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