1 # Generated by h2py from /usr/include/netinet/in.h
3 # Included from standards.h
5 # Included from sgidefs.h
14 # Included from sys/bsd_types.h
16 # Included from sys/mkdev.h
28 def IS_STRING_SPEC_DEV(x
): return ((dev_t
)(x
)==__makedev(MKDEV_VER
, 0, 0))
30 def major(dev
): return __major(MKDEV_VER
, dev
)
32 def minor(dev
): return __minor(MKDEV_VER
, dev
)
35 # Included from sys/select.h
39 # Included from string.h
43 # Included from sys/endian.h
50 _BYTE_ORDER
= _BIG_ENDIAN
51 _BYTE_ORDER
= _LITTLE_ENDIAN
52 def ntohl(x
): return (x
)
54 def ntohs(x
): return (x
)
56 def htonl(x
): return (x
)
58 def htons(x
): return (x
)
60 def htonl(x
): return ntohl(x
)
62 def htons(x
): return ntohs(x
)
65 # Included from sys/types.h
67 # Included from sys/pthread.h
71 # Included from sys/cpumask.h
73 def CPUMASK_INDEX(bit
): return ((bit
) >> 6)
75 def CPUMASK_SHFT(bit
): return ((bit
) & 0x3f)
77 def CPUMASK_IS_ZERO(p
): return ((p
) == 0)
79 def CPUMASK_IS_NONZERO(p
): return ((p
) != 0)
82 # Included from sys/nodemask.h
83 def CNODEMASK_IS_ZERO(p
): return ((p
) == 0)
85 def CNODEMASK_IS_NONZERO(p
): return ((p
) != 0)
93 IPPROTO_ENCAP
= IPPROTO_IPIP
99 IPPROTO_BBN_RCC_MON
= 10
108 IPPROTO_DCN_MEAS
= 19
121 IPPROTO_MERIT_INP
= 32
127 IPPROTO_IDPR_CMTP
= 38
132 IPPROTO_FRAGMENT
= 44
141 IPPROTO_SAT_EXPAK
= 64
142 IPPROTO_KRYPTOLAN
= 65
152 IPPROTO_BR_SAT_MON
= 76
155 IPPROTO_WB_EXPAK
= 79
158 IPPROTO_SECURE_VMTP
= 82
161 IPPROTO_NSFNET_IGP
= 85
166 IPPROTO_SPRITE_RPC
= 90
172 IPPROTO_AES_SP3_D
= 96
174 IPPROTO_ENCAPHDR
= 98
178 IPPORT_RESERVED
= 1024
179 IPPORT_MAXPORT
= 65535
181 INET6_ADDRSTRLEN
= 46
182 def IN_CLASSA(i
): return (((__int32_t
)(i
) & 0x80000000) == 0)
184 IN_CLASSA_NET
= 0xff000000
185 IN_CLASSA_NSHIFT
= 24
186 IN_CLASSA_HOST
= 0x00ffffff
188 def IN_CLASSB(i
): return (((__int32_t
)(i
) & 0xc0000000) == 0x80000000)
190 IN_CLASSB_NET
= 0xffff0000
191 IN_CLASSB_NSHIFT
= 16
192 IN_CLASSB_HOST
= 0x0000ffff
193 IN_CLASSB_MAX
= 65536
194 def IN_CLASSC(i
): return (((__int32_t
)(i
) & 0xe0000000) == 0xc0000000)
196 IN_CLASSC_NET
= 0xffffff00
198 IN_CLASSC_HOST
= 0x000000ff
199 def IN_CLASSD(i
): return (((__int32_t
)(i
) & 0xf0000000) == 0xe0000000)
201 IN_CLASSD_NET
= 0xf0000000
202 IN_CLASSD_NSHIFT
= 28
203 IN_CLASSD_HOST
= 0x0fffffff
204 def IN_MULTICAST(i
): return IN_CLASSD(i
)
206 def IN_EXPERIMENTAL(i
): return (((__int32_t
)(i
) & 0xf0000000) == 0xf0000000)
208 def IN_BADCLASS(i
): return (((__int32_t
)(i
) & 0xf0000000) == 0xf0000000)
210 INADDR_NONE
= 0xffffffff
213 IPV6_FLOWINFO_FLOWLABEL
= 0x00ffffff
214 IPV6_FLOWINFO_PRIORITY
= 0x0f000000
215 IPV6_FLOWINFO_PRIFLOW
= 0x0fffffff
216 IPV6_FLOWINFO_SRFLAG
= 0x10000000
217 IPV6_FLOWINFO_VERSION
= 0xf0000000
218 IPV6_PRIORITY_UNCHARACTERIZED
= 0x00000000
219 IPV6_PRIORITY_FILLER
= 0x01000000
220 IPV6_PRIORITY_UNATTENDED
= 0x02000000
221 IPV6_PRIORITY_RESERVED1
= 0x03000000
222 IPV6_PRIORITY_BULK
= 0x04000000
223 IPV6_PRIORITY_RESERVED2
= 0x05000000
224 IPV6_PRIORITY_INTERACTIVE
= 0x06000000
225 IPV6_PRIORITY_CONTROL
= 0x07000000
226 IPV6_PRIORITY_8
= 0x08000000
227 IPV6_PRIORITY_9
= 0x09000000
228 IPV6_PRIORITY_10
= 0x0a000000
229 IPV6_PRIORITY_11
= 0x0b000000
230 IPV6_PRIORITY_12
= 0x0c000000
231 IPV6_PRIORITY_13
= 0x0d000000
232 IPV6_PRIORITY_14
= 0x0e000000
233 IPV6_PRIORITY_15
= 0x0f000000
234 IPV6_SRFLAG_STRICT
= 0x10000000
235 IPV6_SRFLAG_LOOSE
= 0x00000000
236 IPV6_VERSION
= 0x60000000
237 IPV6_FLOWINFO_FLOWLABEL
= 0xffffff00
238 IPV6_FLOWINFO_PRIORITY
= 0x0000000f
239 IPV6_FLOWINFO_PRIFLOW
= 0xffffff0f
240 IPV6_FLOWINFO_SRFLAG
= 0x00000010
241 IPV6_FLOWINFO_VERSION
= 0x000000f0
242 IPV6_PRIORITY_UNCHARACTERIZED
= 0x00000000
243 IPV6_PRIORITY_FILLER
= 0x00000001
244 IPV6_PRIORITY_UNATTENDED
= 0x00000002
245 IPV6_PRIORITY_RESERVED1
= 0x00000003
246 IPV6_PRIORITY_BULK
= 0x00000004
247 IPV6_PRIORITY_RESERVED2
= 0x00000005
248 IPV6_PRIORITY_INTERACTIVE
= 0x00000006
249 IPV6_PRIORITY_CONTROL
= 0x00000007
250 IPV6_PRIORITY_8
= 0x00000008
251 IPV6_PRIORITY_9
= 0x00000009
252 IPV6_PRIORITY_10
= 0x0000000a
253 IPV6_PRIORITY_11
= 0x0000000b
254 IPV6_PRIORITY_12
= 0x0000000c
255 IPV6_PRIORITY_13
= 0x0000000d
256 IPV6_PRIORITY_14
= 0x0000000e
257 IPV6_PRIORITY_15
= 0x0000000f
258 IPV6_SRFLAG_STRICT
= 0x00000010
259 IPV6_SRFLAG_LOOSE
= 0x00000000
260 IPV6_VERSION
= 0x00000060
261 def IPV6_GET_FLOWLABEL(x
): return (ntohl(x
) & 0x00ffffff)
263 def IPV6_GET_PRIORITY(x
): return ((ntohl(x
) >> 24) & 0xf)
265 def IPV6_GET_VERSION(x
): return ((ntohl(x
) >> 28) & 0xf)
267 def IPV6_SET_FLOWLABEL(x
): return (htonl(x
) & IPV6_FLOWINFO_FLOWLABEL
)
269 def IPV6_SET_PRIORITY(x
): return (htonl((x
& 0xf) << 24))
271 def CLR_ADDR6(a
): return \
273 def IS_ANYSOCKADDR(a
): return \
275 def IS_ANYADDR6(a
): return \
277 def IS_COMPATSOCKADDR(a
): return \
279 def IS_COMPATADDR6(a
): return \
281 def IS_LOOPSOCKADDR(a
): return \
283 def IS_LOOPADDR6(a
): return \
285 def IS_IPV4SOCKADDR(a
): return \
287 def IS_IPV4ADDR6(a
): return \
289 def IS_LOOPSOCKADDR(a
): return \
291 def IS_LOOPADDR6(a
): return \
293 def IS_IPV4SOCKADDR(a
): return \
295 def IS_IPV4ADDR6(a
): return \
297 def IS_LOCALADDR6(a
): return ((a
).s6_addr8
[0] == 0xfe)
299 def IS_LINKLADDR6(a
): return \
301 def IS_SITELADDR6(a
): return \
303 def IS_MULTIADDR6(a
): return ((a
).s6_addr8
[0] == 0xff)
305 def MADDR6_FLAGS(a
): return ((a
).s6_addr8
[1] >> 4)
309 def MADDR6_SCOPE(a
): return ((a
).s6_addr8
[1] & 0x0f)
311 MADDR6_SCP_NODE
= 0x1
312 MADDR6_SCP_LINK
= 0x2
313 MADDR6_SCP_SITE
= 0x5
317 MADDR6_ALLROUTERS
= 2
319 def IN6_IS_ADDR_UNSPECIFIED(p
): return IS_ANYADDR6(*p
)
321 def IN6_IS_ADDR_LOOPBACK(p
): return IS_LOOPADDR6(*p
)
323 def IN6_IS_ADDR_MULTICAST(p
): return IS_MULTIADDR6(*p
)
325 def IN6_IS_ADDR_LINKLOCAL(p
): return IS_LINKLADDR6(*p
)
327 def IN6_IS_ADDR_SITELOCAL(p
): return IS_SITELADDR6(*p
)
329 def IN6_IS_ADDR_V4MAPPED(p
): return IS_IPV4ADDR6(*p
)
331 def IN6_IS_ADDR_V4COMPAT(p
): return IS_COMPATADDR6(*p
)
333 def IN6_IS_ADDR_MC_NODELOCAL(p
): return \
335 def IN6_IS_ADDR_MC_LINKLOCAL(p
): return \
337 def IN6_IS_ADDR_MC_SITELOCAL(p
): return \
339 def IN6_IS_ADDR_MC_ORGLOCAL(p
): return \
341 def IN6_IS_ADDR_MC_GLOBAL(p
): return \
352 IP_MULTICAST_TTL
= 21
353 IP_MULTICAST_LOOP
= 22
354 IP_ADD_MEMBERSHIP
= 23
355 IP_DROP_MEMBERSHIP
= 24
356 IP_MULTICAST_VIF
= 25
361 IPV6_UNICAST_HOPS
= IP_TTL
362 IPV6_MULTICAST_IF
= IP_MULTICAST_IF
363 IPV6_MULTICAST_HOPS
= IP_MULTICAST_TTL
364 IPV6_MULTICAST_LOOP
= IP_MULTICAST_LOOP
365 IPV6_ADD_MEMBERSHIP
= IP_ADD_MEMBERSHIP
366 IPV6_DROP_MEMBERSHIP
= IP_DROP_MEMBERSHIP
369 IPV6_RECVPKTINFO
= 43
372 IPV6_RECVHOPS
= IP_RECVTTL
381 IP_DEFAULT_MULTICAST_TTL
= 1
382 IP_DEFAULT_MULTICAST_LOOP
= 1
384 IPV6_RTHDR_STRICT
= 1
385 IPV6_RTHDR_TYPE_0
= 0