Include file for Proteus Win32
socket functions |
; Include file for Proteus Win32 socket functions
; **** Parameters for W32SOCKET ****
; Address family
; unspecified
CONST AF_UNSPEC 0
; locale to host (pipe, portals)
CONST AF_UNIX 1
; internetwork: UDP, TCP, etc.
CONST AF_INET 2
; imp arpanet addresses
CONST AF_IMPLINK 3
; pup protocols: e.g. BSP
CONST AF_PUP 4
; mit CHAOS protocols
CONST AF_CHAOS 5
; IPX and SPX
CONST AF_IPX 6
; XEROX NS protocols
CONST AF_NS 6
; ISO protocols
CONST AF_ISO 7
; OSI is ISO
CONST AF_OSI 7
; european computer makers
CONST AF_ECMA 8
; datakit protocols
CONST AF_DATAKIT 9
; protocols CCITT, X.25 etc.
CONST AF_CCITT 10
; IBM SNA
CONST AF_SNA 11
; DECnet
CONST AF_DECnet 12
; datalink direct interface
CONST AF_DLI 13
; LAT
CONST AF_LAT 14
; NSC Hyperchannel
CONST AF_HYLINK 15
; AppleTalk
CONST AF_APPLETALK 16
; NetBios style addresses
CONST AF_NETBIOS 17
; VoiceView
CONST AF_VOICEVIEW 18
; FireFox
CONST AF_FIREFOX 19
; somebody is using this!
CONST AF_UNKNOWN1 20
; Banyan
CONST AF_BAN 21
; Type
; stream type socket
CONST SOCK_STREAM 1
; datagram socket
CONST SOCK_DGRAM 2
; raw protocol interface
CONST SOCK_RAW 3
; securely delivered message
CONST SOCK_RDM 4
; packet stream with sequence control
CONST SOCK_SEQPACKET 5
; Protocol
; dummy for IP
CONST IPPROTO_IP 0
; protocol with message checking
CONST IPPROTO_ICMP 1
; protocol for group management
CONST IPPROTO_IGMP 2
; gateway^2 (deprecated)
CONST IPPROTO_GGP 3
; tcp
CONST IPPROTO_TCP 6
; pup
CONST IPPROTO_PUP 12
; UDP protocol
CONST IPPROTO_UDP 17
; xns idp
CONST IPPROTO_IDP 22
; UNOFFICIAL net disk protocol
CONST IPPROTO_ND 77
; IP raw packet
CONST IPPROTO_RAW 255
; maximum value for protocol
CONST IPPROTO_MAX 256
; -----------------------------------------------------------------------------------------
; Errors returned by W32LASTSOCKETERR
; Windows socket definitions for Microsoft® C error constants
CONST WSAEINTR 10004
CONST WSAEBADF 10009
CONST WSAEACCES 10013
CONST WSAEFAULT 10014
CONST WSAEINVAL 10022
CONST WSAEMFILE 10024
; Windows socket definitions for Berkeley error constants
CONST WSAEWOULDBLOCK 10035
CONST WSAEINPROGRESS 10036
CONST WSAEALREADY 10037
CONST WSAENOTSOCK 10038
CONST WSAEDESTADDRREQ 10039
CONST WSAEMSGSIZE 10040
CONST WSAEPROTOTYPE 10041
CONST WSAENOPROTOOPT 10042
CONST WSAEPROTONOSUPPORT 10043
CONST WSAESOCKTNOSUPPORT 10044
CONST WSAEOPNOTSUPP 10045
CONST WSAEPFNOSUPPORT 10046
CONST WSAEAFNOSUPPORT 10047
CONST WSAEADDRINUSE 10048
CONST WSAEADDRNOTAVAIL 10049
CONST WSAENETDOWN 10050
CONST WSAENETUNREACH 10051
CONST WSAENETRESET 10052
CONST WSAECONNABORTED 10053
CONST WSAECONNRESET 10054
CONST WSAENOBUFS 10055
CONST WSAEISCONN 10056
CONST WSAENOTCONN 10057
CONST WSAESHUTDOWN 10058
CONST WSAETOOMANYREFS 10059
CONST WSAETIMEDOUT 10060
CONST WSAECONNREFUSED 10061
CONST WSAELOOP 10062
CONST WSAENAMETOOLONG 10063
CONST WSAEHOSTDOWN 10064
CONST WSAEHOSTUNREACH 10065
CONST WSAENOTEMPTY 10066
CONST WSAEPROCLIM 10067
CONST WSAEUSERS 10068
CONST WSAEDQUOT 10069
CONST WSAESTALE 10070
CONST WSAEREMOTE 10071
CONST WSAEDISCON 10101
; Windows socket extended error constants
CONST WSASYSNOTREADY 10091
CONST WSAVERNOTSUPPORTED 10092
CONST WSANOTINITIALISED 10093
; -----------------------------------------------------------------------------------------
; Parameters for W32IOCTLSOCKET
; bytes readable from socket
CONST FIONREAD 0x4004667F
; disable/enable blocking mode
CONST FIONBIO 0x8004667E
; check for out-of-band data
CONST SIOCATMARK 0x40047307
; -----------------------------------------------------------------------------------------
; Flags for W32SEND
; process "out-of-band" data
CONST MSG_OOB 0x1
; peek at input message
CONST MSG_PEEK 0x2
; send without using routing tables
CONST MSG_DONTROUTE 0x4
CONST MSG_MAXIOVLEN 16
; send or receive xport partial message
CONST MSG_PARTIAL 0x8000
; -----------------------------------------------------------------------------------------
; Flags for W32SHUTDOWN
; shutdown receive
CONST SD_RECEIVE 0x00
; shutdown send
CONST SD_SEND 0x01
; shutdown both send and receive
CONST SD_BOTH 0x02
; -----------------------------------------------------------------------------------------
; Parameters for W32GETSOCKOPT and W32SETSOCKOPT
; options for socket level
CONST SOL_SOCKET 0xffff
; level = SOL_SOCKET
; socket did listen()
CONST SO_ACCEPTCONN 0x0002
; allow for broadcast messages
CONST SO_BROADCAST 0x0020
; enable debug info recording
CONST SO_DEBUG 0x0001
; don't linger
CONST SO_DONTLINGER 0xFFFFFF7F
; don't use routing tables
CONST SO_DONTROUTE 0x0010
; get error status and reset
CONST SO_ERROR 0x1007
; ID for socket group
CONST SO_GROUP_ID 0x2001
; group priority
CONST SO_GROUP_PRIORITY 0x2002
; keep alive connections
CONST SO_KEEPALIVE 0x0008
; linger on closing if data is available
CONST SO_LINGER 0x0080
; maximum message size
CONST SO_MAX_MSG_SIZE 0x2003
; leave online received OOB data
CONST SO_OOBINLINE 0x0100
; WSAPROTOCOL_INFOA structure
CONST SO_PROTOCOL_INFOA 0x2004
; WSAPROTOCOL_INFOW structure
CONST SO_PROTOCOL_INFOW 0x2005
; receive buffer size
CONST SO_RCVBUF 0x1002
; reuse local address
CONST SO_REUSEADDR 0x0004
; send buffer size
CONST SO_SNDBUF 0x1001
; return socket type
CONST SO_TYPE 0x1008
; configuration info for service provider
CONST PVD_CONFIG 0x3001
; level = IPPROTO_TCP
CONST TCP_NODELAY 0x0001
; minimum level for send
CONST SO_SNDLOWAT 0x1003
; minimum level for receive
CONST SO_RCVLOWAT 0x1004
; timeout for send
CONST SO_SNDTIMEO 0x1005
; timeout for receive
CONST SO_RCVTIMEO 0x1006
; bypass hardware when possibile
CONST SO_USELOOPBACK 0x0040
; maximum connection queue for listen
CONST SO_MAXCONN 0x7fffffff
; maximum length for arrays passed to W32SELECT
CONST FD_SETSIZE 64
; offsets to use for checking the bitmap returned by W32SELECT
CONST W32SELECT_READ_OFFSET 0
CONST W32SELECT_WRITE_OFFSET 64
CONST W32SELECT_EXCEPT_OFFSET 129