1# Generated by h2py from /usr/include/netinet/in.h
2
3# Included from sys/cdefs.h
4__GNUCLIKE_ASM = 3
5__GNUCLIKE_ASM = 2
6__GNUCLIKE___TYPEOF = 1
7__GNUCLIKE___OFFSETOF = 1
8__GNUCLIKE___SECTION = 1
9__GNUCLIKE_ATTRIBUTE_MODE_DI = 1
10__GNUCLIKE_CTOR_SECTION_HANDLING = 1
11__GNUCLIKE_BUILTIN_CONSTANT_P = 1
12__GNUCLIKE_BUILTIN_VARARGS = 1
13__GNUCLIKE_BUILTIN_STDARG = 1
14__GNUCLIKE_BUILTIN_VAALIST = 1
15__GNUC_VA_LIST_COMPATIBILITY = 1
16__GNUCLIKE_BUILTIN_NEXT_ARG = 1
17__GNUCLIKE_BUILTIN_MEMCPY = 1
18__CC_SUPPORTS_INLINE = 1
19__CC_SUPPORTS___INLINE = 1
20__CC_SUPPORTS___INLINE__ = 1
21__CC_SUPPORTS___FUNC__ = 1
22__CC_SUPPORTS_WARNING = 1
23__CC_SUPPORTS_VARADIC_XXX = 1
24__CC_SUPPORTS_DYNAMIC_ARRAY_INIT = 1
25__CC_INT_IS_32BIT = 1
26def __P(protos): return protos
27
28def __STRING(x): return #x
29
30def __XSTRING(x): return __STRING(x)
31
32def __P(protos): return ()
33
34def __STRING(x): return "x"
35
36def __aligned(x): return __attribute__((__aligned__(x)))
37
38def __section(x): return __attribute__((__section__(x)))
39
40def __aligned(x): return __attribute__((__aligned__(x)))
41
42def __section(x): return __attribute__((__section__(x)))
43
44def __nonnull(x): return __attribute__((__nonnull__(x)))
45
46def __predict_true(exp): return __builtin_expect((exp), 1)
47
48def __predict_false(exp): return __builtin_expect((exp), 0)
49
50def __predict_true(exp): return (exp)
51
52def __predict_false(exp): return (exp)
53
54def __format_arg(fmtarg): return __attribute__((__format_arg__ (fmtarg)))
55
56def __FBSDID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
57
58def __RCSID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
59
60def __RCSID_SOURCE(s): return __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
61
62def __SCCSID(s): return __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
63
64def __COPYRIGHT(s): return __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
65
66_POSIX_C_SOURCE = 199009
67_POSIX_C_SOURCE = 199209
68__XSI_VISIBLE = 600
69_POSIX_C_SOURCE = 200112
70__XSI_VISIBLE = 500
71_POSIX_C_SOURCE = 199506
72_POSIX_C_SOURCE = 198808
73__POSIX_VISIBLE = 200112
74__ISO_C_VISIBLE = 1999
75__POSIX_VISIBLE = 199506
76__ISO_C_VISIBLE = 1990
77__POSIX_VISIBLE = 199309
78__ISO_C_VISIBLE = 1990
79__POSIX_VISIBLE = 199209
80__ISO_C_VISIBLE = 1990
81__POSIX_VISIBLE = 199009
82__ISO_C_VISIBLE = 1990
83__POSIX_VISIBLE = 198808
84__ISO_C_VISIBLE = 0
85__POSIX_VISIBLE = 0
86__XSI_VISIBLE = 0
87__BSD_VISIBLE = 0
88__ISO_C_VISIBLE = 1990
89__POSIX_VISIBLE = 0
90__XSI_VISIBLE = 0
91__BSD_VISIBLE = 0
92__ISO_C_VISIBLE = 1999
93__POSIX_VISIBLE = 200112
94__XSI_VISIBLE = 600
95__BSD_VISIBLE = 1
96__ISO_C_VISIBLE = 1999
97
98# Included from sys/_types.h
99
100# Included from machine/_types.h
101
102# Included from machine/endian.h
103_QUAD_HIGHWORD = 1
104_QUAD_LOWWORD = 0
105_LITTLE_ENDIAN = 1234
106_BIG_ENDIAN = 4321
107_PDP_ENDIAN = 3412
108_BYTE_ORDER = _LITTLE_ENDIAN
109LITTLE_ENDIAN = _LITTLE_ENDIAN
110BIG_ENDIAN = _BIG_ENDIAN
111PDP_ENDIAN = _PDP_ENDIAN
112BYTE_ORDER = _BYTE_ORDER
113def __word_swap_int_var(x): return \
114
115def __word_swap_int_const(x): return \
116
117def __word_swap_int(x): return __word_swap_int_var(x)
118
119def __byte_swap_int_var(x): return \
120
121def __byte_swap_int_const(x): return \
122
123def __byte_swap_int(x): return __byte_swap_int_var(x)
124
125def __byte_swap_long_var(x): return \
126
127def __byte_swap_long_const(x): return \
128
129def __byte_swap_long(x): return __byte_swap_long_var(x)
130
131def __byte_swap_word_var(x): return \
132
133def __byte_swap_word_const(x): return \
134
135def __byte_swap_word(x): return __byte_swap_word_var(x)
136
137def __htonl(x): return __bswap32(x)
138
139def __htons(x): return __bswap16(x)
140
141def __ntohl(x): return __bswap32(x)
142
143def __ntohs(x): return __bswap16(x)
144
145IPPROTO_IP = 0
146IPPROTO_ICMP = 1
147IPPROTO_TCP = 6
148IPPROTO_UDP = 17
149def htonl(x): return __htonl(x)
150
151def htons(x): return __htons(x)
152
153def ntohl(x): return __ntohl(x)
154
155def ntohs(x): return __ntohs(x)
156
157IPPROTO_RAW = 255
158INET_ADDRSTRLEN = 16
159IPPROTO_HOPOPTS = 0
160IPPROTO_IGMP = 2
161IPPROTO_GGP = 3
162IPPROTO_IPV4 = 4
163IPPROTO_IPIP = IPPROTO_IPV4
164IPPROTO_ST = 7
165IPPROTO_EGP = 8
166IPPROTO_PIGP = 9
167IPPROTO_RCCMON = 10
168IPPROTO_NVPII = 11
169IPPROTO_PUP = 12
170IPPROTO_ARGUS = 13
171IPPROTO_EMCON = 14
172IPPROTO_XNET = 15
173IPPROTO_CHAOS = 16
174IPPROTO_MUX = 18
175IPPROTO_MEAS = 19
176IPPROTO_HMP = 20
177IPPROTO_PRM = 21
178IPPROTO_IDP = 22
179IPPROTO_TRUNK1 = 23
180IPPROTO_TRUNK2 = 24
181IPPROTO_LEAF1 = 25
182IPPROTO_LEAF2 = 26
183IPPROTO_RDP = 27
184IPPROTO_IRTP = 28
185IPPROTO_TP = 29
186IPPROTO_BLT = 30
187IPPROTO_NSP = 31
188IPPROTO_INP = 32
189IPPROTO_SEP = 33
190IPPROTO_3PC = 34
191IPPROTO_IDPR = 35
192IPPROTO_XTP = 36
193IPPROTO_DDP = 37
194IPPROTO_CMTP = 38
195IPPROTO_TPXX = 39
196IPPROTO_IL = 40
197IPPROTO_IPV6 = 41
198IPPROTO_SDRP = 42
199IPPROTO_ROUTING = 43
200IPPROTO_FRAGMENT = 44
201IPPROTO_IDRP = 45
202IPPROTO_RSVP = 46
203IPPROTO_GRE = 47
204IPPROTO_MHRP = 48
205IPPROTO_BHA = 49
206IPPROTO_ESP = 50
207IPPROTO_AH = 51
208IPPROTO_INLSP = 52
209IPPROTO_SWIPE = 53
210IPPROTO_NHRP = 54
211IPPROTO_MOBILE = 55
212IPPROTO_TLSP = 56
213IPPROTO_SKIP = 57
214IPPROTO_ICMPV6 = 58
215IPPROTO_NONE = 59
216IPPROTO_DSTOPTS = 60
217IPPROTO_AHIP = 61
218IPPROTO_CFTP = 62
219IPPROTO_HELLO = 63
220IPPROTO_SATEXPAK = 64
221IPPROTO_KRYPTOLAN = 65
222IPPROTO_RVD = 66
223IPPROTO_IPPC = 67
224IPPROTO_ADFS = 68
225IPPROTO_SATMON = 69
226IPPROTO_VISA = 70
227IPPROTO_IPCV = 71
228IPPROTO_CPNX = 72
229IPPROTO_CPHB = 73
230IPPROTO_WSN = 74
231IPPROTO_PVP = 75
232IPPROTO_BRSATMON = 76
233IPPROTO_ND = 77
234IPPROTO_WBMON = 78
235IPPROTO_WBEXPAK = 79
236IPPROTO_EON = 80
237IPPROTO_VMTP = 81
238IPPROTO_SVMTP = 82
239IPPROTO_VINES = 83
240IPPROTO_TTP = 84
241IPPROTO_IGP = 85
242IPPROTO_DGP = 86
243IPPROTO_TCF = 87
244IPPROTO_IGRP = 88
245IPPROTO_OSPFIGP = 89
246IPPROTO_SRPC = 90
247IPPROTO_LARP = 91
248IPPROTO_MTP = 92
249IPPROTO_AX25 = 93
250IPPROTO_IPEIP = 94
251IPPROTO_MICP = 95
252IPPROTO_SCCSP = 96
253IPPROTO_ETHERIP = 97
254IPPROTO_ENCAP = 98
255IPPROTO_APES = 99
256IPPROTO_GMTP = 100
257IPPROTO_IPCOMP = 108
258IPPROTO_SCTP = 132
259IPPROTO_PIM = 103
260IPPROTO_CARP = 112
261IPPROTO_PGM = 113
262IPPROTO_PFSYNC = 240
263IPPROTO_OLD_DIVERT = 254
264IPPROTO_MAX = 256
265IPPROTO_DONE = 257
266IPPROTO_DIVERT = 258
267IPPROTO_SPACER = 32767
268IPPORT_RESERVED = 1024
269IPPORT_HIFIRSTAUTO = 49152
270IPPORT_HILASTAUTO = 65535
271IPPORT_RESERVEDSTART = 600
272IPPORT_MAX = 65535
273def IN_CLASSA(i): return (((u_int32_t)(i) & 0x80000000) == 0)
274
275IN_CLASSA_NET = 0xff000000
276IN_CLASSA_NSHIFT = 24
277IN_CLASSA_HOST = 0x00ffffff
278IN_CLASSA_MAX = 128
279def IN_CLASSB(i): return (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
280
281IN_CLASSB_NET = 0xffff0000
282IN_CLASSB_NSHIFT = 16
283IN_CLASSB_HOST = 0x0000ffff
284IN_CLASSB_MAX = 65536
285def IN_CLASSC(i): return (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
286
287IN_CLASSC_NET = 0xffffff00
288IN_CLASSC_NSHIFT = 8
289IN_CLASSC_HOST = 0x000000ff
290def IN_CLASSD(i): return (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
291
292IN_CLASSD_NET = 0xf0000000
293IN_CLASSD_NSHIFT = 28
294IN_CLASSD_HOST = 0x0fffffff
295def IN_MULTICAST(i): return IN_CLASSD(i)
296
297def IN_EXPERIMENTAL(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
298
299def IN_BADCLASS(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
300
301INADDR_NONE = 0xffffffff
302IN_LOOPBACKNET = 127
303IP_OPTIONS = 1
304IP_HDRINCL = 2
305IP_TOS = 3
306IP_TTL = 4
307IP_RECVOPTS = 5
308IP_RECVRETOPTS = 6
309IP_RECVDSTADDR = 7
310IP_SENDSRCADDR = IP_RECVDSTADDR
311IP_RETOPTS = 8
312IP_MULTICAST_IF = 9
313IP_MULTICAST_TTL = 10
314IP_MULTICAST_LOOP = 11
315IP_ADD_MEMBERSHIP = 12
316IP_DROP_MEMBERSHIP = 13
317IP_MULTICAST_VIF = 14
318IP_RSVP_ON = 15
319IP_RSVP_OFF = 16
320IP_RSVP_VIF_ON = 17
321IP_RSVP_VIF_OFF = 18
322IP_PORTRANGE = 19
323IP_RECVIF = 20
324IP_IPSEC_POLICY = 21
325IP_FAITH = 22
326IP_ONESBCAST = 23
327IP_FW_TABLE_ADD = 40
328IP_FW_TABLE_DEL = 41
329IP_FW_TABLE_FLUSH = 42
330IP_FW_TABLE_GETSIZE = 43
331IP_FW_TABLE_LIST = 44
332IP_FW_ADD = 50
333IP_FW_DEL = 51
334IP_FW_FLUSH = 52
335IP_FW_ZERO = 53
336IP_FW_GET = 54
337IP_FW_RESETLOG = 55
338IP_DUMMYNET_CONFIGURE = 60
339IP_DUMMYNET_DEL = 61
340IP_DUMMYNET_FLUSH = 62
341IP_DUMMYNET_GET = 64
342IP_RECVTTL = 65
343IP_MINTTL = 66
344IP_DONTFRAG = 67
345IP_DEFAULT_MULTICAST_TTL = 1
346IP_DEFAULT_MULTICAST_LOOP = 1
347IP_MAX_MEMBERSHIPS = 20
348IP_PORTRANGE_DEFAULT = 0
349IP_PORTRANGE_HIGH = 1
350IP_PORTRANGE_LOW = 2
351IPPROTO_MAXID = (IPPROTO_AH + 1)
352IPCTL_FORWARDING = 1
353IPCTL_SENDREDIRECTS = 2
354IPCTL_DEFTTL = 3
355IPCTL_DEFMTU = 4
356IPCTL_RTEXPIRE = 5
357IPCTL_RTMINEXPIRE = 6
358IPCTL_RTMAXCACHE = 7
359IPCTL_SOURCEROUTE = 8
360IPCTL_DIRECTEDBROADCAST = 9
361IPCTL_INTRQMAXLEN = 10
362IPCTL_INTRQDROPS = 11
363IPCTL_STATS = 12
364IPCTL_ACCEPTSOURCEROUTE = 13
365IPCTL_FASTFORWARDING = 14
366IPCTL_KEEPFAITH = 15
367IPCTL_GIF_TTL = 16
368IPCTL_MAXID = 17
369def in_nullhost(x): return ((x).s_addr == INADDR_ANY)
370
371
372# Included from netinet6/in6.h
373__KAME_VERSION = "FreeBSD"
374IPV6PORT_RESERVED = 1024
375IPV6PORT_ANONMIN = 49152
376IPV6PORT_ANONMAX = 65535
377IPV6PORT_RESERVEDMIN = 600
378IPV6PORT_RESERVEDMAX = (IPV6PORT_RESERVED-1)
379INET6_ADDRSTRLEN = 46
380IPV6_ADDR_INT32_ONE = 1
381IPV6_ADDR_INT32_TWO = 2
382IPV6_ADDR_INT32_MNL = 0xff010000
383IPV6_ADDR_INT32_MLL = 0xff020000
384IPV6_ADDR_INT32_SMP = 0x0000ffff
385IPV6_ADDR_INT16_ULL = 0xfe80
386IPV6_ADDR_INT16_USL = 0xfec0
387IPV6_ADDR_INT16_MLL = 0xff02
388IPV6_ADDR_INT32_ONE = 0x01000000
389IPV6_ADDR_INT32_TWO = 0x02000000
390IPV6_ADDR_INT32_MNL = 0x000001ff
391IPV6_ADDR_INT32_MLL = 0x000002ff
392IPV6_ADDR_INT32_SMP = 0xffff0000
393IPV6_ADDR_INT16_ULL = 0x80fe
394IPV6_ADDR_INT16_USL = 0xc0fe
395IPV6_ADDR_INT16_MLL = 0x02ff
396def IN6_IS_ADDR_UNSPECIFIED(a): return \
397
398def IN6_IS_ADDR_LOOPBACK(a): return \
399
400def IN6_IS_ADDR_V4COMPAT(a): return \
401
402def IN6_IS_ADDR_V4MAPPED(a): return \
403
404IPV6_ADDR_SCOPE_NODELOCAL = 0x01
405IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01
406IPV6_ADDR_SCOPE_LINKLOCAL = 0x02
407IPV6_ADDR_SCOPE_SITELOCAL = 0x05
408IPV6_ADDR_SCOPE_ORGLOCAL = 0x08
409IPV6_ADDR_SCOPE_GLOBAL = 0x0e
410__IPV6_ADDR_SCOPE_NODELOCAL = 0x01
411__IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01
412__IPV6_ADDR_SCOPE_LINKLOCAL = 0x02
413__IPV6_ADDR_SCOPE_SITELOCAL = 0x05
414__IPV6_ADDR_SCOPE_ORGLOCAL = 0x08
415__IPV6_ADDR_SCOPE_GLOBAL = 0x0e
416def IN6_IS_ADDR_LINKLOCAL(a): return \
417
418def IN6_IS_ADDR_SITELOCAL(a): return \
419
420def IN6_IS_ADDR_MC_NODELOCAL(a): return \
421
422def IN6_IS_ADDR_MC_INTFACELOCAL(a): return \
423
424def IN6_IS_ADDR_MC_LINKLOCAL(a): return \
425
426def IN6_IS_ADDR_MC_SITELOCAL(a): return \
427
428def IN6_IS_ADDR_MC_ORGLOCAL(a): return \
429
430def IN6_IS_ADDR_MC_GLOBAL(a): return \
431
432def IN6_IS_ADDR_MC_NODELOCAL(a): return \
433
434def IN6_IS_ADDR_MC_LINKLOCAL(a): return \
435
436def IN6_IS_ADDR_MC_SITELOCAL(a): return \
437
438def IN6_IS_ADDR_MC_ORGLOCAL(a): return \
439
440def IN6_IS_ADDR_MC_GLOBAL(a): return \
441
442def IN6_IS_SCOPE_LINKLOCAL(a): return \
443
444def IFA6_IS_DEPRECATED(a): return \
445
446def IFA6_IS_INVALID(a): return \
447
448IPV6_OPTIONS = 1
449IPV6_RECVOPTS = 5
450IPV6_RECVRETOPTS = 6
451IPV6_RECVDSTADDR = 7
452IPV6_RETOPTS = 8
453IPV6_SOCKOPT_RESERVED1 = 3
454IPV6_UNICAST_HOPS = 4
455IPV6_MULTICAST_IF = 9
456IPV6_MULTICAST_HOPS = 10
457IPV6_MULTICAST_LOOP = 11
458IPV6_JOIN_GROUP = 12
459IPV6_LEAVE_GROUP = 13
460IPV6_PORTRANGE = 14
461ICMP6_FILTER = 18
462IPV6_2292PKTINFO = 19
463IPV6_2292HOPLIMIT = 20
464IPV6_2292NEXTHOP = 21
465IPV6_2292HOPOPTS = 22
466IPV6_2292DSTOPTS = 23
467IPV6_2292RTHDR = 24
468IPV6_2292PKTOPTIONS = 25
469IPV6_CHECKSUM = 26
470IPV6_V6ONLY = 27
471IPV6_BINDV6ONLY = IPV6_V6ONLY
472IPV6_IPSEC_POLICY = 28
473IPV6_FAITH = 29
474IPV6_FW_ADD = 30
475IPV6_FW_DEL = 31
476IPV6_FW_FLUSH = 32
477IPV6_FW_ZERO = 33
478IPV6_FW_GET = 34
479IPV6_RTHDRDSTOPTS = 35
480IPV6_RECVPKTINFO = 36
481IPV6_RECVHOPLIMIT = 37
482IPV6_RECVRTHDR = 38
483IPV6_RECVHOPOPTS = 39
484IPV6_RECVDSTOPTS = 40
485IPV6_RECVRTHDRDSTOPTS = 41
486IPV6_USE_MIN_MTU = 42
487IPV6_RECVPATHMTU = 43
488IPV6_PATHMTU = 44
489IPV6_REACHCONF = 45
490IPV6_PKTINFO = 46
491IPV6_HOPLIMIT = 47
492IPV6_NEXTHOP = 48
493IPV6_HOPOPTS = 49
494IPV6_DSTOPTS = 50
495IPV6_RTHDR = 51
496IPV6_PKTOPTIONS = 52
497IPV6_RECVTCLASS = 57
498IPV6_AUTOFLOWLABEL = 59
499IPV6_TCLASS = 61
500IPV6_DONTFRAG = 62
501IPV6_PREFER_TEMPADDR = 63
502IPV6_RTHDR_LOOSE = 0
503IPV6_RTHDR_STRICT = 1
504IPV6_RTHDR_TYPE_0 = 0
505IPV6_DEFAULT_MULTICAST_HOPS = 1
506IPV6_DEFAULT_MULTICAST_LOOP = 1
507IPV6_PORTRANGE_DEFAULT = 0
508IPV6_PORTRANGE_HIGH = 1
509IPV6_PORTRANGE_LOW = 2
510IPV6PROTO_MAXID = (IPPROTO_PIM + 1)
511IPV6CTL_FORWARDING = 1
512IPV6CTL_SENDREDIRECTS = 2
513IPV6CTL_DEFHLIM = 3
514IPV6CTL_DEFMTU = 4
515IPV6CTL_FORWSRCRT = 5
516IPV6CTL_STATS = 6
517IPV6CTL_MRTSTATS = 7
518IPV6CTL_MRTPROTO = 8
519IPV6CTL_MAXFRAGPACKETS = 9
520IPV6CTL_SOURCECHECK = 10
521IPV6CTL_SOURCECHECK_LOGINT = 11
522IPV6CTL_ACCEPT_RTADV = 12
523IPV6CTL_KEEPFAITH = 13
524IPV6CTL_LOG_INTERVAL = 14
525IPV6CTL_HDRNESTLIMIT = 15
526IPV6CTL_DAD_COUNT = 16
527IPV6CTL_AUTO_FLOWLABEL = 17
528IPV6CTL_DEFMCASTHLIM = 18
529IPV6CTL_GIF_HLIM = 19
530IPV6CTL_KAME_VERSION = 20
531IPV6CTL_USE_DEPRECATED = 21
532IPV6CTL_RR_PRUNE = 22
533IPV6CTL_MAPPED_ADDR = 23
534IPV6CTL_V6ONLY = 24
535IPV6CTL_RTEXPIRE = 25
536IPV6CTL_RTMINEXPIRE = 26
537IPV6CTL_RTMAXCACHE = 27
538IPV6CTL_USETEMPADDR = 32
539IPV6CTL_TEMPPLTIME = 33
540IPV6CTL_TEMPVLTIME = 34
541IPV6CTL_AUTO_LINKLOCAL = 35
542IPV6CTL_RIP6STATS = 36
543IPV6CTL_PREFER_TEMPADDR = 37
544IPV6CTL_ADDRCTLPOLICY = 38
545IPV6CTL_USE_DEFAULTZONE = 39
546IPV6CTL_MAXFRAGS = 41
547IPV6CTL_IFQ = 42
548IPV6CTL_ISATAPRTR = 43
549IPV6CTL_MCAST_PMTU = 44
550IPV6CTL_STEALTH = 45
551IPV6CTL_MAXID = 46
552