xref: /illumos-gate/usr/src/uts/common/sys/overlay.h (revision b93865c3d90e9b0d73e338c9abb3293c35c571a8)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2015, Joyent, Inc.
14  */
15 
16 #ifndef _SYS_OVERLAY_H
17 #define	_SYS_OVERLAY_H
18 
19 /*
20  * Overlay device support
21  */
22 
23 #include <sys/param.h>
24 #include <sys/dld_ioc.h>
25 #include <sys/mac.h>
26 #include <sys/overlay_common.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #define	OVERLAY_IOC_CREATE	OVERLAYIOC(1)
33 #define	OVERLAY_IOC_DELETE	OVERLAYIOC(2)
34 #define	OVERLAY_IOC_PROPINFO	OVERLAYIOC(3)
35 #define	OVERLAY_IOC_GETPROP	OVERLAYIOC(4)
36 #define	OVERLAY_IOC_SETPROP	OVERLAYIOC(5)
37 #define	OVERLAY_IOC_NPROPS	OVERLAYIOC(6)
38 #define	OVERLAY_IOC_ACTIVATE	OVERLAYIOC(7)
39 #define	OVERLAY_IOC_STATUS	OVERLAYIOC(8)
40 
41 typedef struct overlay_ioc_create {
42 	datalink_id_t	oic_linkid;
43 	uint32_t	oic_filler;
44 	uint64_t	oic_vnetid;
45 	char		oic_encap[MAXLINKNAMELEN];
46 } overlay_ioc_create_t;
47 
48 typedef struct overlay_ioc_activate {
49 	datalink_id_t	oia_linkid;
50 } overlay_ioc_activate_t;
51 
52 typedef struct overlay_ioc_delete {
53 	datalink_id_t	oid_linkid;
54 } overlay_ioc_delete_t;
55 
56 typedef struct overlay_ioc_nprops {
57 	datalink_id_t	oipn_linkid;
58 	int32_t		oipn_nprops;
59 } overlay_ioc_nprops_t;
60 
61 typedef struct overlay_ioc_propinfo {
62 	datalink_id_t	oipi_linkid;
63 	int32_t		oipi_id;
64 	char		oipi_name[OVERLAY_PROP_NAMELEN];
65 	uint_t		oipi_type;
66 	uint_t		oipi_prot;
67 	uint8_t		oipi_default[OVERLAY_PROP_SIZEMAX];
68 	uint32_t	oipi_defsize;
69 	uint32_t	oipi_posssize;
70 	uint8_t		oipi_poss[OVERLAY_PROP_SIZEMAX];
71 } overlay_ioc_propinfo_t;
72 
73 typedef struct overlay_ioc_prop {
74 	datalink_id_t	oip_linkid;
75 	int32_t		oip_id;
76 	char		oip_name[OVERLAY_PROP_NAMELEN];
77 	uint8_t		oip_value[OVERLAY_PROP_SIZEMAX];
78 	uint32_t	oip_size;
79 } overlay_ioc_prop_t;
80 
81 typedef enum overlay_status {
82 	OVERLAY_I_OK		= 0x00,
83 	OVERLAY_I_DEGRADED	= 0x01
84 } overlay_status_t;
85 
86 typedef struct overlay_ioc_status {
87 	datalink_id_t	ois_linkid;
88 	uint_t		ois_status;
89 	char		ois_message[OVERLAY_STATUS_BUFLEN];
90 } overlay_ioc_status_t;
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif /* _SYS_OVERLAY_H */
97