Print this page
3942 inject sanity into ipadm tcp buffer size properties
3943 _snd_lowat_fraction tcp tunable has no effect
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Peng Dai <peng.dai@delphix.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libipadm/common/libipadm_impl.h
+++ new/usr/src/lib/libipadm/common/libipadm_impl.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) 2010, Oracle and/or its affiliates. All rights reserved.
23 + * Copyright (c) 2013 by Delphix. All rights reserved.
23 24 */
24 25
25 26 #ifndef _LIBIPADM_IMPL_H
26 27 #define _LIBIPADM_IMPL_H
27 28
28 29 #ifdef __cplusplus
29 30 extern "C" {
30 31 #endif
31 32
32 33 #include <sys/socket.h>
33 34 #include <net/if.h>
34 35 #include <libipadm.h>
35 36 #include <libdladm.h>
36 37 #include <ipadm_ipmgmt.h>
37 38 #include <inet/tunables.h>
38 39 #include <netinet/in.h>
39 40 #include <pthread.h>
40 41 #include <libinetutil.h>
41 42 #include <libsocket_priv.h>
42 43
43 44 #define IPADM_STRSIZE 256
44 45 #define IPADM_ONSTR "on"
45 46 #define IPADM_OFFSTR "off"
46 47 #define ARP_MOD_NAME "arp"
47 48 #define IPADM_LOGICAL_SEP ':'
48 49 #define IPV6_MIN_MTU 1280 /* rfc2460 */
49 50
50 51 /* mask for flags accepted by libipadm functions */
51 52 #define IPADM_COMMON_OPT_MASK (IPADM_OPT_ACTIVE | IPADM_OPT_PERSIST)
52 53
53 54 /* Opaque library handle */
54 55 struct ipadm_handle {
55 56 int iph_sock; /* socket to interface */
56 57 int iph_sock6; /* socket to interface */
57 58 int iph_door_fd; /* door descriptor to ipmgmtd */
58 59 int iph_rtsock; /* routing socket */
59 60 dladm_handle_t iph_dlh; /* handle to libdladm library */
60 61 uint32_t iph_flags; /* internal flags */
61 62 pthread_mutex_t iph_lock; /* lock to set door_fd */
62 63 zoneid_t iph_zoneid; /* zoneid where handle was opened */
63 64 };
64 65
65 66 struct ipadm_addrobj_s {
66 67 char ipadm_ifname[LIFNAMSIZ];
67 68 int32_t ipadm_lifnum;
68 69 char ipadm_aobjname[IPADM_AOBJSIZ];
69 70 ipadm_addr_type_t ipadm_atype;
70 71 uint32_t ipadm_flags;
71 72 sa_family_t ipadm_af;
72 73 union {
73 74 struct {
74 75 char ipadm_ahname[MAXNAMELEN];
75 76 struct sockaddr_storage ipadm_addr;
76 77 uint32_t ipadm_prefixlen;
77 78 char ipadm_dhname[MAXNAMELEN];
78 79 struct sockaddr_storage ipadm_dstaddr;
79 80 } ipadm_static_addr_s;
80 81 struct {
81 82 struct sockaddr_in6 ipadm_intfid;
82 83 uint32_t ipadm_intfidlen;
83 84 boolean_t ipadm_stateless;
84 85 boolean_t ipadm_stateful;
85 86 } ipadm_ipv6_intfid_s;
86 87 struct {
87 88 boolean_t ipadm_primary;
88 89 int32_t ipadm_wait;
89 90 } ipadm_dhcp_s;
90 91 } ipadm_addr_u;
91 92 };
92 93
93 94 #define ipadm_static_addr ipadm_addr_u.ipadm_static_addr_s.ipadm_addr
94 95 #define ipadm_static_aname ipadm_addr_u.ipadm_static_addr_s.ipadm_ahname
95 96 #define ipadm_static_prefixlen ipadm_addr_u.ipadm_static_addr_s.ipadm_prefixlen
96 97 #define ipadm_static_dst_addr ipadm_addr_u.ipadm_static_addr_s.ipadm_dstaddr
97 98 #define ipadm_static_dname ipadm_addr_u.ipadm_static_addr_s.ipadm_dhname
98 99 #define ipadm_intfid ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_intfid
99 100 #define ipadm_intfidlen ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_intfidlen
100 101 #define ipadm_stateless ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_stateless
101 102 #define ipadm_stateful ipadm_addr_u.ipadm_ipv6_intfid_s.ipadm_stateful
102 103 #define ipadm_primary ipadm_addr_u.ipadm_dhcp_s.ipadm_primary
103 104 #define ipadm_wait ipadm_addr_u.ipadm_dhcp_s.ipadm_wait
104 105
105 106 /*
106 107 * Data structures and callback functions related to property management
107 108 */
108 109 struct ipadm_prop_desc;
109 110 typedef struct ipadm_prop_desc ipadm_prop_desc_t;
110 111
↓ open down ↓ |
78 lines elided |
↑ open up ↑ |
111 112 /* property set() callback */
112 113 typedef ipadm_status_t ipadm_pd_setf_t(ipadm_handle_t, const void *,
113 114 ipadm_prop_desc_t *, const void *, uint_t, uint_t);
114 115
115 116 /* property get() callback */
116 117 typedef ipadm_status_t ipadm_pd_getf_t(ipadm_handle_t, const void *,
117 118 ipadm_prop_desc_t *, char *, uint_t *, uint_t, uint_t);
118 119
119 120 struct ipadm_prop_desc {
120 121 char *ipd_name; /* property name */
121 - uint_t ipd_class; /* prop. class - global/perif/both */
122 + char *ipd_old_name; /* for backward compatibility */
123 + uint_t ipd_class; /* prop. class - global/perif/both */
122 124 uint_t ipd_proto; /* protocol to which property belongs */
123 125 uint_t ipd_flags; /* see below */
124 126 ipadm_pd_setf_t *ipd_set; /* set callback function */
125 127 ipadm_pd_getf_t *ipd_get_range; /* get range callback function */
126 128 ipadm_pd_getf_t *ipd_get; /* get value callback function */
127 129 };
128 130
129 131 /* ipd_flags values */
130 132 #define IPADMPROP_MULVAL 0x00000001 /* property multi-valued */
131 133
132 134 extern ipadm_prop_desc_t ipadm_addrprop_table[];
133 135 extern ipadm_pd_getf_t i_ipadm_get_onoff;
134 136
135 137 /* libipadm.c */
136 138 extern ipadm_status_t i_ipadm_get_flags(ipadm_handle_t, const char *,
137 139 sa_family_t, uint64_t *);
138 140 extern ipadm_status_t i_ipadm_set_flags(ipadm_handle_t, const char *,
139 141 sa_family_t, uint64_t, uint64_t);
140 142 extern ipadm_status_t i_ipadm_init_ifs(ipadm_handle_t, const char *,
141 143 nvlist_t **);
142 144 extern ipadm_status_t i_ipadm_init_ifobj(ipadm_handle_t, const char *,
143 145 nvlist_t *);
144 146 extern ipadm_status_t i_ipadm_init_addrobj(ipadm_handle_t, nvlist_t *);
145 147 extern ipadm_status_t i_ipadm_addr_persist(ipadm_handle_t,
146 148 const ipadm_addrobj_t, boolean_t, uint32_t);
147 149 extern ipadm_status_t i_ipadm_delete_addr(ipadm_handle_t, ipadm_addrobj_t);
148 150 extern int i_ipadm_strioctl(int, int, char *, int);
149 151 extern boolean_t i_ipadm_is_loopback(const char *);
150 152 extern boolean_t i_ipadm_is_vni(const char *);
151 153 extern boolean_t i_ipadm_is_ipmp(ipadm_handle_t, const char *);
152 154 extern boolean_t i_ipadm_is_under_ipmp(ipadm_handle_t, const char *);
153 155 extern boolean_t i_ipadm_is_6to4(ipadm_handle_t, char *);
154 156 extern boolean_t i_ipadm_validate_ifname(ipadm_handle_t, const char *);
155 157 extern ipadm_status_t ipadm_errno2status(int);
156 158 extern int ipadm_door_call(ipadm_handle_t, void *, size_t, void **,
157 159 size_t, boolean_t);
158 160 extern boolean_t ipadm_if_enabled(ipadm_handle_t, const char *,
159 161 sa_family_t);
160 162
161 163 /* ipadm_ndpd.c */
162 164 extern ipadm_status_t i_ipadm_create_ipv6addrs(ipadm_handle_t,
163 165 ipadm_addrobj_t, uint32_t);
164 166 extern ipadm_status_t i_ipadm_delete_ipv6addrs(ipadm_handle_t,
165 167 ipadm_addrobj_t);
166 168 extern ipadm_status_t i_ipadm_disable_autoconf(const char *);
167 169 extern ipadm_status_t i_ipadm_enable_autoconf(const char *);
168 170
169 171 /* ipadm_persist.c */
170 172 extern ipadm_status_t i_ipadm_add_ipaddr2nvl(nvlist_t *, ipadm_addrobj_t);
171 173 extern ipadm_status_t i_ipadm_add_ip6addr2nvl(nvlist_t *, ipadm_addrobj_t);
172 174 extern ipadm_status_t i_ipadm_add_intfid2nvl(nvlist_t *, ipadm_addrobj_t);
173 175 extern ipadm_status_t i_ipadm_add_dhcp2nvl(nvlist_t *, boolean_t, int32_t);
174 176
175 177 /* ipadm_prop.c */
176 178 extern ipadm_status_t i_ipadm_persist_propval(ipadm_handle_t,
177 179 ipadm_prop_desc_t *, const char *, const void *,
178 180 uint_t);
179 181 extern ipadm_status_t i_ipadm_get_persist_propval(ipadm_handle_t,
180 182 ipadm_prop_desc_t *, char *, uint_t *,
181 183 const void *);
182 184
183 185 /* ipadm_addr.c */
184 186 extern void i_ipadm_init_addr(ipadm_addrobj_t, const char *,
185 187 const char *, ipadm_addr_type_t);
186 188 extern ipadm_status_t i_ipadm_merge_prefixlen_from_nvl(nvlist_t *, nvlist_t *,
187 189 const char *);
188 190 extern ipadm_status_t i_ipadm_get_addrobj(ipadm_handle_t, ipadm_addrobj_t);
189 191 extern ipadm_status_t i_ipadm_enable_static(ipadm_handle_t, const char *,
190 192 nvlist_t *, sa_family_t);
191 193 extern ipadm_status_t i_ipadm_enable_dhcp(ipadm_handle_t, const char *,
192 194 nvlist_t *);
193 195 extern ipadm_status_t i_ipadm_enable_addrconf(ipadm_handle_t, const char *,
194 196 nvlist_t *);
195 197 extern void i_ipadm_addrobj2lifname(ipadm_addrobj_t, char *, int);
196 198 extern ipadm_status_t i_ipadm_nvl2in6_addr(nvlist_t *, char *,
197 199 in6_addr_t *);
198 200 extern ipadm_status_t i_ipadm_get_lif2addrobj(ipadm_handle_t,
199 201 ipadm_addrobj_t);
200 202 extern ipadm_status_t i_ipadm_lookupadd_addrobj(ipadm_handle_t,
201 203 ipadm_addrobj_t);
202 204 extern ipadm_status_t i_ipadm_setlifnum_addrobj(ipadm_handle_t,
203 205 ipadm_addrobj_t);
204 206 extern ipadm_status_t i_ipadm_do_addif(ipadm_handle_t, ipadm_addrobj_t);
205 207 extern ipadm_status_t i_ipadm_delete_addrobj(ipadm_handle_t,
206 208 const ipadm_addrobj_t, uint32_t);
207 209 extern boolean_t i_ipadm_name2atype(const char *, sa_family_t *,
208 210 ipadm_addr_type_t *);
209 211 extern ipadm_status_t i_ipadm_resolve_addr(const char *, sa_family_t,
210 212 struct sockaddr_storage *);
211 213
212 214 /* ipadm_if.c */
213 215 extern ipadm_status_t i_ipadm_create_if(ipadm_handle_t, char *, sa_family_t,
214 216 uint32_t);
215 217 extern ipadm_status_t i_ipadm_delete_if(ipadm_handle_t, const char *,
216 218 sa_family_t, uint32_t);
217 219 extern ipadm_status_t i_ipadm_plumb_if(ipadm_handle_t, char *, sa_family_t,
218 220 uint32_t);
219 221 extern ipadm_status_t i_ipadm_unplumb_if(ipadm_handle_t, const char *,
220 222 sa_family_t);
221 223 extern ipadm_status_t i_ipadm_if_pexists(ipadm_handle_t, const char *,
222 224 sa_family_t, boolean_t *);
223 225 extern ipadm_status_t i_ipadm_delete_ifobj(ipadm_handle_t, const char *,
224 226 sa_family_t, boolean_t);
225 227 extern int i_ipadm_get_lnum(const char *);
226 228
227 229 #ifdef __cplusplus
228 230 }
229 231 #endif
230 232
231 233 #endif /* _LIBIPADM_IMPL_H */
↓ open down ↓ |
100 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX