1 # Generated by h2py from /usr/include/netinet/in.h
3 # Included from netinet/in_f.h
4 def IN_CLASSA(i
): return (((long)(i
) & 0x80000000) == 0)
6 IN_CLASSA_NET
= 0xff000000
8 IN_CLASSA_HOST
= 0x00ffffff
10 def IN_CLASSB(i
): return (((long)(i
) & 0xc0000000) == 0x80000000)
12 IN_CLASSB_NET
= 0xffff0000
14 IN_CLASSB_HOST
= 0x0000ffff
16 def IN_CLASSC(i
): return (((long)(i
) & 0xe0000000) == 0xc0000000)
18 IN_CLASSC_NET
= 0xffffff00
20 IN_CLASSC_HOST
= 0x000000ff
21 def IN_CLASSD(i
): return (((long)(i
) & 0xf0000000) == 0xe0000000)
23 IN_CLASSD_NET
= 0xf0000000
25 IN_CLASSD_HOST
= 0x0fffffff
26 def IN_MULTICAST(i
): return IN_CLASSD(i
)
28 def IN_EXPERIMENTAL(i
): return (((long)(i
) & 0xe0000000) == 0xe0000000)
30 def IN_BADCLASS(i
): return (((long)(i
) & 0xf0000000) == 0xf0000000)
32 INADDR_ANY
= 0x00000000
33 INADDR_LOOPBACK
= 0x7f000001
34 INADDR_BROADCAST
= 0xffffffff
35 INADDR_NONE
= 0xffffffff
37 INADDR_UNSPEC_GROUP
= 0xe0000000
38 INADDR_ALLHOSTS_GROUP
= 0xe0000001
39 INADDR_ALLRTRS_GROUP
= 0xe0000002
40 INADDR_MAX_LOCAL_GROUP
= 0xe00000ff
42 # Included from netinet/in6.h
44 # Included from sys/types.h
45 def quad_low(x
): return x
.val
[0]
50 INT_MIN
= (-2147483647-1)
52 LONG_MIN
= (-2147483647-1)
63 # Included from sys/select.h
68 # Included from sys/bitypes.h
70 # Included from netinet/in6_f.h
71 def IN6_IS_ADDR_UNSPECIFIED(a
): return IN6_ADDR_EQUAL_L(a
, 0, 0, 0, 0)
73 def IN6_SET_ADDR_UNSPECIFIED(a
): return IN6_ADDR_COPY_L(a
, 0, 0, 0, 0)
75 def IN6_IS_ADDR_ANY(a
): return IN6_ADDR_EQUAL_L(a
, 0, 0, 0, 0)
77 def IN6_SET_ADDR_ANY(a
): return IN6_ADDR_COPY_L(a
, 0, 0, 0, 0)
79 def IN6_IS_ADDR_LOOPBACK(a
): return IN6_ADDR_EQUAL_L(a
, 0, 0, 0, 0x01000000)
81 def IN6_SET_ADDR_LOOPBACK(a
): return IN6_ADDR_COPY_L(a
, 0, 0, 0, 0x01000000)
83 IN6_MC_FLAG_PERMANENT
= 0x0
84 IN6_MC_FLAG_TRANSIENT
= 0x1
85 IN6_MC_SCOPE_NODELOCAL
= 0x1
86 IN6_MC_SCOPE_LINKLOCAL
= 0x2
87 IN6_MC_SCOPE_SITELOCAL
= 0x5
88 IN6_MC_SCOPE_ORGLOCAL
= 0x8
89 IN6_MC_SCOPE_GLOBAL
= 0xE
90 def IN6_IS_ADDR_MC_NODELOCAL(a
): return \
92 def IN6_IS_ADDR_MC_LINKLOCAL(a
): return \
94 def IN6_IS_ADDR_MC_SITELOCAL(a
): return \
96 def IN6_IS_ADDR_MC_ORGLOCAL(a
): return \
98 def IN6_IS_ADDR_MC_GLOBAL(a
): return \
101 # Included from sys/convsa.h
102 __NETLIB_UW211_SVR4
= 1
103 __NETLIB_UW211_XPG4
= 2
104 __NETLIB_GEMINI_SVR4
= 3
105 __NETLIB_GEMINI_XPG4
= 4
106 __NETLIB_FP1_SVR4
= 5
107 __NETLIB_FP1_XPG4
= 6
108 __NETLIB_BASE_VERSION__
= __NETLIB_UW211_SVR4
109 __NETLIB_VERSION__
= __NETLIB_FP1_SVR4
110 __NETLIB_VERSION__
= __NETLIB_FP1_XPG4
111 __NETLIB_VERSION__
= __NETLIB_GEMINI_SVR4
112 __NETLIB_VERSION__
= __NETLIB_GEMINI_XPG4
113 __NETLIB_VERSION__
= __NETLIB_UW211_SVR4
114 __NETLIB_VERSION__
= __NETLIB_UW211_XPG4
115 __NETLIB_VERSION__
= __NETLIB_FP1_XPG4
117 # Included from sys/byteorder.h
122 # Included from sys/byteorder_f.h
123 BYTE_ORDER
= LITTLE_ENDIAN
124 def htonl(hl
): return __htonl(hl
)
126 def ntohl(nl
): return __ntohl(nl
)
128 def htons(hs
): return __htons(hs
)
130 def ntohs(ns
): return __ntohs(ns
)
132 def ntohl(x
): return (x
)
134 def ntohs(x
): return (x
)
136 def htonl(x
): return (x
)
138 def htons(x
): return (x
)
140 def __NETLIB_VERSION_IS_XPG4(version
): return (((version
) % 2) == 0)
142 def __NETLIB_VERSION_HAS_SALEN(version
): return ((version
) >= __NETLIB_GEMINI_SVR4
)
144 def __NETLIB_VERSION_IS_IKS(version
): return ((version
) >= __NETLIB_FP1_SVR4
)
146 def SA_FAMILY_GET(sa
): return \
148 INET6_ADDRSTRLEN
= 46
149 IPV6_UNICAST_HOPS
= 3
151 IPV6_MULTICAST_HOPS
= 25
152 IPV6_MULTICAST_IF
= 26
153 IPV6_MULTICAST_LOOP
= 27
154 IPV6_ADD_MEMBERSHIP
= 28
155 IPV6_DROP_MEMBERSHIP
= 29
157 # Included from sys/insrem.h
158 def LIST_INIT(head
): return \
160 def LIST_INIT(head
): return \
162 def remque(a
): return REMQUE(a
)
165 # Included from sys/socket.h
167 # Included from sys/uio.h
172 # Included from sys/netconfig.h
174 # Included from sys/cdefs.h
175 def __P(protos
): return protos
177 def __STRING(x
): return #x
179 def __P(protos
): return ()
181 def __STRING(x
): return "x"
183 NETCONFIG
= "/etc/netconfig"
193 NC_LOOPBACK
= "loopback"
196 NC_IMPLINK
= "implink"
202 NC_DATAKIT
= "datakit"
209 NC_APPLETALK
= "appletalk"
211 NC_IEEE802
= "ieee802"
216 NC_NETWARE
= "netware"
233 SO_ACCEPTCONN
= 0x0002
234 SO_REUSEADDR
= 0x0004
235 SO_KEEPALIVE
= 0x0008
236 SO_DONTROUTE
= 0x0010
237 SO_BROADCAST
= 0x0020
238 SO_USELOOPBACK
= 0x0040
240 SO_OOBINLINE
= 0x0100
242 SO_IMASOCKET
= 0x0400
244 SO_REUSEPORT
= 0x1000
245 SO_LISTENING
= 0x2000
248 SO_DONTLINGER
= (~SO_LINGER
)
257 SO_PROTOTYPE
= 0x1009
291 AF_INET_BSWAP
= 0x0200
292 PF_UNSPEC
= AF_UNSPEC
296 PF_IMPLINK
= AF_IMPLINK
302 PF_DATAKIT
= AF_DATAKIT
305 PF_DECnet
= AF_DECnet
308 PF_HYLINK
= AF_HYLINK
309 PF_APPLETALK
= AF_APPLETALK
315 PF_OSINET
= AF_OSINET
320 pseudo_PF_XTP
= pseudo_AF_XTP
333 def OPTLEN(x
): return ((((x
) + sizeof(long) - 1) / sizeof(long)) * sizeof(long))
359 # Included from sys/stream.h
361 # Included from sys/cred.h
363 # Included from sys/ksynch.h
365 # Included from sys/dl.h
368 # Included from sys/ipl.h
370 # Included from sys/disp_p.h
372 # Included from sys/trap.h
400 EVT_GLOBCALLOUT
= 0x08
401 EVT_LCLCALLOUT
= 0x10
402 EVT_SOFTINTMASK
= (EVT_STRSCHED|EVT_GLOBCALLOUT|EVT_LCLCALLOUT
)
420 MAX_INTR_NESTING
= 50
421 STRSCHED
= EVT_STRSCHED
422 GLOBALSOFTINT
= EVT_GLOBCALLOUT
423 LOCALSOFTINT
= EVT_LCLCALLOUT
425 # Included from sys/ksynch_p.h
426 def GET_TIME(timep
): return \
428 LK_THRESHOLD
= 500000
430 # Included from sys/list.h
432 # Included from sys/listasm.h
433 def remque_null(e
): return \
435 def LS_ISEMPTY(listp
): return \
440 def CYCLES_SINCE(c
): return CYCLES_BETWEEN((c
), CYCLES())
451 RWS_READ
= (ord('r'))
452 RWS_WRITE
= (ord('w'))
453 RWS_UNLOCKED
= (ord('u'))
454 RWS_BUSY
= (ord('b'))
455 def SLEEP_LOCKOWNED(lkp
): return \
457 def SLEEP_DISOWN(lkp
): return \
459 KS_NOPRMPT
= 0x00000001
460 __KS_LOCKTEST
= KS_LOCKTEST
462 __KS_MPSTATS
= KS_MPSTATS
464 __KS_NVLTTRACE
= KS_NVLTTRACE
466 KSFLAGS
= (__KS_LOCKTEST|__KS_MPSTATS|__KS_NVLTTRACE
)
472 KSVFLAG
= KSVMPNODEBUG
474 # Included from sys/ksinline.h
478 def _ATOMIC_INT_INCR(atomic_intp
): return \
480 def _ATOMIC_INT_DECR(atomic_intp
): return \
482 def ATOMIC_INT_READ(atomic_intp
): return _ATOMIC_INT_READ(atomic_intp
)
484 def ATOMIC_INT_INCR(atomic_intp
): return _ATOMIC_INT_INCR(atomic_intp
)
486 def ATOMIC_INT_DECR(atomic_intp
): return _ATOMIC_INT_DECR(atomic_intp
)
488 def FSPIN_INIT(lp
): return
490 def FSPIN_LOCK(l
): return DISABLE()
492 def FSPIN_TRYLOCK(l
): return (DISABLE(), B_TRUE
)
494 def FSPIN_UNLOCK(l
): return ENABLE()
496 def LOCK_DEINIT(lp
): return
498 def LOCK_DEALLOC(lp
): return
500 def LOCK_OWNED(lp
): return (B_TRUE
)
502 def RW_DEINIT(lp
): return
504 def RW_DEALLOC(lp
): return
506 def RW_OWNED(lp
): return (B_TRUE
)
508 def IS_LOCKED(lockp
): return B_FALSE
510 def LOCK_PLMIN(lockp
): return \
512 def TRYLOCK_PLMIN(lockp
): return LOCK_PLMIN(lockp
)
514 def LOCK_SH_PLMIN(lockp
): return LOCK_PLMIN(lockp
)
516 def RW_RDLOCK_PLMIN(lockp
): return LOCK_PLMIN(lockp
)
518 def RW_WRLOCK_PLMIN(lockp
): return LOCK_PLMIN(lockp
)
520 def LOCK_DEINIT(l
): return
522 def LOCK_PLMIN(lockp
): return LOCK((lockp
), PLMIN
)
524 def TRYLOCK_PLMIN(lockp
): return TRYLOCK((lockp
), PLMIN
)
526 def LOCK_SH_PLMIN(lockp
): return LOCK_SH((lockp
), PLMIN
)
528 def RW_RDLOCK_PLMIN(lockp
): return RW_RDLOCK((lockp
), PLMIN
)
530 def RW_WRLOCK_PLMIN(lockp
): return RW_WRLOCK((lockp
), PLMIN
)
532 def FSPIN_IS_LOCKED(fsp
): return B_FALSE
534 def SPIN_IS_LOCKED(lockp
): return B_FALSE
536 def FSPIN_OWNED(l
): return (B_TRUE
)
538 CR_MLDREAL
= 0x00000001
539 CR_RDUMP
= 0x00000002
540 def crhold(credp
): return crholdn((credp
), 1)
542 def crfree(credp
): return crfreen((credp
), 1)
545 # Included from sys/strmdep.h
546 def str_aligned(X
): return (((uint
)(X
) & (sizeof(int) - 1)) == 0)
549 # Included from sys/engine.h
551 # Included from sys/clock.h
553 # Included from sys/time.h
571 # Included from time.h
573 CLOCKS_PER_SEC
= 1000000
575 # Included from sys/clock_p.h
578 def toid_unpackcg(idval
): return (((idval
) >> IDBITS
) & 0xf)
580 def toid_unpackid(idval
): return ((idval
) & 0xfffffff)
582 def toid_unpackcg(idval
): return 0
584 def toid_unpackid(idval
): return (idval
)
587 CALLOUT_MAXVAL
= 0x7fffffff
588 TO_PERIODIC
= 0x80000000
589 TO_IMMEDIATE
= 0x80000000
597 def TIME_OWNED_R(cgnum
): return (B_TRUE
)
600 LOOPMICROSECONDS
= (LOOPSECONDS
* MICROSEC
)
601 def TICKS_SINCE(t
): return TICKS_BETWEEN(t
, TICKS())
608 E_DEFAULTKEEP
= 0x100
609 E_DRIVERBOUND
= 0x200
612 E_NOWAY
= (E_OFFLINE|E_BAD|E_SHUTDOWN
)
617 def PROCESSOR_UNMAP(e
): return ((e
) - engine
)
637 STRM_PUTCNT_TABLES
= 31
638 def STRM_MYENG_PUTCNT(sdp
): return STRM_PUTCNT(l
.eng_num
, sdp
)
702 SO_NODELIM
= 0x010000
703 SO_STRHOLD
= 0x020000
718 def straln(a
): return (caddr_t
)((long)(a
) & ~
(sizeof(int)-1))
748 IPPROTO_FRAGMENT
= 44
767 IPPORT_TIMESERVER
= 37
768 IPPORT_NAMESERVER
= 42
776 IPPORT_EXECSERVER
= 512
777 IPPORT_LOGINSERVER
= 513
778 IPPORT_CMDSERVER
= 514
779 IPPORT_EFSSERVER
= 520
781 IPPORT_WHOSERVER
= 513
782 IPPORT_ROUTESERVER
= 520
783 IPPORT_RESERVED
= 1024
784 IPPORT_USERRESERVED
= 65535
785 IPPORT_RESERVED_LOW
= 512
786 IPPORT_RESERVED_HIGH
= 1023
787 IPPORT_USERRESERVED_LOW
= 32768
788 IPPORT_USERRESERVED_HIGH
= 65535
799 IP_MULTICAST_LOOP
= 10
800 IP_ADD_MEMBERSHIP
= 11
801 IP_DROP_MEMBERSHIP
= 12
804 IP_MULTICAST_TTL
= 16
812 IP_DEFAULT_MULTICAST_TTL
= 1
813 IP_DEFAULT_MULTICAST_LOOP
= 1
814 IP_MAX_MEMBERSHIPS
= 20
815 INADDR_UNSPEC_GROUP
= 0xe0000000
816 INADDR_ALLHOSTS_GROUP
= 0xe0000001
817 INADDR_ALLRTRS_GROUP
= 0xe0000002
818 INADDR_MAX_LOCAL_GROUP
= 0xe00000ff
820 # Included from netinet/in_mp.h
822 # Included from netinet/in_mp_ddi.h
824 # Included from sys/inline.h
826 def ASSERT_LOCK(x
): return
828 def ASSERT_WRLOCK(x
): return
830 def ASSERT_UNLOCK(x
): return
832 def CANPUT(q
): return canput((q
))
834 def CANPUTNEXT(q
): return canputnext((q
))