5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _LIBDLADM_H
26 #define _LIBDLADM_H
27
28 #include <sys/dls_mgmt.h>
29 #include <sys/dld.h>
30 #include <sys/dlpi.h>
31 #include <libnvpair.h>
32
33 /*
34 * This file includes structures, macros and common routines shared by all
35 * data-link administration, and routines which do not directly administrate
36 * links. For example, dladm_status2str().
37 */
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #define LINKID_STR_WIDTH 10
44 #define DLADM_STRSIZE 256
45
46 /*
47 * option flags taken by the libdladm functions
48 *
49 * - DLADM_OPT_ACTIVE:
50 * The function requests to bringup some configuration that only take
51 * effect on active system (not persistent).
191 } dladm_conf_t;
192
193 #define ds_confid ds_u.dsu_confid
194 #define ds_nvl ds_u.dsu_nvl
195
196 #define DLADM_INVALID_CONF 0
197
198 /* opaque dladm handle to libdladm functions */
199 struct dladm_handle;
200 typedef struct dladm_handle *dladm_handle_t;
201
202 /* open/close handle */
203 extern dladm_status_t dladm_open(dladm_handle_t *);
204 extern void dladm_close(dladm_handle_t);
205
206 /*
207 * retrieve the dld file descriptor from handle, only libdladm and
208 * dlmgmtd are given access to the door file descriptor.
209 */
210 extern int dladm_dld_fd(dladm_handle_t);
211
212 typedef struct dladm_arg_info {
213 const char *ai_name;
214 char *ai_val[DLADM_MAX_ARG_VALS];
215 uint_t ai_count;
216 } dladm_arg_info_t;
217
218 typedef struct dladm_arg_list {
219 dladm_arg_info_t al_info[DLADM_MAX_ARG_CNT];
220 uint_t al_count;
221 char *al_buf;
222 } dladm_arg_list_t;
223
224 typedef enum {
225 DLADM_LOGTYPE_LINK = 1,
226 DLADM_LOGTYPE_FLOW
227 } dladm_logtype_t;
228
229 typedef struct dladm_usage {
230 char du_name[MAXLINKNAMELEN];
|
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
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.
12 *
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 /*
26 * Copyright 2019 OmniOS Community Edition (OmniOSce) Association
27 */
28
29 #ifndef _LIBDLADM_H
30 #define _LIBDLADM_H
31
32 #include <sys/dls_mgmt.h>
33 #include <sys/dld.h>
34 #include <sys/dlpi.h>
35 #include <libnvpair.h>
36 #include <kstat.h>
37
38 /*
39 * This file includes structures, macros and common routines shared by all
40 * data-link administration, and routines which do not directly administrate
41 * links. For example, dladm_status2str().
42 */
43
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47
48 #define LINKID_STR_WIDTH 10
49 #define DLADM_STRSIZE 256
50
51 /*
52 * option flags taken by the libdladm functions
53 *
54 * - DLADM_OPT_ACTIVE:
55 * The function requests to bringup some configuration that only take
56 * effect on active system (not persistent).
196 } dladm_conf_t;
197
198 #define ds_confid ds_u.dsu_confid
199 #define ds_nvl ds_u.dsu_nvl
200
201 #define DLADM_INVALID_CONF 0
202
203 /* opaque dladm handle to libdladm functions */
204 struct dladm_handle;
205 typedef struct dladm_handle *dladm_handle_t;
206
207 /* open/close handle */
208 extern dladm_status_t dladm_open(dladm_handle_t *);
209 extern void dladm_close(dladm_handle_t);
210
211 /*
212 * retrieve the dld file descriptor from handle, only libdladm and
213 * dlmgmtd are given access to the door file descriptor.
214 */
215 extern int dladm_dld_fd(dladm_handle_t);
216 /*
217 * Retrieve kstat_ctl_t* from handle.The libkstat handle is opened
218 * when the first caller needs it.This allows the library to share
219 * the kstat handle.
220 */
221 extern kstat_ctl_t *dladm_dld_kcp(dladm_handle_t);
222
223 typedef struct dladm_arg_info {
224 const char *ai_name;
225 char *ai_val[DLADM_MAX_ARG_VALS];
226 uint_t ai_count;
227 } dladm_arg_info_t;
228
229 typedef struct dladm_arg_list {
230 dladm_arg_info_t al_info[DLADM_MAX_ARG_CNT];
231 uint_t al_count;
232 char *al_buf;
233 } dladm_arg_list_t;
234
235 typedef enum {
236 DLADM_LOGTYPE_LINK = 1,
237 DLADM_LOGTYPE_FLOW
238 } dladm_logtype_t;
239
240 typedef struct dladm_usage {
241 char du_name[MAXLINKNAMELEN];
|