Project

General

Profile

Bug #5680 » constdefs.c

autogenerated ext/socket/constdefs.c - duerst (Martin Dürst), 11/28/2011 08:09 PM

 
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
static void
18
init_constants(void)
19
{
20
    /*
21
     * Document-module: Socket::Constants
22
     *
23
     * Socket::Constants provides socket-related constants.  All possible
24
     * socket constants are listed in the documentation but they may not all
25
     * be present on your platform.
26
     *
27
     * If the underlying platform doesn't define a constant the corresponding
28
     * Ruby constant is not defined.
29
     *
30
     */
31
    rb_mSockConst = rb_define_module_under(rb_cSocket, "Constants");
32

    
33
#if defined(SOCK_STREAM)
34
    /* A stream socket provides a sequenced, reliable two-way connection for a byte stream */
35
    rb_define_const(rb_cSocket, "SOCK_STREAM", INT2NUM(SOCK_STREAM));
36
    /* A stream socket provides a sequenced, reliable two-way connection for a byte stream */
37
    rb_define_const(rb_mSockConst, "SOCK_STREAM", INT2NUM(SOCK_STREAM));
38
#endif
39
#if defined(SOCK_DGRAM)
40
    /* A datagram socket provides connectionless, unreliable messaging */
41
    rb_define_const(rb_cSocket, "SOCK_DGRAM", INT2NUM(SOCK_DGRAM));
42
    /* A datagram socket provides connectionless, unreliable messaging */
43
    rb_define_const(rb_mSockConst, "SOCK_DGRAM", INT2NUM(SOCK_DGRAM));
44
#endif
45
#if defined(SOCK_RAW)
46
    /* A raw socket provides low-level access for direct access or implementing network protocols */
47
    rb_define_const(rb_cSocket, "SOCK_RAW", INT2NUM(SOCK_RAW));
48
    /* A raw socket provides low-level access for direct access or implementing network protocols */
49
    rb_define_const(rb_mSockConst, "SOCK_RAW", INT2NUM(SOCK_RAW));
50
#endif
51
#if defined(SOCK_RDM)
52
    /* A reliable datagram socket provides reliable delivery of messages */
53
    rb_define_const(rb_cSocket, "SOCK_RDM", INT2NUM(SOCK_RDM));
54
    /* A reliable datagram socket provides reliable delivery of messages */
55
    rb_define_const(rb_mSockConst, "SOCK_RDM", INT2NUM(SOCK_RDM));
56
#endif
57
#if defined(SOCK_SEQPACKET)
58
    /* A sequential packet socket provides sequenced, reliable two-way connection for datagrams */
59
    rb_define_const(rb_cSocket, "SOCK_SEQPACKET", INT2NUM(SOCK_SEQPACKET));
60
    /* A sequential packet socket provides sequenced, reliable two-way connection for datagrams */
61
    rb_define_const(rb_mSockConst, "SOCK_SEQPACKET", INT2NUM(SOCK_SEQPACKET));
62
#endif
63
#if defined(SOCK_PACKET)
64
    /* Device-level packet access */
65
    rb_define_const(rb_cSocket, "SOCK_PACKET", INT2NUM(SOCK_PACKET));
66
    /* Device-level packet access */
67
    rb_define_const(rb_mSockConst, "SOCK_PACKET", INT2NUM(SOCK_PACKET));
68
#endif
69
#if defined(AF_UNSPEC)
70
    /* Unspecified protocol, any supported address family */
71
    rb_define_const(rb_cSocket, "AF_UNSPEC", INT2NUM(AF_UNSPEC));
72
    /* Unspecified protocol, any supported address family */
73
    rb_define_const(rb_mSockConst, "AF_UNSPEC", INT2NUM(AF_UNSPEC));
74
#endif
75
#if defined(PF_UNSPEC)
76
    /* Unspecified protocol, any supported address family */
77
    rb_define_const(rb_cSocket, "PF_UNSPEC", INT2NUM(PF_UNSPEC));
78
    /* Unspecified protocol, any supported address family */
79
    rb_define_const(rb_mSockConst, "PF_UNSPEC", INT2NUM(PF_UNSPEC));
80
#endif
81
#if defined(AF_INET)
82
    /* IPv4 protocol */
83
    rb_define_const(rb_cSocket, "AF_INET", INT2NUM(AF_INET));
84
    /* IPv4 protocol */
85
    rb_define_const(rb_mSockConst, "AF_INET", INT2NUM(AF_INET));
86
#endif
87
#if defined(PF_INET)
88
    /* IPv4 protocol */
89
    rb_define_const(rb_cSocket, "PF_INET", INT2NUM(PF_INET));
90
    /* IPv4 protocol */
91
    rb_define_const(rb_mSockConst, "PF_INET", INT2NUM(PF_INET));
92
#endif
93
#if defined(INET6)
94
#if defined(AF_INET6)
95
    /* IPv6 protocol */
96
    rb_define_const(rb_cSocket, "AF_INET6", INT2NUM(AF_INET6));
97
    /* IPv6 protocol */
98
    rb_define_const(rb_mSockConst, "AF_INET6", INT2NUM(AF_INET6));
99
#endif
100
#endif
101
#if defined(INET6)
102
#if defined(PF_INET6)
103
    /* IPv6 protocol */
104
    rb_define_const(rb_cSocket, "PF_INET6", INT2NUM(PF_INET6));
105
    /* IPv6 protocol */
106
    rb_define_const(rb_mSockConst, "PF_INET6", INT2NUM(PF_INET6));
107
#endif
108
#endif
109
#if defined(AF_UNIX)
110
    /* UNIX sockets */
111
    rb_define_const(rb_cSocket, "AF_UNIX", INT2NUM(AF_UNIX));
112
    /* UNIX sockets */
113
    rb_define_const(rb_mSockConst, "AF_UNIX", INT2NUM(AF_UNIX));
114
#endif
115
#if defined(PF_UNIX)
116
    /* UNIX sockets */
117
    rb_define_const(rb_cSocket, "PF_UNIX", INT2NUM(PF_UNIX));
118
    /* UNIX sockets */
119
    rb_define_const(rb_mSockConst, "PF_UNIX", INT2NUM(PF_UNIX));
120
#endif
121
#if defined(AF_AX25)
122
    /* AX.25 protocol */
123
    rb_define_const(rb_cSocket, "AF_AX25", INT2NUM(AF_AX25));
124
    /* AX.25 protocol */
125
    rb_define_const(rb_mSockConst, "AF_AX25", INT2NUM(AF_AX25));
126
#endif
127
#if defined(PF_AX25)
128
    /* AX.25 protocol */
129
    rb_define_const(rb_cSocket, "PF_AX25", INT2NUM(PF_AX25));
130
    /* AX.25 protocol */
131
    rb_define_const(rb_mSockConst, "PF_AX25", INT2NUM(PF_AX25));
132
#endif
133
#if defined(AF_IPX)
134
    /* IPX protocol */
135
    rb_define_const(rb_cSocket, "AF_IPX", INT2NUM(AF_IPX));
136
    /* IPX protocol */
137
    rb_define_const(rb_mSockConst, "AF_IPX", INT2NUM(AF_IPX));
138
#endif
139
#if defined(PF_IPX)
140
    /* IPX protocol */
141
    rb_define_const(rb_cSocket, "PF_IPX", INT2NUM(PF_IPX));
142
    /* IPX protocol */
143
    rb_define_const(rb_mSockConst, "PF_IPX", INT2NUM(PF_IPX));
144
#endif
145
#if defined(AF_APPLETALK)
146
    /* AppleTalk protocol */
147
    rb_define_const(rb_cSocket, "AF_APPLETALK", INT2NUM(AF_APPLETALK));
148
    /* AppleTalk protocol */
149
    rb_define_const(rb_mSockConst, "AF_APPLETALK", INT2NUM(AF_APPLETALK));
150
#endif
151
#if defined(PF_APPLETALK)
152
    /* AppleTalk protocol */
153
    rb_define_const(rb_cSocket, "PF_APPLETALK", INT2NUM(PF_APPLETALK));
154
    /* AppleTalk protocol */
155
    rb_define_const(rb_mSockConst, "PF_APPLETALK", INT2NUM(PF_APPLETALK));
156
#endif
157
#if defined(AF_LOCAL)
158
    /* Host-internal protocols */
159
    rb_define_const(rb_cSocket, "AF_LOCAL", INT2NUM(AF_LOCAL));
160
    /* Host-internal protocols */
161
    rb_define_const(rb_mSockConst, "AF_LOCAL", INT2NUM(AF_LOCAL));
162
#endif
163
#if defined(PF_LOCAL)
164
    /* Host-internal protocols */
165
    rb_define_const(rb_cSocket, "PF_LOCAL", INT2NUM(PF_LOCAL));
166
    /* Host-internal protocols */
167
    rb_define_const(rb_mSockConst, "PF_LOCAL", INT2NUM(PF_LOCAL));
168
#endif
169
#if defined(AF_IMPLINK)
170
    /* ARPANET IMP protocol */
171
    rb_define_const(rb_cSocket, "AF_IMPLINK", INT2NUM(AF_IMPLINK));
172
    /* ARPANET IMP protocol */
173
    rb_define_const(rb_mSockConst, "AF_IMPLINK", INT2NUM(AF_IMPLINK));
174
#endif
175
#if defined(PF_IMPLINK)
176
    /* ARPANET IMP protocol */
177
    rb_define_const(rb_cSocket, "PF_IMPLINK", INT2NUM(PF_IMPLINK));
178
    /* ARPANET IMP protocol */
179
    rb_define_const(rb_mSockConst, "PF_IMPLINK", INT2NUM(PF_IMPLINK));
180
#endif
181
#if defined(AF_PUP)
182
    /* PARC Universal Packet protocol */
183
    rb_define_const(rb_cSocket, "AF_PUP", INT2NUM(AF_PUP));
184
    /* PARC Universal Packet protocol */
185
    rb_define_const(rb_mSockConst, "AF_PUP", INT2NUM(AF_PUP));
186
#endif
187
#if defined(PF_PUP)
188
    /* PARC Universal Packet protocol */
189
    rb_define_const(rb_cSocket, "PF_PUP", INT2NUM(PF_PUP));
190
    /* PARC Universal Packet protocol */
191
    rb_define_const(rb_mSockConst, "PF_PUP", INT2NUM(PF_PUP));
192
#endif
193
#if defined(AF_CHAOS)
194
    /* MIT CHAOS protocols */
195
    rb_define_const(rb_cSocket, "AF_CHAOS", INT2NUM(AF_CHAOS));
196
    /* MIT CHAOS protocols */
197
    rb_define_const(rb_mSockConst, "AF_CHAOS", INT2NUM(AF_CHAOS));
198
#endif
199
#if defined(PF_CHAOS)
200
    /* MIT CHAOS protocols */
201
    rb_define_const(rb_cSocket, "PF_CHAOS", INT2NUM(PF_CHAOS));
202
    /* MIT CHAOS protocols */
203
    rb_define_const(rb_mSockConst, "PF_CHAOS", INT2NUM(PF_CHAOS));
204
#endif
205
#if defined(AF_NS)
206
    /* XEROX NS protocols */
207
    rb_define_const(rb_cSocket, "AF_NS", INT2NUM(AF_NS));
208
    /* XEROX NS protocols */
209
    rb_define_const(rb_mSockConst, "AF_NS", INT2NUM(AF_NS));
210
#endif
211
#if defined(PF_NS)
212
    /* XEROX NS protocols */
213
    rb_define_const(rb_cSocket, "PF_NS", INT2NUM(PF_NS));
214
    /* XEROX NS protocols */
215
    rb_define_const(rb_mSockConst, "PF_NS", INT2NUM(PF_NS));
216
#endif
217
#if defined(AF_ISO)
218
    /* ISO Open Systems Interconnection protocols */
219
    rb_define_const(rb_cSocket, "AF_ISO", INT2NUM(AF_ISO));
220
    /* ISO Open Systems Interconnection protocols */
221
    rb_define_const(rb_mSockConst, "AF_ISO", INT2NUM(AF_ISO));
222
#endif
223
#if defined(PF_ISO)
224
    /* ISO Open Systems Interconnection protocols */
225
    rb_define_const(rb_cSocket, "PF_ISO", INT2NUM(PF_ISO));
226
    /* ISO Open Systems Interconnection protocols */
227
    rb_define_const(rb_mSockConst, "PF_ISO", INT2NUM(PF_ISO));
228
#endif
229
#if defined(AF_OSI)
230
    /* ISO Open Systems Interconnection protocols */
231
    rb_define_const(rb_cSocket, "AF_OSI", INT2NUM(AF_OSI));
232
    /* ISO Open Systems Interconnection protocols */
233
    rb_define_const(rb_mSockConst, "AF_OSI", INT2NUM(AF_OSI));
234
#endif
235
#if defined(PF_OSI)
236
    /* ISO Open Systems Interconnection protocols */
237
    rb_define_const(rb_cSocket, "PF_OSI", INT2NUM(PF_OSI));
238
    /* ISO Open Systems Interconnection protocols */
239
    rb_define_const(rb_mSockConst, "PF_OSI", INT2NUM(PF_OSI));
240
#endif
241
#if defined(AF_ECMA)
242
    /* European Computer Manufacturers protocols */
243
    rb_define_const(rb_cSocket, "AF_ECMA", INT2NUM(AF_ECMA));
244
    /* European Computer Manufacturers protocols */
245
    rb_define_const(rb_mSockConst, "AF_ECMA", INT2NUM(AF_ECMA));
246
#endif
247
#if defined(PF_ECMA)
248
    /* European Computer Manufacturers protocols */
249
    rb_define_const(rb_cSocket, "PF_ECMA", INT2NUM(PF_ECMA));
250
    /* European Computer Manufacturers protocols */
251
    rb_define_const(rb_mSockConst, "PF_ECMA", INT2NUM(PF_ECMA));
252
#endif
253
#if defined(AF_DATAKIT)
254
    /* Datakit protocol */
255
    rb_define_const(rb_cSocket, "AF_DATAKIT", INT2NUM(AF_DATAKIT));
256
    /* Datakit protocol */
257
    rb_define_const(rb_mSockConst, "AF_DATAKIT", INT2NUM(AF_DATAKIT));
258
#endif
259
#if defined(PF_DATAKIT)
260
    /* Datakit protocol */
261
    rb_define_const(rb_cSocket, "PF_DATAKIT", INT2NUM(PF_DATAKIT));
262
    /* Datakit protocol */
263
    rb_define_const(rb_mSockConst, "PF_DATAKIT", INT2NUM(PF_DATAKIT));
264
#endif
265
#if defined(AF_CCITT)
266
    /* CCITT (now ITU-T) protocols */
267
    rb_define_const(rb_cSocket, "AF_CCITT", INT2NUM(AF_CCITT));
268
    /* CCITT (now ITU-T) protocols */
269
    rb_define_const(rb_mSockConst, "AF_CCITT", INT2NUM(AF_CCITT));
270
#endif
271
#if defined(PF_CCITT)
272
    /* CCITT (now ITU-T) protocols */
273
    rb_define_const(rb_cSocket, "PF_CCITT", INT2NUM(PF_CCITT));
274
    /* CCITT (now ITU-T) protocols */
275
    rb_define_const(rb_mSockConst, "PF_CCITT", INT2NUM(PF_CCITT));
276
#endif
277
#if defined(AF_SNA)
278
    /* IBM SNA protocol */
279
    rb_define_const(rb_cSocket, "AF_SNA", INT2NUM(AF_SNA));
280
    /* IBM SNA protocol */
281
    rb_define_const(rb_mSockConst, "AF_SNA", INT2NUM(AF_SNA));
282
#endif
283
#if defined(PF_SNA)
284
    /* IBM SNA protocol */
285
    rb_define_const(rb_cSocket, "PF_SNA", INT2NUM(PF_SNA));
286
    /* IBM SNA protocol */
287
    rb_define_const(rb_mSockConst, "PF_SNA", INT2NUM(PF_SNA));
288
#endif
289
#if defined(AF_DEC)
290
    /* DECnet protocol */
291
    rb_define_const(rb_cSocket, "AF_DEC", INT2NUM(AF_DEC));
292
    /* DECnet protocol */
293
    rb_define_const(rb_mSockConst, "AF_DEC", INT2NUM(AF_DEC));
294
#endif
295
#if defined(PF_DEC)
296
    /* DECnet protocol */
297
    rb_define_const(rb_cSocket, "PF_DEC", INT2NUM(PF_DEC));
298
    /* DECnet protocol */
299
    rb_define_const(rb_mSockConst, "PF_DEC", INT2NUM(PF_DEC));
300
#endif
301
#if defined(AF_DLI)
302
    /* DEC Direct Data Link Interface protocol */
303
    rb_define_const(rb_cSocket, "AF_DLI", INT2NUM(AF_DLI));
304
    /* DEC Direct Data Link Interface protocol */
305
    rb_define_const(rb_mSockConst, "AF_DLI", INT2NUM(AF_DLI));
306
#endif
307
#if defined(PF_DLI)
308
    /* DEC Direct Data Link Interface protocol */
309
    rb_define_const(rb_cSocket, "PF_DLI", INT2NUM(PF_DLI));
310
    /* DEC Direct Data Link Interface protocol */
311
    rb_define_const(rb_mSockConst, "PF_DLI", INT2NUM(PF_DLI));
312
#endif
313
#if defined(AF_LAT)
314
    /* Local Area Transport protocol */
315
    rb_define_const(rb_cSocket, "AF_LAT", INT2NUM(AF_LAT));
316
    /* Local Area Transport protocol */
317
    rb_define_const(rb_mSockConst, "AF_LAT", INT2NUM(AF_LAT));
318
#endif
319
#if defined(PF_LAT)
320
    /* Local Area Transport protocol */
321
    rb_define_const(rb_cSocket, "PF_LAT", INT2NUM(PF_LAT));
322
    /* Local Area Transport protocol */
323
    rb_define_const(rb_mSockConst, "PF_LAT", INT2NUM(PF_LAT));
324
#endif
325
#if defined(AF_HYLINK)
326
    /* NSC Hyperchannel protocol */
327
    rb_define_const(rb_cSocket, "AF_HYLINK", INT2NUM(AF_HYLINK));
328
    /* NSC Hyperchannel protocol */
329
    rb_define_const(rb_mSockConst, "AF_HYLINK", INT2NUM(AF_HYLINK));
330
#endif
331
#if defined(PF_HYLINK)
332
    /* NSC Hyperchannel protocol */
333
    rb_define_const(rb_cSocket, "PF_HYLINK", INT2NUM(PF_HYLINK));
334
    /* NSC Hyperchannel protocol */
335
    rb_define_const(rb_mSockConst, "PF_HYLINK", INT2NUM(PF_HYLINK));
336
#endif
337
#if defined(AF_ROUTE)
338
    /* Internal routing protocol */
339
    rb_define_const(rb_cSocket, "AF_ROUTE", INT2NUM(AF_ROUTE));
340
    /* Internal routing protocol */
341
    rb_define_const(rb_mSockConst, "AF_ROUTE", INT2NUM(AF_ROUTE));
342
#endif
343
#if defined(PF_ROUTE)
344
    /* Internal routing protocol */
345
    rb_define_const(rb_cSocket, "PF_ROUTE", INT2NUM(PF_ROUTE));
346
    /* Internal routing protocol */
347
    rb_define_const(rb_mSockConst, "PF_ROUTE", INT2NUM(PF_ROUTE));
348
#endif
349
#if defined(AF_LINK)
350
    /* Link layer interface */
351
    rb_define_const(rb_cSocket, "AF_LINK", INT2NUM(AF_LINK));
352
    /* Link layer interface */
353
    rb_define_const(rb_mSockConst, "AF_LINK", INT2NUM(AF_LINK));
354
#endif
355
#if defined(PF_LINK)
356
    /* Link layer interface */
357
    rb_define_const(rb_cSocket, "PF_LINK", INT2NUM(PF_LINK));
358
    /* Link layer interface */
359
    rb_define_const(rb_mSockConst, "PF_LINK", INT2NUM(PF_LINK));
360
#endif
361
#if defined(AF_COIP)
362
    /* Connection-oriented IP */
363
    rb_define_const(rb_cSocket, "AF_COIP", INT2NUM(AF_COIP));
364
    /* Connection-oriented IP */
365
    rb_define_const(rb_mSockConst, "AF_COIP", INT2NUM(AF_COIP));
366
#endif
367
#if defined(PF_COIP)
368
    /* Connection-oriented IP */
369
    rb_define_const(rb_cSocket, "PF_COIP", INT2NUM(PF_COIP));
370
    /* Connection-oriented IP */
371
    rb_define_const(rb_mSockConst, "PF_COIP", INT2NUM(PF_COIP));
372
#endif
373
#if defined(AF_CNT)
374
    /* Computer Network Technology */
375
    rb_define_const(rb_cSocket, "AF_CNT", INT2NUM(AF_CNT));
376
    /* Computer Network Technology */
377
    rb_define_const(rb_mSockConst, "AF_CNT", INT2NUM(AF_CNT));
378
#endif
379
#if defined(PF_CNT)
380
    /* Computer Network Technology */
381
    rb_define_const(rb_cSocket, "PF_CNT", INT2NUM(PF_CNT));
382
    /* Computer Network Technology */
383
    rb_define_const(rb_mSockConst, "PF_CNT", INT2NUM(PF_CNT));
384
#endif
385
#if defined(AF_SIP)
386
    /* Simple Internet Protocol */
387
    rb_define_const(rb_cSocket, "AF_SIP", INT2NUM(AF_SIP));
388
    /* Simple Internet Protocol */
389
    rb_define_const(rb_mSockConst, "AF_SIP", INT2NUM(AF_SIP));
390
#endif
391
#if defined(PF_SIP)
392
    /* Simple Internet Protocol */
393
    rb_define_const(rb_cSocket, "PF_SIP", INT2NUM(PF_SIP));
394
    /* Simple Internet Protocol */
395
    rb_define_const(rb_mSockConst, "PF_SIP", INT2NUM(PF_SIP));
396
#endif
397
#if defined(AF_NDRV)
398
    /* Network driver raw access */
399
    rb_define_const(rb_cSocket, "AF_NDRV", INT2NUM(AF_NDRV));
400
    /* Network driver raw access */
401
    rb_define_const(rb_mSockConst, "AF_NDRV", INT2NUM(AF_NDRV));
402
#endif
403
#if defined(PF_NDRV)
404
    /* Network driver raw access */
405
    rb_define_const(rb_cSocket, "PF_NDRV", INT2NUM(PF_NDRV));
406
    /* Network driver raw access */
407
    rb_define_const(rb_mSockConst, "PF_NDRV", INT2NUM(PF_NDRV));
408
#endif
409
#if defined(AF_ISDN)
410
    /* Integrated Services Digital Network */
411
    rb_define_const(rb_cSocket, "AF_ISDN", INT2NUM(AF_ISDN));
412
    /* Integrated Services Digital Network */
413
    rb_define_const(rb_mSockConst, "AF_ISDN", INT2NUM(AF_ISDN));
414
#endif
415
#if defined(PF_ISDN)
416
    /* Integrated Services Digital Network */
417
    rb_define_const(rb_cSocket, "PF_ISDN", INT2NUM(PF_ISDN));
418
    /* Integrated Services Digital Network */
419
    rb_define_const(rb_mSockConst, "PF_ISDN", INT2NUM(PF_ISDN));
420
#endif
421
#if defined(AF_NATM)
422
    /* Native ATM access */
423
    rb_define_const(rb_cSocket, "AF_NATM", INT2NUM(AF_NATM));
424
    /* Native ATM access */
425
    rb_define_const(rb_mSockConst, "AF_NATM", INT2NUM(AF_NATM));
426
#endif
427
#if defined(PF_NATM)
428
    /* Native ATM access */
429
    rb_define_const(rb_cSocket, "PF_NATM", INT2NUM(PF_NATM));
430
    /* Native ATM access */
431
    rb_define_const(rb_mSockConst, "PF_NATM", INT2NUM(PF_NATM));
432
#endif
433
#if defined(AF_SYSTEM)
434
    /*  */
435
    rb_define_const(rb_cSocket, "AF_SYSTEM", INT2NUM(AF_SYSTEM));
436
    /*  */
437
    rb_define_const(rb_mSockConst, "AF_SYSTEM", INT2NUM(AF_SYSTEM));
438
#endif
439
#if defined(PF_SYSTEM)
440
    /*  */
441
    rb_define_const(rb_cSocket, "PF_SYSTEM", INT2NUM(PF_SYSTEM));
442
    /*  */
443
    rb_define_const(rb_mSockConst, "PF_SYSTEM", INT2NUM(PF_SYSTEM));
444
#endif
445
#if defined(AF_NETBIOS)
446
    /* NetBIOS */
447
    rb_define_const(rb_cSocket, "AF_NETBIOS", INT2NUM(AF_NETBIOS));
448
    /* NetBIOS */
449
    rb_define_const(rb_mSockConst, "AF_NETBIOS", INT2NUM(AF_NETBIOS));
450
#endif
451
#if defined(PF_NETBIOS)
452
    /* NetBIOS */
453
    rb_define_const(rb_cSocket, "PF_NETBIOS", INT2NUM(PF_NETBIOS));
454
    /* NetBIOS */
455
    rb_define_const(rb_mSockConst, "PF_NETBIOS", INT2NUM(PF_NETBIOS));
456
#endif
457
#if defined(AF_PPP)
458
    /* Point-to-Point Protocol */
459
    rb_define_const(rb_cSocket, "AF_PPP", INT2NUM(AF_PPP));
460
    /* Point-to-Point Protocol */
461
    rb_define_const(rb_mSockConst, "AF_PPP", INT2NUM(AF_PPP));
462
#endif
463
#if defined(PF_PPP)
464
    /* Point-to-Point Protocol */
465
    rb_define_const(rb_cSocket, "PF_PPP", INT2NUM(PF_PPP));
466
    /* Point-to-Point Protocol */
467
    rb_define_const(rb_mSockConst, "PF_PPP", INT2NUM(PF_PPP));
468
#endif
469
#if defined(AF_ATM)
470
    /* Asynchronous Transfer Mode */
471
    rb_define_const(rb_cSocket, "AF_ATM", INT2NUM(AF_ATM));
472
    /* Asynchronous Transfer Mode */
473
    rb_define_const(rb_mSockConst, "AF_ATM", INT2NUM(AF_ATM));
474
#endif
475
#if defined(PF_ATM)
476
    /* Asynchronous Transfer Mode */
477
    rb_define_const(rb_cSocket, "PF_ATM", INT2NUM(PF_ATM));
478
    /* Asynchronous Transfer Mode */
479
    rb_define_const(rb_mSockConst, "PF_ATM", INT2NUM(PF_ATM));
480
#endif
481
#if defined(AF_NETGRAPH)
482
    /* Netgraph sockets */
483
    rb_define_const(rb_cSocket, "AF_NETGRAPH", INT2NUM(AF_NETGRAPH));
484
    /* Netgraph sockets */
485
    rb_define_const(rb_mSockConst, "AF_NETGRAPH", INT2NUM(AF_NETGRAPH));
486
#endif
487
#if defined(PF_NETGRAPH)
488
    /* Netgraph sockets */
489
    rb_define_const(rb_cSocket, "PF_NETGRAPH", INT2NUM(PF_NETGRAPH));
490
    /* Netgraph sockets */
491
    rb_define_const(rb_mSockConst, "PF_NETGRAPH", INT2NUM(PF_NETGRAPH));
492
#endif
493
#if defined(AF_MAX)
494
    /* Maximum address family for this platform */
495
    rb_define_const(rb_cSocket, "AF_MAX", INT2NUM(AF_MAX));
496
    /* Maximum address family for this platform */
497
    rb_define_const(rb_mSockConst, "AF_MAX", INT2NUM(AF_MAX));
498
#endif
499
#if defined(PF_MAX)
500
    /* Maximum address family for this platform */
501
    rb_define_const(rb_cSocket, "PF_MAX", INT2NUM(PF_MAX));
502
    /* Maximum address family for this platform */
503
    rb_define_const(rb_mSockConst, "PF_MAX", INT2NUM(PF_MAX));
504
#endif
505
#if defined(AF_PACKET)
506
    /* Direct link-layer access */
507
    rb_define_const(rb_cSocket, "AF_PACKET", INT2NUM(AF_PACKET));
508
    /* Direct link-layer access */
509
    rb_define_const(rb_mSockConst, "AF_PACKET", INT2NUM(AF_PACKET));
510
#endif
511
#if defined(PF_PACKET)
512
    /* Direct link-layer access */
513
    rb_define_const(rb_cSocket, "PF_PACKET", INT2NUM(PF_PACKET));
514
    /* Direct link-layer access */
515
    rb_define_const(rb_mSockConst, "PF_PACKET", INT2NUM(PF_PACKET));
516
#endif
517
#if defined(AF_E164)
518
    /* CCITT (ITU-T) E.164 recommendation */
519
    rb_define_const(rb_cSocket, "AF_E164", INT2NUM(AF_E164));
520
    /* CCITT (ITU-T) E.164 recommendation */
521
    rb_define_const(rb_mSockConst, "AF_E164", INT2NUM(AF_E164));
522
#endif
523
#if defined(PF_XTP)
524
    /* eXpress Transfer Protocol */
525
    rb_define_const(rb_cSocket, "PF_XTP", INT2NUM(PF_XTP));
526
    /* eXpress Transfer Protocol */
527
    rb_define_const(rb_mSockConst, "PF_XTP", INT2NUM(PF_XTP));
528
#endif
529
#if defined(PF_RTIP)
530
    /*  */
531
    rb_define_const(rb_cSocket, "PF_RTIP", INT2NUM(PF_RTIP));
532
    /*  */
533
    rb_define_const(rb_mSockConst, "PF_RTIP", INT2NUM(PF_RTIP));
534
#endif
535
#if defined(PF_PIP)
536
    /*  */
537
    rb_define_const(rb_cSocket, "PF_PIP", INT2NUM(PF_PIP));
538
    /*  */
539
    rb_define_const(rb_mSockConst, "PF_PIP", INT2NUM(PF_PIP));
540
#endif
541
#if defined(PF_KEY)
542
    /*  */
543
    rb_define_const(rb_cSocket, "PF_KEY", INT2NUM(PF_KEY));
544
    /*  */
545
    rb_define_const(rb_mSockConst, "PF_KEY", INT2NUM(PF_KEY));
546
#endif
547
#if defined(MSG_OOB)
548
    /* Process out-of-band data */
549
    rb_define_const(rb_cSocket, "MSG_OOB", INT2NUM(MSG_OOB));
550
    /* Process out-of-band data */
551
    rb_define_const(rb_mSockConst, "MSG_OOB", INT2NUM(MSG_OOB));
552
#endif
553
#if defined(MSG_PEEK)
554
    /* Peek at incoming message */
555
    rb_define_const(rb_cSocket, "MSG_PEEK", INT2NUM(MSG_PEEK));
556
    /* Peek at incoming message */
557
    rb_define_const(rb_mSockConst, "MSG_PEEK", INT2NUM(MSG_PEEK));
558
#endif
559
#if defined(MSG_DONTROUTE)
560
    /* Send without using the routing tables */
561
    rb_define_const(rb_cSocket, "MSG_DONTROUTE", INT2NUM(MSG_DONTROUTE));
562
    /* Send without using the routing tables */
563
    rb_define_const(rb_mSockConst, "MSG_DONTROUTE", INT2NUM(MSG_DONTROUTE));
564
#endif
565
#if defined(MSG_EOR)
566
    /* Data completes record */
567
    rb_define_const(rb_cSocket, "MSG_EOR", INT2NUM(MSG_EOR));
568
    /* Data completes record */
569
    rb_define_const(rb_mSockConst, "MSG_EOR", INT2NUM(MSG_EOR));
570
#endif
571
#if defined(MSG_TRUNC)
572
    /* Data discarded before delivery */
573
    rb_define_const(rb_cSocket, "MSG_TRUNC", INT2NUM(MSG_TRUNC));
574
    /* Data discarded before delivery */
575
    rb_define_const(rb_mSockConst, "MSG_TRUNC", INT2NUM(MSG_TRUNC));
576
#endif
577
#if defined(MSG_CTRUNC)
578
    /* Control data lost before delivery */
579
    rb_define_const(rb_cSocket, "MSG_CTRUNC", INT2NUM(MSG_CTRUNC));
580
    /* Control data lost before delivery */
581
    rb_define_const(rb_mSockConst, "MSG_CTRUNC", INT2NUM(MSG_CTRUNC));
582
#endif
583
#if defined(MSG_WAITALL)
584
    /* Wait for full request or error */
585
    rb_define_const(rb_cSocket, "MSG_WAITALL", INT2NUM(MSG_WAITALL));
586
    /* Wait for full request or error */
587
    rb_define_const(rb_mSockConst, "MSG_WAITALL", INT2NUM(MSG_WAITALL));
588
#endif
589
#if defined(MSG_DONTWAIT)
590
    /* This message should be non-blocking */
591
    rb_define_const(rb_cSocket, "MSG_DONTWAIT", INT2NUM(MSG_DONTWAIT));
592
    /* This message should be non-blocking */
593
    rb_define_const(rb_mSockConst, "MSG_DONTWAIT", INT2NUM(MSG_DONTWAIT));
594
#endif
595
#if defined(MSG_EOF)
596
    /* Data completes connection */
597
    rb_define_const(rb_cSocket, "MSG_EOF", INT2NUM(MSG_EOF));
598
    /* Data completes connection */
599
    rb_define_const(rb_mSockConst, "MSG_EOF", INT2NUM(MSG_EOF));
600
#endif
601
#if defined(MSG_FLUSH)
602
    /* Start of a hold sequence.  Dumps to so_temp */
603
    rb_define_const(rb_cSocket, "MSG_FLUSH", INT2NUM(MSG_FLUSH));
604
    /* Start of a hold sequence.  Dumps to so_temp */
605
    rb_define_const(rb_mSockConst, "MSG_FLUSH", INT2NUM(MSG_FLUSH));
606
#endif
607
#if defined(MSG_HOLD)
608
    /* Hold fragment in so_temp */
609
    rb_define_const(rb_cSocket, "MSG_HOLD", INT2NUM(MSG_HOLD));
610
    /* Hold fragment in so_temp */
611
    rb_define_const(rb_mSockConst, "MSG_HOLD", INT2NUM(MSG_HOLD));
612
#endif
613
#if defined(MSG_SEND)
614
    /* Send the packet in so_temp */
615
    rb_define_const(rb_cSocket, "MSG_SEND", INT2NUM(MSG_SEND));
616
    /* Send the packet in so_temp */
617
    rb_define_const(rb_mSockConst, "MSG_SEND", INT2NUM(MSG_SEND));
618
#endif
619
#if defined(MSG_HAVEMORE)
620
    /* Data ready to be read */
621
    rb_define_const(rb_cSocket, "MSG_HAVEMORE", INT2NUM(MSG_HAVEMORE));
622
    /* Data ready to be read */
623
    rb_define_const(rb_mSockConst, "MSG_HAVEMORE", INT2NUM(MSG_HAVEMORE));
624
#endif
625
#if defined(MSG_RCVMORE)
626
    /* Data remains in the current packet */
627
    rb_define_const(rb_cSocket, "MSG_RCVMORE", INT2NUM(MSG_RCVMORE));
628
    /* Data remains in the current packet */
629
    rb_define_const(rb_mSockConst, "MSG_RCVMORE", INT2NUM(MSG_RCVMORE));
630
#endif
631
#if defined(MSG_COMPAT)
632
    /* End of record */
633
    rb_define_const(rb_cSocket, "MSG_COMPAT", INT2NUM(MSG_COMPAT));
634
    /* End of record */
635
    rb_define_const(rb_mSockConst, "MSG_COMPAT", INT2NUM(MSG_COMPAT));
636
#endif
637
#if defined(MSG_PROXY)
638
    /* Wait for full request */
639
    rb_define_const(rb_cSocket, "MSG_PROXY", INT2NUM(MSG_PROXY));
640
    /* Wait for full request */
641
    rb_define_const(rb_mSockConst, "MSG_PROXY", INT2NUM(MSG_PROXY));
642
#endif
643
#if defined(MSG_FIN)
644
    /*  */
645
    rb_define_const(rb_cSocket, "MSG_FIN", INT2NUM(MSG_FIN));
646
    /*  */
647
    rb_define_const(rb_mSockConst, "MSG_FIN", INT2NUM(MSG_FIN));
648
#endif
649
#if defined(MSG_SYN)
650
    /*  */
651
    rb_define_const(rb_cSocket, "MSG_SYN", INT2NUM(MSG_SYN));
652
    /*  */
653
    rb_define_const(rb_mSockConst, "MSG_SYN", INT2NUM(MSG_SYN));
654
#endif
655
#if defined(MSG_CONFIRM)
656
    /* Confirm path validity */
657
    rb_define_const(rb_cSocket, "MSG_CONFIRM", INT2NUM(MSG_CONFIRM));
658
    /* Confirm path validity */
659
    rb_define_const(rb_mSockConst, "MSG_CONFIRM", INT2NUM(MSG_CONFIRM));
660
#endif
661
#if defined(MSG_RST)
662
    /*  */
663
    rb_define_const(rb_cSocket, "MSG_RST", INT2NUM(MSG_RST));
664
    /*  */
665
    rb_define_const(rb_mSockConst, "MSG_RST", INT2NUM(MSG_RST));
666
#endif
667
#if defined(MSG_ERRQUEUE)
668
    /* Fetch message from error queue */
669
    rb_define_const(rb_cSocket, "MSG_ERRQUEUE", INT2NUM(MSG_ERRQUEUE));
670
    /* Fetch message from error queue */
671
    rb_define_const(rb_mSockConst, "MSG_ERRQUEUE", INT2NUM(MSG_ERRQUEUE));
672
#endif
673
#if defined(MSG_NOSIGNAL)
674
    /* Do not generate SIGPIPE */
675
    rb_define_const(rb_cSocket, "MSG_NOSIGNAL", INT2NUM(MSG_NOSIGNAL));
676
    /* Do not generate SIGPIPE */
677
    rb_define_const(rb_mSockConst, "MSG_NOSIGNAL", INT2NUM(MSG_NOSIGNAL));
678
#endif
679
#if defined(MSG_MORE)
680
    /* Sender will send more */
681
    rb_define_const(rb_cSocket, "MSG_MORE", INT2NUM(MSG_MORE));
682
    /* Sender will send more */
683
    rb_define_const(rb_mSockConst, "MSG_MORE", INT2NUM(MSG_MORE));
684
#endif
685
#if defined(SOL_SOCKET)
686
    /* Socket-level options */
687
    rb_define_const(rb_cSocket, "SOL_SOCKET", INT2NUM(SOL_SOCKET));
688
    /* Socket-level options */
689
    rb_define_const(rb_mSockConst, "SOL_SOCKET", INT2NUM(SOL_SOCKET));
690
#endif
691
#if defined(SOL_IP)
692
    /* IP socket options */
693
    rb_define_const(rb_cSocket, "SOL_IP", INT2NUM(SOL_IP));
694
    /* IP socket options */
695
    rb_define_const(rb_mSockConst, "SOL_IP", INT2NUM(SOL_IP));
696
#endif
697
#if defined(SOL_IPX)
698
    /* IPX socket options */
699
    rb_define_const(rb_cSocket, "SOL_IPX", INT2NUM(SOL_IPX));
700
    /* IPX socket options */
701
    rb_define_const(rb_mSockConst, "SOL_IPX", INT2NUM(SOL_IPX));
702
#endif
703
#if defined(SOL_AX25)
704
    /* AX.25 socket options */
705
    rb_define_const(rb_cSocket, "SOL_AX25", INT2NUM(SOL_AX25));
706
    /* AX.25 socket options */
707
    rb_define_const(rb_mSockConst, "SOL_AX25", INT2NUM(SOL_AX25));
708
#endif
709
#if defined(SOL_ATALK)
710
    /* AppleTalk socket options */
711
    rb_define_const(rb_cSocket, "SOL_ATALK", INT2NUM(SOL_ATALK));
712
    /* AppleTalk socket options */
713
    rb_define_const(rb_mSockConst, "SOL_ATALK", INT2NUM(SOL_ATALK));
714
#endif
715
#if defined(SOL_TCP)
716
    /* TCP socket options */
717
    rb_define_const(rb_cSocket, "SOL_TCP", INT2NUM(SOL_TCP));
718
    /* TCP socket options */
719
    rb_define_const(rb_mSockConst, "SOL_TCP", INT2NUM(SOL_TCP));
720
#endif
721
#if defined(SOL_UDP)
722
    /* UDP socket options */
723
    rb_define_const(rb_cSocket, "SOL_UDP", INT2NUM(SOL_UDP));
724
    /* UDP socket options */
725
    rb_define_const(rb_mSockConst, "SOL_UDP", INT2NUM(SOL_UDP));
726
#endif
727
#if defined(IPPROTO_IP)
728
    /* Dummy protocol for IP */
729
    rb_define_const(rb_cSocket, "IPPROTO_IP", INT2NUM(IPPROTO_IP));
730
    /* Dummy protocol for IP */
731
    rb_define_const(rb_mSockConst, "IPPROTO_IP", INT2NUM(IPPROTO_IP));
732
#endif
733
#if defined(IPPROTO_ICMP)
734
    /* Control message protocol */
735
    rb_define_const(rb_cSocket, "IPPROTO_ICMP", INT2NUM(IPPROTO_ICMP));
736
    /* Control message protocol */
737
    rb_define_const(rb_mSockConst, "IPPROTO_ICMP", INT2NUM(IPPROTO_ICMP));
738
#endif
739
#if defined(IPPROTO_IGMP)
740
    /* Group Management Protocol */
741
    rb_define_const(rb_cSocket, "IPPROTO_IGMP", INT2NUM(IPPROTO_IGMP));
742
    /* Group Management Protocol */
743
    rb_define_const(rb_mSockConst, "IPPROTO_IGMP", INT2NUM(IPPROTO_IGMP));
744
#endif
745
#if defined(IPPROTO_GGP)
746
    /* Gateway to Gateway Protocol */
747
    rb_define_const(rb_cSocket, "IPPROTO_GGP", INT2NUM(IPPROTO_GGP));
748
    /* Gateway to Gateway Protocol */
749
    rb_define_const(rb_mSockConst, "IPPROTO_GGP", INT2NUM(IPPROTO_GGP));
750
#endif
751
#if defined(IPPROTO_TCP)
752
    /* TCP */
753
    rb_define_const(rb_cSocket, "IPPROTO_TCP", INT2NUM(IPPROTO_TCP));
754
    /* TCP */
755
    rb_define_const(rb_mSockConst, "IPPROTO_TCP", INT2NUM(IPPROTO_TCP));
756
#endif
757
#if defined(IPPROTO_EGP)
758
    /* Exterior Gateway Protocol */
759
    rb_define_const(rb_cSocket, "IPPROTO_EGP", INT2NUM(IPPROTO_EGP));
760
    /* Exterior Gateway Protocol */
761
    rb_define_const(rb_mSockConst, "IPPROTO_EGP", INT2NUM(IPPROTO_EGP));
762
#endif
763
#if defined(IPPROTO_PUP)
764
    /* PARC Universal Packet protocol */
765
    rb_define_const(rb_cSocket, "IPPROTO_PUP", INT2NUM(IPPROTO_PUP));
766
    /* PARC Universal Packet protocol */
767
    rb_define_const(rb_mSockConst, "IPPROTO_PUP", INT2NUM(IPPROTO_PUP));
768
#endif
769
#if defined(IPPROTO_UDP)
770
    /* UDP */
771
    rb_define_const(rb_cSocket, "IPPROTO_UDP", INT2NUM(IPPROTO_UDP));
772
    /* UDP */
773
    rb_define_const(rb_mSockConst, "IPPROTO_UDP", INT2NUM(IPPROTO_UDP));
774
#endif
775
#if defined(IPPROTO_IDP)
776
    /* XNS IDP */
777
    rb_define_const(rb_cSocket, "IPPROTO_IDP", INT2NUM(IPPROTO_IDP));
778
    /* XNS IDP */
779
    rb_define_const(rb_mSockConst, "IPPROTO_IDP", INT2NUM(IPPROTO_IDP));
780
#endif
781
#if defined(IPPROTO_HELLO)
782
    /* "hello" routing protocol */
783
    rb_define_const(rb_cSocket, "IPPROTO_HELLO", INT2NUM(IPPROTO_HELLO));
784
    /* "hello" routing protocol */
785
    rb_define_const(rb_mSockConst, "IPPROTO_HELLO", INT2NUM(IPPROTO_HELLO));
786
#endif
787
#if defined(IPPROTO_ND)
788
    /* Sun net disk protocol */
789
    rb_define_const(rb_cSocket, "IPPROTO_ND", INT2NUM(IPPROTO_ND));
790
    /* Sun net disk protocol */
791
    rb_define_const(rb_mSockConst, "IPPROTO_ND", INT2NUM(IPPROTO_ND));
792
#endif
793
#if defined(IPPROTO_TP)
794
    /* ISO transport protocol class 4 */
795
    rb_define_const(rb_cSocket, "IPPROTO_TP", INT2NUM(IPPROTO_TP));
796
    /* ISO transport protocol class 4 */
797
    rb_define_const(rb_mSockConst, "IPPROTO_TP", INT2NUM(IPPROTO_TP));
798
#endif
799
#if defined(IPPROTO_XTP)
800
    /* Xpress Transport Protocol */
801
    rb_define_const(rb_cSocket, "IPPROTO_XTP", INT2NUM(IPPROTO_XTP));
802
    /* Xpress Transport Protocol */
803
    rb_define_const(rb_mSockConst, "IPPROTO_XTP", INT2NUM(IPPROTO_XTP));
804
#endif
805
#if defined(IPPROTO_EON)
806
    /* ISO cnlp */
807
    rb_define_const(rb_cSocket, "IPPROTO_EON", INT2NUM(IPPROTO_EON));
808
    /* ISO cnlp */
809
    rb_define_const(rb_mSockConst, "IPPROTO_EON", INT2NUM(IPPROTO_EON));
810
#endif
811
#if defined(IPPROTO_BIP)
812
    /*  */
813
    rb_define_const(rb_cSocket, "IPPROTO_BIP", INT2NUM(IPPROTO_BIP));
814
    /*  */
815
    rb_define_const(rb_mSockConst, "IPPROTO_BIP", INT2NUM(IPPROTO_BIP));
816
#endif
817
#if defined(IPPROTO_AH)
818
    /* IP6 auth header */
819
    rb_define_const(rb_cSocket, "IPPROTO_AH", INT2NUM(IPPROTO_AH));
820
    /* IP6 auth header */
821
    rb_define_const(rb_mSockConst, "IPPROTO_AH", INT2NUM(IPPROTO_AH));
822
#endif
823
#if defined(IPPROTO_DSTOPTS)
824
    /* IP6 destination option */
825
    rb_define_const(rb_cSocket, "IPPROTO_DSTOPTS", INT2NUM(IPPROTO_DSTOPTS));
826
    /* IP6 destination option */
827
    rb_define_const(rb_mSockConst, "IPPROTO_DSTOPTS", INT2NUM(IPPROTO_DSTOPTS));
828
#endif
829
#if defined(IPPROTO_ESP)
830
    /* IP6 Encapsulated Security Payload */
831
    rb_define_const(rb_cSocket, "IPPROTO_ESP", INT2NUM(IPPROTO_ESP));
832
    /* IP6 Encapsulated Security Payload */
833
    rb_define_const(rb_mSockConst, "IPPROTO_ESP", INT2NUM(IPPROTO_ESP));
834
#endif
835
#if defined(IPPROTO_FRAGMENT)
836
    /* IP6 fragmentation header */
837
    rb_define_const(rb_cSocket, "IPPROTO_FRAGMENT", INT2NUM(IPPROTO_FRAGMENT));
838
    /* IP6 fragmentation header */
839
    rb_define_const(rb_mSockConst, "IPPROTO_FRAGMENT", INT2NUM(IPPROTO_FRAGMENT));
840
#endif
841
#if defined(IPPROTO_HOPOPTS)
842
    /* IP6 hop-by-hop options */
843
    rb_define_const(rb_cSocket, "IPPROTO_HOPOPTS", INT2NUM(IPPROTO_HOPOPTS));
844
    /* IP6 hop-by-hop options */
845
    rb_define_const(rb_mSockConst, "IPPROTO_HOPOPTS", INT2NUM(IPPROTO_HOPOPTS));
846
#endif
847
#if defined(IPPROTO_ICMPV6)
848
    /* ICMP6 */
849
    rb_define_const(rb_cSocket, "IPPROTO_ICMPV6", INT2NUM(IPPROTO_ICMPV6));
850
    /* ICMP6 */
851
    rb_define_const(rb_mSockConst, "IPPROTO_ICMPV6", INT2NUM(IPPROTO_ICMPV6));
852
#endif
853
#if defined(IPPROTO_IPV6)
854
    /* IP6 header */
855
    rb_define_const(rb_cSocket, "IPPROTO_IPV6", INT2NUM(IPPROTO_IPV6));
856
    /* IP6 header */
857
    rb_define_const(rb_mSockConst, "IPPROTO_IPV6", INT2NUM(IPPROTO_IPV6));
858
#endif
859
#if defined(IPPROTO_NONE)
860
    /* IP6 no next header */
861
    rb_define_const(rb_cSocket, "IPPROTO_NONE", INT2NUM(IPPROTO_NONE));
862
    /* IP6 no next header */
863
    rb_define_const(rb_mSockConst, "IPPROTO_NONE", INT2NUM(IPPROTO_NONE));
864
#endif
865
#if defined(IPPROTO_ROUTING)
866
    /* IP6 routing header */
867
    rb_define_const(rb_cSocket, "IPPROTO_ROUTING", INT2NUM(IPPROTO_ROUTING));
868
    /* IP6 routing header */
869
    rb_define_const(rb_mSockConst, "IPPROTO_ROUTING", INT2NUM(IPPROTO_ROUTING));
870
#endif
871
#if defined(IPPROTO_RAW)
872
    /* Raw IP packet */
873
    rb_define_const(rb_cSocket, "IPPROTO_RAW", INT2NUM(IPPROTO_RAW));
874
    /* Raw IP packet */
875
    rb_define_const(rb_mSockConst, "IPPROTO_RAW", INT2NUM(IPPROTO_RAW));
876
#endif
877
#if defined(IPPROTO_MAX)
878
    /* Maximum IPPROTO constant */
879
    rb_define_const(rb_cSocket, "IPPROTO_MAX", INT2NUM(IPPROTO_MAX));
880
    /* Maximum IPPROTO constant */
881
    rb_define_const(rb_mSockConst, "IPPROTO_MAX", INT2NUM(IPPROTO_MAX));
882
#endif
883
#if defined(IPPORT_RESERVED)
884
    /* Default minimum address for bind or connect */
885
    rb_define_const(rb_cSocket, "IPPORT_RESERVED", INT2NUM(IPPORT_RESERVED));
886
    /* Default minimum address for bind or connect */
887
    rb_define_const(rb_mSockConst, "IPPORT_RESERVED", INT2NUM(IPPORT_RESERVED));
888
#endif
889
#if defined(IPPORT_USERRESERVED)
890
    /* Default maximum address for bind or connect */
891
    rb_define_const(rb_cSocket, "IPPORT_USERRESERVED", INT2NUM(IPPORT_USERRESERVED));
892
    /* Default maximum address for bind or connect */
893
    rb_define_const(rb_mSockConst, "IPPORT_USERRESERVED", INT2NUM(IPPORT_USERRESERVED));
894
#endif
895
#if defined(INADDR_ANY)
896
    /* A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address */
897
    rb_define_const(rb_cSocket, "INADDR_ANY", UINT2NUM(INADDR_ANY));
898
    /* A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address */
899
    rb_define_const(rb_mSockConst, "INADDR_ANY", UINT2NUM(INADDR_ANY));
900
#endif
901
#if defined(INADDR_BROADCAST)
902
    /* The network broadcast address */
903
    rb_define_const(rb_cSocket, "INADDR_BROADCAST", UINT2NUM(INADDR_BROADCAST));
904
    /* The network broadcast address */
905
    rb_define_const(rb_mSockConst, "INADDR_BROADCAST", UINT2NUM(INADDR_BROADCAST));
906
#endif
907
#if defined(INADDR_LOOPBACK)
908
    /* The loopback address */
909
    rb_define_const(rb_cSocket, "INADDR_LOOPBACK", UINT2NUM(INADDR_LOOPBACK));
910
    /* The loopback address */
911
    rb_define_const(rb_mSockConst, "INADDR_LOOPBACK", UINT2NUM(INADDR_LOOPBACK));
912
#endif
913
#if defined(INADDR_UNSPEC_GROUP)
914
    /* The reserved multicast group */
915
    rb_define_const(rb_cSocket, "INADDR_UNSPEC_GROUP", UINT2NUM(INADDR_UNSPEC_GROUP));
916
    /* The reserved multicast group */
917
    rb_define_const(rb_mSockConst, "INADDR_UNSPEC_GROUP", UINT2NUM(INADDR_UNSPEC_GROUP));
918
#endif
919
#if defined(INADDR_ALLHOSTS_GROUP)
920
    /* Multicast group for all systems on this subset */
921
    rb_define_const(rb_cSocket, "INADDR_ALLHOSTS_GROUP", UINT2NUM(INADDR_ALLHOSTS_GROUP));
922
    /* Multicast group for all systems on this subset */
923
    rb_define_const(rb_mSockConst, "INADDR_ALLHOSTS_GROUP", UINT2NUM(INADDR_ALLHOSTS_GROUP));
924
#endif
925
#if defined(INADDR_MAX_LOCAL_GROUP)
926
    /* The last local network multicast group */
927
    rb_define_const(rb_cSocket, "INADDR_MAX_LOCAL_GROUP", UINT2NUM(INADDR_MAX_LOCAL_GROUP));
928
    /* The last local network multicast group */
929
    rb_define_const(rb_mSockConst, "INADDR_MAX_LOCAL_GROUP", UINT2NUM(INADDR_MAX_LOCAL_GROUP));
930
#endif
931
#if defined(INADDR_NONE)
932
    /* A bitmask for matching no valid IP address */
933
    rb_define_const(rb_cSocket, "INADDR_NONE", UINT2NUM(INADDR_NONE));
934
    /* A bitmask for matching no valid IP address */
935
    rb_define_const(rb_mSockConst, "INADDR_NONE", UINT2NUM(INADDR_NONE));
936
#endif
937
#if defined(IP_OPTIONS)
938
    /* IP options to be included in packets */
939
    rb_define_const(rb_cSocket, "IP_OPTIONS", INT2NUM(IP_OPTIONS));
940
    /* IP options to be included in packets */
941
    rb_define_const(rb_mSockConst, "IP_OPTIONS", INT2NUM(IP_OPTIONS));
942
#endif
943
#if defined(IP_HDRINCL)
944
    /* Header is included with data */
945
    rb_define_const(rb_cSocket, "IP_HDRINCL", INT2NUM(IP_HDRINCL));
946
    /* Header is included with data */
947
    rb_define_const(rb_mSockConst, "IP_HDRINCL", INT2NUM(IP_HDRINCL));
948
#endif
949
#if defined(IP_TOS)
950
    /* IP type-of-service */
951
    rb_define_const(rb_cSocket, "IP_TOS", INT2NUM(IP_TOS));
952
    /* IP type-of-service */
953
    rb_define_const(rb_mSockConst, "IP_TOS", INT2NUM(IP_TOS));
954
#endif
955
#if defined(IP_TTL)
956
    /* IP time-to-live */
957
    rb_define_const(rb_cSocket, "IP_TTL", INT2NUM(IP_TTL));
958
    /* IP time-to-live */
959
    rb_define_const(rb_mSockConst, "IP_TTL", INT2NUM(IP_TTL));
960
#endif
961
#if defined(IP_RECVOPTS)
962
    /* Receive all IP options with datagram */
963
    rb_define_const(rb_cSocket, "IP_RECVOPTS", INT2NUM(IP_RECVOPTS));
964
    /* Receive all IP options with datagram */
965
    rb_define_const(rb_mSockConst, "IP_RECVOPTS", INT2NUM(IP_RECVOPTS));
966
#endif
967
#if defined(IP_RECVRETOPTS)
968
    /* Receive all IP options for response */
969
    rb_define_const(rb_cSocket, "IP_RECVRETOPTS", INT2NUM(IP_RECVRETOPTS));
970
    /* Receive all IP options for response */
971
    rb_define_const(rb_mSockConst, "IP_RECVRETOPTS", INT2NUM(IP_RECVRETOPTS));
972
#endif
973
#if defined(IP_RECVDSTADDR)
974
    /* Receive IP destination address with datagram */
975
    rb_define_const(rb_cSocket, "IP_RECVDSTADDR", INT2NUM(IP_RECVDSTADDR));
976
    /* Receive IP destination address with datagram */
977
    rb_define_const(rb_mSockConst, "IP_RECVDSTADDR", INT2NUM(IP_RECVDSTADDR));
978
#endif
979
#if defined(IP_RETOPTS)
980
    /* IP options to be included in datagrams */
981
    rb_define_const(rb_cSocket, "IP_RETOPTS", INT2NUM(IP_RETOPTS));
982
    /* IP options to be included in datagrams */
983
    rb_define_const(rb_mSockConst, "IP_RETOPTS", INT2NUM(IP_RETOPTS));
984
#endif
985
#if defined(IP_MINTTL)
986
    /* Minimum TTL allowed for received packets */
987
    rb_define_const(rb_cSocket, "IP_MINTTL", INT2NUM(IP_MINTTL));
988
    /* Minimum TTL allowed for received packets */
989
    rb_define_const(rb_mSockConst, "IP_MINTTL", INT2NUM(IP_MINTTL));
990
#endif
991
#if defined(IP_DONTFRAG)
992
    /* Don't fragment packets */
993
    rb_define_const(rb_cSocket, "IP_DONTFRAG", INT2NUM(IP_DONTFRAG));
994
    /* Don't fragment packets */
995
    rb_define_const(rb_mSockConst, "IP_DONTFRAG", INT2NUM(IP_DONTFRAG));
996
#endif
997
#if defined(IP_SENDSRCADDR)
998
    /* Source address for outgoing UDP datagrams */
999
    rb_define_const(rb_cSocket, "IP_SENDSRCADDR", INT2NUM(IP_SENDSRCADDR));
1000
    /* Source address for outgoing UDP datagrams */
1001
    rb_define_const(rb_mSockConst, "IP_SENDSRCADDR", INT2NUM(IP_SENDSRCADDR));
1002
#endif
1003
#if defined(IP_ONESBCAST)
1004
    /* Force outgoing broadcast datagrams to have the undirected broadcast address */
1005
    rb_define_const(rb_cSocket, "IP_ONESBCAST", INT2NUM(IP_ONESBCAST));
1006
    /* Force outgoing broadcast datagrams to have the undirected broadcast address */
1007
    rb_define_const(rb_mSockConst, "IP_ONESBCAST", INT2NUM(IP_ONESBCAST));
1008
#endif
1009
#if defined(IP_RECVTTL)
1010
    /* Receive IP TTL with datagrams */
1011
    rb_define_const(rb_cSocket, "IP_RECVTTL", INT2NUM(IP_RECVTTL));
1012
    /* Receive IP TTL with datagrams */
1013
    rb_define_const(rb_mSockConst, "IP_RECVTTL", INT2NUM(IP_RECVTTL));
1014
#endif
1015
#if defined(IP_RECVIF)
1016
    /* Receive interface information with datagrams */
1017
    rb_define_const(rb_cSocket, "IP_RECVIF", INT2NUM(IP_RECVIF));
1018
    /* Receive interface information with datagrams */
1019
    rb_define_const(rb_mSockConst, "IP_RECVIF", INT2NUM(IP_RECVIF));
1020
#endif
1021
#if defined(IP_RECVSLLA)
1022
    /* Receive link-layer address with datagrams */
1023
    rb_define_const(rb_cSocket, "IP_RECVSLLA", INT2NUM(IP_RECVSLLA));
1024
    /* Receive link-layer address with datagrams */
1025
    rb_define_const(rb_mSockConst, "IP_RECVSLLA", INT2NUM(IP_RECVSLLA));
1026
#endif
1027
#if defined(IP_PORTRANGE)
1028
    /* Set the port range for sockets with unspecified port numbers */
1029
    rb_define_const(rb_cSocket, "IP_PORTRANGE", INT2NUM(IP_PORTRANGE));
1030
    /* Set the port range for sockets with unspecified port numbers */
1031
    rb_define_const(rb_mSockConst, "IP_PORTRANGE", INT2NUM(IP_PORTRANGE));
1032
#endif
1033
#if defined(IP_MULTICAST_IF)
1034
    /* IP multicast interface */
1035
    rb_define_const(rb_cSocket, "IP_MULTICAST_IF", INT2NUM(IP_MULTICAST_IF));
1036
    /* IP multicast interface */
1037
    rb_define_const(rb_mSockConst, "IP_MULTICAST_IF", INT2NUM(IP_MULTICAST_IF));
1038
#endif
1039
#if defined(IP_MULTICAST_TTL)
1040
    /* IP multicast TTL */
1041
    rb_define_const(rb_cSocket, "IP_MULTICAST_TTL", INT2NUM(IP_MULTICAST_TTL));
1042
    /* IP multicast TTL */
1043
    rb_define_const(rb_mSockConst, "IP_MULTICAST_TTL", INT2NUM(IP_MULTICAST_TTL));
1044
#endif
1045
#if defined(IP_MULTICAST_LOOP)
1046
    /* IP multicast loopback */
1047
    rb_define_const(rb_cSocket, "IP_MULTICAST_LOOP", INT2NUM(IP_MULTICAST_LOOP));
1048
    /* IP multicast loopback */
1049
    rb_define_const(rb_mSockConst, "IP_MULTICAST_LOOP", INT2NUM(IP_MULTICAST_LOOP));
1050
#endif
1051
#if defined(IP_ADD_MEMBERSHIP)
1052
    /* Add a multicast group membership */
1053
    rb_define_const(rb_cSocket, "IP_ADD_MEMBERSHIP", INT2NUM(IP_ADD_MEMBERSHIP));
1054
    /* Add a multicast group membership */
1055
    rb_define_const(rb_mSockConst, "IP_ADD_MEMBERSHIP", INT2NUM(IP_ADD_MEMBERSHIP));
1056
#endif
1057
#if defined(IP_DROP_MEMBERSHIP)
1058
    /* Drop a multicast group membership */
1059
    rb_define_const(rb_cSocket, "IP_DROP_MEMBERSHIP", INT2NUM(IP_DROP_MEMBERSHIP));
1060
    /* Drop a multicast group membership */
1061
    rb_define_const(rb_mSockConst, "IP_DROP_MEMBERSHIP", INT2NUM(IP_DROP_MEMBERSHIP));
1062
#endif
1063
#if defined(IP_DEFAULT_MULTICAST_TTL)
1064
    /* Default multicast TTL */
1065
    rb_define_const(rb_cSocket, "IP_DEFAULT_MULTICAST_TTL", INT2NUM(IP_DEFAULT_MULTICAST_TTL));
1066
    /* Default multicast TTL */
1067
    rb_define_const(rb_mSockConst, "IP_DEFAULT_MULTICAST_TTL", INT2NUM(IP_DEFAULT_MULTICAST_TTL));
1068
#endif
1069
#if defined(IP_DEFAULT_MULTICAST_LOOP)
1070
    /* Default multicast loopback */
1071
    rb_define_const(rb_cSocket, "IP_DEFAULT_MULTICAST_LOOP", INT2NUM(IP_DEFAULT_MULTICAST_LOOP));
1072
    /* Default multicast loopback */
1073
    rb_define_const(rb_mSockConst, "IP_DEFAULT_MULTICAST_LOOP", INT2NUM(IP_DEFAULT_MULTICAST_LOOP));
1074
#endif
1075
#if defined(IP_MAX_MEMBERSHIPS)
1076
    /* Maximum number multicast groups a socket can join */
1077
    rb_define_const(rb_cSocket, "IP_MAX_MEMBERSHIPS", INT2NUM(IP_MAX_MEMBERSHIPS));
1078
    /* Maximum number multicast groups a socket can join */
1079
    rb_define_const(rb_mSockConst, "IP_MAX_MEMBERSHIPS", INT2NUM(IP_MAX_MEMBERSHIPS));
1080
#endif
1081
#if defined(IP_ROUTER_ALERT)
1082
    /* Notify transit routers to more closely examine the contents of an IP packet */
1083
    rb_define_const(rb_cSocket, "IP_ROUTER_ALERT", INT2NUM(IP_ROUTER_ALERT));
1084
    /* Notify transit routers to more closely examine the contents of an IP packet */
1085
    rb_define_const(rb_mSockConst, "IP_ROUTER_ALERT", INT2NUM(IP_ROUTER_ALERT));
1086
#endif
1087
#if defined(IP_PKTINFO)
1088
    /* Receive packet information with datagrams */
1089
    rb_define_const(rb_cSocket, "IP_PKTINFO", INT2NUM(IP_PKTINFO));
1090
    /* Receive packet information with datagrams */
1091
    rb_define_const(rb_mSockConst, "IP_PKTINFO", INT2NUM(IP_PKTINFO));
1092
#endif
1093
#if defined(IP_PKTOPTIONS)
1094
    /* Receive packet options with datagrams */
1095
    rb_define_const(rb_cSocket, "IP_PKTOPTIONS", INT2NUM(IP_PKTOPTIONS));
1096
    /* Receive packet options with datagrams */
1097
    rb_define_const(rb_mSockConst, "IP_PKTOPTIONS", INT2NUM(IP_PKTOPTIONS));
1098
#endif
1099
#if defined(IP_MTU_DISCOVER)
1100
    /* Path MTU discovery */
1101
    rb_define_const(rb_cSocket, "IP_MTU_DISCOVER", INT2NUM(IP_MTU_DISCOVER));
1102
    /* Path MTU discovery */
1103
    rb_define_const(rb_mSockConst, "IP_MTU_DISCOVER", INT2NUM(IP_MTU_DISCOVER));
1104
#endif
1105
#if defined(IP_RECVERR)
1106
    /* Enable extended reliable error message passing */
1107
    rb_define_const(rb_cSocket, "IP_RECVERR", INT2NUM(IP_RECVERR));
1108
    /* Enable extended reliable error message passing */
1109
    rb_define_const(rb_mSockConst, "IP_RECVERR", INT2NUM(IP_RECVERR));
1110
#endif
1111
#if defined(IP_RECVTOS)
1112
    /* Receive TOS with incoming packets */
1113
    rb_define_const(rb_cSocket, "IP_RECVTOS", INT2NUM(IP_RECVTOS));
1114
    /* Receive TOS with incoming packets */
1115
    rb_define_const(rb_mSockConst, "IP_RECVTOS", INT2NUM(IP_RECVTOS));
1116
#endif
1117
#if defined(IP_MTU)
1118
    /* The Maximum Transmission Unit of the socket */
1119
    rb_define_const(rb_cSocket, "IP_MTU", INT2NUM(IP_MTU));
1120
    /* The Maximum Transmission Unit of the socket */
1121
    rb_define_const(rb_mSockConst, "IP_MTU", INT2NUM(IP_MTU));
1122
#endif
1123
#if defined(IP_FREEBIND)
1124
    /* Allow binding to nonexistent IP addresses */
1125
    rb_define_const(rb_cSocket, "IP_FREEBIND", INT2NUM(IP_FREEBIND));
1126
    /* Allow binding to nonexistent IP addresses */
1127
    rb_define_const(rb_mSockConst, "IP_FREEBIND", INT2NUM(IP_FREEBIND));
1128
#endif
1129
#if defined(IP_IPSEC_POLICY)
1130
    /* IPsec security policy */
1131
    rb_define_const(rb_cSocket, "IP_IPSEC_POLICY", INT2NUM(IP_IPSEC_POLICY));
1132
    /* IPsec security policy */
1133
    rb_define_const(rb_mSockConst, "IP_IPSEC_POLICY", INT2NUM(IP_IPSEC_POLICY));
1134
#endif
1135
#if defined(IP_XFRM_POLICY)
1136
    /*  */
1137
    rb_define_const(rb_cSocket, "IP_XFRM_POLICY", INT2NUM(IP_XFRM_POLICY));
1138
    /*  */
1139
    rb_define_const(rb_mSockConst, "IP_XFRM_POLICY", INT2NUM(IP_XFRM_POLICY));
1140
#endif
1141
#if defined(IP_PASSSEC)
1142
    /* Retrieve security context with datagram */
1143
    rb_define_const(rb_cSocket, "IP_PASSSEC", INT2NUM(IP_PASSSEC));
1144
    /* Retrieve security context with datagram */
1145
    rb_define_const(rb_mSockConst, "IP_PASSSEC", INT2NUM(IP_PASSSEC));
1146
#endif
1147
#if defined(IP_PMTUDISC_DONT)
1148
    /* Never send DF frames */
1149
    rb_define_const(rb_cSocket, "IP_PMTUDISC_DONT", INT2NUM(IP_PMTUDISC_DONT));
1150
    /* Never send DF frames */
1151
    rb_define_const(rb_mSockConst, "IP_PMTUDISC_DONT", INT2NUM(IP_PMTUDISC_DONT));
1152
#endif
1153
#if defined(IP_PMTUDISC_WANT)
1154
    /* Use per-route hints */
1155
    rb_define_const(rb_cSocket, "IP_PMTUDISC_WANT", INT2NUM(IP_PMTUDISC_WANT));
1156
    /* Use per-route hints */
1157
    rb_define_const(rb_mSockConst, "IP_PMTUDISC_WANT", INT2NUM(IP_PMTUDISC_WANT));
1158
#endif
1159
#if defined(IP_PMTUDISC_DO)
1160
    /* Always send DF frames */
1161
    rb_define_const(rb_cSocket, "IP_PMTUDISC_DO", INT2NUM(IP_PMTUDISC_DO));
1162
    /* Always send DF frames */
1163
    rb_define_const(rb_mSockConst, "IP_PMTUDISC_DO", INT2NUM(IP_PMTUDISC_DO));
1164
#endif
1165
#if defined(IP_UNBLOCK_SOURCE)
1166
    /* Unblock IPv4 multicast packets with a give source address */
1167
    rb_define_const(rb_cSocket, "IP_UNBLOCK_SOURCE", INT2NUM(IP_UNBLOCK_SOURCE));
1168
    /* Unblock IPv4 multicast packets with a give source address */
1169
    rb_define_const(rb_mSockConst, "IP_UNBLOCK_SOURCE", INT2NUM(IP_UNBLOCK_SOURCE));
1170
#endif
1171
#if defined(IP_BLOCK_SOURCE)
1172
    /* Block IPv4 multicast packets with a give source address */
1173
    rb_define_const(rb_cSocket, "IP_BLOCK_SOURCE", INT2NUM(IP_BLOCK_SOURCE));
1174
    /* Block IPv4 multicast packets with a give source address */
1175
    rb_define_const(rb_mSockConst, "IP_BLOCK_SOURCE", INT2NUM(IP_BLOCK_SOURCE));
1176
#endif
1177
#if defined(IP_ADD_SOURCE_MEMBERSHIP)
1178
    /* Add a multicast group membership */
1179
    rb_define_const(rb_cSocket, "IP_ADD_SOURCE_MEMBERSHIP", INT2NUM(IP_ADD_SOURCE_MEMBERSHIP));
1180
    /* Add a multicast group membership */
1181
    rb_define_const(rb_mSockConst, "IP_ADD_SOURCE_MEMBERSHIP", INT2NUM(IP_ADD_SOURCE_MEMBERSHIP));
1182
#endif
1183
#if defined(IP_DROP_SOURCE_MEMBERSHIP)
1184
    /* Drop a multicast group membership */
1185
    rb_define_const(rb_cSocket, "IP_DROP_SOURCE_MEMBERSHIP", INT2NUM(IP_DROP_SOURCE_MEMBERSHIP));
1186
    /* Drop a multicast group membership */
1187
    rb_define_const(rb_mSockConst, "IP_DROP_SOURCE_MEMBERSHIP", INT2NUM(IP_DROP_SOURCE_MEMBERSHIP));
1188
#endif
1189
#if defined(IP_MSFILTER)
1190
    /* Multicast source filtering */
1191
    rb_define_const(rb_cSocket, "IP_MSFILTER", INT2NUM(IP_MSFILTER));
1192
    /* Multicast source filtering */
1193
    rb_define_const(rb_mSockConst, "IP_MSFILTER", INT2NUM(IP_MSFILTER));
1194
#endif
1195
#if defined(MCAST_JOIN_GROUP)
1196
    /* Join a multicast group */
1197
    rb_define_const(rb_cSocket, "MCAST_JOIN_GROUP", INT2NUM(MCAST_JOIN_GROUP));
1198
    /* Join a multicast group */
1199
    rb_define_const(rb_mSockConst, "MCAST_JOIN_GROUP", INT2NUM(MCAST_JOIN_GROUP));
1200
#endif
1201
#if defined(MCAST_BLOCK_SOURCE)
1202
    /* Block multicast packets from this source */
1203
    rb_define_const(rb_cSocket, "MCAST_BLOCK_SOURCE", INT2NUM(MCAST_BLOCK_SOURCE));
1204
    /* Block multicast packets from this source */
1205
    rb_define_const(rb_mSockConst, "MCAST_BLOCK_SOURCE", INT2NUM(MCAST_BLOCK_SOURCE));
1206
#endif
1207
#if defined(MCAST_UNBLOCK_SOURCE)
1208
    /* Unblock multicast packets from this source */
1209
    rb_define_const(rb_cSocket, "MCAST_UNBLOCK_SOURCE", INT2NUM(MCAST_UNBLOCK_SOURCE));
1210
    /* Unblock multicast packets from this source */
1211
    rb_define_const(rb_mSockConst, "MCAST_UNBLOCK_SOURCE", INT2NUM(MCAST_UNBLOCK_SOURCE));
1212
#endif
1213
#if defined(MCAST_LEAVE_GROUP)
1214
    /* Leave a multicast group */
1215
    rb_define_const(rb_cSocket, "MCAST_LEAVE_GROUP", INT2NUM(MCAST_LEAVE_GROUP));
1216
    /* Leave a multicast group */
1217
    rb_define_const(rb_mSockConst, "MCAST_LEAVE_GROUP", INT2NUM(MCAST_LEAVE_GROUP));
1218
#endif
1219
#if defined(MCAST_JOIN_SOURCE_GROUP)
1220
    /* Join a multicast source group */
1221
    rb_define_const(rb_cSocket, "MCAST_JOIN_SOURCE_GROUP", INT2NUM(MCAST_JOIN_SOURCE_GROUP));
1222
    /* Join a multicast source group */
1223
    rb_define_const(rb_mSockConst, "MCAST_JOIN_SOURCE_GROUP", INT2NUM(MCAST_JOIN_SOURCE_GROUP));
1224
#endif
1225
#if defined(MCAST_LEAVE_SOURCE_GROUP)
1226
    /* Leave a multicast source group */
1227
    rb_define_const(rb_cSocket, "MCAST_LEAVE_SOURCE_GROUP", INT2NUM(MCAST_LEAVE_SOURCE_GROUP));
1228
    /* Leave a multicast source group */
1229
    rb_define_const(rb_mSockConst, "MCAST_LEAVE_SOURCE_GROUP", INT2NUM(MCAST_LEAVE_SOURCE_GROUP));
1230
#endif
1231
#if defined(MCAST_MSFILTER)
1232
    /* Multicast source filtering */
1233
    rb_define_const(rb_cSocket, "MCAST_MSFILTER", INT2NUM(MCAST_MSFILTER));
1234
    /* Multicast source filtering */
1235
    rb_define_const(rb_mSockConst, "MCAST_MSFILTER", INT2NUM(MCAST_MSFILTER));
1236
#endif
1237
#if defined(MCAST_EXCLUDE)
1238
    /* Exclusive multicast source filter */
1239
    rb_define_const(rb_cSocket, "MCAST_EXCLUDE", INT2NUM(MCAST_EXCLUDE));
1240
    /* Exclusive multicast source filter */
1241
    rb_define_const(rb_mSockConst, "MCAST_EXCLUDE", INT2NUM(MCAST_EXCLUDE));
1242
#endif
1243
#if defined(MCAST_INCLUDE)
1244
    /* Inclusive multicast source filter */
1245
    rb_define_const(rb_cSocket, "MCAST_INCLUDE", INT2NUM(MCAST_INCLUDE));
1246
    /* Inclusive multicast source filter */
1247
    rb_define_const(rb_mSockConst, "MCAST_INCLUDE", INT2NUM(MCAST_INCLUDE));
1248
#endif
1249
#if defined(SO_DEBUG)
1250
    /* Debug info recording */
1251
    rb_define_const(rb_cSocket, "SO_DEBUG", INT2NUM(SO_DEBUG));
1252
    /* Debug info recording */
1253
    rb_define_const(rb_mSockConst, "SO_DEBUG", INT2NUM(SO_DEBUG));
1254
#endif
1255
#if defined(SO_REUSEADDR)
1256
    /* Allow local address reuse */
1257
    rb_define_const(rb_cSocket, "SO_REUSEADDR", INT2NUM(SO_REUSEADDR));
1258
    /* Allow local address reuse */
1259
    rb_define_const(rb_mSockConst, "SO_REUSEADDR", INT2NUM(SO_REUSEADDR));
1260
#endif
1261
#if defined(SO_REUSEPORT)
1262
    /* Allow local address and port reuse */
1263
    rb_define_const(rb_cSocket, "SO_REUSEPORT", INT2NUM(SO_REUSEPORT));
1264
    /* Allow local address and port reuse */
1265
    rb_define_const(rb_mSockConst, "SO_REUSEPORT", INT2NUM(SO_REUSEPORT));
1266
#endif
1267
#if defined(SO_TYPE)
1268
    /* Get the socket type */
1269
    rb_define_const(rb_cSocket, "SO_TYPE", INT2NUM(SO_TYPE));
1270
    /* Get the socket type */
1271
    rb_define_const(rb_mSockConst, "SO_TYPE", INT2NUM(SO_TYPE));
1272
#endif
1273
#if defined(SO_ERROR)
1274
    /* Get and clear the error status */
1275
    rb_define_const(rb_cSocket, "SO_ERROR", INT2NUM(SO_ERROR));
1276
    /* Get and clear the error status */
1277
    rb_define_const(rb_mSockConst, "SO_ERROR", INT2NUM(SO_ERROR));
1278
#endif
1279
#if defined(SO_DONTROUTE)
1280
    /* Use interface addresses */
1281
    rb_define_const(rb_cSocket, "SO_DONTROUTE", INT2NUM(SO_DONTROUTE));
1282
    /* Use interface addresses */
1283
    rb_define_const(rb_mSockConst, "SO_DONTROUTE", INT2NUM(SO_DONTROUTE));
1284
#endif
1285
#if defined(SO_BROADCAST)
1286
    /* Permit sending of broadcast messages */
1287
    rb_define_const(rb_cSocket, "SO_BROADCAST", INT2NUM(SO_BROADCAST));
1288
    /* Permit sending of broadcast messages */
1289
    rb_define_const(rb_mSockConst, "SO_BROADCAST", INT2NUM(SO_BROADCAST));
1290
#endif
1291
#if defined(SO_SNDBUF)
1292
    /* Send buffer size */
1293
    rb_define_const(rb_cSocket, "SO_SNDBUF", INT2NUM(SO_SNDBUF));
1294
    /* Send buffer size */
1295
    rb_define_const(rb_mSockConst, "SO_SNDBUF", INT2NUM(SO_SNDBUF));
1296
#endif
1297
#if defined(SO_RCVBUF)
1298
    /* Receive buffer size */
1299
    rb_define_const(rb_cSocket, "SO_RCVBUF", INT2NUM(SO_RCVBUF));
1300
    /* Receive buffer size */
1301
    rb_define_const(rb_mSockConst, "SO_RCVBUF", INT2NUM(SO_RCVBUF));
1302
#endif
1303
#if defined(SO_KEEPALIVE)
1304
    /* Keep connections alive */
1305
    rb_define_const(rb_cSocket, "SO_KEEPALIVE", INT2NUM(SO_KEEPALIVE));
1306
    /* Keep connections alive */
1307
    rb_define_const(rb_mSockConst, "SO_KEEPALIVE", INT2NUM(SO_KEEPALIVE));
1308
#endif
1309
#if defined(SO_OOBINLINE)
1310
    /* Leave received out-of-band data in-line */
1311
    rb_define_const(rb_cSocket, "SO_OOBINLINE", INT2NUM(SO_OOBINLINE));
1312
    /* Leave received out-of-band data in-line */
1313
    rb_define_const(rb_mSockConst, "SO_OOBINLINE", INT2NUM(SO_OOBINLINE));
1314
#endif
1315
#if defined(SO_NO_CHECK)
1316
    /* Disable checksums */
1317
    rb_define_const(rb_cSocket, "SO_NO_CHECK", INT2NUM(SO_NO_CHECK));
1318
    /* Disable checksums */
1319
    rb_define_const(rb_mSockConst, "SO_NO_CHECK", INT2NUM(SO_NO_CHECK));
1320
#endif
1321
#if defined(SO_PRIORITY)
1322
    /* The protocol-defined priority for all packets on this socket */
1323
    rb_define_const(rb_cSocket, "SO_PRIORITY", INT2NUM(SO_PRIORITY));
1324
    /* The protocol-defined priority for all packets on this socket */
1325
    rb_define_const(rb_mSockConst, "SO_PRIORITY", INT2NUM(SO_PRIORITY));
1326
#endif
1327
#if defined(SO_LINGER)
1328
    /* Linger on close if data is present */
1329
    rb_define_const(rb_cSocket, "SO_LINGER", INT2NUM(SO_LINGER));
1330
    /* Linger on close if data is present */
1331
    rb_define_const(rb_mSockConst, "SO_LINGER", INT2NUM(SO_LINGER));
1332
#endif
1333
#if defined(SO_PASSCRED)
1334
    /* Receive SCM_CREDENTIALS messages */
1335
    rb_define_const(rb_cSocket, "SO_PASSCRED", INT2NUM(SO_PASSCRED));
1336
    /* Receive SCM_CREDENTIALS messages */
1337
    rb_define_const(rb_mSockConst, "SO_PASSCRED", INT2NUM(SO_PASSCRED));
1338
#endif
1339
#if defined(SO_PEERCRED)
1340
    /* The credentials of the foreign process connected to this socket */
1341
    rb_define_const(rb_cSocket, "SO_PEERCRED", INT2NUM(SO_PEERCRED));
1342
    /* The credentials of the foreign process connected to this socket */
1343
    rb_define_const(rb_mSockConst, "SO_PEERCRED", INT2NUM(SO_PEERCRED));
1344
#endif
1345
#if defined(SO_RCVLOWAT)
1346
    /* Receive low-water mark */
1347
    rb_define_const(rb_cSocket, "SO_RCVLOWAT", INT2NUM(SO_RCVLOWAT));
1348
    /* Receive low-water mark */
1349
    rb_define_const(rb_mSockConst, "SO_RCVLOWAT", INT2NUM(SO_RCVLOWAT));
1350
#endif
1351
#if defined(SO_SNDLOWAT)
1352
    /* Send low-water mark */
1353
    rb_define_const(rb_cSocket, "SO_SNDLOWAT", INT2NUM(SO_SNDLOWAT));
1354
    /* Send low-water mark */
1355
    rb_define_const(rb_mSockConst, "SO_SNDLOWAT", INT2NUM(SO_SNDLOWAT));
1356
#endif
1357
#if defined(SO_RCVTIMEO)
1358
    /* Receive timeout */
1359
    rb_define_const(rb_cSocket, "SO_RCVTIMEO", INT2NUM(SO_RCVTIMEO));
1360
    /* Receive timeout */
1361
    rb_define_const(rb_mSockConst, "SO_RCVTIMEO", INT2NUM(SO_RCVTIMEO));
1362
#endif
1363
#if defined(SO_SNDTIMEO)
1364
    /* Send timeout */
1365
    rb_define_const(rb_cSocket, "SO_SNDTIMEO", INT2NUM(SO_SNDTIMEO));
1366
    /* Send timeout */
1367
    rb_define_const(rb_mSockConst, "SO_SNDTIMEO", INT2NUM(SO_SNDTIMEO));
1368
#endif
1369
#if defined(SO_ACCEPTCONN)
1370
    /* Socket has had listen() called on it */
1371
    rb_define_const(rb_cSocket, "SO_ACCEPTCONN", INT2NUM(SO_ACCEPTCONN));
1372
    /* Socket has had listen() called on it */
1373
    rb_define_const(rb_mSockConst, "SO_ACCEPTCONN", INT2NUM(SO_ACCEPTCONN));
1374
#endif
1375
#if defined(SO_USELOOPBACK)
1376
    /* Bypass hardware when possible */
1377
    rb_define_const(rb_cSocket, "SO_USELOOPBACK", INT2NUM(SO_USELOOPBACK));
1378
    /* Bypass hardware when possible */
1379
    rb_define_const(rb_mSockConst, "SO_USELOOPBACK", INT2NUM(SO_USELOOPBACK));
1380
#endif
1381
#if defined(SO_ACCEPTFILTER)
1382
    /* There is an accept filter */
1383
    rb_define_const(rb_cSocket, "SO_ACCEPTFILTER", INT2NUM(SO_ACCEPTFILTER));
1384
    /* There is an accept filter */
1385
    rb_define_const(rb_mSockConst, "SO_ACCEPTFILTER", INT2NUM(SO_ACCEPTFILTER));
1386
#endif
1387
#if defined(SO_DONTTRUNC)
1388
    /* Retain unread data */
1389
    rb_define_const(rb_cSocket, "SO_DONTTRUNC", INT2NUM(SO_DONTTRUNC));
1390
    /* Retain unread data */
1391
    rb_define_const(rb_mSockConst, "SO_DONTTRUNC", INT2NUM(SO_DONTTRUNC));
1392
#endif
1393
#if defined(SO_WANTMORE)
1394
    /* Give a hint when more data is ready */
1395
    rb_define_const(rb_cSocket, "SO_WANTMORE", INT2NUM(SO_WANTMORE));
1396
    /* Give a hint when more data is ready */
1397
    rb_define_const(rb_mSockConst, "SO_WANTMORE", INT2NUM(SO_WANTMORE));
1398
#endif
1399
#if defined(SO_WANTOOBFLAG)
1400
    /* OOB data is wanted in MSG_FLAG on receive */
1401
    rb_define_const(rb_cSocket, "SO_WANTOOBFLAG", INT2NUM(SO_WANTOOBFLAG));
1402
    /* OOB data is wanted in MSG_FLAG on receive */
1403
    rb_define_const(rb_mSockConst, "SO_WANTOOBFLAG", INT2NUM(SO_WANTOOBFLAG));
1404
#endif
1405
#if defined(SO_NREAD)
1406
    /* Get first packet byte count */
1407
    rb_define_const(rb_cSocket, "SO_NREAD", INT2NUM(SO_NREAD));
1408
    /* Get first packet byte count */
1409
    rb_define_const(rb_mSockConst, "SO_NREAD", INT2NUM(SO_NREAD));
1410
#endif
1411
#if defined(SO_NKE)
1412
    /* Install socket-level Network Kernel Extension */
1413
    rb_define_const(rb_cSocket, "SO_NKE", INT2NUM(SO_NKE));
1414
    /* Install socket-level Network Kernel Extension */
1415
    rb_define_const(rb_mSockConst, "SO_NKE", INT2NUM(SO_NKE));
1416
#endif
1417
#if defined(SO_NOSIGPIPE)
1418
    /* Don't SIGPIPE on EPIPE */
1419
    rb_define_const(rb_cSocket, "SO_NOSIGPIPE", INT2NUM(SO_NOSIGPIPE));
1420
    /* Don't SIGPIPE on EPIPE */
1421
    rb_define_const(rb_mSockConst, "SO_NOSIGPIPE", INT2NUM(SO_NOSIGPIPE));
1422
#endif
1423
#if defined(SO_SECURITY_AUTHENTICATION)
1424
    /*  */
1425
    rb_define_const(rb_cSocket, "SO_SECURITY_AUTHENTICATION", INT2NUM(SO_SECURITY_AUTHENTICATION));
1426
    /*  */
1427
    rb_define_const(rb_mSockConst, "SO_SECURITY_AUTHENTICATION", INT2NUM(SO_SECURITY_AUTHENTICATION));
1428
#endif
1429
#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT)
1430
    /*  */
1431
    rb_define_const(rb_cSocket, "SO_SECURITY_ENCRYPTION_TRANSPORT", INT2NUM(SO_SECURITY_ENCRYPTION_TRANSPORT));
1432
    /*  */
1433
    rb_define_const(rb_mSockConst, "SO_SECURITY_ENCRYPTION_TRANSPORT", INT2NUM(SO_SECURITY_ENCRYPTION_TRANSPORT));
1434
#endif
1435
#if defined(SO_SECURITY_ENCRYPTION_NETWORK)
1436
    /*  */
1437
    rb_define_const(rb_cSocket, "SO_SECURITY_ENCRYPTION_NETWORK", INT2NUM(SO_SECURITY_ENCRYPTION_NETWORK));
1438
    /*  */
1439
    rb_define_const(rb_mSockConst, "SO_SECURITY_ENCRYPTION_NETWORK", INT2NUM(SO_SECURITY_ENCRYPTION_NETWORK));
1440
#endif
1441
#if defined(SO_BINDTODEVICE)
1442
    /* Only send packets from the given interface */
1443
    rb_define_const(rb_cSocket, "SO_BINDTODEVICE", INT2NUM(SO_BINDTODEVICE));
1444
    /* Only send packets from the given interface */
1445
    rb_define_const(rb_mSockConst, "SO_BINDTODEVICE", INT2NUM(SO_BINDTODEVICE));
1446
#endif
1447
#if defined(SO_ATTACH_FILTER)
1448
    /* Attach an accept filter */
1449
    rb_define_const(rb_cSocket, "SO_ATTACH_FILTER", INT2NUM(SO_ATTACH_FILTER));
1450
    /* Attach an accept filter */
1451
    rb_define_const(rb_mSockConst, "SO_ATTACH_FILTER", INT2NUM(SO_ATTACH_FILTER));
1452
#endif
1453
#if defined(SO_DETACH_FILTER)
1454
    /* Detach an accept filter */
1455
    rb_define_const(rb_cSocket, "SO_DETACH_FILTER", INT2NUM(SO_DETACH_FILTER));
1456
    /* Detach an accept filter */
1457
    rb_define_const(rb_mSockConst, "SO_DETACH_FILTER", INT2NUM(SO_DETACH_FILTER));
1458
#endif
1459
#if defined(SO_PEERNAME)
1460
    /* Name of the connecting user */
1461
    rb_define_const(rb_cSocket, "SO_PEERNAME", INT2NUM(SO_PEERNAME));
1462
    /* Name of the connecting user */
1463
    rb_define_const(rb_mSockConst, "SO_PEERNAME", INT2NUM(SO_PEERNAME));
1464
#endif
1465
#if defined(SO_TIMESTAMP)
1466
    /* Receive timestamp with datagrams (timeval) */
1467
    rb_define_const(rb_cSocket, "SO_TIMESTAMP", INT2NUM(SO_TIMESTAMP));
1468
    /* Receive timestamp with datagrams (timeval) */
1469
    rb_define_const(rb_mSockConst, "SO_TIMESTAMP", INT2NUM(SO_TIMESTAMP));
1470
#endif
1471
#if defined(SO_TIMESTAMPNS)
1472
    /* Receive nanosecond timestamp with datagrams (timespec) */
1473
    rb_define_const(rb_cSocket, "SO_TIMESTAMPNS", INT2NUM(SO_TIMESTAMPNS));
1474
    /* Receive nanosecond timestamp with datagrams (timespec) */
1475
    rb_define_const(rb_mSockConst, "SO_TIMESTAMPNS", INT2NUM(SO_TIMESTAMPNS));
1476
#endif
1477
#if defined(SO_BINTIME)
1478
    /* Receive timestamp with datagrams (bintime) */
1479
    rb_define_const(rb_cSocket, "SO_BINTIME", INT2NUM(SO_BINTIME));
1480
    /* Receive timestamp with datagrams (bintime) */
1481
    rb_define_const(rb_mSockConst, "SO_BINTIME", INT2NUM(SO_BINTIME));
1482
#endif
1483
#if defined(SO_RECVUCRED)
1484
    /* Receive user credentials with datagram */
1485
    rb_define_const(rb_cSocket, "SO_RECVUCRED", INT2NUM(SO_RECVUCRED));
1486
    /* Receive user credentials with datagram */
1487
    rb_define_const(rb_mSockConst, "SO_RECVUCRED", INT2NUM(SO_RECVUCRED));
1488
#endif
1489
#if defined(SO_MAC_EXEMPT)
1490
    /* Mandatory Access Control exemption for unlabeled peers */
1491
    rb_define_const(rb_cSocket, "SO_MAC_EXEMPT", INT2NUM(SO_MAC_EXEMPT));
1492
    /* Mandatory Access Control exemption for unlabeled peers */
1493
    rb_define_const(rb_mSockConst, "SO_MAC_EXEMPT", INT2NUM(SO_MAC_EXEMPT));
1494
#endif
1495
#if defined(SO_ALLZONES)
1496
    /* Bypass zone boundaries */
1497
    rb_define_const(rb_cSocket, "SO_ALLZONES", INT2NUM(SO_ALLZONES));
1498
    /* Bypass zone boundaries */
1499
    rb_define_const(rb_mSockConst, "SO_ALLZONES", INT2NUM(SO_ALLZONES));
1500
#endif
1501
#if defined(SOPRI_INTERACTIVE)
1502
    /* Interactive socket priority */
1503
    rb_define_const(rb_cSocket, "SOPRI_INTERACTIVE", INT2NUM(SOPRI_INTERACTIVE));
1504
    /* Interactive socket priority */
1505
    rb_define_const(rb_mSockConst, "SOPRI_INTERACTIVE", INT2NUM(SOPRI_INTERACTIVE));
1506
#endif
1507
#if defined(SOPRI_NORMAL)
1508
    /* Normal socket priority */
1509
    rb_define_const(rb_cSocket, "SOPRI_NORMAL", INT2NUM(SOPRI_NORMAL));
1510
    /* Normal socket priority */
1511
    rb_define_const(rb_mSockConst, "SOPRI_NORMAL", INT2NUM(SOPRI_NORMAL));
1512
#endif
1513
#if defined(SOPRI_BACKGROUND)
1514
    /* Background socket priority */
1515
    rb_define_const(rb_cSocket, "SOPRI_BACKGROUND", INT2NUM(SOPRI_BACKGROUND));
1516
    /* Background socket priority */
1517
    rb_define_const(rb_mSockConst, "SOPRI_BACKGROUND", INT2NUM(SOPRI_BACKGROUND));
1518
#endif
1519
#if defined(IPX_TYPE)
1520
    /*  */
1521
    rb_define_const(rb_cSocket, "IPX_TYPE", INT2NUM(IPX_TYPE));
1522
    /*  */
1523
    rb_define_const(rb_mSockConst, "IPX_TYPE", INT2NUM(IPX_TYPE));
1524
#endif
1525
#if defined(TCP_NODELAY)
1526
    /* Don't delay sending to coalesce packets */
1527
    rb_define_const(rb_cSocket, "TCP_NODELAY", INT2NUM(TCP_NODELAY));
1528
    /* Don't delay sending to coalesce packets */
1529
    rb_define_const(rb_mSockConst, "TCP_NODELAY", INT2NUM(TCP_NODELAY));
1530
#endif
1531
#if defined(TCP_MAXSEG)
1532
    /* Set maximum segment size */
1533
    rb_define_const(rb_cSocket, "TCP_MAXSEG", INT2NUM(TCP_MAXSEG));
1534
    /* Set maximum segment size */
1535
    rb_define_const(rb_mSockConst, "TCP_MAXSEG", INT2NUM(TCP_MAXSEG));
1536
#endif
1537
#if defined(TCP_CORK)
1538
    /* Don't send partial frames */
1539
    rb_define_const(rb_cSocket, "TCP_CORK", INT2NUM(TCP_CORK));
1540
    /* Don't send partial frames */
1541
    rb_define_const(rb_mSockConst, "TCP_CORK", INT2NUM(TCP_CORK));
1542
#endif
1543
#if defined(TCP_DEFER_ACCEPT)
1544
    /* Don't notify a listening socket until data is ready */
1545
    rb_define_const(rb_cSocket, "TCP_DEFER_ACCEPT", INT2NUM(TCP_DEFER_ACCEPT));
1546
    /* Don't notify a listening socket until data is ready */
1547
    rb_define_const(rb_mSockConst, "TCP_DEFER_ACCEPT", INT2NUM(TCP_DEFER_ACCEPT));
1548
#endif
1549
#if defined(TCP_INFO)
1550
    /* Retrieve information about this socket */
1551
    rb_define_const(rb_cSocket, "TCP_INFO", INT2NUM(TCP_INFO));
1552
    /* Retrieve information about this socket */
1553
    rb_define_const(rb_mSockConst, "TCP_INFO", INT2NUM(TCP_INFO));
1554
#endif
1555
#if defined(TCP_KEEPCNT)
1556
    /* Maximum number of keepalive probes allowed before dropping a connection */
1557
    rb_define_const(rb_cSocket, "TCP_KEEPCNT", INT2NUM(TCP_KEEPCNT));
1558
    /* Maximum number of keepalive probes allowed before dropping a connection */
1559
    rb_define_const(rb_mSockConst, "TCP_KEEPCNT", INT2NUM(TCP_KEEPCNT));
1560
#endif
1561
#if defined(TCP_KEEPIDLE)
1562
    /* Idle time before keepalive probes are sent */
1563
    rb_define_const(rb_cSocket, "TCP_KEEPIDLE", INT2NUM(TCP_KEEPIDLE));
1564
    /* Idle time before keepalive probes are sent */
1565
    rb_define_const(rb_mSockConst, "TCP_KEEPIDLE", INT2NUM(TCP_KEEPIDLE));
1566
#endif
1567
#if defined(TCP_KEEPINTVL)
1568
    /* Time between keepalive probes */
1569
    rb_define_const(rb_cSocket, "TCP_KEEPINTVL", INT2NUM(TCP_KEEPINTVL));
1570
    /* Time between keepalive probes */
1571
    rb_define_const(rb_mSockConst, "TCP_KEEPINTVL", INT2NUM(TCP_KEEPINTVL));
1572
#endif
1573
#if defined(TCP_LINGER2)
1574
    /* Lifetime of orphaned FIN_WAIT2 sockets */
1575
    rb_define_const(rb_cSocket, "TCP_LINGER2", INT2NUM(TCP_LINGER2));
1576
    /* Lifetime of orphaned FIN_WAIT2 sockets */
1577
    rb_define_const(rb_mSockConst, "TCP_LINGER2", INT2NUM(TCP_LINGER2));
1578
#endif
1579
#if defined(TCP_MD5SIG)
1580
    /* Use MD5 digests (RFC2385) */
1581
    rb_define_const(rb_cSocket, "TCP_MD5SIG", INT2NUM(TCP_MD5SIG));
1582
    /* Use MD5 digests (RFC2385) */
1583
    rb_define_const(rb_mSockConst, "TCP_MD5SIG", INT2NUM(TCP_MD5SIG));
1584
#endif
1585
#if defined(TCP_NOOPT)
1586
    /* Don't use TCP options */
1587
    rb_define_const(rb_cSocket, "TCP_NOOPT", INT2NUM(TCP_NOOPT));
1588
    /* Don't use TCP options */
1589
    rb_define_const(rb_mSockConst, "TCP_NOOPT", INT2NUM(TCP_NOOPT));
1590
#endif
1591
#if defined(TCP_NOPUSH)
1592
    /* Don't push the last block of write */
1593
    rb_define_const(rb_cSocket, "TCP_NOPUSH", INT2NUM(TCP_NOPUSH));
1594
    /* Don't push the last block of write */
1595
    rb_define_const(rb_mSockConst, "TCP_NOPUSH", INT2NUM(TCP_NOPUSH));
1596
#endif
1597
#if defined(TCP_QUICKACK)
1598
    /* Enable quickack mode */
1599
    rb_define_const(rb_cSocket, "TCP_QUICKACK", INT2NUM(TCP_QUICKACK));
1600
    /* Enable quickack mode */
1601
    rb_define_const(rb_mSockConst, "TCP_QUICKACK", INT2NUM(TCP_QUICKACK));
1602
#endif
1603
#if defined(TCP_SYNCNT)
1604
    /* Number of SYN retransmits before a connection is dropped */
1605
    rb_define_const(rb_cSocket, "TCP_SYNCNT", INT2NUM(TCP_SYNCNT));
1606
    /* Number of SYN retransmits before a connection is dropped */
1607
    rb_define_const(rb_mSockConst, "TCP_SYNCNT", INT2NUM(TCP_SYNCNT));
1608
#endif
1609
#if defined(TCP_WINDOW_CLAMP)
1610
    /* Clamp the size of the advertised window */
1611
    rb_define_const(rb_cSocket, "TCP_WINDOW_CLAMP", INT2NUM(TCP_WINDOW_CLAMP));
1612
    /* Clamp the size of the advertised window */
1613
    rb_define_const(rb_mSockConst, "TCP_WINDOW_CLAMP", INT2NUM(TCP_WINDOW_CLAMP));
1614
#endif
1615
#if defined(UDP_CORK)
1616
    /* Don't send partial frames */
1617
    rb_define_const(rb_cSocket, "UDP_CORK", INT2NUM(UDP_CORK));
1618
    /* Don't send partial frames */
1619
    rb_define_const(rb_mSockConst, "UDP_CORK", INT2NUM(UDP_CORK));
1620
#endif
1621
#if defined(EAI_ADDRFAMILY)
1622
    /* Address family for hostname not supported */
1623
    rb_define_const(rb_cSocket, "EAI_ADDRFAMILY", INT2NUM(EAI_ADDRFAMILY));
1624
    /* Address family for hostname not supported */
1625
    rb_define_const(rb_mSockConst, "EAI_ADDRFAMILY", INT2NUM(EAI_ADDRFAMILY));
1626
#endif
1627
#if defined(EAI_AGAIN)
1628
    /* Temporary failure in name resolution */
1629
    rb_define_const(rb_cSocket, "EAI_AGAIN", INT2NUM(EAI_AGAIN));
1630
    /* Temporary failure in name resolution */
1631
    rb_define_const(rb_mSockConst, "EAI_AGAIN", INT2NUM(EAI_AGAIN));
1632
#endif
1633
#if defined(EAI_BADFLAGS)
1634
    /* Invalid flags */
1635
    rb_define_const(rb_cSocket, "EAI_BADFLAGS", INT2NUM(EAI_BADFLAGS));
1636
    /* Invalid flags */
1637
    rb_define_const(rb_mSockConst, "EAI_BADFLAGS", INT2NUM(EAI_BADFLAGS));
1638
#endif
1639
#if defined(EAI_FAIL)
1640
    /* Non-recoverable failure in name resolution */
1641
    rb_define_const(rb_cSocket, "EAI_FAIL", INT2NUM(EAI_FAIL));
1642
    /* Non-recoverable failure in name resolution */
1643
    rb_define_const(rb_mSockConst, "EAI_FAIL", INT2NUM(EAI_FAIL));
1644
#endif
1645
#if defined(EAI_FAMILY)
1646
    /* Address family not supported */
1647
    rb_define_const(rb_cSocket, "EAI_FAMILY", INT2NUM(EAI_FAMILY));
1648
    /* Address family not supported */
1649
    rb_define_const(rb_mSockConst, "EAI_FAMILY", INT2NUM(EAI_FAMILY));
1650
#endif
1651
#if defined(EAI_MEMORY)
1652
    /* Memory allocation failure */
1653
    rb_define_const(rb_cSocket, "EAI_MEMORY", INT2NUM(EAI_MEMORY));
1654
    /* Memory allocation failure */
1655
    rb_define_const(rb_mSockConst, "EAI_MEMORY", INT2NUM(EAI_MEMORY));
1656
#endif
1657
#if defined(EAI_NODATA)
1658
    /* No address associated with hostname */
1659
    rb_define_const(rb_cSocket, "EAI_NODATA", INT2NUM(EAI_NODATA));
1660
    /* No address associated with hostname */
1661
    rb_define_const(rb_mSockConst, "EAI_NODATA", INT2NUM(EAI_NODATA));
1662
#endif
1663
#if defined(EAI_NONAME)
1664
    /* Hostname nor servname, or not known */
1665
    rb_define_const(rb_cSocket, "EAI_NONAME", INT2NUM(EAI_NONAME));
1666
    /* Hostname nor servname, or not known */
1667
    rb_define_const(rb_mSockConst, "EAI_NONAME", INT2NUM(EAI_NONAME));
1668
#endif
1669
#if defined(EAI_OVERFLOW)
1670
    /* Argument buffer overflow */
1671
    rb_define_const(rb_cSocket, "EAI_OVERFLOW", INT2NUM(EAI_OVERFLOW));
1672
    /* Argument buffer overflow */
1673
    rb_define_const(rb_mSockConst, "EAI_OVERFLOW", INT2NUM(EAI_OVERFLOW));
1674
#endif
1675
#if defined(EAI_SERVICE)
1676
    /* Servname not supported for socket type */
1677
    rb_define_const(rb_cSocket, "EAI_SERVICE", INT2NUM(EAI_SERVICE));
1678
    /* Servname not supported for socket type */
1679
    rb_define_const(rb_mSockConst, "EAI_SERVICE", INT2NUM(EAI_SERVICE));
1680
#endif
1681
#if defined(EAI_SOCKTYPE)
1682
    /* Socket type not supported */
1683
    rb_define_const(rb_cSocket, "EAI_SOCKTYPE", INT2NUM(EAI_SOCKTYPE));
1684
    /* Socket type not supported */
1685
    rb_define_const(rb_mSockConst, "EAI_SOCKTYPE", INT2NUM(EAI_SOCKTYPE));
1686
#endif
1687
#if defined(EAI_SYSTEM)
1688
    /* System error returned in errno */
1689
    rb_define_const(rb_cSocket, "EAI_SYSTEM", INT2NUM(EAI_SYSTEM));
1690
    /* System error returned in errno */
1691
    rb_define_const(rb_mSockConst, "EAI_SYSTEM", INT2NUM(EAI_SYSTEM));
1692
#endif
1693
#if defined(EAI_BADHINTS)
1694
    /* Invalid value for hints */
1695
    rb_define_const(rb_cSocket, "EAI_BADHINTS", INT2NUM(EAI_BADHINTS));
1696
    /* Invalid value for hints */
1697
    rb_define_const(rb_mSockConst, "EAI_BADHINTS", INT2NUM(EAI_BADHINTS));
1698
#endif
1699
#if defined(EAI_PROTOCOL)
1700
    /* Resolved protocol is unknown */
1701
    rb_define_const(rb_cSocket, "EAI_PROTOCOL", INT2NUM(EAI_PROTOCOL));
1702
    /* Resolved protocol is unknown */
1703
    rb_define_const(rb_mSockConst, "EAI_PROTOCOL", INT2NUM(EAI_PROTOCOL));
1704
#endif
1705
#if defined(EAI_MAX)
1706
    /* Maximum error code from getaddrinfo */
1707
    rb_define_const(rb_cSocket, "EAI_MAX", INT2NUM(EAI_MAX));
1708
    /* Maximum error code from getaddrinfo */
1709
    rb_define_const(rb_mSockConst, "EAI_MAX", INT2NUM(EAI_MAX));
1710
#endif
1711
#if defined(AI_PASSIVE)
1712
    /* Get address to use with bind() */
1713
    rb_define_const(rb_cSocket, "AI_PASSIVE", INT2NUM(AI_PASSIVE));
1714
    /* Get address to use with bind() */
1715
    rb_define_const(rb_mSockConst, "AI_PASSIVE", INT2NUM(AI_PASSIVE));
1716
#endif
1717
#if defined(AI_CANONNAME)
1718
    /* Fill in the canonical name */
1719
    rb_define_const(rb_cSocket, "AI_CANONNAME", INT2NUM(AI_CANONNAME));
1720
    /* Fill in the canonical name */
1721
    rb_define_const(rb_mSockConst, "AI_CANONNAME", INT2NUM(AI_CANONNAME));
1722
#endif
1723
#if defined(AI_NUMERICHOST)
1724
    /* Prevent host name resolution */
1725
    rb_define_const(rb_cSocket, "AI_NUMERICHOST", INT2NUM(AI_NUMERICHOST));
1726
    /* Prevent host name resolution */
1727
    rb_define_const(rb_mSockConst, "AI_NUMERICHOST", INT2NUM(AI_NUMERICHOST));
1728
#endif
1729
#if defined(AI_NUMERICSERV)
1730
    /* Prevent service name resolution */
1731
    rb_define_const(rb_cSocket, "AI_NUMERICSERV", INT2NUM(AI_NUMERICSERV));
1732
    /* Prevent service name resolution */
1733
    rb_define_const(rb_mSockConst, "AI_NUMERICSERV", INT2NUM(AI_NUMERICSERV));
1734
#endif
1735
#if defined(AI_MASK)
1736
    /* Valid flag mask for getaddrinfo (not for application use) */
1737
    rb_define_const(rb_cSocket, "AI_MASK", INT2NUM(AI_MASK));
1738
    /* Valid flag mask for getaddrinfo (not for application use) */
1739
    rb_define_const(rb_mSockConst, "AI_MASK", INT2NUM(AI_MASK));
1740
#endif
1741
#if defined(AI_ALL)
1742
    /* Allow all addresses */
1743
    rb_define_const(rb_cSocket, "AI_ALL", INT2NUM(AI_ALL));
1744
    /* Allow all addresses */
1745
    rb_define_const(rb_mSockConst, "AI_ALL", INT2NUM(AI_ALL));
1746
#endif
1747
#if defined(AI_V4MAPPED_CFG)
1748
    /* Accept IPv4 mapped addresses if the kernel supports it */
1749
    rb_define_const(rb_cSocket, "AI_V4MAPPED_CFG", INT2NUM(AI_V4MAPPED_CFG));
1750
    /* Accept IPv4 mapped addresses if the kernel supports it */
1751
    rb_define_const(rb_mSockConst, "AI_V4MAPPED_CFG", INT2NUM(AI_V4MAPPED_CFG));
1752
#endif
1753
#if defined(AI_ADDRCONFIG)
1754
    /* Accept only if any address is assigned */
1755
    rb_define_const(rb_cSocket, "AI_ADDRCONFIG", INT2NUM(AI_ADDRCONFIG));
1756
    /* Accept only if any address is assigned */
1757
    rb_define_const(rb_mSockConst, "AI_ADDRCONFIG", INT2NUM(AI_ADDRCONFIG));
1758
#endif
1759
#if defined(AI_V4MAPPED)
1760
    /* Accept IPv4-mapped IPv6 addresses */
1761
    rb_define_const(rb_cSocket, "AI_V4MAPPED", INT2NUM(AI_V4MAPPED));
1762
    /* Accept IPv4-mapped IPv6 addresses */
1763
    rb_define_const(rb_mSockConst, "AI_V4MAPPED", INT2NUM(AI_V4MAPPED));
1764
#endif
1765
#if defined(AI_DEFAULT)
1766
    /* Default flags for getaddrinfo */
1767
    rb_define_const(rb_cSocket, "AI_DEFAULT", INT2NUM(AI_DEFAULT));
1768
    /* Default flags for getaddrinfo */
1769
    rb_define_const(rb_mSockConst, "AI_DEFAULT", INT2NUM(AI_DEFAULT));
1770
#endif
1771
#if defined(NI_MAXHOST)
1772
    /* Maximum length of a hostname */
1773
    rb_define_const(rb_cSocket, "NI_MAXHOST", INT2NUM(NI_MAXHOST));
1774
    /* Maximum length of a hostname */
1775
    rb_define_const(rb_mSockConst, "NI_MAXHOST", INT2NUM(NI_MAXHOST));
1776
#endif
1777
#if defined(NI_MAXSERV)
1778
    /* Maximum length of a service name */
1779
    rb_define_const(rb_cSocket, "NI_MAXSERV", INT2NUM(NI_MAXSERV));
1780
    /* Maximum length of a service name */
1781
    rb_define_const(rb_mSockConst, "NI_MAXSERV", INT2NUM(NI_MAXSERV));
1782
#endif
1783
#if defined(NI_NOFQDN)
1784
    /* An FQDN is not required for local hosts, return only the local part */
1785
    rb_define_const(rb_cSocket, "NI_NOFQDN", INT2NUM(NI_NOFQDN));
1786
    /* An FQDN is not required for local hosts, return only the local part */
1787
    rb_define_const(rb_mSockConst, "NI_NOFQDN", INT2NUM(NI_NOFQDN));
1788
#endif
1789
#if defined(NI_NUMERICHOST)
1790
    /* Return a numeric address */
1791
    rb_define_const(rb_cSocket, "NI_NUMERICHOST", INT2NUM(NI_NUMERICHOST));
1792
    /* Return a numeric address */
1793
    rb_define_const(rb_mSockConst, "NI_NUMERICHOST", INT2NUM(NI_NUMERICHOST));
1794
#endif
1795
#if defined(NI_NAMEREQD)
1796
    /* A name is required */
1797
    rb_define_const(rb_cSocket, "NI_NAMEREQD", INT2NUM(NI_NAMEREQD));
1798
    /* A name is required */
1799
    rb_define_const(rb_mSockConst, "NI_NAMEREQD", INT2NUM(NI_NAMEREQD));
1800
#endif
1801
#if defined(NI_NUMERICSERV)
1802
    /* Return the service name as a digit string */
1803
    rb_define_const(rb_cSocket, "NI_NUMERICSERV", INT2NUM(NI_NUMERICSERV));
1804
    /* Return the service name as a digit string */
1805
    rb_define_const(rb_mSockConst, "NI_NUMERICSERV", INT2NUM(NI_NUMERICSERV));
1806
#endif
1807
#if defined(NI_DGRAM)
1808
    /* The service specified is a datagram service (looks up UDP ports) */
1809
    rb_define_const(rb_cSocket, "NI_DGRAM", INT2NUM(NI_DGRAM));
1810
    /* The service specified is a datagram service (looks up UDP ports) */
1811
    rb_define_const(rb_mSockConst, "NI_DGRAM", INT2NUM(NI_DGRAM));
1812
#endif
1813
#if defined(SHUT_RD)
1814
    /* Shut down the reading side of the socket */
1815
    rb_define_const(rb_cSocket, "SHUT_RD", INT2NUM(SHUT_RD));
1816
    /* Shut down the reading side of the socket */
1817
    rb_define_const(rb_mSockConst, "SHUT_RD", INT2NUM(SHUT_RD));
1818
#endif
1819
#if defined(SHUT_WR)
1820
    /* Shut down the writing side of the socket */
1821
    rb_define_const(rb_cSocket, "SHUT_WR", INT2NUM(SHUT_WR));
1822
    /* Shut down the writing side of the socket */
1823
    rb_define_const(rb_mSockConst, "SHUT_WR", INT2NUM(SHUT_WR));
1824
#endif
1825
#if defined(SHUT_RDWR)
1826
    /* Shut down the both sides of the socket */
1827
    rb_define_const(rb_cSocket, "SHUT_RDWR", INT2NUM(SHUT_RDWR));
1828
    /* Shut down the both sides of the socket */
1829
    rb_define_const(rb_mSockConst, "SHUT_RDWR", INT2NUM(SHUT_RDWR));
1830
#endif
1831
#if defined(INET6)
1832
#if defined(IPV6_JOIN_GROUP)
1833
    /* Join a group membership */
1834
    rb_define_const(rb_cSocket, "IPV6_JOIN_GROUP", INT2NUM(IPV6_JOIN_GROUP));
1835
    /* Join a group membership */
1836
    rb_define_const(rb_mSockConst, "IPV6_JOIN_GROUP", INT2NUM(IPV6_JOIN_GROUP));
1837
#endif
1838
#endif
1839
#if defined(INET6)
1840
#if defined(IPV6_LEAVE_GROUP)
1841
    /* Leave a group membership */
1842
    rb_define_const(rb_cSocket, "IPV6_LEAVE_GROUP", INT2NUM(IPV6_LEAVE_GROUP));
1843
    /* Leave a group membership */
1844
    rb_define_const(rb_mSockConst, "IPV6_LEAVE_GROUP", INT2NUM(IPV6_LEAVE_GROUP));
1845
#endif
1846
#endif
1847
#if defined(INET6)
1848
#if defined(IPV6_MULTICAST_HOPS)
1849
    /* IP6 multicast hops */
1850
    rb_define_const(rb_cSocket, "IPV6_MULTICAST_HOPS", INT2NUM(IPV6_MULTICAST_HOPS));
1851
    /* IP6 multicast hops */
1852
    rb_define_const(rb_mSockConst, "IPV6_MULTICAST_HOPS", INT2NUM(IPV6_MULTICAST_HOPS));
1853
#endif
1854
#endif
1855
#if defined(INET6)
1856
#if defined(IPV6_MULTICAST_IF)
1857
    /* IP6 multicast interface */
1858
    rb_define_const(rb_cSocket, "IPV6_MULTICAST_IF", INT2NUM(IPV6_MULTICAST_IF));
1859
    /* IP6 multicast interface */
1860
    rb_define_const(rb_mSockConst, "IPV6_MULTICAST_IF", INT2NUM(IPV6_MULTICAST_IF));
1861
#endif
1862
#endif
1863
#if defined(INET6)
1864
#if defined(IPV6_MULTICAST_LOOP)
1865
    /* IP6 multicast loopback */
1866
    rb_define_const(rb_cSocket, "IPV6_MULTICAST_LOOP", INT2NUM(IPV6_MULTICAST_LOOP));
1867
    /* IP6 multicast loopback */
1868
    rb_define_const(rb_mSockConst, "IPV6_MULTICAST_LOOP", INT2NUM(IPV6_MULTICAST_LOOP));
1869
#endif
1870
#endif
1871
#if defined(INET6)
1872
#if defined(IPV6_UNICAST_HOPS)
1873
    /* IP6 unicast hops */
1874
    rb_define_const(rb_cSocket, "IPV6_UNICAST_HOPS", INT2NUM(IPV6_UNICAST_HOPS));
1875
    /* IP6 unicast hops */
1876
    rb_define_const(rb_mSockConst, "IPV6_UNICAST_HOPS", INT2NUM(IPV6_UNICAST_HOPS));
1877
#endif
1878
#endif
1879
#if defined(INET6)
1880
#if defined(IPV6_V6ONLY)
1881
    /* Only bind IPv6 with a wildcard bind */
1882
    rb_define_const(rb_cSocket, "IPV6_V6ONLY", INT2NUM(IPV6_V6ONLY));
1883
    /* Only bind IPv6 with a wildcard bind */
1884
    rb_define_const(rb_mSockConst, "IPV6_V6ONLY", INT2NUM(IPV6_V6ONLY));
1885
#endif
1886
#endif
1887
#if defined(INET6)
1888
#if defined(IPV6_CHECKSUM)
1889
    /* Checksum offset for raw sockets */
1890
    rb_define_const(rb_cSocket, "IPV6_CHECKSUM", INT2NUM(IPV6_CHECKSUM));
1891
    /* Checksum offset for raw sockets */
1892
    rb_define_const(rb_mSockConst, "IPV6_CHECKSUM", INT2NUM(IPV6_CHECKSUM));
1893
#endif
1894
#endif
1895
#if defined(INET6)
1896
#if defined(IPV6_DONTFRAG)
1897
    /* Don't fragment packets */
1898
    rb_define_const(rb_cSocket, "IPV6_DONTFRAG", INT2NUM(IPV6_DONTFRAG));
1899
    /* Don't fragment packets */
1900
    rb_define_const(rb_mSockConst, "IPV6_DONTFRAG", INT2NUM(IPV6_DONTFRAG));
1901
#endif
1902
#endif
1903
#if defined(INET6)
1904
#if defined(IPV6_DSTOPTS)
1905
    /* Destination option */
1906
    rb_define_const(rb_cSocket, "IPV6_DSTOPTS", INT2NUM(IPV6_DSTOPTS));
1907
    /* Destination option */
1908
    rb_define_const(rb_mSockConst, "IPV6_DSTOPTS", INT2NUM(IPV6_DSTOPTS));
1909
#endif
1910
#endif
1911
#if defined(INET6)
1912
#if defined(IPV6_HOPLIMIT)
1913
    /* Hop limit */
1914
    rb_define_const(rb_cSocket, "IPV6_HOPLIMIT", INT2NUM(IPV6_HOPLIMIT));
1915
    /* Hop limit */
1916
    rb_define_const(rb_mSockConst, "IPV6_HOPLIMIT", INT2NUM(IPV6_HOPLIMIT));
1917
#endif
1918
#endif
1919
#if defined(INET6)
1920
#if defined(IPV6_HOPOPTS)
1921
    /* Hop-by-hop option */
1922
    rb_define_const(rb_cSocket, "IPV6_HOPOPTS", INT2NUM(IPV6_HOPOPTS));
1923
    /* Hop-by-hop option */
1924
    rb_define_const(rb_mSockConst, "IPV6_HOPOPTS", INT2NUM(IPV6_HOPOPTS));
1925
#endif
1926
#endif
1927
#if defined(INET6)
1928
#if defined(IPV6_NEXTHOP)
1929
    /* Next hop address */
1930
    rb_define_const(rb_cSocket, "IPV6_NEXTHOP", INT2NUM(IPV6_NEXTHOP));
1931
    /* Next hop address */
1932
    rb_define_const(rb_mSockConst, "IPV6_NEXTHOP", INT2NUM(IPV6_NEXTHOP));
1933
#endif
1934
#endif
1935
#if defined(INET6)
1936
#if defined(IPV6_PATHMTU)
1937
    /* Retrieve current path MTU */
1938
    rb_define_const(rb_cSocket, "IPV6_PATHMTU", INT2NUM(IPV6_PATHMTU));
1939
    /* Retrieve current path MTU */
1940
    rb_define_const(rb_mSockConst, "IPV6_PATHMTU", INT2NUM(IPV6_PATHMTU));
1941
#endif
1942
#endif
1943
#if defined(INET6)
1944
#if defined(IPV6_PKTINFO)
1945
    /* Receive packet information with datagram */
1946
    rb_define_const(rb_cSocket, "IPV6_PKTINFO", INT2NUM(IPV6_PKTINFO));
1947
    /* Receive packet information with datagram */
1948
    rb_define_const(rb_mSockConst, "IPV6_PKTINFO", INT2NUM(IPV6_PKTINFO));
1949
#endif
1950
#endif
1951
#if defined(INET6)
1952
#if defined(IPV6_RECVDSTOPTS)
1953
    /* Receive all IP6 options for response */
1954
    rb_define_const(rb_cSocket, "IPV6_RECVDSTOPTS", INT2NUM(IPV6_RECVDSTOPTS));
1955
    /* Receive all IP6 options for response */
1956
    rb_define_const(rb_mSockConst, "IPV6_RECVDSTOPTS", INT2NUM(IPV6_RECVDSTOPTS));
1957
#endif
1958
#endif
1959
#if defined(INET6)
1960
#if defined(IPV6_RECVHOPLIMIT)
1961
    /* Receive hop limit with datagram */
1962
    rb_define_const(rb_cSocket, "IPV6_RECVHOPLIMIT", INT2NUM(IPV6_RECVHOPLIMIT));
1963
    /* Receive hop limit with datagram */
1964
    rb_define_const(rb_mSockConst, "IPV6_RECVHOPLIMIT", INT2NUM(IPV6_RECVHOPLIMIT));
1965
#endif
1966
#endif
1967
#if defined(INET6)
1968
#if defined(IPV6_RECVHOPOPTS)
1969
    /* Receive hop-by-hop options */
1970
    rb_define_const(rb_cSocket, "IPV6_RECVHOPOPTS", INT2NUM(IPV6_RECVHOPOPTS));
1971
    /* Receive hop-by-hop options */
1972
    rb_define_const(rb_mSockConst, "IPV6_RECVHOPOPTS", INT2NUM(IPV6_RECVHOPOPTS));
1973
#endif
1974
#endif
1975
#if defined(INET6)
1976
#if defined(IPV6_RECVPKTINFO)
1977
    /* Receive destination IP address and incoming interface */
1978
    rb_define_const(rb_cSocket, "IPV6_RECVPKTINFO", INT2NUM(IPV6_RECVPKTINFO));
1979
    /* Receive destination IP address and incoming interface */
1980
    rb_define_const(rb_mSockConst, "IPV6_RECVPKTINFO", INT2NUM(IPV6_RECVPKTINFO));
1981
#endif
1982
#endif
1983
#if defined(INET6)
1984
#if defined(IPV6_RECVRTHDR)
1985
    /* Receive routing header */
1986
    rb_define_const(rb_cSocket, "IPV6_RECVRTHDR", INT2NUM(IPV6_RECVRTHDR));
1987
    /* Receive routing header */
1988
    rb_define_const(rb_mSockConst, "IPV6_RECVRTHDR", INT2NUM(IPV6_RECVRTHDR));
1989
#endif
1990
#endif
1991
#if defined(INET6)
1992
#if defined(IPV6_RECVTCLASS)
1993
    /* Receive traffic class */
1994
    rb_define_const(rb_cSocket, "IPV6_RECVTCLASS", INT2NUM(IPV6_RECVTCLASS));
1995
    /* Receive traffic class */
1996
    rb_define_const(rb_mSockConst, "IPV6_RECVTCLASS", INT2NUM(IPV6_RECVTCLASS));
1997
#endif
1998
#endif
1999
#if defined(INET6)
2000
#if defined(IPV6_RTHDR)
2001
    /* Allows removal of sticky routing headers */
2002
    rb_define_const(rb_cSocket, "IPV6_RTHDR", INT2NUM(IPV6_RTHDR));
2003
    /* Allows removal of sticky routing headers */
2004
    rb_define_const(rb_mSockConst, "IPV6_RTHDR", INT2NUM(IPV6_RTHDR));
2005
#endif
2006
#endif
2007
#if defined(INET6)
2008
#if defined(IPV6_RTHDRDSTOPTS)
2009
    /* Allows removal of sticky destination options header */
2010
    rb_define_const(rb_cSocket, "IPV6_RTHDRDSTOPTS", INT2NUM(IPV6_RTHDRDSTOPTS));
2011
    /* Allows removal of sticky destination options header */
2012
    rb_define_const(rb_mSockConst, "IPV6_RTHDRDSTOPTS", INT2NUM(IPV6_RTHDRDSTOPTS));
2013
#endif
2014
#endif
2015
#if defined(INET6)
2016
#if defined(IPV6_RTHDR_TYPE_0)
2017
    /* Routing header type 0 */
2018
    rb_define_const(rb_cSocket, "IPV6_RTHDR_TYPE_0", INT2NUM(IPV6_RTHDR_TYPE_0));
2019
    /* Routing header type 0 */
2020
    rb_define_const(rb_mSockConst, "IPV6_RTHDR_TYPE_0", INT2NUM(IPV6_RTHDR_TYPE_0));
2021
#endif
2022
#endif
2023
#if defined(INET6)
2024
#if defined(IPV6_RECVPATHMTU)
2025
    /* Receive current path MTU with datagram */
2026
    rb_define_const(rb_cSocket, "IPV6_RECVPATHMTU", INT2NUM(IPV6_RECVPATHMTU));
2027
    /* Receive current path MTU with datagram */
2028
    rb_define_const(rb_mSockConst, "IPV6_RECVPATHMTU", INT2NUM(IPV6_RECVPATHMTU));
2029
#endif
2030
#endif
2031
#if defined(INET6)
2032
#if defined(IPV6_TCLASS)
2033
    /* Specify the traffic class */
2034
    rb_define_const(rb_cSocket, "IPV6_TCLASS", INT2NUM(IPV6_TCLASS));
2035
    /* Specify the traffic class */
2036
    rb_define_const(rb_mSockConst, "IPV6_TCLASS", INT2NUM(IPV6_TCLASS));
2037
#endif
2038
#endif
2039
#if defined(INET6)
2040
#if defined(IPV6_USE_MIN_MTU)
2041
    /* Use the minimum MTU size */
2042
    rb_define_const(rb_cSocket, "IPV6_USE_MIN_MTU", INT2NUM(IPV6_USE_MIN_MTU));
2043
    /* Use the minimum MTU size */
2044
    rb_define_const(rb_mSockConst, "IPV6_USE_MIN_MTU", INT2NUM(IPV6_USE_MIN_MTU));
2045
#endif
2046
#endif
2047
#if defined(INET_ADDRSTRLEN)
2048
    /* Maximum length of an IPv4 address string */
2049
    rb_define_const(rb_cSocket, "INET_ADDRSTRLEN", INT2NUM(INET_ADDRSTRLEN));
2050
    /* Maximum length of an IPv4 address string */
2051
    rb_define_const(rb_mSockConst, "INET_ADDRSTRLEN", INT2NUM(INET_ADDRSTRLEN));
2052
#endif
2053
#if defined(INET6_ADDRSTRLEN)
2054
    /* Maximum length of an IPv6 address string */
2055
    rb_define_const(rb_cSocket, "INET6_ADDRSTRLEN", INT2NUM(INET6_ADDRSTRLEN));
2056
    /* Maximum length of an IPv6 address string */
2057
    rb_define_const(rb_mSockConst, "INET6_ADDRSTRLEN", INT2NUM(INET6_ADDRSTRLEN));
2058
#endif
2059
#if defined(IFNAMSIZ)
2060
    /* Maximum interface name size */
2061
    rb_define_const(rb_cSocket, "IFNAMSIZ", INT2NUM(IFNAMSIZ));
2062
    /* Maximum interface name size */
2063
    rb_define_const(rb_mSockConst, "IFNAMSIZ", INT2NUM(IFNAMSIZ));
2064
#endif
2065
#if defined(IF_NAMESIZE)
2066
    /* Maximum interface name size */
2067
    rb_define_const(rb_cSocket, "IF_NAMESIZE", INT2NUM(IF_NAMESIZE));
2068
    /* Maximum interface name size */
2069
    rb_define_const(rb_mSockConst, "IF_NAMESIZE", INT2NUM(IF_NAMESIZE));
2070
#endif
2071
#if defined(SOMAXCONN)
2072
    /* Maximum connection requests that may be queued for a socket */
2073
    rb_define_const(rb_cSocket, "SOMAXCONN", INT2NUM(SOMAXCONN));
2074
    /* Maximum connection requests that may be queued for a socket */
2075
    rb_define_const(rb_mSockConst, "SOMAXCONN", INT2NUM(SOMAXCONN));
2076
#endif
2077
#if defined(SCM_RIGHTS)
2078
    /* Access rights */
2079
    rb_define_const(rb_cSocket, "SCM_RIGHTS", INT2NUM(SCM_RIGHTS));
2080
    /* Access rights */
2081
    rb_define_const(rb_mSockConst, "SCM_RIGHTS", INT2NUM(SCM_RIGHTS));
2082
#endif
2083
#if defined(SCM_TIMESTAMP)
2084
    /* Timestamp (timeval) */
2085
    rb_define_const(rb_cSocket, "SCM_TIMESTAMP", INT2NUM(SCM_TIMESTAMP));
2086
    /* Timestamp (timeval) */
2087
    rb_define_const(rb_mSockConst, "SCM_TIMESTAMP", INT2NUM(SCM_TIMESTAMP));
2088
#endif
2089
#if defined(SCM_TIMESTAMPNS)
2090
    /* Timespec (timespec) */
2091
    rb_define_const(rb_cSocket, "SCM_TIMESTAMPNS", INT2NUM(SCM_TIMESTAMPNS));
2092
    /* Timespec (timespec) */
2093
    rb_define_const(rb_mSockConst, "SCM_TIMESTAMPNS", INT2NUM(SCM_TIMESTAMPNS));
2094
#endif
2095
#if defined(SCM_BINTIME)
2096
    /* Timestamp (bintime) */
2097
    rb_define_const(rb_cSocket, "SCM_BINTIME", INT2NUM(SCM_BINTIME));
2098
    /* Timestamp (bintime) */
2099
    rb_define_const(rb_mSockConst, "SCM_BINTIME", INT2NUM(SCM_BINTIME));
2100
#endif
2101
#if defined(SCM_CREDENTIALS)
2102
    /* The sender's credentials */
2103
    rb_define_const(rb_cSocket, "SCM_CREDENTIALS", INT2NUM(SCM_CREDENTIALS));
2104
    /* The sender's credentials */
2105
    rb_define_const(rb_mSockConst, "SCM_CREDENTIALS", INT2NUM(SCM_CREDENTIALS));
2106
#endif
2107
#if defined(SCM_CREDS)
2108
    /* Process credentials */
2109
    rb_define_const(rb_cSocket, "SCM_CREDS", INT2NUM(SCM_CREDS));
2110
    /* Process credentials */
2111
    rb_define_const(rb_mSockConst, "SCM_CREDS", INT2NUM(SCM_CREDS));
2112
#endif
2113
#if defined(SCM_UCRED)
2114
    /* User credentials */
2115
    rb_define_const(rb_cSocket, "SCM_UCRED", INT2NUM(SCM_UCRED));
2116
    /* User credentials */
2117
    rb_define_const(rb_mSockConst, "SCM_UCRED", INT2NUM(SCM_UCRED));
2118
#endif
2119
#if defined(LOCAL_PEERCRED)
2120
    /* Retrieve peer credentials */
2121
    rb_define_const(rb_cSocket, "LOCAL_PEERCRED", INT2NUM(LOCAL_PEERCRED));
2122
    /* Retrieve peer credentials */
2123
    rb_define_const(rb_mSockConst, "LOCAL_PEERCRED", INT2NUM(LOCAL_PEERCRED));
2124
#endif
2125
#if defined(LOCAL_CREDS)
2126
    /* Pass credentials to receiver */
2127
    rb_define_const(rb_cSocket, "LOCAL_CREDS", INT2NUM(LOCAL_CREDS));
2128
    /* Pass credentials to receiver */
2129
    rb_define_const(rb_mSockConst, "LOCAL_CREDS", INT2NUM(LOCAL_CREDS));
2130
#endif
2131
#if defined(LOCAL_CONNWAIT)
2132
    /* Connect blocks until accepted */
2133
    rb_define_const(rb_cSocket, "LOCAL_CONNWAIT", INT2NUM(LOCAL_CONNWAIT));
2134
    /* Connect blocks until accepted */
2135
    rb_define_const(rb_mSockConst, "LOCAL_CONNWAIT", INT2NUM(LOCAL_CONNWAIT));
2136
#endif
2137

    
2138
    rsock_intern_family_hash = st_init_numtable();
2139
#ifdef AF_E164
2140
    st_insert(rsock_intern_family_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("AF_E164", 7));
2141
#endif
2142
#ifdef AF_PACKET
2143
    st_insert(rsock_intern_family_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("AF_PACKET", 9));
2144
#endif
2145
#ifdef AF_MAX
2146
    st_insert(rsock_intern_family_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("AF_MAX", 6));
2147
#endif
2148
#ifdef AF_NETGRAPH
2149
    st_insert(rsock_intern_family_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("AF_NETGRAPH", 11));
2150
#endif
2151
#ifdef AF_ATM
2152
    st_insert(rsock_intern_family_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("AF_ATM", 6));
2153
#endif
2154
#ifdef AF_PPP
2155
    st_insert(rsock_intern_family_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("AF_PPP", 6));
2156
#endif
2157
#ifdef AF_NETBIOS
2158
    st_insert(rsock_intern_family_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("AF_NETBIOS", 10));
2159
#endif
2160
#ifdef AF_SYSTEM
2161
    st_insert(rsock_intern_family_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("AF_SYSTEM", 9));
2162
#endif
2163
#ifdef AF_NATM
2164
    st_insert(rsock_intern_family_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("AF_NATM", 7));
2165
#endif
2166
#ifdef AF_ISDN
2167
    st_insert(rsock_intern_family_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("AF_ISDN", 7));
2168
#endif
2169
#ifdef AF_NDRV
2170
    st_insert(rsock_intern_family_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("AF_NDRV", 7));
2171
#endif
2172
#ifdef AF_SIP
2173
    st_insert(rsock_intern_family_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("AF_SIP", 6));
2174
#endif
2175
#ifdef AF_CNT
2176
    st_insert(rsock_intern_family_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("AF_CNT", 6));
2177
#endif
2178
#ifdef AF_COIP
2179
    st_insert(rsock_intern_family_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("AF_COIP", 7));
2180
#endif
2181
#ifdef AF_LINK
2182
    st_insert(rsock_intern_family_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("AF_LINK", 7));
2183
#endif
2184
#ifdef AF_ROUTE
2185
    st_insert(rsock_intern_family_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("AF_ROUTE", 8));
2186
#endif
2187
#ifdef AF_HYLINK
2188
    st_insert(rsock_intern_family_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("AF_HYLINK", 9));
2189
#endif
2190
#ifdef AF_LAT
2191
    st_insert(rsock_intern_family_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("AF_LAT", 6));
2192
#endif
2193
#ifdef AF_DLI
2194
    st_insert(rsock_intern_family_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("AF_DLI", 6));
2195
#endif
2196
#ifdef AF_DEC
2197
    st_insert(rsock_intern_family_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("AF_DEC", 6));
2198
#endif
2199
#ifdef AF_SNA
2200
    st_insert(rsock_intern_family_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("AF_SNA", 6));
2201
#endif
2202
#ifdef AF_CCITT
2203
    st_insert(rsock_intern_family_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("AF_CCITT", 8));
2204
#endif
2205
#ifdef AF_DATAKIT
2206
    st_insert(rsock_intern_family_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("AF_DATAKIT", 10));
2207
#endif
2208
#ifdef AF_ECMA
2209
    st_insert(rsock_intern_family_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("AF_ECMA", 7));
2210
#endif
2211
#ifdef AF_OSI
2212
    st_insert(rsock_intern_family_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("AF_OSI", 6));
2213
#endif
2214
#ifdef AF_ISO
2215
    st_insert(rsock_intern_family_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("AF_ISO", 6));
2216
#endif
2217
#ifdef AF_NS
2218
    st_insert(rsock_intern_family_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("AF_NS", 5));
2219
#endif
2220
#ifdef AF_CHAOS
2221
    st_insert(rsock_intern_family_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("AF_CHAOS", 8));
2222
#endif
2223
#ifdef AF_PUP
2224
    st_insert(rsock_intern_family_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("AF_PUP", 6));
2225
#endif
2226
#ifdef AF_IMPLINK
2227
    st_insert(rsock_intern_family_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("AF_IMPLINK", 10));
2228
#endif
2229
#ifdef AF_LOCAL
2230
    st_insert(rsock_intern_family_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("AF_LOCAL", 8));
2231
#endif
2232
#ifdef AF_APPLETALK
2233
    st_insert(rsock_intern_family_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("AF_APPLETALK", 12));
2234
#endif
2235
#ifdef AF_IPX
2236
    st_insert(rsock_intern_family_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("AF_IPX", 6));
2237
#endif
2238
#ifdef AF_AX25
2239
    st_insert(rsock_intern_family_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AF_AX25", 7));
2240
#endif
2241
#ifdef AF_UNIX
2242
    st_insert(rsock_intern_family_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("AF_UNIX", 7));
2243
#endif
2244
#ifdef AF_INET6
2245
    st_insert(rsock_intern_family_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("AF_INET6", 8));
2246
#endif
2247
#ifdef AF_INET
2248
    st_insert(rsock_intern_family_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("AF_INET", 7));
2249
#endif
2250
#ifdef AF_UNSPEC
2251
    st_insert(rsock_intern_family_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("AF_UNSPEC", 9));
2252
#endif
2253

    
2254
    rsock_intern_family_noprefix_hash = st_init_numtable();
2255
#ifdef AF_E164
2256
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("AF_E164", 7));
2257
#endif
2258
#ifdef AF_PACKET
2259
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("AF_PACKET", 9));
2260
#endif
2261
#ifdef AF_MAX
2262
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("AF_MAX", 6));
2263
#endif
2264
#ifdef AF_NETGRAPH
2265
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("AF_NETGRAPH", 11));
2266
#endif
2267
#ifdef AF_ATM
2268
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("AF_ATM", 6));
2269
#endif
2270
#ifdef AF_PPP
2271
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("AF_PPP", 6));
2272
#endif
2273
#ifdef AF_NETBIOS
2274
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("AF_NETBIOS", 10));
2275
#endif
2276
#ifdef AF_SYSTEM
2277
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("AF_SYSTEM", 9));
2278
#endif
2279
#ifdef AF_NATM
2280
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("AF_NATM", 7));
2281
#endif
2282
#ifdef AF_ISDN
2283
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("AF_ISDN", 7));
2284
#endif
2285
#ifdef AF_NDRV
2286
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("AF_NDRV", 7));
2287
#endif
2288
#ifdef AF_SIP
2289
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("AF_SIP", 6));
2290
#endif
2291
#ifdef AF_CNT
2292
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("AF_CNT", 6));
2293
#endif
2294
#ifdef AF_COIP
2295
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("AF_COIP", 7));
2296
#endif
2297
#ifdef AF_LINK
2298
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("AF_LINK", 7));
2299
#endif
2300
#ifdef AF_ROUTE
2301
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("AF_ROUTE", 8));
2302
#endif
2303
#ifdef AF_HYLINK
2304
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("AF_HYLINK", 9));
2305
#endif
2306
#ifdef AF_LAT
2307
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("AF_LAT", 6));
2308
#endif
2309
#ifdef AF_DLI
2310
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("AF_DLI", 6));
2311
#endif
2312
#ifdef AF_DEC
2313
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("AF_DEC", 6));
2314
#endif
2315
#ifdef AF_SNA
2316
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("AF_SNA", 6));
2317
#endif
2318
#ifdef AF_CCITT
2319
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("AF_CCITT", 8));
2320
#endif
2321
#ifdef AF_DATAKIT
2322
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("AF_DATAKIT", 10));
2323
#endif
2324
#ifdef AF_ECMA
2325
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("AF_ECMA", 7));
2326
#endif
2327
#ifdef AF_OSI
2328
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("AF_OSI", 6));
2329
#endif
2330
#ifdef AF_ISO
2331
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("AF_ISO", 6));
2332
#endif
2333
#ifdef AF_NS
2334
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("AF_NS", 5));
2335
#endif
2336
#ifdef AF_CHAOS
2337
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("AF_CHAOS", 8));
2338
#endif
2339
#ifdef AF_PUP
2340
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("AF_PUP", 6));
2341
#endif
2342
#ifdef AF_IMPLINK
2343
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("AF_IMPLINK", 10));
2344
#endif
2345
#ifdef AF_LOCAL
2346
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("AF_LOCAL", 8));
2347
#endif
2348
#ifdef AF_APPLETALK
2349
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("AF_APPLETALK", 12));
2350
#endif
2351
#ifdef AF_IPX
2352
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("AF_IPX", 6));
2353
#endif
2354
#ifdef AF_AX25
2355
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AF_AX25", 7));
2356
#endif
2357
#ifdef AF_UNIX
2358
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("AF_UNIX", 7));
2359
#endif
2360
#ifdef AF_INET6
2361
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("AF_INET6", 8));
2362
#endif
2363
#ifdef AF_INET
2364
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("AF_INET", 7));
2365
#endif
2366
#ifdef AF_UNSPEC
2367
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("AF_UNSPEC", 9));
2368
#endif
2369
#ifdef AF_E164
2370
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_E164, (st_data_t)rb_intern2("E164", 4));
2371
#endif
2372
#ifdef AF_PACKET
2373
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PACKET, (st_data_t)rb_intern2("PACKET", 6));
2374
#endif
2375
#ifdef AF_MAX
2376
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_MAX, (st_data_t)rb_intern2("MAX", 3));
2377
#endif
2378
#ifdef AF_NETGRAPH
2379
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETGRAPH, (st_data_t)rb_intern2("NETGRAPH", 8));
2380
#endif
2381
#ifdef AF_ATM
2382
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ATM, (st_data_t)rb_intern2("ATM", 3));
2383
#endif
2384
#ifdef AF_PPP
2385
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PPP, (st_data_t)rb_intern2("PPP", 3));
2386
#endif
2387
#ifdef AF_NETBIOS
2388
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NETBIOS, (st_data_t)rb_intern2("NETBIOS", 7));
2389
#endif
2390
#ifdef AF_SYSTEM
2391
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SYSTEM, (st_data_t)rb_intern2("SYSTEM", 6));
2392
#endif
2393
#ifdef AF_NATM
2394
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NATM, (st_data_t)rb_intern2("NATM", 4));
2395
#endif
2396
#ifdef AF_ISDN
2397
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISDN, (st_data_t)rb_intern2("ISDN", 4));
2398
#endif
2399
#ifdef AF_NDRV
2400
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NDRV, (st_data_t)rb_intern2("NDRV", 4));
2401
#endif
2402
#ifdef AF_SIP
2403
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SIP, (st_data_t)rb_intern2("SIP", 3));
2404
#endif
2405
#ifdef AF_CNT
2406
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CNT, (st_data_t)rb_intern2("CNT", 3));
2407
#endif
2408
#ifdef AF_COIP
2409
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_COIP, (st_data_t)rb_intern2("COIP", 4));
2410
#endif
2411
#ifdef AF_LINK
2412
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LINK, (st_data_t)rb_intern2("LINK", 4));
2413
#endif
2414
#ifdef AF_ROUTE
2415
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ROUTE, (st_data_t)rb_intern2("ROUTE", 5));
2416
#endif
2417
#ifdef AF_HYLINK
2418
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_HYLINK, (st_data_t)rb_intern2("HYLINK", 6));
2419
#endif
2420
#ifdef AF_LAT
2421
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LAT, (st_data_t)rb_intern2("LAT", 3));
2422
#endif
2423
#ifdef AF_DLI
2424
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DLI, (st_data_t)rb_intern2("DLI", 3));
2425
#endif
2426
#ifdef AF_DEC
2427
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DEC, (st_data_t)rb_intern2("DEC", 3));
2428
#endif
2429
#ifdef AF_SNA
2430
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_SNA, (st_data_t)rb_intern2("SNA", 3));
2431
#endif
2432
#ifdef AF_CCITT
2433
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CCITT, (st_data_t)rb_intern2("CCITT", 5));
2434
#endif
2435
#ifdef AF_DATAKIT
2436
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_DATAKIT, (st_data_t)rb_intern2("DATAKIT", 7));
2437
#endif
2438
#ifdef AF_ECMA
2439
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ECMA, (st_data_t)rb_intern2("ECMA", 4));
2440
#endif
2441
#ifdef AF_OSI
2442
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_OSI, (st_data_t)rb_intern2("OSI", 3));
2443
#endif
2444
#ifdef AF_ISO
2445
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_ISO, (st_data_t)rb_intern2("ISO", 3));
2446
#endif
2447
#ifdef AF_NS
2448
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_NS, (st_data_t)rb_intern2("NS", 2));
2449
#endif
2450
#ifdef AF_CHAOS
2451
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_CHAOS, (st_data_t)rb_intern2("CHAOS", 5));
2452
#endif
2453
#ifdef AF_PUP
2454
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_PUP, (st_data_t)rb_intern2("PUP", 3));
2455
#endif
2456
#ifdef AF_IMPLINK
2457
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IMPLINK, (st_data_t)rb_intern2("IMPLINK", 7));
2458
#endif
2459
#ifdef AF_LOCAL
2460
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_LOCAL, (st_data_t)rb_intern2("LOCAL", 5));
2461
#endif
2462
#ifdef AF_APPLETALK
2463
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_APPLETALK, (st_data_t)rb_intern2("APPLETALK", 9));
2464
#endif
2465
#ifdef AF_IPX
2466
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_IPX, (st_data_t)rb_intern2("IPX", 3));
2467
#endif
2468
#ifdef AF_AX25
2469
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_AX25, (st_data_t)rb_intern2("AX25", 4));
2470
#endif
2471
#ifdef AF_UNIX
2472
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNIX, (st_data_t)rb_intern2("UNIX", 4));
2473
#endif
2474
#ifdef AF_INET6
2475
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET6, (st_data_t)rb_intern2("INET6", 5));
2476
#endif
2477
#ifdef AF_INET
2478
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_INET, (st_data_t)rb_intern2("INET", 4));
2479
#endif
2480
#ifdef AF_UNSPEC
2481
    st_insert(rsock_intern_family_noprefix_hash, (st_data_t)AF_UNSPEC, (st_data_t)rb_intern2("UNSPEC", 6));
2482
#endif
2483

    
2484
    rsock_intern_protocol_family_hash = st_init_numtable();
2485
#ifdef PF_KEY
2486
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_KEY, (st_data_t)rb_intern2("PF_KEY", 6));
2487
#endif
2488
#ifdef PF_PIP
2489
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PIP, (st_data_t)rb_intern2("PF_PIP", 6));
2490
#endif
2491
#ifdef PF_RTIP
2492
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_RTIP, (st_data_t)rb_intern2("PF_RTIP", 7));
2493
#endif
2494
#ifdef PF_XTP
2495
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_XTP, (st_data_t)rb_intern2("PF_XTP", 6));
2496
#endif
2497
#ifdef PF_PACKET
2498
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PACKET, (st_data_t)rb_intern2("PF_PACKET", 9));
2499
#endif
2500
#ifdef PF_MAX
2501
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_MAX, (st_data_t)rb_intern2("PF_MAX", 6));
2502
#endif
2503
#ifdef PF_NETGRAPH
2504
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NETGRAPH, (st_data_t)rb_intern2("PF_NETGRAPH", 11));
2505
#endif
2506
#ifdef PF_ATM
2507
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ATM, (st_data_t)rb_intern2("PF_ATM", 6));
2508
#endif
2509
#ifdef PF_PPP
2510
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PPP, (st_data_t)rb_intern2("PF_PPP", 6));
2511
#endif
2512
#ifdef PF_NETBIOS
2513
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NETBIOS, (st_data_t)rb_intern2("PF_NETBIOS", 10));
2514
#endif
2515
#ifdef PF_SYSTEM
2516
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SYSTEM, (st_data_t)rb_intern2("PF_SYSTEM", 9));
2517
#endif
2518
#ifdef PF_NATM
2519
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NATM, (st_data_t)rb_intern2("PF_NATM", 7));
2520
#endif
2521
#ifdef PF_ISDN
2522
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ISDN, (st_data_t)rb_intern2("PF_ISDN", 7));
2523
#endif
2524
#ifdef PF_NDRV
2525
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NDRV, (st_data_t)rb_intern2("PF_NDRV", 7));
2526
#endif
2527
#ifdef PF_SIP
2528
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SIP, (st_data_t)rb_intern2("PF_SIP", 6));
2529
#endif
2530
#ifdef PF_CNT
2531
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CNT, (st_data_t)rb_intern2("PF_CNT", 6));
2532
#endif
2533
#ifdef PF_COIP
2534
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_COIP, (st_data_t)rb_intern2("PF_COIP", 7));
2535
#endif
2536
#ifdef PF_LINK
2537
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LINK, (st_data_t)rb_intern2("PF_LINK", 7));
2538
#endif
2539
#ifdef PF_ROUTE
2540
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ROUTE, (st_data_t)rb_intern2("PF_ROUTE", 8));
2541
#endif
2542
#ifdef PF_HYLINK
2543
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_HYLINK, (st_data_t)rb_intern2("PF_HYLINK", 9));
2544
#endif
2545
#ifdef PF_LAT
2546
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LAT, (st_data_t)rb_intern2("PF_LAT", 6));
2547
#endif
2548
#ifdef PF_DLI
2549
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DLI, (st_data_t)rb_intern2("PF_DLI", 6));
2550
#endif
2551
#ifdef PF_DEC
2552
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DEC, (st_data_t)rb_intern2("PF_DEC", 6));
2553
#endif
2554
#ifdef PF_SNA
2555
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_SNA, (st_data_t)rb_intern2("PF_SNA", 6));
2556
#endif
2557
#ifdef PF_CCITT
2558
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CCITT, (st_data_t)rb_intern2("PF_CCITT", 8));
2559
#endif
2560
#ifdef PF_DATAKIT
2561
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_DATAKIT, (st_data_t)rb_intern2("PF_DATAKIT", 10));
2562
#endif
2563
#ifdef PF_ECMA
2564
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ECMA, (st_data_t)rb_intern2("PF_ECMA", 7));
2565
#endif
2566
#ifdef PF_OSI
2567
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_OSI, (st_data_t)rb_intern2("PF_OSI", 6));
2568
#endif
2569
#ifdef PF_ISO
2570
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_ISO, (st_data_t)rb_intern2("PF_ISO", 6));
2571
#endif
2572
#ifdef PF_NS
2573
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_NS, (st_data_t)rb_intern2("PF_NS", 5));
2574
#endif
2575
#ifdef PF_CHAOS
2576
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_CHAOS, (st_data_t)rb_intern2("PF_CHAOS", 8));
2577
#endif
2578
#ifdef PF_PUP
2579
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_PUP, (st_data_t)rb_intern2("PF_PUP", 6));
2580
#endif
2581
#ifdef PF_IMPLINK
2582
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_IMPLINK, (st_data_t)rb_intern2("PF_IMPLINK", 10));
2583
#endif
2584
#ifdef PF_LOCAL
2585
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_LOCAL, (st_data_t)rb_intern2("PF_LOCAL", 8));
2586
#endif
2587
#ifdef PF_APPLETALK
2588
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_APPLETALK, (st_data_t)rb_intern2("PF_APPLETALK", 12));
2589
#endif
2590
#ifdef PF_IPX
2591
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_IPX, (st_data_t)rb_intern2("PF_IPX", 6));
2592
#endif
2593
#ifdef PF_AX25
2594
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_AX25, (st_data_t)rb_intern2("PF_AX25", 7));
2595
#endif
2596
#ifdef PF_UNIX
2597
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_UNIX, (st_data_t)rb_intern2("PF_UNIX", 7));
2598
#endif
2599
#ifdef PF_INET6
2600
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_INET6, (st_data_t)rb_intern2("PF_INET6", 8));
2601
#endif
2602
#ifdef PF_INET
2603
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_INET, (st_data_t)rb_intern2("PF_INET", 7));
2604
#endif
2605
#ifdef PF_UNSPEC
2606
    st_insert(rsock_intern_protocol_family_hash, (st_data_t)PF_UNSPEC, (st_data_t)rb_intern2("PF_UNSPEC", 9));
2607
#endif
2608

    
2609
    rsock_intern_socktype_hash = st_init_numtable();
2610
#ifdef SOCK_PACKET
2611
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_PACKET, (st_data_t)rb_intern2("SOCK_PACKET", 11));
2612
#endif
2613
#ifdef SOCK_SEQPACKET
2614
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_SEQPACKET, (st_data_t)rb_intern2("SOCK_SEQPACKET", 14));
2615
#endif
2616
#ifdef SOCK_RDM
2617
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_RDM, (st_data_t)rb_intern2("SOCK_RDM", 8));
2618
#endif
2619
#ifdef SOCK_RAW
2620
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_RAW, (st_data_t)rb_intern2("SOCK_RAW", 8));
2621
#endif
2622
#ifdef SOCK_DGRAM
2623
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_DGRAM, (st_data_t)rb_intern2("SOCK_DGRAM", 10));
2624
#endif
2625
#ifdef SOCK_STREAM
2626
    st_insert(rsock_intern_socktype_hash, (st_data_t)SOCK_STREAM, (st_data_t)rb_intern2("SOCK_STREAM", 11));
2627
#endif
2628

    
2629
    rsock_intern_ipproto_hash = st_init_numtable();
2630
#ifdef IPPROTO_MAX
2631
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("IPPROTO_MAX", 11));
2632
#endif
2633
#ifdef IPPROTO_RAW
2634
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("IPPROTO_RAW", 11));
2635
#endif
2636
#ifdef IPPROTO_ROUTING
2637
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("IPPROTO_ROUTING", 15));
2638
#endif
2639
#ifdef IPPROTO_NONE
2640
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("IPPROTO_NONE", 12));
2641
#endif
2642
#ifdef IPPROTO_IPV6
2643
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPPROTO_IPV6", 12));
2644
#endif
2645
#ifdef IPPROTO_ICMPV6
2646
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("IPPROTO_ICMPV6", 14));
2647
#endif
2648
#ifdef IPPROTO_HOPOPTS
2649
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("IPPROTO_HOPOPTS", 15));
2650
#endif
2651
#ifdef IPPROTO_FRAGMENT
2652
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("IPPROTO_FRAGMENT", 16));
2653
#endif
2654
#ifdef IPPROTO_ESP
2655
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("IPPROTO_ESP", 11));
2656
#endif
2657
#ifdef IPPROTO_DSTOPTS
2658
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("IPPROTO_DSTOPTS", 15));
2659
#endif
2660
#ifdef IPPROTO_AH
2661
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("IPPROTO_AH", 10));
2662
#endif
2663
#ifdef IPPROTO_BIP
2664
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("IPPROTO_BIP", 11));
2665
#endif
2666
#ifdef IPPROTO_EON
2667
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("IPPROTO_EON", 11));
2668
#endif
2669
#ifdef IPPROTO_XTP
2670
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("IPPROTO_XTP", 11));
2671
#endif
2672
#ifdef IPPROTO_TP
2673
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("IPPROTO_TP", 10));
2674
#endif
2675
#ifdef IPPROTO_ND
2676
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("IPPROTO_ND", 10));
2677
#endif
2678
#ifdef IPPROTO_HELLO
2679
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("IPPROTO_HELLO", 13));
2680
#endif
2681
#ifdef IPPROTO_IDP
2682
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IPPROTO_IDP", 11));
2683
#endif
2684
#ifdef IPPROTO_UDP
2685
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("IPPROTO_UDP", 11));
2686
#endif
2687
#ifdef IPPROTO_PUP
2688
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("IPPROTO_PUP", 11));
2689
#endif
2690
#ifdef IPPROTO_EGP
2691
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("IPPROTO_EGP", 11));
2692
#endif
2693
#ifdef IPPROTO_TCP
2694
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("IPPROTO_TCP", 11));
2695
#endif
2696
#ifdef IPPROTO_GGP
2697
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("IPPROTO_GGP", 11));
2698
#endif
2699
#ifdef IPPROTO_IGMP
2700
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IPPROTO_IGMP", 12));
2701
#endif
2702
#ifdef IPPROTO_ICMP
2703
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("IPPROTO_ICMP", 12));
2704
#endif
2705
#ifdef IPPROTO_IP
2706
    st_insert(rsock_intern_ipproto_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IPPROTO_IP", 10));
2707
#endif
2708

    
2709
    rsock_intern_iplevel_hash = st_init_numtable();
2710
#ifdef IPPROTO_MAX
2711
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("IPPROTO_MAX", 11));
2712
#endif
2713
#ifdef IPPROTO_RAW
2714
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("IPPROTO_RAW", 11));
2715
#endif
2716
#ifdef IPPROTO_ROUTING
2717
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("IPPROTO_ROUTING", 15));
2718
#endif
2719
#ifdef IPPROTO_NONE
2720
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("IPPROTO_NONE", 12));
2721
#endif
2722
#ifdef IPPROTO_IPV6
2723
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPPROTO_IPV6", 12));
2724
#endif
2725
#ifdef IPPROTO_ICMPV6
2726
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("IPPROTO_ICMPV6", 14));
2727
#endif
2728
#ifdef IPPROTO_HOPOPTS
2729
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("IPPROTO_HOPOPTS", 15));
2730
#endif
2731
#ifdef IPPROTO_FRAGMENT
2732
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("IPPROTO_FRAGMENT", 16));
2733
#endif
2734
#ifdef IPPROTO_ESP
2735
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("IPPROTO_ESP", 11));
2736
#endif
2737
#ifdef IPPROTO_DSTOPTS
2738
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("IPPROTO_DSTOPTS", 15));
2739
#endif
2740
#ifdef IPPROTO_AH
2741
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("IPPROTO_AH", 10));
2742
#endif
2743
#ifdef IPPROTO_BIP
2744
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("IPPROTO_BIP", 11));
2745
#endif
2746
#ifdef IPPROTO_EON
2747
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("IPPROTO_EON", 11));
2748
#endif
2749
#ifdef IPPROTO_XTP
2750
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("IPPROTO_XTP", 11));
2751
#endif
2752
#ifdef IPPROTO_TP
2753
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("IPPROTO_TP", 10));
2754
#endif
2755
#ifdef IPPROTO_ND
2756
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("IPPROTO_ND", 10));
2757
#endif
2758
#ifdef IPPROTO_HELLO
2759
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("IPPROTO_HELLO", 13));
2760
#endif
2761
#ifdef IPPROTO_IDP
2762
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IPPROTO_IDP", 11));
2763
#endif
2764
#ifdef IPPROTO_UDP
2765
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("IPPROTO_UDP", 11));
2766
#endif
2767
#ifdef IPPROTO_PUP
2768
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("IPPROTO_PUP", 11));
2769
#endif
2770
#ifdef IPPROTO_EGP
2771
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("IPPROTO_EGP", 11));
2772
#endif
2773
#ifdef IPPROTO_TCP
2774
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("IPPROTO_TCP", 11));
2775
#endif
2776
#ifdef IPPROTO_GGP
2777
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("IPPROTO_GGP", 11));
2778
#endif
2779
#ifdef IPPROTO_IGMP
2780
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IPPROTO_IGMP", 12));
2781
#endif
2782
#ifdef IPPROTO_ICMP
2783
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("IPPROTO_ICMP", 12));
2784
#endif
2785
#ifdef IPPROTO_IP
2786
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IPPROTO_IP", 10));
2787
#endif
2788
#ifdef SOL_SOCKET
2789
    st_insert(rsock_intern_iplevel_hash, (st_data_t)SOL_SOCKET, (st_data_t)rb_intern2("SOL_SOCKET", 10));
2790
#endif
2791
#ifdef IPPROTO_MAX
2792
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_MAX, (st_data_t)rb_intern2("MAX", 3));
2793
#endif
2794
#ifdef IPPROTO_RAW
2795
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_RAW, (st_data_t)rb_intern2("RAW", 3));
2796
#endif
2797
#ifdef IPPROTO_ROUTING
2798
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ROUTING, (st_data_t)rb_intern2("ROUTING", 7));
2799
#endif
2800
#ifdef IPPROTO_NONE
2801
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_NONE, (st_data_t)rb_intern2("NONE", 4));
2802
#endif
2803
#ifdef IPPROTO_IPV6
2804
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IPV6, (st_data_t)rb_intern2("IPV6", 4));
2805
#endif
2806
#ifdef IPPROTO_ICMPV6
2807
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMPV6, (st_data_t)rb_intern2("ICMPV6", 6));
2808
#endif
2809
#ifdef IPPROTO_HOPOPTS
2810
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HOPOPTS, (st_data_t)rb_intern2("HOPOPTS", 7));
2811
#endif
2812
#ifdef IPPROTO_FRAGMENT
2813
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_FRAGMENT, (st_data_t)rb_intern2("FRAGMENT", 8));
2814
#endif
2815
#ifdef IPPROTO_ESP
2816
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ESP, (st_data_t)rb_intern2("ESP", 3));
2817
#endif
2818
#ifdef IPPROTO_DSTOPTS
2819
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_DSTOPTS, (st_data_t)rb_intern2("DSTOPTS", 7));
2820
#endif
2821
#ifdef IPPROTO_AH
2822
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_AH, (st_data_t)rb_intern2("AH", 2));
2823
#endif
2824
#ifdef IPPROTO_BIP
2825
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_BIP, (st_data_t)rb_intern2("BIP", 3));
2826
#endif
2827
#ifdef IPPROTO_EON
2828
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EON, (st_data_t)rb_intern2("EON", 3));
2829
#endif
2830
#ifdef IPPROTO_XTP
2831
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_XTP, (st_data_t)rb_intern2("XTP", 3));
2832
#endif
2833
#ifdef IPPROTO_TP
2834
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TP, (st_data_t)rb_intern2("TP", 2));
2835
#endif
2836
#ifdef IPPROTO_ND
2837
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ND, (st_data_t)rb_intern2("ND", 2));
2838
#endif
2839
#ifdef IPPROTO_HELLO
2840
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_HELLO, (st_data_t)rb_intern2("HELLO", 5));
2841
#endif
2842
#ifdef IPPROTO_IDP
2843
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IDP, (st_data_t)rb_intern2("IDP", 3));
2844
#endif
2845
#ifdef IPPROTO_UDP
2846
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_UDP, (st_data_t)rb_intern2("UDP", 3));
2847
#endif
2848
#ifdef IPPROTO_PUP
2849
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_PUP, (st_data_t)rb_intern2("PUP", 3));
2850
#endif
2851
#ifdef IPPROTO_EGP
2852
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_EGP, (st_data_t)rb_intern2("EGP", 3));
2853
#endif
2854
#ifdef IPPROTO_TCP
2855
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_TCP, (st_data_t)rb_intern2("TCP", 3));
2856
#endif
2857
#ifdef IPPROTO_GGP
2858
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_GGP, (st_data_t)rb_intern2("GGP", 3));
2859
#endif
2860
#ifdef IPPROTO_IGMP
2861
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IGMP, (st_data_t)rb_intern2("IGMP", 4));
2862
#endif
2863
#ifdef IPPROTO_ICMP
2864
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_ICMP, (st_data_t)rb_intern2("ICMP", 4));
2865
#endif
2866
#ifdef IPPROTO_IP
2867
    st_insert(rsock_intern_iplevel_hash, (st_data_t)IPPROTO_IP, (st_data_t)rb_intern2("IP", 2));
2868
#endif
2869
#ifdef SOL_SOCKET
2870
    st_insert(rsock_intern_iplevel_hash, (st_data_t)SOL_SOCKET, (st_data_t)rb_intern2("SOCKET", 6));
2871
#endif
2872

    
2873
    rsock_intern_so_optname_hash = st_init_numtable();
2874
#ifdef SO_ALLZONES
2875
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ALLZONES, (st_data_t)rb_intern2("SO_ALLZONES", 11));
2876
#endif
2877
#ifdef SO_MAC_EXEMPT
2878
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_MAC_EXEMPT, (st_data_t)rb_intern2("SO_MAC_EXEMPT", 13));
2879
#endif
2880
#ifdef SO_RECVUCRED
2881
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RECVUCRED, (st_data_t)rb_intern2("SO_RECVUCRED", 12));
2882
#endif
2883
#ifdef SO_BINTIME
2884
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINTIME, (st_data_t)rb_intern2("SO_BINTIME", 10));
2885
#endif
2886
#ifdef SO_TIMESTAMPNS
2887
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMPNS, (st_data_t)rb_intern2("SO_TIMESTAMPNS", 14));
2888
#endif
2889
#ifdef SO_TIMESTAMP
2890
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMP, (st_data_t)rb_intern2("SO_TIMESTAMP", 12));
2891
#endif
2892
#ifdef SO_PEERNAME
2893
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERNAME, (st_data_t)rb_intern2("SO_PEERNAME", 11));
2894
#endif
2895
#ifdef SO_DETACH_FILTER
2896
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DETACH_FILTER, (st_data_t)rb_intern2("SO_DETACH_FILTER", 16));
2897
#endif
2898
#ifdef SO_ATTACH_FILTER
2899
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ATTACH_FILTER, (st_data_t)rb_intern2("SO_ATTACH_FILTER", 16));
2900
#endif
2901
#ifdef SO_BINDTODEVICE
2902
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINDTODEVICE, (st_data_t)rb_intern2("SO_BINDTODEVICE", 15));
2903
#endif
2904
#ifdef SO_SECURITY_ENCRYPTION_NETWORK
2905
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_NETWORK, (st_data_t)rb_intern2("SO_SECURITY_ENCRYPTION_NETWORK", 30));
2906
#endif
2907
#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
2908
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_TRANSPORT, (st_data_t)rb_intern2("SO_SECURITY_ENCRYPTION_TRANSPORT", 32));
2909
#endif
2910
#ifdef SO_SECURITY_AUTHENTICATION
2911
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_AUTHENTICATION, (st_data_t)rb_intern2("SO_SECURITY_AUTHENTICATION", 26));
2912
#endif
2913
#ifdef SO_NOSIGPIPE
2914
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NOSIGPIPE, (st_data_t)rb_intern2("SO_NOSIGPIPE", 12));
2915
#endif
2916
#ifdef SO_NKE
2917
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NKE, (st_data_t)rb_intern2("SO_NKE", 6));
2918
#endif
2919
#ifdef SO_NREAD
2920
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NREAD, (st_data_t)rb_intern2("SO_NREAD", 8));
2921
#endif
2922
#ifdef SO_WANTOOBFLAG
2923
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTOOBFLAG, (st_data_t)rb_intern2("SO_WANTOOBFLAG", 14));
2924
#endif
2925
#ifdef SO_WANTMORE
2926
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTMORE, (st_data_t)rb_intern2("SO_WANTMORE", 11));
2927
#endif
2928
#ifdef SO_DONTTRUNC
2929
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTTRUNC, (st_data_t)rb_intern2("SO_DONTTRUNC", 12));
2930
#endif
2931
#ifdef SO_ACCEPTFILTER
2932
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTFILTER, (st_data_t)rb_intern2("SO_ACCEPTFILTER", 15));
2933
#endif
2934
#ifdef SO_USELOOPBACK
2935
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_USELOOPBACK, (st_data_t)rb_intern2("SO_USELOOPBACK", 14));
2936
#endif
2937
#ifdef SO_ACCEPTCONN
2938
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTCONN, (st_data_t)rb_intern2("SO_ACCEPTCONN", 13));
2939
#endif
2940
#ifdef SO_SNDTIMEO
2941
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDTIMEO, (st_data_t)rb_intern2("SO_SNDTIMEO", 11));
2942
#endif
2943
#ifdef SO_RCVTIMEO
2944
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVTIMEO, (st_data_t)rb_intern2("SO_RCVTIMEO", 11));
2945
#endif
2946
#ifdef SO_SNDLOWAT
2947
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDLOWAT, (st_data_t)rb_intern2("SO_SNDLOWAT", 11));
2948
#endif
2949
#ifdef SO_RCVLOWAT
2950
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVLOWAT, (st_data_t)rb_intern2("SO_RCVLOWAT", 11));
2951
#endif
2952
#ifdef SO_PEERCRED
2953
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERCRED, (st_data_t)rb_intern2("SO_PEERCRED", 11));
2954
#endif
2955
#ifdef SO_PASSCRED
2956
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PASSCRED, (st_data_t)rb_intern2("SO_PASSCRED", 11));
2957
#endif
2958
#ifdef SO_LINGER
2959
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_LINGER, (st_data_t)rb_intern2("SO_LINGER", 9));
2960
#endif
2961
#ifdef SO_PRIORITY
2962
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PRIORITY, (st_data_t)rb_intern2("SO_PRIORITY", 11));
2963
#endif
2964
#ifdef SO_NO_CHECK
2965
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NO_CHECK, (st_data_t)rb_intern2("SO_NO_CHECK", 11));
2966
#endif
2967
#ifdef SO_OOBINLINE
2968
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_OOBINLINE, (st_data_t)rb_intern2("SO_OOBINLINE", 12));
2969
#endif
2970
#ifdef SO_KEEPALIVE
2971
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_KEEPALIVE, (st_data_t)rb_intern2("SO_KEEPALIVE", 12));
2972
#endif
2973
#ifdef SO_RCVBUF
2974
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVBUF, (st_data_t)rb_intern2("SO_RCVBUF", 9));
2975
#endif
2976
#ifdef SO_SNDBUF
2977
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDBUF, (st_data_t)rb_intern2("SO_SNDBUF", 9));
2978
#endif
2979
#ifdef SO_BROADCAST
2980
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BROADCAST, (st_data_t)rb_intern2("SO_BROADCAST", 12));
2981
#endif
2982
#ifdef SO_DONTROUTE
2983
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTROUTE, (st_data_t)rb_intern2("SO_DONTROUTE", 12));
2984
#endif
2985
#ifdef SO_ERROR
2986
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ERROR, (st_data_t)rb_intern2("SO_ERROR", 8));
2987
#endif
2988
#ifdef SO_TYPE
2989
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TYPE, (st_data_t)rb_intern2("SO_TYPE", 7));
2990
#endif
2991
#ifdef SO_REUSEPORT
2992
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEPORT, (st_data_t)rb_intern2("SO_REUSEPORT", 12));
2993
#endif
2994
#ifdef SO_REUSEADDR
2995
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEADDR, (st_data_t)rb_intern2("SO_REUSEADDR", 12));
2996
#endif
2997
#ifdef SO_DEBUG
2998
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DEBUG, (st_data_t)rb_intern2("SO_DEBUG", 8));
2999
#endif
3000
#ifdef SO_ALLZONES
3001
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ALLZONES, (st_data_t)rb_intern2("ALLZONES", 8));
3002
#endif
3003
#ifdef SO_MAC_EXEMPT
3004
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_MAC_EXEMPT, (st_data_t)rb_intern2("MAC_EXEMPT", 10));
3005
#endif
3006
#ifdef SO_RECVUCRED
3007
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RECVUCRED, (st_data_t)rb_intern2("RECVUCRED", 9));
3008
#endif
3009
#ifdef SO_BINTIME
3010
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINTIME, (st_data_t)rb_intern2("BINTIME", 7));
3011
#endif
3012
#ifdef SO_TIMESTAMPNS
3013
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMPNS, (st_data_t)rb_intern2("TIMESTAMPNS", 11));
3014
#endif
3015
#ifdef SO_TIMESTAMP
3016
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TIMESTAMP, (st_data_t)rb_intern2("TIMESTAMP", 9));
3017
#endif
3018
#ifdef SO_PEERNAME
3019
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERNAME, (st_data_t)rb_intern2("PEERNAME", 8));
3020
#endif
3021
#ifdef SO_DETACH_FILTER
3022
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DETACH_FILTER, (st_data_t)rb_intern2("DETACH_FILTER", 13));
3023
#endif
3024
#ifdef SO_ATTACH_FILTER
3025
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ATTACH_FILTER, (st_data_t)rb_intern2("ATTACH_FILTER", 13));
3026
#endif
3027
#ifdef SO_BINDTODEVICE
3028
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BINDTODEVICE, (st_data_t)rb_intern2("BINDTODEVICE", 12));
3029
#endif
3030
#ifdef SO_SECURITY_ENCRYPTION_NETWORK
3031
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_NETWORK, (st_data_t)rb_intern2("SECURITY_ENCRYPTION_NETWORK", 27));
3032
#endif
3033
#ifdef SO_SECURITY_ENCRYPTION_TRANSPORT
3034
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_ENCRYPTION_TRANSPORT, (st_data_t)rb_intern2("SECURITY_ENCRYPTION_TRANSPORT", 29));
3035
#endif
3036
#ifdef SO_SECURITY_AUTHENTICATION
3037
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SECURITY_AUTHENTICATION, (st_data_t)rb_intern2("SECURITY_AUTHENTICATION", 23));
3038
#endif
3039
#ifdef SO_NOSIGPIPE
3040
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NOSIGPIPE, (st_data_t)rb_intern2("NOSIGPIPE", 9));
3041
#endif
3042
#ifdef SO_NKE
3043
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NKE, (st_data_t)rb_intern2("NKE", 3));
3044
#endif
3045
#ifdef SO_NREAD
3046
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NREAD, (st_data_t)rb_intern2("NREAD", 5));
3047
#endif
3048
#ifdef SO_WANTOOBFLAG
3049
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTOOBFLAG, (st_data_t)rb_intern2("WANTOOBFLAG", 11));
3050
#endif
3051
#ifdef SO_WANTMORE
3052
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_WANTMORE, (st_data_t)rb_intern2("WANTMORE", 8));
3053
#endif
3054
#ifdef SO_DONTTRUNC
3055
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTTRUNC, (st_data_t)rb_intern2("DONTTRUNC", 9));
3056
#endif
3057
#ifdef SO_ACCEPTFILTER
3058
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTFILTER, (st_data_t)rb_intern2("ACCEPTFILTER", 12));
3059
#endif
3060
#ifdef SO_USELOOPBACK
3061
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_USELOOPBACK, (st_data_t)rb_intern2("USELOOPBACK", 11));
3062
#endif
3063
#ifdef SO_ACCEPTCONN
3064
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ACCEPTCONN, (st_data_t)rb_intern2("ACCEPTCONN", 10));
3065
#endif
3066
#ifdef SO_SNDTIMEO
3067
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDTIMEO, (st_data_t)rb_intern2("SNDTIMEO", 8));
3068
#endif
3069
#ifdef SO_RCVTIMEO
3070
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVTIMEO, (st_data_t)rb_intern2("RCVTIMEO", 8));
3071
#endif
3072
#ifdef SO_SNDLOWAT
3073
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDLOWAT, (st_data_t)rb_intern2("SNDLOWAT", 8));
3074
#endif
3075
#ifdef SO_RCVLOWAT
3076
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVLOWAT, (st_data_t)rb_intern2("RCVLOWAT", 8));
3077
#endif
3078
#ifdef SO_PEERCRED
3079
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PEERCRED, (st_data_t)rb_intern2("PEERCRED", 8));
3080
#endif
3081
#ifdef SO_PASSCRED
3082
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PASSCRED, (st_data_t)rb_intern2("PASSCRED", 8));
3083
#endif
3084
#ifdef SO_LINGER
3085
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_LINGER, (st_data_t)rb_intern2("LINGER", 6));
3086
#endif
3087
#ifdef SO_PRIORITY
3088
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_PRIORITY, (st_data_t)rb_intern2("PRIORITY", 8));
3089
#endif
3090
#ifdef SO_NO_CHECK
3091
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_NO_CHECK, (st_data_t)rb_intern2("NO_CHECK", 8));
3092
#endif
3093
#ifdef SO_OOBINLINE
3094
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_OOBINLINE, (st_data_t)rb_intern2("OOBINLINE", 9));
3095
#endif
3096
#ifdef SO_KEEPALIVE
3097
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_KEEPALIVE, (st_data_t)rb_intern2("KEEPALIVE", 9));
3098
#endif
3099
#ifdef SO_RCVBUF
3100
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_RCVBUF, (st_data_t)rb_intern2("RCVBUF", 6));
3101
#endif
3102
#ifdef SO_SNDBUF
3103
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_SNDBUF, (st_data_t)rb_intern2("SNDBUF", 6));
3104
#endif
3105
#ifdef SO_BROADCAST
3106
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_BROADCAST, (st_data_t)rb_intern2("BROADCAST", 9));
3107
#endif
3108
#ifdef SO_DONTROUTE
3109
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DONTROUTE, (st_data_t)rb_intern2("DONTROUTE", 9));
3110
#endif
3111
#ifdef SO_ERROR
3112
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_ERROR, (st_data_t)rb_intern2("ERROR", 5));
3113
#endif
3114
#ifdef SO_TYPE
3115
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_TYPE, (st_data_t)rb_intern2("TYPE", 4));
3116
#endif
3117
#ifdef SO_REUSEPORT
3118
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEPORT, (st_data_t)rb_intern2("REUSEPORT", 9));
3119
#endif
3120
#ifdef SO_REUSEADDR
3121
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_REUSEADDR, (st_data_t)rb_intern2("REUSEADDR", 9));
3122
#endif
3123
#ifdef SO_DEBUG
3124
    st_insert(rsock_intern_so_optname_hash, (st_data_t)SO_DEBUG, (st_data_t)rb_intern2("DEBUG", 5));
3125
#endif
3126

    
3127
    rsock_intern_ip_optname_hash = st_init_numtable();
3128
#ifdef IP_MSFILTER
3129
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MSFILTER, (st_data_t)rb_intern2("IP_MSFILTER", 11));
3130
#endif
3131
#ifdef IP_DROP_SOURCE_MEMBERSHIP
3132
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("IP_DROP_SOURCE_MEMBERSHIP", 25));
3133
#endif
3134
#ifdef IP_ADD_SOURCE_MEMBERSHIP
3135
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("IP_ADD_SOURCE_MEMBERSHIP", 24));
3136
#endif
3137
#ifdef IP_BLOCK_SOURCE
3138
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_BLOCK_SOURCE, (st_data_t)rb_intern2("IP_BLOCK_SOURCE", 15));
3139
#endif
3140
#ifdef IP_UNBLOCK_SOURCE
3141
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_UNBLOCK_SOURCE, (st_data_t)rb_intern2("IP_UNBLOCK_SOURCE", 17));
3142
#endif
3143
#ifdef IP_PMTUDISC_DO
3144
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DO, (st_data_t)rb_intern2("IP_PMTUDISC_DO", 14));
3145
#endif
3146
#ifdef IP_PMTUDISC_WANT
3147
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_WANT, (st_data_t)rb_intern2("IP_PMTUDISC_WANT", 16));
3148
#endif
3149
#ifdef IP_PMTUDISC_DONT
3150
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DONT, (st_data_t)rb_intern2("IP_PMTUDISC_DONT", 16));
3151
#endif
3152
#ifdef IP_PASSSEC
3153
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PASSSEC, (st_data_t)rb_intern2("IP_PASSSEC", 10));
3154
#endif
3155
#ifdef IP_XFRM_POLICY
3156
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_XFRM_POLICY, (st_data_t)rb_intern2("IP_XFRM_POLICY", 14));
3157
#endif
3158
#ifdef IP_IPSEC_POLICY
3159
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_IPSEC_POLICY, (st_data_t)rb_intern2("IP_IPSEC_POLICY", 15));
3160
#endif
3161
#ifdef IP_FREEBIND
3162
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_FREEBIND, (st_data_t)rb_intern2("IP_FREEBIND", 11));
3163
#endif
3164
#ifdef IP_MTU
3165
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU, (st_data_t)rb_intern2("IP_MTU", 6));
3166
#endif
3167
#ifdef IP_RECVTOS
3168
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTOS, (st_data_t)rb_intern2("IP_RECVTOS", 10));
3169
#endif
3170
#ifdef IP_RECVERR
3171
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVERR, (st_data_t)rb_intern2("IP_RECVERR", 10));
3172
#endif
3173
#ifdef IP_MTU_DISCOVER
3174
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU_DISCOVER, (st_data_t)rb_intern2("IP_MTU_DISCOVER", 15));
3175
#endif
3176
#ifdef IP_PKTOPTIONS
3177
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTOPTIONS, (st_data_t)rb_intern2("IP_PKTOPTIONS", 13));
3178
#endif
3179
#ifdef IP_PKTINFO
3180
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTINFO, (st_data_t)rb_intern2("IP_PKTINFO", 10));
3181
#endif
3182
#ifdef IP_ROUTER_ALERT
3183
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ROUTER_ALERT, (st_data_t)rb_intern2("IP_ROUTER_ALERT", 15));
3184
#endif
3185
#ifdef IP_MAX_MEMBERSHIPS
3186
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MAX_MEMBERSHIPS, (st_data_t)rb_intern2("IP_MAX_MEMBERSHIPS", 18));
3187
#endif
3188
#ifdef IP_DEFAULT_MULTICAST_LOOP
3189
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_LOOP, (st_data_t)rb_intern2("IP_DEFAULT_MULTICAST_LOOP", 25));
3190
#endif
3191
#ifdef IP_DEFAULT_MULTICAST_TTL
3192
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_TTL, (st_data_t)rb_intern2("IP_DEFAULT_MULTICAST_TTL", 24));
3193
#endif
3194
#ifdef IP_DROP_MEMBERSHIP
3195
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_MEMBERSHIP, (st_data_t)rb_intern2("IP_DROP_MEMBERSHIP", 18));
3196
#endif
3197
#ifdef IP_ADD_MEMBERSHIP
3198
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_MEMBERSHIP, (st_data_t)rb_intern2("IP_ADD_MEMBERSHIP", 17));
3199
#endif
3200
#ifdef IP_MULTICAST_LOOP
3201
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_LOOP, (st_data_t)rb_intern2("IP_MULTICAST_LOOP", 17));
3202
#endif
3203
#ifdef IP_MULTICAST_TTL
3204
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_TTL, (st_data_t)rb_intern2("IP_MULTICAST_TTL", 16));
3205
#endif
3206
#ifdef IP_MULTICAST_IF
3207
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_IF, (st_data_t)rb_intern2("IP_MULTICAST_IF", 15));
3208
#endif
3209
#ifdef IP_PORTRANGE
3210
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PORTRANGE, (st_data_t)rb_intern2("IP_PORTRANGE", 12));
3211
#endif
3212
#ifdef IP_RECVSLLA
3213
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVSLLA, (st_data_t)rb_intern2("IP_RECVSLLA", 11));
3214
#endif
3215
#ifdef IP_RECVIF
3216
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVIF, (st_data_t)rb_intern2("IP_RECVIF", 9));
3217
#endif
3218
#ifdef IP_RECVTTL
3219
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTTL, (st_data_t)rb_intern2("IP_RECVTTL", 10));
3220
#endif
3221
#ifdef IP_ONESBCAST
3222
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ONESBCAST, (st_data_t)rb_intern2("IP_ONESBCAST", 12));
3223
#endif
3224
#ifdef IP_SENDSRCADDR
3225
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_SENDSRCADDR, (st_data_t)rb_intern2("IP_SENDSRCADDR", 14));
3226
#endif
3227
#ifdef IP_DONTFRAG
3228
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DONTFRAG, (st_data_t)rb_intern2("IP_DONTFRAG", 11));
3229
#endif
3230
#ifdef IP_MINTTL
3231
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MINTTL, (st_data_t)rb_intern2("IP_MINTTL", 9));
3232
#endif
3233
#ifdef IP_RETOPTS
3234
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RETOPTS, (st_data_t)rb_intern2("IP_RETOPTS", 10));
3235
#endif
3236
#ifdef IP_RECVDSTADDR
3237
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVDSTADDR, (st_data_t)rb_intern2("IP_RECVDSTADDR", 14));
3238
#endif
3239
#ifdef IP_RECVRETOPTS
3240
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVRETOPTS, (st_data_t)rb_intern2("IP_RECVRETOPTS", 14));
3241
#endif
3242
#ifdef IP_RECVOPTS
3243
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVOPTS, (st_data_t)rb_intern2("IP_RECVOPTS", 11));
3244
#endif
3245
#ifdef IP_TTL
3246
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TTL, (st_data_t)rb_intern2("IP_TTL", 6));
3247
#endif
3248
#ifdef IP_TOS
3249
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_TOS, (st_data_t)rb_intern2("IP_TOS", 6));
3250
#endif
3251
#ifdef IP_HDRINCL
3252
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_HDRINCL, (st_data_t)rb_intern2("IP_HDRINCL", 10));
3253
#endif
3254
#ifdef IP_OPTIONS
3255
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_OPTIONS, (st_data_t)rb_intern2("IP_OPTIONS", 10));
3256
#endif
3257
#ifdef IP_MSFILTER
3258
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MSFILTER, (st_data_t)rb_intern2("MSFILTER", 8));
3259
#endif
3260
#ifdef IP_DROP_SOURCE_MEMBERSHIP
3261
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("DROP_SOURCE_MEMBERSHIP", 22));
3262
#endif
3263
#ifdef IP_ADD_SOURCE_MEMBERSHIP
3264
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_SOURCE_MEMBERSHIP, (st_data_t)rb_intern2("ADD_SOURCE_MEMBERSHIP", 21));
3265
#endif
3266
#ifdef IP_BLOCK_SOURCE
3267
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_BLOCK_SOURCE, (st_data_t)rb_intern2("BLOCK_SOURCE", 12));
3268
#endif
3269
#ifdef IP_UNBLOCK_SOURCE
3270
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_UNBLOCK_SOURCE, (st_data_t)rb_intern2("UNBLOCK_SOURCE", 14));
3271
#endif
3272
#ifdef IP_PMTUDISC_DO
3273
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DO, (st_data_t)rb_intern2("PMTUDISC_DO", 11));
3274
#endif
3275
#ifdef IP_PMTUDISC_WANT
3276
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_WANT, (st_data_t)rb_intern2("PMTUDISC_WANT", 13));
3277
#endif
3278
#ifdef IP_PMTUDISC_DONT
3279
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PMTUDISC_DONT, (st_data_t)rb_intern2("PMTUDISC_DONT", 13));
3280
#endif
3281
#ifdef IP_PASSSEC
3282
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PASSSEC, (st_data_t)rb_intern2("PASSSEC", 7));
3283
#endif
3284
#ifdef IP_XFRM_POLICY
3285
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_XFRM_POLICY, (st_data_t)rb_intern2("XFRM_POLICY", 11));
3286
#endif
3287
#ifdef IP_IPSEC_POLICY
3288
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_IPSEC_POLICY, (st_data_t)rb_intern2("IPSEC_POLICY", 12));
3289
#endif
3290
#ifdef IP_FREEBIND
3291
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_FREEBIND, (st_data_t)rb_intern2("FREEBIND", 8));
3292
#endif
3293
#ifdef IP_MTU
3294
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU, (st_data_t)rb_intern2("MTU", 3));
3295
#endif
3296
#ifdef IP_RECVTOS
3297
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTOS, (st_data_t)rb_intern2("RECVTOS", 7));
3298
#endif
3299
#ifdef IP_RECVERR
3300
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVERR, (st_data_t)rb_intern2("RECVERR", 7));
3301
#endif
3302
#ifdef IP_MTU_DISCOVER
3303
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MTU_DISCOVER, (st_data_t)rb_intern2("MTU_DISCOVER", 12));
3304
#endif
3305
#ifdef IP_PKTOPTIONS
3306
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTOPTIONS, (st_data_t)rb_intern2("PKTOPTIONS", 10));
3307
#endif
3308
#ifdef IP_PKTINFO
3309
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PKTINFO, (st_data_t)rb_intern2("PKTINFO", 7));
3310
#endif
3311
#ifdef IP_ROUTER_ALERT
3312
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ROUTER_ALERT, (st_data_t)rb_intern2("ROUTER_ALERT", 12));
3313
#endif
3314
#ifdef IP_MAX_MEMBERSHIPS
3315
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MAX_MEMBERSHIPS, (st_data_t)rb_intern2("MAX_MEMBERSHIPS", 15));
3316
#endif
3317
#ifdef IP_DEFAULT_MULTICAST_LOOP
3318
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_LOOP, (st_data_t)rb_intern2("DEFAULT_MULTICAST_LOOP", 22));
3319
#endif
3320
#ifdef IP_DEFAULT_MULTICAST_TTL
3321
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DEFAULT_MULTICAST_TTL, (st_data_t)rb_intern2("DEFAULT_MULTICAST_TTL", 21));
3322
#endif
3323
#ifdef IP_DROP_MEMBERSHIP
3324
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DROP_MEMBERSHIP, (st_data_t)rb_intern2("DROP_MEMBERSHIP", 15));
3325
#endif
3326
#ifdef IP_ADD_MEMBERSHIP
3327
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ADD_MEMBERSHIP, (st_data_t)rb_intern2("ADD_MEMBERSHIP", 14));
3328
#endif
3329
#ifdef IP_MULTICAST_LOOP
3330
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_LOOP, (st_data_t)rb_intern2("MULTICAST_LOOP", 14));
3331
#endif
3332
#ifdef IP_MULTICAST_TTL
3333
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_TTL, (st_data_t)rb_intern2("MULTICAST_TTL", 13));
3334
#endif
3335
#ifdef IP_MULTICAST_IF
3336
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MULTICAST_IF, (st_data_t)rb_intern2("MULTICAST_IF", 12));
3337
#endif
3338
#ifdef IP_PORTRANGE
3339
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_PORTRANGE, (st_data_t)rb_intern2("PORTRANGE", 9));
3340
#endif
3341
#ifdef IP_RECVSLLA
3342
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVSLLA, (st_data_t)rb_intern2("RECVSLLA", 8));
3343
#endif
3344
#ifdef IP_RECVIF
3345
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVIF, (st_data_t)rb_intern2("RECVIF", 6));
3346
#endif
3347
#ifdef IP_RECVTTL
3348
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_RECVTTL, (st_data_t)rb_intern2("RECVTTL", 7));
3349
#endif
3350
#ifdef IP_ONESBCAST
3351
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_ONESBCAST, (st_data_t)rb_intern2("ONESBCAST", 9));
3352
#endif
3353
#ifdef IP_SENDSRCADDR
3354
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_SENDSRCADDR, (st_data_t)rb_intern2("SENDSRCADDR", 11));
3355
#endif
3356
#ifdef IP_DONTFRAG
3357
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_DONTFRAG, (st_data_t)rb_intern2("DONTFRAG", 8));
3358
#endif
3359
#ifdef IP_MINTTL
3360
    st_insert(rsock_intern_ip_optname_hash, (st_data_t)IP_MINTTL, (