Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/inet/udp/udp_opt_data.c
+++ new/usr/src/uts/common/inet/udp/udp_opt_data.c
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 *
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 2009 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #include <sys/types.h>
27 27 #include <sys/stream.h>
28 28 #define _SUN_TPI_VERSION 2
29 29 #include <sys/tihdr.h>
30 30 #include <sys/socket.h>
31 31 #include <sys/xti_xtiopt.h>
32 32 #include <sys/xti_inet.h>
33 33
34 34 #include <inet/common.h>
35 35 #include <netinet/ip6.h>
36 36 #include <inet/ip.h>
37 37 #include <inet/udp_impl.h>
38 38 /*
39 39 * MK_XXX Following 2 includes temporary to import ip6_rthdr_t
40 40 * definition. May not be needed if we fix ip6_dg_snd_attrs_t
41 41 * to do all extension headers in identical manner.
42 42 */
43 43 #include <net/if.h>
44 44 #include <inet/ip6.h>
45 45
46 46 #include <netinet/in.h>
47 47 #include <netinet/udp.h>
48 48 #include <inet/optcom.h>
↓ open down ↓ |
48 lines elided |
↑ open up ↑ |
49 49
50 50 /*
51 51 * Table of all known options handled on a UDP protocol stack.
52 52 *
53 53 * Note: This table contains options processed by both UDP and IP levels
54 54 * and is the superset of options that can be performed on a UDP over IP
55 55 * stack.
56 56 */
57 57 opdes_t udp_opt_arr[] = {
58 58
59 -{ SO_DEBUG, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
60 -{ SO_DONTROUTE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
61 -{ SO_USELOOPBACK, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
59 +{ SO_DEBUG, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
60 +{ SO_DONTROUTE, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
61 +{ SO_USELOOPBACK, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
62 62 },
63 -{ SO_BROADCAST, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
64 -{ SO_REUSEADDR, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
65 -{ SO_TYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
66 -{ SO_SNDBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
67 -{ SO_RCVBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
63 +{ SO_BROADCAST, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
64 +{ SO_REUSEADDR, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
65 +{ SO_TYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), {0}},
66 +{ SO_SNDBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
67 +{ SO_RCVBUF, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
68 68 { SO_SNDTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0,
69 - sizeof (struct timeval), 0 },
69 + sizeof (struct timeval), {0}},
70 70 { SO_RCVTIMEO, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0,
71 - sizeof (struct timeval), 0 },
71 + sizeof (struct timeval), {0}},
72 72 { SO_DGRAM_ERRIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
73 - 0 },
74 -{ SO_RECVUCRED, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
73 + {0}},
74 +{ SO_RECVUCRED, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
75 75 },
76 76 { SO_ALLZONES, SOL_SOCKET, OA_R, OA_RW, OP_CONFIG, 0, sizeof (int),
77 - 0 },
78 -{ SO_VRRP, SOL_SOCKET, OA_RW, OA_RW, OP_CONFIG, 0, sizeof (int), 0 },
79 -{ SO_TIMESTAMP, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
77 + {0}},
78 +{ SO_VRRP, SOL_SOCKET, OA_RW, OA_RW, OP_CONFIG, 0, sizeof (int), {0}},
79 +{ SO_TIMESTAMP, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
80 80 },
81 81 { SO_ANON_MLP, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
82 - 0 },
82 + {0}},
83 83 { SO_MAC_EXEMPT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
84 - 0 },
84 + {0}},
85 85 { SO_MAC_IMPLICIT, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
86 - 0 },
86 + {0}},
87 87 /*
88 88 * The maximum size reported here depends on the maximum value for
89 89 * ucredsize; unfortunately, we can't add ucredsize here so we need
90 90 * to estimate here. Before it was 512 or 384 + NGROUPS_UMAX * sizeof (gid_t);
91 91 * as we're changing NGROUPS_UMAX we now codify this here using NGROUPS_UMAX.
92 92 */
93 93 { SCM_UCRED, SOL_SOCKET, OA_W, OA_W, OP_NP, OP_VARLEN|OP_NODEFAULT,
94 - 384 + NGROUPS_UMAX * sizeof (gid_t), 0 },
95 -{ SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
96 -{ SO_DOMAIN, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
97 -{ SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), 0 },
94 + 384 + NGROUPS_UMAX * sizeof (gid_t), {0}},
95 +{ SO_EXCLBIND, SOL_SOCKET, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
96 +{ SO_DOMAIN, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), {0}},
97 +{ SO_PROTOTYPE, SOL_SOCKET, OA_R, OA_R, OP_NP, 0, sizeof (int), {0}},
98 98
99 99 { IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
100 100 (OP_VARLEN|OP_NODEFAULT),
101 - IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
101 + IP_MAX_OPT_LENGTH + IP_ADDR_LEN, {-1} /* not initialized */ },
102 102 { T_IP_OPTIONS, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
103 103 (OP_VARLEN|OP_NODEFAULT),
104 - IP_MAX_OPT_LENGTH + IP_ADDR_LEN, -1 /* not initialized */ },
104 + IP_MAX_OPT_LENGTH + IP_ADDR_LEN, {-1} /* not initialized */ },
105 105
106 -{ IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
107 -{ T_IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
108 -{ IP_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
109 -{ IP_RECVOPTS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
110 -{ IP_RECVDSTADDR, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
106 +{ IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
107 +{ T_IP_TOS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
108 +{ IP_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
109 +{ IP_RECVOPTS, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
110 +{ IP_RECVDSTADDR, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
111 111 },
112 -{ IP_RECVIF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
113 -{ IP_RECVSLLA, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
112 +{ IP_RECVIF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
113 +{ IP_RECVSLLA, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
114 114 { IP_RECVTTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int),
115 - 0 },
115 + {0}},
116 116 { IP_MULTICAST_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0,
117 - sizeof (struct in_addr), 0 /* INADDR_ANY */ },
117 + sizeof (struct in_addr), {0} /* INADDR_ANY */ },
118 118
119 119 { IP_MULTICAST_LOOP, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
120 - sizeof (uchar_t), -1 /* not initialized */},
120 + sizeof (uchar_t), {-1} /* not initialized */},
121 121
122 122 { IP_MULTICAST_TTL, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
123 - sizeof (uchar_t), -1 /* not initialized */ },
123 + sizeof (uchar_t), {-1} /* not initialized */ },
124 124
125 125 { IP_ADD_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
126 - sizeof (struct ip_mreq), -1 /* not initialized */ },
126 + sizeof (struct ip_mreq), {-1} /* not initialized */ },
127 127
128 128 { IP_DROP_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
129 - sizeof (struct ip_mreq), -1 /* not initialized */ },
129 + sizeof (struct ip_mreq), {-1} /* not initialized */ },
130 130
131 131 { IP_BLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
132 - sizeof (struct ip_mreq_source), -1 /* not initialized */ },
132 + sizeof (struct ip_mreq_source), {-1} /* not initialized */ },
133 133
134 134 { IP_UNBLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP, OP_NODEFAULT,
135 - sizeof (struct ip_mreq_source), -1 /* not initialized */ },
135 + sizeof (struct ip_mreq_source), {-1} /* not initialized */ },
136 136
137 137 { IP_ADD_SOURCE_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP,
138 - OP_NODEFAULT, sizeof (struct ip_mreq_source), -1 },
138 + OP_NODEFAULT, sizeof (struct ip_mreq_source), {-1} },
139 139
140 140 { IP_DROP_SOURCE_MEMBERSHIP, IPPROTO_IP, OA_X, OA_X, OP_NP,
141 - OP_NODEFAULT, sizeof (struct ip_mreq_source), -1 },
141 + OP_NODEFAULT, sizeof (struct ip_mreq_source), {-1} },
142 142
143 143 { IP_SEC_OPT, IPPROTO_IP, OA_RW, OA_RW, OP_NP, OP_NODEFAULT,
144 - sizeof (ipsec_req_t), -1 /* not initialized */ },
144 + sizeof (ipsec_req_t), {-1} /* not initialized */ },
145 145
146 146 { IP_BOUND_IF, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0,
147 - sizeof (int), 0 /* no ifindex */ },
147 + sizeof (int), {0} /* no ifindex */ },
148 148
149 149 { IP_DHCPINIT_IF, IPPROTO_IP, OA_R, OA_RW, OP_CONFIG, 0,
150 - sizeof (int), 0 },
150 + sizeof (int), {0}},
151 151
152 152 { IP_UNSPEC_SRC, IPPROTO_IP, OA_R, OA_RW, OP_RAW, 0,
153 - sizeof (int), 0 },
153 + sizeof (int), {0}},
154 154
155 155 { IP_BROADCAST_TTL, IPPROTO_IP, OA_R, OA_RW, OP_RAW, 0, sizeof (uchar_t),
156 - 0 /* disabled */ },
156 + {0} /* disabled */ },
157 157
158 158 { IP_PKTINFO, IPPROTO_IP, OA_RW, OA_RW, OP_NP,
159 159 (OP_NODEFAULT|OP_VARLEN),
160 - sizeof (struct in_pktinfo), -1 /* not initialized */ },
160 + sizeof (struct in_pktinfo), {-1} /* not initialized */ },
161 161 { IP_NEXTHOP, IPPROTO_IP, OA_R, OA_RW, OP_CONFIG, 0,
162 - sizeof (in_addr_t), -1 /* not initialized */ },
162 + sizeof (in_addr_t), {-1} /* not initialized */ },
163 163
164 -{ IP_DONTFRAG, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0 },
164 +{ IP_DONTFRAG, IPPROTO_IP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}},
165 165
166 166 { MCAST_JOIN_GROUP, IPPROTO_IP, OA_X, OA_X, OP_NP,
167 167 OP_NODEFAULT, sizeof (struct group_req),
168 - -1 /* not initialized */ },
168 + {-1} /* not initialized */ },
169 169 { MCAST_LEAVE_GROUP, IPPROTO_IP, OA_X, OA_X, OP_NP,
170 170 OP_NODEFAULT, sizeof (struct group_req),
171 - -1 /* not initialized */ },
171 + {-1} /* not initialized */ },
172 172 { MCAST_BLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP,
173 173 OP_NODEFAULT, sizeof (struct group_source_req),
174 - -1 /* not initialized */ },
174 + {-1} /* not initialized */ },
175 175 { MCAST_UNBLOCK_SOURCE, IPPROTO_IP, OA_X, OA_X, OP_NP,
176 176 OP_NODEFAULT, sizeof (struct group_source_req),
177 - -1 /* not initialized */ },
177 + {-1} /* not initialized */ },
178 178 { MCAST_JOIN_SOURCE_GROUP, IPPROTO_IP, OA_X, OA_X, OP_NP,
179 179 OP_NODEFAULT, sizeof (struct group_source_req),
180 - -1 /* not initialized */ },
180 + {-1} /* not initialized */ },
181 181 { MCAST_LEAVE_SOURCE_GROUP, IPPROTO_IP, OA_X, OA_X, OP_NP,
182 182 OP_NODEFAULT, sizeof (struct group_source_req),
183 - -1 /* not initialized */ },
183 + {-1} /* not initialized */ },
184 184
185 185 { IPV6_MULTICAST_IF, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
186 - sizeof (int), 0 },
186 + sizeof (int), {0}},
187 187
188 188 { IPV6_MULTICAST_HOPS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
189 - OP_DEF_FN, sizeof (int), -1 /* not initialized */ },
189 + OP_DEF_FN, sizeof (int), {-1} /* not initialized */ },
190 190
191 191 { IPV6_MULTICAST_LOOP, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
192 - OP_DEF_FN, sizeof (int), -1 /* not initialized */},
192 + OP_DEF_FN, sizeof (int), {-1} /* not initialized */},
193 193
194 194 { IPV6_JOIN_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP, OP_NODEFAULT,
195 - sizeof (struct ipv6_mreq), -1 /* not initialized */ },
195 + sizeof (struct ipv6_mreq), {-1} /* not initialized */ },
196 196
197 197 { IPV6_LEAVE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
198 198 OP_NODEFAULT,
199 - sizeof (struct ipv6_mreq), -1 /* not initialized */ },
199 + sizeof (struct ipv6_mreq), {-1} /* not initialized */ },
200 200
201 201 { IPV6_UNICAST_HOPS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_DEF_FN,
202 - sizeof (int), -1 /* not initialized */ },
202 + sizeof (int), {-1} /* not initialized */ },
203 203
204 204 { IPV6_BOUND_IF, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
205 - sizeof (int), 0 /* no ifindex */ },
205 + sizeof (int), {0} /* no ifindex */ },
206 206
207 207 { IPV6_UNSPEC_SRC, IPPROTO_IPV6, OA_R, OA_RW, OP_RAW, 0,
208 - sizeof (int), 0 },
208 + sizeof (int), {0}},
209 209
210 210 { IPV6_PKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
211 211 (OP_NODEFAULT|OP_VARLEN),
212 - sizeof (struct in6_pktinfo), -1 /* not initialized */ },
212 + sizeof (struct in6_pktinfo), {-1} /* not initialized */ },
213 213 { IPV6_HOPLIMIT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
214 214 OP_NODEFAULT,
215 - sizeof (int), -1 /* not initialized */ },
215 + sizeof (int), {-1} /* not initialized */ },
216 216 { IPV6_NEXTHOP, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
217 217 (OP_NODEFAULT|OP_VARLEN),
218 - sizeof (sin6_t), -1 /* not initialized */ },
218 + sizeof (sin6_t), {-1} /* not initialized */ },
219 219 { IPV6_HOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
220 220 (OP_VARLEN|OP_NODEFAULT),
221 - MAX_EHDR_LEN, -1 /* not initialized */ },
221 + MAX_EHDR_LEN, {-1} /* not initialized */ },
222 222 { IPV6_DSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
223 223 (OP_VARLEN|OP_NODEFAULT),
224 - MAX_EHDR_LEN, -1 /* not initialized */ },
224 + MAX_EHDR_LEN, {-1} /* not initialized */ },
225 225 { IPV6_RTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
226 226 (OP_VARLEN|OP_NODEFAULT),
227 - MAX_EHDR_LEN, -1 /* not initialized */ },
227 + MAX_EHDR_LEN, {-1} /* not initialized */ },
228 228 { IPV6_RTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
229 229 (OP_VARLEN|OP_NODEFAULT),
230 - MAX_EHDR_LEN, -1 /* not initialized */ },
230 + MAX_EHDR_LEN, {-1} /* not initialized */ },
231 231 { IPV6_TCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
232 232 OP_NODEFAULT,
233 - sizeof (int), -1 /* not initialized */ },
233 + sizeof (int), {-1} /* not initialized */ },
234 234 { IPV6_PATHMTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
235 235 OP_NODEFAULT,
236 - sizeof (struct ip6_mtuinfo), -1 },
236 + sizeof (struct ip6_mtuinfo), {-1} },
237 237 { IPV6_DONTFRAG, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
238 - sizeof (int), 0 },
238 + sizeof (int), {0}},
239 239 { IPV6_USE_MIN_MTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
240 - sizeof (int), 0 },
240 + sizeof (int), {0}},
241 241 { IPV6_V6ONLY, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
242 - sizeof (int), 0 },
242 + sizeof (int), {0}},
243 243
244 244 { IPV6_RECVPKTINFO, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
245 - sizeof (int), 0 },
245 + sizeof (int), {0}},
246 246 { IPV6_RECVHOPLIMIT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
247 - sizeof (int), 0 },
247 + sizeof (int), {0}},
248 248 { IPV6_RECVHOPOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
249 - sizeof (int), 0 },
249 + sizeof (int), {0}},
250 250 { _OLD_IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
251 - sizeof (int), 0 },
251 + sizeof (int), {0}},
252 252 { IPV6_RECVDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
253 - sizeof (int), 0 },
253 + sizeof (int), {0}},
254 254 { IPV6_RECVRTHDR, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
255 - sizeof (int), 0 },
255 + sizeof (int), {0}},
256 256 { IPV6_RECVRTHDRDSTOPTS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
257 - sizeof (int), 0 },
257 + sizeof (int), {0}},
258 258 { IPV6_RECVPATHMTU, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP,
259 - 0, sizeof (int), 0 },
259 + 0, sizeof (int), {0}},
260 260 { IPV6_RECVTCLASS, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
261 - sizeof (int), 0 },
261 + sizeof (int), {0}},
262 262
263 263 { IPV6_SEC_OPT, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, OP_NODEFAULT,
264 - sizeof (ipsec_req_t), -1 /* not initialized */ },
264 + sizeof (ipsec_req_t), {-1} /* not initialized */ },
265 265 { IPV6_SRC_PREFERENCES, IPPROTO_IPV6, OA_RW, OA_RW, OP_NP, 0,
266 - sizeof (uint32_t), IPV6_PREFER_SRC_DEFAULT },
266 + sizeof (uint32_t), {IPV6_PREFER_SRC_DEFAULT} },
267 267
268 268 { MCAST_JOIN_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
269 269 OP_NODEFAULT, sizeof (struct group_req),
270 - -1 /* not initialized */ },
270 + {-1} /* not initialized */ },
271 271 { MCAST_LEAVE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
272 272 OP_NODEFAULT, sizeof (struct group_req),
273 - -1 /* not initialized */ },
273 + {-1} /* not initialized */ },
274 274 { MCAST_BLOCK_SOURCE, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
275 275 OP_NODEFAULT, sizeof (struct group_source_req),
276 - -1 /* not initialized */ },
276 + {-1} /* not initialized */ },
277 277 { MCAST_UNBLOCK_SOURCE, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
278 278 OP_NODEFAULT, sizeof (struct group_source_req),
279 - -1 /* not initialized */ },
279 + {-1} /* not initialized */ },
280 280 { MCAST_JOIN_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
281 281 OP_NODEFAULT, sizeof (struct group_source_req),
282 - -1 /* not initialized */ },
282 + {-1} /* not initialized */ },
283 283 { MCAST_LEAVE_SOURCE_GROUP, IPPROTO_IPV6, OA_X, OA_X, OP_NP,
284 284 OP_NODEFAULT, sizeof (struct group_source_req),
285 - -1 /* not initialized */ },
285 + {-1} /* not initialized */ },
286 286
287 287 { UDP_ANONPRIVBIND, IPPROTO_UDP, OA_R, OA_RW, OP_PRIVPORT, 0,
288 - sizeof (int), 0 },
289 -{ UDP_EXCLBIND, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
288 + sizeof (int), {0}},
289 +{ UDP_EXCLBIND, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
290 290 },
291 -{ UDP_RCVHDR, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), 0
291 +{ UDP_RCVHDR, IPPROTO_UDP, OA_RW, OA_RW, OP_NP, 0, sizeof (int), {0}
292 292 },
293 293 { UDP_NAT_T_ENDPOINT, IPPROTO_UDP, OA_RW, OA_RW, OP_PRIVPORT, 0, sizeof (int),
294 - 0 },
294 + {0}},
295 295 };
296 296
297 297 /*
298 298 * Table of all supported levels
299 299 * Note: Some levels (e.g. XTI_GENERIC) may be valid but may not have
300 300 * any supported options so we need this info separately.
301 301 *
302 302 * This is needed only for topmost tpi providers and is used only by
303 303 * XTI interfaces.
304 304 */
305 305 optlevel_t udp_valid_levels_arr[] = {
306 306 XTI_GENERIC,
307 307 SOL_SOCKET,
308 308 IPPROTO_UDP,
309 309 IPPROTO_IP,
310 310 IPPROTO_IPV6
311 311 };
312 312
313 313 #define UDP_VALID_LEVELS_CNT A_CNT(udp_valid_levels_arr)
314 314 #define UDP_OPT_ARR_CNT A_CNT(udp_opt_arr)
315 315
316 316 uint_t udp_max_optsize; /* initialized when UDP driver is loaded */
317 317
318 318 /*
319 319 * Initialize option database object for UDP
320 320 *
321 321 * This object represents database of options to search passed to
322 322 * {sock,tpi}optcom_req() interface routine to take care of option
323 323 * management and associated methods.
324 324 */
325 325
326 326 optdb_obj_t udp_opt_obj = {
327 327 udp_opt_default, /* UDP default value function pointer */
328 328 udp_tpi_opt_get, /* UDP get function pointer */
329 329 udp_tpi_opt_set, /* UDP set function pointer */
330 330 UDP_OPT_ARR_CNT, /* UDP option database count of entries */
331 331 udp_opt_arr, /* UDP option database */
332 332 UDP_VALID_LEVELS_CNT, /* UDP valid level count of entries */
333 333 udp_valid_levels_arr /* UDP valid level array */
334 334 };
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX