1# Generated by h2py from /usr/include/netinet/in.h
2from warnings import warnpy3k
3warnpy3k("the IN module has been removed in Python 3.0", stacklevel=2)
4del warnpy3k
5
6# Included from sys/endian.h
7LITTLE_ENDIAN = 1234
8BIG_ENDIAN = 4321
9PDP_ENDIAN = 3412
10BYTE_ORDER = BIG_ENDIAN
11BYTE_ORDER = LITTLE_ENDIAN
12def ntohl(x): return (x)
13
14def ntohs(x): return (x)
15
16def htonl(x): return (x)
17
18def htons(x): return (x)
19
20def htonl(x): return ntohl(x)
21
22def htons(x): return ntohs(x)
23
24
25# Included from sys/bsd_types.h
26
27# Included from sys/mkdev.h
28ONBITSMAJOR = 7
29ONBITSMINOR = 8
30OMAXMAJ = 0x7f
31OMAXMIN = 0xff
32NBITSMAJOR = 14
33NBITSMINOR = 18
34MAXMAJ = 0x1ff
35MAXMIN = 0x3ffff
36OLDDEV = 0
37NEWDEV = 1
38MKDEV_VER = NEWDEV
39def major(dev): return __major(MKDEV_VER, dev)
40
41def minor(dev): return __minor(MKDEV_VER, dev)
42
43
44# Included from sys/select.h
45FD_SETSIZE = 1024
46NBBY = 8
47IPPROTO_IP = 0
48IPPROTO_ICMP = 1
49IPPROTO_IGMP = 2
50IPPROTO_GGP = 3
51IPPROTO_ENCAP = 4
52IPPROTO_TCP = 6
53IPPROTO_EGP = 8
54IPPROTO_PUP = 12
55IPPROTO_UDP = 17
56IPPROTO_IDP = 22
57IPPROTO_TP = 29
58IPPROTO_XTP = 36
59IPPROTO_HELLO = 63
60IPPROTO_ND = 77
61IPPROTO_EON = 80
62IPPROTO_RAW = 255
63IPPROTO_MAX = 256
64IPPORT_RESERVED = 1024
65IPPORT_USERRESERVED = 5000
66IPPORT_MAXPORT = 65535
67def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0)
68
69IN_CLASSA_NET = 0xff000000
70IN_CLASSA_NSHIFT = 24
71IN_CLASSA_HOST = 0x00ffffff
72IN_CLASSA_MAX = 128
73def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000)
74
75IN_CLASSB_NET = 0xffff0000
76IN_CLASSB_NSHIFT = 16
77IN_CLASSB_HOST = 0x0000ffff
78IN_CLASSB_MAX = 65536
79def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000)
80
81IN_CLASSC_NET = 0xffffff00
82IN_CLASSC_NSHIFT = 8
83IN_CLASSC_HOST = 0x000000ff
84def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000)
85
86IN_CLASSD_NET = 0xf0000000
87IN_CLASSD_NSHIFT = 28
88IN_CLASSD_HOST = 0x0fffffff
89def IN_MULTICAST(i): return IN_CLASSD(i)
90
91def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000)
92
93def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000)
94
95INADDR_ANY = 0x00000000
96INADDR_BROADCAST = 0xffffffff
97INADDR_LOOPBACK = 0x7F000001
98INADDR_UNSPEC_GROUP = 0xe0000000
99INADDR_ALLHOSTS_GROUP = 0xe0000001
100INADDR_MAX_LOCAL_GROUP = 0xe00000ff
101INADDR_NONE = 0xffffffff
102IN_LOOPBACKNET = 127
103IP_OPTIONS = 1
104IP_MULTICAST_IF = 2
105IP_MULTICAST_TTL = 3
106IP_MULTICAST_LOOP = 4
107IP_ADD_MEMBERSHIP = 5
108IP_DROP_MEMBERSHIP = 6
109IP_HDRINCL = 7
110IP_TOS = 8
111IP_TTL = 9
112IP_RECVOPTS = 10
113IP_RECVRETOPTS = 11
114IP_RECVDSTADDR = 12
115IP_RETOPTS = 13
116IP_OPTIONS = 1
117IP_HDRINCL = 2
118IP_TOS = 3
119IP_TTL = 4
120IP_RECVOPTS = 5
121IP_RECVRETOPTS = 6
122IP_RECVDSTADDR = 7
123IP_RETOPTS = 8
124IP_MULTICAST_IF = 20
125IP_MULTICAST_TTL = 21
126IP_MULTICAST_LOOP = 22
127IP_ADD_MEMBERSHIP = 23
128IP_DROP_MEMBERSHIP = 24
129IRIX4_IP_OPTIONS = 1
130IRIX4_IP_MULTICAST_IF = 2
131IRIX4_IP_MULTICAST_TTL = 3
132IRIX4_IP_MULTICAST_LOOP = 4
133IRIX4_IP_ADD_MEMBERSHIP = 5
134IRIX4_IP_DROP_MEMBERSHIP = 6
135IRIX4_IP_HDRINCL = 7
136IRIX4_IP_TOS = 8
137IRIX4_IP_TTL = 9
138IRIX4_IP_RECVOPTS = 10
139IRIX4_IP_RECVRETOPTS = 11
140IRIX4_IP_RECVDSTADDR = 12
141IRIX4_IP_RETOPTS = 13
142IP_DEFAULT_MULTICAST_TTL = 1
143IP_DEFAULT_MULTICAST_LOOP = 1
144IP_MAX_MEMBERSHIPS = 20
145