PageRenderTime 95ms CodeModel.GetById 30ms app.highlight 44ms RepoModel.GetById 17ms app.codeStats 0ms

/Lib/plat-irix6/IN.py

http://unladen-swallow.googlecode.com/
Python | 388 lines | 307 code | 69 blank | 12 comment | 0 complexity | 178a4bfbe38c0a192da624e422ad0c92 MD5 | raw file
  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 standards.h
  7
  8# Included from sgidefs.h
  9_MIPS_ISA_MIPS1 = 1
 10_MIPS_ISA_MIPS2 = 2
 11_MIPS_ISA_MIPS3 = 3
 12_MIPS_ISA_MIPS4 = 4
 13_MIPS_SIM_ABI32 = 1
 14_MIPS_SIM_NABI32 = 2
 15_MIPS_SIM_ABI64 = 3
 16
 17# Included from sys/bsd_types.h
 18
 19# Included from sys/mkdev.h
 20ONBITSMAJOR = 7
 21ONBITSMINOR = 8
 22OMAXMAJ = 0x7f
 23OMAXMIN = 0xff
 24NBITSMAJOR = 14
 25NBITSMINOR = 18
 26MAXMAJ = 0x1ff
 27MAXMIN = 0x3ffff
 28OLDDEV = 0
 29NEWDEV = 1
 30MKDEV_VER = NEWDEV
 31def IS_STRING_SPEC_DEV(x): return ((dev_t)(x)==__makedev(MKDEV_VER, 0, 0))
 32
 33def major(dev): return __major(MKDEV_VER, dev)
 34
 35def minor(dev): return __minor(MKDEV_VER, dev)
 36
 37
 38# Included from sys/select.h
 39FD_SETSIZE = 1024
 40__NBBY = 8
 41
 42# Included from string.h
 43NULL = 0L
 44NBBY = 8
 45
 46# Included from sys/endian.h
 47LITTLE_ENDIAN = 1234
 48BIG_ENDIAN = 4321
 49PDP_ENDIAN = 3412
 50_LITTLE_ENDIAN = 1234
 51_BIG_ENDIAN = 4321
 52_PDP_ENDIAN = 3412
 53_BYTE_ORDER = _BIG_ENDIAN
 54_BYTE_ORDER = _LITTLE_ENDIAN
 55def ntohl(x): return (x)
 56
 57def ntohs(x): return (x)
 58
 59def htonl(x): return (x)
 60
 61def htons(x): return (x)
 62
 63def htonl(x): return ntohl(x)
 64
 65def htons(x): return ntohs(x)
 66
 67
 68# Included from sys/types.h
 69
 70# Included from sys/pthread.h
 71P_MYID = (-1)
 72P_MYHOSTID = (-1)
 73
 74# Included from sys/cpumask.h
 75MAXCPU = 128
 76def CPUMASK_INDEX(bit): return ((bit) >> 6)
 77
 78def CPUMASK_SHFT(bit): return ((bit) & 0x3f)
 79
 80def CPUMASK_IS_ZERO(p): return ((p) == 0)
 81
 82def CPUMASK_IS_NONZERO(p): return ((p) != 0)
 83
 84
 85# Included from sys/nodemask.h
 86def CNODEMASK_IS_ZERO(p): return ((p) == 0)
 87
 88def CNODEMASK_IS_NONZERO(p): return ((p) != 0)
 89
 90IPPROTO_IP = 0
 91IPPROTO_HOPOPTS = 0
 92IPPROTO_ICMP = 1
 93IPPROTO_IGMP = 2
 94IPPROTO_GGP = 3
 95IPPROTO_IPIP = 4
 96IPPROTO_ENCAP = IPPROTO_IPIP
 97IPPROTO_ST = 5
 98IPPROTO_TCP = 6
 99IPPROTO_UCL = 7
100IPPROTO_EGP = 8
101IPPROTO_IGP = 9
102IPPROTO_BBN_RCC_MON = 10
103IPPROTO_NVP_II = 11
104IPPROTO_PUP = 12
105IPPROTO_ARGUS = 13
106IPPROTO_EMCON = 14
107IPPROTO_XNET = 15
108IPPROTO_CHAOS = 16
109IPPROTO_UDP = 17
110IPPROTO_MUX = 18
111IPPROTO_DCN_MEAS = 19
112IPPROTO_HMP = 20
113IPPROTO_PRM = 21
114IPPROTO_IDP = 22
115IPPROTO_TRUNK_1 = 23
116IPPROTO_TRUNK_2 = 24
117IPPROTO_LEAF_1 = 25
118IPPROTO_LEAF_2 = 26
119IPPROTO_RDP = 27
120IPPROTO_IRTP = 28
121IPPROTO_TP = 29
122IPPROTO_NETBLT = 30
123IPPROTO_MFE_NSP = 31
124IPPROTO_MERIT_INP = 32
125IPPROTO_SEP = 33
126IPPROTO_3PC = 34
127IPPROTO_IDPR = 35
128IPPROTO_XTP = 36
129IPPROTO_DDP = 37
130IPPROTO_IDPR_CMTP = 38
131IPPROTO_TPPP = 39
132IPPROTO_IL = 40
133IPPROTO_IPV6 = 41
134IPPROTO_ROUTING = 43
135IPPROTO_FRAGMENT = 44
136IPPROTO_RSVP = 46
137IPPROTO_ESP = 50
138IPPROTO_AH = 51
139IPPROTO_ICMPV6 = 58
140IPPROTO_NONE = 59
141IPPROTO_DSTOPTS = 60
142IPPROTO_CFTP = 62
143IPPROTO_HELLO = 63
144IPPROTO_SAT_EXPAK = 64
145IPPROTO_KRYPTOLAN = 65
146IPPROTO_RVD = 66
147IPPROTO_IPPC = 67
148IPPROTO_SAT_MON = 69
149IPPROTO_VISA = 70
150IPPROTO_IPCV = 71
151IPPROTO_CPNX = 72
152IPPROTO_CPHB = 73
153IPPROTO_WSN = 74
154IPPROTO_PVP = 75
155IPPROTO_BR_SAT_MON = 76
156IPPROTO_ND = 77
157IPPROTO_WB_MON = 78
158IPPROTO_WB_EXPAK = 79
159IPPROTO_EON = 80
160IPPROTO_VMTP = 81
161IPPROTO_SECURE_VMTP = 82
162IPPROTO_VINES = 83
163IPPROTO_TTP = 84
164IPPROTO_NSFNET_IGP = 85
165IPPROTO_DGP = 86
166IPPROTO_TCF = 87
167IPPROTO_IGRP = 88
168IPPROTO_OSPF = 89
169IPPROTO_SPRITE_RPC = 90
170IPPROTO_LARP = 91
171IPPROTO_MTP = 92
172IPPROTO_AX25 = 93
173IPPROTO_SWIPE = 94
174IPPROTO_MICP = 95
175IPPROTO_AES_SP3_D = 96
176IPPROTO_ETHERIP = 97
177IPPROTO_ENCAPHDR = 98
178IPPROTO_RAW = 255
179IPPROTO_MAX = 256
180IPPROTO_STP = 257
181IPPORT_RESERVED = 1024
182IPPORT_MAXPORT = 65535
183INET_ADDRSTRLEN = 16
184INET6_ADDRSTRLEN = 46
185def IN_CLASSA(i): return (((__int32_t)(i) & 0x80000000) == 0)
186
187IN_CLASSA_NET = 0xff000000
188IN_CLASSA_NSHIFT = 24
189IN_CLASSA_HOST = 0x00ffffff
190IN_CLASSA_MAX = 128
191def IN_CLASSB(i): return (((__int32_t)(i) & 0xc0000000) == 0x80000000)
192
193IN_CLASSB_NET = 0xffff0000
194IN_CLASSB_NSHIFT = 16
195IN_CLASSB_HOST = 0x0000ffff
196IN_CLASSB_MAX = 65536
197def IN_CLASSC(i): return (((__int32_t)(i) & 0xe0000000) == 0xc0000000)
198
199IN_CLASSC_NET = 0xffffff00
200IN_CLASSC_NSHIFT = 8
201IN_CLASSC_HOST = 0x000000ff
202def IN_CLASSD(i): return (((__int32_t)(i) & 0xf0000000) == 0xe0000000)
203
204IN_CLASSD_NET = 0xf0000000
205IN_CLASSD_NSHIFT = 28
206IN_CLASSD_HOST = 0x0fffffff
207def IN_MULTICAST(i): return IN_CLASSD(i)
208
209def IN_EXPERIMENTAL(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
210
211def IN_BADCLASS(i): return (((__int32_t)(i) & 0xf0000000) == 0xf0000000)
212
213INADDR_NONE = 0xffffffff
214IN_LOOPBACKNET = 127
215IPNGVERSION = 6
216IPV6_FLOWINFO_FLOWLABEL = 0x00ffffff
217IPV6_FLOWINFO_PRIORITY = 0x0f000000
218IPV6_FLOWINFO_PRIFLOW = 0x0fffffff
219IPV6_FLOWINFO_SRFLAG = 0x10000000
220IPV6_FLOWINFO_VERSION = 0xf0000000
221IPV6_PRIORITY_UNCHARACTERIZED = 0x00000000
222IPV6_PRIORITY_FILLER = 0x01000000
223IPV6_PRIORITY_UNATTENDED = 0x02000000
224IPV6_PRIORITY_RESERVED1 = 0x03000000
225IPV6_PRIORITY_BULK = 0x04000000
226IPV6_PRIORITY_RESERVED2 = 0x05000000
227IPV6_PRIORITY_INTERACTIVE = 0x06000000
228IPV6_PRIORITY_CONTROL = 0x07000000
229IPV6_PRIORITY_8 = 0x08000000
230IPV6_PRIORITY_9 = 0x09000000
231IPV6_PRIORITY_10 = 0x0a000000
232IPV6_PRIORITY_11 = 0x0b000000
233IPV6_PRIORITY_12 = 0x0c000000
234IPV6_PRIORITY_13 = 0x0d000000
235IPV6_PRIORITY_14 = 0x0e000000
236IPV6_PRIORITY_15 = 0x0f000000
237IPV6_SRFLAG_STRICT = 0x10000000
238IPV6_SRFLAG_LOOSE = 0x00000000
239IPV6_VERSION = 0x60000000
240IPV6_FLOWINFO_FLOWLABEL = 0xffffff00
241IPV6_FLOWINFO_PRIORITY = 0x0000000f
242IPV6_FLOWINFO_PRIFLOW = 0xffffff0f
243IPV6_FLOWINFO_SRFLAG = 0x00000010
244IPV6_FLOWINFO_VERSION = 0x000000f0
245IPV6_PRIORITY_UNCHARACTERIZED = 0x00000000
246IPV6_PRIORITY_FILLER = 0x00000001
247IPV6_PRIORITY_UNATTENDED = 0x00000002
248IPV6_PRIORITY_RESERVED1 = 0x00000003
249IPV6_PRIORITY_BULK = 0x00000004
250IPV6_PRIORITY_RESERVED2 = 0x00000005
251IPV6_PRIORITY_INTERACTIVE = 0x00000006
252IPV6_PRIORITY_CONTROL = 0x00000007
253IPV6_PRIORITY_8 = 0x00000008
254IPV6_PRIORITY_9 = 0x00000009
255IPV6_PRIORITY_10 = 0x0000000a
256IPV6_PRIORITY_11 = 0x0000000b
257IPV6_PRIORITY_12 = 0x0000000c
258IPV6_PRIORITY_13 = 0x0000000d
259IPV6_PRIORITY_14 = 0x0000000e
260IPV6_PRIORITY_15 = 0x0000000f
261IPV6_SRFLAG_STRICT = 0x00000010
262IPV6_SRFLAG_LOOSE = 0x00000000
263IPV6_VERSION = 0x00000060
264def IPV6_GET_FLOWLABEL(x): return (ntohl(x) & 0x00ffffff)
265
266def IPV6_GET_PRIORITY(x): return ((ntohl(x) >> 24) & 0xf)
267
268def IPV6_GET_VERSION(x): return ((ntohl(x) >> 28) & 0xf)
269
270def IPV6_SET_FLOWLABEL(x): return (htonl(x) & IPV6_FLOWINFO_FLOWLABEL)
271
272def IPV6_SET_PRIORITY(x): return (htonl((x & 0xf) << 24))
273
274def CLR_ADDR6(a): return \
275
276def IS_ANYSOCKADDR(a): return \
277
278def IS_ANYADDR6(a): return \
279
280def IS_COMPATSOCKADDR(a): return \
281
282def IS_COMPATADDR6(a): return \
283
284def IS_LOOPSOCKADDR(a): return \
285
286def IS_LOOPADDR6(a): return \
287
288def IS_IPV4SOCKADDR(a): return \
289
290def IS_IPV4ADDR6(a): return \
291
292def IS_LOOPSOCKADDR(a): return \
293
294def IS_LOOPADDR6(a): return \
295
296def IS_IPV4SOCKADDR(a): return \
297
298def IS_IPV4ADDR6(a): return \
299
300def IS_LOCALADDR6(a): return ((a).s6_addr8[0] == 0xfe)
301
302def IS_LINKLADDR6(a): return \
303
304def IS_SITELADDR6(a): return \
305
306def IS_MULTIADDR6(a): return ((a).s6_addr8[0] == 0xff)
307
308def MADDR6_FLAGS(a): return ((a).s6_addr8[1] >> 4)
309
310MADDR6_FLG_WK = 0
311MADDR6_FLG_TS = 1
312def MADDR6_SCOPE(a): return ((a).s6_addr8[1] & 0x0f)
313
314MADDR6_SCP_NODE = 0x1
315MADDR6_SCP_LINK = 0x2
316MADDR6_SCP_SITE = 0x5
317MADDR6_SCP_ORG = 0x8
318MADDR6_SCP_GLO = 0xe
319MADDR6_ALLNODES = 1
320MADDR6_ALLROUTERS = 2
321MADDR6_ALLHOSTS = 3
322def IN6_IS_ADDR_UNSPECIFIED(p): return IS_ANYADDR6(*p)
323
324def IN6_IS_ADDR_LOOPBACK(p): return IS_LOOPADDR6(*p)
325
326def IN6_IS_ADDR_MULTICAST(p): return IS_MULTIADDR6(*p)
327
328def IN6_IS_ADDR_LINKLOCAL(p): return IS_LINKLADDR6(*p)
329
330def IN6_IS_ADDR_SITELOCAL(p): return IS_SITELADDR6(*p)
331
332def IN6_IS_ADDR_V4MAPPED(p): return IS_IPV4ADDR6(*p)
333
334def IN6_IS_ADDR_V4COMPAT(p): return IS_COMPATADDR6(*p)
335
336def IN6_IS_ADDR_MC_NODELOCAL(p): return \
337
338def IN6_IS_ADDR_MC_LINKLOCAL(p): return \
339
340def IN6_IS_ADDR_MC_SITELOCAL(p): return \
341
342def IN6_IS_ADDR_MC_ORGLOCAL(p): return \
343
344def IN6_IS_ADDR_MC_GLOBAL(p): return \
345
346IP_OPTIONS = 1
347IP_HDRINCL = 2
348IP_TOS = 3
349IP_TTL = 4
350IP_RECVOPTS = 5
351IP_RECVRETOPTS = 6
352IP_RECVDSTADDR = 7
353IP_RETOPTS = 8
354IP_MULTICAST_IF = 20
355IP_MULTICAST_TTL = 21
356IP_MULTICAST_LOOP = 22
357IP_ADD_MEMBERSHIP = 23
358IP_DROP_MEMBERSHIP = 24
359IP_MULTICAST_VIF = 25
360IP_RSVP_VIF_ON = 26
361IP_RSVP_VIF_OFF = 27
362IP_RSVP_ON = 28
363IP_SENDSRCADDR = 36
364IPV6_UNICAST_HOPS = IP_TTL
365IPV6_MULTICAST_IF = IP_MULTICAST_IF
366IPV6_MULTICAST_HOPS = IP_MULTICAST_TTL
367IPV6_MULTICAST_LOOP = IP_MULTICAST_LOOP
368IPV6_ADD_MEMBERSHIP = IP_ADD_MEMBERSHIP
369IPV6_DROP_MEMBERSHIP = IP_DROP_MEMBERSHIP
370IPV6_SENDIF = 40
371IPV6_NOPROBE = 42
372IPV6_RECVPKTINFO = 43
373IPV6_PKTINFO = 44
374IP_RECVTTL = 45
375IPV6_RECVHOPS = IP_RECVTTL
376IPV6_CHECKSUM = 46
377ICMP6_FILTER = 47
378IPV6_HOPLIMIT = 48
379IPV6_HOPOPTS = 49
380IPV6_DSTOPTS = 50
381IPV6_RTHDR = 51
382IPV6_PKTOPTIONS = 52
383IPV6_NEXTHOP = 53
384IP_DEFAULT_MULTICAST_TTL = 1
385IP_DEFAULT_MULTICAST_LOOP = 1
386IPV6_RTHDR_LOOSE = 0
387IPV6_RTHDR_STRICT = 1
388IPV6_RTHDR_TYPE_0 = 0