import less(1)
[unleashed/tickless.git] / usr / src / lib / libdladm / common / libdlmgmt.h
blob2e208209e8e9fae243c03e81ce175bc5f26df993
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
26 * This file includes structures, macros used to communicate with linkmgmt
27 * daemon.
30 #ifndef _LIBDLMGMT_H
31 #define _LIBDLMGMT_H
33 #include <sys/types.h>
34 #include <libdladm.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
41 * datalink management related macros, structures.
45 * Door call commands.
47 #define DLMGMT_CMD_CREATE_LINKID (DLMGMT_CMD_BASE + 0)
48 #define DLMGMT_CMD_DESTROY_LINKID (DLMGMT_CMD_BASE + 1)
49 #define DLMGMT_CMD_REMAP_LINKID (DLMGMT_CMD_BASE + 2)
50 #define DLMGMT_CMD_CREATECONF (DLMGMT_CMD_BASE + 3)
51 #define DLMGMT_CMD_OPENCONF (DLMGMT_CMD_BASE + 4)
52 #define DLMGMT_CMD_WRITECONF (DLMGMT_CMD_BASE + 5)
53 #define DLMGMT_CMD_UP_LINKID (DLMGMT_CMD_BASE + 6)
54 #define DLMGMT_CMD_SETATTR (DLMGMT_CMD_BASE + 7)
55 #define DLMGMT_CMD_UNSETATTR (DLMGMT_CMD_BASE + 8)
56 #define DLMGMT_CMD_REMOVECONF (DLMGMT_CMD_BASE + 9)
57 #define DLMGMT_CMD_DESTROYCONF (DLMGMT_CMD_BASE + 10)
58 #define DLMGMT_CMD_GETATTR (DLMGMT_CMD_BASE + 11)
59 #define DLMGMT_CMD_GETCONFSNAPSHOT (DLMGMT_CMD_BASE + 12)
60 #define DLMGMT_CMD_ZONEBOOT (DLMGMT_CMD_BASE + 13)
61 #define DLMGMT_CMD_ZONEHALT (DLMGMT_CMD_BASE + 14)
63 typedef struct dlmgmt_door_createid_s {
64 int ld_cmd;
65 char ld_link[MAXLINKNAMELEN];
66 datalink_class_t ld_class;
67 uint32_t ld_media;
68 boolean_t ld_prefix;
69 uint32_t ld_flags;
70 } dlmgmt_door_createid_t;
72 typedef struct dlmgmt_door_destroyid_s {
73 int ld_cmd;
74 datalink_id_t ld_linkid;
75 uint32_t ld_flags;
76 } dlmgmt_door_destroyid_t;
78 typedef struct dlmgmt_door_remapid_s {
79 int ld_cmd;
80 datalink_id_t ld_linkid;
81 char ld_link[MAXLINKNAMELEN];
82 } dlmgmt_door_remapid_t;
84 typedef struct dlmgmt_door_upid_s {
85 int ld_cmd;
86 datalink_id_t ld_linkid;
87 } dlmgmt_door_upid_t;
89 typedef struct dlmgmt_door_createconf_s {
90 int ld_cmd;
91 char ld_link[MAXLINKNAMELEN];
92 datalink_id_t ld_linkid;
93 datalink_class_t ld_class;
94 uint32_t ld_media;
95 } dlmgmt_door_createconf_t;
97 typedef struct dlmgmt_door_setattr_s {
98 int ld_cmd;
99 int ld_confid;
100 char ld_attr[MAXLINKATTRLEN];
101 size_t ld_attrsz;
102 dladm_datatype_t ld_type;
103 char ld_attrval[MAXLINKATTRVALLEN];
104 } dlmgmt_door_setattr_t;
106 typedef struct dlmgmt_door_unsetattr_s {
107 int ld_cmd;
108 int ld_confid;
109 char ld_attr[MAXLINKATTRLEN];
110 } dlmgmt_door_unsetattr_t;
112 typedef struct dlmgmt_door_writeconf_s {
113 int ld_cmd;
114 int ld_confid;
115 } dlmgmt_door_writeconf_t;
117 typedef struct dlmgmt_door_removeconf_s {
118 int ld_cmd;
119 datalink_id_t ld_linkid;
120 } dlmgmt_door_removeconf_t;
122 typedef struct dlmgmt_door_destroyconf_s {
123 int ld_cmd;
124 int ld_confid;
125 } dlmgmt_door_destroyconf_t;
127 typedef struct dlmgmt_door_openconf_s {
128 int ld_cmd;
129 datalink_id_t ld_linkid;
130 } dlmgmt_door_openconf_t;
132 typedef struct dlmgmt_door_getconfsnapshot_s {
133 int ld_cmd;
134 datalink_id_t ld_linkid;
135 } dlmgmt_door_getconfsnapshot_t;
137 typedef struct dlmgmt_door_getattr_s {
138 int ld_cmd;
139 int ld_confid;
140 char ld_attr[MAXLINKATTRLEN];
141 } dlmgmt_door_getattr_t;
143 typedef struct dlmgmt_createconf_retval_s {
144 uint_t lr_err;
145 int lr_confid;
146 } dlmgmt_createconf_retval_t;
148 typedef struct dlmgmt_openconf_retval_s {
149 uint_t lr_err;
150 int lr_confid;
151 } dlmgmt_openconf_retval_t;
153 typedef struct dlmgmt_getconfsnapshot_retval_s {
154 uint_t lr_err;
155 size_t lr_nvlsz;
156 /* buffer for nvl */
157 } dlmgmt_getconfsnapshot_retval_t;
159 typedef struct dlmgmt_door_zone_s {
160 int ld_cmd;
161 zoneid_t ld_zoneid;
162 } dlmgmt_door_zoneboot_t, dlmgmt_door_zonehalt_t;
164 typedef struct dlmgmt_retval_s dlmgmt_remapid_retval_t,
165 dlmgmt_upid_retval_t,
166 dlmgmt_destroyid_retval_t,
167 dlmgmt_setattr_retval_t,
168 dlmgmt_unsetattr_retval_t,
169 dlmgmt_writeconf_retval_t,
170 dlmgmt_removeconf_retval_t,
171 dlmgmt_destroyconf_retval_t,
172 dlmgmt_zoneboot_retval_t,
173 dlmgmt_zonehalt_retval_t;
175 typedef struct dlmgmt_linkid_retval_s dlmgmt_createid_retval_t;
177 #ifdef __cplusplus
179 #endif
181 #endif /* _LIBDLMGMT_H */