Print this page
OS-249
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/lib/libdladm/common/libdllink.h
+++ new/usr/src/lib/libdladm/common/libdllink.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
|
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright (c) 2011, Joyent Inc. All rights reserved.
23 24 */
24 25
25 26 #ifndef _LIBDLLINK_H
26 27 #define _LIBDLLINK_H
27 28
28 29 /*
29 30 * This file includes structures, macros and routines used by general
30 31 * link administration (i.e. not limited to one specific type of link).
31 32 */
32 33
33 34 #include <stdio.h>
34 35 #include <sys/types.h>
35 36 #include <sys/param.h>
36 37 #include <sys/mac.h>
37 38 #include <sys/dld.h>
38 39 #include <libdladm.h>
39 40
40 41 #ifdef __cplusplus
41 42 extern "C" {
42 43 #endif
43 44
44 45 typedef struct dladm_attr {
45 46 uint_t da_max_sdu;
46 47 } dladm_attr_t;
47 48
48 49 typedef struct dladm_phys_attr {
49 50 char dp_dev[MAXLINKNAMELEN];
50 51 /*
51 52 * Whether this physical link supports vanity naming (links with media
52 53 * types not supported by GLDv3 don't have vanity naming support).
53 54 */
54 55 boolean_t dp_novanity;
55 56 } dladm_phys_attr_t;
56 57
57 58 typedef enum {
58 59 DLADM_PROP_VAL_CURRENT = 1,
59 60 DLADM_PROP_VAL_DEFAULT,
60 61 DLADM_PROP_VAL_PERM,
61 62 DLADM_PROP_VAL_MODIFIABLE,
62 63 DLADM_PROP_VAL_PERSISTENT
63 64 } dladm_prop_type_t;
64 65
65 66 /*
66 67 * Maximum size of secobj value. Note that it should not be greater than
67 68 * DLD_SECOBJ_VAL_MAX.
68 69 */
69 70 #define DLADM_SECOBJ_VAL_MAX 256
70 71
71 72 /*
72 73 * Maximum size of secobj name. Note that it should not be greater than
73 74 * DLD_SECOBJ_NAME_MAX.
74 75 */
75 76 #define DLADM_SECOBJ_NAME_MAX 32
76 77
77 78 #define DLADM_MAX_PROP_VALCNT 32
78 79 /*
79 80 * Size of prop_val buffer passed to pd_get function must be at
80 81 * least DLADM_PROP_VAL_MAX
81 82 */
82 83 #define DLADM_PROP_VAL_MAX 128
83 84
84 85 #define DLADM_SECOBJ_CLASS_WEP 0
85 86 #define DLADM_SECOBJ_CLASS_WPA 1
86 87 typedef int dladm_secobj_class_t;
87 88
88 89 typedef int (dladm_walkcb_t)(const char *, void *);
89 90
90 91 /* possible flags for ma_flags below */
91 92 #define DLADM_MACADDR_USED 0x1
92 93
93 94 typedef enum {
94 95 DLADM_HWGRP_TYPE_RX = 0x1,
95 96 DLADM_HWGRP_TYPE_TX
96 97 } dladm_hwgrp_type_t;
97 98
98 99 typedef struct dladm_hwgrp_attr {
99 100 char hg_link_name[MAXLINKNAMELEN];
100 101 uint_t hg_grp_num;
101 102 dladm_hwgrp_type_t hg_grp_type;
102 103 uint_t hg_n_rings;
103 104 uint_t hg_rings[MAX_RINGS_PER_GROUP];
104 105 uint_t hg_n_clnts;
105 106 char hg_client_names[MAXCLIENTNAMELEN];
106 107 } dladm_hwgrp_attr_t;
107 108
108 109 typedef struct dladm_macaddr_attr {
109 110 uint_t ma_slot;
110 111 uint_t ma_flags;
111 112 uchar_t ma_addr[MAXMACADDRLEN];
112 113 uint_t ma_addrlen;
113 114 char ma_client_name[MAXNAMELEN];
|
↓ open down ↓ |
81 lines elided |
↑ open up ↑ |
114 115 datalink_id_t ma_client_linkid;
115 116 } dladm_macaddr_attr_t;
116 117
117 118 extern dladm_status_t dladm_walk(dladm_walkcb_t *, dladm_handle_t, void *,
118 119 datalink_class_t, datalink_media_t, uint32_t);
119 120 extern dladm_status_t dladm_mac_walk(dladm_walkcb_t *, void *);
120 121 extern dladm_status_t dladm_info(dladm_handle_t, datalink_id_t,
121 122 dladm_attr_t *);
122 123
123 124 extern dladm_status_t dladm_rename_link(dladm_handle_t, const char *,
124 - const char *);
125 + const char *, const char *);
125 126
126 127 extern dladm_status_t dladm_set_linkprop(dladm_handle_t, datalink_id_t,
127 128 const char *, char **, uint_t, uint_t);
128 129 extern dladm_status_t dladm_get_linkprop(dladm_handle_t, datalink_id_t,
129 130 dladm_prop_type_t, const char *, char **, uint_t *);
130 131 extern dladm_status_t dladm_get_linkprop_values(dladm_handle_t, datalink_id_t,
131 132 dladm_prop_type_t, const char *, uint_t *,
132 133 uint_t *);
133 134 extern dladm_status_t dladm_walk_linkprop(dladm_handle_t, datalink_id_t,
134 135 void *, int (*)(dladm_handle_t, datalink_id_t,
135 136 const char *, void *));
136 137 extern boolean_t dladm_attr_is_linkprop(const char *name);
137 138 extern dladm_status_t dladm_linkprop_is_set(dladm_handle_t, datalink_id_t,
138 139 dladm_prop_type_t, const char *, boolean_t *);
139 140
140 141 extern dladm_status_t dladm_set_secobj(dladm_handle_t, const char *,
141 142 dladm_secobj_class_t, uint8_t *, uint_t, uint_t);
142 143 extern dladm_status_t dladm_get_secobj(dladm_handle_t, const char *,
143 144 dladm_secobj_class_t *, uint8_t *, uint_t *,
144 145 uint_t);
145 146 extern dladm_status_t dladm_unset_secobj(dladm_handle_t, const char *,
146 147 uint_t);
147 148 extern dladm_status_t dladm_walk_secobj(dladm_handle_t, void *,
148 149 boolean_t (*)(dladm_handle_t, void *, const char *),
149 150 uint_t);
150 151
151 152 extern const char *dladm_linkstate2str(link_state_t, char *);
152 153 extern const char *dladm_linkduplex2str(link_duplex_t, char *);
153 154 extern const char *dladm_secobjclass2str(dladm_secobj_class_t, char *);
154 155 extern dladm_status_t dladm_str2secobjclass(const char *,
155 156 dladm_secobj_class_t *);
156 157
157 158 extern dladm_status_t dladm_init_linkprop(dladm_handle_t, datalink_id_t,
158 159 boolean_t);
159 160 extern dladm_status_t dladm_init_secobj(dladm_handle_t);
160 161 extern boolean_t dladm_valid_secobj_name(const char *);
161 162
162 163 extern dladm_status_t dladm_create_datalink_id(dladm_handle_t, const char *,
|
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
163 164 datalink_class_t, uint_t, uint32_t,
164 165 datalink_id_t *);
165 166 extern dladm_status_t dladm_destroy_datalink_id(dladm_handle_t, datalink_id_t,
166 167 uint32_t);
167 168 extern dladm_status_t dladm_remap_datalink_id(dladm_handle_t, datalink_id_t,
168 169 const char *);
169 170 extern dladm_status_t dladm_up_datalink_id(dladm_handle_t, datalink_id_t);
170 171 extern dladm_status_t dladm_name2info(dladm_handle_t, const char *,
171 172 datalink_id_t *, uint32_t *, datalink_class_t *,
172 173 uint32_t *);
174 +extern dladm_status_t dladm_zname2info(dladm_handle_t, const char *,
175 + const char *, datalink_id_t *, uint32_t *,
176 + datalink_class_t *, uint32_t *);
173 177 extern dladm_status_t dladm_datalink_id2info(dladm_handle_t, datalink_id_t,
174 178 uint32_t *, datalink_class_t *, uint32_t *, char *,
175 179 size_t);
176 180 extern dladm_status_t dladm_walk_datalink_id(int (*)(dladm_handle_t,
177 181 datalink_id_t, void *), dladm_handle_t, void *,
178 182 datalink_class_t, datalink_media_t, uint32_t);
179 183 extern dladm_status_t dladm_create_conf(dladm_handle_t, const char *,
180 184 datalink_id_t, datalink_class_t, uint32_t,
181 185 dladm_conf_t *);
182 186 extern dladm_status_t dladm_open_conf(dladm_handle_t, datalink_id_t,
183 187 dladm_conf_t *);
184 188 extern dladm_status_t dladm_getsnap_conf(dladm_handle_t, datalink_id_t,
185 189 dladm_conf_t *);
186 190 extern dladm_status_t dladm_write_conf(dladm_handle_t, dladm_conf_t);
187 191 extern dladm_status_t dladm_remove_conf(dladm_handle_t, datalink_id_t);
188 192 extern void dladm_destroy_conf(dladm_handle_t, dladm_conf_t);
189 193 extern dladm_status_t dladm_get_conf_field(dladm_handle_t, dladm_conf_t,
190 194 const char *, void *, size_t);
191 195 extern dladm_status_t dladm_getnext_conf_linkprop(dladm_handle_t,
192 196 dladm_conf_t, const char *, char *, void *,
193 197 size_t, size_t *);
194 198 extern dladm_status_t dladm_set_conf_field(dladm_handle_t, dladm_conf_t,
195 199 const char *, dladm_datatype_t, const void *);
196 200 extern dladm_status_t dladm_unset_conf_field(dladm_handle_t, dladm_conf_t,
197 201 const char *);
198 202
199 203 extern dladm_status_t dladm_dev2linkid(dladm_handle_t, const char *,
200 204 datalink_id_t *);
201 205 extern dladm_status_t dladm_linkid2legacyname(dladm_handle_t, datalink_id_t,
202 206 char *, size_t);
203 207 extern dladm_status_t dladm_phys_delete(dladm_handle_t, datalink_id_t);
204 208
205 209 extern dladm_status_t dladm_phys_info(dladm_handle_t, datalink_id_t,
206 210 dladm_phys_attr_t *, uint32_t);
207 211 extern dladm_status_t dladm_parselink(const char *, char *, uint_t *);
208 212
209 213 extern int dladm_walk_macaddr(dladm_handle_t, datalink_id_t,
210 214 void *,
211 215 boolean_t (*)(void *, dladm_macaddr_attr_t *));
212 216 extern int dladm_walk_hwgrp(dladm_handle_t, datalink_id_t, void *,
213 217 boolean_t (*)(void *, dladm_hwgrp_attr_t *));
214 218
215 219 extern void dladm_sort_index_list(uint_t [], uint_t);
216 220
217 221 extern dladm_status_t dladm_link_get_proplist(dladm_handle_t, datalink_id_t,
218 222 dladm_arg_list_t **);
219 223
220 224 extern dladm_status_t i_dladm_set_link_proplist_db(char *,
221 225 dladm_arg_list_t *);
222 226
223 227 #ifdef __cplusplus
224 228 }
225 229 #endif
226 230
227 231 #endif /* _LIBDLLINK_H */
|
↓ open down ↓ |
45 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX