3 *
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.
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) 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24
25 #ifndef _LIBIPADM_IMPL_H
26 #define _LIBIPADM_IMPL_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <sys/socket.h>
33 #include <net/if.h>
34 #include <libipadm.h>
35 #include <libdladm.h>
36 #include <ipadm_ipmgmt.h>
37 #include <inet/tunables.h>
38 #include <netinet/in.h>
39 #include <pthread.h>
40 #include <libinetutil.h>
41 #include <libsocket_priv.h>
42
101 #define ipadm_stateful ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_stateful
102 #define ipadm_primary ipadm_addr_u.ipadm_dhcp_s.ipadm_primary
103 #define ipadm_wait ipadm_addr_u.ipadm_dhcp_s.ipadm_wait
104
105 /*
106 * Data structures and callback functions related to property management
107 */
108 struct ipadm_prop_desc;
109 typedef struct ipadm_prop_desc ipadm_prop_desc_t;
110
111 /* property set() callback */
112 typedef ipadm_status_t ipadm_pd_setf_t(ipadm_handle_t, const void *,
113 ipadm_prop_desc_t *, const void *, uint_t, uint_t);
114
115 /* property get() callback */
116 typedef ipadm_status_t ipadm_pd_getf_t(ipadm_handle_t, const void *,
117 ipadm_prop_desc_t *, char *, uint_t *, uint_t, uint_t);
118
119 struct ipadm_prop_desc {
120 char *ipd_name; /* property name */
121 uint_t ipd_class; /* prop. class - global/perif/both */
122 uint_t ipd_proto; /* protocol to which property belongs */
123 uint_t ipd_flags; /* see below */
124 ipadm_pd_setf_t *ipd_set; /* set callback function */
125 ipadm_pd_getf_t *ipd_get_range; /* get range callback function */
126 ipadm_pd_getf_t *ipd_get; /* get value callback function */
127 };
128
129 /* ipd_flags values */
130 #define IPADMPROP_MULVAL 0x00000001 /* property multi-valued */
131
132 extern ipadm_prop_desc_t ipadm_addrprop_table[];
133 extern ipadm_pd_getf_t i_ipadm_get_onoff;
134
135 /* libipadm.c */
136 extern ipadm_status_t i_ipadm_get_flags(ipadm_handle_t, const char *,
137 sa_family_t, uint64_t *);
138 extern ipadm_status_t i_ipadm_set_flags(ipadm_handle_t, const char *,
139 sa_family_t, uint64_t, uint64_t);
140 extern ipadm_status_t i_ipadm_init_ifs(ipadm_handle_t, const char *,
|
3 *
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.
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) 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 */
25
26 #ifndef _LIBIPADM_IMPL_H
27 #define _LIBIPADM_IMPL_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #include <sys/socket.h>
34 #include <net/if.h>
35 #include <libipadm.h>
36 #include <libdladm.h>
37 #include <ipadm_ipmgmt.h>
38 #include <inet/tunables.h>
39 #include <netinet/in.h>
40 #include <pthread.h>
41 #include <libinetutil.h>
42 #include <libsocket_priv.h>
43
102 #define ipadm_stateful ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_stateful
103 #define ipadm_primary ipadm_addr_u.ipadm_dhcp_s.ipadm_primary
104 #define ipadm_wait ipadm_addr_u.ipadm_dhcp_s.ipadm_wait
105
106 /*
107 * Data structures and callback functions related to property management
108 */
109 struct ipadm_prop_desc;
110 typedef struct ipadm_prop_desc ipadm_prop_desc_t;
111
112 /* property set() callback */
113 typedef ipadm_status_t ipadm_pd_setf_t(ipadm_handle_t, const void *,
114 ipadm_prop_desc_t *, const void *, uint_t, uint_t);
115
116 /* property get() callback */
117 typedef ipadm_status_t ipadm_pd_getf_t(ipadm_handle_t, const void *,
118 ipadm_prop_desc_t *, char *, uint_t *, uint_t, uint_t);
119
120 struct ipadm_prop_desc {
121 char *ipd_name; /* property name */
122 char *ipd_old_name; /* for backward compatibility */
123 uint_t ipd_class; /* prop. class - global/perif/both */
124 uint_t ipd_proto; /* protocol to which property belongs */
125 uint_t ipd_flags; /* see below */
126 ipadm_pd_setf_t *ipd_set; /* set callback function */
127 ipadm_pd_getf_t *ipd_get_range; /* get range callback function */
128 ipadm_pd_getf_t *ipd_get; /* get value callback function */
129 };
130
131 /* ipd_flags values */
132 #define IPADMPROP_MULVAL 0x00000001 /* property multi-valued */
133
134 extern ipadm_prop_desc_t ipadm_addrprop_table[];
135 extern ipadm_pd_getf_t i_ipadm_get_onoff;
136
137 /* libipadm.c */
138 extern ipadm_status_t i_ipadm_get_flags(ipadm_handle_t, const char *,
139 sa_family_t, uint64_t *);
140 extern ipadm_status_t i_ipadm_set_flags(ipadm_handle_t, const char *,
141 sa_family_t, uint64_t, uint64_t);
142 extern ipadm_status_t i_ipadm_init_ifs(ipadm_handle_t, const char *,
|