Ruby 2.1.5p273(2014-11-13revision48405)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

constdefs.c
Go to the documentation of this file.
1 /* autogenerated file */
2
3 static st_table *rsock_intern_family_hash;
4 static st_table *rsock_intern_family_noprefix_hash;
5 static st_table *rsock_intern_protocol_family_hash;
6 static st_table *rsock_intern_socktype_hash;
7 static st_table *rsock_intern_ipproto_hash;
8 static st_table *rsock_intern_iplevel_hash;
9 static st_table *rsock_intern_so_optname_hash;
10 static st_table *rsock_intern_ip_optname_hash;
11 static st_table *rsock_intern_ipv6_optname_hash;
12 static st_table *rsock_intern_tcp_optname_hash;
13 static st_table *rsock_intern_udp_optname_hash;
14 static st_table *rsock_intern_scm_optname_hash;
15 static st_table *rsock_intern_local_optname_hash;
16
17 #ifdef HAVE_LONG_LONG
18 #define INTEGER2NUM(n) \
19 (FIXNUM_MAX < (n) ? ULL2NUM(n) : \
20 FIXNUM_MIN > (LONG_LONG)(n) ? LL2NUM(n) : \
21 LONG2FIX(n))
22 #else
23 #define INTEGER2NUM(n) \
24 (FIXNUM_MAX < (n) ? ULONG2NUM(n) : \
25 FIXNUM_MIN > (long)(n) ? LONG2NUM(n) : \
26 LONG2FIX(n))
27 #endif
28
29 static void
30 init_constants(void)
31 {
32 /*
33 * Document-module: Socket::Constants
34 *
35 * Socket::Constants provides socket-related constants. All possible
36 * socket constants are listed in the documentation but they may not all
37 * be present on your platform.
38 *
39 * If the underlying platform doesn't define a constant the corresponding
40 * Ruby constant is not defined.
41 *
42 */
43 rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants");
44
45 #if defined(SOCK_STREAM)
46 /* A stream socket provides a sequenced, reliable two-way connection for a byte stream */
47 rb_define_const(rb_cSocket, "SOCK_STREAM", INTEGER2NUM(SOCK_STREAM));
48 /* A stream socket provides a sequenced, reliable two-way connection for a byte stream */
49 rb_define_const(rb_mSockConst, "SOCK_STREAM", INTEGER2NUM(SOCK_STREAM));
50 #endif
51 #if defined(SOCK_DGRAM)
52 /* A datagram socket provides connectionless, unreliable messaging */
53 rb_define_const(rb_cSocket, "SOCK_DGRAM", INTEGER2NUM(SOCK_DGRAM));
54 /* A datagram socket provides connectionless, unreliable messaging */
55 rb_define_const(rb_mSockConst, "SOCK_DGRAM", INTEGER2NUM(SOCK_DGRAM));
56 #endif
57 #if defined(SOCK_RAW)
58 /* A raw socket provides low-level access for direct access or implementing network protocols */
59 rb_define_const(rb_cSocket, "SOCK_RAW", INTEGER2NUM(SOCK_RAW));
60 /* A raw socket provides low-level access for direct access or implementing network protocols */
61 rb_define_const(rb_mSockConst, "SOCK_RAW", INTEGER2NUM(SOCK_RAW));
62 #endif
63 #if defined(SOCK_RDM)
64 /* A reliable datagram socket provides reliable delivery of messages */
65 rb_define_const(rb_cSocket, "SOCK_RDM", INTEGER2NUM(SOCK_RDM));
66 /* A reliable datagram socket provides reliable delivery of messages */
67 rb_define_const(rb_mSockConst, "SOCK_RDM", INTEGER2NUM(SOCK_RDM));
68 #endif
69 #if defined(SOCK_SEQPACKET)
70 /* A sequential packet socket provides sequenced, reliable two-way connection for datagrams */
71 rb_define_const(rb_cSocket, "SOCK_SEQPACKET", INTEGER2NUM(SOCK_SEQPACKET));
72 /* A sequential packet socket provides sequenced, reliable two-way connection for datagrams */
73 rb_define_const(rb_mSockConst, "SOCK_SEQPACKET", INTEGER2NUM(SOCK_SEQPACKET));
74 #endif
75 #if defined(SOCK_PACKET)
76 /* Device-level packet access */
77 rb_define_const(rb_cSocket, "SOCK_PACKET", INTEGER2NUM(SOCK_PACKET));
78 /* Device-level packet access */
79 rb_define_const(rb_mSockConst, "SOCK_PACKET", INTEGER2NUM(SOCK_PACKET));
80 #endif
81 #if defined(AF_UNSPEC)
82 /* Unspecified protocol, any supported address family */
83 rb_define_const(rb_cSocket, "AF_UNSPEC", INTEGER2NUM(AF_UNSPEC));
84 /* Unspecified protocol, any supported address family */
85 rb_define_const(rb_mSockConst, "AF_UNSPEC", INTEGER2NUM(AF_UNSPEC));
86 #endif
87 #if defined(PF_UNSPEC)
88 /* Unspecified protocol, any supported address family */
89 rb_define_const(rb_cSocket, "PF_UNSPEC", INTEGER2NUM(PF_UNSPEC));
90 /* Unspecified protocol, any supported address family */
91 rb_define_const(rb_mSockConst, "PF_UNSPEC", INTEGER2NUM(PF_UNSPEC));
92 #endif
93 #if defined(AF_INET)
94 /* IPv4 protocol */
95 rb_define_const(rb_cSocket, "AF_INET", INTEGER2NUM(AF_INET));
96 /* IPv4 protocol */
97 rb_define_const(rb_mSockConst, "AF_INET", INTEGER2NUM(AF_INET));
98 #endif
99 #if defined(PF_INET)
100 /* IPv4 protocol */
101 rb_define_const(rb_cSocket, "PF_INET", INTEGER2NUM(PF_INET));
102 /* IPv4 protocol */
103 rb_define_const(rb_mSockConst, "PF_INET", INTEGER2NUM(PF_INET));
104 #endif
105 #if defined(INET6)
106 #if defined(AF_INET6)
107 /* IPv6 protocol */
108 rb_define_const(rb_cSocket, "AF_INET6", INTEGER2NUM(AF_INET6));
109 /* IPv6 protocol */
110 rb_define_const(rb_mSockConst, "AF_INET6", INTEGER2NUM(AF_INET6));
111 #endif
112 #endif
113 #if defined(INET6)
114 #if defined(PF_INET6)
115 /* IPv6 protocol */
116 rb_define_const(rb_cSocket, "PF_INET6", INTEGER2NUM(PF_INET6));
117 /* IPv6 protocol */
118 rb_define_const(rb_mSockConst, "PF_INET6", INTEGER2NUM(PF_INET6));
119 #endif
120 #endif
121 #if defined(AF_UNIX)
122 /* UNIX sockets */
123 rb_define_const(rb_cSocket, "AF_UNIX", INTEGER2NUM(AF_UNIX));
124 /* UNIX sockets */
125 rb_define_const(rb_mSockConst, "AF_UNIX", INTEGER2NUM(AF_UNIX));
126 #endif
127 #if defined(PF_UNIX)
128 /* UNIX sockets */
129 rb_define_const(rb_cSocket, "PF_UNIX", INTEGER2NUM(PF_UNIX));
130 /* UNIX sockets */
131 rb_define_const(rb_mSockConst, "PF_UNIX", INTEGER2NUM(PF_UNIX));
132 #endif
133 #if defined(AF_AX25)
134 /* AX.25 protocol */
135 rb_define_const(rb_cSocket, "AF_AX25", INTEGER2NUM(AF_AX25));
136 /* AX.25 protocol */
137 rb_define_const(rb_mSockConst, "AF_AX25", INTEGER2NUM(AF_AX25));
138 #endif
139 #if defined(PF_AX25)
140 /* AX.25 protocol */
141 rb_define_const(rb_cSocket, "PF_AX25", INTEGER2NUM(PF_AX25));
142 /* AX.25 protocol */
143 rb_define_const(rb_mSockConst, "PF_AX25", INTEGER2NUM(PF_AX25));
144 #endif
145 #if defined(AF_IPX)
146 /* IPX protocol */
147 rb_define_const(rb_cSocket, "AF_IPX", INTEGER2NUM(AF_IPX));
148 /* IPX protocol */
149 rb_define_const(rb_mSockConst, "AF_IPX", INTEGER2NUM(AF_IPX));
150 #endif
151 #if defined(PF_IPX)
152 /* IPX protocol */
153 rb_define_const(rb_cSocket, "PF_IPX", INTEGER2NUM(PF_IPX));
154 /* IPX protocol */
155 rb_define_const(rb_mSockConst, "PF_IPX", INTEGER2NUM(PF_IPX));
156 #endif
157 #if defined(AF_APPLETALK)
158 /* AppleTalk protocol */
159 rb_define_const(rb_cSocket, "AF_APPLETALK", INTEGER2NUM(AF_APPLETALK));
160 /* AppleTalk protocol */
161 rb_define_const(rb_mSockConst, "AF_APPLETALK", INTEGER2NUM(AF_APPLETALK));
162 #endif
163 #if defined(PF_APPLETALK)
164 /* AppleTalk protocol */
165 rb_define_const(rb_cSocket, "PF_APPLETALK", INTEGER2NUM(PF_APPLETALK));
166 /* AppleTalk protocol */
167 rb_define_const(rb_mSockConst, "PF_APPLETALK", INTEGER2NUM(PF_APPLETALK));
168 #endif
169 #if defined(AF_LOCAL)
170 /* Host-internal protocols */
171 rb_define_const(rb_cSocket, "AF_LOCAL", INTEGER2NUM(AF_LOCAL));
172 /* Host-internal protocols */
173 rb_define_const(rb_mSockConst, "AF_LOCAL", INTEGER2NUM(AF_LOCAL));
174 #endif
175 #if defined(PF_LOCAL)
176 /* Host-internal protocols */
177 rb_define_const(rb_cSocket, "PF_LOCAL", INTEGER2NUM(PF_LOCAL));
178 /* Host-internal protocols */
179 rb_define_const(rb_mSockConst, "PF_LOCAL", INTEGER2NUM(PF_LOCAL));
180 #endif
181 #if defined(AF_IMPLINK)
182 /* ARPANET IMP protocol */
183 rb_define_const(rb_cSocket, "AF_IMPLINK", INTEGER2NUM(AF_IMPLINK));
184 /* ARPANET IMP protocol */
185 rb_define_const(rb_mSockConst, "AF_IMPLINK", INTEGER2NUM(AF_IMPLINK));
186 #endif
187 #if defined(PF_IMPLINK)
188 /* ARPANET IMP protocol */
189 rb_define_const(rb_cSocket, "PF_IMPLINK", INTEGER2NUM(PF_IMPLINK));
190 /* ARPANET IMP protocol */
191 rb_define_const(rb_mSockConst, "PF_IMPLINK", INTEGER2NUM(PF_IMPLINK));
192 #endif
193 #if defined(AF_PUP)
194 /* PARC Universal Packet protocol */
195 rb_define_const(rb_cSocket, "AF_PUP", INTEGER2NUM(AF_PUP));
196 /* PARC Universal Packet protocol */
197 rb_define_const(rb_mSockConst, "AF_PUP", INTEGER2NUM(AF_PUP));
198 #endif
199 #if defined(PF_PUP)
200 /* PARC Universal Packet protocol */
201 rb_define_const(rb_cSocket, "PF_PUP", INTEGER2NUM(PF_PUP));
202 /* PARC Universal Packet protocol */
203 rb_define_const(rb_mSockConst, "PF_PUP", INTEGER2NUM(PF_PUP));
204 #endif
205 #if defined(AF_CHAOS)
206 /* MIT CHAOS protocols */
207 rb_define_const(rb_cSocket, "AF_CHAOS", INTEGER2NUM(AF_CHAOS));
208 /* MIT CHAOS protocols */
209 rb_define_const(rb_mSockConst, "AF_CHAOS", INTEGER2NUM(AF_CHAOS));
210 #endif
211 #if defined(PF_CHAOS)
212 /* MIT CHAOS protocols */
213 rb_define_const(rb_cSocket, "PF_CHAOS", INTEGER2NUM(PF_CHAOS));
214 /* MIT CHAOS protocols */
215 rb_define_const(rb_mSockConst, "PF_CHAOS", INTEGER2NUM(PF_CHAOS));
216 #endif
217 #if defined(AF_NS)
218 /* XEROX NS protocols */
219 rb_define_const(rb_cSocket, "AF_NS", INTEGER2NUM(AF_NS));
220 /* XEROX NS protocols */
221 rb_define_const(rb_mSockConst, "AF_NS", INTEGER2NUM(AF_NS));
222 #endif
223 #if defined(PF_NS)
224 /* XEROX NS protocols */
225 rb_define_const(rb_cSocket, "PF_NS", INTEGER2NUM(PF_NS));
226 /* XEROX NS protocols */
227 rb_define_const(rb_mSockConst, "PF_NS", INTEGER2NUM(PF_NS));
228 #endif
229 #if defined(AF_ISO)
230 /* ISO Open Systems Interconnection protocols */
231 rb_define_const(rb_cSocket, "AF_ISO", INTEGER2NUM(AF_ISO));
232 /* ISO Open Systems Interconnection protocols */
233 rb_define_const(rb_mSockConst, "AF_ISO", INTEGER2NUM(AF_ISO));
234 #endif
235 #if defined(PF_ISO)
236 /* ISO Open Systems Interconnection protocols */
237 rb_define_const(rb_cSocket, "PF_ISO", INTEGER2NUM(PF_ISO));
238 /* ISO Open Systems Interconnection protocols */
239 rb_define_const(rb_mSockConst, "PF_ISO", INTEGER2NUM(PF_ISO));
240 #endif
241 #if defined(AF_OSI)
242 /* ISO Open Systems Interconnection protocols */
243 rb_define_const(rb_cSocket, "AF_OSI", INTEGER2NUM(AF_OSI));
244 /* ISO Open Systems Interconnection protocols */
245 rb_define_const(rb_mSockConst, "AF_OSI", INTEGER2NUM(AF_OSI));
246 #endif
247 #if defined(PF_OSI)
248 /* ISO Open Systems Interconnection protocols */
249 rb_define_const(rb_cSocket, "PF_OSI", INTEGER2NUM(PF_OSI));
250 /* ISO Open Systems Interconnection protocols */
251 rb_define_const(rb_mSockConst, "PF_OSI", INTEGER2NUM(PF_OSI));
252 #endif
253 #if defined(AF_ECMA)
254 /* European Computer Manufacturers protocols */
255 rb_define_const(rb_cSocket, "AF_ECMA", INTEGER2NUM(AF_ECMA));
256 /* European Computer Manufacturers protocols */
257 rb_define_const(rb_mSockConst, "AF_ECMA", INTEGER2NUM(AF_ECMA));
258 #endif
259 #if defined(PF_ECMA)
260 /* European Computer Manufacturers protocols */
261 rb_define_const(rb_cSocket, "PF_ECMA", INTEGER2NUM(PF_ECMA));
262 /* European Computer Manufacturers protocols */
263 rb_define_const(rb_mSockConst, "PF_ECMA", INTEGER2NUM(PF_ECMA));
264 #endif
265 #if defined(AF_DATAKIT)
266 /* Datakit protocol */
267 rb_define_const(rb_cSocket, "AF_DATAKIT", INTEGER2NUM(AF_DATAKIT));
268 /* Datakit protocol */
269 rb_define_const(rb_mSockConst, "AF_DATAKIT", INTEGER2NUM(AF_DATAKIT));
270 #endif
271 #if defined(PF_DATAKIT)
272 /* Datakit protocol */
273 rb_define_const(rb_cSocket, "PF_DATAKIT", INTEGER2NUM(PF_DATAKIT));
274 /* Datakit protocol */
275 rb_define_const(rb_mSockConst, "PF_DATAKIT", INTEGER2NUM(PF_DATAKIT));
276 #endif
277 #if defined(AF_CCITT)
278 /* CCITT (now ITU-T) protocols */
279 rb_define_const(rb_cSocket, "AF_CCITT", INTEGER2NUM(AF_CCITT));
280 /* CCITT (now ITU-T) protocols */
281 rb_define_const(rb_mSockConst, "AF_CCITT", INTEGER2NUM(AF_CCITT));
282 #endif
283 #if defined(PF_CCITT)
284 /* CCITT (now ITU-T) protocols */
285 rb_define_const(rb_cSocket, "PF_CCITT", INTEGER2NUM(PF_CCITT));
286 /* CCITT (now ITU-T) protocols */
287 rb_define_const(rb_mSockConst, "PF_CCITT", INTEGER2NUM(PF_CCITT));
288 #endif
289 #if defined(AF_SNA)
290 /* IBM SNA protocol */
291 rb_define_const(rb_cSocket, "AF_SNA", INTEGER2NUM(AF_SNA));
292 /* IBM SNA protocol */
293 rb_define_const(rb_mSockConst, "AF_SNA", INTEGER2NUM(AF_SNA));
294 #endif
295 #if defined(PF_SNA)
296 /* IBM SNA protocol */
297 rb_define_const(rb_cSocket, "PF_SNA", INTEGER2NUM(PF_SNA));
298 /* IBM SNA protocol */
299 rb_define_const(rb_mSockConst, "PF_SNA", INTEGER2NUM(PF_SNA));
300 #endif
301 #if defined(AF_DEC)
302 /* DECnet protocol */
303 rb_define_const(rb_cSocket, "AF_DEC", INTEGER2NUM(AF_DEC));
304 /* DECnet protocol */
305 rb_define_const(rb_mSockConst, "AF_DEC", INTEGER2NUM(AF_DEC));
306 #endif
307 #if defined(PF_DEC)
308 /* DECnet protocol */
309 rb_define_const(rb_cSocket, "PF_DEC", INTEGER2NUM(PF_DEC));
310 /* DECnet protocol */
311 rb_define_const(rb_mSockConst, "PF_DEC", INTEGER2NUM(PF_DEC));
312 #endif
313 #if defined(AF_DLI)
314 /* DEC Direct Data Link Interface protocol */
315 rb_define_const(rb_cSocket, "AF_DLI", INTEGER2NUM(AF_DLI));
316 /* DEC Direct Data Link Interface protocol */
317 rb_define_const(rb_mSockConst, "AF_DLI", INTEGER2NUM(AF_DLI));
318 #endif
319 #if defined(PF_DLI)
320 /* DEC Direct Data Link Interface protocol */
321 rb_define_const(rb_cSocket, "PF_DLI", INTEGER2NUM(PF_DLI));
322 /* DEC Direct Data Link Interface protocol */
323 rb_define_const(rb_mSockConst, "PF_DLI", INTEGER2NUM(PF_DLI));
324 #endif
325 #if defined(AF_LAT)
326 /* Local Area Transport protocol */
327 rb_define_const(rb_cSocket, "AF_LAT", INTEGER2NUM(AF_LAT));
328 /* Local Area Transport protocol */
329 rb_define_const(rb_mSockConst, "AF_LAT", INTEGER2NUM(AF_LAT));
330 #endif
331 #if defined(PF_LAT)
332 /* Local Area Transport protocol */
333 rb_define_const(rb_cSocket, "PF_LAT", INTEGER2NUM(PF_LAT));
334 /* Local Area Transport protocol */
335 rb_define_const(rb_mSockConst, "PF_LAT", INTEGER2NUM(PF_LAT));
336 #endif
337 #if defined(AF_HYLINK)
338 /* NSC Hyperchannel protocol */
339 rb_define_const(rb_cSocket, "AF_HYLINK", INTEGER2NUM(AF_HYLINK));
340 /* NSC Hyperchannel protocol */
341 rb_define_const(rb_mSockConst, "AF_HYLINK", INTEGER2NUM(AF_HYLINK));
342 #endif
343 #if defined(PF_HYLINK)
344 /* NSC Hyperchannel protocol */
345 rb_define_const(rb_cSocket, "PF_HYLINK", INTEGER2NUM(PF_HYLINK));
346 /* NSC Hyperchannel protocol */
347 rb_define_const(rb_mSockConst, "PF_HYLINK", INTEGER2NUM(PF_HYLINK));
348 #endif
349 #if defined(AF_ROUTE)
350 /* Internal routing protocol */
351 rb_define_const(rb_cSocket, "AF_ROUTE", INTEGER2NUM(AF_ROUTE));
352 /* Internal routing protocol */
353 rb_define_const(rb_mSockConst, "AF_ROUTE", INTEGER2NUM(AF_ROUTE));
354 #endif
355 #if defined(PF_ROUTE)
356 /* Internal routing protocol */
357 rb_define_const(rb_cSocket, "PF_ROUTE", INTEGER2NUM(PF_ROUTE));
358 /* Internal routing protocol */
359 rb_define_const(rb_mSockConst, "PF_ROUTE", INTEGER2NUM(PF_ROUTE));
360 #endif
361 #if defined(AF_LINK)
362 /* Link layer interface */
363 rb_define_const(rb_cSocket, "AF_LINK", INTEGER2NUM(AF_LINK));
364 /* Link layer interface */
365 rb_define_const(rb_mSockConst, "AF_LINK", INTEGER2NUM(AF_LINK));
366 #endif
367 #if defined(PF_LINK)
368 /* Link layer interface */
369 rb_define_const(rb_cSocket, "PF_LINK", INTEGER2NUM(PF_LINK));
370 /* Link layer interface */
371 rb_define_const(rb_mSockConst, "PF_LINK", INTEGER2NUM(PF_LINK));
372 #endif
373 #if defined(AF_COIP)
374 /* Connection-oriented IP */
375 rb_define_const(rb_cSocket, "AF_COIP", INTEGER2NUM(AF_COIP));
376 /* Connection-oriented IP */
377 rb_define_const(rb_mSockConst, "AF_COIP", INTEGER2NUM(AF_COIP));
378 #endif
379 #if defined(PF_COIP)
380 /* Connection-oriented IP */
381 rb_define_const(rb_cSocket, "PF_COIP", INTEGER2NUM(PF_COIP));
382 /* Connection-oriented IP */
383 rb_define_const(rb_mSockConst, "PF_COIP", INTEGER2NUM(PF_COIP));
384 #endif
385 #if defined(AF_CNT)
386 /* Computer Network Technology */
387 rb_define_const(rb_cSocket, "AF_CNT", INTEGER2NUM(AF_CNT));
388 /* Computer Network Technology */
389 rb_define_const(rb_mSockConst, "AF_CNT", INTEGER2NUM(AF_CNT));
390 #endif
391 #if defined(PF_CNT)
392 /* Computer Network Technology */
393 rb_define_const(rb_cSocket, "PF_CNT", INTEGER2NUM(PF_CNT));
394 /* Computer Network Technology */
395 rb_define_const(rb_mSockConst, "PF_CNT", INTEGER2NUM(PF_CNT));
396 #endif
397 #if defined(AF_SIP)
398 /* Simple Internet Protocol */
399 rb_define_const(rb_cSocket, "AF_SIP", INTEGER2NUM(AF_SIP));
400 /* Simple Internet Protocol */
401 rb_define_const(rb_mSockConst, "AF_SIP", INTEGER2NUM(AF_SIP));
402 #endif
403 #if defined(PF_SIP)
404 /* Simple Internet Protocol */
405 rb_define_const(rb_cSocket, "PF_SIP", INTEGER2NUM(PF_SIP));
406 /* Simple Internet Protocol */
407 rb_define_const(rb_mSockConst, "PF_SIP", INTEGER2NUM(PF_SIP));
408 #endif
409 #if defined(AF_NDRV)
410 /* Network driver raw access */
411 rb_define_const(rb_cSocket, "AF_NDRV", INTEGER2NUM(AF_NDRV));
412 /* Network driver raw access */
413 rb_define_const(rb_mSockConst, "AF_NDRV", INTEGER2NUM(AF_NDRV));
414 #endif
415 #if defined(PF_NDRV)
416 /* Network driver raw access */
417 rb_define_const(rb_cSocket, "PF_NDRV", INTEGER2NUM(PF_NDRV));
418 /* Network driver raw access */
419 rb_define_const(rb_mSockConst, "PF_NDRV", INTEGER2NUM(PF_NDRV));
420 #endif
421 #if defined(AF_ISDN)
422 /* Integrated Services Digital Network */
423 rb_define_const(rb_cSocket, "AF_ISDN", INTEGER2NUM(AF_ISDN));
424 /* Integrated Services Digital Network */
425 rb_define_const(rb_mSockConst, "AF_ISDN", INTEGER2NUM(AF_ISDN));
426 #endif
427 #if defined(PF_ISDN)
428 /* Integrated Services Digital Network */
429 rb_define_const(rb_cSocket, "PF_ISDN", INTEGER2NUM(PF_ISDN));
430 /* Integrated Services Digital Network */
431 rb_define_const(rb_mSockConst, "PF_ISDN", INTEGER2NUM(PF_ISDN));
432 #endif
433 #if defined(AF_NATM)
434 /* Native ATM access */
435 rb_define_const(rb_cSocket, "AF_NATM", INTEGER2NUM(AF_NATM));
436 /* Native ATM access */
437 rb_define_const(rb_mSockConst, "AF_NATM", INTEGER2NUM(AF_NATM));
438 #endif
439 #if defined(PF_NATM)
440 /* Native ATM access */
441 rb_define_const(rb_cSocket, "PF_NATM", INTEGER2NUM(PF_NATM));
442 /* Native ATM access */
443 rb_define_const(rb_mSockConst, "PF_NATM", INTEGER2NUM(PF_NATM));
444 #endif
445 #if defined(AF_SYSTEM)
446 /* */
447 rb_define_const(rb_cSocket, "AF_SYSTEM", INTEGER2NUM(AF_SYSTEM));
448 /* */
449 rb_define_const(rb_mSockConst, "AF_SYSTEM", INTEGER2NUM(AF_SYSTEM));
450 #endif
451 #if defined(PF_SYSTEM)
452 /* */
453 rb_define_const(rb_cSocket, "PF_SYSTEM", INTEGER2NUM(PF_SYSTEM));
454 /* */
455 rb_define_const(rb_mSockConst, "PF_SYSTEM", INTEGER2NUM(PF_SYSTEM));
456 #endif
457 #if defined(AF_NETBIOS)
458 /* NetBIOS */
459 rb_define_const(rb_cSocket, "AF_NETBIOS", INTEGER2NUM(AF_NETBIOS));
460 /* NetBIOS */
461 rb_define_const(rb_mSockConst, "AF_NETBIOS", INTEGER2NUM(AF_NETBIOS));
462 #endif
463 #if defined(PF_NETBIOS)
464 /* NetBIOS */
465 rb_define_const(rb_cSocket, "PF_NETBIOS", INTEGER2NUM(PF_NETBIOS));
466 /* NetBIOS */
467 rb_define_const(rb_mSockConst, "PF_NETBIOS", INTEGER2NUM(PF_NETBIOS));
468 #endif
469 #if defined(AF_PPP)
470 /* Point-to-Point Protocol */
471 rb_define_const(rb_cSocket, "AF_PPP", INTEGER2NUM(AF_PPP));
472 /* Point-to-Point Protocol */
473 rb_define_const(rb_mSockConst, "AF_PPP", INTEGER2NUM(AF_PPP));
474 #endif
475 #if defined(PF_PPP)
476 /* Point-to-Point Protocol */
477 rb_define_const(rb_cSocket, "PF_PPP", INTEGER2NUM(PF_PPP));
478 /* Point-to-Point Protocol */
479 rb_define_const(rb_mSockConst, "PF_PPP", INTEGER2NUM(PF_PPP));
480 #endif
481 #if defined(AF_ATM)
482 /* Asynchronous Transfer Mode */
483 rb_define_const(rb_cSocket, "AF_ATM", INTEGER2NUM(AF_ATM));
484 /* Asynchronous Transfer Mode */
485 rb_define_const(rb_mSockConst, "AF_ATM", INTEGER2NUM(AF_ATM));
486 #endif
487 #if defined(PF_ATM)
488 /* Asynchronous Transfer Mode */
489 rb_define_const(rb_cSocket, "PF_ATM", INTEGER2NUM(PF_ATM));
490 /* Asynchronous Transfer Mode */
491 rb_define_const(rb_mSockConst, "PF_ATM", INTEGER2NUM(PF_ATM));
492 #endif
493 #if defined(AF_NETGRAPH)
494 /* Netgraph sockets */
495 rb_define_const(rb_cSocket, "AF_NETGRAPH", INTEGER2NUM(AF_NETGRAPH));
496 /* Netgraph sockets */
497 rb_define_const(rb_mSockConst, "AF_NETGRAPH", INTEGER2NUM(AF_NETGRAPH));
498 #endif
499 #if defined(PF_NETGRAPH)
500 /* Netgraph sockets */
501 rb_define_const(rb_cSocket, "PF_NETGRAPH", INTEGER2NUM(PF_NETGRAPH));
502 /* Netgraph sockets */
503 rb_define_const(rb_mSockConst, "PF_NETGRAPH", INTEGER2NUM(PF_NETGRAPH));
504 #endif
505 #if defined(AF_MAX)
506 /* Maximum address family for this platform */
507 rb_define_const(rb_cSocket, "AF_MAX", INTEGER2NUM(AF_MAX));
508 /* Maximum address family for this platform */
509 rb_define_const(rb_mSockConst, "AF_MAX", INTEGER2NUM(AF_MAX));
510 #endif
511 #if defined(PF_MAX)
512 /* Maximum address family for this platform */
513 rb_define_const(rb_cSocket, "PF_MAX", INTEGER2NUM(PF_MAX));
514 /* Maximum address family for this platform */
515 rb_define_const(rb_mSockConst, "PF_MAX", INTEGER2NUM(PF_MAX));
516 #endif
517 #if defined(AF_PACKET)
518 /* Direct link-layer access */
519 rb_define_const(rb_cSocket, "AF_PACKET", INTEGER2NUM(AF_PACKET));
520 /* Direct link-layer access */
521 rb_define_const(rb_mSockConst, "AF_PACKET", INTEGER2NUM(AF_PACKET));
522 #endif
523 #if defined(PF_PACKET)
524 /* Direct link-layer access */
525 rb_define_const(rb_cSocket, "PF_PACKET", INTEGER2NUM(PF_PACKET));
526 /* Direct link-layer access */
527 rb_define_const(rb_mSockConst, "PF_PACKET", INTEGER2NUM(PF_PACKET));
528 #endif
529 #if defined(AF_E164)
530 /* CCITT (ITU-T) E.164 recommendation */
531 rb_define_const(rb_cSocket, "AF_E164", INTEGER2NUM(AF_E164));
532 /* CCITT (ITU-T) E.164 recommendation */
533 rb_define_const(rb_mSockConst, "AF_E164", INTEGER2NUM(AF_E164));
534 #endif
535 #if defined(PF_XTP)
536 /* eXpress Transfer Protocol */
537 rb_define_const(rb_cSocket, "PF_XTP", INTEGER2NUM(PF_XTP));
538 /* eXpress Transfer Protocol */
539 rb_define_const(rb_mSockConst, "PF_XTP", INTEGER2NUM(PF_XTP));
540 #endif
541 #if defined(PF_RTIP)
542 /* */
543 rb_define_const(rb_cSocket, "PF_RTIP", INTEGER2NUM(PF_RTIP));
544 /* */
545 rb_define_const(rb_mSockConst, "PF_RTIP", INTEGER2NUM(PF_RTIP));
546 #endif
547 #if defined(PF_PIP)
548 /* */
549 rb_define_const(rb_cSocket, "PF_PIP", INTEGER2NUM(PF_PIP));
550 /* */
551 rb_define_const(rb_mSockConst, "PF_PIP", INTEGER2NUM(PF_PIP));
552 #endif
553 #if defined(PF_KEY)
554 /* */
555 rb_define_const(rb_cSocket, "PF_KEY", INTEGER2NUM(PF_KEY));
556 /* */
557 rb_define_const(rb_mSockConst, "PF_KEY", INTEGER2NUM(PF_KEY));
558 #endif
559 #if defined(MSG_OOB)
560 /* Process out-of-band data */
561 rb_define_const(rb_cSocket, "MSG_OOB", INTEGER2NUM(MSG_OOB));
562 /* Process out-of-band data */
563 rb_define_const(rb_mSockConst, "MSG_OOB", INTEGER2NUM(MSG_OOB));
564 #endif
565 #if defined(MSG_PEEK)
566 /* Peek at incoming message */
567 rb_define_const(rb_cSocket, "MSG_PEEK", INTEGER2NUM(MSG_PEEK));
568 /* Peek at incoming message */
569 rb_define_const(rb_mSockConst, "MSG_PEEK", INTEGER2NUM(MSG_PEEK));
570 #endif
571 #if defined(MSG_DONTROUTE)
572 /* Send without using the routing tables */
573 rb_define_const(rb_cSocket, "MSG_DONTROUTE", INTEGER2NUM(MSG_DONTROUTE));
574 /* Send without using the routing tables */
575 rb_define_const(rb_mSockConst, "MSG_DONTROUTE", INTEGER2NUM(MSG_DONTROUTE));
576 #endif
577 #if defined(MSG_EOR)
578 /* Data completes record */
579 rb_define_const(rb_cSocket, "MSG_EOR", INTEGER2NUM(MSG_EOR));
580 /* Data completes record */
581 rb_define_const(rb_mSockConst, "MSG_EOR", INTEGER2NUM(MSG_EOR));
582 #endif
583 #if defined(MSG_TRUNC)
584 /* Data discarded before delivery */
585 rb_define_const(rb_cSocket, "MSG_TRUNC", INTEGER2NUM(MSG_TRUNC));
586 /* Data discarded before delivery */
587 rb_define_const(rb_mSockConst, "MSG_TRUNC", INTEGER2NUM(MSG_TRUNC));
588 #endif
589 #if defined(MSG_CTRUNC)
590 /* Control data lost before delivery */
591 rb_define_const(rb_cSocket, "MSG_CTRUNC", INTEGER2NUM(MSG_CTRUNC));
592 /* Control data lost before delivery */
593 rb_define_const(rb_mSockConst, "MSG_CTRUNC", INTEGER2NUM(MSG_CTRUNC));
594 #endif
595 #if defined(MSG_WAITALL)
596 /* Wait for full request or error */
597 rb_define_const(rb_cSocket, "MSG_WAITALL", INTEGER2NUM(MSG_WAITALL));
598 /* Wait for full request or error */
599 rb_define_const(rb_mSockConst, "MSG_WAITALL", INTEGER2NUM(MSG_WAITALL));
600 #endif
601 #if defined(MSG_DONTWAIT)
602 /* This message should be non-blocking */
603 rb_define_const(rb_cSocket, "MSG_DONTWAIT", INTEGER2NUM(MSG_DONTWAIT));
604 /* This message should be non-blocking */
605 rb_define_const(rb_mSockConst, "MSG_DONTWAIT", INTEGER2NUM(MSG_DONTWAIT));
606 #endif
607 #if defined(MSG_EOF)
608 /* Data completes connection */
609 rb_define_const(rb_cSocket, "MSG_EOF", INTEGER2NUM(MSG_EOF));
610 /* Data completes connection */
611 rb_define_const(rb_mSockConst, "MSG_EOF", INTEGER2NUM(MSG_EOF));
612 #endif
613 #if defined(MSG_FLUSH)
614 /* Start of a hold sequence. Dumps to so_temp */
615 rb_define_const(rb_cSocket, "MSG_FLUSH", INTEGER2NUM(MSG_FLUSH));
616 /* Start of a hold sequence. Dumps to so_temp */
617 rb_define_const(rb_mSockConst, "MSG_FLUSH", INTEGER2NUM(MSG_FLUSH));
618 #endif
619 #if defined(MSG_HOLD)
620 /* Hold fragment in so_temp */
621 rb_define_const(rb_cSocket, "MSG_HOLD", INTEGER2NUM(MSG_HOLD));
622 /* Hold fragment in so_temp */
623 rb_define_const(rb_mSockConst, "MSG_HOLD", INTEGER2NUM(MSG_HOLD));
624 #endif
625 #if defined(MSG_SEND)
626 /* Send the packet in so_temp */
627 rb_define_const(rb_cSocket, "MSG_SEND", INTEGER2NUM(MSG_SEND));
628 /* Send the packet in so_temp */
629 rb_define_const(rb_mSockConst, "MSG_SEND", INTEGER2NUM(MSG_SEND));
630 #endif
631 #if defined(MSG_HAVEMORE)
632 /* Data ready to be read */
633 rb_define_const(rb_cSocket, "MSG_HAVEMORE", INTEGER2NUM(MSG_HAVEMORE));
634 /* Data ready to be read */
635 rb_define_const(rb_mSockConst, "MSG_HAVEMORE", INTEGER2NUM(MSG_HAVEMORE));
636 #endif
637 #if defined(MSG_RCVMORE)
638 /* Data remains in the current packet */
639 rb_define_const(rb_cSocket, "MSG_RCVMORE", INTEGER2NUM(MSG_RCVMORE));
640 /* Data remains in the current packet */
641 rb_define_const(rb_mSockConst, "MSG_RCVMORE", INTEGER2NUM(MSG_RCVMORE));
642 #endif
643 #if defined(MSG_COMPAT)
644 /* End of record */
645 rb_define_const(rb_cSocket, "MSG_COMPAT", INTEGER2NUM(MSG_COMPAT));
646 /* End of record */
647 rb_define_const(rb_mSockConst, "MSG_COMPAT", INTEGER2NUM(MSG_COMPAT));
648 #endif
649 #if defined(MSG_PROXY)
650 /* Wait for full request */
651 rb_define_const(rb_cSocket, "MSG_PROXY", INTEGER2NUM(MSG_PROXY));
652 /* Wait for full request */
653 rb_define_const(rb_mSockConst, "MSG_PROXY", INTEGER2NUM(MSG_PROXY));
654 #endif
655 #if defined(MSG_FIN)
656 /* */
657 rb_define_const(rb_cSocket, "MSG_FIN", INTEGER2NUM(MSG_FIN));
658 /* */
659 rb_define_const(rb_mSockConst, "MSG_FIN", INTEGER2NUM(MSG_FIN));
660 #endif
661 #if defined(MSG_SYN)
662 /* */
663 rb_define_const(rb_cSocket, "MSG_SYN", INTEGER2NUM(MSG_SYN));
664 /* */
665 rb_define_const(rb_mSockConst, "MSG_SYN", INTEGER2NUM(MSG_SYN));
666 #endif
667 #if defined(MSG_CONFIRM)
668 /* Confirm path validity */
669 rb_define_const(rb_cSocket, "MSG_CONFIRM", INTEGER2NUM(MSG_CONFIRM));
670 /* Confirm path validity */
671 rb_define_const(rb_mSockConst, "MSG_CONFIRM", INTEGER2NUM(MSG_CONFIRM));
672 #endif
673 #if defined(MSG_RST)
674 /* */
675 rb_define_const(rb_cSocket, "MSG_RST", INTEGER2NUM(MSG_RST));
676 /* */
677 rb_define_const(rb_mSockConst, "MSG_RST", INTEGER2NUM(MSG_RST));
678 #endif
679 #if defined(MSG_ERRQUEUE)
680 /* Fetch message from error queue */
681 rb_define_const(rb_cSocket, "MSG_ERRQUEUE", INTEGER2NUM(MSG_ERRQUEUE));
682 /* Fetch message from error queue */
683 rb_define_const(rb_mSockConst, "MSG_ERRQUEUE", INTEGER2NUM(MSG_ERRQUEUE));
684 #endif
685 #if defined(MSG_NOSIGNAL)
686 /* Do not generate SIGPIPE */
687 rb_define_const(rb_cSocket, "MSG_NOSIGNAL", INTEGER2NUM(MSG_NOSIGNAL));
688 /* Do not generate SIGPIPE */
689 rb_define_const(rb_mSockConst, "MSG_NOSIGNAL", INTEGER2NUM(MSG_NOSIGNAL));
690 #endif
691 #if defined(MSG_MORE)
692 /* Sender will send more */
693 rb_define_const(rb_cSocket, "MSG_MORE", INTEGER2NUM(MSG_MORE));
694 /* Sender will send more */
695 rb_define_const(rb_mSockConst, "MSG_MORE", INTEGER2NUM(MSG_MORE));
696 #endif
697 #if defined(MSG_FASTOPEN)
698 /* Reduce step of the handshake process */
699 rb_define_const(rb_cSocket, "MSG_FASTOPEN", INTEGER2NUM(MSG_FASTOPEN));
700 /* Reduce step of the handshake process */
701 rb_define_const(rb_mSockConst, "MSG_FASTOPEN", INTEGER2NUM(MSG_FASTOPEN));
702 #endif
703 #if defined(SOL_SOCKET)
704 /* Socket-level options */
705 rb_define_const(rb_cSocket, "SOL_SOCKET", INTEGER2NUM(SOL_SOCKET));
706 /* Socket-level options */
707 rb_define_const(rb_mSockConst, "SOL_SOCKET", INTEGER2NUM(SOL_SOCKET));
708 #endif
709 #if defined(SOL_IP)
710 /* IP socket options */
711 rb_define_const(rb_cSocket, "SOL_IP", INTEGER2NUM(SOL_IP));
712 /* IP socket options */
713 rb_define_const(rb_mSockConst, "SOL_IP", INTEGER2NUM(SOL_IP));
714 #endif
715 #if defined(SOL_IPX)
716 /* IPX socket options */
717 rb_define_const(rb_cSocket, "SOL_IPX", INTEGER2NUM(SOL_IPX));
718 /* IPX socket options */
719 rb_define_const(rb_mSockConst, "SOL_IPX", INTEGER2NUM(SOL_IPX));
720 #endif
721 #if defined(SOL_AX25)
722 /* AX.25 socket options */
723 rb_define_const(rb_cSocket, "SOL_AX25", INTEGER2NUM(SOL_AX25));
724 /* AX.25 socket options */
725 rb_define_const(rb_mSockConst, "SOL_AX25", INTEGER2NUM(SOL_AX25));
726 #endif
727 #if defined(SOL_ATALK)
728 /* AppleTalk socket options */
729 rb_define_const(rb_cSocket, "SOL_ATALK", INTEGER2NUM(SOL_ATALK));
730 /* AppleTalk socket options */
731 rb_define_const(rb_mSockConst, "SOL_ATALK", INTEGER2NUM(SOL_ATALK));
732 #endif
733 #if defined(SOL_TCP)
734 /* TCP socket options */
735 rb_define_const(rb_cSocket, "SOL_TCP", INTEGER2NUM(SOL_TCP));
736 /* TCP socket options */
737 rb_define_const(rb_mSockConst, "SOL_TCP", INTEGER2NUM(SOL_TCP));
738 #endif
739 #if defined(SOL_UDP)
740 /* UDP socket options */
741 rb_define_const(rb_cSocket, "SOL_UDP", INTEGER2NUM(SOL_UDP));
742 /* UDP socket options */
743 rb_define_const(rb_mSockConst, "SOL_UDP", INTEGER2NUM(SOL_UDP));
744 #endif
745 #if defined(IPPROTO_IP)
746 /* Dummy protocol for IP */
747 rb_define_const(rb_cSocket, "IPPROTO_IP", INTEGER2NUM(IPPROTO_IP));
748 /* Dummy protocol for IP */
749 rb_define_const(rb_mSockConst, "IPPROTO_IP", INTEGER2NUM(IPPROTO_IP));
750 #endif
751 #if defined(IPPROTO_ICMP)
752 /* Control message protocol */
753 rb_define_const(rb_cSocket, "IPPROTO_ICMP", INTEGER2NUM(IPPROTO_ICMP));
754 /* Control message protocol */
755 rb_define_const(rb_mSockConst, "IPPROTO_ICMP", INTEGER2NUM(IPPROTO_ICMP));
756 #endif
757 #if defined(IPPROTO_IGMP)
758 /* Group Management Protocol */
759 rb_define_const(rb_cSocket, "IPPROTO_IGMP", INTEGER2NUM(IPPROTO_IGMP));
760 /* Group Management Protocol */
761 rb_define_const(rb_mSockConst, "IPPROTO_IGMP", INTEGER2NUM(IPPROTO_IGMP));
762 #endif
763 #if defined(IPPROTO_GGP)
764 /* Gateway to Gateway Protocol */
765 rb_define_const(rb_cSocket, "IPPROTO_GGP", INTEGER2NUM(IPPROTO_GGP));
766 /* Gateway to Gateway Protocol */
767 rb_define_const(rb_mSockConst, "IPPROTO_GGP", INTEGER2NUM(IPPROTO_GGP));
768 #endif
769 #if defined(IPPROTO_TCP)
770 /* TCP */
771 rb_define_const(rb_cSocket, "IPPROTO_TCP", INTEGER2NUM(IPPROTO_TCP));
772 /* TCP */
773 rb_define_const(rb_mSockConst, "IPPROTO_TCP", INTEGER2NUM(IPPROTO_TCP));
774 #endif
775 #if defined(IPPROTO_EGP)
776 /* Exterior Gateway Protocol */
777 rb_define_const(rb_cSocket, "IPPROTO_EGP", INTEGER2NUM(IPPROTO_EGP));
778 /* Exterior Gateway Protocol */
779 rb_define_const(rb_mSockConst, "IPPROTO_EGP", INTEGER2NUM(IPPROTO_EGP));
780 #endif
781 #if defined(IPPROTO_PUP)
782 /* PARC Universal Packet protocol */
783 rb_define_const(rb_cSocket, "IPPROTO_PUP", INTEGER2NUM(IPPROTO_PUP));
784 /* PARC Universal Packet protocol */
785 rb_define_const(rb_mSockConst, "IPPROTO_PUP", INTEGER2NUM(IPPROTO_PUP));
786 #endif
787 #if defined(IPPROTO_UDP)
788 /* UDP */
789 rb_define_const(rb_cSocket, "IPPROTO_UDP", INTEGER2NUM(IPPROTO_UDP));
790 /* UDP */
791 rb_define_const(rb_mSockConst, "IPPROTO_UDP", INTEGER2NUM(IPPROTO_UDP));
792 #endif
793 #if defined(IPPROTO_IDP)
794 /* XNS IDP */
795 rb_define_const(rb_cSocket, "IPPROTO_IDP", INTEGER2NUM(IPPROTO_IDP));
796 /* XNS IDP */
797 rb_define_const(rb_mSockConst, "IPPROTO_IDP", INTEGER2NUM(IPPROTO_IDP));
798 #endif
799 #if defined(IPPROTO_HELLO)
800 /* "hello" routing protocol */
801 rb_define_const(rb_cSocket, "IPPROTO_HELLO", INTEGER2NUM(IPPROTO_HELLO));
802 /* "hello" routing protocol */
803 rb_define_const(rb_mSockConst, "IPPROTO_HELLO", INTEGER2NUM(IPPROTO_HELLO));
804 #endif
805 #if defined(IPPROTO_ND)
806 /* Sun net disk protocol */
807 rb_define_const(rb_cSocket, "IPPROTO_ND", INTEGER2NUM(IPPROTO_ND));
808 /* Sun net disk protocol */
809 rb_define_const(rb_mSockConst, "IPPROTO_ND", INTEGER2NUM(IPPROTO_ND));
810 #endif
811 #if defined(IPPROTO_TP)
812 /* ISO transport protocol class 4 */
813 rb_define_const(rb_cSocket, "IPPROTO_TP", INTEGER2NUM(IPPROTO_TP));
814 /* ISO transport protocol class 4 */
815 rb_define_const(rb_mSockConst, "IPPROTO_TP", INTEGER2NUM(IPPROTO_TP));
816 #endif
817 #if defined(IPPROTO_XTP)
818 /* Xpress Transport Protocol */
819 rb_define_const(rb_cSocket, "IPPROTO_XTP", INTEGER2NUM(IPPROTO_XTP));
820 /* Xpress Transport Protocol */
821 rb_define_const(rb_mSockConst, "IPPROTO_XTP", INTEGER2NUM(IPPROTO_XTP));
822 #endif
823 #if defined(IPPROTO_EON)
824 /* ISO cnlp */
825 rb_define_const(rb_cSocket, "IPPROTO_EON", INTEGER2NUM(IPPROTO_EON));
826 /* ISO cnlp */
827 rb_define_const(rb_mSockConst, "IPPROTO_EON", INTEGER2NUM(IPPROTO_EON));
828 #endif
829 #if defined(IPPROTO_BIP)
830 /* */
831 rb_define_const(rb_cSocket, "IPPROTO_BIP", INTEGER2NUM(IPPROTO_BIP));
832 /* */
833 rb_define_const(rb_mSockConst, "IPPROTO_BIP", INTEGER2NUM(IPPROTO_BIP));
834 #endif
835 #if defined(IPPROTO_AH)
836 /* IP6 auth header */
837 rb_define_const(rb_cSocket, "IPPROTO_AH", INTEGER2NUM(IPPROTO_AH));
838 /* IP6 auth header */
839 rb_define_const(rb_mSockConst, "IPPROTO_AH", INTEGER2NUM(IPPROTO_AH));
840 #endif
841 #if defined(IPPROTO_DSTOPTS)
842 /* IP6 destination option */
843 rb_define_const(rb_cSocket, "IPPROTO_DSTOPTS", INTEGER2NUM(IPPROTO_DSTOPTS));
844 /* IP6 destination option */
845 rb_define_const(rb_mSockConst, "IPPROTO_DSTOPTS", INTEGER2NUM(IPPROTO_DSTOPTS));
846 #endif
847 #if defined(IPPROTO_ESP)
848 /* IP6 Encapsulated Security Payload */
849 rb_define_const(rb_cSocket, "IPPROTO_ESP", INTEGER2NUM(IPPROTO_ESP));
850 /* IP6 Encapsulated Security Payload */
851 rb_define_const(rb_mSockConst, "IPPROTO_ESP", INTEGER2NUM(IPPROTO_ESP));
852 #endif
853 #if defined(IPPROTO_FRAGMENT)
854 /* IP6 fragmentation header */
855 rb_define_const(rb_cSocket, "IPPROTO_FRAGMENT", INTEGER2NUM(IPPROTO_FRAGMENT));
856 /* IP6 fragmentation header */
857 rb_define_const(rb_mSockConst, "IPPROTO_FRAGMENT", INTEGER2NUM(IPPROTO_FRAGMENT));
858 #endif
859 #if defined(IPPROTO_HOPOPTS)
860 /* IP6 hop-by-hop options */
861 rb_define_const(rb_cSocket, "IPPROTO_HOPOPTS", INTEGER2NUM(IPPROTO_HOPOPTS));
862 /* IP6 hop-by-hop options */
863 rb_define_const(rb_mSockConst, "IPPROTO_HOPOPTS", INTEGER2NUM(IPPROTO_HOPOPTS));
864 #endif
865 #if defined(IPPROTO_ICMPV6)
866 /* ICMP6 */
867 rb_define_const(rb_cSocket, "IPPROTO_ICMPV6", INTEGER2NUM(IPPROTO_ICMPV6));
868 /* ICMP6 */
869 rb_define_const(rb_mSockConst, "IPPROTO_ICMPV6", INTEGER2NUM(IPPROTO_ICMPV6));
870 #endif
871 #if defined(IPPROTO_IPV6)
872 /* IP6 header */
873 rb_define_const(rb_cSocket, "IPPROTO_IPV6", INTEGER2NUM(IPPROTO_IPV6));
874 /* IP6 header */
875 rb_define_const(rb_mSockConst, "IPPROTO_IPV6", INTEGER2NUM(IPPROTO_IPV6));
876 #endif
877 #if defined(IPPROTO_NONE)
878 /* IP6 no next header */
879 rb_define_const(rb_cSocket, "IPPROTO_NONE", INTEGER2NUM(IPPROTO_NONE));
880 /* IP6 no next header */
881 rb_define_const(rb_mSockConst, "IPPROTO_NONE", INTEGER2NUM(IPPROTO_NONE));
882 #endif
883 #if defined(IPPROTO_ROUTING)
884 /* IP6 routing header */
885 rb_define_const(rb_cSocket, "IPPROTO_ROUTING", INTEGER2NUM(IPPROTO_ROUTING));
886 /* IP6 routing header */
887 rb_define_const(rb_mSockConst, "IPPROTO_ROUTING", INTEGER2NUM(IPPROTO_ROUTING));
888 #endif
889 #if defined(IPPROTO_RAW)
890 /* Raw IP packet */
891 rb_define_const(rb_cSocket, "IPPROTO_RAW", INTEGER2NUM(IPPROTO_RAW));
892 /* Raw IP packet */
893 rb_define_const(rb_mSockConst, "IPPROTO_RAW", INTEGER2NUM(IPPROTO_RAW));
894 #endif
895 #if defined(IPPROTO_MAX)
896 /* Maximum IPPROTO constant */
897 rb_define_const(rb_cSocket, "IPPROTO_MAX", INTEGER2NUM(IPPROTO_MAX));
898 /* Maximum IPPROTO constant */
899 rb_define_const(rb_mSockConst, "IPPROTO_MAX", INTEGER2NUM(IPPROTO_MAX));
900 #endif
901 #if defined(IPPORT_RESERVED)
902 /* Default minimum address for bind or connect */
903 rb_define_const(rb_cSocket, "IPPORT_RESERVED", INTEGER2NUM(IPPORT_RESERVED));
904 /* Default minimum address for bind or connect */
905 rb_define_const(rb_mSockConst, "IPPORT_RESERVED", INTEGER2NUM(IPPORT_RESERVED));
906 #endif
907 #if defined(IPPORT_USERRESERVED)
908 /* Default maximum address for bind or connect */
909 rb_define_const(rb_cSocket, "IPPORT_USERRESERVED", INTEGER2NUM(IPPORT_USERRESERVED));
910 /* Default maximum address for bind or connect */
911 rb_define_const(rb_mSockConst, "IPPORT_USERRESERVED", INTEGER2NUM(IPPORT_USERRESERVED));
912 #endif
913 #if defined(INADDR_ANY)
914 /* A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address */
915 rb_define_const(rb_cSocket, "INADDR_ANY", INTEGER2NUM(INADDR_ANY));
916 /* A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address */
917 rb_define_const(rb_mSockConst, "INADDR_ANY", INTEGER2NUM(INADDR_ANY));
918 #endif
919 #if defined(INADDR_BROADCAST)
920 /* The network broadcast address */
921 rb_define_const(rb_cSocket, "INADDR_BROADCAST", INTEGER2NUM(INADDR_BROADCAST));
922 /* The network broadcast address */
923 rb_define_const(rb_mSockConst, "INADDR_BROADCAST", INTEGER2NUM(INADDR_BROADCAST));
924 #endif
925 #if defined(INADDR_LOOPBACK)
926 /* The loopback address */
927 rb_define_const(rb_cSocket, "INADDR_LOOPBACK", INTEGER2NUM(INADDR_LOOPBACK));
928 /* The loopback address */
929 rb_define_const(rb_mSockConst, "INADDR_LOOPBACK", INTEGER2NUM(INADDR_LOOPBACK));
930 #endif
931 #if defined(INADDR_UNSPEC_GROUP)
932 /* The reserved multicast group */
933 rb_define_const(rb_cSocket, "INADDR_UNSPEC_GROUP", INTEGER2NUM(INADDR_UNSPEC_GROUP));
934 /* The reserved multicast group */
935 rb_define_const(rb_mSockConst, "INADDR_UNSPEC_GROUP", INTEGER2NUM(INADDR_UNSPEC_GROUP));
936 #endif
937 #if defined(INADDR_ALLHOSTS_GROUP)
938 /* Multicast group for all systems on this subset */
939 rb_define_const(rb_cSocket, "INADDR_ALLHOSTS_GROUP", INTEGER2NUM(INADDR_ALLHOSTS_GROUP));
940 /* Multicast group for all systems on this subset */
941 rb_define_const(rb_mSockConst, "INADDR_ALLHOSTS_GROUP", INTEGER2NUM(INADDR_ALLHOSTS_GROUP));
942 #endif
943 #if defined(INADDR_MAX_LOCAL_GROUP)
944 /* The last local network multicast group */
945 rb_define_const(rb_cSocket, "INADDR_MAX_LOCAL_GROUP", INTEGER2NUM(INADDR_MAX_LOCAL_GROUP));
946 /* The last local network multicast group */
947 rb_define_const(rb_mSockConst, "INADDR_MAX_LOCAL_GROUP", INTEGER2NUM(INADDR_MAX_LOCAL_GROUP));
948 #endif
949 #if defined(INADDR_NONE)
950 /* A bitmask for matching no valid IP address */
951 rb_define_const(rb_cSocket, "INADDR_NONE", INTEGER2NUM(INADDR_NONE));
952 /* A bitmask for matching no valid IP address */
953 rb_define_const(rb_mSockConst, "INADDR_NONE", INTEGER2NUM(INADDR_NONE));
954 #endif
955 #if defined(IP_OPTIONS)
956 /* IP options to be included in packets */
957 rb_define_const(rb_cSocket, "IP_OPTIONS", INTEGER2NUM(IP_OPTIONS));
958 /* IP options to be included in packets */
959 rb_define_const(rb_mSockConst, "IP_OPTIONS", INTEGER2NUM(IP_OPTIONS));
960 #endif
961 #if defined(IP_HDRINCL)
962 /* Header is included with data */
963 rb_define_const(rb_cSocket, "IP_HDRINCL", INTEGER2NUM(IP_HDRINCL));
964 /* Header is included with data */
965 rb_define_const(rb_mSockConst, "IP_HDRINCL", INTEGER2NUM(IP_HDRINCL));
966 #endif
967 #if defined(IP_TOS)
968 /* IP type-of-service */
969 rb_define_const(rb_cSocket, "IP_TOS", INTEGER2NUM(IP_TOS));
970 /* IP type-of-service */
971 rb_define_const(rb_mSockConst, "IP_TOS", INTEGER2NUM(IP_TOS));
972 #endif
973 #if defined(IP_TTL)
974 /* IP time-to-live */
975 rb_define_const(rb_cSocket, "IP_TTL", INTEGER2NUM(IP_TTL));
976 /* IP time-to-live */
977 rb_define_const(rb_mSockConst, "IP_TTL", INTEGER2NUM(IP_TTL));
978 #endif
979 #if defined(IP_RECVOPTS)
980 /* Receive all IP options with datagram */
981 rb_define_const(rb_cSocket, "IP_RECVOPTS", INTEGER2NUM(IP_RECVOPTS));
982 /* Receive all IP options with datagram */
983 rb_define_const(rb_mSockConst, "IP_RECVOPTS", INTEGER2NUM(IP_RECVOPTS));
984 #endif
985 #if defined(IP_RECVRETOPTS)
986 /* Receive all IP options for response */
987 rb_define_const(rb_cSocket, "IP_RECVRETOPTS", INTEGER2NUM(IP_RECVRETOPTS));
988 /* Receive all IP options for response */
989 rb_define_const(rb_mSockConst, "IP_RECVRETOPTS", INTEGER2NUM(IP_RECVRETOPTS));
990 #endif
991 #if defined(IP_RECVDSTADDR)
992 /* Receive IP destination address with datagram */
993 rb_define_const(rb_cSocket, "IP_RECVDSTADDR", INTEGER2NUM(IP_RECVDSTADDR));
994 /* Receive IP destination address with datagram */
995 rb_define_const(rb_mSockConst, "IP_RECVDSTADDR", INTEGER2NUM(IP_RECVDSTADDR));
996 #endif
997 #if defined(IP_RETOPTS)
998 /* IP options to be included in datagrams */
999 rb_define_const(rb_cSocket, "IP_RETOPTS", INTEGER2NUM(IP_RETOPTS));
1000 /* IP options to be included in datagrams */
1001 rb_define_const(rb_mSockConst, "IP_RETOPTS", INTEGER2NUM(IP_RETOPTS));
1002 #endif
1003 #if defined(IP_MINTTL)
1004 /* Minimum TTL allowed for received packets */
1005 rb_define_const(rb_cSocket, "IP_MINTTL", INTEGER2NUM(IP_MINTTL));
1006 /* Minimum TTL allowed for received packets */
1007 rb_define_const(rb_mSockConst, "IP_MINTTL", INTEGER2NUM(IP_MINTTL));
1008 #endif
1009 #if defined(IP_DONTFRAG)
1010 /* Don't fragment packets */
1011 rb_define_const(rb_cSocket, "IP_DONTFRAG", INTEGER2NUM(IP_DONTFRAG));
1012 /* Don't fragment packets */
1013 rb_define_const(rb_mSockConst, "IP_DONTFRAG", INTEGER2NUM(IP_DONTFRAG));
1014 #endif
1015 #if defined(IP_SENDSRCADDR)
1016 /* Source address for outgoing UDP datagrams */
1017 rb_define_const(rb_cSocket, "IP_SENDSRCADDR", INTEGER2NUM(IP_SENDSRCADDR));
1018 /* Source address for outgoing UDP datagrams */
1019 rb_define_const(rb_mSockConst, "IP_SENDSRCADDR", INTEGER2NUM(IP_SENDSRCADDR));
1020 #endif
1021 #if defined(IP_ONESBCAST)
1022 /* Force outgoing broadcast datagrams to have the undirected broadcast address */
1023 rb_define_const(rb_cSocket, "IP_ONESBCAST", INTEGER2NUM(IP_ONESBCAST));
1024 /* Force outgoing broadcast datagrams to have the undirected broadcast address */
1025 rb_define_const(rb_mSockConst, "IP_ONESBCAST", INTEGER2NUM(IP_ONESBCAST));
1026 #endif
1027 #if defined(IP_RECVTTL)
1028 /* Receive IP TTL with datagrams */
1029 rb_define_const(rb_cSocket, "IP_RECVTTL", INTEGER2NUM(IP_RECVTTL));
1030 /* Receive IP TTL with datagrams */
1031 rb_define_const(rb_mSockConst, "IP_RECVTTL", INTEGER2NUM(IP_RECVTTL));
1032 #endif
1033 #if defined(IP_RECVIF)
1034 /* Receive interface information with datagrams */
1035 rb_define_const(rb_cSocket, "IP_RECVIF", INTEGER2NUM(IP_RECVIF));
1036 /* Receive interface information with datagrams */
1037 rb_define_const(rb_mSockConst, "IP_RECVIF", INTEGER2NUM(IP_RECVIF));
1038 #endif
1039 #if defined(IP_RECVSLLA)
1040 /* Receive link-layer address with datagrams */
1041 rb_define_const(rb_cSocket, "IP_RECVSLLA", INTEGER2NUM(IP_RECVSLLA));
1042 /* Receive link-layer address with datagrams */
1043 rb_define_const(rb_mSockConst, "IP_RECVSLLA", INTEGER2NUM(IP_RECVSLLA));
1044 #endif
1045 #if defined(IP_PORTRANGE)
1046 /* Set the port range for sockets with unspecified port numbers */
1047 rb_define_const(rb_cSocket, "IP_PORTRANGE", INTEGER2NUM(IP_PORTRANGE));
1048 /* Set the port range for sockets with unspecified port numbers */
1049 rb_define_const(rb_mSockConst, "IP_PORTRANGE", INTEGER2NUM(IP_PORTRANGE));
1050 #endif
1051 #if defined(IP_MULTICAST_IF)
1052 /* IP multicast interface */
1053 rb_define_const(rb_cSocket, "IP_MULTICAST_IF", INTEGER2NUM(IP_MULTICAST_IF));
1054 /* IP multicast interface */
1055 rb_define_const(rb_mSockConst, "IP_MULTICAST_IF", INTEGER2NUM(IP_MULTICAST_IF));
1056 #endif
1057 #if defined(IP_MULTICAST_TTL)
1058 /* IP multicast TTL */
1059 rb_define_const(rb_cSocket, "IP_MULTICAST_TTL", INTEGER2NUM(IP_MULTICAST_TTL));
1060 /* IP multicast TTL */
1061 rb_define_const(rb_mSockConst, "IP_MULTICAST_TTL", INTEGER2NUM(IP_MULTICAST_TTL));
1062 #endif
1063 #if defined(IP_MULTICAST_LOOP)
1064 /* IP multicast loopback */
1065 rb_define_const(rb_cSocket, "IP_MULTICAST_LOOP", INTEGER2NUM(IP_MULTICAST_LOOP));
1066 /* IP multicast loopback */
1067 rb_define_const(rb_mSockConst, "IP_MULTICAST_LOOP", INTEGER2NUM(IP_MULTICAST_LOOP));
1068 #endif
1069 #if defined(IP_ADD_MEMBERSHIP)
1070 /* Add a multicast group membership */
1071 rb_define_const(rb_cSocket, "IP_ADD_MEMBERSHIP", INTEGER2NUM(IP_ADD_MEMBERSHIP));
1072 /* Add a multicast group membership */
1073 rb_define_const(rb_mSockConst, "IP_ADD_MEMBERSHIP", INTEGER2NUM(IP_ADD_MEMBERSHIP));
1074 #endif
1075 #if defined(IP_DROP_MEMBERSHIP)
1076 /* Drop a multicast group membership */
1077 rb_define_const(rb_cSocket, "IP_DROP_MEMBERSHIP", INTEGER2NUM(IP_DROP_MEMBERSHIP));
1078 /* Drop a multicast group membership */
1079 rb_define_const(rb_mSockConst, "IP_DROP_MEMBERSHIP", INTEGER2NUM(IP_DROP_MEMBERSHIP));
1080 #endif
1081 #if defined(IP_DEFAULT_MULTICAST_TTL)
1082 /* Default multicast TTL */
1083 rb_define_const(rb_cSocket, "IP_DEFAULT_MULTICAST_TTL", INTEGER2NUM(IP_DEFAULT_MULTICAST_TTL));
1084 /* Default multicast TTL */
1085 rb_define_const(rb_mSockConst, "IP_DEFAULT_MULTICAST_TTL", INTEGER2NUM(IP_DEFAULT_MULTICAST_TTL));
1086 #endif
1087 #if defined(IP_DEFAULT_MULTICAST_LOOP)
1088 /* Default multicast loopback */
1089 rb_define_const(rb_cSocket, "IP_DEFAULT_MULTICAST_LOOP", INTEGER2NUM(IP_DEFAULT_MULTICAST_LOOP));
1090 /* Default multicast loopback */
1091 rb_define_const(rb_mSockConst, "IP_DEFAULT_MULTICAST_LOOP", INTEGER2NUM(IP_DEFAULT_MULTICAST_LOOP));
1092 #endif
1093 #if defined(IP_MAX_MEMBERSHIPS)
1094 /* Maximum number multicast groups a socket can join */
1095 rb_define_const(rb_cSocket, "IP_MAX_MEMBERSHIPS", INTEGER2NUM(IP_MAX_MEMBERSHIPS));
1096 /* Maximum number multicast groups a socket can join */
1097 rb_define_const(rb_mSockConst, "IP_MAX_MEMBERSHIPS", INTEGER2NUM(IP_MAX_MEMBERSHIPS));
1098 #endif
1099 #if defined(IP_ROUTER_ALERT)
1100 /* Notify transit routers to more closely examine the contents of an IP packet */
1101 rb_define_const(rb_cSocket, "IP_ROUTER_ALERT", INTEGER2NUM(IP_ROUTER_ALERT));
1102 /* Notify transit routers to more closely examine the contents of an IP packet */
1103 rb_define_const(rb_mSockConst, "IP_ROUTER_ALERT", INTEGER2NUM(IP_ROUTER_ALERT));
1104 #endif
1105 #if defined(IP_PKTINFO)
1106 /* Receive packet information with datagrams */
1107 rb_define_const(rb_cSocket, "IP_PKTINFO", INTEGER2NUM(IP_PKTINFO));
1108 /* Receive packet information with datagrams */
1109 rb_define_const(rb_mSockConst, "IP_PKTINFO", INTEGER2NUM(IP_PKTINFO));
1110 #endif
1111 #if defined(IP_PKTOPTIONS)
1112 /* Receive packet options with datagrams */
1113 rb_define_const(rb_cSocket, "IP_PKTOPTIONS", INTEGER2NUM(IP_PKTOPTIONS));
1114 /* Receive packet options with datagrams */
1115 rb_define_const(rb_mSockConst, "IP_PKTOPTIONS", INTEGER2NUM(IP_PKTOPTIONS));
1116 #endif
1117 #if defined(IP_MTU_DISCOVER)
1118 /* Path MTU discovery */
1119 rb_define_const(rb_cSocket, "IP_MTU_DISCOVER", INTEGER2NUM(IP_MTU_DISCOVER));
1120 /* Path MTU discovery */
1121 rb_define_const(rb_mSockConst, "IP_MTU_DISCOVER", INTEGER2NUM(IP_MTU_DISCOVER));
1122 #endif
1123 #if defined(IP_RECVERR)
1124 /* Enable extended reliable error message passing */
1125 rb_define_const(rb_cSocket, "IP_RECVERR", INTEGER2NUM(IP_RECVERR));
1126 /* Enable extended reliable error message passing */
1127 rb_define_const(rb_mSockConst, "IP_RECVERR", INTEGER2NUM(IP_RECVERR));
1128 #endif
1129 #if defined(IP_RECVTOS)
1130 /* Receive TOS with incoming packets */
1131 rb_define_const(rb_cSocket, "IP_RECVTOS", INTEGER2NUM(IP_RECVTOS));
1132 /* Receive TOS with incoming packets */
1133 rb_define_const(rb_mSockConst, "IP_RECVTOS", INTEGER2NUM(IP_RECVTOS));
1134 #endif
1135 #if defined(IP_MTU)
1136 /* The Maximum Transmission Unit of the socket */
1137 rb_define_const(rb_cSocket, "IP_MTU", INTEGER2NUM(IP_MTU));
1138 /* The Maximum Transmission Unit of the socket */
1139 rb_define_const(rb_mSockConst, "IP_MTU", INTEGER2NUM(IP_MTU));
1140 #endif
1141 #if defined(IP_FREEBIND)
1142 /* Allow binding to nonexistent IP addresses */
1143 rb_define_const(rb_cSocket, "IP_FREEBIND", INTEGER2NUM(IP_FREEBIND));
1144 /* Allow binding to nonexistent IP addresses */
1145 rb_define_const(rb_mSockConst, "IP_FREEBIND", INTEGER2NUM(IP_FREEBIND));
1146 #endif
1147 #if defined(IP_IPSEC_POLICY)
1148 /* IPsec security policy */
1149 rb_define_const(rb_cSocket, "IP_IPSEC_POLICY", INTEGER2NUM(IP_IPSEC_POLICY));
1150 /* IPsec security policy */
1151 rb_define_const(rb_mSockConst, "IP_IPSEC_POLICY", INTEGER2NUM(IP_IPSEC_POLICY));
1152 #endif
1153 #if defined(IP_XFRM_POLICY)
1154 /* */
1155 rb_define_const(rb_cSocket, "IP_XFRM_POLICY", INTEGER2NUM(IP_XFRM_POLICY));
1156 /* */
1157 rb_define_const(rb_mSockConst, "IP_XFRM_POLICY", INTEGER2NUM(IP_XFRM_POLICY));
1158 #endif
1159 #if defined(IP_PASSSEC)
1160 /* Retrieve security context with datagram */
1161 rb_define_const(rb_cSocket, "IP_PASSSEC", INTEGER2NUM(IP_PASSSEC));
1162 /* Retrieve security context with datagram */
1163 rb_define_const(rb_mSockConst, "IP_PASSSEC", INTEGER2NUM(IP_PASSSEC));
1164 #endif
1165 #if defined(IP_PMTUDISC_DONT)
1166 /* Never send DF frames */
1167 rb_define_const(rb_cSocket, "IP_PMTUDISC_DONT", INTEGER2NUM(IP_PMTUDISC_DONT));
1168 /* Never send DF frames */
1169 rb_define_const(rb_mSockConst, "IP_PMTUDISC_DONT", INTEGER2NUM(IP_PMTUDISC_DONT));
1170 #endif
1171 #if defined(IP_PMTUDISC_WANT)
1172 /* Use per-route hints */
1173 rb_define_const(rb_cSocket, "IP_PMTUDISC_WANT", INTEGER2NUM(IP_PMTUDISC_WANT));
1174 /* Use per-route hints */
1175 rb_define_const(rb_mSockConst, "IP_PMTUDISC_WANT", INTEGER2NUM(IP_PMTUDISC_WANT));
1176 #endif
1177 #if defined(IP_PMTUDISC_DO)
1178 /* Always send DF frames */
1179 rb_define_const(rb_cSocket, "IP_PMTUDISC_DO", INTEGER2NUM(IP_PMTUDISC_DO));
1180 /* Always send DF frames */
1181 rb_define_const(rb_mSockConst, "IP_PMTUDISC_DO", INTEGER2NUM(IP_PMTUDISC_DO));
1182 #endif
1183 #if defined(IP_UNBLOCK_SOURCE)
1184 /* Unblock IPv4 multicast packets with a give source address */
1185 rb_define_const(rb_cSocket, "IP_UNBLOCK_SOURCE", INTEGER2NUM(IP_UNBLOCK_SOURCE));
1186 /* Unblock IPv4 multicast packets with a give source address */
1187 rb_define_const(rb_mSockConst, "IP_UNBLOCK_SOURCE", INTEGER2NUM(IP_UNBLOCK_SOURCE));
1188 #endif
1189 #if defined(IP_BLOCK_SOURCE)
1190 /* Block IPv4 multicast packets with a give source address */
1191 rb_define_const(rb_cSocket, "IP_BLOCK_SOURCE", INTEGER2NUM(IP_BLOCK_SOURCE));
1192 /* Block IPv4 multicast packets with a give source address */
1193 rb_define_const(rb_mSockConst, "IP_BLOCK_SOURCE", INTEGER2NUM(IP_BLOCK_SOURCE));
1194 #endif
1195 #if defined(IP_ADD_SOURCE_MEMBERSHIP)
1196 /* Add a multicast group membership */
1197 rb_define_const(rb_cSocket, "IP_ADD_SOURCE_MEMBERSHIP", INTEGER2NUM(IP_ADD_SOURCE_MEMBERSHIP));
1198 /* Add a multicast group membership */
1199 rb_define_const(rb_mSockConst, "IP_ADD_SOURCE_MEMBERSHIP", INTEGER2NUM(IP_ADD_SOURCE_MEMBERSHIP));
1200 #endif
1201 #if defined(IP_DROP_SOURCE_MEMBERSHIP)
1202 /* Drop a multicast group membership */
1203 rb_define_const(rb_cSocket, "IP_DROP_SOURCE_MEMBERSHIP", INTEGER2NUM(IP_DROP_SOURCE_MEMBERSHIP));
1204 /* Drop a multicast group membership */
1205 rb_define_const(rb_mSockConst, "IP_DROP_SOURCE_MEMBERSHIP", INTEGER2NUM(IP_DROP_SOURCE_MEMBERSHIP));
1206 #endif
1207 #if defined(IP_MSFILTER)
1208 /* Multicast source filtering */
1209 rb_define_const(rb_cSocket, "IP_MSFILTER", INTEGER2NUM(IP_MSFILTER));
1210 /* Multicast source filtering */
1211 rb_define_const(rb_mSockConst, "IP_MSFILTER", INTEGER2NUM(IP_MSFILTER));
1212 #endif
1213 #if defined(MCAST_JOIN_GROUP)
1214 /* Join a multicast group */
1215 rb_define_const(rb_cSocket, "MCAST_JOIN_GROUP", INTEGER2NUM(MCAST_JOIN_GROUP));
1216 /* Join a multicast group */
1217 rb_define_const(rb_mSockConst, "MCAST_JOIN_GROUP", INTEGER2NUM(MCAST_JOIN_GROUP));
1218 #endif
1219 #if defined(MCAST_BLOCK_SOURCE)
1220 /* Block multicast packets from this source */
1221 rb_define_const(rb_cSocket, "MCAST_BLOCK_SOURCE", INTEGER2NUM(MCAST_BLOCK_SOURCE));
1222 /* Block multicast packets from this source */
1223 rb_define_const(rb_mSockConst, "MCAST_BLOCK_SOURCE", INTEGER2NUM(MCAST_BLOCK_SOURCE));
1224 #endif
1225 #if defined(MCAST_UNBLOCK_SOURCE)
1226 /* Unblock multicast packets from this source */
1227 rb_define_const(rb_cSocket, "MCAST_UNBLOCK_SOURCE", INTEGER2NUM(MCAST_UNBLOCK_SOURCE));
1228 /* Unblock multicast packets from this source */
1229 rb_define_const(rb_mSockConst, "MCAST_UNBLOCK_SOURCE", INTEGER2NUM(MCAST_UNBLOCK_SOURCE));
1230 #endif
1231 #if defined(MCAST_LEAVE_GROUP)
1232 /* Leave a multicast group */
1233 rb_define_const(rb_cSocket, "MCAST_LEAVE_GROUP", INTEGER2NUM(MCAST_LEAVE_GROUP));
1234 /* Leave a multicast group */
1235 rb_define_const(rb_mSockConst, "MCAST_LEAVE_GROUP", INTEGER2NUM(MCAST_LEAVE_GROUP));
1236 #endif
1237 #if defined(MCAST_JOIN_SOURCE_GROUP)
1238 /* Join a multicast source group */
1239 rb_define_const(rb_cSocket, "MCAST_JOIN_SOURCE_GROUP", INTEGER2NUM(MCAST_JOIN_SOURCE_GROUP));
1240 /* Join a multicast source group */
1241 rb_define_const(rb_mSockConst, "MCAST_JOIN_SOURCE_GROUP", INTEGER2NUM(MCAST_JOIN_SOURCE_GROUP));
1242 #endif
1243 #if defined(MCAST_LEAVE_SOURCE_GROUP)
1244 /* Leave a multicast source group */
1245 rb_define_const(rb_cSocket, "MCAST_LEAVE_SOURCE_GROUP", INTEGER2NUM(MCAST_LEAVE_SOURCE_GROUP));
1246 /* Leave a multicast source group */
1247 rb_define_const(rb_mSockConst, "MCAST_LEAVE_SOURCE_GROUP", INTEGER2NUM(MCAST_LEAVE_SOURCE_GROUP));
1248 #endif
1249 #if defined(MCAST_MSFILTER)
1250 /* Multicast source filtering */
1251 rb_define_const(rb_cSocket, "MCAST_MSFILTER", INTEGER2NUM(MCAST_MSFILTER));
1252 /* Multicast source filtering */
1253 rb_define_const(rb_mSockConst, "MCAST_MSFILTER", INTEGER2NUM(MCAST_MSFILTER));
1254 #endif
1255 #if defined(MCAST_EXCLUDE)
1256 /* Exclusive multicast source filter */
1257 rb_define_const(rb_cSocket, "MCAST_EXCLUDE", INTEGER2NUM(MCAST_EXCLUDE));
1258 /* Exclusive multicast source filter */
1259 rb_define_const(rb_mSockConst, "MCAST_EXCLUDE", INTEGER2NUM(MCAST_EXCLUDE));
1260 #endif
1261 #if defined(MCAST_INCLUDE)
1262 /* Inclusive multicast source filter */
1263 rb_define_const(rb_cSocket, "MCAST_INCLUDE", INTEGER2NUM(MCAST_INCLUDE));
1264 /* Inclusive multicast source filter */
1265 rb_define_const(rb_mSockConst, "MCAST_INCLUDE", INTEGER2NUM(MCAST_INCLUDE));
1266 #endif
1267 #if defined(SO_DEBUG)
1268 /* Debug info recording */
1269 rb_define_const(rb_cSocket, "SO_DEBUG", INTEGER2NUM(SO_DEBUG));
1270 /* Debug info recording */
1271 rb_define_const(rb_mSockConst, "SO_DEBUG", INTEGER2NUM(SO_DEBUG));
1272 #endif
1273 #if defined(SO_REUSEADDR)
1274 /* Allow local address reuse */
1275 rb_define_const(rb_cSocket, "SO_REUSEADDR", INTEGER2NUM(SO_REUSEADDR));
1276 /* Allow local address reuse */
1277 rb_define_const(rb_mSockConst, "SO_REUSEADDR", INTEGER2NUM(SO_REUSEADDR));
1278 #endif
1279 #if defined(SO_REUSEPORT)
1280 /* Allow local address and port reuse */
1281 rb_define_const(rb_cSocket, "SO_REUSEPORT", INTEGER2NUM(SO_REUSEPORT));
1282 /* Allow local address and port reuse */
1283 rb_define_const(rb_mSockConst, "SO_REUSEPORT", INTEGER2NUM(SO_REUSEPORT));
1284 #endif
1285 #if defined(SO_TYPE)
1286 /* Get the socket type */
1287 rb_define_const(rb_cSocket, "SO_TYPE", INTEGER2NUM(SO_TYPE));
1288 /* Get the socket type */
1289 rb_define_const(rb_mSockConst, "SO_TYPE", INTEGER2NUM(SO_TYPE));
1290 #endif
1291 #if defined(SO_ERROR)
1292 /* Get and clear the error status */
1293 rb_define_const(rb_cSocket, "SO_ERROR", INTEGER2NUM(SO_ERROR));
1294 /* Get and clear the error status */
1295 rb_define_const(rb_mSockConst, "SO_ERROR", INTEGER2NUM(SO_ERROR));
1296 #endif
1297 #if defined(SO_DONTROUTE)
1298 /* Use interface addresses */
1299 rb_define_const(rb_cSocket, "SO_DONTROUTE", INTEGER2NUM(SO_DONTROUTE));
1300 /* Use interface addresses */
1301 rb_define_const(rb_mSockConst, "SO_DONTROUTE", INTEGER2NUM(SO_DONTROUTE));
1302 #endif
1303 #if defined(SO_BROADCAST)
1304 /* Permit sending of broadcast messages */
1305 rb_define_const(rb_cSocket, "SO_BROADCAST", INTEGER2NUM(SO_BROADCAST));
1306 /* Permit sending of broadcast messages */
1307 rb_define_const(rb_mSockConst, "SO_BROADCAST", INTEGER2NUM(SO_BROADCAST));
1308 #endif
1309 #if defined(SO_SNDBUF)
1310 /* Send buffer size */
1311 rb_define_const(rb_cSocket, "SO_SNDBUF", INTEGER2NUM(SO_SNDBUF));
1312 /* Send buffer size */
1313 rb_define_const(rb_mSockConst, "SO_SNDBUF", INTEGER2NUM(SO_SNDBUF));
1314 #endif
1315 #if defined(SO_RCVBUF)
1316 /* Receive buffer size */
1317 rb_define_const(rb_cSocket, "SO_RCVBUF", INTEGER2NUM(SO_RCVBUF));
1318 /* Receive buffer size */
1319 rb_define_const(rb_mSockConst, "SO_RCVBUF", INTEGER2NUM(SO_RCVBUF));
1320 #endif
1321 #if defined(SO_KEEPALIVE)
1322 /* Keep connections alive */
1323 rb_define_const(rb_cSocket, "SO_KEEPALIVE", INTEGER2NUM(SO_KEEPALIVE));
1324 /* Keep connections alive */
1325 rb_define_const(rb_mSockConst, "SO_KEEPALIVE", INTEGER2NUM(SO_KEEPALIVE));
1326 #endif
1327 #if defined(SO_OOBINLINE)
1328 /* Leave received out-of-band data in-line */
1329 rb_define_const(rb_cSocket, "SO_OOBINLINE", INTEGER2NUM(SO_OOBINLINE));
1330 /* Leave received out-of-band data in-line */
1331 rb_define_const(rb_mSockConst, "SO_OOBINLINE", INTEGER2NUM(SO_OOBINLINE));
1332 #endif
1333 #if defined(SO_NO_CHECK)
1334 /* Disable checksums */
1335 rb_define_const(rb_cSocket, "SO_NO_CHECK", INTEGER2NUM(SO_NO_CHECK));
1336 /* Disable checksums */
1337 rb_define_const(rb_mSockConst, "SO_NO_CHECK", INTEGER2NUM(SO_NO_CHECK));
1338 #endif
1339 #if defined(SO_PRIORITY)
1340 /* The protocol-defined priority for all packets on this socket */
1341 rb_define_const(rb_cSocket, "SO_PRIORITY", INTEGER2NUM(SO_PRIORITY));
1342 /* The protocol-defined priority for all packets on this socket */
1343 rb_define_const(rb_mSockConst, "SO_PRIORITY", INTEGER2NUM(SO_PRIORITY));
1344 #endif
1345 #if defined(SO_LINGER)
1346 /* Linger on close if data is present */
1347 rb_define_const(rb_cSocket, "SO_LINGER", INTEGER2NUM(SO_LINGER));
1348 /* Linger on close if data is present */
1349 rb_define_const(rb_mSockConst, "SO_LINGER", INTEGER2NUM(SO_LINGER));
1350 #endif
1351 #if defined(SO_PASSCRED)
1352 /* Receive SCM_CREDENTIALS messages */
1353 rb_define_const(rb_cSocket, "SO_PASSCRED", INTEGER2NUM(SO_PASSCRED));
1354 /* Receive SCM_CREDENTIALS messages */
1355 rb_define_const(rb_mSockConst, "SO_PASSCRED", INTEGER2NUM(SO_PASSCRED));
1356 #endif
1357 #if defined(SO_PEERCRED)
1358 /* The credentials of the foreign process connected to this socket */
1359 rb_define_const(rb_cSocket, "SO_PEERCRED", INTEGER2NUM(SO_PEERCRED));
1360 /* The credentials of the foreign process connected to this socket */
1361 rb_define_const(rb_mSockConst, "SO_PEERCRED", INTEGER2NUM(SO_PEERCRED));
1362 #endif
1363 #if defined(SO_RCVLOWAT)
1364 /* Receive low-water mark */
1365 rb_define_const(rb_cSocket, "SO_RCVLOWAT", INTEGER2NUM(SO_RCVLOWAT));
1366 /* Receive low-water mark */
1367 rb_define_const(rb_mSockConst, "SO_RCVLOWAT", INTEGER2NUM(SO_RCVLOWAT));
1368 #endif
1369 #if defined(SO_SNDLOWAT)
1370 /* Send low-water mark */
1371 rb_define_const(rb_cSocket, "SO_SNDLOWAT", INTEGER2NUM(SO_SNDLOWAT));
1372 /* Send low-water mark */
1373 rb_define_const(rb_mSockConst, "SO_SNDLOWAT", INTEGER2NUM(SO_SNDLOWAT));
1374 #endif
1375 #if defined(SO_RCVTIMEO)
1376 /* Receive timeout */
1377 rb_define_const(rb_cSocket, "SO_RCVTIMEO", INTEGER2NUM(SO_RCVTIMEO));
1378 /* Receive timeout */
1379 rb_define_const(rb_mSockConst, "SO_RCVTIMEO", INTEGER2NUM(SO_RCVTIMEO));
1380 #endif
1381 #if defined(SO_SNDTIMEO)
1382 /* Send timeout */
1383 rb_define_const(rb_cSocket, "SO_SNDTIMEO", INTEGER2NUM(SO_SNDTIMEO));
1384 /* Send timeout */
1385 rb_define_const(rb_mSockConst, "SO_SNDTIMEO", INTEGER2NUM(SO_SNDTIMEO));
1386 #endif
1387 #if defined(SO_ACCEPTCONN)
1388 /* Socket has had listen() called on it */
1389 rb_define_const(rb_cSocket, "SO_ACCEPTCONN", INTEGER2NUM(SO_ACCEPTCONN));
1390 /* Socket has had listen() called on it */
1391 rb_define_const(rb_mSockConst, "SO_ACCEPTCONN", INTEGER2NUM(SO_ACCEPTCONN));
1392 #endif
1393 #if defined(SO_USELOOPBACK)
1394 /* Bypass hardware when possible */
1395 rb_define_const(rb_cSocket, "SO_USELOOPBACK", INTEGER2NUM(SO_USELOOPBACK));
1396 /* Bypass hardware when possible */
1397 rb_define_const(rb_mSockConst, "SO_USELOOPBACK", INTEGER2NUM(SO_USELOOPBACK));
1398 #endif
1399 #if defined(SO_ACCEPTFILTER)
1400 /* There is an accept filter */
1401 rb_define_const(rb_cSocket, "SO_ACCEPTFILTER", INTEGER2NUM(SO_ACCEPTFILTER));
1402 /* There is an accept filter */
1403 rb_define_const(rb_mSockConst, "SO_ACCEPTFILTER", INTEGER2NUM(SO_ACCEPTFILTER));
1404 #endif
1405 #if defined(SO_DONTTRUNC)
1406 /* Retain unread data */
1407 rb_define_const(rb_cSocket, "SO_DONTTRUNC", INTEGER2NUM(SO_DONTTRUNC));
1408 /* Retain unread data */
1409 rb_define_const(rb_mSockConst, "SO_DONTTRUNC", INTEGER2NUM(SO_DONTTRUNC));
1410 #endif
1411 #if defined(SO_WANTMORE)
1412 /* Give a hint when more data is ready */
1413 rb_define_const(rb_cSocket, "SO_WANTMORE", INTEGER2NUM(SO_WANTMORE));
1414 /* Give a hint when more data is ready */
1415 rb_define_const(rb_mSockConst, "SO_WANTMORE", INTEGER2NUM(SO_WANTMORE));
1416 #endif
1417 #if defined(SO_WANTOOBFLAG)
1418 /* OOB data is wanted in MSG_FLAG on receive */
1419 rb_define_const(rb_cSocket, "SO_WANTOOBFLAG", INTEGER2NUM(SO_WANTOOBFLAG));
1420 /* OOB data is wanted in MSG_FLAG on receive */
1421 rb_define_const(rb_mSockConst, "SO_WANTOOBFLAG", INTEGER2NUM(SO_WANTOOBFLAG));
1422 #endif
1423 #if defined(SO_NREAD)
1424 /* Get first packet byte count */
1425 rb_define_const(rb_cSocket, "SO_NREAD", INTEGER2NUM(SO_NREAD));
1426 /* Get first packet byte count */
1427 rb_define_const(rb_mSockConst, "SO_NREAD", INTEGER2NUM(SO_NREAD));
1428 #endif
1429 #if defined(SO_NKE)
1430 /* Install socket-level Network Kernel Extension */
1431 rb_define_const(rb_cSocket, "SO_NKE", INTEGER2NUM(SO_NKE));
1432 /* Install socket-level Network Kernel Extension */
1433 rb_define_const(rb_mSockConst, "SO_NKE", INTEGER2NUM(SO_NKE));
1434 #endif
1435 #if defined(SO_NOSIGPIPE)
1436 /* Don't SIGPIPE on EPIPE */
1437 rb_define_const(rb_cSocket, "SO_NOSIGPIPE", INTEGER2NUM(SO_NOSIGPIPE));
1438 /* Don't SIGPIPE on EPIPE */
1439 rb_define_const(rb_mSockConst, "SO_NOSIGPIPE", INTEGER2NUM(SO_NOSIGPIPE));
1440 #endif
1441 #if defined(SO_SECURITY_AUTHENTICATION)
1442 /* */
1443 rb_define_const(rb_cSocket, "SO_SECURITY_AUTHENTICATION", INTEGER2NUM(SO_SECURITY_AUTHENTICATION));
1444 /* */
1445 rb_define_const(rb_mSockConst, "SO_SECURITY_AUTHENTICATION", INTEGER2NUM(SO_SECURITY_AUTHENTICATION));
1446 #endif
1447 #if defined(SO_SECURITY_ENCRYPTION_TRANSPORT)
1448 /* */
1449 rb_define_const(rb_cSocket, "SO_SECURITY_ENCRYPTION_TRANSPORT", INTEGER2NUM(SO_SECURITY_ENCRYPTION_TRANSPORT));
1450 /* */
1451 rb_define_const(rb_mSockConst, "SO_SECURITY_ENCRYPTION_TRANSPORT", INTEGER2NUM(SO_SECURITY_ENCRYPTION_TRANSPORT));
1452 #endif
1453 #if defined(SO_SECURITY_ENCRYPTION_NETWORK)
1454 /* */
1455 rb_define_const(rb_cSocket, "SO_SECURITY_ENCRYPTION_NETWORK", INTEGER2NUM(SO_SECURITY_ENCRYPTION_NETWORK));
1456 /* */
1457 rb_define_const(rb_mSockConst, "SO_SECURITY_ENCRYPTION_NETWORK", INTEGER2NUM(SO_SECURITY_ENCRYPTION_NETWORK));
1458 #endif
1459 #if defined(SO_BINDTODEVICE)
1460 /* Only send packets from the given interface */
1461 rb_define_const(rb_cSocket, "SO_BINDTODEVICE", INTEGER2NUM(SO_BINDTODEVICE));
1462 /* Only send packets from the given interface */
1463 rb_define_const(rb_mSockConst, "SO_BINDTODEVICE", INTEGER2NUM(SO_BINDTODEVICE));
1464 #endif
1465 #if defined(SO_ATTACH_FILTER)
1466 /* Attach an accept filter */
1467 rb_define_const(rb_cSocket, "SO_ATTACH_FILTER", INTEGER2NUM(SO_ATTACH_FILTER));
1468 /* Attach an accept filter */
1469 rb_define_const(rb_mSockConst, "SO_ATTACH_FILTER", INTEGER2NUM(SO_ATTACH_FILTER));
1470 #endif
1471 #if defined(SO_DETACH_FILTER)
1472 /* Detach an accept filter */
1473 rb_define_const(rb_cSocket, "SO_DETACH_FILTER", INTEGER2NUM(SO_DETACH_FILTER));
1474 /* Detach an accept filter */
1475 rb_define_const(rb_mSockConst, "SO_DETACH_FILTER", INTEGER2NUM(SO_DETACH_FILTER));
1476 #endif
1477 #if defined(SO_PEERNAME)
1478 /* Name of the connecting user */
1479 rb_define_const(rb_cSocket, "SO_PEERNAME", INTEGER2NUM(SO_PEERNAME));
1480 /* Name of the connecting user */
1481 rb_define_const(rb_mSockConst, "SO_PEERNAME", INTEGER2NUM(SO_PEERNAME));
1482 #endif
1483 #if defined(SO_TIMESTAMP)
1484 /* Receive timestamp with datagrams (timeval) */
1485 rb_define_const(rb_cSocket, "SO_TIMESTAMP", INTEGER2NUM(SO_TIMESTAMP));
1486 /* Receive timestamp with datagrams (timeval) */
1487 rb_define_const(rb_mSockConst, "SO_TIMESTAMP", INTEGER2NUM(SO_TIMESTAMP));
1488 #endif
1489 #if defined(SO_TIMESTAMPNS)
1490 /* Receive nanosecond timestamp with datagrams (timespec) */
1491 rb_define_const(rb_cSocket, "SO_TIMESTAMPNS", INTEGER2NUM(SO_TIMESTAMPNS));
1492 /* Receive nanosecond timestamp with datagrams (timespec) */
1493 rb_define_const(rb_mSockConst, "SO_TIMESTAMPNS", INTEGER2NUM(SO_TIMESTAMPNS));
1494 #endif
1495 #if defined(SO_BINTIME)
1496 /* Receive timestamp with datagrams (bintime) */
1497 rb_define_const(rb_cSocket, "SO_BINTIME", INTEGER2NUM(SO_BINTIME));
1498 /* Receive timestamp with datagrams (bintime) */
1499 rb_define_const(rb_mSockConst, "SO_BINTIME", INTEGER2NUM(SO_BINTIME));
1500 #endif
1501 #if defined(SO_RECVUCRED)
1502 /* Receive user credentials with datagram */
1503 rb_define_const(rb_cSocket, "SO_RECVUCRED", INTEGER2NUM(SO_RECVUCRED));
1504 /* Receive user credentials with datagram */
1505 rb_define_const(rb_mSockConst, "SO_RECVUCRED", INTEGER2NUM(SO_RECVUCRED));
1506 #endif
1507 #if defined(SO_MAC_EXEMPT)
1508 /* Mandatory Access Control exemption for unlabeled peers */
1509 rb_define_const(rb_cSocket, "SO_MAC_EXEMPT", INTEGER2NUM(SO_MAC_EXEMPT));
1510 /* Mandatory Access Control exemption for unlabeled peers */
1511 rb_define_const(rb_mSockConst, "SO_MAC_EXEMPT", INTEGER2NUM(SO_MAC_EXEMPT));
1512 #endif
1513 #if defined(SO_ALLZONES)
1514 /* Bypass zone boundaries */
1515 rb_define_const(rb_cSocket, "SO_ALLZONES", INTEGER2NUM(SO_ALLZONES));
1516 /* Bypass zone boundaries */
1517 rb_define_const(rb_mSockConst, "SO_ALLZONES", INTEGER2NUM(SO_ALLZONES));
1518 #endif
1519 #if defined(SOPRI_INTERACTIVE)
1520 /* Interactive socket priority */
1521 rb_define_const(rb_cSocket, "SOPRI_INTERACTIVE", INTEGER2NUM(SOPRI_INTERACTIVE));
1522 /* Interactive socket priority */
1523 rb_define_const(rb_mSockConst, "SOPRI_INTERACTIVE", INTEGER2NUM(SOPRI_INTERACTIVE));
1524 #endif
1525 #if defined(SOPRI_NORMAL)
1526 /* Normal socket priority */
1527 rb_define_const(rb_cSocket, "SOPRI_NORMAL", INTEGER2NUM(SOPRI_NORMAL));
1528 /* Normal socket priority */
1529 rb_define_const(rb_mSockConst, "SOPRI_NORMAL", INTEGER2NUM(SOPRI_NORMAL));
1530 #endif
1531 #if defined(SOPRI_BACKGROUND)
1532 /* Background socket priority */
1533 rb_define_const(rb_cSocket, "SOPRI_BACKGROUND", INTEGER2NUM(SOPRI_BACKGROUND));
1534 /* Background socket priority */
1535 rb_define_const(rb_mSockConst, "SOPRI_BACKGROUND", INTEGER2NUM(SOPRI_BACKGROUND));
1536 #endif
1537 #if defined(IPX_TYPE)
1538 /* */
1539 rb_define_const(rb_cSocket, "IPX_TYPE", INTEGER2NUM(IPX_TYPE));
1540 /* */
1541 rb_define_const(rb_mSockConst, "IPX_TYPE", INTEGER2NUM(IPX_TYPE));
1542 #endif
1543 #if defined(TCP_NODELAY)
1544 /* Don't delay sending to coalesce packets */
1545 rb_define_const(rb_cSocket, "TCP_NODELAY", INTEGER2NUM(TCP_NODELAY));
1546 /* Don't delay sending to coalesce packets */
1547 rb_define_const(rb_mSockConst, "TCP_NODELAY", INTEGER2NUM(TCP_NODELAY));
1548 #endif
1549 #if defined(TCP_MAXSEG)
1550 /* Set maximum segment size */
1551 rb_define_const(rb_cSocket, "TCP_MAXSEG", INTEGER2NUM(TCP_MAXSEG));
1552 /* Set maximum segment size */
1553 rb_define_const(rb_mSockConst, "TCP_MAXSEG", INTEGER2NUM(TCP_MAXSEG));
1554 #endif
1555 #if defined(TCP_CORK)
1556 /* Don't send partial frames */
1557 rb_define_const(rb_cSocket, "TCP_CORK", INTEGER2NUM(TCP_CORK));
1558 /* Don't send partial frames */
1559 rb_define_const(rb_mSockConst, "TCP_CORK", INTEGER2NUM(TCP_CORK));
1560 #endif
1561 #if defined(TCP_DEFER_ACCEPT)
1562 /* Don't notify a listening socket until data is ready */
1563 rb_define_const(rb_cSocket, "TCP_DEFER_ACCEPT", INTEGER2NUM(TCP_DEFER_ACCEPT));
1564 /* Don't notify a listening socket until data is ready */
1565 rb_define_const(rb_mSockConst, "TCP_DEFER_ACCEPT", INTEGER2NUM(TCP_DEFER_ACCEPT));
1566 #endif
1567 #if defined(TCP_INFO)
1568 /* Retrieve information about this socket */
1569 rb_define_const(rb_cSocket, "TCP_INFO", INTEGER2NUM(TCP_INFO));
1570 /* Retrieve information about this socket */
1571 rb_define_const(rb_mSockConst, "TCP_INFO", INTEGER2NUM(TCP_INFO));
1572 #endif
1573 #if defined(TCP_KEEPCNT)
1574 /* Maximum number of keepalive probes allowed before dropping a connection */
1575 rb_define_const(rb_cSocket, "TCP_KEEPCNT", INTEGER2NUM(TCP_KEEPCNT));
1576 /* Maximum number of keepalive probes allowed before dropping a connection */
1577 rb_define_const(rb_mSockConst, "TCP_KEEPCNT", INTEGER2NUM(TCP_KEEPCNT));
1578 #endif
1579 #if defined(TCP_KEEPIDLE)
1580 /* Idle time before keepalive probes are sent */
1581 rb_define_const(rb_cSocket, "TCP_KEEPIDLE", INTEGER2NUM(TCP_KEEPIDLE));
1582 /* Idle time before keepalive probes are sent */
1583 rb_define_const(rb_mSockConst, "TCP_KEEPIDLE", INTEGER2NUM(TCP_KEEPIDLE));
1584 #endif
1585 #if defined(TCP_KEEPINTVL)
1586 /* Time between keepalive probes */
1587 rb_define_const(rb_cSocket, "TCP_KEEPINTVL", INTEGER2NUM(TCP_KEEPINTVL));
1588 /* Time between keepalive probes */
1589 rb_define_const(rb_mSockConst, "TCP_KEEPINTVL", INTEGER2NUM(TCP_KEEPINTVL));
1590 #endif
1591 #if defined(TCP_LINGER2)
1592 /* Lifetime of orphaned FIN_WAIT2 sockets */
1593 rb_define_const(rb_cSocket, "TCP_LINGER2", INTEGER2NUM(TCP_LINGER2));
1594 /* Lifetime of orphaned FIN_WAIT2 sockets */
1595 rb_define_const(rb_mSockConst, "TCP_LINGER2", INTEGER2NUM(TCP_LINGER2));
1596 #endif
1597 #if defined(TCP_MD5SIG)
1598 /* Use MD5 digests (RFC2385) */
1599 rb_define_const(rb_cSocket, "TCP_MD5SIG", INTEGER2NUM(TCP_MD5SIG));
1600 /* Use MD5 digests (RFC2385) */
1601 rb_define_const(rb_mSockConst, "TCP_MD5SIG", INTEGER2NUM(TCP_MD5SIG));
1602 #endif
1603 #if defined(TCP_NOOPT)
1604 /* Don't use TCP options */
1605 rb_define_const(rb_cSocket, "TCP_NOOPT", INTEGER2NUM(TCP_NOOPT));
1606 /* Don't use TCP options */
1607 rb_define_const(rb_mSockConst, "TCP_NOOPT", INTEGER2NUM(TCP_NOOPT));
1608 #endif
1609 #if defined(TCP_NOPUSH)
1610 /* Don't push the last block of write */
1611 rb_define_const(rb_cSocket, "TCP_NOPUSH", INTEGER2NUM(TCP_NOPUSH));
1612 /* Don't push the last block of write */
1613 rb_define_const(rb_mSockConst, "TCP_NOPUSH", INTEGER2NUM(TCP_NOPUSH));
1614 #endif
1615 #if defined(TCP_QUICKACK)
1616 /* Enable quickack mode */
1617 rb_define_const(rb_cSocket, "TCP_QUICKACK", INTEGER2NUM(TCP_QUICKACK));
1618 /* Enable quickack mode */
1619 rb_define_const(rb_mSockConst, "TCP_QUICKACK", INTEGER2NUM(TCP_QUICKACK));
1620 #endif
1621 #if defined(TCP_SYNCNT)
1622 /* Number of SYN retransmits before a connection is dropped */
1623 rb_define_const(rb_cSocket, "TCP_SYNCNT", INTEGER2NUM(TCP_SYNCNT));
1624 /* Number of SYN retransmits before a connection is dropped */
1625 rb_define_const(rb_mSockConst, "TCP_SYNCNT", INTEGER2NUM(TCP_SYNCNT));
1626 #endif
1627 #if defined(TCP_WINDOW_CLAMP)
1628 /* Clamp the size of the advertised window */
1629 rb_define_const(rb_cSocket, "TCP_WINDOW_CLAMP", INTEGER2NUM(TCP_WINDOW_CLAMP));
1630 /* Clamp the size of the advertised window */
1631 rb_define_const(rb_mSockConst, "TCP_WINDOW_CLAMP", INTEGER2NUM(TCP_WINDOW_CLAMP));
1632 #endif
1633 #if defined(TCP_FASTOPEN)
1634 /* Reduce step of the handshake process */
1635 rb_define_const(rb_cSocket, "TCP_FASTOPEN", INTEGER2NUM(TCP_FASTOPEN));
1636 /* Reduce step of the handshake process */
1637 rb_define_const(rb_mSockConst, "TCP_FASTOPEN", INTEGER2NUM(TCP_FASTOPEN));
1638 #endif
1639 #if defined(UDP_CORK)
1640 /* Don't send partial frames */
1641 rb_define_const(rb_cSocket, "UDP_CORK", INTEGER2NUM(UDP_CORK));
1642 /* Don't send partial frames */
1643 rb_define_const(rb_mSockConst, "UDP_CORK", INTEGER2NUM(UDP_CORK));
1644 #endif
1645 #if defined(EAI_ADDRFAMILY)
1646 /* Address family for hostname not supported */
1647 rb_define_const(rb_cSocket, "EAI_ADDRFAMILY", INTEGER2NUM(EAI_ADDRFAMILY));
1648 /* Address family for hostname not supported */
1649 rb_define_const(rb_mSockConst, "EAI_ADDRFAMILY", INTEGER2NUM(EAI_ADDRFAMILY));
1650 #endif
1651 #if defined(EAI_AGAIN)
1652 /* Temporary failure in name resolution */
1653 rb_define_const(rb_cSocket, "EAI_AGAIN", INTEGER2NUM(EAI_AGAIN));
1654 /* Temporary failure in name resolution */
1655 rb_define_const(rb_mSockConst, "EAI_AGAIN", INTEGER2NUM(EAI_AGAIN));
1656 #endif
1657 #if defined(EAI_BADFLAGS)
1658 /* Invalid flags */
1659 rb_define_const(rb_cSocket, "EAI_BADFLAGS", INTEGER2NUM(EAI_BADFLAGS));
1660 /* Invalid flags */
1661 rb_define_const(rb_mSockConst, "EAI_BADFLAGS", INTEGER2NUM(EAI_BADFLAGS));
1662 #endif
1663 #if defined(EAI_FAIL)
1664 /* Non-recoverable failure in name resolution */
1665 rb_define_const(rb_cSocket, "EAI_FAIL", INTEGER2NUM(EAI_FAIL));
1666 /* Non-recoverable failure in name resolution */
1667 rb_define_const(rb_mSockConst, "EAI_FAIL", INTEGER2NUM(EAI_FAIL));
1668 #endif
1669 #if defined(EAI_FAMILY)
1670 /* Address family not supported */
1671 rb_define_const(rb_cSocket, "EAI_FAMILY", INTEGER2NUM(EAI_FAMILY));
1672 /* Address family not supported */
1673 rb_define_const(rb_mSockConst, "EAI_FAMILY", INTEGER2NUM(EAI_FAMILY));
1674 #endif
1675 #if defined(EAI_MEMORY)
1676 /* Memory allocation failure */
1677 rb_define_const(rb_cSocket, "EAI_MEMORY", INTEGER2NUM(EAI_MEMORY));
1678 /* Memory allocation failure */
1679 rb_define_const(rb_mSockConst, "EAI_MEMORY", INTEGER2NUM(EAI_MEMORY));
1680 #endif
1681 #if defined(EAI_NODATA)
1682 /* No address associated with hostname */
1683 rb_define_const(rb_cSocket, "EAI_NODATA", INTEGER2NUM(EAI_NODATA));
1684 /* No address associated with hostname */
1685 rb_define_const(rb_mSockConst, "EAI_NODATA", INTEGER2NUM(EAI_NODATA));
1686 #endif
1687 #if defined(EAI_NONAME)
1688 /* Hostname nor servname, or not known */
1689 rb_define_const(rb_cSocket, "EAI_NONAME", INTEGER2NUM(EAI_NONAME));
1690 /* Hostname nor servname, or not known */
1691 rb_define_const(rb_mSockConst, "EAI_NONAME", INTEGER2NUM(EAI_NONAME));
1692 #endif
1693 #if defined(EAI_OVERFLOW)
1694 /* Argument buffer overflow */
1695 rb_define_const(rb_cSocket, "EAI_OVERFLOW", INTEGER2NUM(EAI_OVERFLOW));
1696 /* Argument buffer overflow */
1697 rb_define_const(rb_mSockConst, "EAI_OVERFLOW", INTEGER2NUM(EAI_OVERFLOW));
1698 #endif
1699 #if defined(EAI_SERVICE)
1700 /* Servname not supported for socket type */
1701 rb_define_const(rb_cSocket, "EAI_SERVICE", INTEGER2NUM(EAI_SERVICE));
1702 /* Servname not supported for socket type */
1703 rb_define_const(rb_mSockConst, "EAI_SERVICE", INTEGER2NUM(EAI_SERVICE));
1704 #endif
1705 #if defined(EAI_SOCKTYPE)
1706 /* Socket type not supported */
1707 rb_define_const(rb_cSocket, "EAI_SOCKTYPE", INTEGER2NUM(EAI_SOCKTYPE));
1708 /* Socket type not supported */
1709 rb_define_const(rb_mSockConst, "EAI_SOCKTYPE", INTEGER2NUM(EAI_SOCKTYPE));
1710 #endif
1711 #if defined(EAI_SYSTEM)
1712 /* System error returned in errno */
1713 rb_define_const(rb_cSocket, "EAI_SYSTEM", INTEGER2NUM(EAI_SYSTEM));
1714 /* System error returned in errno */
1715 rb_define_const(rb_mSockConst, "EAI_SYSTEM", INTEGER2NUM(EAI_SYSTEM));
1716 #endif
1717 #if defined(EAI_BADHINTS)
1718 /* Invalid value for hints */
1719 rb_define_const(rb_cSocket, "EAI_BADHINTS", INTEGER2NUM(EAI_BADHINTS));
1720 /* Invalid value for hints */
1721 rb_define_const(rb_mSockConst, "EAI_BADHINTS", INTEGER2NUM(EAI_BADHINTS));
1722 #endif
1723 #if defined(EAI_PROTOCOL)
1724 /* Resolved protocol is unknown */
1725 rb_define_const(rb_cSocket, "EAI_PROTOCOL", INTEGER2NUM(EAI_PROTOCOL));
1726 /* Resolved protocol is unknown */
1727 rb_define_const(rb_mSockConst, "EAI_PROTOCOL", INTEGER2NUM(EAI_PROTOCOL));
1728 #endif
1729 #if defined(EAI_MAX)
1730 /* Maximum error code from getaddrinfo */
1731 rb_define_const(rb_cSocket, "EAI_MAX", INTEGER2NUM(EAI_MAX));
1732 /* Maximum error code from getaddrinfo */
1733 rb_define_const(rb_mSockConst, "EAI_MAX", INTEGER2NUM(EAI_MAX));
1734 #endif
1735 #if defined(AI_PASSIVE)
1736 /* Get address to use with bind() */
1737 rb_define_const(rb_cSocket, "AI_PASSIVE", INTEGER2NUM(AI_PASSIVE));
1738 /* Get address to use with bind() */
1739 rb_define_const(rb_mSockConst, "AI_PASSIVE", INTEGER2NUM(AI_PASSIVE));
1740 #endif
1741 #if defined(AI_CANONNAME)
1742 /* Fill in the canonical name */
1743 rb_define_const(rb_cSocket, "AI_CANONNAME", INTEGER2NUM(AI_CANONNAME));
1744 /* Fill in the canonical name */
1745 rb_define_const(rb_mSockConst, "AI_CANONNAME", INTEGER2NUM(AI_CANONNAME));
1746 #endif
1747 #if defined(AI_NUMERICHOST)
1748 /* Prevent host name resolution */
1749 rb_define_const(rb_cSocket, "AI_NUMERICHOST", INTEGER2NUM(AI_NUMERICHOST));
1750 /* Prevent host name resolution */
1751 rb_define_const(rb_mSockConst, "AI_NUMERICHOST", INTEGER2NUM(AI_NUMERICHOST));
1752 #endif
1753 #if defined(AI_NUMERICSERV)
1754 /* Prevent service name resolution */
1755 rb_define_const(rb_cSocket, "AI_NUMERICSERV", INTEGER2NUM(AI_NUMERICSERV));
1756 /* Prevent service name resolution */
1757 rb_define_const(rb_mSockConst, "AI_NUMERICSERV", INTEGER2NUM(AI_NUMERICSERV));
1758 #endif
1759 #if defined(AI_MASK)
1760 /* Valid flag mask for getaddrinfo (not for application use) */
1761 rb_define_const(rb_cSocket, "AI_MASK", INTEGER2NUM(AI_MASK));
1762 /* Valid flag mask for getaddrinfo (not for application use) */
1763 rb_define_const(rb_mSockConst, "AI_MASK", INTEGER2NUM(AI_MASK));
1764 #endif
1765 #if defined(AI_ALL)
1766 /* Allow all addresses */
1767 rb_define_const(rb_cSocket, "AI_ALL", INTEGER2NUM(AI_ALL));
1768 /* Allow all addresses */
1769 rb_define_const(rb_mSockConst, "AI_ALL", INTEGER2NUM(AI_ALL));
1770 #endif
1771 #if defined(AI_V4MAPPED_CFG)
1772 /* Accept IPv4 mapped addresses if the kernel supports it */
1773 rb_define_const(rb_cSocket, "AI_V4MAPPED_CFG", INTEGER2NUM(AI_V4MAPPED_CFG));
1774 /* Accept IPv4 mapped addresses if the kernel supports it */
1775 rb_define_const(rb_mSockConst, "AI_V4MAPPED_CFG", INTEGER2NUM(AI_V4MAPPED_CFG));
1776 #endif
1777 #if defined(AI_ADDRCONFIG)
1778 /* Accept only if any address is assigned */
1779 rb_define_const(rb_cSocket, "AI_ADDRCONFIG", INTEGER2NUM(AI_ADDRCONFIG));
1780 /* Accept only if any address is assigned */
1781 rb_define_const(rb_mSockConst, "AI_ADDRCONFIG", INTEGER2NUM(AI_ADDRCONFIG));
1782 #endif
1783 #if defined(AI_V4MAPPED)
1784 /* Accept IPv4-mapped IPv6 addresses */
1785 rb_define_const(rb_cSocket, "AI_V4MAPPED", INTEGER2NUM(AI_V4MAPPED));
1786 /* Accept IPv4-mapped IPv6 addresses */
1787 rb_define_const(rb_mSockConst, "AI_V4MAPPED", INTEGER2NUM(AI_V4MAPPED));
1788 #endif
1789 #if defined(AI_DEFAULT)
1790 /* Default flags for getaddrinfo */
1791 rb_define_const(rb_cSocket, "AI_DEFAULT", INTEGER2NUM(AI_DEFAULT));
1792 /* Default flags for getaddrinfo */
1793 rb_define_const(rb_mSockConst, "AI_DEFAULT", INTEGER2NUM(AI_DEFAULT));
1794 #endif
1795 #if defined(NI_MAXHOST)
1796 /* Maximum length of a hostname */
1797 rb_define_const(rb_cSocket, "NI_MAXHOST", INTEGER2NUM(NI_MAXHOST));
1798 /* Maximum length of a hostname */
1799 rb_define_const(rb_mSockConst, "NI_MAXHOST", INTEGER2NUM(NI_MAXHOST));
1800 #endif
1801 #if defined(NI_MAXSERV)
1802 /* Maximum length of a service name */
1803 rb_define_const(rb_cSocket, "NI_MAXSERV", INTEGER2NUM(NI_MAXSERV));
1804 /* Maximum length of a service name */
1805 rb_define_const(rb_mSockConst, "NI_MAXSERV", INTEGER2NUM(NI_MAXSERV));
1806 #endif
1807 #if defined(NI_NOFQDN)
1808 /* An FQDN is not required for local hosts, return only the local part */
1809 rb_define_const(rb_cSocket, "NI_NOFQDN", INTEGER2NUM(NI_NOFQDN));
1810 /* An FQDN is not required for local hosts, return only the local part */
1811 rb_define_const(rb_mSockConst, "NI_NOFQDN", INTEGER2NUM(NI_NOFQDN));
1812 #endif
1813 #if defined(NI_NUMERICHOST)
1814 /* Return a numeric address */
1815 rb_define_const(rb_cSocket, "NI_NUMERICHOST", INTEGER2NUM(NI_NUMERICHOST));
1816 /* Return a numeric address */
1817 rb_define_const(rb_mSockConst, "NI_NUMERICHOST", INTEGER2NUM(NI_NUMERICHOST));
1818 #endif
1819 #if defined(NI_NAMEREQD)
1820 /* A name is required */
1821 rb_define_const(rb_cSocket, "NI_NAMEREQD", INTEGER2NUM(NI_NAMEREQD));
1822 /* A name is required */
1823 rb_define_const(rb_mSockConst, "NI_NAMEREQD", INTEGER2NUM(NI_NAMEREQD));
1824 #endif
1825 #if defined(NI_NUMERICSERV)
1826 /* Return the service name as a digit string */
1827 rb_define_const(rb_cSocket, "NI_NUMERICSERV", INTEGER2NUM(NI_NUMERICSERV));
1828 /* Return the service name as a digit string */
1829 rb_define_const(rb_mSockConst, "NI_NUMERICSERV", INTEGER2NUM(NI_NUMERICSERV));
1830 #endif
1831 #if defined(NI_DGRAM)
1832 /* The service specified is a datagram service (looks up UDP ports) */
1833 rb_define_const(rb_cSocket, "NI_DGRAM", INTEGER2NUM(NI_DGRAM));
1834 /* The service specified is a datagram service (looks up UDP ports) */
1835 rb_define_const(rb_mSockConst, "NI_DGRAM", INTEGER2NUM(NI_DGRAM));
1836 #endif
1837 #if defined(SHUT_RD)
1838 /* Shut down the reading side of the socket */
1839 rb_define_const(rb_cSocket, "SHUT_RD", INTEGER2NUM(SHUT_RD));
1840 /* Shut down the reading side of the socket */
1841 rb_define_const(rb_mSockConst, "SHUT_RD", INTEGER2NUM(SHUT_RD));
1842 #endif
1843 #if defined(SHUT_WR)
1844 /* Shut down the writing side of the socket */
1845 rb_define_const(rb_cSocket, "SHUT_WR", INTEGER2NUM(SHUT_WR));
1846 /* Shut down the writing side of the socket */
1847 rb_define_const(rb_mSockConst, "SHUT_WR", INTEGER2NUM(SHUT_WR));
1848 #endif
1849 #if defined(SHUT_RDWR)
1850 /* Shut down the both sides of the socket */
1851 rb_define_const(rb_cSocket, "SHUT_RDWR", INTEGER2NUM(SHUT_RDWR));
1852 /* Shut down the both sides of the socket */
1853 rb_define_const(rb_mSockConst, "SHUT_RDWR", INTEGER2NUM(SHUT_RDWR));
1854 #endif
1855 #if defined(INET6)
1856 #if defined(IPV6_JOIN_GROUP)
1857 /* Join a group membership */
1858 rb_define_const(rb_cSocket, "IPV6_JOIN_GROUP", INTEGER2NUM(IPV6_JOIN_GROUP));
1859 /* Join a group membership */
1860 rb_define_const(rb_mSockConst, "IPV6_JOIN_GROUP", INTEGER2NUM(IPV6_JOIN_GROUP));
1861 #endif
1862 #endif
1863 #if defined(INET6)
1864 #if defined(IPV6_LEAVE_GROUP)
1865 /* Leave a group membership */
1866 rb_define_const(rb_cSocket, "IPV6_LEAVE_GROUP", INTEGER2NUM(IPV6_LEAVE_GROUP));
1867 /* Leave a group membership */
1868 rb_define_const(rb_mSockConst, "IPV6_LEAVE_GROUP", INTEGER2NUM(IPV6_LEAVE_GROUP));
1869 #endif
1870 #endif
1871 #if defined(INET6)
1872 #if defined(IPV6_MULTICAST_HOPS)
1873 /* IP6 multicast hops */
1874 rb_define_const(rb_cSocket, "IPV6_MULTICAST_HOPS", INTEGER2NUM(IPV6_MULTICAST_HOPS));
1875 /* IP6 multicast hops */
1876 rb_define_const(rb_mSockConst, "IPV6_MULTICAST_HOPS", INTEGER2NUM(IPV6_MULTICAST_HOPS));
1877 #endif
1878 #endif
1879 #if defined(INET6)
1880 #if defined(IPV6_MULTICAST_IF)
1881 /* IP6 multicast interface */
1882 rb_define_const(rb_cSocket, "IPV6_MULTICAST_IF", INTEGER2NUM(IPV6_MULTICAST_IF));
1883 /* IP6 multicast interface */
1884 rb_define_const(rb_mSockConst, "IPV6_MULTICAST_IF", INTEGER2NUM(IPV6_MULTICAST_IF));
1885 #endif
1886 #endif
1887 #if defined(INET6)
1888 #if defined(IPV6_MULTICAST_LOOP)
1889 /* IP6 multicast loopback */
1890 rb_define_const(rb_cSocket, "IPV6_MULTICAST_LOOP", INTEGER2NUM(IPV6_MULTICAST_LOOP));
1891 /* IP6 multicast loopback */
1892 rb_define_const(rb_mSockConst, "IPV6_MULTICAST_LOOP", INTEGER2NUM(IPV6_MULTICAST_LOOP));
1893 #endif
1894 #endif
1895 #if defined(INET6)
1896 #if defined(IPV6_UNICAST_HOPS)
1897 /* IP6 unicast hops */
1898 rb_define_const(rb_cSocket, "IPV6_UNICAST_HOPS", INTEGER2NUM(IPV6_UNICAST_HOPS));
1899 /* IP6 unicast hops */
1900 rb_define_const(rb_mSockConst, "IPV6_UNICAST_HOPS", INTEGER2NUM(IPV6_UNICAST_HOPS));
1901 #endif
1902 #endif
1903 #if defined(INET6)
1904 #if defined(IPV6_V6ONLY)
1905 /* Only bind IPv6 with a wildcard bind */
1906 rb_define_const(rb_cSocket, "IPV6_V6ONLY", INTEGER2NUM(IPV6_V6ONLY));
1907 /* Only bind IPv6 with a wildcard bind */
1908 rb_define_const(rb_mSockConst, "IPV6_V6ONLY", INTEGER2NUM(IPV6_V6ONLY));
1909 #endif
1910 #endif
1911 #if defined(INET6)
1912 #if defined(IPV6_CHECKSUM)
1913 /* Checksum offset for raw sockets */
1914 rb_define_const(rb_cSocket, "IPV6_CHECKSUM", INTEGER2NUM(IPV6_CHECKSUM));
1915 /* Checksum offset for raw sockets */
1916 rb_define_const(rb_mSockConst, "IPV6_CHECKSUM", INTEGER2NUM(IPV6_CHECKSUM));
1917 #endif
1918 #endif
1919 #if defined(INET6)
1920 #if defined(IPV6_DONTFRAG)
1921 /* Don't fragment packets */
1922 rb_define_const(rb_cSocket, "IPV6_DONTFRAG", INTEGER2NUM(IPV6_DONTFRAG));
1923 /* Don't fragment packets */
1924 rb_define_const(rb_mSockConst, "IPV6_DONTFRAG", INTEGER2NUM(IPV6_DONTFRAG));
1925 #endif
1926 #endif
1927 #if defined(INET6)
1928 #if defined(IPV6_DSTOPTS)
1929 /* Destination option */
1930 rb_define_const(rb_cSocket, "IPV6_DSTOPTS", INTEGER2NUM(IPV6_DSTOPTS));
1931 /* Destination option */
1932 rb_define_const(rb_mSockConst, "IPV6_DSTOPTS", INTEGER2NUM(IPV6_DSTOPTS));
1933 #endif
1934 #endif
1935 #if defined(INET6)
1936 #if defined(IPV6_HOPLIMIT)
1937 /* Hop limit */
1938 rb_define_const(rb_cSocket, "IPV6_HOPLIMIT", INTEGER2NUM(IPV6_HOPLIMIT));
1939 /* Hop limit */
1940 rb_define_const(rb_mSockConst, "IPV6_HOPLIMIT", INTEGER2NUM(IPV6_HOPLIMIT));
1941 #endif
1942 #endif
1943 #if defined(INET6)
1944 #if defined(IPV6_HOPOPTS)
1945 /* Hop-by-hop option */
1946 rb_define_const(rb_cSocket, "IPV6_HOPOPTS", INTEGER2NUM(IPV6_HOPOPTS));
1947 /* Hop-by-hop option */
1948 rb_define_const(rb_mSockConst, "IPV6_HOPOPTS", INTEGER2NUM(IPV6_HOPOPTS));
1949 #endif
1950 #endif
1951 #if defined(INET6)
1952 #if defined(IPV6_NEXTHOP)
1953 /* Next hop address */
1954 rb_define_const(rb_cSocket, "IPV6_NEXTHOP", INTEGER2NUM(IPV6_NEXTHOP));
1955 /* Next hop address */
1956 rb_define_const(rb_mSockConst, "IPV6_NEXTHOP", INTEGER2NUM(IPV6_NEXTHOP));
1957 #endif
1958 #endif
1959 #if defined(INET6)
1960 #if defined(IPV6_PATHMTU)
1961 /* Retrieve current path MTU */
1962 rb_define_const(rb_cSocket, "IPV6_PATHMTU", INTEGER2NUM(IPV6_PATHMTU));
1963 /* Retrieve current path MTU */
1964 rb_define_const(rb_mSockConst, "IPV6_PATHMTU", INTEGER2NUM(IPV6_PATHMTU));
1965 #endif
1966 #endif
1967 #if defined(INET6)
1968 #if defined(IPV6_PKTINFO)
1969 /* Receive packet information with datagram */
1970 rb_define_const(rb_cSocket, "IPV6_PKTINFO", INTEGER2NUM(IPV6_PKTINFO));
1971 /* Receive packet information with datagram */
1972 rb_define_const(rb_mSockConst, "IPV6_PKTINFO", INTEGER2NUM(IPV6_PKTINFO));
1973 #endif
1974 #endif
1975 #if defined(INET6)
1976 #if defined(IPV6_RECVDSTOPTS)
1977 /* Receive all IP6 options for response */
1978 rb_define_const(rb_cSocket, "IPV6_RECVDSTOPTS", INTEGER2NUM(IPV6_RECVDSTOPTS));
1979 /* Receive all IP6 options for response */
1980 rb_define_const(rb_mSockConst, "IPV6_RECVDSTOPTS", INTEGER2NUM(IPV6_RECVDSTOPTS));
1981 #endif
1982 #endif
1983 #if defined(INET6)
1984 #if defined(IPV6_RECVHOPLIMIT)
1985 /* Receive hop limit with datagram */
1986 rb_define_const(rb_cSocket, "IPV6_RECVHOPLIMIT", INTEGER2NUM(IPV6_RECVHOPLIMIT));
1987 /* Receive hop limit with datagram */
1988 rb_define_const(rb_mSockConst, "IPV6_RECVHOPLIMIT", INTEGER2NUM(IPV6_RECVHOPLIMIT));
1989 #endif
1990 #endif
1991 #if defined(INET6)
1992 #if defined(IPV6_RECVHOPOPTS)
1993 /* Receive hop-by-hop options */
1994 rb_define_const(rb_cSocket, "IPV6_RECVHOPOPTS", INTEGER2NUM(IPV6_RECVHOPOPTS));
1995 /* Receive hop-by-hop options */
1996 rb_define_const(rb_mSockConst, "IPV6_RECVHOPOPTS", INTEGER2NUM(IPV6_RECVHOPOPTS));
1997 #endif
1998 #endif
1999 #if defined(INET6)
2000 #if defined(IPV6_RECVPKTINFO)
2001 /* Receive destination IP address and incoming interface */
2002 rb_define_const(rb_cSocket, "IPV6_RECVPKTINFO", INTEGER2NUM(IPV6_RECVPKTINFO));
2003 /* Receive destination IP address and incoming interface */
2004 rb_define_const(rb_mSockConst, "IPV6_RECVPKTINFO", INTEGER2NUM(IPV6_RECVPKTINFO));
2005 #endif
2006 #endif
2007 #if defined(INET6)
2008 #if defined(IPV6_RECVRTHDR)
2009 /* Receive routing header */
2010 rb_define_const(rb_cSocket, "IPV6_RECVRTHDR", INTEGER2NUM(IPV6_RECVRTHDR));
2011 /* Receive routing header */
2012 rb_define_const(rb_mSockConst, "IPV6_RECVRTHDR", INTEGER2NUM(IPV6_RECVRTHDR));
2013 #endif
2014 #endif
2015 #if defined(INET6)
2016 #if defined(IPV6_RECVTCLASS)
2017 /* Receive traffic class */
2018 rb_define_const(rb_cSocket, "IPV6_RECVTCLASS", INTEGER2NUM(IPV6_RECVTCLASS));
2019 /* Receive traffic class */
2020 rb_define_const(rb_mSockConst, "IPV6_RECVTCLASS", INTEGER2NUM(IPV6_RECVTCLASS));
2021 #endif
2022 #endif
2023 #if defined(INET6)
2024 #if defined(IPV6_RTHDR)
2025 /* Allows removal of sticky routing headers */
2026 rb_define_const(rb_cSocket, "IPV6_RTHDR", INTEGER2NUM(IPV6_RTHDR));
2027 /* Allows removal of sticky routing headers */
2028 rb_define_const(rb_mSockConst, "IPV6_RTHDR", INTEGER2NUM(IPV6_RTHDR));
2029 #endif
2030 #endif
2031 #if defined(INET6)
2032 #if defined(IPV6_RTHDRDSTOPTS)
2033 /* Allows removal of sticky destination options header */
2034 rb_define_const(rb_cSocket, "IPV6_RTHDRDSTOPTS", INTEGER2NUM(IPV6_RTHDRDSTOPTS));
2035 /* Allows removal of sticky destination options header */
2036 rb_define_const(rb_mSockConst, "IPV6_RTHDRDSTOPTS", INTEGER2NUM(IPV6_RTHDRDSTOPTS));
2037 #endif
2038 #endif
2039 #if defined(INET6)
2040 #if defined(IPV6_RTHDR_TYPE_0)
2041 /* Routing header type 0 */
2042 rb_define_const(rb_cSocket, "IPV6_RTHDR_TYPE_0", INTEGER2NUM(IPV6_RTHDR_TYPE_0));
2043 /* Routing header type 0 */
2044 rb_define_const(rb_mSockConst, "IPV6_RTHDR_TYPE_0", INTEGER2NUM(IPV6_RTHDR_TYPE_0));
2045 #endif
2046 #endif
2047 #if defined(INET6)
2048 #if defined(IPV6_RECVPATHMTU)
2049 /* Receive current path MTU with datagram */
2050 rb_define_const(rb_cSocket, "IPV6_RECVPATHMTU", INTEGER2NUM(IPV6_RECVPATHMTU));
2051 /* Receive current path MTU with datagram */
2052 rb_define_const(rb_mSockConst, "IPV6_RECVPATHMTU", INTEGER2NUM(IPV6_RECVPATHMTU));
2053 #endif
2054 #endif
2055 #if defined(INET6)
2056 #if defined(IPV6_TCLASS)
2057 /* Specify the traffic class */
2058 rb_define_const(rb_cSocket, "IPV6_TCLASS", INTEGER2NUM(IPV6_TCLASS));
2059 /* Specify the traffic class */
2060 rb_define_const(rb_mSockConst, "IPV6_TCLASS", INTEGER2NUM(IPV6_TCLASS));
2061 #endif
2062 #endif
2063 #if defined(INET6)
2064 #if defined(IPV6_USE_MIN_MTU)
2065 /* Use the minimum MTU size */
2066 rb_define_const(rb_cSocket, "IPV6_USE_MIN_MTU", INTEGER2NUM(IPV6_USE_MIN_MTU));
2067 /* Use the minimum MTU size */
2068 rb_define_const(rb_mSockConst, "IPV6_USE_MIN_MTU", INTEGER2NUM(IPV6_USE_MIN_MTU));
2069 #endif
2070 #endif
2071 #if defined(INET_ADDRSTRLEN)
2072 /* Maximum length of an IPv4 address string */
2073 rb_define_const(rb_cSocket, "INET_ADDRSTRLEN", INTEGER2NUM(INET_ADDRSTRLEN));
2074 /* Maximum length of an IPv4 address string */
2075 rb_define_const(rb_mSockConst, "INET_ADDRSTRLEN", INTEGER2NUM(INET_ADDRSTRLEN));
2076 #endif
2077 #if defined(INET6_ADDRSTRLEN)
2078 /* Maximum length of an IPv6 address string */
2079 rb_define_const(rb_cSocket, "INET6_ADDRSTRLEN", INTEGER2NUM(INET6_ADDRSTRLEN));
2080 /* Maximum length of an IPv6 address string */
2081 rb_define_const(rb_mSockConst, "INET6_ADDRSTRLEN", INTEGER2NUM(INET6_ADDRSTRLEN));
2082 #endif
2083 #if defined(IFNAMSIZ)
2084 /* Maximum interface name size */
2085 rb_define_const(rb_cSocket, "IFNAMSIZ", INTEGER2NUM(IFNAMSIZ));
2086 /* Maximum interface name size */
2087 rb_define_const(rb_mSockConst, "IFNAMSIZ", INTEGER2NUM(IFNAMSIZ));
2088 #endif
2089 #if defined(IF_NAMESIZE)
2090 /* Maximum interface name size */
2091 rb_define_const(rb_cSocket, "IF_NAMESIZE", INTEGER2NUM(IF_NAMESIZE));
2092 /* Maximum interface name size */
2093 rb_define_const(rb_mSockConst, "IF_NAMESIZE", INTEGER2NUM(IF_NAMESIZE));
2094 #endif
2095 #if defined(SOMAXCONN)
2096 /* Maximum connection requests that may be queued for a socket */
2097 rb_define_const(rb_cSocket, "SOMAXCONN", INTEGER2NUM(SOMAXCONN));
2098 /* Maximum connection requests that may be queued for a socket */
2099 rb_define_const(rb_mSockConst, "SOMAXCONN", INTEGER2NUM(SOMAXCONN));
2100 #endif
2101 #if defined(SCM_RIGHTS)
2102 /* Access rights */
2103 rb_define_const(rb_cSocket, "SCM_RIGHTS", INTEGER2NUM(SCM_RIGHTS));
2104 /* Access rights */
2105 rb_define_const(rb_mSockConst, "SCM_RIGHTS", INTEGER2NUM(SCM_RIGHTS));
2106 #endif
2107 #if defined(SCM_TIMESTAMP)
2108 /* Timestamp (timeval) */
2109 rb_define_const(rb_cSocket, "SCM_TIMESTAMP", INTEGER2NUM(SCM_TIMESTAMP));
2110 /* Timestamp (timeval) */
2111 rb_define_const(rb_mSockConst, "SCM_TIMESTAMP", INTEGER2NUM(SCM_TIMESTAMP));
2112 #endif
2113 #if defined(SCM_TIMESTAMPNS)
2114 /* Timespec (timespec) */
2115 rb_define_const(rb_cSocket, "SCM_TIMESTAMPNS", INTEGER2NUM(SCM_TIMESTAMPNS));
2116 /* Timespec (timespec) */
2117 rb_define_const(rb_mSockConst, "SCM_TIMESTAMPNS", INTEGER2NUM(SCM_TIMESTAMPNS));
2118 #endif
2119 #if defined(SCM_BINTIME)
2120 /* Timestamp (bintime) */
2121 rb_define_const(rb_cSocket, "SCM_BINTIME", INTEGER2NUM(SCM_BINTIME));
2122 /* Timestamp (bintime) */
2123 rb_define_const(rb_mSockConst, "SCM_BINTIME", INTEGER2NUM(SCM_BINTIME));
2124 #endif
2125 #if defined(SCM_CREDENTIALS)
2126 /* The sender's credentials */
2127 rb_define_const(rb_cSocket, "SCM_CREDENTIALS", INTEGER2NUM(SCM_CREDENTIALS));
2128 /* The sender's credentials */
2129 rb_define_const(rb_mSockConst, "SCM_CREDENTIALS", INTEGER2NUM(SCM_CREDENTIALS));
2130 #endif
2131 #if defined(SCM_CREDS)
2132 /* Process credentials */
2133 rb_define_const(rb_cSocket, "SCM_CREDS", INTEGER2NUM(SCM_CREDS));
2134 /* Process credentials */
2135 rb_define_const(rb_mSockConst, "SCM_CREDS", INTEGER2NUM(SCM_CREDS));
2136 #endif
2137 #if defined(SCM_UCRED)
2138 /* User credentials */
2139 rb_define_const(rb_cSocket, "SCM_UCRED", INTEGER2NUM(SCM_UCRED));
2140 /* User credentials */
2141 rb_define_const(rb_mSockConst, "SCM_UCRED", INTEGER2NUM(SCM_UCRED));
2142 #endif
2143 #if defined(LOCAL_PEERCRED)
2144 /* Retrieve peer credentials */
2145 rb_define_const(rb_cSocket, "LOCAL_PEERCRED", INTEGER2NUM(LOCAL_PEERCRED));
2146 /* Retrieve peer credentials */
2147 rb_define_const(rb_mSockConst, "LOCAL_PEERCRED", INTEGER2NUM(LOCAL_PEERCRED));
2148 #endif
2149 #if defined(LOCAL_CREDS)
2150 /* Pass credentials to receiver */
2151 rb_define_const(rb_cSocket, "LOCAL_CREDS", INTEGER2NUM(LOCAL_CREDS));
2152 /* Pass credentials to receiver */
2153 rb_define_const(rb_mSockConst, "LOCAL_CREDS", INTEGER2NUM(LOCAL_CREDS));
2154 #endif
2155 #if defined(LOCAL_CONNWAIT)
2156 /* Connect blocks until accepted */
2157 rb_define_const(rb_cSocket, "LOCAL_CONNWAIT", INTEGER2NUM(LOCAL_CONNWAIT));
2158 /* Connect blocks until accepted */
2159 rb_define_const(rb_mSockConst, "LOCAL_CONNWAIT", INTEGER2NUM(LOCAL_CONNWAIT));
2160 #endif
2161 #if defined(IFF_802_1Q_VLAN)
2162 /* 802.1Q VLAN device */
2163 rb_define_const(rb_cSocket, "IFF_802_1Q_VLAN", INTEGER2NUM(IFF_802_1Q_VLAN));
2164 /* 802.1Q VLAN device */
2165 rb_define_const(rb_mSockConst, "IFF_802_1Q_VLAN", INTEGER2NUM(IFF_802_1Q_VLAN));
2166 #endif
2167 #if defined(IFF_ALLMULTI)
2168 /* receive all multicast packets */
2169 rb_define_const(rb_cSocket, "IFF_ALLMULTI", INTEGER2NUM(IFF_ALLMULTI));
2170 /* receive all multicast packets */
2171 rb_define_const(rb_mSockConst, "IFF_ALLMULTI", INTEGER2NUM(IFF_ALLMULTI));
2172 #endif
2173 #if defined(IFF_ALTPHYS)
2174 /* use alternate physical connection */
2175 rb_define_const(rb_cSocket, "IFF_ALTPHYS", INTEGER2NUM(IFF_ALTPHYS));
2176 /* use alternate physical connection */
2177 rb_define_const(rb_mSockConst, "IFF_ALTPHYS", INTEGER2NUM(IFF_ALTPHYS));
2178 #endif
2179 #if defined(IFF_AUTOMEDIA)
2180 /* auto media select active */
2181 rb_define_const(rb_cSocket, "IFF_AUTOMEDIA", INTEGER2NUM(IFF_AUTOMEDIA));
2182 /* auto media select active */
2183 rb_define_const(rb_mSockConst, "IFF_AUTOMEDIA", INTEGER2NUM(IFF_AUTOMEDIA));
2184 #endif
2185 #if defined(IFF_BONDING)
2186 /* bonding master or slave */
2187 rb_define_const(rb_cSocket, "IFF_BONDING", INTEGER2NUM(IFF_BONDING));
2188 /* bonding master or slave */
2189 rb_define_const(rb_mSockConst, "IFF_BONDING", INTEGER2NUM(IFF_BONDING));
2190 #endif
2191 #if defined(IFF_BRIDGE_PORT)
2192 /* device used as bridge port */
2193 rb_define_const(rb_cSocket, "IFF_BRIDGE_PORT", INTEGER2NUM(IFF_BRIDGE_PORT));
2194 /* device used as bridge port */
2195 rb_define_const(rb_mSockConst, "IFF_BRIDGE_PORT", INTEGER2NUM(IFF_BRIDGE_PORT));
2196 #endif
2197 #if defined(IFF_BROADCAST)
2198 /* broadcast address valid */
2199 rb_define_const(rb_cSocket, "IFF_BROADCAST", INTEGER2NUM(IFF_BROADCAST));
2200 /* broadcast address valid */
2201 rb_define_const(rb_mSockConst, "IFF_BROADCAST", INTEGER2NUM(IFF_BROADCAST));
2202 #endif
2203 #if defined(IFF_CANTCONFIG)
2204 /* unconfigurable using ioctl(2) */
2205 rb_define_const(rb_cSocket, "IFF_CANTCONFIG", INTEGER2NUM(IFF_CANTCONFIG));
2206 /* unconfigurable using ioctl(2) */
2207 rb_define_const(rb_mSockConst, "IFF_CANTCONFIG", INTEGER2NUM(IFF_CANTCONFIG));
2208 #endif
2209 #if defined(IFF_DEBUG)
2210 /* turn on debugging */
2211 rb_define_const(rb_cSocket, "IFF_DEBUG", INTEGER2NUM(IFF_DEBUG));
2212 /* turn on debugging */
2213 rb_define_const(rb_mSockConst, "IFF_DEBUG", INTEGER2NUM(IFF_DEBUG));
2214 #endif
2215 #if defined(IFF_DISABLE_NETPOLL)
2216 /* disable netpoll at run-time */
2217 rb_define_const(rb_cSocket, "IFF_DISABLE_NETPOLL", INTEGER2NUM(IFF_DISABLE_NETPOLL));
2218 /* disable netpoll at run-time */
2219 rb_define_const(rb_mSockConst, "IFF_DISABLE_NETPOLL", INTEGER2NUM(IFF_DISABLE_NETPOLL));
2220 #endif
2221 #if defined(IFF_DONT_BRIDGE)
2222 /* disallow bridging this ether dev */
2223 rb_define_const(rb_cSocket, "IFF_DONT_BRIDGE", INTEGER2NUM(IFF_DONT_BRIDGE));
2224 /* disallow bridging this ether dev */
2225 rb_define_const(rb_mSockConst, "IFF_DONT_BRIDGE", INTEGER2NUM(IFF_DONT_BRIDGE));
2226 #endif
2227 #if defined(IFF_DORMANT)
2228 /* driver signals dormant */
2229 rb_define_const(rb_cSocket, "IFF_DORMANT", INTEGER2NUM(IFF_DORMANT));
2230 /* driver signals dormant */
2231 rb_define_const(rb_mSockConst, "IFF_DORMANT", INTEGER2NUM(IFF_DORMANT));
2232 #endif
2233 #if defined(IFF_DRV_OACTIVE)
2234 /* tx hardware queue is full */
2235 rb_define_const(rb_cSocket, "IFF_DRV_OACTIVE", INTEGER2NUM(IFF_DRV_OACTIVE));
2236 /* tx hardware queue is full */
2237 rb_define_const(rb_mSockConst, "IFF_DRV_OACTIVE", INTEGER2NUM(IFF_DRV_OACTIVE));
2238 #endif
2239 #if defined(IFF_DRV_RUNNING)
2240 /* resources allocated */
2241 rb_define_const(rb_cSocket, "IFF_DRV_RUNNING", INTEGER2NUM(IFF_DRV_RUNNING));
2242 /* resources allocated */
2243 rb_define_const(rb_mSockConst, "IFF_DRV_RUNNING", INTEGER2NUM(IFF_DRV_RUNNING));
2244 #endif
2245 #if defined(IFF_DYING)
2246 /* interface is winding down */
2247 rb_define_const(rb_cSocket, "IFF_DYING", INTEGER2NUM(IFF_DYING));
2248 /* interface is winding down */
2249 rb_define_const(rb_mSockConst, "IFF_DYING", INTEGER2NUM(IFF_DYING));
2250 #endif
2251 #if defined(IFF_DYNAMIC)
2252 /* dialup device with changing addresses */
2253 rb_define_const(rb_cSocket, "IFF_DYNAMIC", INTEGER2NUM(IFF_DYNAMIC));
2254 /* dialup device with changing addresses */
2255 rb_define_const(rb_mSockConst, "IFF_DYNAMIC", INTEGER2NUM(IFF_DYNAMIC));
2256 #endif
2257 #if defined(IFF_EBRIDGE)
2258 /* ethernet bridging device */
2259 rb_define_const(rb_cSocket, "IFF_EBRIDGE", INTEGER2NUM(IFF_EBRIDGE));
2260 /* ethernet bridging device */
2261 rb_define_const(rb_mSockConst, "IFF_EBRIDGE", INTEGER2NUM(IFF_EBRIDGE));
2262 #endif
2263 #if defined(IFF_ECHO)
2264 /* echo sent packets */
2265 rb_define_const(rb_cSocket, "IFF_ECHO", INTEGER2NUM(IFF_ECHO));
2266 /* echo sent packets */
2267 rb_define_const(rb_mSockConst, "IFF_ECHO", INTEGER2NUM(IFF_ECHO));
2268 #endif
2269 #if defined(IFF_ISATAP)
2270 /* ISATAP interface (RFC4214) */
2271 rb_define_const(rb_cSocket, "IFF_ISATAP", INTEGER2NUM(IFF_ISATAP));
2272 /* ISATAP interface (RFC4214) */
2273 rb_define_const(rb_mSockConst, "IFF_ISATAP", INTEGER2NUM(IFF_ISATAP));
2274 #endif
2275 #if defined(IFF_LINK0)
2276 /* per link layer defined bit 0 */
2277 rb_define_const(rb_cSocket, "IFF_LINK0", INTEGER2NUM(IFF_LINK0));
2278 /* per link layer defined bit 0 */
2279 rb_define_const(rb_mSockConst, "IFF_LINK0", INTEGER2NUM(IFF_LINK0));
2280 #endif
2281 #if defined(IFF_LINK1)
2282 /* per link layer defined bit 1 */
2283 rb_define_const(rb_cSocket, "IFF_LINK1", INTEGER2NUM(IFF_LINK1));
2284 /* per link layer defined bit 1 */
2285 rb_define_const(rb_mSockConst, "IFF_LINK1", INTEGER2NUM(IFF_LINK1));
2286 #endif
2287 #if defined(IFF_LINK2)
2288 /* per link layer defined bit 2 */
2289 rb_define_const(rb_cSocket, "IFF_LINK2", INTEGER2NUM(IFF_LINK2));
2290 /* per link layer defined bit 2 */
2291 rb_define_const(rb_mSockConst, "IFF_LINK2", INTEGER2NUM(IFF_LINK2));
2292 #endif
2293 #if defined(IFF_LIVE_ADDR_CHANGE)
2294 /* hardware address change when it's running */
2295 rb_define_const(rb_cSocket, "IFF_LIVE_ADDR_CHANGE", INTEGER2NUM(IFF_LIVE_ADDR_CHANGE));
2296 /* hardware address change when it's running */
2297 rb_define_const(rb_mSockConst, "IFF_LIVE_ADDR_CHANGE", INTEGER2NUM(IFF_LIVE_ADDR_CHANGE));
2298 #endif
2299 #if defined(IFF_LOOPBACK)
2300 /* loopback net */
2301 rb_define_const(rb_cSocket, "IFF_LOOPBACK", INTEGER2NUM(IFF_LOOPBACK));
2302 /* loopback net */
2303 rb_define_const(rb_mSockConst, "IFF_LOOPBACK", INTEGER2NUM(IFF_LOOPBACK));
2304 #endif
2305 #if defined(IFF_LOWER_UP)
2306 /* driver signals L1 up */
2307 rb_define_const(rb_cSocket, "IFF_LOWER_UP", INTEGER2NUM(IFF_LOWER_UP));
2308 /* driver signals L1 up */
2309 rb_define_const(rb_mSockConst, "IFF_LOWER_UP", INTEGER2NUM(IFF_LOWER_UP));
2310 #endif
2311 #if defined(IFF_MACVLAN_PORT)
2312 /* device used as macvlan port */
2313 rb_define_const(rb_cSocket, "IFF_MACVLAN_PORT", INTEGER2NUM(IFF_MACVLAN_PORT));
2314 /* device used as macvlan port */
2315 rb_define_const(rb_mSockConst, "IFF_MACVLAN_PORT", INTEGER2NUM(IFF_MACVLAN_PORT));
2316 #endif
2317 #if defined(IFF_MASTER)
2318 /* master of a load balancer */
2319 rb_define_const(rb_cSocket, "IFF_MASTER", INTEGER2NUM(IFF_MASTER));
2320 /* master of a load balancer */
2321 rb_define_const(rb_mSockConst, "IFF_MASTER", INTEGER2NUM(IFF_MASTER));
2322 #endif
2323 #if defined(IFF_MASTER_8023AD)
2324 /* bonding master, 802.3ad. */
2325 rb_define_const(rb_cSocket, "IFF_MASTER_8023AD", INTEGER2NUM(IFF_MASTER_8023AD));
2326 /* bonding master, 802.3ad. */
2327 rb_define_const(rb_mSockConst, "IFF_MASTER_8023AD", INTEGER2NUM(IFF_MASTER_8023AD));
2328 #endif
2329 #if defined(IFF_MASTER_ALB)
2330 /* bonding master, balance-alb. */
2331 rb_define_const(rb_cSocket, "IFF_MASTER_ALB", INTEGER2NUM(IFF_MASTER_ALB));
2332 /* bonding master, balance-alb. */
2333 rb_define_const(rb_mSockConst, "IFF_MASTER_ALB", INTEGER2NUM(IFF_MASTER_ALB));
2334 #endif
2335 #if defined(IFF_MASTER_ARPMON)
2336 /* bonding master, ARP mon in use */
2337 rb_define_const(rb_cSocket, "IFF_MASTER_ARPMON", INTEGER2NUM(IFF_MASTER_ARPMON));
2338 /* bonding master, ARP mon in use */
2339 rb_define_const(rb_mSockConst, "IFF_MASTER_ARPMON", INTEGER2NUM(IFF_MASTER_ARPMON));
2340 #endif
2341 #if defined(IFF_MONITOR)
2342 /* user-requested monitor mode */
2343 rb_define_const(rb_cSocket, "IFF_MONITOR", INTEGER2NUM(IFF_MONITOR));
2344 /* user-requested monitor mode */
2345 rb_define_const(rb_mSockConst, "IFF_MONITOR", INTEGER2NUM(IFF_MONITOR));
2346 #endif
2347 #if defined(IFF_MULTICAST)
2348 /* supports multicast */
2349 rb_define_const(rb_cSocket, "IFF_MULTICAST", INTEGER2NUM(IFF_MULTICAST));
2350 /* supports multicast */
2351 rb_define_const(rb_mSockConst, "IFF_MULTICAST", INTEGER2NUM(IFF_MULTICAST));
2352 #endif
2353 #if defined(IFF_NOARP)
2354 /* no address resolution protocol */
2355 rb_define_const(rb_cSocket, "IFF_NOARP", INTEGER2NUM(IFF_NOARP));
2356 /* no address resolution protocol */
2357 rb_define_const(rb_mSockConst, "IFF_NOARP", INTEGER2NUM(IFF_NOARP));
2358 #endif
2359 #if defined(IFF_NOTRAILERS)
2360 /* avoid use of trailers */
2361 rb_define_const(rb_cSocket, "IFF_NOTRAILERS", INTEGER2NUM(IFF_NOTRAILERS));
2362 /* avoid use of trailers */
2363 rb_define_const(rb_mSockConst, "IFF_NOTRAILERS", INTEGER2NUM(IFF_NOTRAILERS));
2364 #endif
2365 #if defined(IFF_OACTIVE)
2366 /* transmission in progress */
2367 rb_define_const(rb_cSocket, "IFF_OACTIVE", INTEGER2NUM(IFF_OACTIVE));
2368 /* transmission in progress */
2369 rb_define_const(rb_mSockConst, "IFF_OACTIVE", INTEGER2NUM(IFF_OACTIVE));
2370 #endif
2371 #if defined(IFF_OVS_DATAPATH)
2372 /* device used as Open vSwitch datapath port */
2373 rb_define_const(rb_cSocket, "IFF_OVS_DATAPATH", INTEGER2NUM(IFF_OVS_DATAPATH));
2374 /* device used as Open vSwitch datapath port */
2375 rb_define_const(rb_mSockConst, "IFF_OVS_DATAPATH", INTEGER2NUM(IFF_OVS_DATAPATH));
2376 #endif
2377 #if defined(IFF_POINTOPOINT)
2378 /* point-to-point link */
2379 rb_define_const(rb_cSocket, "IFF_POINTOPOINT", INTEGER2NUM(IFF_POINTOPOINT));
2380 /* point-to-point link */
2381 rb_define_const(rb_mSockConst, "IFF_POINTOPOINT", INTEGER2NUM(IFF_POINTOPOINT));
2382 #endif
2383 #if defined(IFF_PORTSEL)
2384 /* can set media type */
2385 rb_define_const(rb_cSocket, "IFF_PORTSEL", INTEGER2NUM(IFF_PORTSEL));
2386 /* can set media type */
2387 rb_define_const(rb_mSockConst, "IFF_PORTSEL", INTEGER2NUM(IFF_PORTSEL));
2388 #endif
2389 #if defined(IFF_PPROMISC)
2390 /* user-requested promisc mode */
2391 rb_define_const(rb_cSocket, "IFF_PPROMISC", INTEGER2NUM(IFF_PPROMISC));
2392 /* user-requested promisc mode */
2393 rb_define_const(rb_mSockConst, "IFF_PPROMISC", INTEGER2NUM(IFF_PPROMISC));
2394 #endif
2395 #if defined(IFF_PROMISC)
2396 /* receive all packets */
2397 rb_define_const(rb_cSocket, "IFF_PROMISC", INTEGER2NUM(IFF_PROMISC));
2398 /* receive all packets */
2399 rb_define_const(rb_mSockConst, "IFF_PROMISC", INTEGER2NUM(IFF_PROMISC));
2400 #endif
2401 #if defined(IFF_RENAMING)
2402 /* interface is being renamed */
2403 rb_define_const(rb_cSocket, "IFF_RENAMING", INTEGER2NUM(IFF_RENAMING));
2404 /* interface is being renamed */
2405 rb_define_const(rb_mSockConst, "IFF_RENAMING", INTEGER2NUM(IFF_RENAMING));
2406 #endif
2407 #if defined(IFF_ROUTE)
2408 /* routing entry installed */
2409 rb_define_const(rb_cSocket, "IFF_ROUTE", INTEGER2NUM(IFF_ROUTE));
2410 /* routing entry installed */
2411 rb_define_const(rb_mSockConst, "IFF_ROUTE", INTEGER2NUM(IFF_ROUTE));
2412 #endif
2413 #if defined(IFF_RUNNING)
2414 /* resources allocated */
2415 rb_define_const(rb_cSocket, "IFF_RUNNING", INTEGER2NUM(IFF_RUNNING));
2416 /* resources allocated */
2417 rb_define_const(rb_mSockConst, "IFF_RUNNING", INTEGER2NUM(IFF_RUNNING));
2418 #endif
2419 #if defined(IFF_SIMPLEX)
2420 /* can't hear own transmissions */
2421 rb_define_const(rb_cSocket, "IFF_SIMPLEX", INTEGER2NUM(IFF_SIMPLEX));
2422 /* can't hear own transmissions */
2423 rb_define_const(rb_mSockConst, "IFF_SIMPLEX", INTEGER2NUM(IFF_SIMPLEX));
2424 #endif
2425 #if defined(IFF_SLAVE)
2426 /* slave of a load balancer */
2427 rb_define_const(rb_cSocket, "IFF_SLAVE", INTEGER2NUM(IFF_SLAVE));
2428 /* slave of a load balancer */
2429 rb_define_const(rb_mSockConst, "IFF_SLAVE", INTEGER2NUM(IFF_SLAVE));
2430 #endif
2431 #if defined(IFF_SLAVE_INACTIVE)
2432 /* bonding slave not the curr. active */
2433 rb_define_const(rb_cSocket, "IFF_SLAVE_INACTIVE", INTEGER2NUM(IFF_SLAVE_INACTIVE));
2434 /* bonding slave not the curr. active */
2435 rb_define_const(rb_mSockConst, "IFF_SLAVE_INACTIVE", INTEGER2NUM(IFF_SLAVE_INACTIVE));
2436 #endif
2437 #if defined(IFF_SLAVE_NEEDARP)
2438 /* need ARPs for validation */
2439 rb_define_const(rb_cSocket, "IFF_SLAVE_NEEDARP", INTEGER2NUM(IFF_SLAVE_NEEDARP));
2440 /* need ARPs for validation */
2441 rb_define_const(rb_mSockConst, "IFF_SLAVE_NEEDARP", INTEGER2NUM(IFF_SLAVE_NEEDARP));
2442 #endif
2443 #if defined(IFF_SMART)
2444 /* interface manages own routes */
2445 rb_define_const(rb_cSocket, "IFF_SMART", INTEGER2NUM(IFF_SMART));
2446 /* interface manages own routes */
2447 rb_define_const(rb_mSockConst, "IFF_SMART", INTEGER2NUM(IFF_SMART));
2448 #endif
2449 #if defined(IFF_STATICARP)
2450 /* static ARP */
2451 rb_define_const(rb_cSocket, "IFF_STATICARP", INTEGER2NUM(IFF_STATICARP));
2452 /* static ARP */
2453 rb_define_const(rb_mSockConst, "IFF_STATICARP", INTEGER2NUM(IFF_STATICARP));
2454 #endif
2455 #if defined(IFF_SUPP_NOFCS)
2456 /* sending custom FCS */
2457 rb_define_const(rb_cSocket, "IFF_SUPP_NOFCS", INTEGER2NUM(IFF_SUPP_NOFCS));
2458 /* sending custom FCS */
2459 rb_define_const(rb_mSockConst, "IFF_SUPP_NOFCS", INTEGER2NUM(IFF_SUPP_NOFCS));
2460 #endif
2461 #if defined(IFF_TEAM_PORT)
2462 /* used as team port */
2463 rb_define_const(rb_cSocket, "IFF_TEAM_PORT", INTEGER2NUM(IFF_TEAM_PORT));
2464 /* used as team port */
2465 rb_define_const(rb_mSockConst, "IFF_TEAM_PORT", INTEGER2NUM(IFF_TEAM_PORT));
2466 #endif
2467 #if defined(IFF_TX_SKB_SHARING)
2468 /* sharing skbs on transmit */
2469 rb_define_const(rb_cSocket, "IFF_TX_SKB_SHARING", INTEGER2NUM(IFF_TX_SKB_SHARING));
2470 /* sharing skbs on transmit */
2471 rb_define_const(rb_mSockConst, "IFF_TX_SKB_SHARING", INTEGER2NUM(IFF_TX_SKB_SHARING));
2472 #endif
2473 #if defined(IFF_UNICAST_FLT)
2474 /* unicast filtering */
2475 rb_define_const(rb_cSocket, "IFF_UNICAST_FLT", INTEGER2NUM(IFF_UNICAST_FLT));
2476 /* unicast filtering */
2477 rb_define_const(rb_mSockConst, "IFF_UNICAST_FLT", INTEGER2NUM(IFF_UNICAST_FLT));
2478 #endif
2479 #if defined(IFF_UP)
2480 /* interface is up */
2481 rb_define_const(rb_cSocket, "IFF_UP", INTEGER2NUM(IFF_UP));
2482 /* interface is up */
2483 rb_define_const(rb_mSockConst, "IFF_UP", INTEGER2NUM(IFF_UP));
2484 #endif
2485 #if defined(IFF_WAN_HDLC)
2486 /* WAN HDLC device */
2487 rb_define_const(rb_cSocket, "IFF_WAN_HDLC", INTEGER2NUM(IFF_WAN_HDLC));
2488 /* WAN HDLC device */
2489 rb_define_const(rb_mSockConst, "IFF_WAN_HDLC", INTEGER2NUM(IFF_WAN_HDLC));
2490 #endif
2491 #if defined(IFF_XMIT_DST_RELEASE)
2492 /* dev_hard_start_xmit() is allowed to release skb->dst */
2493 rb_define_const(rb_cSocket, "IFF_XMIT_DST_RELEASE", INTEGER2NUM(IFF_XMIT_DST_RELEASE));
2494 /* dev_hard_start_xmit() is allowed to release skb->dst */
2495 rb_define_const(rb_mSockConst, "IFF_XMIT_DST_RELEASE", INTEGER2NUM(IFF_XMIT_DST_RELEASE));
2496 #endif
2497 #if defined(IFF_VOLATILE)
2498 /* volatile flags */
2499 rb_define_const(rb_cSocket, "IFF_VOLATILE", INTEGER2NUM(IFF_VOLATILE));
2500 /* volatile flags */
2501 rb_define_const(rb_mSockConst, "IFF_VOLATILE", INTEGER2NUM(IFF_VOLATILE));
2502 #endif
2503 #if defined(IFF_CANTCHANGE)
2504 /* flags not changeable */
2505 rb_define_const(rb_cSocket, "IFF_CANTCHANGE", INTEGER2NUM(IFF_CANTCHANGE));
2506 /* flags not changeable */
2507 rb_define_const(rb_mSockConst, "IFF_CANTCHANGE", INTEGER2NUM(IFF_CANTCHANGE));
2508 #endif
2509
2510 rsock_intern_family_hash = st_init_numtable();
2511 #ifdef AF_E164
2512 st_insert(rsock_intern_family_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("AF_E164", 7));
2513 #endif
2514 #ifdef AF_PACKET
2515 st_insert(rsock_intern_family_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("AF_PACKET", 9));
2516 #endif
2517 #ifdef AF_MAX
2518 st_insert(rsock_intern_family_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("AF_MAX", 6));
2519 #endif
2520 #ifdef AF_NETGRAPH
2521 st_insert(rsock_intern_family_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("AF_NETGRAPH", 11));
2522 #endif
2523 #ifdef AF_ATM
2524 st_insert(rsock_intern_family_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("AF_ATM", 6));
2525 #endif
2526 #ifdef AF_PPP
2527 st_insert(rsock_intern_family_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("AF_PPP", 6));
2528 #endif
2529 #ifdef AF_NETBIOS
2530 st_insert(rsock_intern_family_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("AF_NETBIOS", 10));
2531 #endif
2532 #ifdef AF_SYSTEM
2533 st_insert(rsock_intern_family_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("AF_SYSTEM", 9));
2534 #endif
2535 #ifdef AF_NATM
2536 st_insert(rsock_intern_family_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("AF_NATM", 7));
2537 #endif
2538 #ifdef AF_ISDN
2539 st_insert(rsock_intern_family_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("AF_ISDN", 7));
2540 #endif
2541 #ifdef AF_NDRV
2542 st_insert(rsock_intern_family_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("AF_NDRV", 7));
2543 #endif
2544 #ifdef AF_SIP
2545 st_insert(rsock_intern_family_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("AF_SIP", 6));
2546 #endif
2547 #ifdef AF_CNT
2548 st_insert(rsock_intern_family_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("AF_CNT", 6));
2549 #endif
2550 #ifdef AF_COIP
2551 st_insert(rsock_intern_family_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("AF_COIP", 7));
2552 #endif
2553 #ifdef AF_LINK
2554 st_insert(rsock_intern_family_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("AF_LINK", 7));
2555 #endif
2556 #ifdef AF_ROUTE
2557 st_insert(rsock_intern_family_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("AF_ROUTE", 8));
2558 #endif
2559 #ifdef AF_HYLINK
2560 st_insert(rsock_intern_family_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("AF_HYLINK", 9));
2561 #endif
2562 #ifdef AF_LAT
2563 st_insert(rsock_intern_family_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("AF_LAT", 6));
2564 #endif
2565 #ifdef AF_DLI
2566 st_insert(rsock_intern_family_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("AF_DLI", 6));
2567 #endif
2568 #ifdef AF_DEC
2569 st_insert(rsock_intern_family_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("AF_DEC", 6));
2570 #endif
2571 #ifdef AF_SNA
2572 st_insert(rsock_intern_family_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("AF_SNA", 6));
2573 #endif
2574 #ifdef AF_CCITT
2575 st_insert(rsock_intern_family_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("AF_CCITT", 8));
2576 #endif
2577 #ifdef AF_DATAKIT
2578 st_insert(rsock_intern_family_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("AF_DATAKIT", 10));
2579 #endif
2580 #ifdef AF_ECMA
2581 st_insert(rsock_intern_family_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("AF_ECMA", 7));
2582 #endif
2583 #ifdef AF_OSI
2584 st_insert(rsock_intern_family_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("AF_OSI", 6));
2585 #endif
2586 #ifdef AF_ISO
2587 st_insert(rsock_intern_family_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("AF_ISO", 6));
2588 #endif
2589 #ifdef AF_NS
2590 st_insert(rsock_intern_family_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("AF_NS", 5));
2591 #endif
2592 #ifdef AF_CHAOS
2593 st_insert(rsock_intern_family_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("AF_CHAOS", 8));
2594 #endif
2595 #ifdef AF_PUP
2596 st_insert(rsock_intern_family_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("AF_PUP", 6));
2597 #endif
2598 #ifdef AF_IMPLINK
2599 st_insert(rsock_intern_family_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("AF_IMPLINK", 10));
2600 #endif
2601 #ifdef AF_LOCAL
2602 st_insert(rsock_intern_family_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("AF_LOCAL", 8));
2603 #endif
2604 #ifdef AF_APPLETALK
2605 st_insert(rsock_intern_family_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("AF_APPLETALK", 12));
2606 #endif
2607 #ifdef AF_IPX
2608 st_insert(rsock_intern_family_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("AF_IPX", 6));
2609 #endif
2610 #ifdef AF_AX25
2611 st_insert(rsock_intern_family_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AF_AX25", 7));
2612 #endif
2613 #ifdef AF_UNIX
2614 st_insert(rsock_intern_family_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("AF_UNIX", 7));
2615 #endif
2616 #ifdef AF_INET6
2617 st_insert(rsock_intern_family_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("AF_INET6", 8));
2618 #endif
2619 #ifdef AF_INET
2620 st_insert(rsock_intern_family_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("AF_INET", 7));
2621 #endif
2622 #ifdef AF_UNSPEC
2623 st_insert(rsock_intern_family_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("AF_UNSPEC", 9));
2624 #endif
2625
2626 rsock_intern_family_noprefix_hash = st_init_numtable();
2627 #ifdef AF_E164
2628 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("AF_E164", 7));
2629 #endif
2630 #ifdef AF_PACKET
2631 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("AF_PACKET", 9));
2632 #endif
2633 #ifdef AF_MAX
2634 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("AF_MAX", 6));
2635 #endif
2636 #ifdef AF_NETGRAPH
2637 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("AF_NETGRAPH", 11));
2638 #endif
2639 #ifdef AF_ATM
2640 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("AF_ATM", 6));
2641 #endif
2642 #ifdef AF_PPP
2643 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("AF_PPP", 6));
2644 #endif
2645 #ifdef AF_NETBIOS
2646 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("AF_NETBIOS", 10));
2647 #endif
2648 #ifdef AF_SYSTEM
2649 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("AF_SYSTEM", 9));
2650 #endif
2651 #ifdef AF_NATM
2652 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("AF_NATM", 7));
2653 #endif
2654 #ifdef AF_ISDN
2655 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("AF_ISDN", 7));
2656 #endif
2657 #ifdef AF_NDRV
2658 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("AF_NDRV", 7));
2659 #endif
2660 #ifdef AF_SIP
2661 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("AF_SIP", 6));
2662 #endif
2663 #ifdef AF_CNT
2664 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("AF_CNT", 6));
2665 #endif
2666 #ifdef AF_COIP
2667 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("AF_COIP", 7));
2668 #endif
2669 #ifdef AF_LINK
2670 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("AF_LINK", 7));
2671 #endif
2672 #ifdef AF_ROUTE
2673 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("AF_ROUTE", 8));
2674 #endif
2675 #ifdef AF_HYLINK
2676 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("AF_HYLINK", 9));
2677 #endif
2678 #ifdef AF_LAT
2679 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("AF_LAT", 6));
2680 #endif
2681 #ifdef AF_DLI
2682 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("AF_DLI", 6));
2683 #endif
2684 #ifdef AF_DEC
2685 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("AF_DEC", 6));
2686 #endif
2687 #ifdef AF_SNA
2688 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("AF_SNA", 6));
2689 #endif
2690 #ifdef AF_CCITT
2691 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("AF_CCITT", 8));
2692 #endif
2693 #ifdef AF_DATAKIT
2694 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("AF_DATAKIT", 10));
2695 #endif
2696 #ifdef AF_ECMA
2697 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("AF_ECMA", 7));
2698 #endif
2699 #ifdef AF_OSI
2700 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("AF_OSI", 6));
2701 #endif
2702 #ifdef AF_ISO
2703 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("AF_ISO", 6));
2704 #endif
2705 #ifdef AF_NS
2706 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("AF_NS", 5));
2707 #endif
2708 #ifdef AF_CHAOS
2709 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("AF_CHAOS", 8));
2710 #endif
2711 #ifdef AF_PUP
2712 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("AF_PUP", 6));
2713 #endif
2714 #ifdef AF_IMPLINK
2715 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("AF_IMPLINK", 10));
2716 #endif
2717 #ifdef AF_LOCAL
2718 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("AF_LOCAL", 8));
2719 #endif
2720 #ifdef AF_APPLETALK
2721 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("AF_APPLETALK", 12));
2722 #endif
2723 #ifdef AF_IPX
2724 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("AF_IPX", 6));
2725 #endif
2726 #ifdef AF_AX25
2727 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AF_AX25", 7));
2728 #endif
2729 #ifdef AF_UNIX
2730 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("AF_UNIX", 7));
2731 #endif
2732 #ifdef AF_INET6
2733 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("AF_INET6", 8));
2734 #endif
2735 #ifdef AF_INET
2736 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("AF_INET", 7));
2737 #endif
2738 #ifdef AF_UNSPEC
2739 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("AF_UNSPEC", 9));
2740 #endif
2741 #ifdef AF_E164
2742 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("E164", 4));
2743 #endif
2744 #ifdef AF_PACKET
2745 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("PACKET", 6));
2746 #endif
2747 #ifdef AF_MAX
2748 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("MAX", 3));
2749 #endif
2750 #ifdef AF_NETGRAPH
2751 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("NETGRAPH", 8));
2752 #endif
2753 #ifdef AF_ATM
2754 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("ATM", 3));
2755 #endif
2756 #ifdef AF_PPP
2757 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("PPP", 3));
2758 #endif
2759 #ifdef AF_NETBIOS
2760 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("NETBIOS", 7));
2761 #endif
2762 #ifdef AF_SYSTEM
2763 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("SYSTEM", 6));
2764 #endif
2765 #ifdef AF_NATM
2766 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("NATM", 4));
2767 #endif
2768 #ifdef AF_ISDN
2769 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("ISDN", 4));
2770 #endif
2771 #ifdef AF_NDRV
2772 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("NDRV", 4));
2773 #endif
2774 #ifdef AF_SIP
2775 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("SIP", 3));
2776 #endif
2777 #ifdef AF_CNT
2778 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("CNT", 3));
2779 #endif
2780 #ifdef AF_COIP
2781 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("COIP", 4));
2782 #endif
2783 #ifdef AF_LINK
2784 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("LINK", 4));
2785 #endif
2786 #ifdef AF_ROUTE
2787 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("ROUTE", 5));
2788 #endif
2789 #ifdef AF_HYLINK
2790 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("HYLINK", 6));
2791 #endif
2792 #ifdef AF_LAT
2793 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("LAT", 3));
2794 #endif
2795 #ifdef AF_DLI
2796 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("DLI", 3));
2797 #endif
2798 #ifdef AF_DEC
2799 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("DEC", 3));
2800 #endif
2801 #ifdef AF_SNA
2802 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("SNA", 3));
2803 #endif
2804 #ifdef AF_CCITT
2805 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("CCITT", 5));
2806 #endif
2807 #ifdef AF_DATAKIT
2808 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("DATAKIT", 7));
2809 #endif
2810 #ifdef AF_ECMA
2811 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("ECMA", 4));
2812 #endif
2813 #ifdef AF_OSI
2814 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("OSI", 3));
2815 #endif
2816 #ifdef AF_ISO
2817 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("ISO", 3));
2818 #endif
2819 #ifdef AF_NS
2820 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("NS", 2));
2821 #endif
2822 #ifdef AF_CHAOS
2823 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("CHAOS", 5));
2824 #endif
2825 #ifdef AF_PUP
2826 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("PUP", 3));
2827 #endif
2828 #ifdef AF_IMPLINK
2829 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("IMPLINK", 7));
2830 #endif
2831 #ifdef AF_LOCAL
2832 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("LOCAL", 5));
2833 #endif
2834 #ifdef AF_APPLETALK
2835 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("APPLETALK", 9));
2836 #endif
2837 #ifdef AF_IPX
2838 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("IPX", 3));
2839 #endif
2840 #ifdef AF_AX25
2841 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AX25", 4));
2842 #endif
2843 #ifdef AF_UNIX
2844 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("UNIX", 4));
2845 #endif
2846 #ifdef AF_INET6
2847 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("INET6", 5));
2848 #endif
2849 #ifdef AF_INET
2850 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("INET", 4));
2851 #endif
2852 #ifdef AF_UNSPEC
2853 st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("UNSPEC", 6));
2854 #endif
2855
2856 rsock_intern_protocol_family_hash = st_init_numtable();
2857 #ifdef PF_KEY
2858 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_KEY, (st_data_t)rb_intern2("PF_KEY", 6));
2859 #endif
2860 #ifdef PF_PIP
2861 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PIP, (st_data_t)rb_intern2("PF_PIP", 6));
2862 #endif
2863 #ifdef PF_RTIP
2864 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_RTIP, (st_data_t)rb_intern2("PF_RTIP", 7));
2865 #endif
2866 #ifdef PF_XTP
2867 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_XTP, (st_data_t)rb_intern2("PF_XTP", 6));
2868 #endif
2869 #ifdef PF_PACKET
2870 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PACKET, (st_data_t)rb_intern2("PF_PACKET", 9));
2871 #endif
2872 #ifdef PF_MAX
2873 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_MAX, (st_data_t)rb_intern2("PF_MAX", 6));
2874 #endif
2875 #ifdef PF_NETGRAPH
2876 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NETGRAPH, (st_data_t)rb_intern2("PF_NETGRAPH", 11));
2877 #endif
2878 #ifdef PF_ATM
2879 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ATM, (st_data_t)rb_intern2("PF_ATM", 6));
2880 #endif
2881 #ifdef PF_PPP
2882 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PPP, (st_data_t)rb_intern2("PF_PPP", 6));
2883 #endif
2884 #ifdef PF_NETBIOS
2885 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NETBIOS, (st_data_t)rb_intern2("PF_NETBIOS", 10));
2886 #endif
2887 #ifdef PF_SYSTEM
2888 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SYSTEM, (st_data_t)rb_intern2("PF_SYSTEM", 9));
2889 #endif
2890 #ifdef PF_NATM
2891 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NATM, (st_data_t)rb_intern2("PF_NATM", 7));
2892 #endif
2893 #ifdef PF_ISDN
2894 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ISDN, (st_data_t)rb_intern2("PF_ISDN", 7));
2895 #endif
2896 #ifdef PF_NDRV
2897 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NDRV, (st_data_t)rb_intern2("PF_NDRV", 7));
2898 #endif
2899 #ifdef PF_SIP
2900 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SIP, (st_data_t)rb_intern2("PF_SIP", 6));
2901 #endif
2902 #ifdef PF_CNT
2903 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CNT, (st_data_t)rb_intern2("PF_CNT", 6));
2904 #endif
2905 #ifdef PF_COIP
2906 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_COIP, (st_data_t)rb_intern2("PF_COIP", 7));
2907 #endif
2908 #ifdef PF_LINK
2909 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LINK, (st_data_t)rb_intern2("PF_LINK", 7));
2910 #endif
2911 #ifdef PF_ROUTE
2912 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ROUTE, (st_data_t)rb_intern2("PF_ROUTE", 8));
2913 #endif
2914 #ifdef PF_HYLINK
2915 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_HYLINK, (st_data_t)rb_intern2("PF_HYLINK", 9));
2916 #endif
2917 #ifdef PF_LAT
2918 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LAT, (st_data_t)rb_intern2("PF_LAT", 6));
2919 #endif
2920 #ifdef PF_DLI
2921 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DLI, (st_data_t)rb_intern2("PF_DLI", 6));
2922 #endif
2923 #ifdef PF_DEC
2924 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DEC, (st_data_t)rb_intern2("PF_DEC", 6));
2925 #endif
2926 #ifdef PF_SNA
2927 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SNA, (st_data_t)rb_intern2("PF_SNA", 6));
2928 #endif
2929 #ifdef PF_CCITT
2930 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CCITT, (st_data_t)rb_intern2("PF_CCITT", 8));
2931 #endif
2932 #ifdef PF_DATAKIT
2933 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DATAKIT, (st_data_t)rb_intern2("PF_DATAKIT", 10));
2934 #endif
2935 #ifdef PF_ECMA
2936 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ECMA, (st_data_t)rb_intern2("PF_ECMA", 7));
2937 #endif
2938 #ifdef PF_OSI
2939 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_OSI, (st_data_t)rb_intern2("PF_OSI", 6));
2940 #endif
2941 #ifdef PF_ISO
2942 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ISO, (st_data_t)rb_intern2("PF_ISO", 6));
2943 #endif
2944 #ifdef PF_NS
2945 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NS, (st_data_t)rb_intern2("PF_NS", 5));
2946 #endif
2947 #ifdef PF_CHAOS
2948 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CHAOS, (st_data_t)rb_intern2("PF_CHAOS", 8));
2949 #endif
2950 #ifdef PF_PUP
2951 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PUP, (st_data_t)rb_intern2("PF_PUP", 6));
2952 #endif
2953 #ifdef PF_IMPLINK
2954 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_IMPLINK, (st_data_t)rb_intern2("PF_IMPLINK", 10));
2955 #endif
2956 #ifdef PF_LOCAL
2957 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LOCAL, (st_data_t)rb_intern2("PF_LOCAL", 8));
2958 #endif
2959 #ifdef PF_APPLETALK
2960 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_APPLETALK, (st_data_t)rb_intern2("PF_APPLETALK", 12));
2961 #endif
2962 #ifdef PF_IPX
2963 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_IPX, (st_data_t)rb_intern2("PF_IPX", 6));
2964 #endif
2965 #ifdef PF_AX25
2966 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_AX25, (st_data_t)rb_intern2("PF_AX25", 7));
2967 #endif
2968 #ifdef PF_UNIX
2969 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_UNIX, (st_data_t)rb_intern2("PF_UNIX", 7));
2970 #endif
2971 #ifdef PF_INET6
2972 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_INET6, (st_data_t)rb_intern2("PF_INET6", 8));
2973 #endif
2974 #ifdef PF_INET
2975 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_INET, (st_data_t)rb_intern2("PF_INET", 7));
2976 #endif
2977 #ifdef PF_UNSPEC
2978 st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_UNSPEC, (st_data_t)rb_intern2("PF_UNSPEC", 9));
2979 #endif
2980
2981 rsock_intern_socktype_hash = st_init_numtable();
2982 #ifdef SOCK_PACKET
2983 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_PACKET, (st_data_t)rb_intern2("SOCK_PACKET", 11));
2984 #endif
2985 #ifdef SOCK_SEQPACKET
2986 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_SEQPACKET, (st_data_t)rb_intern2("SOCK_SEQPACKET", 14));
2987 #endif
2988 #ifdef SOCK_RDM
2989 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_RDM, (st_data_t)rb_intern2("SOCK_RDM", 8));
2990 #endif
2991 #ifdef SOCK_RAW
2992 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_RAW, (st_data_t)rb_intern2("SOCK_RAW", 8));
2993 #endif
2994 #ifdef SOCK_DGRAM
2995 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_DGRAM, (st_data_t)rb_intern2("SOCK_DGRAM", 10));
2996 #endif
2997 #ifdef SOCK_STREAM
2998 st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_STREAM, (st_data_t)rb_intern2("SOCK_STREAM", 11));
2999 #endif
3000
3001 rsock_intern_ipproto_hash = st_init_numtable();
3002 #ifdef IPPROTO_MAX
3003 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("IPPROTO_MAX", 11));
3004 #endif
3005 #ifdef IPPROTO_RAW
3006 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("IPPROTO_RAW", 11));
3007 #endif
3008 #ifdef IPPROTO_ROUTING
3009 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("IPPROTO_ROUTING", 15));
3010 #endif
3011 #ifdef IPPROTO_NONE
3012 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("IPPROTO_NONE", 12));
3013 #endif
3014 #ifdef IPPROTO_IPV6
3015 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPPROTO_IPV6", 12));
3016 #endif
3017 #ifdef IPPROTO_ICMPV6
3018 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("IPPROTO_ICMPV6", 14));
3019 #endif
3020 #ifdef IPPROTO_HOPOPTS
3021 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("IPPROTO_HOPOPTS", 15));
3022 #endif
3023 #ifdef IPPROTO_FRAGMENT
3024 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("IPPROTO_FRAGMENT", 16));
3025 #endif
3026 #ifdef IPPROTO_ESP
3027 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("IPPROTO_ESP", 11));
3028 #endif
3029 #ifdef IPPROTO_DSTOPTS
3030 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("IPPROTO_DSTOPTS", 15));
3031 #endif
3032 #ifdef IPPROTO_AH
3033 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("IPPROTO_AH", 10));
3034 #endif
3035 #ifdef IPPROTO_BIP
3036 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("IPPROTO_BIP", 11));
3037 #endif
3038 #ifdef IPPROTO_EON
3039 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("IPPROTO_EON", 11));
3040 #endif
3041 #ifdef IPPROTO_XTP
3042 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("IPPROTO_XTP", 11));
3043 #endif
3044 #ifdef IPPROTO_TP
3045 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("IPPROTO_TP", 10));
3046 #endif
3047 #ifdef IPPROTO_ND
3048 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("IPPROTO_ND", 10));
3049 #endif
3050 #ifdef IPPROTO_HELLO
3051 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("IPPROTO_HELLO", 13));
3052 #endif
3053 #ifdef IPPROTO_IDP
3054 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IPPROTO_IDP", 11));
3055 #endif
3056 #ifdef IPPROTO_UDP
3057 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("IPPROTO_UDP", 11));
3058 #endif
3059 #ifdef IPPROTO_PUP
3060 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("IPPROTO_PUP", 11));
3061 #endif
3062 #ifdef IPPROTO_EGP
3063 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("IPPROTO_EGP", 11));
3064 #endif
3065 #ifdef IPPROTO_TCP
3066 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("IPPROTO_TCP", 11));
3067 #endif
3068 #ifdef IPPROTO_GGP
3069 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("IPPROTO_GGP", 11));
3070 #endif
3071 #ifdef IPPROTO_IGMP
3072 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IPPROTO_IGMP", 12));
3073 #endif
3074 #ifdef IPPROTO_ICMP
3075 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("IPPROTO_ICMP", 12));
3076 #endif
3077 #ifdef IPPROTO_IP
3078 st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IPPROTO_IP", 10));
3079 #endif
3080
3081 rsock_intern_iplevel_hash = st_init_numtable();
3082 #ifdef IPPROTO_MAX
3083 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("IPPROTO_MAX", 11));
3084 #endif
3085 #ifdef IPPROTO_RAW
3086 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("IPPROTO_RAW", 11));
3087 #endif
3088 #ifdef IPPROTO_ROUTING
3089 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("IPPROTO_ROUTING", 15));
3090 #endif
3091 #ifdef IPPROTO_NONE
3092 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("IPPROTO_NONE", 12));
3093 #endif
3094 #ifdef IPPROTO_IPV6
3095 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPPROTO_IPV6", 12));
3096 #endif
3097 #ifdef IPPROTO_ICMPV6
3098 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("IPPROTO_ICMPV6", 14));
3099 #endif
3100 #ifdef IPPROTO_HOPOPTS
3101 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("IPPROTO_HOPOPTS", 15));
3102 #endif
3103 #ifdef IPPROTO_FRAGMENT
3104 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("IPPROTO_FRAGMENT", 16));
3105 #endif
3106 #ifdef IPPROTO_ESP
3107 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("IPPROTO_ESP", 11));
3108 #endif
3109 #ifdef IPPROTO_DSTOPTS
3110 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("IPPROTO_DSTOPTS", 15));
3111 #endif
3112 #ifdef IPPROTO_AH
3113 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("IPPROTO_AH", 10));
3114 #endif
3115 #ifdef IPPROTO_BIP
3116 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("IPPROTO_BIP", 11));
3117 #endif
3118 #ifdef IPPROTO_EON
3119 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("IPPROTO_EON", 11));
3120 #endif
3121 #ifdef IPPROTO_XTP
3122 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("IPPROTO_XTP", 11));
3123 #endif
3124 #ifdef IPPROTO_TP
3125 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("IPPROTO_TP", 10));
3126 #endif
3127 #ifdef IPPROTO_ND
3128 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("IPPROTO_ND", 10));
3129 #endif
3130 #ifdef IPPROTO_HELLO
3131 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("IPPROTO_HELLO", 13));
3132 #endif
3133 #ifdef IPPROTO_IDP
3134 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IPPROTO_IDP", 11));
3135 #endif
3136 #ifdef IPPROTO_UDP
3137 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("IPPROTO_UDP", 11));
3138 #endif
3139 #ifdef IPPROTO_PUP
3140 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("IPPROTO_PUP", 11));
3141 #endif
3142 #ifdef IPPROTO_EGP
3143 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("IPPROTO_EGP", 11));
3144 #endif
3145 #ifdef IPPROTO_TCP
3146 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("IPPROTO_TCP", 11));
3147 #endif
3148 #ifdef IPPROTO_GGP
3149 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("IPPROTO_GGP", 11));
3150 #endif
3151 #ifdef IPPROTO_IGMP
3152 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IPPROTO_IGMP", 12));
3153 #endif
3154 #ifdef IPPROTO_ICMP
3155 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("IPPROTO_ICMP", 12));
3156 #endif
3157 #ifdef IPPROTO_IP
3158 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IPPROTO_IP", 10));
3159 #endif
3160 #ifdef SOL_SOCKET
3161 st_insert(rsock_intern_iplevel_hash, (st_data_t)SOL_SOCKET, (st_data_t)rb_intern2("SOL_SOCKET", 10));
3162 #endif
3163 #ifdef IPPROTO_MAX
3164 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("MAX", 3));
3165 #endif
3166 #ifdef IPPROTO_RAW
3167 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("RAW", 3));
3168 #endif
3169 #ifdef IPPROTO_ROUTING
3170 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("ROUTING", 7));
3171 #endif
3172 #ifdef IPPROTO_NONE
3173 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("NONE", 4));
3174 #endif
3175 #ifdef IPPROTO_IPV6
3176 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPV6", 4));
3177 #endif
3178 #ifdef IPPROTO_ICMPV6
3179 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("ICMPV6", 6));
3180 #endif
3181 #ifdef IPPROTO_HOPOPTS
3182 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("HOPOPTS", 7));
3183 #endif
3184 #ifdef IPPROTO_FRAGMENT
3185 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("FRAGMENT", 8));
3186 #endif
3187 #ifdef IPPROTO_ESP
3188 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("ESP", 3));
3189 #endif
3190 #ifdef IPPROTO_DSTOPTS
3191 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("DSTOPTS", 7));
3192 #endif
3193 #ifdef IPPROTO_AH
3194 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("AH", 2));
3195 #endif
3196 #ifdef IPPROTO_BIP
3197 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("BIP", 3));
3198 #endif
3199 #ifdef IPPROTO_EON
3200 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("EON", 3));
3201 #endif
3202 #ifdef IPPROTO_XTP
3203 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("XTP", 3));
3204 #endif
3205 #ifdef IPPROTO_TP
3206 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("TP", 2));
3207 #endif
3208 #ifdef IPPROTO_ND
3209 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("ND", 2));
3210 #endif
3211 #ifdef IPPROTO_HELLO
3212 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("HELLO", 5));
3213 #endif
3214 #ifdef IPPROTO_IDP
3215 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IDP", 3));
3216 #endif
3217 #ifdef IPPROTO_UDP
3218 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("UDP", 3));
3219 #endif
3220 #ifdef IPPROTO_PUP
3221 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("PUP", 3));
3222 #endif
3223 #ifdef IPPROTO_EGP
3224 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("EGP", 3));
3225 #endif
3226 #ifdef IPPROTO_TCP
3227 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("TCP", 3));
3228 #endif
3229 #ifdef IPPROTO_GGP
3230 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("GGP", 3));
3231 #endif
3232 #ifdef IPPROTO_IGMP
3233 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IGMP", 4));
3234 #endif
3235 #ifdef IPPROTO_ICMP
3236 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("ICMP", 4));
3237 #endif
3238 #ifdef IPPROTO_IP
3239 st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IP", 2));
3240 #endif
3241 #ifdef SOL_SOCKET
3242 st_insert(rsock_intern_iplevel_hash, (st_data_t)SOL_SOCKET, (st_data_t)rb_intern2("SOCKET", 6));
3243 #endif
3244
3245 rsock_intern_so_optname_hash = st_init_numtable();
3246 #ifdef SO_ALLZONES
3247 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ALLZONES, (st_data_t)rb_intern2("SO_ALLZONES", 11));
3248 #endif
3249 #ifdef SO_MAC_EXEMPT
3250 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_MAC_EXEMPT, (st_data_t)rb_intern2("SO_MAC_EXEMPT", 13));
3251 #endif
3252 #ifdef SO_RECVUCRED
3253 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RECVUCRED, (st_data_t)rb_intern2("SO_RECVUCRED", 12));
3254 #endif
3255 #ifdef SO_BINTIME
3256 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINTIME, (st_data_t)rb_intern2("SO_BINTIME", 10));
3257 #endif
3258 #ifdef SO_TIMESTAMPNS
3259 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMPNS, (st_data_t)rb_intern2("SO_TIMESTAMPNS", 14));
3260 #endif
3261 #ifdef SO_TIMESTAMP
3262 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMP, (st_data_t)rb_intern2("SO_TIMESTAMP", 12));
3263 #endif
3264 #ifdef SO_PEERNAME
3265 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERNAME, (st_data_t)rb_intern2("SO_PEERNAME", 11));
3266 #endif
3267 #ifdef SO_DETACH_FILTER
3268 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DETACH_FILTER, (st_data_t)rb_intern2("SO_DETACH_FILTER", 16));
3269 #endif
3270 #ifdef SO_ATTACH_FILTER
3271 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ATTACH_FILTER, (st_data_t)rb_intern2("SO_ATTACH_FILTER", 16));
3272 #endif
3273 #ifdef SO_BINDTODEVICE
3274 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINDTODEVICE, (st_data_t)rb_intern2("SO_BINDTODEVICE", 15));
3275 #endif
3276 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
3277 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_NETWORK, (st_data_t)rb_intern2("SO_SECURITY_ENCRYPTION_NETWORK", 30));
3278 #endif
3279 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
3280 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_TRANSPORT, (st_data_t)rb_intern2("SO_SECURITY_ENCRYPTION_TRANSPORT", 32));
3281 #endif
3282 #ifdef SO_SECURITY_AUTHENTICATION
3283 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_AUTHENTICATION, (st_data_t)rb_intern2("SO_SECURITY_AUTHENTICATION", 26));
3284 #endif
3285 #ifdef SO_NOSIGPIPE
3286 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NOSIGPIPE, (st_data_t)rb_intern2("SO_NOSIGPIPE", 12));
3287 #endif
3288 #ifdef SO_NKE
3289 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NKE, (st_data_t)rb_intern2("SO_NKE", 6));
3290 #endif
3291 #ifdef SO_NREAD
3292 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NREAD, (st_data_t)rb_intern2("SO_NREAD", 8));
3293 #endif
3294 #ifdef SO_WANTOOBFLAG
3295 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTOOBFLAG, (st_data_t)rb_intern2("SO_WANTOOBFLAG", 14));
3296 #endif
3297 #ifdef SO_WANTMORE
3298 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTMORE, (st_data_t)rb_intern2("SO_WANTMORE", 11));
3299 #endif
3300 #ifdef SO_DONTTRUNC
3301 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTTRUNC, (st_data_t)rb_intern2("SO_DONTTRUNC", 12));
3302 #endif
3303 #ifdef SO_ACCEPTFILTER
3304 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTFILTER, (st_data_t)rb_intern2("SO_ACCEPTFILTER", 15));
3305 #endif
3306 #ifdef SO_USELOOPBACK
3307 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_USELOOPBACK, (st_data_t)rb_intern2("SO_USELOOPBACK", 14));
3308 #endif
3309 #ifdef SO_ACCEPTCONN
3310 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTCONN, (st_data_t)rb_intern2("SO_ACCEPTCONN", 13));
3311 #endif
3312 #ifdef SO_SNDTIMEO
3313 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDTIMEO, (st_data_t)rb_intern2("SO_SNDTIMEO", 11));
3314 #endif
3315 #ifdef SO_RCVTIMEO
3316 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVTIMEO, (st_data_t)rb_intern2("SO_RCVTIMEO", 11));
3317 #endif
3318 #ifdef SO_SNDLOWAT
3319 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDLOWAT, (st_data_t)rb_intern2("SO_SNDLOWAT", 11));
3320 #endif
3321 #ifdef SO_RCVLOWAT
3322 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVLOWAT, (st_data_t)rb_intern2("SO_RCVLOWAT", 11));
3323 #endif
3324 #ifdef SO_PEERCRED
3325 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERCRED, (st_data_t)rb_intern2("SO_PEERCRED", 11));
3326 #endif
3327 #ifdef SO_PASSCRED
3328 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PASSCRED, (st_data_t)rb_intern2("SO_PASSCRED", 11));
3329 #endif
3330 #ifdef SO_LINGER
3331 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_LINGER, (st_data_t)rb_intern2("SO_LINGER", 9));
3332 #endif
3333 #ifdef SO_PRIORITY
3334 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PRIORITY, (st_data_t)rb_intern2("SO_PRIORITY", 11));
3335 #endif
3336 #ifdef SO_NO_CHECK
3337 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NO_CHECK, (st_data_t)rb_intern2("SO_NO_CHECK", 11));
3338 #endif
3339 #ifdef SO_OOBINLINE
3340 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_OOBINLINE, (st_data_t)rb_intern2("SO_OOBINLINE", 12));
3341 #endif
3342 #ifdef SO_KEEPALIVE
3343 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_KEEPALIVE, (st_data_t)rb_intern2("SO_KEEPALIVE", 12));
3344 #endif
3345 #ifdef SO_RCVBUF
3346 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVBUF, (st_data_t)rb_intern2("SO_RCVBUF", 9));
3347 #endif
3348 #ifdef SO_SNDBUF
3349 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDBUF, (st_data_t)rb_intern2("SO_SNDBUF", 9));
3350 #endif
3351 #ifdef SO_BROADCAST
3352 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BROADCAST, (st_data_t)rb_intern2("SO_BROADCAST", 12));
3353 #endif
3354 #ifdef SO_DONTROUTE
3355 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTROUTE, (st_data_t)rb_intern2("SO_DONTROUTE", 12));
3356 #endif
3357 #ifdef SO_ERROR
3358 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ERROR, (st_data_t)rb_intern2("SO_ERROR", 8));
3359 #endif
3360 #ifdef SO_TYPE
3361 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TYPE, (st_data_t)rb_intern2("SO_TYPE", 7));
3362 #endif
3363 #ifdef SO_REUSEPORT
3364 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEPORT, (st_data_t)rb_intern2("SO_REUSEPORT", 12));
3365 #endif
3366 #ifdef SO_REUSEADDR
3367 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEADDR, (st_data_t)rb_intern2("SO_REUSEADDR", 12));
3368 #endif
3369 #ifdef SO_DEBUG
3370 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DEBUG, (st_data_t)rb_intern2("SO_DEBUG", 8));
3371 #endif
3372 #ifdef SO_ALLZONES
3373 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ALLZONES, (st_data_t)rb_intern2("ALLZONES", 8));
3374 #endif
3375 #ifdef SO_MAC_EXEMPT
3376 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_MAC_EXEMPT, (st_data_t)rb_intern2("MAC_EXEMPT", 10));
3377 #endif
3378 #ifdef SO_RECVUCRED
3379 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RECVUCRED, (st_data_t)rb_intern2("RECVUCRED", 9));
3380 #endif
3381 #ifdef SO_BINTIME
3382 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINTIME, (st_data_t)rb_intern2("BINTIME", 7));
3383 #endif
3384 #ifdef SO_TIMESTAMPNS
3385 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMPNS, (st_data_t)rb_intern2("TIMESTAMPNS", 11));
3386 #endif
3387 #ifdef SO_TIMESTAMP
3388 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMP, (st_data_t)rb_intern2("TIMESTAMP", 9));
3389 #endif
3390 #ifdef SO_PEERNAME
3391 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERNAME, (st_data_t)rb_intern2("PEERNAME", 8));
3392 #endif
3393 #ifdef SO_DETACH_FILTER
3394 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DETACH_FILTER, (st_data_t)rb_intern2("DETACH_FILTER", 13));
3395 #endif
3396 #ifdef SO_ATTACH_FILTER
3397 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ATTACH_FILTER, (st_data_t)rb_intern2("ATTACH_FILTER", 13));
3398 #endif
3399 #ifdef SO_BINDTODEVICE
3400 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINDTODEVICE, (st_data_t)rb_intern2("BINDTODEVICE", 12));
3401 #endif
3402 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
3403 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_NETWORK, (st_data_t)rb_intern2("SECURITY_ENCRYPTION_NETWORK", 27));
3404 #endif
3405 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
3406 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_TRANSPORT, (st_data_t)rb_intern2("SECURITY_ENCRYPTION_TRANSPORT", 29));
3407 #endif
3408 #ifdef SO_SECURITY_AUTHENTICATION
3409 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_AUTHENTICATION, (st_data_t)rb_intern2("SECURITY_AUTHENTICATION", 23));
3410 #endif
3411 #ifdef SO_NOSIGPIPE
3412 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NOSIGPIPE, (st_data_t)rb_intern2("NOSIGPIPE", 9));
3413 #endif
3414 #ifdef SO_NKE
3415 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NKE, (st_data_t)rb_intern2("NKE", 3));
3416 #endif
3417 #ifdef SO_NREAD
3418 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NREAD, (st_data_t)rb_intern2("NREAD", 5));
3419 #endif
3420 #ifdef SO_WANTOOBFLAG
3421 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTOOBFLAG, (st_data_t)rb_intern2("WANTOOBFLAG", 11));
3422 #endif
3423 #ifdef SO_WANTMORE
3424 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTMORE, (st_data_t)rb_intern2("WANTMORE", 8));
3425 #endif
3426 #ifdef SO_DONTTRUNC
3427 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTTRUNC, (st_data_t)rb_intern2("DONTTRUNC", 9));
3428 #endif
3429 #ifdef SO_ACCEPTFILTER
3430 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTFILTER, (st_data_t)rb_intern2("ACCEPTFILTER", 12));
3431 #endif
3432 #ifdef SO_USELOOPBACK
3433 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_USELOOPBACK, (st_data_t)rb_intern2("USELOOPBACK", 11));
3434 #endif
3435 #ifdef SO_ACCEPTCONN
3436 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTCONN, (st_data_t)rb_intern2("ACCEPTCONN", 10));
3437 #endif
3438 #ifdef SO_SNDTIMEO
3439 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDTIMEO, (st_data_t)rb_intern2("SNDTIMEO", 8));
3440 #endif
3441 #ifdef SO_RCVTIMEO
3442 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVTIMEO, (st_data_t)rb_intern2("RCVTIMEO", 8));
3443 #endif
3444 #ifdef SO_SNDLOWAT
3445 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDLOWAT, (st_data_t)rb_intern2("SNDLOWAT", 8));
3446 #endif
3447 #ifdef SO_RCVLOWAT
3448 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVLOWAT, (st_data_t)rb_intern2("RCVLOWAT", 8));
3449 #endif
3450 #ifdef SO_PEERCRED
3451 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERCRED, (st_data_t)rb_intern2("PEERCRED", 8));
3452 #endif
3453 #ifdef SO_PASSCRED
3454 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PASSCRED, (st_data_t)rb_intern2("PASSCRED", 8));
3455 #endif
3456 #ifdef SO_LINGER
3457 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_LINGER, (st_data_t)rb_intern2("LINGER", 6));
3458 #endif
3459 #ifdef SO_PRIORITY
3460 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PRIORITY, (st_data_t)rb_intern2("PRIORITY", 8));
3461 #endif
3462 #ifdef SO_NO_CHECK
3463 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NO_CHECK, (st_data_t)rb_intern2("NO_CHECK", 8));
3464 #endif
3465 #ifdef SO_OOBINLINE
3466 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_OOBINLINE, (st_data_t)rb_intern2("OOBINLINE", 9));
3467 #endif
3468 #ifdef SO_KEEPALIVE
3469 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_KEEPALIVE, (st_data_t)rb_intern2("KEEPALIVE", 9));
3470 #endif
3471 #ifdef SO_RCVBUF
3472 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVBUF, (st_data_t)rb_intern2("RCVBUF", 6));
3473 #endif
3474 #ifdef SO_SNDBUF
3475 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDBUF, (st_data_t)rb_intern2("SNDBUF", 6));
3476 #endif
3477 #ifdef SO_BROADCAST
3478 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BROADCAST, (st_data_t)rb_intern2("BROADCAST", 9));
3479 #endif
3480 #ifdef SO_DONTROUTE
3481 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTROUTE, (st_data_t)rb_intern2("DONTROUTE", 9));
3482 #endif
3483 #ifdef SO_ERROR
3484 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ERROR, (st_data_t)rb_intern2("ERROR", 5));
3485 #endif
3486 #ifdef SO_TYPE
3487 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TYPE, (st_data_t)rb_intern2("TYPE", 4));
3488 #endif
3489 #ifdef SO_REUSEPORT
3490 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEPORT, (st_data_t)rb_intern2("REUSEPORT", 9));
3491 #endif
3492 #ifdef SO_REUSEADDR
3493 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEADDR, (st_data_t)rb_intern2("REUSEADDR", 9));
3494 #endif
3495 #ifdef SO_DEBUG
3496 st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DEBUG, (st_data_t)rb_intern2("DEBUG", 5));
3497 #endif
3498
3499 rsock_intern_ip_optname_hash = st_init_numtable();
3500 #ifdef IP_MSFILTER
3501 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MSFILTER, (st_data_t)rb_intern2("IP_MSFILTER", 11));
3502 #endif
3503 #ifdef IP_DROP_SOURCE_MEMBERSHIP
3504 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("IP_DROP_SOURCE_MEMBERSHIP", 25));
3505 #endif
3506 #ifdef IP_ADD_SOURCE_MEMBERSHIP
3507 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("IP_ADD_SOURCE_MEMBERSHIP", 24));
3508 #endif
3509 #ifdef IP_BLOCK_SOURCE
3510 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_BLOCK_SOURCE, (st_data_t)rb_intern2("IP_BLOCK_SOURCE", 15));
3511 #endif
3512 #ifdef IP_UNBLOCK_SOURCE
3513 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_UNBLOCK_SOURCE, (st_data_t)rb_intern2("IP_UNBLOCK_SOURCE", 17));
3514 #endif
3515 #ifdef IP_PMTUDISC_DO
3516 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DO, (st_data_t)rb_intern2("IP_PMTUDISC_DO", 14));
3517 #endif
3518 #ifdef IP_PMTUDISC_WANT
3519 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_WANT, (st_data_t)rb_intern2("IP_PMTUDISC_WANT", 16));
3520 #endif
3521 #ifdef IP_PMTUDISC_DONT
3522 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DONT, (st_data_t)rb_intern2("IP_PMTUDISC_DONT", 16));
3523 #endif
3524 #ifdef IP_PASSSEC
3525 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PASSSEC, (st_data_t)rb_intern2("IP_PASSSEC", 10));
3526 #endif
3527 #ifdef IP_XFRM_POLICY
3528 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_XFRM_POLICY, (st_data_t)rb_intern2("IP_XFRM_POLICY", 14));
3529 #endif
3530 #ifdef IP_IPSEC_POLICY
3531 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_IPSEC_POLICY, (st_data_t)rb_intern2("IP_IPSEC_POLICY", 15));
3532 #endif
3533 #ifdef IP_FREEBIND
3534 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_FREEBIND, (st_data_t)rb_intern2("IP_FREEBIND", 11));
3535 #endif
3536 #ifdef IP_MTU
3537 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU, (st_data_t)rb_intern2("IP_MTU", 6));
3538 #endif
3539 #ifdef IP_RECVTOS
3540 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTOS, (st_data_t)rb_intern2("IP_RECVTOS", 10));
3541 #endif
3542 #ifdef IP_RECVERR
3543 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVERR, (st_data_t)rb_intern2("IP_RECVERR", 10));
3544 #endif
3545 #ifdef IP_MTU_DISCOVER
3546 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU_DISCOVER, (st_data_t)rb_intern2("IP_MTU_DISCOVER", 15));
3547 #endif
3548 #ifdef IP_PKTOPTIONS
3549 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTOPTIONS, (st_data_t)rb_intern2("IP_PKTOPTIONS", 13));
3550 #endif
3551 #ifdef IP_PKTINFO
3552 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTINFO, (st_data_t)rb_intern2("IP_PKTINFO", 10));
3553 #endif
3554 #ifdef IP_ROUTER_ALERT
3555 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ROUTER_ALERT, (st_data_t)rb_intern2("IP_ROUTER_ALERT", 15));
3556 #endif
3557 #ifdef IP_MAX_MEMBERSHIPS
3558 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MAX_MEMBERSHIPS, (st_data_t)rb_intern2("IP_MAX_MEMBERSHIPS", 18));
3559 #endif
3560 #ifdef IP_DEFAULT_MULTICAST_LOOP
3561 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_LOOP, (st_data_t)rb_intern2("IP_DEFAULT_MULTICAST_LOOP", 25));
3562 #endif
3563 #ifdef IP_DEFAULT_MULTICAST_TTL
3564 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_TTL, (st_data_t)rb_intern2("IP_DEFAULT_MULTICAST_TTL", 24));
3565 #endif
3566 #ifdef IP_DROP_MEMBERSHIP
3567 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_MEMBERSHIP, (st_data_t)rb_intern2("IP_DROP_MEMBERSHIP", 18));
3568 #endif
3569 #ifdef IP_ADD_MEMBERSHIP
3570 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_MEMBERSHIP, (st_data_t)rb_intern2("IP_ADD_MEMBERSHIP", 17));
3571 #endif
3572 #ifdef IP_MULTICAST_LOOP
3573 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_LOOP, (st_data_t)rb_intern2("IP_MULTICAST_LOOP", 17));
3574 #endif
3575 #ifdef IP_MULTICAST_TTL
3576 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_TTL, (st_data_t)rb_intern2("IP_MULTICAST_TTL", 16));
3577 #endif
3578 #ifdef IP_MULTICAST_IF
3579 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_IF, (st_data_t)rb_intern2("IP_MULTICAST_IF", 15));
3580 #endif
3581 #ifdef IP_PORTRANGE
3582 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PORTRANGE, (st_data_t)rb_intern2("IP_PORTRANGE", 12));
3583 #endif
3584 #ifdef IP_RECVSLLA
3585 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVSLLA, (st_data_t)rb_intern2("IP_RECVSLLA", 11));
3586 #endif
3587 #ifdef IP_RECVIF
3588 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVIF, (st_data_t)rb_intern2("IP_RECVIF", 9));
3589 #endif
3590 #ifdef IP_RECVTTL
3591 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTTL, (st_data_t)rb_intern2("IP_RECVTTL", 10));
3592 #endif
3593 #ifdef IP_ONESBCAST
3594 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ONESBCAST, (st_data_t)rb_intern2("IP_ONESBCAST", 12));
3595 #endif
3596 #ifdef IP_SENDSRCADDR
3597 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_SENDSRCADDR, (st_data_t)rb_intern2("IP_SENDSRCADDR", 14));
3598 #endif
3599 #ifdef IP_DONTFRAG
3600 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DONTFRAG, (st_data_t)rb_intern2("IP_DONTFRAG", 11));
3601 #endif
3602 #ifdef IP_MINTTL
3603 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MINTTL, (st_data_t)rb_intern2("IP_MINTTL", 9));
3604 #endif
3605 #ifdef IP_RETOPTS
3606 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RETOPTS, (st_data_t)rb_intern2("IP_RETOPTS", 10));
3607 #endif
3608 #ifdef IP_RECVDSTADDR
3609 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVDSTADDR, (st_data_t)rb_intern2("IP_RECVDSTADDR", 14));
3610 #endif
3611 #ifdef IP_RECVRETOPTS
3612 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVRETOPTS, (st_data_t)rb_intern2("IP_RECVRETOPTS", 14));
3613 #endif
3614 #ifdef IP_RECVOPTS
3615 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVOPTS, (st_data_t)rb_intern2("IP_RECVOPTS", 11));
3616 #endif
3617 #ifdef IP_TTL
3618 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TTL, (st_data_t)rb_intern2("IP_TTL", 6));
3619 #endif
3620 #ifdef IP_TOS
3621 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TOS, (st_data_t)rb_intern2("IP_TOS", 6));
3622 #endif
3623 #ifdef IP_HDRINCL
3624 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_HDRINCL, (st_data_t)rb_intern2("IP_HDRINCL", 10));
3625 #endif
3626 #ifdef IP_OPTIONS
3627 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_OPTIONS, (st_data_t)rb_intern2("IP_OPTIONS", 10));
3628 #endif
3629 #ifdef IP_MSFILTER
3630 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MSFILTER, (st_data_t)rb_intern2("MSFILTER", 8));
3631 #endif
3632 #ifdef IP_DROP_SOURCE_MEMBERSHIP
3633 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("DROP_SOURCE_MEMBERSHIP", 22));
3634 #endif
3635 #ifdef IP_ADD_SOURCE_MEMBERSHIP
3636 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("ADD_SOURCE_MEMBERSHIP", 21));
3637 #endif
3638 #ifdef IP_BLOCK_SOURCE
3639 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_BLOCK_SOURCE, (st_data_t)rb_intern2("BLOCK_SOURCE", 12));
3640 #endif
3641 #ifdef IP_UNBLOCK_SOURCE
3642 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_UNBLOCK_SOURCE, (st_data_t)rb_intern2("UNBLOCK_SOURCE", 14));
3643 #endif
3644 #ifdef IP_PMTUDISC_DO
3645 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DO, (st_data_t)rb_intern2("PMTUDISC_DO", 11));
3646 #endif
3647 #ifdef IP_PMTUDISC_WANT
3648 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_WANT, (st_data_t)rb_intern2("PMTUDISC_WANT", 13));
3649 #endif
3650 #ifdef IP_PMTUDISC_DONT
3651 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DONT, (st_data_t)rb_intern2("PMTUDISC_DONT", 13));
3652 #endif
3653 #ifdef IP_PASSSEC
3654 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PASSSEC, (st_data_t)rb_intern2("PASSSEC", 7));
3655 #endif
3656 #ifdef IP_XFRM_POLICY
3657 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_XFRM_POLICY, (st_data_t)rb_intern2("XFRM_POLICY", 11));
3658 #endif
3659 #ifdef IP_IPSEC_POLICY
3660 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_IPSEC_POLICY, (st_data_t)rb_intern2("IPSEC_POLICY", 12));
3661 #endif
3662 #ifdef IP_FREEBIND
3663 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_FREEBIND, (st_data_t)rb_intern2("FREEBIND", 8));
3664 #endif
3665 #ifdef IP_MTU
3666 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU, (st_data_t)rb_intern2("MTU", 3));
3667 #endif
3668 #ifdef IP_RECVTOS
3669 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTOS, (st_data_t)rb_intern2("RECVTOS", 7));
3670 #endif
3671 #ifdef IP_RECVERR
3672 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVERR, (st_data_t)rb_intern2("RECVERR", 7));
3673 #endif
3674 #ifdef IP_MTU_DISCOVER
3675 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU_DISCOVER, (st_data_t)rb_intern2("MTU_DISCOVER", 12));
3676 #endif
3677 #ifdef IP_PKTOPTIONS
3678 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTOPTIONS, (st_data_t)rb_intern2("PKTOPTIONS", 10));
3679 #endif
3680 #ifdef IP_PKTINFO
3681 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTINFO, (st_data_t)rb_intern2("PKTINFO", 7));
3682 #endif
3683 #ifdef IP_ROUTER_ALERT
3684 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ROUTER_ALERT, (st_data_t)rb_intern2("ROUTER_ALERT", 12));
3685 #endif
3686 #ifdef IP_MAX_MEMBERSHIPS
3687 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MAX_MEMBERSHIPS, (st_data_t)rb_intern2("MAX_MEMBERSHIPS", 15));
3688 #endif
3689 #ifdef IP_DEFAULT_MULTICAST_LOOP
3690 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_LOOP, (st_data_t)rb_intern2("DEFAULT_MULTICAST_LOOP", 22));
3691 #endif
3692 #ifdef IP_DEFAULT_MULTICAST_TTL
3693 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_TTL, (st_data_t)rb_intern2("DEFAULT_MULTICAST_TTL", 21));
3694 #endif
3695 #ifdef IP_DROP_MEMBERSHIP
3696 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_MEMBERSHIP, (st_data_t)rb_intern2("DROP_MEMBERSHIP", 15));
3697 #endif
3698 #ifdef IP_ADD_MEMBERSHIP
3699 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_MEMBERSHIP, (st_data_t)rb_intern2("ADD_MEMBERSHIP", 14));
3700 #endif
3701 #ifdef IP_MULTICAST_LOOP
3702 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_LOOP, (st_data_t)rb_intern2("MULTICAST_LOOP", 14));
3703 #endif
3704 #ifdef IP_MULTICAST_TTL
3705 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_TTL, (st_data_t)rb_intern2("MULTICAST_TTL", 13));
3706 #endif
3707 #ifdef IP_MULTICAST_IF
3708 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_IF, (st_data_t)rb_intern2("MULTICAST_IF", 12));
3709 #endif
3710 #ifdef IP_PORTRANGE
3711 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PORTRANGE, (st_data_t)rb_intern2("PORTRANGE", 9));
3712 #endif
3713 #ifdef IP_RECVSLLA
3714 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVSLLA, (st_data_t)rb_intern2("RECVSLLA", 8));
3715 #endif
3716 #ifdef IP_RECVIF
3717 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVIF, (st_data_t)rb_intern2("RECVIF", 6));
3718 #endif
3719 #ifdef IP_RECVTTL
3720 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTTL, (st_data_t)rb_intern2("RECVTTL", 7));
3721 #endif
3722 #ifdef IP_ONESBCAST
3723 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ONESBCAST, (st_data_t)rb_intern2("ONESBCAST", 9));
3724 #endif
3725 #ifdef IP_SENDSRCADDR
3726 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_SENDSRCADDR, (st_data_t)rb_intern2("SENDSRCADDR", 11));
3727 #endif
3728 #ifdef IP_DONTFRAG
3729 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DONTFRAG, (st_data_t)rb_intern2("DONTFRAG", 8));
3730 #endif
3731 #ifdef IP_MINTTL
3732 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MINTTL, (st_data_t)rb_intern2("MINTTL", 6));
3733 #endif
3734 #ifdef IP_RETOPTS
3735 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RETOPTS, (st_data_t)rb_intern2("RETOPTS", 7));
3736 #endif
3737 #ifdef IP_RECVDSTADDR
3738 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVDSTADDR, (st_data_t)rb_intern2("RECVDSTADDR", 11));
3739 #endif
3740 #ifdef IP_RECVRETOPTS
3741 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVRETOPTS, (st_data_t)rb_intern2("RECVRETOPTS", 11));
3742 #endif
3743 #ifdef IP_RECVOPTS
3744 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVOPTS, (st_data_t)rb_intern2("RECVOPTS", 8));
3745 #endif
3746 #ifdef IP_TTL
3747 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TTL, (st_data_t)rb_intern2("TTL", 3));
3748 #endif
3749 #ifdef IP_TOS
3750 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TOS, (st_data_t)rb_intern2("TOS", 3));
3751 #endif
3752 #ifdef IP_HDRINCL
3753 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_HDRINCL, (st_data_t)rb_intern2("HDRINCL", 7));
3754 #endif
3755 #ifdef IP_OPTIONS
3756 st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_OPTIONS, (st_data_t)rb_intern2("OPTIONS", 7));
3757 #endif
3758
3759 rsock_intern_ipv6_optname_hash = st_init_numtable();
3760 #ifdef IPV6_USE_MIN_MTU
3761 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_USE_MIN_MTU, (st_data_t)rb_intern2("IPV6_USE_MIN_MTU", 16));
3762 #endif
3763 #ifdef IPV6_TCLASS
3764 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_TCLASS, (st_data_t)rb_intern2("IPV6_TCLASS", 11));
3765 #endif
3766 #ifdef IPV6_RECVPATHMTU
3767 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVPATHMTU, (st_data_t)rb_intern2("IPV6_RECVPATHMTU", 16));
3768 #endif
3769 #ifdef IPV6_RTHDR_TYPE_0
3770 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDR_TYPE_0, (st_data_t)rb_intern2("IPV6_RTHDR_TYPE_0", 17));
3771 #endif
3772 #ifdef IPV6_RTHDRDSTOPTS
3773 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDRDSTOPTS, (st_data_t)rb_intern2("IPV6_RTHDRDSTOPTS", 17));
3774 #endif
3775 #ifdef IPV6_RTHDR
3776 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDR, (st_data_t)rb_intern2("IPV6_RTHDR", 10));
3777 #endif
3778 #ifdef IPV6_RECVTCLASS
3779 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVTCLASS, (st_data_t)rb_intern2("IPV6_RECVTCLASS", 15));
3780 #endif
3781 #ifdef IPV6_RECVRTHDR
3782 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVRTHDR, (st_data_t)rb_intern2("IPV6_RECVRTHDR", 14));
3783 #endif
3784 #ifdef IPV6_RECVPKTINFO
3785 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVPKTINFO, (st_data_t)rb_intern2("IPV6_RECVPKTINFO", 16));
3786 #endif
3787 #ifdef IPV6_RECVHOPOPTS
3788 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVHOPOPTS, (st_data_t)rb_intern2("IPV6_RECVHOPOPTS", 16));
3789 #endif
3790 #ifdef IPV6_RECVHOPLIMIT
3791 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVHOPLIMIT, (st_data_t)rb_intern2("IPV6_RECVHOPLIMIT", 17));
3792 #endif
3793 #ifdef IPV6_RECVDSTOPTS
3794 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVDSTOPTS, (st_data_t)rb_intern2("IPV6_RECVDSTOPTS", 16));
3795 #endif
3796 #ifdef IPV6_PKTINFO
3797 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_PKTINFO, (st_data_t)rb_intern2("IPV6_PKTINFO", 12));
3798 #endif
3799 #ifdef IPV6_PATHMTU
3800 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_PATHMTU, (st_data_t)rb_intern2("IPV6_PATHMTU", 12));
3801 #endif
3802 #ifdef IPV6_NEXTHOP
3803 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_NEXTHOP, (st_data_t)rb_intern2("IPV6_NEXTHOP", 12));
3804 #endif
3805 #ifdef IPV6_HOPOPTS
3806 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_HOPOPTS, (st_data_t)rb_intern2("IPV6_HOPOPTS", 12));
3807 #endif
3808 #ifdef IPV6_HOPLIMIT
3809 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_HOPLIMIT, (st_data_t)rb_intern2("IPV6_HOPLIMIT", 13));
3810 #endif
3811 #ifdef IPV6_DSTOPTS
3812 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_DSTOPTS, (st_data_t)rb_intern2("IPV6_DSTOPTS", 12));
3813 #endif
3814 #ifdef IPV6_DONTFRAG
3815 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_DONTFRAG, (st_data_t)rb_intern2("IPV6_DONTFRAG", 13));
3816 #endif
3817 #ifdef IPV6_CHECKSUM
3818 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_CHECKSUM, (st_data_t)rb_intern2("IPV6_CHECKSUM", 13));
3819 #endif
3820 #ifdef IPV6_V6ONLY
3821 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_V6ONLY, (st_data_t)rb_intern2("IPV6_V6ONLY", 11));
3822 #endif
3823 #ifdef IPV6_UNICAST_HOPS
3824 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_UNICAST_HOPS, (st_data_t)rb_intern2("IPV6_UNICAST_HOPS", 17));
3825 #endif
3826 #ifdef IPV6_MULTICAST_LOOP
3827 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_LOOP, (st_data_t)rb_intern2("IPV6_MULTICAST_LOOP", 19));
3828 #endif
3829 #ifdef IPV6_MULTICAST_IF
3830 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_IF, (st_data_t)rb_intern2("IPV6_MULTICAST_IF", 17));
3831 #endif
3832 #ifdef IPV6_MULTICAST_HOPS
3833 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_HOPS, (st_data_t)rb_intern2("IPV6_MULTICAST_HOPS", 19));
3834 #endif
3835 #ifdef IPV6_LEAVE_GROUP
3836 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_LEAVE_GROUP, (st_data_t)rb_intern2("IPV6_LEAVE_GROUP", 16));
3837 #endif
3838 #ifdef IPV6_JOIN_GROUP
3839 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_JOIN_GROUP, (st_data_t)rb_intern2("IPV6_JOIN_GROUP", 15));
3840 #endif
3841 #ifdef IPV6_USE_MIN_MTU
3842 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_USE_MIN_MTU, (st_data_t)rb_intern2("USE_MIN_MTU", 11));
3843 #endif
3844 #ifdef IPV6_TCLASS
3845 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_TCLASS, (st_data_t)rb_intern2("TCLASS", 6));
3846 #endif
3847 #ifdef IPV6_RECVPATHMTU
3848 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVPATHMTU, (st_data_t)rb_intern2("RECVPATHMTU", 11));
3849 #endif
3850 #ifdef IPV6_RTHDR_TYPE_0
3851 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDR_TYPE_0, (st_data_t)rb_intern2("RTHDR_TYPE_0", 12));
3852 #endif
3853 #ifdef IPV6_RTHDRDSTOPTS
3854 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDRDSTOPTS, (st_data_t)rb_intern2("RTHDRDSTOPTS", 12));
3855 #endif
3856 #ifdef IPV6_RTHDR
3857 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RTHDR, (st_data_t)rb_intern2("RTHDR", 5));
3858 #endif
3859 #ifdef IPV6_RECVTCLASS
3860 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVTCLASS, (st_data_t)rb_intern2("RECVTCLASS", 10));
3861 #endif
3862 #ifdef IPV6_RECVRTHDR
3863 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVRTHDR, (st_data_t)rb_intern2("RECVRTHDR", 9));
3864 #endif
3865 #ifdef IPV6_RECVPKTINFO
3866 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVPKTINFO, (st_data_t)rb_intern2("RECVPKTINFO", 11));
3867 #endif
3868 #ifdef IPV6_RECVHOPOPTS
3869 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVHOPOPTS, (st_data_t)rb_intern2("RECVHOPOPTS", 11));
3870 #endif
3871 #ifdef IPV6_RECVHOPLIMIT
3872 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVHOPLIMIT, (st_data_t)rb_intern2("RECVHOPLIMIT", 12));
3873 #endif
3874 #ifdef IPV6_RECVDSTOPTS
3875 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_RECVDSTOPTS, (st_data_t)rb_intern2("RECVDSTOPTS", 11));
3876 #endif
3877 #ifdef IPV6_PKTINFO
3878 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_PKTINFO, (st_data_t)rb_intern2("PKTINFO", 7));
3879 #endif
3880 #ifdef IPV6_PATHMTU
3881 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_PATHMTU, (st_data_t)rb_intern2("PATHMTU", 7));
3882 #endif
3883 #ifdef IPV6_NEXTHOP
3884 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_NEXTHOP, (st_data_t)rb_intern2("NEXTHOP", 7));
3885 #endif
3886 #ifdef IPV6_HOPOPTS
3887 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_HOPOPTS, (st_data_t)rb_intern2("HOPOPTS", 7));
3888 #endif
3889 #ifdef IPV6_HOPLIMIT
3890 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_HOPLIMIT, (st_data_t)rb_intern2("HOPLIMIT", 8));
3891 #endif
3892 #ifdef IPV6_DSTOPTS
3893 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_DSTOPTS, (st_data_t)rb_intern2("DSTOPTS", 7));
3894 #endif
3895 #ifdef IPV6_DONTFRAG
3896 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_DONTFRAG, (st_data_t)rb_intern2("DONTFRAG", 8));
3897 #endif
3898 #ifdef IPV6_CHECKSUM
3899 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_CHECKSUM, (st_data_t)rb_intern2("CHECKSUM", 8));
3900 #endif
3901 #ifdef IPV6_V6ONLY
3902 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_V6ONLY, (st_data_t)rb_intern2("V6ONLY", 6));
3903 #endif
3904 #ifdef IPV6_UNICAST_HOPS
3905 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_UNICAST_HOPS, (st_data_t)rb_intern2("UNICAST_HOPS", 12));
3906 #endif
3907 #ifdef IPV6_MULTICAST_LOOP
3908 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_LOOP, (st_data_t)rb_intern2("MULTICAST_LOOP", 14));
3909 #endif
3910 #ifdef IPV6_MULTICAST_IF
3911 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_IF, (st_data_t)rb_intern2("MULTICAST_IF", 12));
3912 #endif
3913 #ifdef IPV6_MULTICAST_HOPS
3914 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_MULTICAST_HOPS, (st_data_t)rb_intern2("MULTICAST_HOPS", 14));
3915 #endif
3916 #ifdef IPV6_LEAVE_GROUP
3917 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_LEAVE_GROUP, (st_data_t)rb_intern2("LEAVE_GROUP", 11));
3918 #endif
3919 #ifdef IPV6_JOIN_GROUP
3920 st_insert(rsock_intern_ipv6_optname_hash, (st_data_t)IPV6_JOIN_GROUP, (st_data_t)rb_intern2("JOIN_GROUP", 10));
3921 #endif
3922
3923 rsock_intern_tcp_optname_hash = st_init_numtable();
3924 #ifdef TCP_FASTOPEN
3925 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_FASTOPEN, (st_data_t)rb_intern2("TCP_FASTOPEN", 12));
3926 #endif
3927 #ifdef TCP_WINDOW_CLAMP
3928 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_WINDOW_CLAMP, (st_data_t)rb_intern2("TCP_WINDOW_CLAMP", 16));
3929 #endif
3930 #ifdef TCP_SYNCNT
3931 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_SYNCNT, (st_data_t)rb_intern2("TCP_SYNCNT", 10));
3932 #endif
3933 #ifdef TCP_QUICKACK
3934 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_QUICKACK, (st_data_t)rb_intern2("TCP_QUICKACK", 12));
3935 #endif
3936 #ifdef TCP_NOPUSH
3937 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NOPUSH, (st_data_t)rb_intern2("TCP_NOPUSH", 10));
3938 #endif
3939 #ifdef TCP_NOOPT
3940 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NOOPT, (st_data_t)rb_intern2("TCP_NOOPT", 9));
3941 #endif
3942 #ifdef TCP_MD5SIG
3943 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_MD5SIG, (st_data_t)rb_intern2("TCP_MD5SIG", 10));
3944 #endif
3945 #ifdef TCP_LINGER2
3946 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_LINGER2, (st_data_t)rb_intern2("TCP_LINGER2", 11));
3947 #endif
3948 #ifdef TCP_KEEPINTVL
3949 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPINTVL, (st_data_t)rb_intern2("TCP_KEEPINTVL", 13));
3950 #endif
3951 #ifdef TCP_KEEPIDLE
3952 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPIDLE, (st_data_t)rb_intern2("TCP_KEEPIDLE", 12));
3953 #endif
3954 #ifdef TCP_KEEPCNT
3955 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPCNT, (st_data_t)rb_intern2("TCP_KEEPCNT", 11));
3956 #endif
3957 #ifdef TCP_INFO
3958 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_INFO, (st_data_t)rb_intern2("TCP_INFO", 8));
3959 #endif
3960 #ifdef TCP_DEFER_ACCEPT
3961 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_DEFER_ACCEPT, (st_data_t)rb_intern2("TCP_DEFER_ACCEPT", 16));
3962 #endif
3963 #ifdef TCP_CORK
3964 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_CORK, (st_data_t)rb_intern2("TCP_CORK", 8));
3965 #endif
3966 #ifdef TCP_MAXSEG
3967 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_MAXSEG, (st_data_t)rb_intern2("TCP_MAXSEG", 10));
3968 #endif
3969 #ifdef TCP_NODELAY
3970 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NODELAY, (st_data_t)rb_intern2("TCP_NODELAY", 11));
3971 #endif
3972 #ifdef TCP_FASTOPEN
3973 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_FASTOPEN, (st_data_t)rb_intern2("FASTOPEN", 8));
3974 #endif
3975 #ifdef TCP_WINDOW_CLAMP
3976 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_WINDOW_CLAMP, (st_data_t)rb_intern2("WINDOW_CLAMP", 12));
3977 #endif
3978 #ifdef TCP_SYNCNT
3979 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_SYNCNT, (st_data_t)rb_intern2("SYNCNT", 6));
3980 #endif
3981 #ifdef TCP_QUICKACK
3982 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_QUICKACK, (st_data_t)rb_intern2("QUICKACK", 8));
3983 #endif
3984 #ifdef TCP_NOPUSH
3985 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NOPUSH, (st_data_t)rb_intern2("NOPUSH", 6));
3986 #endif
3987 #ifdef TCP_NOOPT
3988 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NOOPT, (st_data_t)rb_intern2("NOOPT", 5));
3989 #endif
3990 #ifdef TCP_MD5SIG
3991 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_MD5SIG, (st_data_t)rb_intern2("MD5SIG", 6));
3992 #endif
3993 #ifdef TCP_LINGER2
3994 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_LINGER2, (st_data_t)rb_intern2("LINGER2", 7));
3995 #endif
3996 #ifdef TCP_KEEPINTVL
3997 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPINTVL, (st_data_t)rb_intern2("KEEPINTVL", 9));
3998 #endif
3999 #ifdef TCP_KEEPIDLE
4000 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPIDLE, (st_data_t)rb_intern2("KEEPIDLE", 8));
4001 #endif
4002 #ifdef TCP_KEEPCNT
4003 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_KEEPCNT, (st_data_t)rb_intern2("KEEPCNT", 7));
4004 #endif
4005 #ifdef TCP_INFO
4006 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_INFO, (st_data_t)rb_intern2("INFO", 4));
4007 #endif
4008 #ifdef TCP_DEFER_ACCEPT
4009 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_DEFER_ACCEPT, (st_data_t)rb_intern2("DEFER_ACCEPT", 12));
4010 #endif
4011 #ifdef TCP_CORK
4012 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_CORK, (st_data_t)rb_intern2("CORK", 4));
4013 #endif
4014 #ifdef TCP_MAXSEG
4015 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_MAXSEG, (st_data_t)rb_intern2("MAXSEG", 6));
4016 #endif
4017 #ifdef TCP_NODELAY
4018 st_insert(rsock_intern_tcp_optname_hash, (st_data_t)TCP_NODELAY, (st_data_t)rb_intern2("NODELAY", 7));
4019 #endif
4020
4021 rsock_intern_udp_optname_hash = st_init_numtable();
4022 #ifdef UDP_CORK
4023 st_insert(rsock_intern_udp_optname_hash, (st_data_t)UDP_CORK, (st_data_t)rb_intern2("UDP_CORK", 8));
4024 #endif
4025 #ifdef UDP_CORK
4026 st_insert(rsock_intern_udp_optname_hash, (st_data_t)UDP_CORK, (st_data_t)rb_intern2("CORK", 4));
4027 #endif
4028
4029 rsock_intern_scm_optname_hash = st_init_numtable();
4030 #ifdef SCM_UCRED
4031 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_UCRED, (st_data_t)rb_intern2("SCM_UCRED", 9));
4032 #endif
4033 #ifdef SCM_CREDS
4034 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_CREDS, (st_data_t)rb_intern2("SCM_CREDS", 9));
4035 #endif
4036 #ifdef SCM_CREDENTIALS
4037 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_CREDENTIALS, (st_data_t)rb_intern2("SCM_CREDENTIALS", 15));
4038 #endif
4039 #ifdef SCM_BINTIME
4040 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_BINTIME, (st_data_t)rb_intern2("SCM_BINTIME", 11));
4041 #endif
4042 #ifdef SCM_TIMESTAMPNS
4043 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_TIMESTAMPNS, (st_data_t)rb_intern2("SCM_TIMESTAMPNS", 15));
4044 #endif
4045 #ifdef SCM_TIMESTAMP
4046 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_TIMESTAMP, (st_data_t)rb_intern2("SCM_TIMESTAMP", 13));
4047 #endif
4048 #ifdef SCM_RIGHTS
4049 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_RIGHTS, (st_data_t)rb_intern2("SCM_RIGHTS", 10));
4050 #endif
4051 #ifdef SCM_UCRED
4052 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_UCRED, (st_data_t)rb_intern2("UCRED", 5));
4053 #endif
4054 #ifdef SCM_CREDS
4055 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_CREDS, (st_data_t)rb_intern2("CREDS", 5));
4056 #endif
4057 #ifdef SCM_CREDENTIALS
4058 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_CREDENTIALS, (st_data_t)rb_intern2("CREDENTIALS", 11));
4059 #endif
4060 #ifdef SCM_BINTIME
4061 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_BINTIME, (st_data_t)rb_intern2("BINTIME", 7));
4062 #endif
4063 #ifdef SCM_TIMESTAMPNS
4064 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_TIMESTAMPNS, (st_data_t)rb_intern2("TIMESTAMPNS", 11));
4065 #endif
4066 #ifdef SCM_TIMESTAMP
4067 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_TIMESTAMP, (st_data_t)rb_intern2("TIMESTAMP", 9));
4068 #endif
4069 #ifdef SCM_RIGHTS
4070 st_insert(rsock_intern_scm_optname_hash, (st_data_t)SCM_RIGHTS, (st_data_t)rb_intern2("RIGHTS", 6));
4071 #endif
4072
4073 rsock_intern_local_optname_hash = st_init_numtable();
4074 #ifdef LOCAL_CONNWAIT
4075 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_CONNWAIT, (st_data_t)rb_intern2("LOCAL_CONNWAIT", 14));
4076 #endif
4077 #ifdef LOCAL_CREDS
4078 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_CREDS, (st_data_t)rb_intern2("LOCAL_CREDS", 11));
4079 #endif
4080 #ifdef LOCAL_PEERCRED
4081 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_PEERCRED, (st_data_t)rb_intern2("LOCAL_PEERCRED", 14));
4082 #endif
4083 #ifdef LOCAL_CONNWAIT
4084 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_CONNWAIT, (st_data_t)rb_intern2("CONNWAIT", 8));
4085 #endif
4086 #ifdef LOCAL_CREDS
4087 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_CREDS, (st_data_t)rb_intern2("CREDS", 5));
4088 #endif
4089 #ifdef LOCAL_PEERCRED
4090 st_insert(rsock_intern_local_optname_hash, (st_data_t)LOCAL_PEERCRED, (st_data_t)rb_intern2("PEERCRED", 8));
4091 #endif
4092
4093 }
4094
4095 int
4096 rsock_family_to_int(const char *str, long len, int *valp)
4097 {
4098 switch (len) {
4099 case 2:
4100 #ifdef AF_NS
4101 if (memcmp(str, "NS", 2) == 0) { *valp = AF_NS; return 0; }
4102 #endif
4103 return -1;
4104
4105 case 3:
4106 #ifdef AF_IPX
4107 if (memcmp(str, "IPX", 3) == 0) { *valp = AF_IPX; return 0; }
4108 #endif
4109 #ifdef AF_PUP
4110 if (memcmp(str, "PUP", 3) == 0) { *valp = AF_PUP; return 0; }
4111 #endif
4112 #ifdef AF_ISO
4113 if (memcmp(str, "ISO", 3) == 0) { *valp = AF_ISO; return 0; }
4114 #endif
4115 #ifdef AF_OSI
4116 if (memcmp(str, "OSI", 3) == 0) { *valp = AF_OSI; return 0; }
4117 #endif
4118 #ifdef AF_SNA
4119 if (memcmp(str, "SNA", 3) == 0) { *valp = AF_SNA; return 0; }
4120 #endif
4121 #ifdef AF_DEC
4122 if (memcmp(str, "DEC", 3) == 0) { *valp = AF_DEC; return 0; }
4123 #endif
4124 #ifdef AF_DLI
4125 if (memcmp(str, "DLI", 3) == 0) { *valp = AF_DLI; return 0; }
4126 #endif
4127 #ifdef AF_LAT
4128 if (memcmp(str, "LAT", 3) == 0) { *valp = AF_LAT; return 0; }
4129 #endif
4130 #ifdef AF_CNT
4131 if (memcmp(str, "CNT", 3) == 0) { *valp = AF_CNT; return 0; }
4132 #endif
4133 #ifdef AF_SIP
4134 if (memcmp(str, "SIP", 3) == 0) { *valp = AF_SIP; return 0; }
4135 #endif
4136 #ifdef AF_PPP
4137 if (memcmp(str, "PPP", 3) == 0) { *valp = AF_PPP; return 0; }
4138 #endif
4139 #ifdef AF_ATM
4140 if (memcmp(str, "ATM", 3) == 0) { *valp = AF_ATM; return 0; }
4141 #endif
4142 #ifdef AF_MAX
4143 if (memcmp(str, "MAX", 3) == 0) { *valp = AF_MAX; return 0; }
4144 #endif
4145 return -1;
4146
4147 case 4:
4148 #ifdef AF_INET
4149 if (memcmp(str, "INET", 4) == 0) { *valp = AF_INET; return 0; }
4150 #endif
4151 #ifdef AF_UNIX
4152 if (memcmp(str, "UNIX", 4) == 0) { *valp = AF_UNIX; return 0; }
4153 #endif
4154 #ifdef AF_AX25
4155 if (memcmp(str, "AX25", 4) == 0) { *valp = AF_AX25; return 0; }
4156 #endif
4157 #ifdef AF_ECMA
4158 if (memcmp(str, "ECMA", 4) == 0) { *valp = AF_ECMA; return 0; }
4159 #endif
4160 #ifdef AF_LINK
4161 if (memcmp(str, "LINK", 4) == 0) { *valp = AF_LINK; return 0; }
4162 #endif
4163 #ifdef AF_COIP
4164 if (memcmp(str, "COIP", 4) == 0) { *valp = AF_COIP; return 0; }
4165 #endif
4166 #ifdef AF_NDRV
4167 if (memcmp(str, "NDRV", 4) == 0) { *valp = AF_NDRV; return 0; }
4168 #endif
4169 #ifdef AF_ISDN
4170 if (memcmp(str, "ISDN", 4) == 0) { *valp = AF_ISDN; return 0; }
4171 #endif
4172 #ifdef AF_NATM
4173 if (memcmp(str, "NATM", 4) == 0) { *valp = AF_NATM; return 0; }
4174 #endif
4175 #ifdef AF_E164
4176 if (memcmp(str, "E164", 4) == 0) { *valp = AF_E164; return 0; }
4177 #endif
4178 return -1;
4179
4180 case 5:
4181 #ifdef AF_NS
4182 if (memcmp(str, "AF_NS", 5) == 0) { *valp = AF_NS; return 0; }
4183 #endif
4184 #ifdef PF_NS
4185 if (memcmp(str, "PF_NS", 5) == 0) { *valp = PF_NS; return 0; }
4186 #endif
4187 #ifdef AF_INET6
4188 if (memcmp(str, "INET6", 5) == 0) { *valp = AF_INET6; return 0; }
4189 #endif
4190 #ifdef AF_LOCAL
4191 if (memcmp(str, "LOCAL", 5) == 0) { *valp = AF_LOCAL; return 0; }
4192 #endif
4193 #ifdef AF_CHAOS
4194 if (memcmp(str, "CHAOS", 5) == 0) { *valp = AF_CHAOS; return 0; }
4195 #endif
4196 #ifdef AF_CCITT
4197 if (memcmp(str, "CCITT", 5) == 0) { *valp = AF_CCITT; return 0; }
4198 #endif
4199 #ifdef AF_ROUTE
4200 if (memcmp(str, "ROUTE", 5) == 0) { *valp = AF_ROUTE; return 0; }
4201 #endif
4202 return -1;
4203
4204 case 6:
4205 #ifdef AF_IPX
4206 if (memcmp(str, "AF_IPX", 6) == 0) { *valp = AF_IPX; return 0; }
4207 #endif
4208 #ifdef PF_IPX
4209 if (memcmp(str, "PF_IPX", 6) == 0) { *valp = PF_IPX; return 0; }
4210 #endif
4211 #ifdef AF_PUP
4212 if (memcmp(str, "AF_PUP", 6) == 0) { *valp = AF_PUP; return 0; }
4213 #endif
4214 #ifdef PF_PUP
4215 if (memcmp(str, "PF_PUP", 6) == 0) { *valp = PF_PUP; return 0; }
4216 #endif
4217 #ifdef AF_ISO
4218 if (memcmp(str, "AF_ISO", 6) == 0) { *valp = AF_ISO; return 0; }
4219 #endif
4220 #ifdef PF_ISO
4221 if (memcmp(str, "PF_ISO", 6) == 0) { *valp = PF_ISO; return 0; }
4222 #endif
4223 #ifdef AF_OSI
4224 if (memcmp(str, "AF_OSI", 6) == 0) { *valp = AF_OSI; return 0; }
4225 #endif
4226 #ifdef PF_OSI
4227 if (memcmp(str, "PF_OSI", 6) == 0) { *valp = PF_OSI; return 0; }
4228 #endif
4229 #ifdef AF_SNA
4230 if (memcmp(str, "AF_SNA", 6) == 0) { *valp = AF_SNA; return 0; }
4231 #endif
4232 #ifdef PF_SNA
4233 if (memcmp(str, "PF_SNA", 6) == 0) { *valp = PF_SNA; return 0; }
4234 #endif
4235 #ifdef AF_DEC
4236 if (memcmp(str, "AF_DEC", 6) == 0) { *valp = AF_DEC; return 0; }
4237 #endif
4238 #ifdef PF_DEC
4239 if (memcmp(str, "PF_DEC", 6) == 0) { *valp = PF_DEC; return 0; }
4240 #endif
4241 #ifdef AF_DLI
4242 if (memcmp(str, "AF_DLI", 6) == 0) { *valp = AF_DLI; return 0; }
4243 #endif
4244 #ifdef PF_DLI
4245 if (memcmp(str, "PF_DLI", 6) == 0) { *valp = PF_DLI; return 0; }
4246 #endif
4247 #ifdef AF_LAT
4248 if (memcmp(str, "AF_LAT", 6) == 0) { *valp = AF_LAT; return 0; }
4249 #endif
4250 #ifdef PF_LAT
4251 if (memcmp(str, "PF_LAT", 6) == 0) { *valp = PF_LAT; return 0; }
4252 #endif
4253 #ifdef AF_CNT
4254 if (memcmp(str, "AF_CNT", 6) == 0) { *valp = AF_CNT; return 0; }
4255 #endif
4256 #ifdef PF_CNT
4257 if (memcmp(str, "PF_CNT", 6) == 0) { *valp = PF_CNT; return 0; }
4258 #endif
4259 #ifdef AF_SIP
4260 if (memcmp(str, "AF_SIP", 6) == 0) { *valp = AF_SIP; return 0; }
4261 #endif
4262 #ifdef PF_SIP
4263 if (memcmp(str, "PF_SIP", 6) == 0) { *valp = PF_SIP; return 0; }
4264 #endif
4265 #ifdef AF_PPP
4266 if (memcmp(str, "AF_PPP", 6) == 0) { *valp = AF_PPP; return 0; }
4267 #endif
4268 #ifdef PF_PPP
4269 if (memcmp(str, "PF_PPP", 6) == 0) { *valp = PF_PPP; return 0; }
4270 #endif
4271 #ifdef AF_ATM
4272 if (memcmp(str, "AF_ATM", 6) == 0) { *valp = AF_ATM; return 0; }
4273 #endif
4274 #ifdef PF_ATM
4275 if (memcmp(str, "PF_ATM", 6) == 0) { *valp = PF_ATM; return 0; }
4276 #endif
4277 #ifdef AF_MAX
4278 if (memcmp(str, "AF_MAX", 6) == 0) { *valp = AF_MAX; return 0; }
4279 #endif
4280 #ifdef PF_MAX
4281 if (memcmp(str, "PF_MAX", 6) == 0) { *valp = PF_MAX; return 0; }
4282 #endif
4283 #ifdef PF_XTP
4284 if (memcmp(str, "PF_XTP", 6) == 0) { *valp = PF_XTP; return 0; }
4285 #endif
4286 #ifdef PF_PIP
4287 if (memcmp(str, "PF_PIP", 6) == 0) { *valp = PF_PIP; return 0; }
4288 #endif
4289 #ifdef PF_KEY
4290 if (memcmp(str, "PF_KEY", 6) == 0) { *valp = PF_KEY; return 0; }
4291 #endif
4292 #ifdef AF_UNSPEC
4293 if (memcmp(str, "UNSPEC", 6) == 0) { *valp = AF_UNSPEC; return 0; }
4294 #endif
4295 #ifdef AF_HYLINK
4296 if (memcmp(str, "HYLINK", 6) == 0) { *valp = AF_HYLINK; return 0; }
4297 #endif
4298 #ifdef AF_SYSTEM
4299 if (memcmp(str, "SYSTEM", 6) == 0) { *valp = AF_SYSTEM; return 0; }
4300 #endif
4301 #ifdef AF_PACKET
4302 if (memcmp(str, "PACKET", 6) == 0) { *valp = AF_PACKET; return 0; }
4303 #endif
4304 return -1;
4305
4306 case 7:
4307 #ifdef AF_INET
4308 if (memcmp(str, "AF_INET", 7) == 0) { *valp = AF_INET; return 0; }
4309 #endif
4310 #ifdef PF_INET
4311 if (memcmp(str, "PF_INET", 7) == 0) { *valp = PF_INET; return 0; }
4312 #endif
4313 #ifdef AF_UNIX
4314 if (memcmp(str, "AF_UNIX", 7) == 0) { *valp = AF_UNIX; return 0; }
4315 #endif
4316 #ifdef PF_UNIX
4317 if (memcmp(str, "PF_UNIX", 7) == 0) { *valp = PF_UNIX; return 0; }
4318 #endif
4319 #ifdef AF_AX25
4320 if (memcmp(str, "AF_AX25", 7) == 0) { *valp = AF_AX25; return 0; }
4321 #endif
4322 #ifdef PF_AX25
4323 if (memcmp(str, "PF_AX25", 7) == 0) { *valp = PF_AX25; return 0; }
4324 #endif
4325 #ifdef AF_ECMA
4326 if (memcmp(str, "AF_ECMA", 7) == 0) { *valp = AF_ECMA; return 0; }
4327 #endif
4328 #ifdef PF_ECMA
4329 if (memcmp(str, "PF_ECMA", 7) == 0) { *valp = PF_ECMA; return 0; }
4330 #endif
4331 #ifdef AF_LINK
4332 if (memcmp(str, "AF_LINK", 7) == 0) { *valp = AF_LINK; return 0; }
4333 #endif
4334 #ifdef PF_LINK
4335 if (memcmp(str, "PF_LINK", 7) == 0) { *valp = PF_LINK; return 0; }
4336 #endif
4337 #ifdef AF_COIP
4338 if (memcmp(str, "AF_COIP", 7) == 0) { *valp = AF_COIP; return 0; }
4339 #endif
4340 #ifdef PF_COIP
4341 if (memcmp(str, "PF_COIP", 7) == 0) { *valp = PF_COIP; return 0; }
4342 #endif
4343 #ifdef AF_NDRV
4344 if (memcmp(str, "AF_NDRV", 7) == 0) { *valp = AF_NDRV; return 0; }
4345 #endif
4346 #ifdef PF_NDRV
4347 if (memcmp(str, "PF_NDRV", 7) == 0) { *valp = PF_NDRV; return 0; }
4348 #endif
4349 #ifdef AF_ISDN
4350 if (memcmp(str, "AF_ISDN", 7) == 0) { *valp = AF_ISDN; return 0; }
4351 #endif
4352 #ifdef PF_ISDN
4353 if (memcmp(str, "PF_ISDN", 7) == 0) { *valp = PF_ISDN; return 0; }
4354 #endif
4355 #ifdef AF_NATM
4356 if (memcmp(str, "AF_NATM", 7) == 0) { *valp = AF_NATM; return 0; }
4357 #endif
4358 #ifdef PF_NATM
4359 if (memcmp(str, "PF_NATM", 7) == 0) { *valp = PF_NATM; return 0; }
4360 #endif
4361 #ifdef AF_E164
4362 if (memcmp(str, "AF_E164", 7) == 0) { *valp = AF_E164; return 0; }
4363 #endif
4364 #ifdef PF_RTIP
4365 if (memcmp(str, "PF_RTIP", 7) == 0) { *valp = PF_RTIP; return 0; }
4366 #endif
4367 #ifdef AF_IMPLINK
4368 if (memcmp(str, "IMPLINK", 7) == 0) { *valp = AF_IMPLINK; return 0; }
4369 #endif
4370 #ifdef AF_DATAKIT
4371 if (memcmp(str, "DATAKIT", 7) == 0) { *valp = AF_DATAKIT; return 0; }
4372 #endif
4373 #ifdef AF_NETBIOS
4374 if (memcmp(str, "NETBIOS", 7) == 0) { *valp = AF_NETBIOS; return 0; }
4375 #endif
4376 return -1;
4377
4378 case 8:
4379 #ifdef AF_INET6
4380 if (memcmp(str, "AF_INET6", 8) == 0) { *valp = AF_INET6; return 0; }
4381 #endif
4382 #ifdef PF_INET6
4383 if (memcmp(str, "PF_INET6", 8) == 0) { *valp = PF_INET6; return 0; }
4384 #endif
4385 #ifdef AF_LOCAL
4386 if (memcmp(str, "AF_LOCAL", 8) == 0) { *valp = AF_LOCAL; return 0; }
4387 #endif
4388 #ifdef PF_LOCAL
4389 if (memcmp(str, "PF_LOCAL", 8) == 0) { *valp = PF_LOCAL; return 0; }
4390 #endif
4391 #ifdef AF_CHAOS
4392 if (memcmp(str, "AF_CHAOS", 8) == 0) { *valp = AF_CHAOS; return 0; }
4393 #endif
4394 #ifdef PF_CHAOS
4395 if (memcmp(str, "PF_CHAOS", 8) == 0) { *valp = PF_CHAOS; return 0; }
4396 #endif
4397 #ifdef AF_CCITT
4398 if (memcmp(str, "AF_CCITT", 8) == 0) { *valp = AF_CCITT; return 0; }
4399 #endif
4400 #ifdef PF_CCITT
4401 if (memcmp(str, "PF_CCITT", 8) == 0) { *valp = PF_CCITT; return 0; }
4402 #endif
4403 #ifdef AF_ROUTE
4404 if (memcmp(str, "AF_ROUTE", 8) == 0) { *valp = AF_ROUTE; return 0; }
4405 #endif
4406 #ifdef PF_ROUTE
4407 if (memcmp(str, "PF_ROUTE", 8) == 0) { *valp = PF_ROUTE; return 0; }
4408 #endif
4409 #ifdef AF_NETGRAPH
4410 if (memcmp(str, "NETGRAPH", 8) == 0) { *valp = AF_NETGRAPH; return 0; }
4411 #endif
4412 return -1;
4413
4414 case 9:
4415 #ifdef AF_UNSPEC
4416 if (memcmp(str, "AF_UNSPEC", 9) == 0) { *valp = AF_UNSPEC; return 0; }
4417 #endif
4418 #ifdef PF_UNSPEC
4419 if (memcmp(str, "PF_UNSPEC", 9) == 0) { *valp = PF_UNSPEC; return 0; }
4420 #endif
4421 #ifdef AF_HYLINK
4422 if (memcmp(str, "AF_HYLINK", 9) == 0) { *valp = AF_HYLINK; return 0; }
4423 #endif
4424 #ifdef PF_HYLINK
4425 if (memcmp(str, "PF_HYLINK", 9) == 0) { *valp = PF_HYLINK; return 0; }
4426 #endif
4427 #ifdef AF_SYSTEM
4428 if (memcmp(str, "AF_SYSTEM", 9) == 0) { *valp = AF_SYSTEM; return 0; }
4429 #endif
4430 #ifdef PF_SYSTEM
4431 if (memcmp(str, "PF_SYSTEM", 9) == 0) { *valp = PF_SYSTEM; return 0; }
4432 #endif
4433 #ifdef AF_PACKET
4434 if (memcmp(str, "AF_PACKET", 9) == 0) { *valp = AF_PACKET; return 0; }
4435 #endif
4436 #ifdef PF_PACKET
4437 if (memcmp(str, "PF_PACKET", 9) == 0) { *valp = PF_PACKET; return 0; }
4438 #endif
4439 #ifdef AF_APPLETALK
4440 if (memcmp(str, "APPLETALK", 9) == 0) { *valp = AF_APPLETALK; return 0; }
4441 #endif
4442 return -1;
4443
4444 case 10:
4445 #ifdef AF_IMPLINK
4446 if (memcmp(str, "AF_IMPLINK", 10) == 0) { *valp = AF_IMPLINK; return 0; }
4447 #endif
4448 #ifdef PF_IMPLINK
4449 if (memcmp(str, "PF_IMPLINK", 10) == 0) { *valp = PF_IMPLINK; return 0; }
4450 #endif
4451 #ifdef AF_DATAKIT
4452 if (memcmp(str, "AF_DATAKIT", 10) == 0) { *valp = AF_DATAKIT; return 0; }
4453 #endif
4454 #ifdef PF_DATAKIT
4455 if (memcmp(str, "PF_DATAKIT", 10) == 0) { *valp = PF_DATAKIT; return 0; }
4456 #endif
4457 #ifdef AF_NETBIOS
4458 if (memcmp(str, "AF_NETBIOS", 10) == 0) { *valp = AF_NETBIOS; return 0; }
4459 #endif
4460 #ifdef PF_NETBIOS
4461 if (memcmp(str, "PF_NETBIOS", 10) == 0) { *valp = PF_NETBIOS; return 0; }
4462 #endif
4463 return -1;
4464
4465 case 11:
4466 #ifdef AF_NETGRAPH
4467 if (memcmp(str, "AF_NETGRAPH", 11) == 0) { *valp = AF_NETGRAPH; return 0; }
4468 #endif
4469 #ifdef PF_NETGRAPH
4470 if (memcmp(str, "PF_NETGRAPH", 11) == 0) { *valp = PF_NETGRAPH; return 0; }
4471 #endif
4472 return -1;
4473
4474 case 12:
4475 #ifdef AF_APPLETALK
4476 if (memcmp(str, "AF_APPLETALK", 12) == 0) { *valp = AF_APPLETALK; return 0; }
4477 #endif
4478 #ifdef PF_APPLETALK
4479 if (memcmp(str, "PF_APPLETALK", 12) == 0) { *valp = PF_APPLETALK; return 0; }
4480 #endif
4481 return -1;
4482
4483 default:
4484 return -1;
4485 }
4486 }
4487
4488
4489 int
4490 rsock_socktype_to_int(const char *str, long len, int *valp)
4491 {
4492 switch (len) {
4493 case 3:
4494 #ifdef SOCK_RAW
4495 if (memcmp(str, "RAW", 3) == 0) { *valp = SOCK_RAW; return 0; }
4496 #endif
4497 #ifdef SOCK_RDM
4498 if (memcmp(str, "RDM", 3) == 0) { *valp = SOCK_RDM; return 0; }
4499 #endif
4500 return -1;
4501
4502 case 5:
4503 #ifdef SOCK_DGRAM
4504 if (memcmp(str, "DGRAM", 5) == 0) { *valp = SOCK_DGRAM; return 0; }
4505 #endif
4506 return -1;
4507
4508 case 6:
4509 #ifdef SOCK_STREAM
4510 if (memcmp(str, "STREAM", 6) == 0) { *valp = SOCK_STREAM; return 0; }
4511 #endif
4512 #ifdef SOCK_PACKET
4513 if (memcmp(str, "PACKET", 6) == 0) { *valp = SOCK_PACKET; return 0; }
4514 #endif
4515 return -1;
4516
4517 case 8:
4518 #ifdef SOCK_RAW
4519 if (memcmp(str, "SOCK_RAW", 8) == 0) { *valp = SOCK_RAW; return 0; }
4520 #endif
4521 #ifdef SOCK_RDM
4522 if (memcmp(str, "SOCK_RDM", 8) == 0) { *valp = SOCK_RDM; return 0; }
4523 #endif
4524 return -1;
4525
4526 case 9:
4527 #ifdef SOCK_SEQPACKET
4528 if (memcmp(str, "SEQPACKET", 9) == 0) { *valp = SOCK_SEQPACKET; return 0; }
4529 #endif
4530 return -1;
4531
4532 case 10:
4533 #ifdef SOCK_DGRAM
4534 if (memcmp(str, "SOCK_DGRAM", 10) == 0) { *valp = SOCK_DGRAM; return 0; }
4535 #endif
4536 return -1;
4537
4538 case 11:
4539 #ifdef SOCK_STREAM
4540 if (memcmp(str, "SOCK_STREAM", 11) == 0) { *valp = SOCK_STREAM; return 0; }
4541 #endif
4542 #ifdef SOCK_PACKET
4543 if (memcmp(str, "SOCK_PACKET", 11) == 0) { *valp = SOCK_PACKET; return 0; }
4544 #endif
4545 return -1;
4546
4547 case 14:
4548 #ifdef SOCK_SEQPACKET
4549 if (memcmp(str, "SOCK_SEQPACKET", 14) == 0) { *valp = SOCK_SEQPACKET; return 0; }
4550 #endif
4551 return -1;
4552
4553 default:
4554 return -1;
4555 }
4556 }
4557
4558
4559 int
4560 rsock_ipproto_to_int(const char *str, long len, int *valp)
4561 {
4562 switch (len) {
4563 case 2:
4564 #ifdef IPPROTO_IP
4565 if (memcmp(str, "IP", 2) == 0) { *valp = IPPROTO_IP; return 0; }
4566 #endif
4567 #ifdef IPPROTO_ND
4568 if (memcmp(str, "ND", 2) == 0) { *valp = IPPROTO_ND; return 0; }
4569 #endif
4570 #ifdef IPPROTO_TP
4571 if (memcmp(str, "TP", 2) == 0) { *valp = IPPROTO_TP; return 0; }
4572 #endif
4573 #ifdef IPPROTO_AH
4574 if (memcmp(str, "AH", 2) == 0) { *valp = IPPROTO_AH; return 0; }
4575 #endif
4576 return -1;
4577
4578 case 3:
4579 #ifdef IPPROTO_GGP
4580 if (memcmp(str, "GGP", 3) == 0) { *valp = IPPROTO_GGP; return 0; }
4581 #endif
4582 #ifdef IPPROTO_TCP
4583 if (memcmp(str, "TCP", 3) == 0) { *valp = IPPROTO_TCP; return 0; }
4584 #endif
4585 #ifdef IPPROTO_EGP
4586 if (memcmp(str, "EGP", 3) == 0) { *valp = IPPROTO_EGP; return 0; }
4587 #endif
4588 #ifdef IPPROTO_PUP
4589 if (memcmp(str, "PUP", 3) == 0) { *valp = IPPROTO_PUP; return 0; }
4590 #endif
4591 #ifdef IPPROTO_UDP
4592 if (memcmp(str, "UDP", 3) == 0) { *valp = IPPROTO_UDP; return 0; }
4593 #endif
4594 #ifdef IPPROTO_IDP
4595 if (memcmp(str, "IDP", 3) == 0) { *valp = IPPROTO_IDP; return 0; }
4596 #endif
4597 #ifdef IPPROTO_XTP
4598 if (memcmp(str, "XTP", 3) == 0) { *valp = IPPROTO_XTP; return 0; }
4599 #endif
4600 #ifdef IPPROTO_EON
4601 if (memcmp(str, "EON", 3) == 0) { *valp = IPPROTO_EON; return 0; }
4602 #endif
4603 #ifdef IPPROTO_BIP
4604 if (memcmp(str, "BIP", 3) == 0) { *valp = IPPROTO_BIP; return 0; }
4605 #endif
4606 #ifdef IPPROTO_ESP
4607 if (memcmp(str, "ESP", 3) == 0) { *valp = IPPROTO_ESP; return 0; }
4608 #endif
4609 #ifdef IPPROTO_RAW
4610 if (memcmp(str, "RAW", 3) == 0) { *valp = IPPROTO_RAW; return 0; }
4611 #endif
4612 #ifdef IPPROTO_MAX
4613 if (memcmp(str, "MAX", 3) == 0) { *valp = IPPROTO_MAX; return 0; }
4614 #endif
4615 return -1;
4616
4617 case 4:
4618 #ifdef IPPROTO_ICMP
4619 if (memcmp(str, "ICMP", 4) == 0) { *valp = IPPROTO_ICMP; return 0; }
4620 #endif
4621 #ifdef IPPROTO_IGMP
4622 if (memcmp(str, "IGMP", 4) == 0) { *valp = IPPROTO_IGMP; return 0; }
4623 #endif
4624 #ifdef IPPROTO_IPV6
4625 if (memcmp(str, "IPV6", 4) == 0) { *valp = IPPROTO_IPV6; return 0; }
4626 #endif
4627 #ifdef IPPROTO_NONE
4628 if (memcmp(str, "NONE", 4) == 0) { *valp = IPPROTO_NONE; return 0; }
4629 #endif
4630 return -1;
4631
4632 case 5:
4633 #ifdef IPPROTO_HELLO
4634 if (memcmp(str, "HELLO", 5) == 0) { *valp = IPPROTO_HELLO; return 0; }
4635 #endif
4636 return -1;
4637
4638 case 6:
4639 #ifdef IPPROTO_ICMPV6
4640 if (memcmp(str, "ICMPV6", 6) == 0) { *valp = IPPROTO_ICMPV6; return 0; }
4641 #endif
4642 return -1;
4643
4644 case 7:
4645 #ifdef IPPROTO_DSTOPTS
4646 if (memcmp(str, "DSTOPTS", 7) == 0) { *valp = IPPROTO_DSTOPTS; return 0; }
4647 #endif
4648 #ifdef IPPROTO_HOPOPTS
4649 if (memcmp(str, "HOPOPTS", 7) == 0) { *valp = IPPROTO_HOPOPTS; return 0; }
4650 #endif
4651 #ifdef IPPROTO_ROUTING
4652 if (memcmp(str, "ROUTING", 7) == 0) { *valp = IPPROTO_ROUTING; return 0; }
4653 #endif
4654 return -1;
4655
4656 case 8:
4657 #ifdef IPPROTO_FRAGMENT
4658 if (memcmp(str, "FRAGMENT", 8) == 0) { *valp = IPPROTO_FRAGMENT; return 0; }
4659 #endif
4660 return -1;
4661
4662 case 10:
4663 #ifdef IPPROTO_IP
4664 if (memcmp(str, "IPPROTO_IP", 10) == 0) { *valp = IPPROTO_IP; return 0; }
4665 #endif
4666 #ifdef IPPROTO_ND
4667 if (memcmp(str, "IPPROTO_ND", 10) == 0) { *valp = IPPROTO_ND; return 0; }
4668 #endif
4669 #ifdef IPPROTO_TP
4670 if (memcmp(str, "IPPROTO_TP", 10) == 0) { *valp = IPPROTO_TP; return 0; }
4671 #endif
4672 #ifdef IPPROTO_AH
4673 if (memcmp(str, "IPPROTO_AH", 10) == 0) { *valp = IPPROTO_AH; return 0; }
4674 #endif
4675 return -1;
4676
4677 case 11:
4678 #ifdef IPPROTO_GGP
4679 if (memcmp(str, "IPPROTO_GGP", 11) == 0) { *valp = IPPROTO_GGP; return 0; }
4680 #endif
4681 #ifdef IPPROTO_TCP
4682 if (memcmp(str, "IPPROTO_TCP", 11) == 0) { *valp = IPPROTO_TCP; return 0; }
4683 #endif
4684 #ifdef IPPROTO_EGP
4685 if (memcmp(str, "IPPROTO_EGP", 11) == 0) { *valp = IPPROTO_EGP; return 0; }
4686 #endif
4687 #ifdef IPPROTO_PUP
4688 if (memcmp(str, "IPPROTO_PUP", 11) == 0) { *valp = IPPROTO_PUP; return 0; }
4689 #endif
4690 #ifdef IPPROTO_UDP
4691 if (memcmp(str, "IPPROTO_UDP", 11) == 0) { *valp = IPPROTO_UDP; return 0; }
4692 #endif
4693 #ifdef IPPROTO_IDP
4694 if (memcmp(str, "IPPROTO_IDP", 11) == 0) { *valp = IPPROTO_IDP; return 0; }
4695 #endif
4696 #ifdef IPPROTO_XTP
4697 if (memcmp(str, "IPPROTO_XTP", 11) == 0) { *valp = IPPROTO_XTP; return 0; }
4698 #endif
4699 #ifdef IPPROTO_EON
4700 if (memcmp(str, "IPPROTO_EON", 11) == 0) { *valp = IPPROTO_EON; return 0; }
4701 #endif
4702 #ifdef IPPROTO_BIP
4703 if (memcmp(str, "IPPROTO_BIP", 11) == 0) { *valp = IPPROTO_BIP; return 0; }
4704 #endif
4705 #ifdef IPPROTO_ESP
4706 if (memcmp(str, "IPPROTO_ESP", 11) == 0) { *valp = IPPROTO_ESP; return 0; }
4707 #endif
4708 #ifdef IPPROTO_RAW
4709 if (memcmp(str, "IPPROTO_RAW", 11) == 0) { *valp = IPPROTO_RAW; return 0; }
4710 #endif
4711 #ifdef IPPROTO_MAX
4712 if (memcmp(str, "IPPROTO_MAX", 11) == 0) { *valp = IPPROTO_MAX; return 0; }
4713 #endif
4714 return -1;
4715
4716 case 12:
4717 #ifdef IPPROTO_ICMP
4718 if (memcmp(str, "IPPROTO_ICMP", 12) == 0) { *valp = IPPROTO_ICMP; return 0; }
4719 #endif
4720 #ifdef IPPROTO_IGMP
4721 if (memcmp(str, "IPPROTO_IGMP", 12) == 0) { *valp = IPPROTO_IGMP; return 0; }
4722 #endif
4723 #ifdef IPPROTO_IPV6
4724 if (memcmp(str, "IPPROTO_IPV6", 12) == 0) { *valp = IPPROTO_IPV6; return 0; }
4725 #endif
4726 #ifdef IPPROTO_NONE
4727 if (memcmp(str, "IPPROTO_NONE", 12) == 0) { *valp = IPPROTO_NONE; return 0; }
4728 #endif
4729 return -1;
4730
4731 case 13:
4732 #ifdef IPPROTO_HELLO
4733 if (memcmp(str, "IPPROTO_HELLO", 13) == 0) { *valp = IPPROTO_HELLO; return 0; }
4734 #endif
4735 return -1;
4736
4737 case 14:
4738 #ifdef IPPROTO_ICMPV6
4739 if (memcmp(str, "IPPROTO_ICMPV6", 14) == 0) { *valp = IPPROTO_ICMPV6; return 0; }
4740 #endif
4741 return -1;
4742
4743 case 15:
4744 #ifdef IPPROTO_DSTOPTS
4745 if (memcmp(str, "IPPROTO_DSTOPTS", 15) == 0) { *valp = IPPROTO_DSTOPTS; return 0; }
4746 #endif
4747 #ifdef IPPROTO_HOPOPTS
4748 if (memcmp(str, "IPPROTO_HOPOPTS", 15) == 0) { *valp = IPPROTO_HOPOPTS; return 0; }
4749 #endif
4750 #ifdef IPPROTO_ROUTING
4751 if (memcmp(str, "IPPROTO_ROUTING", 15) == 0) { *valp = IPPROTO_ROUTING; return 0; }
4752 #endif
4753 return -1;
4754
4755 case 16:
4756 #ifdef IPPROTO_FRAGMENT
4757 if (memcmp(str, "IPPROTO_FRAGMENT", 16) == 0) { *valp = IPPROTO_FRAGMENT; return 0; }
4758 #endif
4759 return -1;
4760
4761 default:
4762 return -1;
4763 }
4764 }
4765
4766
4767 int
4768 rsock_unknown_level_to_int(const char *str, long len, int *valp)
4769 {
4770 switch (len) {
4771 case 6:
4772 #ifdef SOL_SOCKET
4773 if (memcmp(str, "SOCKET", 6) == 0) { *valp = SOL_SOCKET; return 0; }
4774 #endif
4775 return -1;
4776
4777 case 10:
4778 #ifdef SOL_SOCKET
4779 if (memcmp(str, "SOL_SOCKET", 10) == 0) { *valp = SOL_SOCKET; return 0; }
4780 #endif
4781 return -1;
4782
4783 default:
4784 return -1;
4785 }
4786 }
4787
4788
4789 int
4790 rsock_ip_level_to_int(const char *str, long len, int *valp)
4791 {
4792 switch (len) {
4793 case 2:
4794 #ifdef IPPROTO_IP
4795 if (memcmp(str, "IP", 2) == 0) { *valp = IPPROTO_IP; return 0; }
4796 #endif
4797 #ifdef IPPROTO_ND
4798 if (memcmp(str, "ND", 2) == 0) { *valp = IPPROTO_ND; return 0; }
4799 #endif
4800 #ifdef IPPROTO_TP
4801 if (memcmp(str, "TP", 2) == 0) { *valp = IPPROTO_TP; return 0; }
4802 #endif
4803 #ifdef IPPROTO_AH
4804 if (memcmp(str, "AH", 2) == 0) { *valp = IPPROTO_AH; return 0; }
4805 #endif
4806 return -1;
4807
4808 case 3:
4809 #ifdef IPPROTO_GGP
4810 if (memcmp(str, "GGP", 3) == 0) { *valp = IPPROTO_GGP; return 0; }
4811 #endif
4812 #ifdef IPPROTO_TCP
4813 if (memcmp(str, "TCP", 3) == 0) { *valp = IPPROTO_TCP; return 0; }
4814 #endif
4815 #ifdef IPPROTO_EGP
4816 if (memcmp(str, "EGP", 3) == 0) { *valp = IPPROTO_EGP; return 0; }
4817 #endif
4818 #ifdef IPPROTO_PUP
4819 if (memcmp(str, "PUP", 3) == 0) { *valp = IPPROTO_PUP; return 0; }
4820 #endif
4821 #ifdef IPPROTO_UDP
4822 if (memcmp(str, "UDP", 3) == 0) { *valp = IPPROTO_UDP; return 0; }
4823 #endif
4824 #ifdef IPPROTO_IDP
4825 if (memcmp(str, "IDP", 3) == 0) { *valp = IPPROTO_IDP; return 0; }
4826 #endif
4827 #ifdef IPPROTO_XTP
4828 if (memcmp(str, "XTP", 3) == 0) { *valp = IPPROTO_XTP; return 0; }
4829 #endif
4830 #ifdef IPPROTO_EON
4831 if (memcmp(str, "EON", 3) == 0) { *valp = IPPROTO_EON; return 0; }
4832 #endif
4833 #ifdef IPPROTO_BIP
4834 if (memcmp(str, "BIP", 3) == 0) { *valp = IPPROTO_BIP; return 0; }
4835 #endif
4836 #ifdef IPPROTO_ESP
4837 if (memcmp(str, "ESP", 3) == 0) { *valp = IPPROTO_ESP; return 0; }
4838 #endif
4839 #ifdef IPPROTO_RAW
4840 if (memcmp(str, "RAW", 3) == 0) { *valp = IPPROTO_RAW; return 0; }
4841 #endif
4842 #ifdef IPPROTO_MAX
4843 if (memcmp(str, "MAX", 3) == 0) { *valp = IPPROTO_MAX; return 0; }
4844 #endif
4845 return -1;
4846
4847 case 4:
4848 #ifdef IPPROTO_ICMP
4849 if (memcmp(str, "ICMP", 4) == 0) { *valp = IPPROTO_ICMP; return 0; }
4850 #endif
4851 #ifdef IPPROTO_IGMP
4852 if (memcmp(str, "IGMP", 4) == 0) { *valp = IPPROTO_IGMP; return 0; }
4853 #endif
4854 #ifdef IPPROTO_IPV6
4855 if (memcmp(str, "IPV6", 4) == 0) { *valp = IPPROTO_IPV6; return 0; }
4856 #endif
4857 #ifdef IPPROTO_NONE
4858 if (memcmp(str, "NONE", 4) == 0) { *valp = IPPROTO_NONE; return 0; }
4859 #endif
4860 return -1;
4861
4862 case 5:
4863 #ifdef IPPROTO_HELLO
4864 if (memcmp(str, "HELLO", 5) == 0) { *valp = IPPROTO_HELLO; return 0; }
4865 #endif
4866 return -1;
4867
4868 case 6:
4869 #ifdef SOL_SOCKET
4870 if (memcmp(str, "SOCKET", 6) == 0) { *valp = SOL_SOCKET; return 0; }
4871 #endif
4872 #ifdef IPPROTO_ICMPV6
4873 if (memcmp(str, "ICMPV6", 6) == 0) { *valp = IPPROTO_ICMPV6; return 0; }
4874 #endif
4875 return -1;
4876
4877 case 7:
4878 #ifdef IPPROTO_DSTOPTS
4879 if (memcmp(str, "DSTOPTS", 7) == 0) { *valp = IPPROTO_DSTOPTS; return 0; }
4880 #endif
4881 #ifdef IPPROTO_HOPOPTS
4882 if (memcmp(str, "HOPOPTS", 7) == 0) { *valp = IPPROTO_HOPOPTS; return 0; }
4883 #endif
4884 #ifdef IPPROTO_ROUTING
4885 if (memcmp(str, "ROUTING", 7) == 0) { *valp = IPPROTO_ROUTING; return 0; }
4886 #endif
4887 return -1;
4888
4889 case 8:
4890 #ifdef IPPROTO_FRAGMENT
4891 if (memcmp(str, "FRAGMENT", 8) == 0) { *valp = IPPROTO_FRAGMENT; return 0; }
4892 #endif
4893 return -1;
4894
4895 case 10:
4896 #ifdef SOL_SOCKET
4897 if (memcmp(str, "SOL_SOCKET", 10) == 0) { *valp = SOL_SOCKET; return 0; }
4898 #endif
4899 #ifdef IPPROTO_IP
4900 if (memcmp(str, "IPPROTO_IP", 10) == 0) { *valp = IPPROTO_IP; return 0; }
4901 #endif
4902 #ifdef IPPROTO_ND
4903 if (memcmp(str, "IPPROTO_ND", 10) == 0) { *valp = IPPROTO_ND; return 0; }
4904 #endif
4905 #ifdef IPPROTO_TP
4906 if (memcmp(str, "IPPROTO_TP", 10) == 0) { *valp = IPPROTO_TP; return 0; }
4907 #endif
4908 #ifdef IPPROTO_AH
4909 if (memcmp(str, "IPPROTO_AH", 10) == 0) { *valp = IPPROTO_AH; return 0; }
4910 #endif
4911 return -1;
4912
4913 case 11:
4914 #ifdef IPPROTO_GGP
4915 if (memcmp(str, "IPPROTO_GGP", 11) == 0) { *valp = IPPROTO_GGP; return 0; }
4916 #endif
4917 #ifdef IPPROTO_TCP
4918 if (memcmp(str, "IPPROTO_TCP", 11) == 0) { *valp = IPPROTO_TCP; return 0; }
4919 #endif
4920 #ifdef IPPROTO_EGP
4921 if (memcmp(str, "IPPROTO_EGP", 11) == 0) { *valp = IPPROTO_EGP; return 0; }
4922 #endif
4923 #ifdef IPPROTO_PUP
4924 if (memcmp(str, "IPPROTO_PUP", 11) == 0) { *valp = IPPROTO_PUP; return 0; }
4925 #endif
4926 #ifdef IPPROTO_UDP
4927 if (memcmp(str, "IPPROTO_UDP", 11) == 0) { *valp = IPPROTO_UDP; return 0; }
4928 #endif
4929 #ifdef IPPROTO_IDP
4930 if (memcmp(str, "IPPROTO_IDP", 11) == 0) { *valp = IPPROTO_IDP; return 0; }
4931 #endif
4932 #ifdef IPPROTO_XTP
4933 if (memcmp(str, "IPPROTO_XTP", 11) == 0) { *valp = IPPROTO_XTP; return 0; }
4934 #endif
4935 #ifdef IPPROTO_EON
4936 if (memcmp(str, "IPPROTO_EON", 11) == 0) { *valp = IPPROTO_EON; return 0; }
4937 #endif
4938 #ifdef IPPROTO_BIP
4939 if (memcmp(str, "IPPROTO_BIP", 11) == 0) { *valp = IPPROTO_BIP; return 0; }
4940 #endif
4941 #ifdef IPPROTO_ESP
4942 if (memcmp(str, "IPPROTO_ESP", 11) == 0) { *valp = IPPROTO_ESP; return 0; }
4943 #endif
4944 #ifdef IPPROTO_RAW
4945 if (memcmp(str, "IPPROTO_RAW", 11) == 0) { *valp = IPPROTO_RAW; return 0; }
4946 #endif
4947 #ifdef IPPROTO_MAX
4948 if (memcmp(str, "IPPROTO_MAX", 11) == 0) { *valp = IPPROTO_MAX; return 0; }
4949 #endif
4950 return -1;
4951
4952 case 12:
4953 #ifdef IPPROTO_ICMP
4954 if (memcmp(str, "IPPROTO_ICMP", 12) == 0) { *valp = IPPROTO_ICMP; return 0; }
4955 #endif
4956 #ifdef IPPROTO_IGMP
4957 if (memcmp(str, "IPPROTO_IGMP", 12) == 0) { *valp = IPPROTO_IGMP; return 0; }
4958 #endif
4959 #ifdef IPPROTO_IPV6
4960 if (memcmp(str, "IPPROTO_IPV6", 12) == 0) { *valp = IPPROTO_IPV6; return 0; }
4961 #endif
4962 #ifdef IPPROTO_NONE
4963 if (memcmp(str, "IPPROTO_NONE", 12) == 0) { *valp = IPPROTO_NONE; return 0; }
4964 #endif
4965 return -1;
4966
4967 case 13:
4968 #ifdef IPPROTO_HELLO
4969 if (memcmp(str, "IPPROTO_HELLO", 13) == 0) { *valp = IPPROTO_HELLO; return 0; }
4970 #endif
4971 return -1;
4972
4973 case 14:
4974 #ifdef IPPROTO_ICMPV6
4975 if (memcmp(str, "IPPROTO_ICMPV6", 14) == 0) { *valp = IPPROTO_ICMPV6; return 0; }
4976 #endif
4977 return -1;
4978
4979 case 15:
4980 #ifdef IPPROTO_DSTOPTS
4981 if (memcmp(str, "IPPROTO_DSTOPTS", 15) == 0) { *valp = IPPROTO_DSTOPTS; return 0; }
4982 #endif
4983 #ifdef IPPROTO_HOPOPTS
4984 if (memcmp(str, "IPPROTO_HOPOPTS", 15) == 0) { *valp = IPPROTO_HOPOPTS; return 0; }
4985 #endif
4986 #ifdef IPPROTO_ROUTING
4987 if (memcmp(str, "IPPROTO_ROUTING", 15) == 0) { *valp = IPPROTO_ROUTING; return 0; }
4988 #endif
4989 return -1;
4990
4991 case 16:
4992 #ifdef IPPROTO_FRAGMENT
4993 if (memcmp(str, "IPPROTO_FRAGMENT", 16) == 0) { *valp = IPPROTO_FRAGMENT; return 0; }
4994 #endif
4995 return -1;
4996
4997 default:
4998 return -1;
4999 }
5000 }
5001
5002
5003 int
5004 rsock_so_optname_to_int(const char *str, long len, int *valp)
5005 {
5006 switch (len) {
5007 case 3:
5008 #ifdef SO_NKE
5009 if (memcmp(str, "NKE", 3) == 0) { *valp = SO_NKE; return 0; }
5010 #endif
5011 return -1;
5012
5013 case 4:
5014 #ifdef SO_TYPE
5015 if (memcmp(str, "TYPE", 4) == 0) { *valp = SO_TYPE; return 0; }
5016 #endif
5017 return -1;
5018
5019 case 5:
5020 #ifdef SO_DEBUG
5021 if (memcmp(str, "DEBUG", 5) == 0) { *valp = SO_DEBUG; return 0; }
5022 #endif
5023 #ifdef SO_ERROR
5024 if (memcmp(str, "ERROR", 5) == 0) { *valp = SO_ERROR; return 0; }
5025 #endif
5026 #ifdef SO_NREAD
5027 if (memcmp(str, "NREAD", 5) == 0) { *valp = SO_NREAD; return 0; }
5028 #endif
5029 return -1;
5030
5031 case 6:
5032 #ifdef SO_NKE
5033 if (memcmp(str, "SO_NKE", 6) == 0) { *valp = SO_NKE; return 0; }
5034 #endif
5035 #ifdef SO_SNDBUF
5036 if (memcmp(str, "SNDBUF", 6) == 0) { *valp = SO_SNDBUF; return 0; }
5037 #endif
5038 #ifdef SO_RCVBUF
5039 if (memcmp(str, "RCVBUF", 6) == 0) { *valp = SO_RCVBUF; return 0; }
5040 #endif
5041 #ifdef SO_LINGER
5042 if (memcmp(str, "LINGER", 6) == 0) { *valp = SO_LINGER; return 0; }
5043 #endif
5044 return -1;
5045
5046 case 7:
5047 #ifdef SO_TYPE
5048 if (memcmp(str, "SO_TYPE", 7) == 0) { *valp = SO_TYPE; return 0; }
5049 #endif
5050 #ifdef SO_BINTIME
5051 if (memcmp(str, "BINTIME", 7) == 0) { *valp = SO_BINTIME; return 0; }
5052 #endif
5053 return -1;
5054
5055 case 8:
5056 #ifdef SO_DEBUG
5057 if (memcmp(str, "SO_DEBUG", 8) == 0) { *valp = SO_DEBUG; return 0; }
5058 #endif
5059 #ifdef SO_ERROR
5060 if (memcmp(str, "SO_ERROR", 8) == 0) { *valp = SO_ERROR; return 0; }
5061 #endif
5062 #ifdef SO_NREAD
5063 if (memcmp(str, "SO_NREAD", 8) == 0) { *valp = SO_NREAD; return 0; }
5064 #endif
5065 #ifdef SO_NO_CHECK
5066 if (memcmp(str, "NO_CHECK", 8) == 0) { *valp = SO_NO_CHECK; return 0; }
5067 #endif
5068 #ifdef SO_PRIORITY
5069 if (memcmp(str, "PRIORITY", 8) == 0) { *valp = SO_PRIORITY; return 0; }
5070 #endif
5071 #ifdef SO_PASSCRED
5072 if (memcmp(str, "PASSCRED", 8) == 0) { *valp = SO_PASSCRED; return 0; }
5073 #endif
5074 #ifdef SO_PEERCRED
5075 if (memcmp(str, "PEERCRED", 8) == 0) { *valp = SO_PEERCRED; return 0; }
5076 #endif
5077 #ifdef SO_RCVLOWAT
5078 if (memcmp(str, "RCVLOWAT", 8) == 0) { *valp = SO_RCVLOWAT; return 0; }
5079 #endif
5080 #ifdef SO_SNDLOWAT
5081 if (memcmp(str, "SNDLOWAT", 8) == 0) { *valp = SO_SNDLOWAT; return 0; }
5082 #endif
5083 #ifdef SO_RCVTIMEO
5084 if (memcmp(str, "RCVTIMEO", 8) == 0) { *valp = SO_RCVTIMEO; return 0; }
5085 #endif
5086 #ifdef SO_SNDTIMEO
5087 if (memcmp(str, "SNDTIMEO", 8) == 0) { *valp = SO_SNDTIMEO; return 0; }
5088 #endif
5089 #ifdef SO_WANTMORE
5090 if (memcmp(str, "WANTMORE", 8) == 0) { *valp = SO_WANTMORE; return 0; }
5091 #endif
5092 #ifdef SO_PEERNAME
5093 if (memcmp(str, "PEERNAME", 8) == 0) { *valp = SO_PEERNAME; return 0; }
5094 #endif
5095 #ifdef SO_ALLZONES
5096 if (memcmp(str, "ALLZONES", 8) == 0) { *valp = SO_ALLZONES; return 0; }
5097 #endif
5098 return -1;
5099
5100 case 9:
5101 #ifdef SO_SNDBUF
5102 if (memcmp(str, "SO_SNDBUF", 9) == 0) { *valp = SO_SNDBUF; return 0; }
5103 #endif
5104 #ifdef SO_RCVBUF
5105 if (memcmp(str, "SO_RCVBUF", 9) == 0) { *valp = SO_RCVBUF; return 0; }
5106 #endif
5107 #ifdef SO_LINGER
5108 if (memcmp(str, "SO_LINGER", 9) == 0) { *valp = SO_LINGER; return 0; }
5109 #endif
5110 #ifdef SO_REUSEADDR
5111 if (memcmp(str, "REUSEADDR", 9) == 0) { *valp = SO_REUSEADDR; return 0; }
5112 #endif
5113 #ifdef SO_REUSEPORT
5114 if (memcmp(str, "REUSEPORT", 9) == 0) { *valp = SO_REUSEPORT; return 0; }
5115 #endif
5116 #ifdef SO_DONTROUTE
5117 if (memcmp(str, "DONTROUTE", 9) == 0) { *valp = SO_DONTROUTE; return 0; }
5118 #endif
5119 #ifdef SO_BROADCAST
5120 if (memcmp(str, "BROADCAST", 9) == 0) { *valp = SO_BROADCAST; return 0; }
5121 #endif
5122 #ifdef SO_KEEPALIVE
5123 if (memcmp(str, "KEEPALIVE", 9) == 0) { *valp = SO_KEEPALIVE; return 0; }
5124 #endif
5125 #ifdef SO_OOBINLINE
5126 if (memcmp(str, "OOBINLINE", 9) == 0) { *valp = SO_OOBINLINE; return 0; }
5127 #endif
5128 #ifdef SO_DONTTRUNC
5129 if (memcmp(str, "DONTTRUNC", 9) == 0) { *valp = SO_DONTTRUNC; return 0; }
5130 #endif
5131 #ifdef SO_NOSIGPIPE
5132 if (memcmp(str, "NOSIGPIPE", 9) == 0) { *valp = SO_NOSIGPIPE; return 0; }
5133 #endif
5134 #ifdef SO_TIMESTAMP
5135 if (memcmp(str, "TIMESTAMP", 9) == 0) { *valp = SO_TIMESTAMP; return 0; }
5136 #endif
5137 #ifdef SO_RECVUCRED
5138 if (memcmp(str, "RECVUCRED", 9) == 0) { *valp = SO_RECVUCRED; return 0; }
5139 #endif
5140 return -1;
5141
5142 case 10:
5143 #ifdef SO_BINTIME
5144 if (memcmp(str, "SO_BINTIME", 10) == 0) { *valp = SO_BINTIME; return 0; }
5145 #endif
5146 #ifdef SO_ACCEPTCONN
5147 if (memcmp(str, "ACCEPTCONN", 10) == 0) { *valp = SO_ACCEPTCONN; return 0; }
5148 #endif
5149 #ifdef SO_MAC_EXEMPT
5150 if (memcmp(str, "MAC_EXEMPT", 10) == 0) { *valp = SO_MAC_EXEMPT; return 0; }
5151 #endif
5152 return -1;
5153
5154 case 11:
5155 #ifdef SO_NO_CHECK
5156 if (memcmp(str, "SO_NO_CHECK", 11) == 0) { *valp = SO_NO_CHECK; return 0; }
5157 #endif
5158 #ifdef SO_PRIORITY
5159 if (memcmp(str, "SO_PRIORITY", 11) == 0) { *valp = SO_PRIORITY; return 0; }
5160 #endif
5161 #ifdef SO_PASSCRED
5162 if (memcmp(str, "SO_PASSCRED", 11) == 0) { *valp = SO_PASSCRED; return 0; }
5163 #endif
5164 #ifdef SO_PEERCRED
5165 if (memcmp(str, "SO_PEERCRED", 11) == 0) { *valp = SO_PEERCRED; return 0; }
5166 #endif
5167 #ifdef SO_RCVLOWAT
5168 if (memcmp(str, "SO_RCVLOWAT", 11) == 0) { *valp = SO_RCVLOWAT; return 0; }
5169 #endif
5170 #ifdef SO_SNDLOWAT
5171 if (memcmp(str, "SO_SNDLOWAT", 11) == 0) { *valp = SO_SNDLOWAT; return 0; }
5172 #endif
5173 #ifdef SO_RCVTIMEO
5174 if (memcmp(str, "SO_RCVTIMEO", 11) == 0) { *valp = SO_RCVTIMEO; return 0; }
5175 #endif
5176 #ifdef SO_SNDTIMEO
5177 if (memcmp(str, "SO_SNDTIMEO", 11) == 0) { *valp = SO_SNDTIMEO; return 0; }
5178 #endif
5179 #ifdef SO_WANTMORE
5180 if (memcmp(str, "SO_WANTMORE", 11) == 0) { *valp = SO_WANTMORE; return 0; }
5181 #endif
5182 #ifdef SO_PEERNAME
5183 if (memcmp(str, "SO_PEERNAME", 11) == 0) { *valp = SO_PEERNAME; return 0; }
5184 #endif
5185 #ifdef SO_ALLZONES
5186 if (memcmp(str, "SO_ALLZONES", 11) == 0) { *valp = SO_ALLZONES; return 0; }
5187 #endif
5188 #ifdef SO_USELOOPBACK
5189 if (memcmp(str, "USELOOPBACK", 11) == 0) { *valp = SO_USELOOPBACK; return 0; }
5190 #endif
5191 #ifdef SO_WANTOOBFLAG
5192 if (memcmp(str, "WANTOOBFLAG", 11) == 0) { *valp = SO_WANTOOBFLAG; return 0; }
5193 #endif
5194 #ifdef SO_TIMESTAMPNS
5195 if (memcmp(str, "TIMESTAMPNS", 11) == 0) { *valp = SO_TIMESTAMPNS; return 0; }
5196 #endif
5197 return -1;
5198
5199 case 12:
5200 #ifdef SO_REUSEADDR
5201 if (memcmp(str, "SO_REUSEADDR", 12) == 0) { *valp = SO_REUSEADDR; return 0; }
5202 #endif
5203 #ifdef SO_REUSEPORT
5204 if (memcmp(str, "SO_REUSEPORT", 12) == 0) { *valp = SO_REUSEPORT; return 0; }
5205 #endif
5206 #ifdef SO_DONTROUTE
5207 if (memcmp(str, "SO_DONTROUTE", 12) == 0) { *valp = SO_DONTROUTE; return 0; }
5208 #endif
5209 #ifdef SO_BROADCAST
5210 if (memcmp(str, "SO_BROADCAST", 12) == 0) { *valp = SO_BROADCAST; return 0; }
5211 #endif
5212 #ifdef SO_KEEPALIVE
5213 if (memcmp(str, "SO_KEEPALIVE", 12) == 0) { *valp = SO_KEEPALIVE; return 0; }
5214 #endif
5215 #ifdef SO_OOBINLINE
5216 if (memcmp(str, "SO_OOBINLINE", 12) == 0) { *valp = SO_OOBINLINE; return 0; }
5217 #endif
5218 #ifdef SO_DONTTRUNC
5219 if (memcmp(str, "SO_DONTTRUNC", 12) == 0) { *valp = SO_DONTTRUNC; return 0; }
5220 #endif
5221 #ifdef SO_NOSIGPIPE
5222 if (memcmp(str, "SO_NOSIGPIPE", 12) == 0) { *valp = SO_NOSIGPIPE; return 0; }
5223 #endif
5224 #ifdef SO_TIMESTAMP
5225 if (memcmp(str, "SO_TIMESTAMP", 12) == 0) { *valp = SO_TIMESTAMP; return 0; }
5226 #endif
5227 #ifdef SO_RECVUCRED
5228 if (memcmp(str, "SO_RECVUCRED", 12) == 0) { *valp = SO_RECVUCRED; return 0; }
5229 #endif
5230 #ifdef SO_ACCEPTFILTER
5231 if (memcmp(str, "ACCEPTFILTER", 12) == 0) { *valp = SO_ACCEPTFILTER; return 0; }
5232 #endif
5233 #ifdef SO_BINDTODEVICE
5234 if (memcmp(str, "BINDTODEVICE", 12) == 0) { *valp = SO_BINDTODEVICE; return 0; }
5235 #endif
5236 return -1;
5237
5238 case 13:
5239 #ifdef SO_ACCEPTCONN
5240 if (memcmp(str, "SO_ACCEPTCONN", 13) == 0) { *valp = SO_ACCEPTCONN; return 0; }
5241 #endif
5242 #ifdef SO_MAC_EXEMPT
5243 if (memcmp(str, "SO_MAC_EXEMPT", 13) == 0) { *valp = SO_MAC_EXEMPT; return 0; }
5244 #endif
5245 #ifdef SO_ATTACH_FILTER
5246 if (memcmp(str, "ATTACH_FILTER", 13) == 0) { *valp = SO_ATTACH_FILTER; return 0; }
5247 #endif
5248 #ifdef SO_DETACH_FILTER
5249 if (memcmp(str, "DETACH_FILTER", 13) == 0) { *valp = SO_DETACH_FILTER; return 0; }
5250 #endif
5251 return -1;
5252
5253 case 14:
5254 #ifdef SO_USELOOPBACK
5255 if (memcmp(str, "SO_USELOOPBACK", 14) == 0) { *valp = SO_USELOOPBACK; return 0; }
5256 #endif
5257 #ifdef SO_WANTOOBFLAG
5258 if (memcmp(str, "SO_WANTOOBFLAG", 14) == 0) { *valp = SO_WANTOOBFLAG; return 0; }
5259 #endif
5260 #ifdef SO_TIMESTAMPNS
5261 if (memcmp(str, "SO_TIMESTAMPNS", 14) == 0) { *valp = SO_TIMESTAMPNS; return 0; }
5262 #endif
5263 return -1;
5264
5265 case 15:
5266 #ifdef SO_ACCEPTFILTER
5267 if (memcmp(str, "SO_ACCEPTFILTER", 15) == 0) { *valp = SO_ACCEPTFILTER; return 0; }
5268 #endif
5269 #ifdef SO_BINDTODEVICE
5270 if (memcmp(str, "SO_BINDTODEVICE", 15) == 0) { *valp = SO_BINDTODEVICE; return 0; }
5271 #endif
5272 return -1;
5273
5274 case 16:
5275 #ifdef SO_ATTACH_FILTER
5276 if (memcmp(str, "SO_ATTACH_FILTER", 16) == 0) { *valp = SO_ATTACH_FILTER; return 0; }
5277 #endif
5278 #ifdef SO_DETACH_FILTER
5279 if (memcmp(str, "SO_DETACH_FILTER", 16) == 0) { *valp = SO_DETACH_FILTER; return 0; }
5280 #endif
5281 return -1;
5282
5283 case 23:
5284 #ifdef SO_SECURITY_AUTHENTICATION
5285 if (memcmp(str, "SECURITY_AUTHENTICATION", 23) == 0) { *valp = SO_SECURITY_AUTHENTICATION; return 0; }
5286 #endif
5287 return -1;
5288
5289 case 26:
5290 #ifdef SO_SECURITY_AUTHENTICATION
5291 if (memcmp(str, "SO_SECURITY_AUTHENTICATION", 26) == 0) { *valp = SO_SECURITY_AUTHENTICATION; return 0; }
5292 #endif
5293 return -1;
5294
5295 case 27:
5296 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
5297 if (memcmp(str, "SECURITY_ENCRYPTION_NETWORK", 27) == 0) { *valp = SO_SECURITY_ENCRYPTION_NETWORK; return 0; }
5298 #endif
5299 return -1;
5300
5301 case 29:
5302 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
5303 if (memcmp(str, "SECURITY_ENCRYPTION_TRANSPORT", 29) == 0) { *valp = SO_SECURITY_ENCRYPTION_TRANSPORT; return 0; }
5304 #endif
5305 return -1;
5306
5307 case 30:
5308 #ifdef SO_SECURITY_ENCRYPTION_NETWORK
5309 if (memcmp(str, "SO_SECURITY_ENCRYPTION_NETWORK", 30) == 0) { *valp = SO_SECURITY_ENCRYPTION_NETWORK; return 0; }
5310 #endif
5311 return -1;
5312
5313 case 32:
5314 #ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
5315 if (memcmp(str, "SO_SECURITY_ENCRYPTION_TRANSPORT", 32) == 0) { *valp = SO_SECURITY_ENCRYPTION_TRANSPORT; return 0; }
5316 #endif
5317 return -1;
5318
5319 default:
5320 return -1;
5321 }
5322 }
5323
5324
5325 int
5326 rsock_ip_optname_to_int(const char *str, long len, int *valp)
5327 {
5328 switch (len) {
5329 case 3:
5330 #ifdef IP_TOS
5331 if (memcmp(str, "TOS", 3) == 0) { *valp = IP_TOS; return 0; }
5332 #endif
5333 #ifdef IP_TTL
5334 if (memcmp(str, "TTL", 3) == 0) { *valp = IP_TTL; return 0; }
5335 #endif
5336 #ifdef IP_MTU
5337 if (memcmp(str, "MTU", 3) == 0) { *valp = IP_MTU; return 0; }
5338 #endif
5339 return -1;
5340
5341 case 6:
5342 #ifdef IP_TOS
5343 if (memcmp(str, "IP_TOS", 6) == 0) { *valp = IP_TOS; return 0; }
5344 #endif
5345 #ifdef IP_TTL
5346 if (memcmp(str, "IP_TTL", 6) == 0) { *valp = IP_TTL; return 0; }
5347 #endif
5348 #ifdef IP_MTU
5349 if (memcmp(str, "IP_MTU", 6) == 0) { *valp = IP_MTU; return 0; }
5350 #endif
5351 #ifdef IP_MINTTL
5352 if (memcmp(str, "MINTTL", 6) == 0) { *valp = IP_MINTTL; return 0; }
5353 #endif
5354 #ifdef IP_RECVIF
5355 if (memcmp(str, "RECVIF", 6) == 0) { *valp = IP_RECVIF; return 0; }
5356 #endif
5357 return -1;
5358
5359 case 7:
5360 #ifdef IP_OPTIONS
5361 if (memcmp(str, "OPTIONS", 7) == 0) { *valp = IP_OPTIONS; return 0; }
5362 #endif
5363 #ifdef IP_HDRINCL
5364 if (memcmp(str, "HDRINCL", 7) == 0) { *valp = IP_HDRINCL; return 0; }
5365 #endif
5366 #ifdef IP_RETOPTS
5367 if (memcmp(str, "RETOPTS", 7) == 0) { *valp = IP_RETOPTS; return 0; }
5368 #endif
5369 #ifdef IP_RECVTTL
5370 if (memcmp(str, "RECVTTL", 7) == 0) { *valp = IP_RECVTTL; return 0; }
5371 #endif
5372 #ifdef IP_PKTINFO
5373 if (memcmp(str, "PKTINFO", 7) == 0) { *valp = IP_PKTINFO; return 0; }
5374 #endif
5375 #ifdef IP_RECVERR
5376 if (memcmp(str, "RECVERR", 7) == 0) { *valp = IP_RECVERR; return 0; }
5377 #endif
5378 #ifdef IP_RECVTOS
5379 if (memcmp(str, "RECVTOS", 7) == 0) { *valp = IP_RECVTOS; return 0; }
5380 #endif
5381 #ifdef IP_PASSSEC
5382 if (memcmp(str, "PASSSEC", 7) == 0) { *valp = IP_PASSSEC; return 0; }
5383 #endif
5384 return -1;
5385
5386 case 8:
5387 #ifdef IP_RECVOPTS
5388 if (memcmp(str, "RECVOPTS", 8) == 0) { *valp = IP_RECVOPTS; return 0; }
5389 #endif
5390 #ifdef IP_DONTFRAG
5391 if (memcmp(str, "DONTFRAG", 8) == 0) { *valp = IP_DONTFRAG; return 0; }
5392 #endif
5393 #ifdef IP_RECVSLLA
5394 if (memcmp(str, "RECVSLLA", 8) == 0) { *valp = IP_RECVSLLA; return 0; }
5395 #endif
5396 #ifdef IP_FREEBIND
5397 if (memcmp(str, "FREEBIND", 8) == 0) { *valp = IP_FREEBIND; return 0; }
5398 #endif
5399 #ifdef IP_MSFILTER
5400 if (memcmp(str, "MSFILTER", 8) == 0) { *valp = IP_MSFILTER; return 0; }
5401 #endif
5402 return -1;
5403
5404 case 9:
5405 #ifdef IP_MINTTL
5406 if (memcmp(str, "IP_MINTTL", 9) == 0) { *valp = IP_MINTTL; return 0; }
5407 #endif
5408 #ifdef IP_RECVIF
5409 if (memcmp(str, "IP_RECVIF", 9) == 0) { *valp = IP_RECVIF; return 0; }
5410 #endif
5411 #ifdef IP_ONESBCAST
5412 if (memcmp(str, "ONESBCAST", 9) == 0) { *valp = IP_ONESBCAST; return 0; }
5413 #endif
5414 #ifdef IP_PORTRANGE
5415 if (memcmp(str, "PORTRANGE", 9) == 0) { *valp = IP_PORTRANGE; return 0; }
5416 #endif
5417 return -1;
5418
5419 case 10:
5420 #ifdef IP_OPTIONS
5421 if (memcmp(str, "IP_OPTIONS", 10) == 0) { *valp = IP_OPTIONS; return 0; }
5422 #endif
5423 #ifdef IP_HDRINCL
5424 if (memcmp(str, "IP_HDRINCL", 10) == 0) { *valp = IP_HDRINCL; return 0; }
5425 #endif
5426 #ifdef IP_RETOPTS
5427 if (memcmp(str, "IP_RETOPTS", 10) == 0) { *valp = IP_RETOPTS; return 0; }
5428 #endif
5429 #ifdef IP_RECVTTL
5430 if (memcmp(str, "IP_RECVTTL", 10) == 0) { *valp = IP_RECVTTL; return 0; }
5431 #endif
5432 #ifdef IP_PKTINFO
5433 if (memcmp(str, "IP_PKTINFO", 10) == 0) { *valp = IP_PKTINFO; return 0; }
5434 #endif
5435 #ifdef IP_RECVERR
5436 if (memcmp(str, "IP_RECVERR", 10) == 0) { *valp = IP_RECVERR; return 0; }
5437 #endif
5438 #ifdef IP_RECVTOS
5439 if (memcmp(str, "IP_RECVTOS", 10) == 0) { *valp = IP_RECVTOS; return 0; }
5440 #endif
5441 #ifdef IP_PASSSEC
5442 if (memcmp(str, "IP_PASSSEC", 10) == 0) { *valp = IP_PASSSEC; return 0; }
5443 #endif
5444 #ifdef IP_PKTOPTIONS
5445 if (memcmp(str, "PKTOPTIONS", 10) == 0) { *valp = IP_PKTOPTIONS; return 0; }
5446 #endif
5447 return -1;
5448
5449 case 11:
5450 #ifdef IP_RECVOPTS
5451 if (memcmp(str, "IP_RECVOPTS", 11) == 0) { *valp = IP_RECVOPTS; return 0; }
5452 #endif
5453 #ifdef IP_DONTFRAG
5454 if (memcmp(str, "IP_DONTFRAG", 11) == 0) { *valp = IP_DONTFRAG; return 0; }
5455 #endif
5456 #ifdef IP_RECVSLLA
5457 if (memcmp(str, "IP_RECVSLLA", 11) == 0) { *valp = IP_RECVSLLA; return 0; }
5458 #endif
5459 #ifdef IP_FREEBIND
5460 if (memcmp(str, "IP_FREEBIND", 11) == 0) { *valp = IP_FREEBIND; return 0; }
5461 #endif
5462 #ifdef IP_MSFILTER
5463 if (memcmp(str, "IP_MSFILTER", 11) == 0) { *valp = IP_MSFILTER; return 0; }
5464 #endif
5465 #ifdef IP_RECVRETOPTS
5466 if (memcmp(str, "RECVRETOPTS", 11) == 0) { *valp = IP_RECVRETOPTS; return 0; }
5467 #endif
5468 #ifdef IP_RECVDSTADDR
5469 if (memcmp(str, "RECVDSTADDR", 11) == 0) { *valp = IP_RECVDSTADDR; return 0; }
5470 #endif
5471 #ifdef IP_SENDSRCADDR
5472 if (memcmp(str, "SENDSRCADDR", 11) == 0) { *valp = IP_SENDSRCADDR; return 0; }
5473 #endif
5474 #ifdef IP_XFRM_POLICY
5475 if (memcmp(str, "XFRM_POLICY", 11) == 0) { *valp = IP_XFRM_POLICY; return 0; }
5476 #endif
5477 #ifdef IP_PMTUDISC_DO
5478 if (memcmp(str, "PMTUDISC_DO", 11) == 0) { *valp = IP_PMTUDISC_DO; return 0; }
5479 #endif
5480 return -1;
5481
5482 case 12:
5483 #ifdef IP_ONESBCAST
5484 if (memcmp(str, "IP_ONESBCAST", 12) == 0) { *valp = IP_ONESBCAST; return 0; }
5485 #endif
5486 #ifdef IP_PORTRANGE
5487 if (memcmp(str, "IP_PORTRANGE", 12) == 0) { *valp = IP_PORTRANGE; return 0; }
5488 #endif
5489 #ifdef IP_MULTICAST_IF
5490 if (memcmp(str, "MULTICAST_IF", 12) == 0) { *valp = IP_MULTICAST_IF; return 0; }
5491 #endif
5492 #ifdef IP_ROUTER_ALERT
5493 if (memcmp(str, "ROUTER_ALERT", 12) == 0) { *valp = IP_ROUTER_ALERT; return 0; }
5494 #endif
5495 #ifdef IP_MTU_DISCOVER
5496 if (memcmp(str, "MTU_DISCOVER", 12) == 0) { *valp = IP_MTU_DISCOVER; return 0; }
5497 #endif
5498 #ifdef IP_IPSEC_POLICY
5499 if (memcmp(str, "IPSEC_POLICY", 12) == 0) { *valp = IP_IPSEC_POLICY; return 0; }
5500 #endif
5501 #ifdef IP_BLOCK_SOURCE
5502 if (memcmp(str, "BLOCK_SOURCE", 12) == 0) { *valp = IP_BLOCK_SOURCE; return 0; }
5503 #endif
5504 return -1;
5505
5506 case 13:
5507 #ifdef IP_PKTOPTIONS
5508 if (memcmp(str, "IP_PKTOPTIONS", 13) == 0) { *valp = IP_PKTOPTIONS; return 0; }
5509 #endif
5510 #ifdef IP_MULTICAST_TTL
5511 if (memcmp(str, "MULTICAST_TTL", 13) == 0) { *valp = IP_MULTICAST_TTL; return 0; }
5512 #endif
5513 #ifdef IP_PMTUDISC_DONT
5514 if (memcmp(str, "PMTUDISC_DONT", 13) == 0) { *valp = IP_PMTUDISC_DONT; return 0; }
5515 #endif
5516 #ifdef IP_PMTUDISC_WANT
5517 if (memcmp(str, "PMTUDISC_WANT", 13) == 0) { *valp = IP_PMTUDISC_WANT; return 0; }
5518 #endif
5519 return -1;
5520
5521 case 14:
5522 #ifdef IP_RECVRETOPTS
5523 if (memcmp(str, "IP_RECVRETOPTS", 14) == 0) { *valp = IP_RECVRETOPTS; return 0; }
5524 #endif
5525 #ifdef IP_RECVDSTADDR
5526 if (memcmp(str, "IP_RECVDSTADDR", 14) == 0) { *valp = IP_RECVDSTADDR; return 0; }
5527 #endif
5528 #ifdef IP_SENDSRCADDR
5529 if (memcmp(str, "IP_SENDSRCADDR", 14) == 0) { *valp = IP_SENDSRCADDR; return 0; }
5530 #endif
5531 #ifdef IP_XFRM_POLICY
5532 if (memcmp(str, "IP_XFRM_POLICY", 14) == 0) { *valp = IP_XFRM_POLICY; return 0; }
5533 #endif
5534 #ifdef IP_PMTUDISC_DO
5535 if (memcmp(str, "IP_PMTUDISC_DO", 14) == 0) { *valp = IP_PMTUDISC_DO; return 0; }
5536 #endif
5537 #ifdef IP_MULTICAST_LOOP
5538 if (memcmp(str, "MULTICAST_LOOP", 14) == 0) { *valp = IP_MULTICAST_LOOP; return 0; }
5539 #endif
5540 #ifdef IP_ADD_MEMBERSHIP
5541 if (memcmp(str, "ADD_MEMBERSHIP", 14) == 0) { *valp = IP_ADD_MEMBERSHIP; return 0; }
5542 #endif
5543 #ifdef IP_UNBLOCK_SOURCE
5544 if (memcmp(str, "UNBLOCK_SOURCE", 14) == 0) { *valp = IP_UNBLOCK_SOURCE; return 0; }
5545 #endif
5546 return -1;
5547
5548 case 15:
5549 #ifdef IP_MULTICAST_IF
5550 if (memcmp(str, "IP_MULTICAST_IF", 15) == 0) { *valp = IP_MULTICAST_IF; return 0; }
5551 #endif
5552 #ifdef IP_ROUTER_ALERT
5553 if (memcmp(str, "IP_ROUTER_ALERT", 15) == 0) { *valp = IP_ROUTER_ALERT; return 0; }
5554 #endif
5555 #ifdef IP_MTU_DISCOVER
5556 if (memcmp(str, "IP_MTU_DISCOVER", 15) == 0) { *valp = IP_MTU_DISCOVER; return 0; }
5557 #endif
5558 #ifdef IP_IPSEC_POLICY
5559 if (memcmp(str, "IP_IPSEC_POLICY", 15) == 0) { *valp = IP_IPSEC_POLICY; return 0; }
5560 #endif
5561 #ifdef IP_BLOCK_SOURCE
5562 if (memcmp(str, "IP_BLOCK_SOURCE", 15) == 0) { *valp = IP_BLOCK_SOURCE; return 0; }
5563 #endif
5564 #ifdef IP_DROP_MEMBERSHIP
5565 if (memcmp(str, "DROP_MEMBERSHIP", 15) == 0) { *valp = IP_DROP_MEMBERSHIP; return 0; }
5566 #endif
5567 #ifdef IP_MAX_MEMBERSHIPS
5568 if (memcmp(str, "MAX_MEMBERSHIPS", 15) == 0) { *valp = IP_MAX_MEMBERSHIPS; return 0; }
5569 #endif
5570 return -1;
5571
5572 case 16:
5573 #ifdef IP_MULTICAST_TTL
5574 if (memcmp(str, "IP_MULTICAST_TTL", 16) == 0) { *valp = IP_MULTICAST_TTL; return 0; }
5575 #endif
5576 #ifdef IP_PMTUDISC_DONT
5577 if (memcmp(str, "IP_PMTUDISC_DONT", 16) == 0) { *valp = IP_PMTUDISC_DONT; return 0; }
5578 #endif
5579 #ifdef IP_PMTUDISC_WANT
5580 if (memcmp(str, "IP_PMTUDISC_WANT", 16) == 0) { *valp = IP_PMTUDISC_WANT; return 0; }
5581 #endif
5582 return -1;
5583
5584 case 17:
5585 #ifdef IP_MULTICAST_LOOP
5586 if (memcmp(str, "IP_MULTICAST_LOOP", 17) == 0) { *valp = IP_MULTICAST_LOOP; return 0; }
5587 #endif
5588 #ifdef IP_ADD_MEMBERSHIP
5589 if (memcmp(str, "IP_ADD_MEMBERSHIP", 17) == 0) { *valp = IP_ADD_MEMBERSHIP; return 0; }
5590 #endif
5591 #ifdef IP_UNBLOCK_SOURCE
5592 if (memcmp(str, "IP_UNBLOCK_SOURCE", 17) == 0) { *valp = IP_UNBLOCK_SOURCE; return 0; }
5593 #endif
5594 return -1;
5595
5596 case 18:
5597 #ifdef IP_DROP_MEMBERSHIP
5598 if (memcmp(str, "IP_DROP_MEMBERSHIP", 18) == 0) { *valp = IP_DROP_MEMBERSHIP; return 0; }
5599 #endif
5600 #ifdef IP_MAX_MEMBERSHIPS
5601 if (memcmp(str, "IP_MAX_MEMBERSHIPS", 18) == 0) { *valp = IP_MAX_MEMBERSHIPS; return 0; }
5602 #endif
5603 return -1;
5604
5605 case 21:
5606 #ifdef IP_DEFAULT_MULTICAST_TTL
5607 if (memcmp(str, "DEFAULT_MULTICAST_TTL", 21) == 0) { *valp = IP_DEFAULT_MULTICAST_TTL; return 0; }
5608 #endif
5609 #ifdef IP_ADD_SOURCE_MEMBERSHIP
5610 if (memcmp(str, "ADD_SOURCE_MEMBERSHIP", 21) == 0) { *valp = IP_ADD_SOURCE_MEMBERSHIP; return 0; }
5611 #endif
5612 return -1;
5613
5614 case 22:
5615 #ifdef IP_DEFAULT_MULTICAST_LOOP
5616 if (memcmp(str, "DEFAULT_MULTICAST_LOOP", 22) == 0) { *valp = IP_DEFAULT_MULTICAST_LOOP; return 0; }
5617 #endif
5618 #ifdef IP_DROP_SOURCE_MEMBERSHIP
5619 if (memcmp(str, "DROP_SOURCE_MEMBERSHIP", 22) == 0) { *valp = IP_DROP_SOURCE_MEMBERSHIP; return 0; }
5620 #endif
5621 return -1;
5622
5623 case 24:
5624 #ifdef IP_DEFAULT_MULTICAST_TTL
5625 if (memcmp(str, "IP_DEFAULT_MULTICAST_TTL", 24) == 0) { *valp = IP_DEFAULT_MULTICAST_TTL; return 0; }
5626 #endif
5627 #ifdef IP_ADD_SOURCE_MEMBERSHIP
5628 if (memcmp(str, "IP_ADD_SOURCE_MEMBERSHIP", 24) == 0) { *valp = IP_ADD_SOURCE_MEMBERSHIP; return 0; }
5629 #endif
5630 return -1;
5631
5632 case 25:
5633 #ifdef IP_DEFAULT_MULTICAST_LOOP
5634 if (memcmp(str, "IP_DEFAULT_MULTICAST_LOOP", 25) == 0) { *valp = IP_DEFAULT_MULTICAST_LOOP; return 0; }
5635 #endif
5636 #ifdef IP_DROP_SOURCE_MEMBERSHIP
5637 if (memcmp(str, "IP_DROP_SOURCE_MEMBERSHIP", 25) == 0) { *valp = IP_DROP_SOURCE_MEMBERSHIP; return 0; }
5638 #endif
5639 return -1;
5640
5641 default:
5642 return -1;
5643 }
5644 }
5645
5646
5647 #ifdef IPPROTO_IPV6
5648 int
5649 rsock_ipv6_optname_to_int(const char *str, long len, int *valp)
5650 {
5651 switch (len) {
5652 case 5:
5653 #ifdef IPV6_RTHDR
5654 if (memcmp(str, "RTHDR", 5) == 0) { *valp = IPV6_RTHDR; return 0; }
5655 #endif
5656 return -1;
5657
5658 case 6:
5659 #ifdef IPV6_V6ONLY
5660 if (memcmp(str, "V6ONLY", 6) == 0) { *valp = IPV6_V6ONLY; return 0; }
5661 #endif
5662 #ifdef IPV6_TCLASS
5663 if (memcmp(str, "TCLASS", 6) == 0) { *valp = IPV6_TCLASS; return 0; }
5664 #endif
5665 return -1;
5666
5667 case 7:
5668 #ifdef IPV6_DSTOPTS
5669 if (memcmp(str, "DSTOPTS", 7) == 0) { *valp = IPV6_DSTOPTS; return 0; }
5670 #endif
5671 #ifdef IPV6_HOPOPTS
5672 if (memcmp(str, "HOPOPTS", 7) == 0) { *valp = IPV6_HOPOPTS; return 0; }
5673 #endif
5674 #ifdef IPV6_NEXTHOP
5675 if (memcmp(str, "NEXTHOP", 7) == 0) { *valp = IPV6_NEXTHOP; return 0; }
5676 #endif
5677 #ifdef IPV6_PATHMTU
5678 if (memcmp(str, "PATHMTU", 7) == 0) { *valp = IPV6_PATHMTU; return 0; }
5679 #endif
5680 #ifdef IPV6_PKTINFO
5681 if (memcmp(str, "PKTINFO", 7) == 0) { *valp = IPV6_PKTINFO; return 0; }
5682 #endif
5683 return -1;
5684
5685 case 8:
5686 #ifdef IPV6_CHECKSUM
5687 if (memcmp(str, "CHECKSUM", 8) == 0) { *valp = IPV6_CHECKSUM; return 0; }
5688 #endif
5689 #ifdef IPV6_DONTFRAG
5690 if (memcmp(str, "DONTFRAG", 8) == 0) { *valp = IPV6_DONTFRAG; return 0; }
5691 #endif
5692 #ifdef IPV6_HOPLIMIT
5693 if (memcmp(str, "HOPLIMIT", 8) == 0) { *valp = IPV6_HOPLIMIT; return 0; }
5694 #endif
5695 return -1;
5696
5697 case 9:
5698 #ifdef IPV6_RECVRTHDR
5699 if (memcmp(str, "RECVRTHDR", 9) == 0) { *valp = IPV6_RECVRTHDR; return 0; }
5700 #endif
5701 return -1;
5702
5703 case 10:
5704 #ifdef IPV6_RTHDR
5705 if (memcmp(str, "IPV6_RTHDR", 10) == 0) { *valp = IPV6_RTHDR; return 0; }
5706 #endif
5707 #ifdef IPV6_JOIN_GROUP
5708 if (memcmp(str, "JOIN_GROUP", 10) == 0) { *valp = IPV6_JOIN_GROUP; return 0; }
5709 #endif
5710 #ifdef IPV6_RECVTCLASS
5711 if (memcmp(str, "RECVTCLASS", 10) == 0) { *valp = IPV6_RECVTCLASS; return 0; }
5712 #endif
5713 return -1;
5714
5715 case 11:
5716 #ifdef IPV6_V6ONLY
5717 if (memcmp(str, "IPV6_V6ONLY", 11) == 0) { *valp = IPV6_V6ONLY; return 0; }
5718 #endif
5719 #ifdef IPV6_TCLASS
5720 if (memcmp(str, "IPV6_TCLASS", 11) == 0) { *valp = IPV6_TCLASS; return 0; }
5721 #endif
5722 #ifdef IPV6_LEAVE_GROUP
5723 if (memcmp(str, "LEAVE_GROUP", 11) == 0) { *valp = IPV6_LEAVE_GROUP; return 0; }
5724 #endif
5725 #ifdef IPV6_RECVDSTOPTS
5726 if (memcmp(str, "RECVDSTOPTS", 11) == 0) { *valp = IPV6_RECVDSTOPTS; return 0; }
5727 #endif
5728 #ifdef IPV6_RECVHOPOPTS
5729 if (memcmp(str, "RECVHOPOPTS", 11) == 0) { *valp = IPV6_RECVHOPOPTS; return 0; }
5730 #endif
5731 #ifdef IPV6_RECVPKTINFO
5732 if (memcmp(str, "RECVPKTINFO", 11) == 0) { *valp = IPV6_RECVPKTINFO; return 0; }
5733 #endif
5734 #ifdef IPV6_RECVPATHMTU
5735 if (memcmp(str, "RECVPATHMTU", 11) == 0) { *valp = IPV6_RECVPATHMTU; return 0; }
5736 #endif
5737 #ifdef IPV6_USE_MIN_MTU
5738 if (memcmp(str, "USE_MIN_MTU", 11) == 0) { *valp = IPV6_USE_MIN_MTU; return 0; }
5739 #endif
5740 return -1;
5741
5742 case 12:
5743 #ifdef IPV6_DSTOPTS
5744 if (memcmp(str, "IPV6_DSTOPTS", 12) == 0) { *valp = IPV6_DSTOPTS; return 0; }
5745 #endif
5746 #ifdef IPV6_HOPOPTS
5747 if (memcmp(str, "IPV6_HOPOPTS", 12) == 0) { *valp = IPV6_HOPOPTS; return 0; }
5748 #endif
5749 #ifdef IPV6_NEXTHOP
5750 if (memcmp(str, "IPV6_NEXTHOP", 12) == 0) { *valp = IPV6_NEXTHOP; return 0; }
5751 #endif
5752 #ifdef IPV6_PATHMTU
5753 if (memcmp(str, "IPV6_PATHMTU", 12) == 0) { *valp = IPV6_PATHMTU; return 0; }
5754 #endif
5755 #ifdef IPV6_PKTINFO
5756 if (memcmp(str, "IPV6_PKTINFO", 12) == 0) { *valp = IPV6_PKTINFO; return 0; }
5757 #endif
5758 #ifdef IPV6_MULTICAST_IF
5759 if (memcmp(str, "MULTICAST_IF", 12) == 0) { *valp = IPV6_MULTICAST_IF; return 0; }
5760 #endif
5761 #ifdef IPV6_UNICAST_HOPS
5762 if (memcmp(str, "UNICAST_HOPS", 12) == 0) { *valp = IPV6_UNICAST_HOPS; return 0; }
5763 #endif
5764 #ifdef IPV6_RECVHOPLIMIT
5765 if (memcmp(str, "RECVHOPLIMIT", 12) == 0) { *valp = IPV6_RECVHOPLIMIT; return 0; }
5766 #endif
5767 #ifdef IPV6_RTHDRDSTOPTS
5768 if (memcmp(str, "RTHDRDSTOPTS", 12) == 0) { *valp = IPV6_RTHDRDSTOPTS; return 0; }
5769 #endif
5770 #ifdef IPV6_RTHDR_TYPE_0
5771 if (memcmp(str, "RTHDR_TYPE_0", 12) == 0) { *valp = IPV6_RTHDR_TYPE_0; return 0; }
5772 #endif
5773 return -1;
5774
5775 case 13:
5776 #ifdef IPV6_CHECKSUM
5777 if (memcmp(str, "IPV6_CHECKSUM", 13) == 0) { *valp = IPV6_CHECKSUM; return 0; }
5778 #endif
5779 #ifdef IPV6_DONTFRAG
5780 if (memcmp(str, "IPV6_DONTFRAG", 13) == 0) { *valp = IPV6_DONTFRAG; return 0; }
5781 #endif
5782 #ifdef IPV6_HOPLIMIT
5783 if (memcmp(str, "IPV6_HOPLIMIT", 13) == 0) { *valp = IPV6_HOPLIMIT; return 0; }
5784 #endif
5785 return -1;
5786
5787 case 14:
5788 #ifdef IPV6_RECVRTHDR
5789 if (memcmp(str, "IPV6_RECVRTHDR", 14) == 0) { *valp = IPV6_RECVRTHDR; return 0; }
5790 #endif
5791 #ifdef IPV6_MULTICAST_HOPS
5792 if (memcmp(str, "MULTICAST_HOPS", 14) == 0) { *valp = IPV6_MULTICAST_HOPS; return 0; }
5793 #endif
5794 #ifdef IPV6_MULTICAST_LOOP
5795 if (memcmp(str, "MULTICAST_LOOP", 14) == 0) { *valp = IPV6_MULTICAST_LOOP; return 0; }
5796 #endif
5797 return -1;
5798
5799 case 15:
5800 #ifdef IPV6_JOIN_GROUP
5801 if (memcmp(str, "IPV6_JOIN_GROUP", 15) == 0) { *valp = IPV6_JOIN_GROUP; return 0; }
5802 #endif
5803 #ifdef IPV6_RECVTCLASS
5804 if (memcmp(str, "IPV6_RECVTCLASS", 15) == 0) { *valp = IPV6_RECVTCLASS; return 0; }
5805 #endif
5806 return -1;
5807
5808 case 16:
5809 #ifdef IPV6_LEAVE_GROUP
5810 if (memcmp(str, "IPV6_LEAVE_GROUP", 16) == 0) { *valp = IPV6_LEAVE_GROUP; return 0; }
5811 #endif
5812 #ifdef IPV6_RECVDSTOPTS
5813 if (memcmp(str, "IPV6_RECVDSTOPTS", 16) == 0) { *valp = IPV6_RECVDSTOPTS; return 0; }
5814 #endif
5815 #ifdef IPV6_RECVHOPOPTS
5816 if (memcmp(str, "IPV6_RECVHOPOPTS", 16) == 0) { *valp = IPV6_RECVHOPOPTS; return 0; }
5817 #endif
5818 #ifdef IPV6_RECVPKTINFO
5819 if (memcmp(str, "IPV6_RECVPKTINFO", 16) == 0) { *valp = IPV6_RECVPKTINFO; return 0; }
5820 #endif
5821 #ifdef IPV6_RECVPATHMTU
5822 if (memcmp(str, "IPV6_RECVPATHMTU", 16) == 0) { *valp = IPV6_RECVPATHMTU; return 0; }
5823 #endif
5824 #ifdef IPV6_USE_MIN_MTU
5825 if (memcmp(str, "IPV6_USE_MIN_MTU", 16) == 0) { *valp = IPV6_USE_MIN_MTU; return 0; }
5826 #endif
5827 return -1;
5828
5829 case 17:
5830 #ifdef IPV6_MULTICAST_IF
5831 if (memcmp(str, "IPV6_MULTICAST_IF", 17) == 0) { *valp = IPV6_MULTICAST_IF; return 0; }
5832 #endif
5833 #ifdef IPV6_UNICAST_HOPS
5834 if (memcmp(str, "IPV6_UNICAST_HOPS", 17) == 0) { *valp = IPV6_UNICAST_HOPS; return 0; }
5835 #endif
5836 #ifdef IPV6_RECVHOPLIMIT
5837 if (memcmp(str, "IPV6_RECVHOPLIMIT", 17) == 0) { *valp = IPV6_RECVHOPLIMIT; return 0; }
5838 #endif
5839 #ifdef IPV6_RTHDRDSTOPTS
5840 if (memcmp(str, "IPV6_RTHDRDSTOPTS", 17) == 0) { *valp = IPV6_RTHDRDSTOPTS; return 0; }
5841 #endif
5842 #ifdef IPV6_RTHDR_TYPE_0
5843 if (memcmp(str, "IPV6_RTHDR_TYPE_0", 17) == 0) { *valp = IPV6_RTHDR_TYPE_0; return 0; }
5844 #endif
5845 return -1;
5846
5847 case 19:
5848 #ifdef IPV6_MULTICAST_HOPS
5849 if (memcmp(str, "IPV6_MULTICAST_HOPS", 19) == 0) { *valp = IPV6_MULTICAST_HOPS; return 0; }
5850 #endif
5851 #ifdef IPV6_MULTICAST_LOOP
5852 if (memcmp(str, "IPV6_MULTICAST_LOOP", 19) == 0) { *valp = IPV6_MULTICAST_LOOP; return 0; }
5853 #endif
5854 return -1;
5855
5856 default:
5857 return -1;
5858 }
5859 }
5860
5861 #endif
5862
5863 int
5864 rsock_tcp_optname_to_int(const char *str, long len, int *valp)
5865 {
5866 switch (len) {
5867 case 4:
5868 #ifdef TCP_CORK
5869 if (memcmp(str, "CORK", 4) == 0) { *valp = TCP_CORK; return 0; }
5870 #endif
5871 #ifdef TCP_INFO
5872 if (memcmp(str, "INFO", 4) == 0) { *valp = TCP_INFO; return 0; }
5873 #endif
5874 return -1;
5875
5876 case 5:
5877 #ifdef TCP_NOOPT
5878 if (memcmp(str, "NOOPT", 5) == 0) { *valp = TCP_NOOPT; return 0; }
5879 #endif
5880 return -1;
5881
5882 case 6:
5883 #ifdef TCP_MAXSEG
5884 if (memcmp(str, "MAXSEG", 6) == 0) { *valp = TCP_MAXSEG; return 0; }
5885 #endif
5886 #ifdef TCP_MD5SIG
5887 if (memcmp(str, "MD5SIG", 6) == 0) { *valp = TCP_MD5SIG; return 0; }
5888 #endif
5889 #ifdef TCP_NOPUSH
5890 if (memcmp(str, "NOPUSH", 6) == 0) { *valp = TCP_NOPUSH; return 0; }
5891 #endif
5892 #ifdef TCP_SYNCNT
5893 if (memcmp(str, "SYNCNT", 6) == 0) { *valp = TCP_SYNCNT; return 0; }
5894 #endif
5895 return -1;
5896
5897 case 7:
5898 #ifdef TCP_NODELAY
5899 if (memcmp(str, "NODELAY", 7) == 0) { *valp = TCP_NODELAY; return 0; }
5900 #endif
5901 #ifdef TCP_KEEPCNT
5902 if (memcmp(str, "KEEPCNT", 7) == 0) { *valp = TCP_KEEPCNT; return 0; }
5903 #endif
5904 #ifdef TCP_LINGER2
5905 if (memcmp(str, "LINGER2", 7) == 0) { *valp = TCP_LINGER2; return 0; }
5906 #endif
5907 return -1;
5908
5909 case 8:
5910 #ifdef TCP_CORK
5911 if (memcmp(str, "TCP_CORK", 8) == 0) { *valp = TCP_CORK; return 0; }
5912 #endif
5913 #ifdef TCP_INFO
5914 if (memcmp(str, "TCP_INFO", 8) == 0) { *valp = TCP_INFO; return 0; }
5915 #endif
5916 #ifdef TCP_KEEPIDLE
5917 if (memcmp(str, "KEEPIDLE", 8) == 0) { *valp = TCP_KEEPIDLE; return 0; }
5918 #endif
5919 #ifdef TCP_QUICKACK
5920 if (memcmp(str, "QUICKACK", 8) == 0) { *valp = TCP_QUICKACK; return 0; }
5921 #endif
5922 #ifdef TCP_FASTOPEN
5923 if (memcmp(str, "FASTOPEN", 8) == 0) { *valp = TCP_FASTOPEN; return 0; }
5924 #endif
5925 return -1;
5926
5927 case 9:
5928 #ifdef TCP_NOOPT
5929 if (memcmp(str, "TCP_NOOPT", 9) == 0) { *valp = TCP_NOOPT; return 0; }
5930 #endif
5931 #ifdef TCP_KEEPINTVL
5932 if (memcmp(str, "KEEPINTVL", 9) == 0) { *valp = TCP_KEEPINTVL; return 0; }
5933 #endif
5934 return -1;
5935
5936 case 10:
5937 #ifdef TCP_MAXSEG
5938 if (memcmp(str, "TCP_MAXSEG", 10) == 0) { *valp = TCP_MAXSEG; return 0; }
5939 #endif
5940 #ifdef TCP_MD5SIG
5941 if (memcmp(str, "TCP_MD5SIG", 10) == 0) { *valp = TCP_MD5SIG; return 0; }
5942 #endif
5943 #ifdef TCP_NOPUSH
5944 if (memcmp(str, "TCP_NOPUSH", 10) == 0) { *valp = TCP_NOPUSH; return 0; }
5945 #endif
5946 #ifdef TCP_SYNCNT
5947 if (memcmp(str, "TCP_SYNCNT", 10) == 0) { *valp = TCP_SYNCNT; return 0; }
5948 #endif
5949 return -1;
5950
5951 case 11:
5952 #ifdef TCP_NODELAY
5953 if (memcmp(str, "TCP_NODELAY", 11) == 0) { *valp = TCP_NODELAY; return 0; }
5954 #endif
5955 #ifdef TCP_KEEPCNT
5956 if (memcmp(str, "TCP_KEEPCNT", 11) == 0) { *valp = TCP_KEEPCNT; return 0; }
5957 #endif
5958 #ifdef TCP_LINGER2
5959 if (memcmp(str, "TCP_LINGER2", 11) == 0) { *valp = TCP_LINGER2; return 0; }
5960 #endif
5961 return -1;
5962
5963 case 12:
5964 #ifdef TCP_KEEPIDLE
5965 if (memcmp(str, "TCP_KEEPIDLE", 12) == 0) { *valp = TCP_KEEPIDLE; return 0; }
5966 #endif
5967 #ifdef TCP_QUICKACK
5968 if (memcmp(str, "TCP_QUICKACK", 12) == 0) { *valp = TCP_QUICKACK; return 0; }
5969 #endif
5970 #ifdef TCP_FASTOPEN
5971 if (memcmp(str, "TCP_FASTOPEN", 12) == 0) { *valp = TCP_FASTOPEN; return 0; }
5972 #endif
5973 #ifdef TCP_DEFER_ACCEPT
5974 if (memcmp(str, "DEFER_ACCEPT", 12) == 0) { *valp = TCP_DEFER_ACCEPT; return 0; }
5975 #endif
5976 #ifdef TCP_WINDOW_CLAMP
5977 if (memcmp(str, "WINDOW_CLAMP", 12) == 0) { *valp = TCP_WINDOW_CLAMP; return 0; }
5978 #endif
5979 return -1;
5980
5981 case 13:
5982 #ifdef TCP_KEEPINTVL
5983 if (memcmp(str, "TCP_KEEPINTVL", 13) == 0) { *valp = TCP_KEEPINTVL; return 0; }
5984 #endif
5985 return -1;
5986
5987 case 16:
5988 #ifdef TCP_DEFER_ACCEPT
5989 if (memcmp(str, "TCP_DEFER_ACCEPT", 16) == 0) { *valp = TCP_DEFER_ACCEPT; return 0; }
5990 #endif
5991 #ifdef TCP_WINDOW_CLAMP
5992 if (memcmp(str, "TCP_WINDOW_CLAMP", 16) == 0) { *valp = TCP_WINDOW_CLAMP; return 0; }
5993 #endif
5994 return -1;
5995
5996 default:
5997 return -1;
5998 }
5999 }
6000
6001
6002 int
6003 rsock_udp_optname_to_int(const char *str, long len, int *valp)
6004 {
6005 switch (len) {
6006 case 4:
6007 #ifdef UDP_CORK
6008 if (memcmp(str, "CORK", 4) == 0) { *valp = UDP_CORK; return 0; }
6009 #endif
6010 return -1;
6011
6012 case 8:
6013 #ifdef UDP_CORK
6014 if (memcmp(str, "UDP_CORK", 8) == 0) { *valp = UDP_CORK; return 0; }
6015 #endif
6016 return -1;
6017
6018 default:
6019 return -1;
6020 }
6021 }
6022
6023
6024 int
6025 rsock_shutdown_how_to_int(const char *str, long len, int *valp)
6026 {
6027 switch (len) {
6028 case 2:
6029 #ifdef SHUT_RD
6030 if (memcmp(str, "RD", 2) == 0) { *valp = SHUT_RD; return 0; }
6031 #endif
6032 #ifdef SHUT_WR
6033 if (memcmp(str, "WR", 2) == 0) { *valp = SHUT_WR; return 0; }
6034 #endif
6035 return -1;
6036
6037 case 4:
6038 #ifdef SHUT_RDWR
6039 if (memcmp(str, "RDWR", 4) == 0) { *valp = SHUT_RDWR; return 0; }
6040 #endif
6041 return -1;
6042
6043 case 7:
6044 #ifdef SHUT_RD
6045 if (memcmp(str, "SHUT_RD", 7) == 0) { *valp = SHUT_RD; return 0; }
6046 #endif
6047 #ifdef SHUT_WR
6048 if (memcmp(str, "SHUT_WR", 7) == 0) { *valp = SHUT_WR; return 0; }
6049 #endif
6050 return -1;
6051
6052 case 9:
6053 #ifdef SHUT_RDWR
6054 if (memcmp(str, "SHUT_RDWR", 9) == 0) { *valp = SHUT_RDWR; return 0; }
6055 #endif
6056 return -1;
6057
6058 default:
6059 return -1;
6060 }
6061 }
6062
6063
6064 int
6065 rsock_scm_optname_to_int(const char *str, long len, int *valp)
6066 {
6067 switch (len) {
6068 case 5:
6069 #ifdef SCM_CREDS
6070 if (memcmp(str, "CREDS", 5) == 0) { *valp = SCM_CREDS; return 0; }
6071 #endif
6072 #ifdef SCM_UCRED
6073 if (memcmp(str, "UCRED", 5) == 0) { *valp = SCM_UCRED; return 0; }
6074 #endif
6075 return -1;
6076
6077 case 6:
6078 #ifdef SCM_RIGHTS
6079 if (memcmp(str, "RIGHTS", 6) == 0) { *valp = SCM_RIGHTS; return 0; }
6080 #endif
6081 return -1;
6082
6083 case 7:
6084 #ifdef SCM_BINTIME
6085 if (memcmp(str, "BINTIME", 7) == 0) { *valp = SCM_BINTIME; return 0; }
6086 #endif
6087 return -1;
6088
6089 case 9:
6090 #ifdef SCM_CREDS
6091 if (memcmp(str, "SCM_CREDS", 9) == 0) { *valp = SCM_CREDS; return 0; }
6092 #endif
6093 #ifdef SCM_UCRED
6094 if (memcmp(str, "SCM_UCRED", 9) == 0) { *valp = SCM_UCRED; return 0; }
6095 #endif
6096 #ifdef SCM_TIMESTAMP
6097 if (memcmp(str, "TIMESTAMP", 9) == 0) { *valp = SCM_TIMESTAMP; return 0; }
6098 #endif
6099 return -1;
6100
6101 case 10:
6102 #ifdef SCM_RIGHTS
6103 if (memcmp(str, "SCM_RIGHTS", 10) == 0) { *valp = SCM_RIGHTS; return 0; }
6104 #endif
6105 return -1;
6106
6107 case 11:
6108 #ifdef SCM_BINTIME
6109 if (memcmp(str, "SCM_BINTIME", 11) == 0) { *valp = SCM_BINTIME; return 0; }
6110 #endif
6111 #ifdef SCM_TIMESTAMPNS
6112 if (memcmp(str, "TIMESTAMPNS", 11) == 0) { *valp = SCM_TIMESTAMPNS; return 0; }
6113 #endif
6114 #ifdef SCM_CREDENTIALS
6115 if (memcmp(str, "CREDENTIALS", 11) == 0) { *valp = SCM_CREDENTIALS; return 0; }
6116 #endif
6117 return -1;
6118
6119 case 13:
6120 #ifdef SCM_TIMESTAMP
6121 if (memcmp(str, "SCM_TIMESTAMP", 13) == 0) { *valp = SCM_TIMESTAMP; return 0; }
6122 #endif
6123 return -1;
6124
6125 case 15:
6126 #ifdef SCM_TIMESTAMPNS
6127 if (memcmp(str, "SCM_TIMESTAMPNS", 15) == 0) { *valp = SCM_TIMESTAMPNS; return 0; }
6128 #endif
6129 #ifdef SCM_CREDENTIALS
6130 if (memcmp(str, "SCM_CREDENTIALS", 15) == 0) { *valp = SCM_CREDENTIALS; return 0; }
6131 #endif
6132 return -1;
6133
6134 default:
6135 return -1;
6136 }
6137 }
6138
6139
6140
6141 ID
6142 rsock_intern_family(int val)
6143 {
6144 st_data_t name;
6145 if (st_lookup(rsock_intern_family_hash, (st_data_t)val, &name))
6146 return (ID)name;
6147 return 0;
6148 }
6149
6150 ID
6151 rsock_intern_family_noprefix(int val)
6152 {
6153 st_data_t name;
6154 if (st_lookup(rsock_intern_family_noprefix_hash, (st_data_t)val, &name))
6155 return (ID)name;
6156 return 0;
6157 }
6158
6159 ID
6160 rsock_intern_protocol_family(int val)
6161 {
6162 st_data_t name;
6163 if (st_lookup(rsock_intern_protocol_family_hash, (st_data_t)val, &name))
6164 return (ID)name;
6165 return 0;
6166 }
6167
6168 ID
6169 rsock_intern_socktype(int val)
6170 {
6171 st_data_t name;
6172 if (st_lookup(rsock_intern_socktype_hash, (st_data_t)val, &name))
6173 return (ID)name;
6174 return 0;
6175 }
6176
6177 ID
6178 rsock_intern_ipproto(int val)
6179 {
6180 st_data_t name;
6181 if (st_lookup(rsock_intern_ipproto_hash, (st_data_t)val, &name))
6182 return (ID)name;
6183 return 0;
6184 }
6185
6186 ID
6187 rsock_intern_iplevel(int val)
6188 {
6189 st_data_t name;
6190 if (st_lookup(rsock_intern_iplevel_hash, (st_data_t)val, &name))
6191 return (ID)name;
6192 return 0;
6193 }
6194
6195 ID
6196 rsock_intern_so_optname(int val)
6197 {
6198 st_data_t name;
6199 if (st_lookup(rsock_intern_so_optname_hash, (st_data_t)val, &name))
6200 return (ID)name;
6201 return 0;
6202 }
6203
6204 ID
6205 rsock_intern_ip_optname(int val)
6206 {
6207 st_data_t name;
6208 if (st_lookup(rsock_intern_ip_optname_hash, (st_data_t)val, &name))
6209 return (ID)name;
6210 return 0;
6211 }
6212
6213 ID
6214 rsock_intern_ipv6_optname(int val)
6215 {
6216 st_data_t name;
6217 if (st_lookup(rsock_intern_ipv6_optname_hash, (st_data_t)val, &name))
6218 return (ID)name;
6219 return 0;
6220 }
6221
6222 ID
6223 rsock_intern_tcp_optname(int val)
6224 {
6225 st_data_t name;
6226 if (st_lookup(rsock_intern_tcp_optname_hash, (st_data_t)val, &name))
6227 return (ID)name;
6228 return 0;
6229 }
6230
6231 ID
6232 rsock_intern_udp_optname(int val)
6233 {
6234 st_data_t name;
6235 if (st_lookup(rsock_intern_udp_optname_hash, (st_data_t)val, &name))
6236 return (ID)name;
6237 return 0;
6238 }
6239
6240 ID
6241 rsock_intern_scm_optname(int val)
6242 {
6243 st_data_t name;
6244 if (st_lookup(rsock_intern_scm_optname_hash, (st_data_t)val, &name))
6245 return (ID)name;
6246 return 0;
6247 }
6248
6249 ID
6250 rsock_intern_local_optname(int val)
6251 {
6252 st_data_t name;
6253 if (st_lookup(rsock_intern_local_optname_hash, (st_data_t)val, &name))
6254 return (ID)name;
6255 return 0;
6256 }
6257
6258
EAI_MAX
#define EAI_MAX
Definition: addrinfo.h:91
IPPORT_USERRESERVED
#define IPPORT_USERRESERVED
Definition: constdefs.h:733
init_constants
static void init_constants(void)
Definition: constdefs.c:30
rsock_intern_family_noprefix
ID rsock_intern_family_noprefix(int val)
Definition: constdefs.c:6151
SOMAXCONN
#define SOMAXCONN
Definition: constdefs.h:1704
st_table
Definition: st.h:69
PF_INET
#define PF_INET
Definition: sockport.h:109
rsock_intern_scm_optname
ID rsock_intern_scm_optname(int val)
Definition: constdefs.c:6241
EAI_BADFLAGS
#define EAI_BADFLAGS
Definition: addrinfo.h:80
rsock_intern_socktype_hash
static st_table * rsock_intern_socktype_hash
Definition: constdefs.c:6
INADDR_MAX_LOCAL_GROUP
#define INADDR_MAX_LOCAL_GROUP
Definition: constdefs.h:775
rsock_udp_optname_to_int
int rsock_udp_optname_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:6003
NI_DGRAM
#define NI_DGRAM
Definition: addrinfo.h:128
INTEGER2NUM
#define INTEGER2NUM(n)
Definition: constdefs.c:23
rb_mSockConst
static VALUE rb_mSockConst
Definition: constants.c:13
st_insert
int st_insert(st_table *, st_data_t, st_data_t)
SHUT_RDWR
#define SHUT_RDWR
Definition: constdefs.h:1538
INET_ADDRSTRLEN
#define INET_ADDRSTRLEN
Definition: constdefs.h:1680
rsock_intern_local_optname_hash
static st_table * rsock_intern_local_optname_hash
Definition: constdefs.c:15
INADDR_ALLHOSTS_GROUP
#define INADDR_ALLHOSTS_GROUP
Definition: constdefs.h:768
INADDR_UNSPEC_GROUP
#define INADDR_UNSPEC_GROUP
Definition: constdefs.h:761
rsock_intern_ipv6_optname_hash
static st_table * rsock_intern_ipv6_optname_hash
Definition: constdefs.c:11
rsock_intern_so_optname
ID rsock_intern_so_optname(int val)
Definition: constdefs.c:6196
rsock_intern_protocol_family_hash
static st_table * rsock_intern_protocol_family_hash
Definition: constdefs.c:5
rsock_intern_ipproto
ID rsock_intern_ipproto(int val)
Definition: constdefs.c:6178
IPPROTO_RAW
#define IPPROTO_RAW
Definition: constdefs.h:714
rsock_intern_family_noprefix_hash
static st_table * rsock_intern_family_noprefix_hash
Definition: constdefs.c:4
rsock_intern_udp_optname_hash
static st_table * rsock_intern_udp_optname_hash
Definition: constdefs.c:13
AI_PASSIVE
#define AI_PASSIVE
Definition: addrinfo.h:96
AI_V4MAPPED_CFG
#define AI_V4MAPPED_CFG
Definition: addrinfo.h:107
rsock_intern_tcp_optname_hash
static st_table * rsock_intern_tcp_optname_hash
Definition: constdefs.c:12
rsock_so_optname_to_int
int rsock_so_optname_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:5004
AI_CANONNAME
#define AI_CANONNAME
Definition: addrinfo.h:97
IPPORT_RESERVED
#define IPPORT_RESERVED
Definition: constdefs.h:726
NI_MAXSERV
#define NI_MAXSERV
Definition: addrinfo.h:118
INADDR_LOOPBACK
#define INADDR_LOOPBACK
Definition: constdefs.h:754
st_data_t
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
Definition: st.h:20
IPPROTO_TCP
#define IPPROTO_TCP
Definition: constdefs.h:610
st_lookup
int st_lookup(st_table *, st_data_t, st_data_t *)
INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN
Definition: constdefs.h:1687
rsock_intern_scm_optname_hash
static st_table * rsock_intern_scm_optname_hash
Definition: constdefs.c:14
rsock_ipproto_to_int
int rsock_ipproto_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:4560
val
#define val
EAI_PROTOCOL
#define EAI_PROTOCOL
Definition: addrinfo.h:90
rsock_intern_ip_optname_hash
static st_table * rsock_intern_ip_optname_hash
Definition: constdefs.c:10
EAI_AGAIN
#define EAI_AGAIN
Definition: addrinfo.h:79
NI_NUMERICSERV
#define NI_NUMERICSERV
Definition: addrinfo.h:127
EAI_FAMILY
#define EAI_FAMILY
Definition: addrinfo.h:82
EAI_MEMORY
#define EAI_MEMORY
Definition: addrinfo.h:83
rb_define_const
void rb_define_const(VALUE, const char *, VALUE)
Definition: variable.c:2225
rsock_intern_ipproto_hash
static st_table * rsock_intern_ipproto_hash
Definition: constdefs.c:7
IPPROTO_UDP
#define IPPROTO_UDP
Definition: constdefs.h:627
rsock_intern_protocol_family
ID rsock_intern_protocol_family(int val)
Definition: constdefs.c:6160
EAI_SOCKTYPE
#define EAI_SOCKTYPE
Definition: addrinfo.h:87
rsock_unknown_level_to_int
int rsock_unknown_level_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:4768
EAI_SYSTEM
#define EAI_SYSTEM
Definition: addrinfo.h:88
rsock_family_to_int
int rsock_family_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:4096
rb_cSocket
VALUE rb_cSocket
Definition: init.c:22
AI_DEFAULT
#define AI_DEFAULT
Definition: addrinfo.h:111
SHUT_RD
#define SHUT_RD
Definition: constdefs.h:1524
rsock_socktype_to_int
int rsock_socktype_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:4490
AI_ADDRCONFIG
#define AI_ADDRCONFIG
Definition: addrinfo.h:108
rsock_intern_iplevel
ID rsock_intern_iplevel(int val)
Definition: constdefs.c:6187
AI_V4MAPPED
#define AI_V4MAPPED
Definition: addrinfo.h:109
EAI_ADDRFAMILY
#define EAI_ADDRFAMILY
Definition: addrinfo.h:78
NI_NUMERICHOST
#define NI_NUMERICHOST
Definition: addrinfo.h:125
ID
unsigned long ID
Definition: ruby.h:89
rsock_intern_family
ID rsock_intern_family(int val)
Definition: constdefs.c:6142
INADDR_BROADCAST
#define INADDR_BROADCAST
Definition: constdefs.h:747
rsock_intern_tcp_optname
ID rsock_intern_tcp_optname(int val)
Definition: constdefs.c:6223
EAI_BADHINTS
#define EAI_BADHINTS
Definition: addrinfo.h:89
AI_NUMERICHOST
#define AI_NUMERICHOST
Definition: addrinfo.h:98
rsock_intern_local_optname
ID rsock_intern_local_optname(int val)
Definition: constdefs.c:6250
rsock_shutdown_how_to_int
int rsock_shutdown_how_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:6025
memcmp
int memcmp(const void *s1, const void *s2, size_t len)
Definition: memcmp.c:7
rsock_intern_socktype
ID rsock_intern_socktype(int val)
Definition: constdefs.c:6169
rsock_intern_family_hash
static st_table * rsock_intern_family_hash
Definition: constdefs.c:3
st_init_numtable
st_table * st_init_numtable(void)
Definition: st.c:272
AI_ALL
#define AI_ALL
Definition: addrinfo.h:106
IPPROTO_ICMP
#define IPPROTO_ICMP
Definition: constdefs.h:593
rb_define_module_under
VALUE rb_define_module_under(VALUE outer, const char *name)
Definition: class.c:766
INADDR_ANY
#define INADDR_ANY
Definition: constdefs.h:740
AI_NUMERICSERV
#define AI_NUMERICSERV
Definition: addrinfo.h:99
rsock_intern_iplevel_hash
static st_table * rsock_intern_iplevel_hash
Definition: constdefs.c:8
EAI_FAIL
#define EAI_FAIL
Definition: addrinfo.h:81
rsock_tcp_optname_to_int
int rsock_tcp_optname_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:5864
PF_UNSPEC
#define PF_UNSPEC
Definition: sockport.h:105
rsock_ip_level_to_int
int rsock_ip_level_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:4790
EAI_SERVICE
#define EAI_SERVICE
Definition: addrinfo.h:86
NI_NOFQDN
#define NI_NOFQDN
Definition: addrinfo.h:124
AF_UNSPEC
#define AF_UNSPEC
Definition: sockport.h:101
rsock_intern_udp_optname
ID rsock_intern_udp_optname(int val)
Definition: constdefs.c:6232
AI_MASK
#define AI_MASK
Definition: addrinfo.h:103
name
const char * name
Definition: nkf.c:208
rsock_ip_optname_to_int
int rsock_ip_optname_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:5326
IFNAMSIZ
#define IFNAMSIZ
EAI_NONAME
#define EAI_NONAME
Definition: addrinfo.h:85
NI_NAMEREQD
#define NI_NAMEREQD
Definition: addrinfo.h:126
rsock_scm_optname_to_int
int rsock_scm_optname_to_int(const char *str, long len, int *valp)
Definition: constdefs.c:6065
IPPROTO_IP
#define IPPROTO_IP
Definition: constdefs.h:586
rsock_intern_ipv6_optname
ID rsock_intern_ipv6_optname(int val)
Definition: constdefs.c:6214
rsock_intern_so_optname_hash
static st_table * rsock_intern_so_optname_hash
Definition: constdefs.c:9
rb_intern2
ID rb_intern2(const char *name, long len)
Definition: ripper.c:17137
SHUT_WR
#define SHUT_WR
Definition: constdefs.h:1531
EAI_NODATA
#define EAI_NODATA
Definition: addrinfo.h:84
NI_MAXHOST
#define NI_MAXHOST
Definition: addrinfo.h:117
INADDR_NONE
#define INADDR_NONE
Definition: constdefs.h:782
rsock_intern_ip_optname
ID rsock_intern_ip_optname(int val)
Definition: constdefs.c:6205