xref: /AOO41X/main/python/python-freebsd.patch (revision 6ee2a585b329d9fb50ad3a152a1905ff467aab9a)
1*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Lib/plat-freebsd9/IN.py misc/build/Python-2.7.8/Lib/plat-freebsd9/IN.py
2*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Lib/plat-freebsd9/IN.py	1969-12-31 19:00:00.000000000 -0500
3*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Lib/plat-freebsd9/IN.py	2016-01-01 17:38:35.922764464 -0500
4723f57f2SPedro Giffuni@@ -0,0 +1,612 @@
5723f57f2SPedro Giffuni+# Generated by h2py from /usr/include/netinet/in.h
6723f57f2SPedro Giffuni+
7723f57f2SPedro Giffuni+# Included from sys/cdefs.h
8723f57f2SPedro Giffuni+__GNUCLIKE_ASM = 3
9723f57f2SPedro Giffuni+__GNUCLIKE_ASM = 2
10723f57f2SPedro Giffuni+__GNUCLIKE___TYPEOF = 1
11723f57f2SPedro Giffuni+__GNUCLIKE___OFFSETOF = 1
12723f57f2SPedro Giffuni+__GNUCLIKE___SECTION = 1
13723f57f2SPedro Giffuni+__GNUCLIKE_CTOR_SECTION_HANDLING = 1
14723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_CONSTANT_P = 1
15723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_VARARGS = 1
16723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_STDARG = 1
17723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_VAALIST = 1
18723f57f2SPedro Giffuni+__GNUC_VA_LIST_COMPATIBILITY = 1
19723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_NEXT_ARG = 1
20723f57f2SPedro Giffuni+__GNUCLIKE_BUILTIN_MEMCPY = 1
21723f57f2SPedro Giffuni+__CC_SUPPORTS_INLINE = 1
22723f57f2SPedro Giffuni+__CC_SUPPORTS___INLINE = 1
23723f57f2SPedro Giffuni+__CC_SUPPORTS___INLINE__ = 1
24723f57f2SPedro Giffuni+__CC_SUPPORTS___FUNC__ = 1
25723f57f2SPedro Giffuni+__CC_SUPPORTS_WARNING = 1
26723f57f2SPedro Giffuni+__CC_SUPPORTS_VARADIC_XXX = 1
27723f57f2SPedro Giffuni+__CC_SUPPORTS_DYNAMIC_ARRAY_INIT = 1
28723f57f2SPedro Giffuni+def __P(protos): return protos
29723f57f2SPedro Giffuni+
30723f57f2SPedro Giffuni+def __STRING(x): return #x
31723f57f2SPedro Giffuni+
32723f57f2SPedro Giffuni+def __XSTRING(x): return __STRING(x)
33723f57f2SPedro Giffuni+
34723f57f2SPedro Giffuni+def __P(protos): return ()
35723f57f2SPedro Giffuni+
36723f57f2SPedro Giffuni+def __STRING(x): return "x"
37723f57f2SPedro Giffuni+
38723f57f2SPedro Giffuni+def __aligned(x): return __attribute__((__aligned__(x)))
39723f57f2SPedro Giffuni+
40723f57f2SPedro Giffuni+def __section(x): return __attribute__((__section__(x)))
41723f57f2SPedro Giffuni+
42723f57f2SPedro Giffuni+def __aligned(x): return __attribute__((__aligned__(x)))
43723f57f2SPedro Giffuni+
44723f57f2SPedro Giffuni+def __section(x): return __attribute__((__section__(x)))
45723f57f2SPedro Giffuni+
46723f57f2SPedro Giffuni+def _Alignas(e): return alignas(e)
47723f57f2SPedro Giffuni+
48723f57f2SPedro Giffuni+def _Alignof(e): return alignof(e)
49723f57f2SPedro Giffuni+
50723f57f2SPedro Giffuni+def _Alignas(x): return __aligned(x)
51723f57f2SPedro Giffuni+
52723f57f2SPedro Giffuni+def _Alignof(x): return __alignof(x)
53723f57f2SPedro Giffuni+
54723f57f2SPedro Giffuni+def __nonnull(x): return __attribute__((__nonnull__(x)))
55723f57f2SPedro Giffuni+
56723f57f2SPedro Giffuni+def __predict_true(exp): return __builtin_expect((exp), 1)
57723f57f2SPedro Giffuni+
58723f57f2SPedro Giffuni+def __predict_false(exp): return __builtin_expect((exp), 0)
59723f57f2SPedro Giffuni+
60723f57f2SPedro Giffuni+def __predict_true(exp): return (exp)
61723f57f2SPedro Giffuni+
62723f57f2SPedro Giffuni+def __predict_false(exp): return (exp)
63723f57f2SPedro Giffuni+
64723f57f2SPedro Giffuni+def __format_arg(fmtarg): return __attribute__((__format_arg__ (fmtarg)))
65723f57f2SPedro Giffuni+
66723f57f2SPedro Giffuni+def __GLOBL(sym): return __GLOBL1(sym)
67723f57f2SPedro Giffuni+
68723f57f2SPedro Giffuni+def __FBSDID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
69723f57f2SPedro Giffuni+
70723f57f2SPedro Giffuni+def __RCSID(s): return __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
71723f57f2SPedro Giffuni+
72723f57f2SPedro Giffuni+def __RCSID_SOURCE(s): return __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
73723f57f2SPedro Giffuni+
74723f57f2SPedro Giffuni+def __SCCSID(s): return __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
75723f57f2SPedro Giffuni+
76723f57f2SPedro Giffuni+def __COPYRIGHT(s): return __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
77723f57f2SPedro Giffuni+
78723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 199009
79723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 199209
80723f57f2SPedro Giffuni+__XSI_VISIBLE = 700
81723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 200809
82723f57f2SPedro Giffuni+__XSI_VISIBLE = 600
83723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 200112
84723f57f2SPedro Giffuni+__XSI_VISIBLE = 500
85723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 199506
86723f57f2SPedro Giffuni+_POSIX_C_SOURCE = 198808
87723f57f2SPedro Giffuni+__POSIX_VISIBLE = 200809
88723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1999
89723f57f2SPedro Giffuni+__POSIX_VISIBLE = 200112
90723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1999
91723f57f2SPedro Giffuni+__POSIX_VISIBLE = 199506
92723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1990
93723f57f2SPedro Giffuni+__POSIX_VISIBLE = 199309
94723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1990
95723f57f2SPedro Giffuni+__POSIX_VISIBLE = 199209
96723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1990
97723f57f2SPedro Giffuni+__POSIX_VISIBLE = 199009
98723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1990
99723f57f2SPedro Giffuni+__POSIX_VISIBLE = 198808
100723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 0
101723f57f2SPedro Giffuni+__POSIX_VISIBLE = 0
102723f57f2SPedro Giffuni+__XSI_VISIBLE = 0
103723f57f2SPedro Giffuni+__BSD_VISIBLE = 0
104723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1990
105723f57f2SPedro Giffuni+__POSIX_VISIBLE = 0
106723f57f2SPedro Giffuni+__XSI_VISIBLE = 0
107723f57f2SPedro Giffuni+__BSD_VISIBLE = 0
108723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1999
109723f57f2SPedro Giffuni+__POSIX_VISIBLE = 200809
110723f57f2SPedro Giffuni+__XSI_VISIBLE = 700
111723f57f2SPedro Giffuni+__BSD_VISIBLE = 1
112723f57f2SPedro Giffuni+__ISO_C_VISIBLE = 1999
113723f57f2SPedro Giffuni+def __has_feature(x): return 0
114723f57f2SPedro Giffuni+
115723f57f2SPedro Giffuni+def __has_include(x): return 0
116723f57f2SPedro Giffuni+
117723f57f2SPedro Giffuni+def __has_builtin(x): return 0
118723f57f2SPedro Giffuni+
119723f57f2SPedro Giffuni+__NO_TLS = 1
120723f57f2SPedro Giffuni+
121723f57f2SPedro Giffuni+# Included from sys/_types.h
122723f57f2SPedro Giffuni+
123723f57f2SPedro Giffuni+# Included from machine/_types.h
124723f57f2SPedro Giffuni+
125723f57f2SPedro Giffuni+# Included from machine/endian.h
126723f57f2SPedro Giffuni+_QUAD_HIGHWORD = 1
127723f57f2SPedro Giffuni+_QUAD_LOWWORD = 0
128723f57f2SPedro Giffuni+_LITTLE_ENDIAN = 1234
129723f57f2SPedro Giffuni+_BIG_ENDIAN = 4321
130723f57f2SPedro Giffuni+_PDP_ENDIAN = 3412
131723f57f2SPedro Giffuni+_BYTE_ORDER = _LITTLE_ENDIAN
132723f57f2SPedro Giffuni+LITTLE_ENDIAN = _LITTLE_ENDIAN
133723f57f2SPedro Giffuni+BIG_ENDIAN = _BIG_ENDIAN
134723f57f2SPedro Giffuni+PDP_ENDIAN = _PDP_ENDIAN
135723f57f2SPedro Giffuni+BYTE_ORDER = _BYTE_ORDER
136723f57f2SPedro Giffuni+def __bswap64_const(_x): return \
137723f57f2SPedro Giffuni+
138723f57f2SPedro Giffuni+def __bswap32_const(_x): return \
139723f57f2SPedro Giffuni+
140723f57f2SPedro Giffuni+def __bswap16_const(_x): return (__uint16_t)((_x) << 8 | (_x) >> 8)
141723f57f2SPedro Giffuni+
142723f57f2SPedro Giffuni+def __bswap64(_x): return \
143723f57f2SPedro Giffuni+
144723f57f2SPedro Giffuni+def __bswap32(_x): return \
145723f57f2SPedro Giffuni+
146723f57f2SPedro Giffuni+def __bswap16(_x): return \
147723f57f2SPedro Giffuni+
148723f57f2SPedro Giffuni+def __htonl(x): return __bswap32(x)
149723f57f2SPedro Giffuni+
150723f57f2SPedro Giffuni+def __htons(x): return __bswap16(x)
151723f57f2SPedro Giffuni+
152723f57f2SPedro Giffuni+def __ntohl(x): return __bswap32(x)
153723f57f2SPedro Giffuni+
154723f57f2SPedro Giffuni+def __ntohs(x): return __bswap16(x)
155723f57f2SPedro Giffuni+
156723f57f2SPedro Giffuni+IPPROTO_IP = 0
157723f57f2SPedro Giffuni+IPPROTO_ICMP = 1
158723f57f2SPedro Giffuni+IPPROTO_TCP = 6
159723f57f2SPedro Giffuni+IPPROTO_UDP = 17
160723f57f2SPedro Giffuni+
161723f57f2SPedro Giffuni+# Included from sys/_sockaddr_storage.h
162723f57f2SPedro Giffuni+def htonl(x): return __htonl(x)
163723f57f2SPedro Giffuni+
164723f57f2SPedro Giffuni+def htons(x): return __htons(x)
165723f57f2SPedro Giffuni+
166723f57f2SPedro Giffuni+def ntohl(x): return __ntohl(x)
167723f57f2SPedro Giffuni+
168723f57f2SPedro Giffuni+def ntohs(x): return __ntohs(x)
169723f57f2SPedro Giffuni+
170723f57f2SPedro Giffuni+IPPROTO_RAW = 255
171723f57f2SPedro Giffuni+INET_ADDRSTRLEN = 16
172723f57f2SPedro Giffuni+IPPROTO_HOPOPTS = 0
173723f57f2SPedro Giffuni+IPPROTO_IGMP = 2
174723f57f2SPedro Giffuni+IPPROTO_GGP = 3
175723f57f2SPedro Giffuni+IPPROTO_IPV4 = 4
176723f57f2SPedro Giffuni+IPPROTO_IPIP = IPPROTO_IPV4
177723f57f2SPedro Giffuni+IPPROTO_ST = 7
178723f57f2SPedro Giffuni+IPPROTO_EGP = 8
179723f57f2SPedro Giffuni+IPPROTO_PIGP = 9
180723f57f2SPedro Giffuni+IPPROTO_RCCMON = 10
181723f57f2SPedro Giffuni+IPPROTO_NVPII = 11
182723f57f2SPedro Giffuni+IPPROTO_PUP = 12
183723f57f2SPedro Giffuni+IPPROTO_ARGUS = 13
184723f57f2SPedro Giffuni+IPPROTO_EMCON = 14
185723f57f2SPedro Giffuni+IPPROTO_XNET = 15
186723f57f2SPedro Giffuni+IPPROTO_CHAOS = 16
187723f57f2SPedro Giffuni+IPPROTO_MUX = 18
188723f57f2SPedro Giffuni+IPPROTO_MEAS = 19
189723f57f2SPedro Giffuni+IPPROTO_HMP = 20
190723f57f2SPedro Giffuni+IPPROTO_PRM = 21
191723f57f2SPedro Giffuni+IPPROTO_IDP = 22
192723f57f2SPedro Giffuni+IPPROTO_TRUNK1 = 23
193723f57f2SPedro Giffuni+IPPROTO_TRUNK2 = 24
194723f57f2SPedro Giffuni+IPPROTO_LEAF1 = 25
195723f57f2SPedro Giffuni+IPPROTO_LEAF2 = 26
196723f57f2SPedro Giffuni+IPPROTO_RDP = 27
197723f57f2SPedro Giffuni+IPPROTO_IRTP = 28
198723f57f2SPedro Giffuni+IPPROTO_TP = 29
199723f57f2SPedro Giffuni+IPPROTO_BLT = 30
200723f57f2SPedro Giffuni+IPPROTO_NSP = 31
201723f57f2SPedro Giffuni+IPPROTO_INP = 32
202723f57f2SPedro Giffuni+IPPROTO_SEP = 33
203723f57f2SPedro Giffuni+IPPROTO_3PC = 34
204723f57f2SPedro Giffuni+IPPROTO_IDPR = 35
205723f57f2SPedro Giffuni+IPPROTO_XTP = 36
206723f57f2SPedro Giffuni+IPPROTO_DDP = 37
207723f57f2SPedro Giffuni+IPPROTO_CMTP = 38
208723f57f2SPedro Giffuni+IPPROTO_TPXX = 39
209723f57f2SPedro Giffuni+IPPROTO_IL = 40
210723f57f2SPedro Giffuni+IPPROTO_IPV6 = 41
211723f57f2SPedro Giffuni+IPPROTO_SDRP = 42
212723f57f2SPedro Giffuni+IPPROTO_ROUTING = 43
213723f57f2SPedro Giffuni+IPPROTO_FRAGMENT = 44
214723f57f2SPedro Giffuni+IPPROTO_IDRP = 45
215723f57f2SPedro Giffuni+IPPROTO_RSVP = 46
216723f57f2SPedro Giffuni+IPPROTO_GRE = 47
217723f57f2SPedro Giffuni+IPPROTO_MHRP = 48
218723f57f2SPedro Giffuni+IPPROTO_BHA = 49
219723f57f2SPedro Giffuni+IPPROTO_ESP = 50
220723f57f2SPedro Giffuni+IPPROTO_AH = 51
221723f57f2SPedro Giffuni+IPPROTO_INLSP = 52
222723f57f2SPedro Giffuni+IPPROTO_SWIPE = 53
223723f57f2SPedro Giffuni+IPPROTO_NHRP = 54
224723f57f2SPedro Giffuni+IPPROTO_MOBILE = 55
225723f57f2SPedro Giffuni+IPPROTO_TLSP = 56
226723f57f2SPedro Giffuni+IPPROTO_SKIP = 57
227723f57f2SPedro Giffuni+IPPROTO_ICMPV6 = 58
228723f57f2SPedro Giffuni+IPPROTO_NONE = 59
229723f57f2SPedro Giffuni+IPPROTO_DSTOPTS = 60
230723f57f2SPedro Giffuni+IPPROTO_AHIP = 61
231723f57f2SPedro Giffuni+IPPROTO_CFTP = 62
232723f57f2SPedro Giffuni+IPPROTO_HELLO = 63
233723f57f2SPedro Giffuni+IPPROTO_SATEXPAK = 64
234723f57f2SPedro Giffuni+IPPROTO_KRYPTOLAN = 65
235723f57f2SPedro Giffuni+IPPROTO_RVD = 66
236723f57f2SPedro Giffuni+IPPROTO_IPPC = 67
237723f57f2SPedro Giffuni+IPPROTO_ADFS = 68
238723f57f2SPedro Giffuni+IPPROTO_SATMON = 69
239723f57f2SPedro Giffuni+IPPROTO_VISA = 70
240723f57f2SPedro Giffuni+IPPROTO_IPCV = 71
241723f57f2SPedro Giffuni+IPPROTO_CPNX = 72
242723f57f2SPedro Giffuni+IPPROTO_CPHB = 73
243723f57f2SPedro Giffuni+IPPROTO_WSN = 74
244723f57f2SPedro Giffuni+IPPROTO_PVP = 75
245723f57f2SPedro Giffuni+IPPROTO_BRSATMON = 76
246723f57f2SPedro Giffuni+IPPROTO_ND = 77
247723f57f2SPedro Giffuni+IPPROTO_WBMON = 78
248723f57f2SPedro Giffuni+IPPROTO_WBEXPAK = 79
249723f57f2SPedro Giffuni+IPPROTO_EON = 80
250723f57f2SPedro Giffuni+IPPROTO_VMTP = 81
251723f57f2SPedro Giffuni+IPPROTO_SVMTP = 82
252723f57f2SPedro Giffuni+IPPROTO_VINES = 83
253723f57f2SPedro Giffuni+IPPROTO_TTP = 84
254723f57f2SPedro Giffuni+IPPROTO_IGP = 85
255723f57f2SPedro Giffuni+IPPROTO_DGP = 86
256723f57f2SPedro Giffuni+IPPROTO_TCF = 87
257723f57f2SPedro Giffuni+IPPROTO_IGRP = 88
258723f57f2SPedro Giffuni+IPPROTO_OSPFIGP = 89
259723f57f2SPedro Giffuni+IPPROTO_SRPC = 90
260723f57f2SPedro Giffuni+IPPROTO_LARP = 91
261723f57f2SPedro Giffuni+IPPROTO_MTP = 92
262723f57f2SPedro Giffuni+IPPROTO_AX25 = 93
263723f57f2SPedro Giffuni+IPPROTO_IPEIP = 94
264723f57f2SPedro Giffuni+IPPROTO_MICP = 95
265723f57f2SPedro Giffuni+IPPROTO_SCCSP = 96
266723f57f2SPedro Giffuni+IPPROTO_ETHERIP = 97
267723f57f2SPedro Giffuni+IPPROTO_ENCAP = 98
268723f57f2SPedro Giffuni+IPPROTO_APES = 99
269723f57f2SPedro Giffuni+IPPROTO_GMTP = 100
270723f57f2SPedro Giffuni+IPPROTO_IPCOMP = 108
271723f57f2SPedro Giffuni+IPPROTO_SCTP = 132
272723f57f2SPedro Giffuni+IPPROTO_MH = 135
273723f57f2SPedro Giffuni+IPPROTO_PIM = 103
274723f57f2SPedro Giffuni+IPPROTO_CARP = 112
275723f57f2SPedro Giffuni+IPPROTO_PGM = 113
276723f57f2SPedro Giffuni+IPPROTO_PFSYNC = 240
277723f57f2SPedro Giffuni+IPPROTO_OLD_DIVERT = 254
278723f57f2SPedro Giffuni+IPPROTO_MAX = 256
279723f57f2SPedro Giffuni+IPPROTO_DONE = 257
280723f57f2SPedro Giffuni+IPPROTO_DIVERT = 258
281723f57f2SPedro Giffuni+IPPROTO_SEND = 259
282723f57f2SPedro Giffuni+IPPROTO_SPACER = 32767
283723f57f2SPedro Giffuni+IPPORT_RESERVED = 1024
284723f57f2SPedro Giffuni+IPPORT_EPHEMERALFIRST = 10000
285723f57f2SPedro Giffuni+IPPORT_EPHEMERALLAST = 65535
286723f57f2SPedro Giffuni+IPPORT_HIFIRSTAUTO = 49152
287723f57f2SPedro Giffuni+IPPORT_HILASTAUTO = 65535
288723f57f2SPedro Giffuni+IPPORT_RESERVEDSTART = 600
289723f57f2SPedro Giffuni+IPPORT_MAX = 65535
290723f57f2SPedro Giffuni+def IN_CLASSA(i): return (((u_int32_t)(i) & 0x80000000) == 0)
291723f57f2SPedro Giffuni+
292723f57f2SPedro Giffuni+IN_CLASSA_NET = 0xff000000
293723f57f2SPedro Giffuni+IN_CLASSA_NSHIFT = 24
294723f57f2SPedro Giffuni+IN_CLASSA_HOST = 0x00ffffff
295723f57f2SPedro Giffuni+IN_CLASSA_MAX = 128
296723f57f2SPedro Giffuni+def IN_CLASSB(i): return (((u_int32_t)(i) & 0xc0000000) == 0x80000000)
297723f57f2SPedro Giffuni+
298723f57f2SPedro Giffuni+IN_CLASSB_NET = 0xffff0000
299723f57f2SPedro Giffuni+IN_CLASSB_NSHIFT = 16
300723f57f2SPedro Giffuni+IN_CLASSB_HOST = 0x0000ffff
301723f57f2SPedro Giffuni+IN_CLASSB_MAX = 65536
302723f57f2SPedro Giffuni+def IN_CLASSC(i): return (((u_int32_t)(i) & 0xe0000000) == 0xc0000000)
303723f57f2SPedro Giffuni+
304723f57f2SPedro Giffuni+IN_CLASSC_NET = 0xffffff00
305723f57f2SPedro Giffuni+IN_CLASSC_NSHIFT = 8
306723f57f2SPedro Giffuni+IN_CLASSC_HOST = 0x000000ff
307723f57f2SPedro Giffuni+def IN_CLASSD(i): return (((u_int32_t)(i) & 0xf0000000) == 0xe0000000)
308723f57f2SPedro Giffuni+
309723f57f2SPedro Giffuni+IN_CLASSD_NET = 0xf0000000
310723f57f2SPedro Giffuni+IN_CLASSD_NSHIFT = 28
311723f57f2SPedro Giffuni+IN_CLASSD_HOST = 0x0fffffff
312723f57f2SPedro Giffuni+def IN_MULTICAST(i): return IN_CLASSD(i)
313723f57f2SPedro Giffuni+
314723f57f2SPedro Giffuni+def IN_EXPERIMENTAL(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
315723f57f2SPedro Giffuni+
316723f57f2SPedro Giffuni+def IN_BADCLASS(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000)
317723f57f2SPedro Giffuni+
318723f57f2SPedro Giffuni+def IN_LINKLOCAL(i): return (((u_int32_t)(i) & 0xffff0000) == 0xa9fe0000)
319723f57f2SPedro Giffuni+
320723f57f2SPedro Giffuni+def IN_LOOPBACK(i): return (((u_int32_t)(i) & 0xff000000) == 0x7f000000)
321723f57f2SPedro Giffuni+
322723f57f2SPedro Giffuni+def IN_ZERONET(i): return (((u_int32_t)(i) & 0xff000000) == 0)
323723f57f2SPedro Giffuni+
324723f57f2SPedro Giffuni+def IN_LOCAL_GROUP(i): return (((u_int32_t)(i) & 0xffffff00) == 0xe0000000)
325723f57f2SPedro Giffuni+
326723f57f2SPedro Giffuni+INADDR_NONE = 0xffffffff
327723f57f2SPedro Giffuni+IN_LOOPBACKNET = 127
328723f57f2SPedro Giffuni+IP_OPTIONS = 1
329723f57f2SPedro Giffuni+IP_HDRINCL = 2
330723f57f2SPedro Giffuni+IP_TOS = 3
331723f57f2SPedro Giffuni+IP_TTL = 4
332723f57f2SPedro Giffuni+IP_RECVOPTS = 5
333723f57f2SPedro Giffuni+IP_RECVRETOPTS = 6
334723f57f2SPedro Giffuni+IP_RECVDSTADDR = 7
335723f57f2SPedro Giffuni+IP_SENDSRCADDR = IP_RECVDSTADDR
336723f57f2SPedro Giffuni+IP_RETOPTS = 8
337723f57f2SPedro Giffuni+IP_MULTICAST_IF = 9
338723f57f2SPedro Giffuni+IP_MULTICAST_TTL = 10
339723f57f2SPedro Giffuni+IP_MULTICAST_LOOP = 11
340723f57f2SPedro Giffuni+IP_ADD_MEMBERSHIP = 12
341723f57f2SPedro Giffuni+IP_DROP_MEMBERSHIP = 13
342723f57f2SPedro Giffuni+IP_MULTICAST_VIF = 14
343723f57f2SPedro Giffuni+IP_RSVP_ON = 15
344723f57f2SPedro Giffuni+IP_RSVP_OFF = 16
345723f57f2SPedro Giffuni+IP_RSVP_VIF_ON = 17
346723f57f2SPedro Giffuni+IP_RSVP_VIF_OFF = 18
347723f57f2SPedro Giffuni+IP_PORTRANGE = 19
348723f57f2SPedro Giffuni+IP_RECVIF = 20
349723f57f2SPedro Giffuni+IP_IPSEC_POLICY = 21
350723f57f2SPedro Giffuni+IP_FAITH = 22
351723f57f2SPedro Giffuni+IP_ONESBCAST = 23
352723f57f2SPedro Giffuni+IP_BINDANY = 24
353723f57f2SPedro Giffuni+IP_FW_TABLE_ADD = 40
354723f57f2SPedro Giffuni+IP_FW_TABLE_DEL = 41
355723f57f2SPedro Giffuni+IP_FW_TABLE_FLUSH = 42
356723f57f2SPedro Giffuni+IP_FW_TABLE_GETSIZE = 43
357723f57f2SPedro Giffuni+IP_FW_TABLE_LIST = 44
358723f57f2SPedro Giffuni+IP_FW3 = 48
359723f57f2SPedro Giffuni+IP_DUMMYNET3 = 49
360723f57f2SPedro Giffuni+IP_FW_ADD = 50
361723f57f2SPedro Giffuni+IP_FW_DEL = 51
362723f57f2SPedro Giffuni+IP_FW_FLUSH = 52
363723f57f2SPedro Giffuni+IP_FW_ZERO = 53
364723f57f2SPedro Giffuni+IP_FW_GET = 54
365723f57f2SPedro Giffuni+IP_FW_RESETLOG = 55
366723f57f2SPedro Giffuni+IP_FW_NAT_CFG = 56
367723f57f2SPedro Giffuni+IP_FW_NAT_DEL = 57
368723f57f2SPedro Giffuni+IP_FW_NAT_GET_CONFIG = 58
369723f57f2SPedro Giffuni+IP_FW_NAT_GET_LOG = 59
370723f57f2SPedro Giffuni+IP_DUMMYNET_CONFIGURE = 60
371723f57f2SPedro Giffuni+IP_DUMMYNET_DEL = 61
372723f57f2SPedro Giffuni+IP_DUMMYNET_FLUSH = 62
373723f57f2SPedro Giffuni+IP_DUMMYNET_GET = 64
374723f57f2SPedro Giffuni+IP_RECVTTL = 65
375723f57f2SPedro Giffuni+IP_MINTTL = 66
376723f57f2SPedro Giffuni+IP_DONTFRAG = 67
377723f57f2SPedro Giffuni+IP_ADD_SOURCE_MEMBERSHIP = 70
378723f57f2SPedro Giffuni+IP_DROP_SOURCE_MEMBERSHIP = 71
379723f57f2SPedro Giffuni+IP_BLOCK_SOURCE = 72
380723f57f2SPedro Giffuni+IP_UNBLOCK_SOURCE = 73
381723f57f2SPedro Giffuni+IP_MSFILTER = 74
382723f57f2SPedro Giffuni+MCAST_JOIN_GROUP = 80
383723f57f2SPedro Giffuni+MCAST_LEAVE_GROUP = 81
384723f57f2SPedro Giffuni+MCAST_JOIN_SOURCE_GROUP = 82
385723f57f2SPedro Giffuni+MCAST_LEAVE_SOURCE_GROUP = 83
386723f57f2SPedro Giffuni+MCAST_BLOCK_SOURCE = 84
387723f57f2SPedro Giffuni+MCAST_UNBLOCK_SOURCE = 85
388723f57f2SPedro Giffuni+IP_DEFAULT_MULTICAST_TTL = 1
389723f57f2SPedro Giffuni+IP_DEFAULT_MULTICAST_LOOP = 1
390723f57f2SPedro Giffuni+IP_MIN_MEMBERSHIPS = 31
391723f57f2SPedro Giffuni+IP_MAX_MEMBERSHIPS = 4095
392723f57f2SPedro Giffuni+IP_MAX_SOURCE_FILTER = 1024
393723f57f2SPedro Giffuni+IP_MAX_GROUP_SRC_FILTER = 512
394723f57f2SPedro Giffuni+IP_MAX_SOCK_SRC_FILTER = 128
395723f57f2SPedro Giffuni+IP_MAX_SOCK_MUTE_FILTER = 128
396723f57f2SPedro Giffuni+MCAST_UNDEFINED = 0
397723f57f2SPedro Giffuni+MCAST_INCLUDE = 1
398723f57f2SPedro Giffuni+MCAST_EXCLUDE = 2
399723f57f2SPedro Giffuni+IP_PORTRANGE_DEFAULT = 0
400723f57f2SPedro Giffuni+IP_PORTRANGE_HIGH = 1
401723f57f2SPedro Giffuni+IP_PORTRANGE_LOW = 2
402723f57f2SPedro Giffuni+IPPROTO_MAXID = (IPPROTO_AH + 1)
403723f57f2SPedro Giffuni+IPCTL_FORWARDING = 1
404723f57f2SPedro Giffuni+IPCTL_SENDREDIRECTS = 2
405723f57f2SPedro Giffuni+IPCTL_DEFTTL = 3
406723f57f2SPedro Giffuni+IPCTL_DEFMTU = 4
407723f57f2SPedro Giffuni+IPCTL_RTEXPIRE = 5
408723f57f2SPedro Giffuni+IPCTL_RTMINEXPIRE = 6
409723f57f2SPedro Giffuni+IPCTL_RTMAXCACHE = 7
410723f57f2SPedro Giffuni+IPCTL_SOURCEROUTE = 8
411723f57f2SPedro Giffuni+IPCTL_DIRECTEDBROADCAST = 9
412723f57f2SPedro Giffuni+IPCTL_INTRQMAXLEN = 10
413723f57f2SPedro Giffuni+IPCTL_INTRQDROPS = 11
414723f57f2SPedro Giffuni+IPCTL_STATS = 12
415723f57f2SPedro Giffuni+IPCTL_ACCEPTSOURCEROUTE = 13
416723f57f2SPedro Giffuni+IPCTL_FASTFORWARDING = 14
417723f57f2SPedro Giffuni+IPCTL_KEEPFAITH = 15
418723f57f2SPedro Giffuni+IPCTL_GIF_TTL = 16
419723f57f2SPedro Giffuni+IPCTL_MAXID = 17
420723f57f2SPedro Giffuni+def in_nullhost(x): return ((x).s_addr == INADDR_ANY)
421723f57f2SPedro Giffuni+
422723f57f2SPedro Giffuni+def in_allhosts(x): return ((x).s_addr == htonl(INADDR_ALLHOSTS_GROUP))
423723f57f2SPedro Giffuni+
424723f57f2SPedro Giffuni+
425723f57f2SPedro Giffuni+# Included from netinet6/in6.h
426723f57f2SPedro Giffuni+__KAME_VERSION = "FreeBSD"
427723f57f2SPedro Giffuni+IPV6PORT_RESERVED = 1024
428723f57f2SPedro Giffuni+IPV6PORT_ANONMIN = 49152
429723f57f2SPedro Giffuni+IPV6PORT_ANONMAX = 65535
430723f57f2SPedro Giffuni+IPV6PORT_RESERVEDMIN = 600
431723f57f2SPedro Giffuni+IPV6PORT_RESERVEDMAX = (IPV6PORT_RESERVED-1)
432723f57f2SPedro Giffuni+INET6_ADDRSTRLEN = 46
433723f57f2SPedro Giffuni+IPV6_ADDR_INT32_ONE = 1
434723f57f2SPedro Giffuni+IPV6_ADDR_INT32_TWO = 2
435723f57f2SPedro Giffuni+IPV6_ADDR_INT32_MNL = 0xff010000
436723f57f2SPedro Giffuni+IPV6_ADDR_INT32_MLL = 0xff020000
437723f57f2SPedro Giffuni+IPV6_ADDR_INT32_SMP = 0x0000ffff
438723f57f2SPedro Giffuni+IPV6_ADDR_INT16_ULL = 0xfe80
439723f57f2SPedro Giffuni+IPV6_ADDR_INT16_USL = 0xfec0
440723f57f2SPedro Giffuni+IPV6_ADDR_INT16_MLL = 0xff02
441723f57f2SPedro Giffuni+IPV6_ADDR_INT32_ONE = 0x01000000
442723f57f2SPedro Giffuni+IPV6_ADDR_INT32_TWO = 0x02000000
443723f57f2SPedro Giffuni+IPV6_ADDR_INT32_MNL = 0x000001ff
444723f57f2SPedro Giffuni+IPV6_ADDR_INT32_MLL = 0x000002ff
445723f57f2SPedro Giffuni+IPV6_ADDR_INT32_SMP = 0xffff0000
446723f57f2SPedro Giffuni+IPV6_ADDR_INT16_ULL = 0x80fe
447723f57f2SPedro Giffuni+IPV6_ADDR_INT16_USL = 0xc0fe
448723f57f2SPedro Giffuni+IPV6_ADDR_INT16_MLL = 0x02ff
449723f57f2SPedro Giffuni+def IN6_IS_ADDR_UNSPECIFIED(a): return \
450723f57f2SPedro Giffuni+
451723f57f2SPedro Giffuni+def IN6_IS_ADDR_LOOPBACK(a): return \
452723f57f2SPedro Giffuni+
453723f57f2SPedro Giffuni+def IN6_IS_ADDR_V4COMPAT(a): return \
454723f57f2SPedro Giffuni+
455723f57f2SPedro Giffuni+def IN6_IS_ADDR_V4MAPPED(a): return \
456723f57f2SPedro Giffuni+
457723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_NODELOCAL = 0x01
458723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01
459723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_LINKLOCAL = 0x02
460723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_SITELOCAL = 0x05
461723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_ORGLOCAL = 0x08
462723f57f2SPedro Giffuni+IPV6_ADDR_SCOPE_GLOBAL = 0x0e
463723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_NODELOCAL = 0x01
464723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01
465723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_LINKLOCAL = 0x02
466723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_SITELOCAL = 0x05
467723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_ORGLOCAL = 0x08
468723f57f2SPedro Giffuni+__IPV6_ADDR_SCOPE_GLOBAL = 0x0e
469723f57f2SPedro Giffuni+def IN6_IS_ADDR_LINKLOCAL(a): return \
470723f57f2SPedro Giffuni+
471723f57f2SPedro Giffuni+def IN6_IS_ADDR_SITELOCAL(a): return \
472723f57f2SPedro Giffuni+
473723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_NODELOCAL(a): return \
474723f57f2SPedro Giffuni+
475723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_INTFACELOCAL(a): return \
476723f57f2SPedro Giffuni+
477723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_LINKLOCAL(a): return \
478723f57f2SPedro Giffuni+
479723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_SITELOCAL(a): return \
480723f57f2SPedro Giffuni+
481723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_ORGLOCAL(a): return \
482723f57f2SPedro Giffuni+
483723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_GLOBAL(a): return \
484723f57f2SPedro Giffuni+
485723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_NODELOCAL(a): return \
486723f57f2SPedro Giffuni+
487723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_LINKLOCAL(a): return \
488723f57f2SPedro Giffuni+
489723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_SITELOCAL(a): return \
490723f57f2SPedro Giffuni+
491723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_ORGLOCAL(a): return \
492723f57f2SPedro Giffuni+
493723f57f2SPedro Giffuni+def IN6_IS_ADDR_MC_GLOBAL(a): return \
494723f57f2SPedro Giffuni+
495723f57f2SPedro Giffuni+def IN6_IS_SCOPE_LINKLOCAL(a): return \
496723f57f2SPedro Giffuni+
497723f57f2SPedro Giffuni+def IN6_IS_SCOPE_EMBED(a): return \
498723f57f2SPedro Giffuni+
499723f57f2SPedro Giffuni+def IFA6_IS_DEPRECATED(a): return \
500723f57f2SPedro Giffuni+
501723f57f2SPedro Giffuni+def IFA6_IS_INVALID(a): return \
502723f57f2SPedro Giffuni+
503723f57f2SPedro Giffuni+IPV6_OPTIONS = 1
504723f57f2SPedro Giffuni+IPV6_RECVOPTS = 5
505723f57f2SPedro Giffuni+IPV6_RECVRETOPTS = 6
506723f57f2SPedro Giffuni+IPV6_RECVDSTADDR = 7
507723f57f2SPedro Giffuni+IPV6_RETOPTS = 8
508723f57f2SPedro Giffuni+IPV6_SOCKOPT_RESERVED1 = 3
509723f57f2SPedro Giffuni+IPV6_UNICAST_HOPS = 4
510723f57f2SPedro Giffuni+IPV6_MULTICAST_IF = 9
511723f57f2SPedro Giffuni+IPV6_MULTICAST_HOPS = 10
512723f57f2SPedro Giffuni+IPV6_MULTICAST_LOOP = 11
513723f57f2SPedro Giffuni+IPV6_JOIN_GROUP = 12
514723f57f2SPedro Giffuni+IPV6_LEAVE_GROUP = 13
515723f57f2SPedro Giffuni+IPV6_PORTRANGE = 14
516723f57f2SPedro Giffuni+ICMP6_FILTER = 18
517723f57f2SPedro Giffuni+IPV6_2292PKTINFO = 19
518723f57f2SPedro Giffuni+IPV6_2292HOPLIMIT = 20
519723f57f2SPedro Giffuni+IPV6_2292NEXTHOP = 21
520723f57f2SPedro Giffuni+IPV6_2292HOPOPTS = 22
521723f57f2SPedro Giffuni+IPV6_2292DSTOPTS = 23
522723f57f2SPedro Giffuni+IPV6_2292RTHDR = 24
523723f57f2SPedro Giffuni+IPV6_2292PKTOPTIONS = 25
524723f57f2SPedro Giffuni+IPV6_CHECKSUM = 26
525723f57f2SPedro Giffuni+IPV6_V6ONLY = 27
526723f57f2SPedro Giffuni+IPV6_BINDV6ONLY = IPV6_V6ONLY
527723f57f2SPedro Giffuni+IPV6_IPSEC_POLICY = 28
528723f57f2SPedro Giffuni+IPV6_FAITH = 29
529723f57f2SPedro Giffuni+IPV6_FW_ADD = 30
530723f57f2SPedro Giffuni+IPV6_FW_DEL = 31
531723f57f2SPedro Giffuni+IPV6_FW_FLUSH = 32
532723f57f2SPedro Giffuni+IPV6_FW_ZERO = 33
533723f57f2SPedro Giffuni+IPV6_FW_GET = 34
534723f57f2SPedro Giffuni+IPV6_RTHDRDSTOPTS = 35
535723f57f2SPedro Giffuni+IPV6_RECVPKTINFO = 36
536723f57f2SPedro Giffuni+IPV6_RECVHOPLIMIT = 37
537723f57f2SPedro Giffuni+IPV6_RECVRTHDR = 38
538723f57f2SPedro Giffuni+IPV6_RECVHOPOPTS = 39
539723f57f2SPedro Giffuni+IPV6_RECVDSTOPTS = 40
540723f57f2SPedro Giffuni+IPV6_RECVRTHDRDSTOPTS = 41
541723f57f2SPedro Giffuni+IPV6_USE_MIN_MTU = 42
542723f57f2SPedro Giffuni+IPV6_RECVPATHMTU = 43
543723f57f2SPedro Giffuni+IPV6_PATHMTU = 44
544723f57f2SPedro Giffuni+IPV6_REACHCONF = 45
545723f57f2SPedro Giffuni+IPV6_PKTINFO = 46
546723f57f2SPedro Giffuni+IPV6_HOPLIMIT = 47
547723f57f2SPedro Giffuni+IPV6_NEXTHOP = 48
548723f57f2SPedro Giffuni+IPV6_HOPOPTS = 49
549723f57f2SPedro Giffuni+IPV6_DSTOPTS = 50
550723f57f2SPedro Giffuni+IPV6_RTHDR = 51
551723f57f2SPedro Giffuni+IPV6_PKTOPTIONS = 52
552723f57f2SPedro Giffuni+IPV6_RECVTCLASS = 57
553723f57f2SPedro Giffuni+IPV6_AUTOFLOWLABEL = 59
554723f57f2SPedro Giffuni+IPV6_TCLASS = 61
555723f57f2SPedro Giffuni+IPV6_DONTFRAG = 62
556723f57f2SPedro Giffuni+IPV6_PREFER_TEMPADDR = 63
557723f57f2SPedro Giffuni+IPV6_BINDANY = 64
558723f57f2SPedro Giffuni+IPV6_MSFILTER = 74
559723f57f2SPedro Giffuni+IPV6_RTHDR_LOOSE = 0
560723f57f2SPedro Giffuni+IPV6_RTHDR_STRICT = 1
561723f57f2SPedro Giffuni+IPV6_RTHDR_TYPE_0 = 0
562723f57f2SPedro Giffuni+IPV6_DEFAULT_MULTICAST_HOPS = 1
563723f57f2SPedro Giffuni+IPV6_DEFAULT_MULTICAST_LOOP = 1
564723f57f2SPedro Giffuni+IPV6_MIN_MEMBERSHIPS = 31
565723f57f2SPedro Giffuni+IPV6_MAX_MEMBERSHIPS = 4095
566723f57f2SPedro Giffuni+IPV6_MAX_GROUP_SRC_FILTER = 512
567723f57f2SPedro Giffuni+IPV6_MAX_SOCK_SRC_FILTER = 128
568723f57f2SPedro Giffuni+IPV6_PORTRANGE_DEFAULT = 0
569723f57f2SPedro Giffuni+IPV6_PORTRANGE_HIGH = 1
570723f57f2SPedro Giffuni+IPV6_PORTRANGE_LOW = 2
571723f57f2SPedro Giffuni+IPV6PROTO_MAXID = (IPPROTO_PIM + 1)
572723f57f2SPedro Giffuni+IPV6CTL_FORWARDING = 1
573723f57f2SPedro Giffuni+IPV6CTL_SENDREDIRECTS = 2
574723f57f2SPedro Giffuni+IPV6CTL_DEFHLIM = 3
575723f57f2SPedro Giffuni+IPV6CTL_DEFMTU = 4
576723f57f2SPedro Giffuni+IPV6CTL_FORWSRCRT = 5
577723f57f2SPedro Giffuni+IPV6CTL_STATS = 6
578723f57f2SPedro Giffuni+IPV6CTL_MRTSTATS = 7
579723f57f2SPedro Giffuni+IPV6CTL_MRTPROTO = 8
580723f57f2SPedro Giffuni+IPV6CTL_MAXFRAGPACKETS = 9
581723f57f2SPedro Giffuni+IPV6CTL_SOURCECHECK = 10
582723f57f2SPedro Giffuni+IPV6CTL_SOURCECHECK_LOGINT = 11
583723f57f2SPedro Giffuni+IPV6CTL_ACCEPT_RTADV = 12
584723f57f2SPedro Giffuni+IPV6CTL_KEEPFAITH = 13
585723f57f2SPedro Giffuni+IPV6CTL_LOG_INTERVAL = 14
586723f57f2SPedro Giffuni+IPV6CTL_HDRNESTLIMIT = 15
587723f57f2SPedro Giffuni+IPV6CTL_DAD_COUNT = 16
588723f57f2SPedro Giffuni+IPV6CTL_AUTO_FLOWLABEL = 17
589723f57f2SPedro Giffuni+IPV6CTL_DEFMCASTHLIM = 18
590723f57f2SPedro Giffuni+IPV6CTL_GIF_HLIM = 19
591723f57f2SPedro Giffuni+IPV6CTL_KAME_VERSION = 20
592723f57f2SPedro Giffuni+IPV6CTL_USE_DEPRECATED = 21
593723f57f2SPedro Giffuni+IPV6CTL_RR_PRUNE = 22
594723f57f2SPedro Giffuni+IPV6CTL_MAPPED_ADDR = 23
595723f57f2SPedro Giffuni+IPV6CTL_V6ONLY = 24
596723f57f2SPedro Giffuni+IPV6CTL_RTEXPIRE = 25
597723f57f2SPedro Giffuni+IPV6CTL_RTMINEXPIRE = 26
598723f57f2SPedro Giffuni+IPV6CTL_RTMAXCACHE = 27
599723f57f2SPedro Giffuni+IPV6CTL_USETEMPADDR = 32
600723f57f2SPedro Giffuni+IPV6CTL_TEMPPLTIME = 33
601723f57f2SPedro Giffuni+IPV6CTL_TEMPVLTIME = 34
602723f57f2SPedro Giffuni+IPV6CTL_AUTO_LINKLOCAL = 35
603723f57f2SPedro Giffuni+IPV6CTL_RIP6STATS = 36
604723f57f2SPedro Giffuni+IPV6CTL_PREFER_TEMPADDR = 37
605723f57f2SPedro Giffuni+IPV6CTL_ADDRCTLPOLICY = 38
606723f57f2SPedro Giffuni+IPV6CTL_USE_DEFAULTZONE = 39
607723f57f2SPedro Giffuni+IPV6CTL_MAXFRAGS = 41
608723f57f2SPedro Giffuni+IPV6CTL_IFQ = 42
609723f57f2SPedro Giffuni+IPV6CTL_ISATAPRTR = 43
610723f57f2SPedro Giffuni+IPV6CTL_MCAST_PMTU = 44
611723f57f2SPedro Giffuni+IPV6CTL_STEALTH = 45
612723f57f2SPedro Giffuni+ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47
613723f57f2SPedro Giffuni+IPV6CTL_NO_RADR = 48
614723f57f2SPedro Giffuni+IPV6CTL_NORBIT_RAIF = 49
615723f57f2SPedro Giffuni+IPV6CTL_RFC6204W3 = 50
616723f57f2SPedro Giffuni+IPV6CTL_MAXID = 51
617*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Lib/plat-freebsd9/regen misc/build/Python-2.7.8/Lib/plat-freebsd9/regen
618*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Lib/plat-freebsd9/regen	1969-12-31 19:00:00.000000000 -0500
619*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Lib/plat-freebsd9/regen	2016-01-01 17:38:35.922764464 -0500
620723f57f2SPedro Giffuni@@ -0,0 +1,3 @@
621723f57f2SPedro Giffuni+#! /bin/sh
622723f57f2SPedro Giffuni+set -v
623723f57f2SPedro Giffuni+python ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
624*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Lib/test/test_threading.py misc/build/Python-2.7.8/Lib/test/test_threading.py
625*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Lib/test/test_threading.py	2014-06-29 21:05:37.000000000 -0500
626*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Lib/test/test_threading.py	2016-01-01 17:38:35.923764731 -0500
627*6ee2a585SPedro Giffuni@@ -486,7 +486,7 @@
6280a45483eSPedro Giffuni     # #12316 and #11870), and fork() from a worker thread is known to trigger
6290a45483eSPedro Giffuni     # problems with some operating systems (issue #3863): skip problematic tests
6300a45483eSPedro Giffuni     # on platforms known to behave badly.
6310a45483eSPedro Giffuni-    platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
6320a45483eSPedro Giffuni+    platforms_to_skip = ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9', 'netbsd5',
6330a45483eSPedro Giffuni                          'os2emx')
6340a45483eSPedro Giffuni
6350a45483eSPedro Giffuni     def _run_and_join(self, script):
636*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Modules/_ctypes/libffi/configure misc/build/Python-2.7.8/Modules/_ctypes/libffi/configure
637*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Modules/_ctypes/libffi/configure	2014-06-29 21:05:40.000000000 -0500
638*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Modules/_ctypes/libffi/configure	2016-01-01 17:38:35.931765818 -0500
639*6ee2a585SPedro Giffuni@@ -6889,7 +6889,7 @@
6400a45483eSPedro Giffuni   rm -rf conftest*
6410a45483eSPedro Giffuni   ;;
6420a45483eSPedro Giffuni
6430a45483eSPedro Giffuni-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6440a45483eSPedro Giffuni+amd64-*-freebsd*|x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6450a45483eSPedro Giffuni s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6460a45483eSPedro Giffuni   # Find out which ABI we are using.
6470a45483eSPedro Giffuni   echo 'int i;' > conftest.$ac_ext
648*6ee2a585SPedro Giffuni@@ -13459,6 +13459,9 @@
649*6ee2a585SPedro Giffuni   powerpc64-*-freebsd*)
650*6ee2a585SPedro Giffuni 	TARGET=POWERPC; TARGETDIR=powerpc
651723f57f2SPedro Giffuni 	;;
652723f57f2SPedro Giffuni+  powerpc64-*-freebsd*)
653723f57f2SPedro Giffuni+	TARGET=POWERPC; TARGETDIR=powerpc
654723f57f2SPedro Giffuni+	;;
655723f57f2SPedro Giffuni   powerpc*-*-rtems*)
656723f57f2SPedro Giffuni 	TARGET=POWERPC; TARGETDIR=powerpc
657723f57f2SPedro Giffuni 	;;
658*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Modules/fcntlmodule.c misc/build/Python-2.7.8/Modules/fcntlmodule.c
659*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Modules/fcntlmodule.c	2014-06-29 21:05:43.000000000 -0500
660*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Modules/fcntlmodule.c	2016-01-01 17:42:35.865747022 -0500
661*6ee2a585SPedro Giffuni@@ -98,20 +98,15 @@
662723f57f2SPedro Giffuni {
663723f57f2SPedro Giffuni #define IOCTL_BUFSZ 1024
664723f57f2SPedro Giffuni     int fd;
665723f57f2SPedro Giffuni-    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
666723f57f2SPedro Giffuni+    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
667723f57f2SPedro Giffuni        format for the 'code' parameter because Python turns 0x8000000
668723f57f2SPedro Giffuni        into either a large positive number (PyLong or PyInt on 64-bit
669723f57f2SPedro Giffuni        platforms) or a negative number on others (32-bit PyInt)
670723f57f2SPedro Giffuni        whereas the system expects it to be a 32bit bit field value
671723f57f2SPedro Giffuni        regardless of it being passed as an int or unsigned long on
672723f57f2SPedro Giffuni-       various platforms.  See the termios.TIOCSWINSZ constant across
673*6ee2a585SPedro Giffuni-       platforms for an example of this.
674723f57f2SPedro Giffuni-
675723f57f2SPedro Giffuni-       If any of the 64bit platforms ever decide to use more than 32bits
676723f57f2SPedro Giffuni-       in their unsigned long ioctl codes this will break and need
677723f57f2SPedro Giffuni-       special casing based on the platform being built on.
678723f57f2SPedro Giffuni+       various platforms.
679723f57f2SPedro Giffuni      */
680723f57f2SPedro Giffuni-    unsigned int code;
681723f57f2SPedro Giffuni+    unsigned long code;
682723f57f2SPedro Giffuni     int arg;
683723f57f2SPedro Giffuni     int ret;
684723f57f2SPedro Giffuni     char *str;
685*6ee2a585SPedro Giffuni@@ -119,7 +114,7 @@
686723f57f2SPedro Giffuni     int mutate_arg = 1;
687723f57f2SPedro Giffuni     char buf[IOCTL_BUFSZ+1];  /* argument plus NUL byte */
688723f57f2SPedro Giffuni
689723f57f2SPedro Giffuni-    if (PyArg_ParseTuple(args, "O&Iw#|i:ioctl",
690723f57f2SPedro Giffuni+    if (PyArg_ParseTuple(args, "O&kw#|i:ioctl",
691723f57f2SPedro Giffuni                          conv_descriptor, &fd, &code,
692723f57f2SPedro Giffuni                          &str, &len, &mutate_arg)) {
693723f57f2SPedro Giffuni         char *arg;
694*6ee2a585SPedro Giffuni@@ -170,7 +165,7 @@
695723f57f2SPedro Giffuni     }
696723f57f2SPedro Giffuni
697723f57f2SPedro Giffuni     PyErr_Clear();
698723f57f2SPedro Giffuni-    if (PyArg_ParseTuple(args, "O&Is#:ioctl",
699723f57f2SPedro Giffuni+    if (PyArg_ParseTuple(args, "O&ks#:ioctl",
700723f57f2SPedro Giffuni                          conv_descriptor, &fd, &code, &str, &len)) {
701723f57f2SPedro Giffuni         if (len > IOCTL_BUFSZ) {
702723f57f2SPedro Giffuni             PyErr_SetString(PyExc_ValueError,
703*6ee2a585SPedro Giffuni@@ -192,7 +187,7 @@
704723f57f2SPedro Giffuni     PyErr_Clear();
705723f57f2SPedro Giffuni     arg = 0;
706723f57f2SPedro Giffuni     if (!PyArg_ParseTuple(args,
707723f57f2SPedro Giffuni-         "O&I|i;ioctl requires a file or file descriptor,"
708723f57f2SPedro Giffuni+         "O&k|i;ioctl requires a file or file descriptor,"
709723f57f2SPedro Giffuni          " an integer and optionally an integer or buffer argument",
710723f57f2SPedro Giffuni                           conv_descriptor, &fd, &code, &arg)) {
711723f57f2SPedro Giffuni       return NULL;
712*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Modules/fcntlmodule.c.rej misc/build/Python-2.7.8/Modules/fcntlmodule.c.rej
713*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Modules/fcntlmodule.c.rej	1969-12-31 19:00:00.000000000 -0500
714*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Modules/fcntlmodule.c.rej	2016-01-01 17:38:35.933764047 -0500
715*6ee2a585SPedro Giffuni@@ -0,0 +1,24 @@
716*6ee2a585SPedro Giffuni+@@ -97,20 +97,15 @@
717*6ee2a585SPedro Giffuni+ {
718*6ee2a585SPedro Giffuni+ #define IOCTL_BUFSZ 1024
719*6ee2a585SPedro Giffuni+     int fd;
720*6ee2a585SPedro Giffuni+-    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'I'
721*6ee2a585SPedro Giffuni++    /* In PyArg_ParseTuple below, we use the unsigned non-checked 'k'
722*6ee2a585SPedro Giffuni+        format for the 'code' parameter because Python turns 0x8000000
723*6ee2a585SPedro Giffuni+        into either a large positive number (PyLong or PyInt on 64-bit
724*6ee2a585SPedro Giffuni+        platforms) or a negative number on others (32-bit PyInt)
725*6ee2a585SPedro Giffuni+        whereas the system expects it to be a 32bit bit field value
726*6ee2a585SPedro Giffuni+        regardless of it being passed as an int or unsigned long on
727*6ee2a585SPedro Giffuni+-       various platforms.  See the termios.TIOCSWINSZ constant across
728*6ee2a585SPedro Giffuni+-       platforms for an example of thise.
729*6ee2a585SPedro Giffuni+-
730*6ee2a585SPedro Giffuni+-       If any of the 64bit platforms ever decide to use more than 32bits
731*6ee2a585SPedro Giffuni+-       in their unsigned long ioctl codes this will break and need
732*6ee2a585SPedro Giffuni+-       special casing based on the platform being built on.
733*6ee2a585SPedro Giffuni++       various platforms.
734*6ee2a585SPedro Giffuni+      */
735*6ee2a585SPedro Giffuni+-    unsigned int code;
736*6ee2a585SPedro Giffuni++    unsigned long code;
737*6ee2a585SPedro Giffuni+     int arg;
738*6ee2a585SPedro Giffuni+     int ret;
739*6ee2a585SPedro Giffuni+     char *str;
740*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/Python/thread_pthread.h misc/build/Python-2.7.8/Python/thread_pthread.h
741*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/Python/thread_pthread.h	2014-06-29 21:05:47.000000000 -0500
742*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/Python/thread_pthread.h	2016-01-01 17:38:35.933764047 -0500
743723f57f2SPedro Giffuni@@ -38,13 +38,18 @@
744723f57f2SPedro Giffuni #endif
745723f57f2SPedro Giffuni #endif
746723f57f2SPedro Giffuni
747723f57f2SPedro Giffuni+#ifdef __FreeBSD__
748723f57f2SPedro Giffuni+#include <osreldate.h>
749723f57f2SPedro Giffuni+#endif
750723f57f2SPedro Giffuni+
751723f57f2SPedro Giffuni /* The POSIX spec says that implementations supporting the sem_*
752723f57f2SPedro Giffuni    family of functions must indicate this by defining
753723f57f2SPedro Giffuni    _POSIX_SEMAPHORES. */
754723f57f2SPedro Giffuni #ifdef _POSIX_SEMAPHORES
755723f57f2SPedro Giffuni /* On FreeBSD 4.x, _POSIX_SEMAPHORES is defined empty, so
756723f57f2SPedro Giffuni    we need to add 0 to make it work there as well. */
757723f57f2SPedro Giffuni-#if (_POSIX_SEMAPHORES+0) == -1
758723f57f2SPedro Giffuni+#if defined(__FreeBSD__) && __FreeBSD_version < 701104 && \
759723f57f2SPedro Giffuni+    (_POSIX_SEMAPHORES+0) == -1
760723f57f2SPedro Giffuni #define HAVE_BROKEN_POSIX_SEMAPHORES
761723f57f2SPedro Giffuni #else
762723f57f2SPedro Giffuni #include <semaphore.h>
763723f57f2SPedro Giffuni@@ -56,7 +61,6 @@
7640a45483eSPedro Giffuni    in default setting.  So the process scope is preferred to get
7650a45483eSPedro Giffuni    enough number of threads to work. */
7660a45483eSPedro Giffuni #ifdef __FreeBSD__
7670a45483eSPedro Giffuni-#include <osreldate.h>
7680a45483eSPedro Giffuni #if __FreeBSD_version >= 500000 && __FreeBSD_version < 504101
7690a45483eSPedro Giffuni #undef PTHREAD_SYSTEM_SCHED_SUPPORTED
7700a45483eSPedro Giffuni #endif
771*6ee2a585SPedro Giffuni@@ -162,6 +166,7 @@
7720a45483eSPedro Giffuni {
7730a45483eSPedro Giffuni     pthread_t th;
7740a45483eSPedro Giffuni     int status;
7750a45483eSPedro Giffuni+    sigset_t set, oset;
7760a45483eSPedro Giffuni #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
7770a45483eSPedro Giffuni     pthread_attr_t attrs;
7780a45483eSPedro Giffuni #endif
779*6ee2a585SPedro Giffuni@@ -190,6 +195,8 @@
7800a45483eSPedro Giffuni #if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
7810a45483eSPedro Giffuni     pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
7820a45483eSPedro Giffuni #endif
7830a45483eSPedro Giffuni+    sigfillset(&set);
7840a45483eSPedro Giffuni+    SET_THREAD_SIGMASK(SIG_BLOCK, &set, &oset);
785723f57f2SPedro Giffuni
7860a45483eSPedro Giffuni     status = pthread_create(&th,
7870a45483eSPedro Giffuni #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
788*6ee2a585SPedro Giffuni@@ -201,6 +208,7 @@
7890a45483eSPedro Giffuni                              (void *)arg
7900a45483eSPedro Giffuni                              );
7910a45483eSPedro Giffuni
7920a45483eSPedro Giffuni+    SET_THREAD_SIGMASK(SIG_SETMASK, &oset, NULL);
7930a45483eSPedro Giffuni #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
7940a45483eSPedro Giffuni     pthread_attr_destroy(&attrs);
7950a45483eSPedro Giffuni #endif
796*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/configure misc/build/Python-2.7.8/configure
797*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/configure	2014-06-29 21:05:48.000000000 -0500
798*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/configure	2016-01-01 17:41:32.541753889 -0500
799*6ee2a585SPedro Giffuni@@ -5347,7 +5347,7 @@
8000a45483eSPedro Giffuni           ;;
8010a45483eSPedro Giffuni     SunOS*)
8020a45483eSPedro Giffuni 	  LDLIBRARY='libpython$(VERSION).so'
8030a45483eSPedro Giffuni-	  BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
8040a45483eSPedro Giffuni+	  BLDLIBRARY=-R\'\$\$ORIGIN\'' -L. -lpython$(VERSION)'
805*6ee2a585SPedro Giffuni 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
8060a45483eSPedro Giffuni 	  INSTSONAME="$LDLIBRARY".$SOVERSION
8070a45483eSPedro Giffuni           ;;
808*6ee2a585SPedro Giffuni@@ -5355,11 +5355,6 @@
8090a45483eSPedro Giffuni 	  LDLIBRARY='libpython$(VERSION).so'
8100a45483eSPedro Giffuni 	  BLDLIBRARY='-L. -lpython$(VERSION)'
811*6ee2a585SPedro Giffuni 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
8120a45483eSPedro Giffuni-	  case $ac_sys_system in
8130a45483eSPedro Giffuni-	      FreeBSD*)
8140a45483eSPedro Giffuni-		SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
8150a45483eSPedro Giffuni-		;;
8160a45483eSPedro Giffuni-	  esac
8170a45483eSPedro Giffuni 	  INSTSONAME="$LDLIBRARY".$SOVERSION
8180a45483eSPedro Giffuni 	  ;;
8190a45483eSPedro Giffuni     hp*|HP*)
820*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/configure.rej misc/build/Python-2.7.8/configure.rej
821*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/configure.rej	1969-12-31 19:00:00.000000000 -0500
822*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/configure.rej	2016-01-01 17:38:35.943764550 -0500
823*6ee2a585SPedro Giffuni@@ -0,0 +1,21 @@
824*6ee2a585SPedro Giffuni+@@ -4916,7 +4916,7 @@
825*6ee2a585SPedro Giffuni+           ;;
826*6ee2a585SPedro Giffuni+     SunOS*)
827*6ee2a585SPedro Giffuni+ 	  LDLIBRARY='libpython$(VERSION).so'
828*6ee2a585SPedro Giffuni+-	  BLDLIBRARY='-Wl,-R,$(LIBDIR) -L. -lpython$(VERSION)'
829*6ee2a585SPedro Giffuni++	  BLDLIBRARY=-R\'\$\$ORIGIN\'' -L. -lpython$(VERSION)'
830*6ee2a585SPedro Giffuni+ 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
831*6ee2a585SPedro Giffuni+ 	  INSTSONAME="$LDLIBRARY".$SOVERSION
832*6ee2a585SPedro Giffuni+           ;;
833*6ee2a585SPedro Giffuni+@@ -4924,11 +4924,6 @@
834*6ee2a585SPedro Giffuni+ 	  LDLIBRARY='libpython$(VERSION).so'
835*6ee2a585SPedro Giffuni+ 	  BLDLIBRARY='-L. -lpython$(VERSION)'
836*6ee2a585SPedro Giffuni+ 	  RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
837*6ee2a585SPedro Giffuni+-	  case $ac_sys_system in
838*6ee2a585SPedro Giffuni+-	      FreeBSD*)
839*6ee2a585SPedro Giffuni+-		SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
840*6ee2a585SPedro Giffuni+-		;;
841*6ee2a585SPedro Giffuni+-	  esac
842*6ee2a585SPedro Giffuni+ 	  INSTSONAME="$LDLIBRARY".$SOVERSION
843*6ee2a585SPedro Giffuni+ 	  ;;
844*6ee2a585SPedro Giffuni+     hp*|HP*)
845*6ee2a585SPedro Giffunidiff -ruN misc/Python-2.7.8/setup.py misc/build/Python-2.7.8/setup.py
846*6ee2a585SPedro Giffuni--- misc/Python-2.7.8/setup.py	2014-06-29 21:05:48.000000000 -0500
847*6ee2a585SPedro Giffuni+++ misc/build/Python-2.7.8/setup.py	2016-01-01 17:38:35.945765223 -0500
848*6ee2a585SPedro Giffuni@@ -1551,7 +1551,7 @@
8490a45483eSPedro Giffuni             macros = dict()
8500a45483eSPedro Giffuni             libraries = []
8510a45483eSPedro Giffuni
85267da92c9SJürgen Schmidt-        elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
85367da92c9SJürgen Schmidt+        elif host_platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8', 'freebsd9'):
8540a45483eSPedro Giffuni             # FreeBSD's P1003.1b semaphore support is very experimental
8550a45483eSPedro Giffuni             # and has many known problems. (as of June 2008)
8560a45483eSPedro Giffuni             macros = dict()
857*6ee2a585SPedro Giffuni@@ -1603,7 +1603,7 @@
8580a45483eSPedro Giffuni             missing.append('linuxaudiodev')
8590a45483eSPedro Giffuni
86067da92c9SJürgen Schmidt         if (host_platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
8610a45483eSPedro Giffuni-                        'freebsd7', 'freebsd8')
8620a45483eSPedro Giffuni+                        'freebsd7', 'freebsd8', 'freebsd9')
86367da92c9SJürgen Schmidt             or host_platform.startswith("gnukfreebsd")):
8640a45483eSPedro Giffuni             exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
8650a45483eSPedro Giffuni         else:
866