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 /*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 */
26
27 /*
28 * Functions to maintain a table of datalink configuration information.
29 */
30
31 #ifndef _DLMGMT_IMPL_H
32 #define _DLMGMT_IMPL_H
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <door.h>
39 #include <libdllink.h>
40 #include <sys/avl.h>
41
42 /*
43 * datalink attribute structure
44 */
53 } dlmgmt_linkattr_t;
54
55 /*
56 * datalink structure
57 */
58 typedef struct dlmgmt_link_s {
59 dlmgmt_linkattr_t *ll_head;
60 char ll_link[MAXLINKNAMELEN];
61 datalink_class_t ll_class;
62 uint32_t ll_media;
63 datalink_id_t ll_linkid;
64
65 /*
66 * The zone that owns the link. If this is set to the id of
67 * an NGZ and ll_onloan is set then the link was created and
68 * is owned by the GZ but is currently being loaned out to an
69 * NGZ. E.g., when the GZ admin creates a VNIC for exclusive
70 * use by an NGZ. If ll_onloan is set then ll_zoneid cannot be 0.
71 *
72 * If ll_zoneid is set to the id of an NGZ but ll_onloan is
73 * not set then the link was created and is owned by the NGZ.
74 */
75 zoneid_t ll_zoneid;
76 boolean_t ll_onloan;
77 avl_node_t ll_name_node;
78 avl_node_t ll_id_node;
79 uint32_t ll_flags;
80 uint32_t ll_gen; /* generation number */
81 boolean_t ll_trans; /* transient link */
82 } dlmgmt_link_t;
83
84 /*
85 * datalink configuration request structure
86 */
87 typedef struct dlmgmt_dlconf_s {
88 dlmgmt_linkattr_t *ld_head;
89 char ld_link[MAXLINKNAMELEN];
90 datalink_id_t ld_linkid;
91 datalink_class_t ld_class;
92 uint32_t ld_media;
93 int ld_id;
94 zoneid_t ld_zoneid;
95 uint32_t ld_gen;
96 avl_node_t ld_node;
97 } dlmgmt_dlconf_t;
98
99 extern boolean_t debug;
100 extern const char *progname;
101 extern char cachefile[];
|
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 /*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright 2017 Joyent, Inc.
25 * Copyright 2023 Oxide Computer Company
26 */
27
28 /*
29 * Functions to maintain a table of datalink configuration information.
30 */
31
32 #ifndef _DLMGMT_IMPL_H
33 #define _DLMGMT_IMPL_H
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #include <door.h>
40 #include <libdllink.h>
41 #include <sys/avl.h>
42
43 /*
44 * datalink attribute structure
45 */
54 } dlmgmt_linkattr_t;
55
56 /*
57 * datalink structure
58 */
59 typedef struct dlmgmt_link_s {
60 dlmgmt_linkattr_t *ll_head;
61 char ll_link[MAXLINKNAMELEN];
62 datalink_class_t ll_class;
63 uint32_t ll_media;
64 datalink_id_t ll_linkid;
65
66 /*
67 * The zone that owns the link. If this is set to the id of
68 * an NGZ and ll_onloan is set then the link was created and
69 * is owned by the GZ but is currently being loaned out to an
70 * NGZ. E.g., when the GZ admin creates a VNIC for exclusive
71 * use by an NGZ. If ll_onloan is set then ll_zoneid cannot be 0.
72 *
73 * If ll_zoneid is set to the id of an NGZ but ll_onloan is
74 * not set then the link was created by, and is owned by, the NGZ.
75 */
76 zoneid_t ll_zoneid;
77 boolean_t ll_onloan;
78 avl_node_t ll_name_node;
79 avl_node_t ll_id_node;
80 uint32_t ll_flags;
81 uint32_t ll_gen; /* generation number */
82 /*
83 * A transient link is one that is created and destroyed along with the
84 * lifetime of a zone. It is a non-persistent link that is owned by the
85 * zone (ll_zoneid is set to the id of the NGZ). It is specifically not
86 * on-loan from the GZ.
87 */
88 boolean_t ll_transient;
89 } dlmgmt_link_t;
90
91 /*
92 * datalink configuration request structure
93 */
94 typedef struct dlmgmt_dlconf_s {
95 dlmgmt_linkattr_t *ld_head;
96 char ld_link[MAXLINKNAMELEN];
97 datalink_id_t ld_linkid;
98 datalink_class_t ld_class;
99 uint32_t ld_media;
100 int ld_id;
101 zoneid_t ld_zoneid;
102 uint32_t ld_gen;
103 avl_node_t ld_node;
104 } dlmgmt_dlconf_t;
105
106 extern boolean_t debug;
107 extern const char *progname;
108 extern char cachefile[];
|