# Generated by h2py from /usr/include/sys/socket.h

# Included from machine/param.h
MACHINE = "alpha"
MACHINE_ARCH = "alpha"

# Included from machine/alpha_cpu.h
ALPHA_PCB_FLAGS_FEN = 0x0000000000000001
ALPHA_PCB_FLAGS_PME = 0x4000000000000000
ALPHA_HWFRAME_PS = 0
ALPHA_HWFRAME_PC = 1
ALPHA_HWFRAME_GP = 2
ALPHA_HWFRAME_A0 = 3
ALPHA_HWFRAME_A1 = 4
ALPHA_HWFRAME_A2 = 5
ALPHA_HWFRAME_SIZE = 6
ALPHA_PSL_USERMODE = 0x0008
ALPHA_PSL_IPL_MASK = 0x0007
ALPHA_PSL_IPL_0 = 0x0000
ALPHA_PSL_IPL_SOFT = 0x0001
ALPHA_PSL_IPL_IO = 0x0004
ALPHA_PSL_IPL_CLOCK = 0x0005
ALPHA_PSL_IPL_HIGH = 0x0006
ALPHA_PSL_MUST_BE_ZERO = 0xfffffffffffffff0
ALPHA_PSL_USERSET = ALPHA_PSL_USERMODE
ALPHA_PSL_USERCLR = (ALPHA_PSL_MUST_BE_ZERO | ALPHA_PSL_IPL_MASK)
ALPHA_INTR_XPROC = 0
ALPHA_INTR_CLOCK = 1
ALPHA_INTR_ERROR = 2
ALPHA_INTR_DEVICE = 3
ALPHA_INTR_PERF = 4
ALPHA_INTR_PASSIVE = 5
ALPHA_MCES_IMP = \
    0xffffffff00000000
ALPHA_MCES_RSVD = \
    0x00000000ffffffe0
ALPHA_MCES_DSC = \
    0x0000000000000010
ALPHA_MCES_DPC = \
    0x0000000000000008
ALPHA_MCES_PCE = \
    0x0000000000000004
ALPHA_MCES_SCE = \
    0x0000000000000002
ALPHA_MCES_MIP = \
    0x0000000000000001
ALPHA_LOGOUT_FLAGS_RETRY = 0x80000000
ALPHA_LOGOUT_FLAGS_SE = 0x40000000
ALPHA_LOGOUT_FLAGS_SBZ = 0x3fffffff
def ALPHA_LOGOUT_PAL_AREA(lap): return \

def ALPHA_LOGOUT_PAL_SIZE(lap): return \

def ALPHA_LOGOUT_CPU_AREA(lap): return \

def ALPHA_LOGOUT_CPU_SIZE(lap): return \

def ALPHA_LOGOUT_SYSTEM_AREA(lap): return \

def ALPHA_LOGOUT_SYSTEM_SIZE(lap): return \

ALPHA_SYS_ERROR = 0x620
ALPHA_PROC_ERROR = 0x630
ALPHA_SYS_MCHECK = 0x660
ALPHA_PROC_MCHECK = 0x670
ALPHA_PGSHIFT = 13
ALPHA_PGBYTES = (1 << ALPHA_PGSHIFT)
ALPHA_USEG_BASE = 0
ALPHA_USEG_END = 0x000003ffffffffff
ALPHA_K0SEG_BASE = 0xfffffc0000000000
ALPHA_K0SEG_END = 0xfffffdffffffffff
ALPHA_K1SEG_BASE = 0xfffffe0000000000
ALPHA_K1SEG_END = 0xffffffffffffffff
def ALPHA_K0SEG_TO_PHYS(x): return ((x) & ~ALPHA_K0SEG_BASE)

def ALPHA_PHYS_TO_K0SEG(x): return ((x) | ALPHA_K0SEG_BASE)

def ALPHA_PTE_TO_PFN(pte): return ((pte) >> 32)

def ALPHA_PTE_FROM_PFN(pfn): return ((pfn) << 32)

ALPHA_KENTRY_INT = 0
ALPHA_KENTRY_ARITH = 1
ALPHA_KENTRY_MM = 2
ALPHA_KENTRY_IF = 3
ALPHA_KENTRY_UNA = 4
ALPHA_KENTRY_SYS = 5
ALPHA_MMCSR_INVALTRANS = 0
ALPHA_MMCSR_ACCESS = 1
ALPHA_MMCSR_FOR = 2
ALPHA_MMCSR_FOE = 3
ALPHA_MMCSR_FOW = 4
ALPHA_IF_CODE_BPT = 0
ALPHA_IF_CODE_BUGCHK = 1
ALPHA_IF_CODE_GENTRAP = 2
ALPHA_IF_CODE_FEN = 3
ALPHA_IF_CODE_OPDEC = 4
def ALPHA_TBISI(va): return alpha_pal_tbi(1, (va))		 

def ALPHA_TBISD(va): return alpha_pal_tbi(2, (va))		 

def ALPHA_TBIS(va): return alpha_pal_tbi(3, (va))		 

ALPHA_AMASK_BWX = 0x0001
ALPHA_AMASK_FIX = 0x0002
ALPHA_AMASK_CIX = 0x0004
ALPHA_AMASK_MVI = 0x0100
ALPHA_AMASK_PAT = 0x0200
ALPHA_AMASK_ALL = (ALPHA_AMASK_BWX|ALPHA_AMASK_FIX|	\
				 ALPHA_AMASK_CIX|ALPHA_AMASK_MVI|	\
				 ALPHA_AMASK_PAT)
ALPHA_AMASK_BITS = \
    "\20\12PAT\11MVI\3CIX\2FIX\1BWX"
ALPHA_IMPLVER_EV4 = 0
ALPHA_IMPLVER_EV5 = 1
ALPHA_IMPLVER_EV6 = 2
ALPHA_WHAMI_MAXID = 63
ALPHA_MAXPROCS = (ALPHA_WHAMI_MAXID + 1)

# Included from machine/pal.h
PAL_halt = 0x0000
PAL_cflush = 0x0001
PAL_draina = 0x0002
PAL_cserve = 0x0009
PAL_swppal = 0x000a
PAL_ipir = 0x000d
PAL_bpt = 0x0080
PAL_bugchk = 0x0081
PAL_imb = 0x0086
PAL_rdunique = 0x009e
PAL_wrunique = 0x009f
PAL_gentrap = 0x00aa
PAL_VMS_ldqp = 0x0003
PAL_VMS_stqp = 0x0004
PAL_VMS_mtpr_fen = 0x000c
PAL_VMS_mtpr_ipir = 0x000d
PAL_VMS_mfpr_ipl = 0x000e
PAL_VMS_mtpr_ipl = 0x000f
PAL_VMS_mfpr_mces = 0x0010
PAL_VMS_mtpr_mces = 0x0011
PAL_VMS_mfpr_prbr = 0x0013
PAL_VMS_mtpr_prbr = 0x0014
PAL_VMS_mfpr_ptbr = 0x0015
PAL_VMS_mtpr_scbb = 0x0017
PAL_VMS_mtpr_sirr = 0x0018
PAL_VMS_mtpr_tbia = 0x001b
PAL_VMS_mtpr_tbiap = 0x001c
PAL_VMS_mtpr_tbis = 0x001d
PAL_VMS_mfpr_usp = 0x0022
PAL_VMS_mtpr_usp = 0x0023
PAL_VMS_mfpr_vptb = 0x0029
PAL_VMS_mfpr_whami = 0x003f
PAL_VMS_rei = 0x0092
PAL_OSF1_rdmces = 0x0010
PAL_OSF1_wrmces = 0x0011
PAL_OSF1_wrfen = 0x002b
PAL_OSF1_wrvptptr = 0x002d
PAL_OSF1_swpctx = 0x0030
PAL_OSF1_wrval = 0x0031
PAL_OSF1_rdval = 0x0032
PAL_OSF1_tbi = 0x0033
PAL_OSF1_wrent = 0x0034
PAL_OSF1_swpipl = 0x0035
PAL_OSF1_rdps = 0x0036
PAL_OSF1_wrkgp = 0x0037
PAL_OSF1_wrusp = 0x0038
PAL_OSF1_wrperfmon = 0x0039
PAL_OSF1_rdusp = 0x003a
PAL_OSF1_whami = 0x003c
PAL_OSF1_retsys = 0x003d
PAL_OSF1_rti = 0x003f
PAL_OSF1_callsys = 0x0083
PAL_OSF1_imb = 0x0086

# Included from machine/cpu.h

# Included from machine/frame.h
FRAME_V0 = 0
FRAME_T0 = 1
FRAME_T1 = 2
FRAME_T2 = 3
FRAME_T3 = 4
FRAME_T4 = 5
FRAME_T5 = 6
FRAME_T6 = 7
FRAME_T7 = 8
FRAME_S0 = 9
FRAME_S1 = 10
FRAME_S2 = 11
FRAME_S3 = 12
FRAME_S4 = 13
FRAME_S5 = 14
FRAME_S6 = 15
FRAME_A3 = 16
FRAME_A4 = 17
FRAME_A5 = 18
FRAME_T8 = 19
FRAME_T9 = 20
FRAME_T10 = 21
FRAME_T11 = 22
FRAME_RA = 23
FRAME_T12 = 24
FRAME_AT = 25
FRAME_SP = 26
FRAME_SW_SIZE = (FRAME_SP + 1)
FRAME_HW_OFFSET = FRAME_SW_SIZE
FRAME_PS = (FRAME_HW_OFFSET + ALPHA_HWFRAME_PS)
FRAME_PC = (FRAME_HW_OFFSET + ALPHA_HWFRAME_PC)
FRAME_GP = (FRAME_HW_OFFSET + ALPHA_HWFRAME_GP)
FRAME_A0 = (FRAME_HW_OFFSET + ALPHA_HWFRAME_A0)
FRAME_A1 = (FRAME_HW_OFFSET + ALPHA_HWFRAME_A1)
FRAME_A2 = (FRAME_HW_OFFSET + ALPHA_HWFRAME_A2)
FRAME_HW_SIZE = ALPHA_HWFRAME_SIZE
FRAME_SIZE = (FRAME_HW_OFFSET + FRAME_HW_SIZE)

# Included from machine/bus.h
BUS_BARRIER_READ = 0x01
BUS_BARRIER_WRITE = 0x02
BUS_SPACE_BARRIER_READ = BUS_BARRIER_READ
BUS_SPACE_BARRIER_WRITE = BUS_BARRIER_WRITE
BUS_DMA_WAITOK = 0x000
BUS_DMA_NOWAIT = 0x001
BUS_DMA_ALLOCNOW = 0x002
BUS_DMA_COHERENT = 0x004
BUS_DMA_BUS1 = 0x010
BUS_DMA_BUS2 = 0x020
BUS_DMA_BUS3 = 0x040
BUS_DMA_BUS4 = 0x080
BUS_DMA_STREAMING = 0x100
BUS_DMA_READ = 0x200
BUS_DMA_WRITE = 0x400
DMAMAP_NO_COALESCE = 0x40000000
DMAMAP_HAS_SGMAP = 0x80000000
BUS_DMASYNC_PREREAD = 0x01
BUS_DMASYNC_POSTREAD = 0x02
BUS_DMASYNC_PREWRITE = 0x04
BUS_DMASYNC_POSTWRITE = 0x08

# Included from sys/device.h

# Included from sys/queue.h
def SLIST_HEAD_INITIALIZER(head): return \

def SLIST_ENTRY(type): return \

def SLIST_END(head): return NULL

def SLIST_EMPTY(head): return (SLIST_FIRST(head) == SLIST_END(head))

def LIST_HEAD_INITIALIZER(head): return \

def LIST_ENTRY(type): return \

def LIST_END(head): return NULL

def LIST_EMPTY(head): return (LIST_FIRST(head) == LIST_END(head))

def SIMPLEQ_HEAD_INITIALIZER(head): return \

def SIMPLEQ_ENTRY(type): return \

def SIMPLEQ_END(head): return NULL

def SIMPLEQ_EMPTY(head): return (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))

def TAILQ_HEAD_INITIALIZER(head): return \

def TAILQ_ENTRY(type): return \

def TAILQ_END(head): return NULL

def TAILQ_EMPTY(head): return \

def CIRCLEQ_HEAD_INITIALIZER(head): return \

def CIRCLEQ_ENTRY(type): return \

def CIRCLEQ_EMPTY(head): return \


# Included from sys/lock.h

# Included from sys/simplelock.h
SLOCK_LOCKED = 1
SLOCK_UNLOCKED = 0
def simple_lock_try(lkp): return (1)	 

def simple_unlock(lkp): return _simple_unlock(lkp, __FILE__, __LINE__)

def simple_lock_try(lkp): return _simple_lock_try(lkp, __FILE__, __LINE__)

def simple_lock(lkp): return _simple_lock(lkp, __FILE__, __LINE__)

LK_TYPE_MASK = 0x0000000f
LK_SHARED = 0x00000001
LK_EXCLUSIVE = 0x00000002
LK_UPGRADE = 0x00000003
LK_EXCLUPGRADE = 0x00000004
LK_DOWNGRADE = 0x00000005
LK_RELEASE = 0x00000006
LK_DRAIN = 0x00000007
LK_EXTFLG_MASK = 0x00700070
LK_NOWAIT = 0x00000010
LK_SLEEPFAIL = 0x00000020
LK_CANRECURSE = 0x00000040
LK_REENABLE = 0x00000080
LK_SETRECURSE = 0x00100000
LK_RECURSEFAIL = 0x00200000
LK_SPIN = 0x00400000
LK_WANT_UPGRADE = 0x00001000
LK_WANT_EXCL = 0x00002000
LK_HAVE_EXCL = 0x00004000
LK_WAITDRAIN = 0x00008000
LK_DRAINING = 0x00040000
LK_DRAINED = 0x00080000
LK_INTERLOCK = 0x00010000
LK_RETRY = 0x00020000
def spinlock_release_all(l): return _spinlock_release_all((l), __FILE__, __LINE__)

def LOCK_ASSERT(x): return KASSERT(x)

def LOCK_ASSERT(x): return  

SIMPLE_LOCK = simple_lock
SIMPLE_UNLOCK = simple_unlock
SIMPLE_LOCK = simple_lock
SIMPLE_UNLOCK = simple_unlock
DVF_ACTIVE = 0x0001
FSTATE_NOTFOUND = 0
FSTATE_FOUND = 1
FSTATE_STAR = 2
FSTATE_DNOTFOUND = 3
FSTATE_DSTAR = 4
DETACH_FORCE = 0x01
DETACH_QUIET = 0x02
QUIET = 0
UNCONF = 1
UNSUPP = 2
FIRMWARE_MAX = 5*1024*1024
CPUF_PRIMARY = 0x01
CPUF_PRESENT = 0x02
CPUF_RUNNING = 0x04
CPUF_PAUSED = 0x08
CPUF_FPUSAVE = 0x10
def cpu_wait(p): return  

def CLKF_USERMODE(framep): return \

def need_resched(ci): return \

def need_resched(ci): return \

def need_proftick(p): return \

def need_proftick(p): return \

def signotify(p): return aston(curcpu())

CPU_CONSDEV = 1
CPU_ROOT_DEVICE = 2
CPU_UNALIGNED_PRINT = 3
CPU_UNALIGNED_FIX = 4
CPU_UNALIGNED_SIGBUS = 5
CPU_BOOTED_KERNEL = 6
CPU_FP_SYNC_COMPLETE = 7
CPU_CHIPSET = 8
CPU_ALLOWAPERTURE = 9
CPU_MAXID = 10
CPU_CHIPSET_MEM = 1
CPU_CHIPSET_BWX = 2
CPU_CHIPSET_TYPE = 3
CPU_CHIPSET_DENSE = 4
CPU_CHIPSET_PORTS = 5
CPU_CHIPSET_HAE_MASK = 6
CPU_CHIPSET_MAXID = 7
ALIGNBYTES = 7
def ALIGN(p): return (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES)

NBPG = (1 << ALPHA_PGSHIFT)
PGOFSET = (NBPG-1)
PGSHIFT = ALPHA_PGSHIFT
PAGE_SHIFT = 13
PAGE_SIZE = (1 << PAGE_SHIFT)
PAGE_MASK = (PAGE_SIZE - 1)
KERNBASE = 0xfffffc0000230000
DEV_BSIZE = 512
DEV_BSHIFT = 9
BLKDEV_IOSIZE = 2048
MAXPHYS = (64 * 1024)
SSIZE = 1
SINCR = 1
UPAGES = 2
USPACE = (UPAGES * NBPG)
USPACE_ALIGN = (0)
MSGBUFSIZE = NBPG
MSIZE = 256
MCLSHIFT = 11
MCLBYTES = (1 << MCLSHIFT)
MCLOFSET = (MCLBYTES - 1)
NMBCLUSTERS = 4096
NKMEMPAGES_MIN_DEFAULT = ((8 * 1024 * 1024) >> PAGE_SHIFT)
NKMEMPAGES_MAX_DEFAULT = ((128 * 1024 * 1024) >> PAGE_SHIFT)
def ctod(x): return ((x) << (PGSHIFT - DEV_BSHIFT))

def dtoc(x): return ((x) >> (PGSHIFT - DEV_BSHIFT))

def ctob(x): return ((x) << PGSHIFT)

def btoc(x): return (((x) + PGOFSET) >> PGSHIFT)

def btodb(x): return ((x) >> DEV_BSHIFT)

def dbtob(x): return ((x) << DEV_BSHIFT)

def bdbtofsb(bn): return ((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))


# Included from machine/intr.h

# Included from sys/evcount.h

# Included from machine/atomic.h
IPL_NONE = 1
IPL_BIO = 1
IPL_NET = 1
IPL_TTY = 1
IPL_CLOCK = 2
IPL_HIGH = 3
IPL_SERIAL = 1
IPL_AUDIO = 1
IPL_SOFTSERIAL = 0
IPL_SOFTNET = 1
IPL_SOFTCLOCK = 2
IPL_SOFT = 3
IPL_NSOFT = 4
IST_UNUSABLE = -1
IST_NONE = 0
IST_PULSE = 1
IST_EDGE = 2
IST_LEVEL = 3
def splassert(wantipl): return  

def splx(s): return \

ALPHA_NIPIS = 6
def softintr_schedule(arg): return \

def DELAY(n): return delay(n)

SOCK_STREAM = 1
SOCK_DGRAM = 2
SOCK_RAW = 3
SOCK_RDM = 4
SOCK_SEQPACKET = 5
SO_DEBUG = 0x0001
SO_ACCEPTCONN = 0x0002
SO_REUSEADDR = 0x0004
SO_KEEPALIVE = 0x0008
SO_DONTROUTE = 0x0010
SO_BROADCAST = 0x0020
SO_USELOOPBACK = 0x0040
SO_LINGER = 0x0080
SO_OOBINLINE = 0x0100
SO_REUSEPORT = 0x0200
SO_SNDBUF = 0x1001
SO_RCVBUF = 0x1002
SO_SNDLOWAT = 0x1003
SO_RCVLOWAT = 0x1004
SO_SNDTIMEO = 0x1005
SO_RCVTIMEO = 0x1006
SO_ERROR = 0x1007
SO_TYPE = 0x1008
SO_NETPROC = 0x1020
SOL_SOCKET = 0xffff
AF_UNSPEC = 0
AF_LOCAL = 1
AF_UNIX = AF_LOCAL
AF_INET = 2
AF_IMPLINK = 3
AF_PUP = 4
AF_CHAOS = 5
AF_NS = 6
AF_ISO = 7
AF_OSI = AF_ISO
AF_ECMA = 8
AF_DATAKIT = 9
AF_CCITT = 10
AF_SNA = 11
AF_DECnet = 12
AF_DLI = 13
AF_LAT = 14
AF_HYLINK = 15
AF_APPLETALK = 16
AF_ROUTE = 17
AF_LINK = 18
pseudo_AF_XTP = 19
AF_COIP = 20
AF_CNT = 21
pseudo_AF_RTIP = 22
AF_IPX = 23
AF_INET6 = 24
pseudo_AF_PIP = 25
AF_ISDN = 26
AF_E164 = AF_ISDN
AF_NATM = 27
AF_ENCAP = 28
AF_SIP = 29
AF_KEY = 30
pseudo_AF_HDRCMPLT = 31
AF_BLUETOOTH = 32
AF_MAX = 33
PF_UNSPEC = AF_UNSPEC
PF_LOCAL = AF_LOCAL
PF_UNIX = PF_LOCAL
PF_INET = AF_INET
PF_IMPLINK = AF_IMPLINK
PF_PUP = AF_PUP
PF_CHAOS = AF_CHAOS
PF_NS = AF_NS
PF_ISO = AF_ISO
PF_OSI = AF_ISO
PF_ECMA = AF_ECMA
PF_DATAKIT = AF_DATAKIT
PF_CCITT = AF_CCITT
PF_SNA = AF_SNA
PF_DECnet = AF_DECnet
PF_DLI = AF_DLI
PF_LAT = AF_LAT
PF_HYLINK = AF_HYLINK
PF_APPLETALK = AF_APPLETALK
PF_ROUTE = AF_ROUTE
PF_LINK = AF_LINK
PF_XTP = pseudo_AF_XTP
PF_COIP = AF_COIP
PF_CNT = AF_CNT
PF_IPX = AF_IPX
PF_INET6 = AF_INET6
PF_PIP = pseudo_AF_PIP
PF_ISDN = AF_ISDN
PF_NATM = AF_NATM
PF_ENCAP = AF_ENCAP
PF_SIP = AF_SIP
PF_KEY = AF_KEY
PF_BPF = pseudo_AF_HDRCMPLT
PF_BLUETOOTH = AF_BLUETOOTH
PF_MAX = AF_MAX
SHUT_RD = 0
SHUT_WR = 1
SHUT_RDWR = 2
def SOCKCREDSIZE(ngrps): return \

NET_MAXID = AF_MAX
NET_RT_DUMP = 1
NET_RT_FLAGS = 2
NET_RT_IFLIST = 3
NET_RT_MAXID = 4
NET_KEY_SADB_DUMP = 1
NET_KEY_MAXID = 2
NET_BPF_BUFSIZE = 1
NET_BPF_MAXBUFSIZE = 2
NET_BPF_MAXID = 3
SOMAXCONN = 128
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_DONTROUTE = 0x4
MSG_EOR = 0x8
MSG_TRUNC = 0x10
MSG_CTRUNC = 0x20
MSG_WAITALL = 0x40
MSG_DONTWAIT = 0x80
MSG_BCAST = 0x100
MSG_MCAST = 0x200
def CMSG_DATA(cmsg): return \

def CMSG_FIRSTHDR(mhdr): return \

def __CMSG_ALIGN(len): return ALIGN(len)

def CMSG_ALIGN(n): return __CMSG_ALIGN(n)

SCM_RIGHTS = 0x01
SCM_CREDS = 0x02

# Included from sys/cdefs.h

# Included from machine/cdefs.h
def _C_LABEL(x): return _STRING(x)

def __P(protos): return protos		 

def __STRING(x): return #x

def __P(protos): return ()		 

def __STRING(x): return "x"

def __attribute__(x): return  

def __predict_true(exp): return __builtin_expect(((exp) != 0), 1)

def __predict_false(exp): return __builtin_expect(((exp) != 0), 0)

def __predict_true(exp): return ((exp) != 0)

def __predict_false(exp): return ((exp) != 0)

MSG_COMPAT = 0x8000
