1
# Generated by h2py from /usr/include/netinet/in.h
2
from warnings import warnpy3k
3
warnpy3k("the IN module has been removed in Python 3.0", stacklevel=2)
6
# Included from standards.h
8
# Included from sgidefs.h
17
# Included from sys/bsd_types.h
19
# Included from sys/mkdev.h
31
def IS_STRING_SPEC_DEV(x): return ((dev_t)(x)==__makedev(MKDEV_VER, 0, 0))
33
def major(dev): return __major(MKDEV_VER, dev)
35
def minor(dev): return __minor(MKDEV_VER, dev)
38
# Included from sys/select.h
42
# Included from string.h
46
# Included from sys/endian.h
53
_BYTE_ORDER = _BIG_ENDIAN
54
_BYTE_ORDER = _LITTLE_ENDIAN
55
def ntohl(x): return (x)
57
def ntohs(x): return (x)
59
def htonl(x): return (x)
61
def htons(x): return (x)
63
def htonl(x): return ntohl(x)
65
def htons(x): return ntohs(x)
68
# Included from sys/types.h
70
# Included from sys/pthread.h
74
# Included from sys/cpumask.h
76
def CPUMASK_INDEX(bit): return ((bit) >> 6)
78
def CPUMASK_SHFT(bit): return ((bit) & 0x3f)
80
def CPUMASK_IS_ZERO(p): return ((p) == 0)
82
def CPUMASK_IS_NONZERO(p): return ((p) != 0)
85
# Included from sys/nodemask.h
86
def CNODEMASK_IS_ZERO(p): return ((p) == 0)
88
def CNODEMASK_IS_NONZERO(p): return ((p) != 0)
96
IPPROTO_ENCAP = IPPROTO_IPIP
102
IPPROTO_BBN_RCC_MON = 10
111
IPPROTO_DCN_MEAS = 19
124
IPPROTO_MERIT_INP = 32
130
IPPROTO_IDPR_CMTP = 38
135
IPPROTO_FRAGMENT = 44
144
IPPROTO_SAT_EXPAK = 64
145
IPPROTO_KRYPTOLAN = 65
155
IPPROTO_BR_SAT_MON = 76
158
IPPROTO_WB_EXPAK = 79
161
IPPROTO_SECURE_VMTP = 82
164
IPPROTO_NSFNET_IGP = 85
169
IPPROTO_SPRITE_RPC = 90
175
IPPROTO_AES_SP3_D = 96
177
IPPROTO_ENCAPHDR = 98
181
IPPORT_RESERVED = 1024
182
IPPORT_MAXPORT = 65535
184
INET6_ADDRSTRLEN = 46
185
def IN_CLASSA(i): return (((__int32_t)(i) & 0x80000000) == 0)
187
IN_CLASSA_NET = 0xff000000
188
IN_CLASSA_NSHIFT = 24
189
IN_CLASSA_HOST = 0x00ffffff
191
def IN_CLASSB(i): return (((__int32_t)(i) & 0xc0000000) == 0x80000000)
193
IN_CLASSB_NET = 0xffff0000
194
IN_CLASSB_NSHIFT = 16
195
IN_CLASSB_HOST = 0x0000ffff
196
IN_CLASSB_MAX = 65536
197
def IN_CLASSC(i): return (((__int32_t)(i) & 0xe0000000) == 0xc0000000)
199
IN_CLASSC_NET = 0xffffff00
201
IN_CLASSC_HOST = 0x000000ff
202
def IN_CLASSD(i): return (((__int32_t)(i) & 0xf0000000) == 0xe0000000)
204
IN_CLASSD_NET = 0xf0000000
205
IN_CLASSD_NSHIFT = 28
206
IN_CLASSD_HOST = 0x0fffffff
207
def IN_MULTICAST(i): return IN_CLASSD(i)
209
def IN_EXPERIMENTAL(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
211
def IN_BADCLASS(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
213
INADDR_NONE = 0xffffffff
216
IPV6_FLOWINFO_FLOWLABEL = 0x00ffffff
217
IPV6_FLOWINFO_PRIORITY = 0x0f000000
218
IPV6_FLOWINFO_PRIFLOW = 0x0fffffff
219
IPV6_FLOWINFO_SRFLAG = 0x10000000
220
IPV6_FLOWINFO_VERSION = 0xf0000000
221
IPV6_PRIORITY_UNCHARACTERIZED = 0x00000000
222
IPV6_PRIORITY_FILLER = 0x01000000
223
IPV6_PRIORITY_UNATTENDED = 0x02000000
224
IPV6_PRIORITY_RESERVED1 = 0x03000000
225
IPV6_PRIORITY_BULK = 0x04000000
226
IPV6_PRIORITY_RESERVED2 = 0x05000000
227
IPV6_PRIORITY_INTERACTIVE = 0x06000000
228
IPV6_PRIORITY_CONTROL = 0x07000000
229
IPV6_PRIORITY_8 = 0x08000000
230
IPV6_PRIORITY_9 = 0x09000000
231
IPV6_PRIORITY_10 = 0x0a000000
232
IPV6_PRIORITY_11 = 0x0b000000
233
IPV6_PRIORITY_12 = 0x0c000000
234
IPV6_PRIORITY_13 = 0x0d000000
235
IPV6_PRIORITY_14 = 0x0e000000
236
IPV6_PRIORITY_15 = 0x0f000000
237
IPV6_SRFLAG_STRICT = 0x10000000
238
IPV6_SRFLAG_LOOSE = 0x00000000
239
IPV6_VERSION = 0x60000000
240
IPV6_FLOWINFO_FLOWLABEL = 0xffffff00
241
IPV6_FLOWINFO_PRIORITY = 0x0000000f
242
IPV6_FLOWINFO_PRIFLOW = 0xffffff0f
243
IPV6_FLOWINFO_SRFLAG = 0x00000010
244
IPV6_FLOWINFO_VERSION = 0x000000f0
245
IPV6_PRIORITY_UNCHARACTERIZED = 0x00000000
246
IPV6_PRIORITY_FILLER = 0x00000001
247
IPV6_PRIORITY_UNATTENDED = 0x00000002
248
IPV6_PRIORITY_RESERVED1 = 0x00000003
249
IPV6_PRIORITY_BULK = 0x00000004
250
IPV6_PRIORITY_RESERVED2 = 0x00000005
251
IPV6_PRIORITY_INTERACTIVE = 0x00000006
252
IPV6_PRIORITY_CONTROL = 0x00000007
253
IPV6_PRIORITY_8 = 0x00000008
254
IPV6_PRIORITY_9 = 0x00000009
255
IPV6_PRIORITY_10 = 0x0000000a
256
IPV6_PRIORITY_11 = 0x0000000b
257
IPV6_PRIORITY_12 = 0x0000000c
258
IPV6_PRIORITY_13 = 0x0000000d
259
IPV6_PRIORITY_14 = 0x0000000e
260
IPV6_PRIORITY_15 = 0x0000000f
261
IPV6_SRFLAG_STRICT = 0x00000010
262
IPV6_SRFLAG_LOOSE = 0x00000000
263
IPV6_VERSION = 0x00000060
264
def IPV6_GET_FLOWLABEL(x): return (ntohl(x) & 0x00ffffff)
266
def IPV6_GET_PRIORITY(x): return ((ntohl(x) >> 24) & 0xf)
268
def IPV6_GET_VERSION(x): return ((ntohl(x) >> 28) & 0xf)
270
def IPV6_SET_FLOWLABEL(x): return (htonl(x) & IPV6_FLOWINFO_FLOWLABEL)
272
def IPV6_SET_PRIORITY(x): return (htonl((x & 0xf) << 24))
274
def CLR_ADDR6(a): return \
276
def IS_ANYSOCKADDR(a): return \
278
def IS_ANYADDR6(a): return \
280
def IS_COMPATSOCKADDR(a): return \
282
def IS_COMPATADDR6(a): return \
284
def IS_LOOPSOCKADDR(a): return \
286
def IS_LOOPADDR6(a): return \
288
def IS_IPV4SOCKADDR(a): return \
290
def IS_IPV4ADDR6(a): return \
292
def IS_LOOPSOCKADDR(a): return \
294
def IS_LOOPADDR6(a): return \
296
def IS_IPV4SOCKADDR(a): return \
298
def IS_IPV4ADDR6(a): return \
300
def IS_LOCALADDR6(a): return ((a).s6_addr8[0] == 0xfe)
302
def IS_LINKLADDR6(a): return \
304
def IS_SITELADDR6(a): return \
306
def IS_MULTIADDR6(a): return ((a).s6_addr8[0] == 0xff)
308
def MADDR6_FLAGS(a): return ((a).s6_addr8[1] >> 4)
312
def MADDR6_SCOPE(a): return ((a).s6_addr8[1] & 0x0f)
314
MADDR6_SCP_NODE = 0x1
315
MADDR6_SCP_LINK = 0x2
316
MADDR6_SCP_SITE = 0x5
320
MADDR6_ALLROUTERS = 2
322
def IN6_IS_ADDR_UNSPECIFIED(p): return IS_ANYADDR6(*p)
324
def IN6_IS_ADDR_LOOPBACK(p): return IS_LOOPADDR6(*p)
326
def IN6_IS_ADDR_MULTICAST(p): return IS_MULTIADDR6(*p)
328
def IN6_IS_ADDR_LINKLOCAL(p): return IS_LINKLADDR6(*p)
330
def IN6_IS_ADDR_SITELOCAL(p): return IS_SITELADDR6(*p)
332
def IN6_IS_ADDR_V4MAPPED(p): return IS_IPV4ADDR6(*p)
334
def IN6_IS_ADDR_V4COMPAT(p): return IS_COMPATADDR6(*p)
336
def IN6_IS_ADDR_MC_NODELOCAL(p): return \
338
def IN6_IS_ADDR_MC_LINKLOCAL(p): return \
340
def IN6_IS_ADDR_MC_SITELOCAL(p): return \
342
def IN6_IS_ADDR_MC_ORGLOCAL(p): return \
344
def IN6_IS_ADDR_MC_GLOBAL(p): return \
355
IP_MULTICAST_TTL = 21
356
IP_MULTICAST_LOOP = 22
357
IP_ADD_MEMBERSHIP = 23
358
IP_DROP_MEMBERSHIP = 24
359
IP_MULTICAST_VIF = 25
364
IPV6_UNICAST_HOPS = IP_TTL
365
IPV6_MULTICAST_IF = IP_MULTICAST_IF
366
IPV6_MULTICAST_HOPS = IP_MULTICAST_TTL
367
IPV6_MULTICAST_LOOP = IP_MULTICAST_LOOP
368
IPV6_ADD_MEMBERSHIP = IP_ADD_MEMBERSHIP
369
IPV6_DROP_MEMBERSHIP = IP_DROP_MEMBERSHIP
372
IPV6_RECVPKTINFO = 43
375
IPV6_RECVHOPS = IP_RECVTTL
384
IP_DEFAULT_MULTICAST_TTL = 1
385
IP_DEFAULT_MULTICAST_LOOP = 1
387
IPV6_RTHDR_STRICT = 1
388
IPV6_RTHDR_TYPE_0 = 0