Difference between revisions of "Unit GlobalSock"

From Ultibo.org
Jump to: navigation, search
 
(22 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo Global Socket Definitions unit'''
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Global socket constants''' <code> FD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>FD_SETSIZE = 64;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>IOCPARM_MASK = $7f;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IOC_VOID = $20000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IOC_OUT = $40000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IOC_IN = $80000000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IOC_INOUT = (IOC_IN or IOC_OUT);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FIONREAD = Cardinal( IOC_OUT or</code>
 +
| get # bytes to read
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 127);</code>
 +
| &nbsp;
 +
|-
 +
| <code>FIONBIO = Cardinal(IOC_IN or</code>
 +
| set/clear non-blocking i/o
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 126);</code>
 +
| &nbsp;
 +
|-
 +
| <code>FIOASYNC = Cardinal(IOC_IN or</code>
 +
| set/clear async i/o
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 125);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SIOCSHIWAT = Cardinal( IOC_IN or</code>
 +
| set high watermark
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 0);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SIOCGHIWAT = Cardinal( IOC_OUT or</code>
 +
| get high watermark
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SIOCSLOWAT = Cardinal( IOC_IN or</code>
 +
| set low watermark
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 2);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SIOCGLOWAT = Cardinal( IOC_OUT or</code>
 +
| get low watermark
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 3);</code>
 +
| &nbsp;
 +
|-
 +
| <code>SIOCATMARK = Cardinal( IOC_OUT or</code>
 +
| at oob mark
 +
|-
 +
| <code>((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 7);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp; 
 +
|-
 +
| <code>IMPLINK_IP = 155;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IMPLINK_LOWEXPER = 156;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IMPLINK_HIGHEXPER = 158;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>TF_DISCONNECT = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TF_REUSE_SOCKET = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TF_WRITE_BEHIND = $04;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp; 
 +
|-
 +
| <code>INVALID_SOCKET = TSocket(NOT(0));</code>
 +
| This is used instead of -1, since the TSocket type is unsigned.
 +
|-
 +
| <code>SOCKET_ERROR = -1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Level number for (get/set)sockopt() to apply to socket itself''
 +
|-
 +
| <code>SOL_SOCKET = $ffff;</code>
 +
| options for socket level
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Maximum queue length specifiable by listen''
 +
|-
 +
| <code>SOMAXCONN = $7fffffff;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Define constant based on rfc883, used by gethostbyxxxx() calls''
 +
|-
 +
| <code>MAXGETHOSTSTRUCT = 1024;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Define flags to be used with the WSAAsyncSelect() call''
 +
|-
 +
| <code>FD_READ = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FD_WRITE = $02;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FD_OOB = $04;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FD_ACCEPT = $08;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FD_CONNECT = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FD_CLOSE = $20;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSADESCRIPTION_LEN = 256;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSASYS_STATUS_LEN = 128;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Global Socket constants for enhanced Winsock functions''
 +
|-
 +
| <code>MAX_NAME_SIZE = 80;</code>
 +
| &nbsp;
 +
|-
 +
| <code>MAX_NAME_ALIASES = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>MAX_NAME_SERVERS = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>MAX_HOST_ALIASES = 16;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>INET_ADDRSTR_ANY = '0.0.0.0';</code>
 +
| &nbsp;
 +
|-
 +
| <code>INET6_ADDRSTR_INIT = '0::0';</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>INET_ADDRSTR_BROADCAST = '255.255.255.255';</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>INET_ADDRSTRLEN = 16;</code>
 +
| Max size of numeric form of IPv4 address
 +
|-
 +
| <code>INET6_ADDRSTRLEN = 46;</code>
 +
| Max size of numeric form of IPv6 address
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''IP protocol''' <code> IPPROTO_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>IPPROTO_IP = 0;</code>
 +
| dummy for IP
 +
|-
 +
| <code>IPPROTO_ICMP = 1;</code>
 +
| control message protocol
 +
|-
 +
| <code>IPPROTO_IGMP = 2;</code>
 +
| group management protocol
 +
|-
 +
| <code>IPPROTO_GGP = 3;</code>
 +
| gateway^2 (deprecated)
 +
|-
 +
| <code>IPPROTO_TCP = 6;</code>
 +
| tcp
 +
|-
 +
| <code>IPPROTO_EGP = 8;</code>
 +
| egp
 +
|-
 +
| <code>IPPROTO_PUP =12;</code>
 +
| pup
 +
|-
 +
| <code>IPPROTO_UDP =17;</code>
 +
| user datagram protocol
 +
|-
 +
| <code>IPPROTO_HMP =20;</code>
 +
| hmp
 +
|-
 +
| <code>IPPROTO_IDP =22;</code>
 +
| xns idp
 +
|-
 +
| <code>IPPROTO_RDP =27;</code>
 +
| rdp
 +
|-
 +
| <code>IPPROTO_IPV6 = 41;</code>
 +
| IP6 header
 +
|-
 +
| <code>IPPROTO_ROUTING = 43;</code>
 +
| IP6 routing header
 +
|-
 +
| <code>IPPROTO_FRAGMENT = 44;</code>
 +
| IP6 fragmentation header
 +
|-
 +
| <code>IPPROTO_ICMPV6 = 58;</code>
 +
| ICMP6
 +
|-
 +
| <code>IPPROTO_RVD = 66;</code>
 +
| rvd
 +
|-
 +
| <code>IPPROTO_ND = 77;</code>
 +
| UNOFFICIAL net disk proto
 +
|-
 +
| <code>IPPROTO_RAW = 255;</code>
 +
| raw IP packet
 +
|-
 +
| <code>IPPROTO_MAX = 256;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NSPROTO_IPX = 1000;</code>
 +
| ipx protocol
 +
|-
 +
| <code>NSPROTO_SPX = 1256;</code>
 +
| spx protocol
 +
|-
 +
| <code>NSPROTO_SPXII = 1257;</code>
 +
| spxii protocol
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''IP port''' <code> IPPORT_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Port/socket numbers: network standard functions''
 +
|-
 +
| <code>IPPORT_ANY = 0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>IPPORT_ECHO = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_DISCARD = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_SYSTAT = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_DAYTIME = 13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_NETSTAT = 15;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_FTP = 21;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_TELNET = 23;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_SMTP = 25;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_TIMESERVER = 37;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_NAMESERVER = 42;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_WHOIS = 43;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_DNS = 53;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_MTP = 57;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_BOOTPS = 67;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_BOOTPC = 68;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Port/socket numbers: host specific functions''
 +
|-
 +
| <code>IPPORT_TFTP = 69;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_RJE = 77;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_FINGER = 79;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_TTYLINK = 87;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_SUPDUP = 95;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''UNIX TCP sockets''
 +
|-
 +
| <code>IPPORT_EXECSERVER = 512;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_LOGINSERVER = 513;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_CMDSERVER = 514;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_EFSSERVER = 520;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''UNIX UDP sockets''
 +
|-
 +
| <code>IPPORT_BIFFUDP = 512;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_WHOSERVER = 513;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IPPORT_ROUTESERVER = 520;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root)''
 +
|-
 +
| <code>IPPORT_RESERVED = 1024;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''IP options''' <code> IP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Options for use with [gs]etsockopt at the IP level
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>IP_OPTIONS = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IP_MULTICAST_IF = 2;</code>
 +
| set/get IP multicast interface
 +
|-
 +
| <code>IP_MULTICAST_TTL = 3;</code>
 +
| set/get IP multicast timetolive
 +
|-
 +
| <code>IP_MULTICAST_LOOP  = 4;</code>
 +
| set/get IP multicast loopback
 +
|-
 +
| <code>IP_ADD_MEMBERSHIP = 5;</code>
 +
| add an IP group membership
 +
|-
 +
| <code>IP_DROP_MEMBERSHIP = 6;</code>
 +
| drop an IP group membership
 +
|-
 +
| <code>IP_TTL = 7;</code>
 +
| set/get IP Time To Live
 +
|-
 +
| <code>IP_TOS = 8;</code>
 +
| set/get IP Type Of Service
 +
|-
 +
| <code>IP_DONTFRAGMENT = 9;</code>
 +
| set/get IP Don't Fragment flag
 +
|-
 +
| <code>IP_HDRINCL = 10;</code>
 +
| set/get IP Header include
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>IP_DEFAULT_MULTICAST_TTL = 1;</code>
 +
| normally limit m'casts to 1 hop
 +
|-
 +
| <code>IP_DEFAULT_MULTICAST_LOOP = 1;</code>
 +
| normally hear sends if a member
 +
|-
 +
| <code>IP_MAX_MEMBERSHIPS = 20;</code>
 +
| per socket; must fit in one mbuf
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Socket type''' <code> SOCK_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SOCK_UNSPEC = 0;</code>
 +
| unspecified
 +
|-
 +
| <code>SOCK_STREAM = 1;</code>
 +
| stream socket
 +
|-
 +
| <code>SOCK_DGRAM = 2;</code>
 +
| datagram socket
 +
|-
 +
| <code>SOCK_RAW = 3;</code>
 +
| raw-protocol interface
 +
|-
 +
| <code>SOCK_RDM = 4;</code>
 +
| reliably-delivered message
 +
|-
 +
| <code>SOCK_SEQPACKET = 5;</code>
 +
| sequenced packet stream
 +
|-
 +
| <code>SOCK_PACKET = 10;</code>
 +
| linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Socket options''' <code> SO_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Option flags per-socket
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SO_DEBUG = $0001;</code>
 +
| turn on debugging info recording
 +
|-
 +
| <code>SO_ACCEPTCONN = $0002;</code>
 +
| socket has had listen()
 +
|-
 +
| <code>SO_REUSEADDR = $0004;</code>
 +
| allow local address reuse
 +
|-
 +
| <code>SO_KEEPALIVE = $0008;</code>
 +
| keep connections alive
 +
|-
 +
| <code>SO_DONTROUTE = $0010;</code>
 +
| just use interface addresses
 +
|-
 +
| <code>SO_BROADCAST = $0020;</code>
 +
| permit sending of broadcast msgs
 +
|-
 +
| <code>SO_USELOOPBACK  = $0040;</code>
 +
| bypass hardware when possible
 +
|-
 +
| <code>SO_LINGER = $0080;</code>
 +
| linger on close if data present
 +
|-
 +
| <code>SO_OOBINLINE = $0100;</code>
 +
| leave received OOB data in line
 +
|-
 +
| <code>SO_REUSEPORT = $0200;</code>
 +
| allow local address & port reuse
 +
|-
 +
| <code>SO_TIMESTAMP = $0400;</code>
 +
| timestamp received dgram traffic
 +
|-
 +
| <code>SO_ACCEPTFILTER = $1000;</code>
 +
| there is an accept filter
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>SO_DONTLINGER = not(SO_LINGER);</code>
 +
| ($ff7f)
 +
|-
 +
| <code>SO_EXCLUSIVEADDRUSE = not(SO_REUSEADDR);</code>
 +
| disallow local address reuse ($fffb)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Additional options''
 +
|-
 +
| <code>SO_SNDBUF = $1001;</code>
 +
| send buffer size
 +
|-
 +
| <code>SO_RCVBUF = $1002;</code>
 +
| receive buffer size
 +
|-
 +
| <code>SO_SNDLOWAT = $1003;</code>
 +
| send low-water mark
 +
|-
 +
| <code>SO_RCVLOWAT = $1004;</code>
 +
| receive low-water mark
 +
|-
 +
| <code>SO_SNDTIMEO = $1005;</code>
 +
| send timeout
 +
|-
 +
| <code>SO_RCVTIMEO = $1006;</code>
 +
| receive timeout
 +
|-
 +
| <code>SO_ERROR = $1007;</code>
 +
| get error status and clear
 +
|-
 +
| <code>SO_TYPE = $1008;</code>
 +
| get socket type
 +
|-
 +
| <code>SO_CONNTIMEO = $1009;</code>
 +
| connection timeout
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Options for connect and disconnect data and options. Used only by non-TCP/IP transports such as DECNet, OSI TP4, etc.''
 +
|-
 +
| <code>SO_CONNDATA = $7000;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_CONNOPT = $7001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_DISCDATA = $7002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_DISCOPT = $7003;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_CONNDATALEN = $7004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_CONNOPTLEN = $7005;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_DISCDATALEN = $7006;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_DISCOPTLEN = $7007;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Option for opening sockets for synchronous access''
 +
|-
 +
| <code>SO_OPENTYPE = $7008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_SYNCHRONOUS_ALERT = $10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_SYNCHRONOUS_NONALERT = $20;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Other NT-specific options''
 +
|-
 +
| <code>SO_MAXDG = $7009;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_MAXPATHDG = $700A;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_UPDATE_ACCEPT_CONTEXT = $700B;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SO_CONNECT_TIME = $700C;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''TCP options''' <code> TCP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TCP_NODELAY = $0001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TCP_MAXSEG = $0002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TCP_NOPUSH = $0004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TCP_NOOPT = $0008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TCP_BSDURGENT = $7000;</code>
 +
| Implement BSD Urgent instead of RFC793/1122
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>TCP_WSCALE = $0010;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TCP_NOSACK = $0020;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''UDP options''' <code> UDP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>UDP_NOCHECKSUM = $0001;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Address family''' <code> AF_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>AF_UNSPEC = 0;</code>
 +
| unspecified
 +
|-
 +
| <code>AF_UNIX = 1;</code>
 +
| local to host (pipes, portals)
 +
|-
 +
| <code>AF_INET = 2;</code>
 +
| internetwork: UDP, TCP, etc.
 +
|-
 +
| <code>AF_IMPLINK = 3;</code>
 +
| arpanet imp addresses
 +
|-
 +
| <code>AF_PUP = 4;</code>
 +
| pup protocols: e.g. BSP
 +
|-
 +
| <code>AF_CHAOS = 5;</code>
 +
| mit CHAOS protocols
 +
|-
 +
| <code>AF_IPX = 6;</code>
 +
| IPX and SPX
 +
|-
 +
| <code>AF_NS = 6;</code>
 +
| XEROX NS protocols
 +
|-
 +
| <code>AF_ISO = 7;</code>
 +
| ISO protocols
 +
|-
 +
| <code>AF_OSI = AF_ISO;</code>
 +
| OSI is ISO
 +
|-
 +
| <code>AF_ECMA = 8;</code>
 +
| european computer manufacturers
 +
|-
 +
| <code>AF_DATAKIT = 9;</code>
 +
| datakit protocols
 +
|-
 +
| <code>AF_CCITT = 10;</code>
 +
| CCITT protocols, X.25 etc
 +
|-
 +
| <code>AF_SNA = 11;</code>
 +
| IBM SNA
 +
|-
 +
| <code>AF_DECnet = 12;</code>
 +
| DECnet
 +
|-
 +
| <code>AF_DLI = 13;</code>
 +
| Direct data link interface
 +
|-
 +
| <code>AF_LAT = 14;</code>
 +
| LAT
 +
|-
 +
| <code>AF_HYLINK = 15;</code>
 +
| NSC Hyperchannel
 +
|-
 +
| <code>AF_APPLETALK = 16;</code>
 +
| AppleTalk
 +
|-
 +
| <code>AF_NETBIOS = 17;</code>
 +
| NetBios-style addresses
 +
|-
 +
| <code>AF_VOICEVIEW = 18;</code>
 +
| VoiceView
 +
|-
 +
| <code>AF_FIREFOX = 19;</code>
 +
| FireFox
 +
|-
 +
| <code>AF_UNKNOWN1 = 20;</code>
 +
| Somebody is using this!
 +
|-
 +
| <code>AF_BAN = 21;</code>
 +
| Banyan
 +
|-
 +
| <code>AF_ATM = 22;</code>
 +
| Native ATM Services
 +
|-
 +
| <code>AF_INET6 = 23;</code>
 +
| Internetwork Version 6
 +
|-
 +
| <code>AF_CLUSTER = 24;</code>
 +
| Microsoft Wolfpack
 +
|-
 +
| <code>AF_12844 = 25;</code>
 +
| IEEE 1284.4 WG AF
 +
|-
 +
| <code>AF_IRDA = 26;</code>
 +
| IrDA
 +
|-
 +
| <code>AF_NETDES = 28;</code>
 +
| Network Designers OSI & gateway enabled
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>AF_MAX = 29;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Protocol family''' <code> PF_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PF_UNSPEC = AF_UNSPEC;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>PF_UNIX = AF_UNIX;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_INET = AF_INET;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_IMPLINK = AF_IMPLINK;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_PUP = AF_PUP;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_CHAOS = AF_CHAOS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_NS = AF_NS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_IPX = AF_IPX;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_OSI = AF_OSI;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_ECMA = AF_ECMA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_DATAKIT = AF_DATAKIT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_CCITT = AF_CCITT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_SNA = AF_SNA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_DECnet = AF_DECnet;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_DLI = AF_DLI;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_LAT = AF_LAT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_HYLINK = AF_HYLINK;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_APPLETALK = AF_APPLETALK;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_VOICEVIEW = AF_VOICEVIEW;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_FIREFOX = AF_FIREFOX;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_UNKNOWN1 = AF_UNKNOWN1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_BAN = AF_BAN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_ATM = AF_ATM;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_INET6 = AF_INET6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_CLUSTER = AF_CLUSTER;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_12844 = AF_12844;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_IRDA = AF_IRDA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PF_NETDES = AF_NETDES;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>PF_MAX = AF_MAX;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Message flag''' <code> MSG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>MSG_OOB = $1;</code>
 +
| process out-of-band data
 +
|-
 +
| <code>MSG_PEEK = $2;</code>
 +
| peek at incoming message
 +
|-
 +
| <code>MSG_DONTROUTE = $4;</code>
 +
| send without using routing tables
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>MSG_INTERRUPT = $10;</code>
 +
| send/recv in the interrupt context
 +
|-
 +
| <code>MSG_MAXIOVLEN = 16;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>MSG_PARTIAL = $8000;</code>
 +
| partial send or recv for message xport
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Socket error''' <code> WSAE*, EAI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|All Windows Sockets error constants are biased by WSABASEERR from the "normal"
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSABASEERR = 10000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Windows Sockets definitions of regular Microsoft C error constants''
 +
|-
 +
| <code>WSAEINTR = (WSABASEERR+4);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEBADF = (WSABASEERR+9);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEACCES = (WSABASEERR+13);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEFAULT = (WSABASEERR+14);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEINVAL = (WSABASEERR+22);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEMFILE = (WSABASEERR+24);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Windows Sockets definitions of regular Berkeley error constants''
 +
|-
 +
| <code>WSAEWOULDBLOCK = (WSABASEERR+35);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEINPROGRESS = (WSABASEERR+36);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEALREADY = (WSABASEERR+37);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENOTSOCK = (WSABASEERR+38);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEDESTADDRREQ = (WSABASEERR+39);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEMSGSIZE = (WSABASEERR+40);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEPROTOTYPE = (WSABASEERR+41);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENOPROTOOPT = (WSABASEERR+42);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEPROTONOSUPPORT = (WSABASEERR+43);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAESOCKTNOSUPPORT = (WSABASEERR+44);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEOPNOTSUPP = (WSABASEERR+45);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEPFNOSUPPORT = (WSABASEERR+46);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEAFNOSUPPORT = (WSABASEERR+47);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEADDRINUSE = (WSABASEERR+48);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEADDRNOTAVAIL = (WSABASEERR+49);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENETDOWN = (WSABASEERR+50);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENETUNREACH = (WSABASEERR+51);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENETRESET = (WSABASEERR+52);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAECONNABORTED = (WSABASEERR+53);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAECONNRESET = (WSABASEERR+54);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENOBUFS = (WSABASEERR+55);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEISCONN = (WSABASEERR+56);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENOTCONN = (WSABASEERR+57);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAESHUTDOWN = (WSABASEERR+58);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAETOOMANYREFS = (WSABASEERR+59);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAETIMEDOUT = (WSABASEERR+60);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAECONNREFUSED = (WSABASEERR+61);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAELOOP = (WSABASEERR+62);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENAMETOOLONG = (WSABASEERR+63);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEHOSTDOWN = (WSABASEERR+64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEHOSTUNREACH = (WSABASEERR+65);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAENOTEMPTY = (WSABASEERR+66);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEPROCLIM = (WSABASEERR+67);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEUSERS = (WSABASEERR+68);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEDQUOT = (WSABASEERR+69);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAESTALE = (WSABASEERR+70);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEREMOTE = (WSABASEERR+71);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSAEDISCON = (WSABASEERR+101);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Extended Windows Sockets error constant definitions''
 +
|-
 +
| <code>WSASYSNOTREADY = (WSABASEERR+91);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAVERNOTSUPPORTED = (WSABASEERR+92);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSANOTINITIALISED = (WSABASEERR+93);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSAENOMORE = (WSABASEERR+102);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAECANCELLED = (WSABASEERR+103);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEINVALIDPROCTABLE = (WSABASEERR+104);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEINVALIDPROVIDER = (WSABASEERR+105);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEPROVIDERFAILEDINIT = (WSABASEERR+106);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSASYSCALLFAILURE = (WSABASEERR+107);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSASERVICE_NOT_FOUND = (WSABASEERR+108);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSATYPE_NOT_FOUND = (WSABASEERR+109);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_E_NO_MORE = (WSABASEERR+110);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_E_CANCELLED = (WSABASEERR+111);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSAEREFUSED = (WSABASEERR+112);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp; 
 +
|-
 +
|colspan="2"|Error return codes from gethostbyname() and gethostbyaddr() (when using the resolver). Note that these errors are retrieved via WSAGetLastError() and must therefore follow the rules for avoiding clashes with error numbers from specific implementations or language run-time systems. For this reason the codes are based at WSABASEERR+1001. Note also that [WSA]NO_ADDRESS is defined only for compatibility purposes.
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Authoritative Answer: Host not found''
 +
|-
 +
| <code>WSAHOST_NOT_FOUND = (WSABASEERR+1001);</code>
 +
| &nbsp;
 +
|-
 +
| <code>HOST_NOT_FOUND = WSAHOST_NOT_FOUND;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Non-Authoritative: Host not found, or SERVERFAIL''
 +
|-
 +
| <code>WSATRY_AGAIN = (WSABASEERR+1002);</code>
 +
| &nbsp;
 +
|-
 +
| <code>TRY_AGAIN = WSATRY_AGAIN;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Non recoverable errors, FORMERR, REFUSED, NOTIMP''
 +
|-
 +
| <code>WSANO_RECOVERY = (WSABASEERR+1003)</code>
 +
| &nbsp;
 +
|-
 +
| <code>NO_RECOVERY = WSANO_RECOVERY;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Valid name, no data record of requested type''
 +
|-
 +
| <code>WSANO_DATA = (WSABASEERR+1004);</code>
 +
| &nbsp;
 +
|-
 +
| <code>NO_DATA = WSANO_DATA;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''no address, look for MX record''
 +
|-
 +
| <code>WSANO_ADDRESS = WSANO_DATA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NO_ADDRESS = WSANO_ADDRESS;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''WinSock 2 extension -- new error codes and type definition''
 +
|-
 +
| <code>WSA_IO_PENDING = ERROR_IO_PENDING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_INVALID_HANDLE = ERROR_INVALID_HANDLE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_NOT_ENOUGH_MEMORY = ERROR_NOT_ENOUGH_MEMORY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_OPERATION_ABORTED = ERROR_OPERATION_ABORTED;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_INVALID_EVENT = WSAEVENT(nil);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAXIMUM_WAIT_EVENTS = MAXIMUM_WAIT_OBJECTS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_WAIT_FAILED = $ffffffff;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_WAIT_EVENT_0 = WAIT_OBJECT_0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_WAIT_IO_COMPLETION = WAIT_IO_COMPLETION;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_WAIT_TIMEOUT = WAIT_TIMEOUT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_INFINITE = INFINITE;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Windows Sockets errors redefined as regular Berkeley error constants. These are commented out in Windows NT to avoid conflicts with errno.h. Use the WSA constants instead.''
 +
|-
 +
| <code>EWOULDBLOCK = WSAEWOULDBLOCK;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EINPROGRESS = WSAEINPROGRESS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EALREADY = WSAEALREADY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOTSOCK = WSAENOTSOCK;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EDESTADDRREQ = WSAEDESTADDRREQ;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EMSGSIZE = WSAEMSGSIZE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EPROTOTYPE = WSAEPROTOTYPE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOPROTOOPT = WSAENOPROTOOPT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EPROTONOSUPPORT = WSAEPROTONOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EOPNOTSUPP = WSAEOPNOTSUPP;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EPFNOSUPPORT = WSAEPFNOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAFNOSUPPORT = WSAEAFNOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EADDRINUSE = WSAEADDRINUSE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EADDRNOTAVAIL = WSAEADDRNOTAVAIL;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENETDOWN = WSAENETDOWN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENETUNREACH = WSAENETUNREACH;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENETRESET = WSAENETRESET;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ECONNABORTED = WSAECONNABORTED;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ECONNRESET = WSAECONNRESET;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOBUFS = WSAENOBUFS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EISCONN = WSAEISCONN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOTCONN = WSAENOTCONN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ESHUTDOWN = WSAESHUTDOWN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ETOOMANYREFS = WSAETOOMANYREFS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ETIMEDOUT = WSAETIMEDOUT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ECONNREFUSED = WSAECONNREFUSED;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ELOOP = WSAELOOP;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENAMETOOLONG = WSAENAMETOOLONG;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EHOSTDOWN = WSAEHOSTDOWN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EHOSTUNREACH = WSAEHOSTUNREACH;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOTEMPTY = WSAENOTEMPTY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EPROCLIM = WSAEPROCLIM;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EUSERS = WSAEUSERS;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EDQUOT = WSAEDQUOT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ESTALE = WSAESTALE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EREMOTE = WSAEREMOTE;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ENOTREADY = WSASYSNOTREADY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EVERNOTSUPPORTED = WSAVERNOTSUPPORTED;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ENOTINITIALISED = WSANOTINITIALISED;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
|colspan="2"|''Error codes from getaddrinfo()''
 +
|-
 +
| <code>EAI_AGAIN = WSATRY_AGAIN;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_BADFLAGS = WSAEINVAL;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_FAIL = WSANO_RECOVERY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_FAMILY = WSAEAFNOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_MEMORY = WSA_NOT_ENOUGH_MEMORY;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_NODATA = WSANO_DATA;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_NONAME = WSAHOST_NOT_FOUND;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_SERVICE = WSATYPE_NOT_FOUND;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EAI_SOCKTYPE = WSAESOCKTNOSUPPORT;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>EAI_NODATA = EAI_NONAME;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Shutdown options''' <code> SD_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SD_RECEIVE = $00;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>SD_SEND = $01;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SD_BOTH = $02;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''WsControlEx options''' <code> WSA_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Global Socket constants for undocumented Winsock functions
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_MAX_INTERFACE_NAME_LEN = 256;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>WSA_ANY_SIZE = 1;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_MAX_ADAPTER_NAME = 128;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_MAX_ADAPTER_DESCRIPTION_LENGTH = 128;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAX_ADAPTER_NAME_LENGTH = 256;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAX_ADAPTER_ADDRESS_LENGTH = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAX_HOSTNAME_LEN = 128;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAX_DOMAIN_NAME_LEN = 128;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAX_SCOPE_ID_LEN = 256;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_MAXLEN_IFDESCR = 256;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_MAXLEN_PHYSADDR = 8;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_USE_CURRENT_TTL = DWORD(-1);</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_USE_CURRENT_FORWARDING = DWORD(-1);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_NON_OPERATIONAL = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_UNREACHABLE = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_DISCONNECTED = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_CONNECTING = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_CONNECTED = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_OPER_STATUS_OPERATIONAL = 5;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IF_TYPE_OTHER = 1;</code>
 +
| Some other type of network interface
 +
|-
 +
| <code>WSA_IF_TYPE_ETHERNET_CSMACD = 6;</code>
 +
| An Ethernet network interface
 +
|-
 +
| <code>WSA_IF_TYPE_ISO88025_TOKENRING = 9;</code>
 +
| A token ring network interface
 +
|-
 +
| <code>WSA_IF_TYPE_FDDI = 15;</code>
 +
| A Fiber Distributed Data Interface (FDDI) network interface
 +
|-
 +
| <code>WSA_IF_TYPE_PPP = 23;</code>
 +
| A PPP network interface
 +
|-
 +
| <code>WSA_IF_TYPE_SOFTWARE_LOOPBACK = 24;</code>
 +
| A software loopback network interface
 +
|-
 +
| <code>WSA_IF_TYPE_SLIP = 28;</code>
 +
| A SLIP network interface
 +
|-
 +
| <code>WSA_IF_TYPE_ATM = 37;</code>
 +
| An ATM network interface
 +
|-
 +
| <code>WSA_IF_TYPE_IEEE80211 = 71;</code>
 +
| An IEEE 802.11 wireless network interface
 +
|-
 +
| <code>WSA_IF_TYPE_TUNNEL = 131;</code>
 +
| A tunnel type encapsulation network interface
 +
|-
 +
| <code>WSA_IF_TYPE_IEEE1394 = 144;</code>
 +
| An IEEE 1394 (Firewire) high performance serial bus network interface
 +
|-
 +
| <code>WSA_IF_TYPE_IEEE80216_WMAN = 237;</code>
 +
| A mobile broadband interface for WiMax devices
 +
|-
 +
| <code>WSA_IF_TYPE_WWANPP = 243;</code>
 +
| A mobile broadband interface for GSM-based devices
 +
|-
 +
| <code>WSA_IF_TYPE_WWANPP2 = 244;</code>
 +
| A mobile broadband interface for CDMA-based devices
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IF_ADMIN_STATUS_UP = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_ADMIN_STATUS_DOWN = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IF_ADMIN_STATUS_TESTING = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_CLOSED = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_LISTEN = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_SYN_SENT = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_SYN_RCVD = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_ESTAB = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_FIN_WAIT1 = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_FIN_WAIT2 = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_CLOSE_WAIT = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_CLOSING = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_LAST_ACK = 10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_TIME_WAIT = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_TCP_STATE_DELETE_TCB = 12;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IP_FORWARDING = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IP_NOT_FORWARDING = 2;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IPROUTE_TYPE_OTHER = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPROUTE_TYPE_INVALID = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPROUTE_TYPE_DIRECT = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPROUTE_TYPE_INDIRECT = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPROUTE_METRIC_UNUSED = DWORD(-1);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_OTHER = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_LOCAL = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_NETMGMT = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_ICMP = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_EGP = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_GGP = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_HELLO = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_RIP = 8;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_IS_IS = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_ES_IS = 10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_CISCO = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_BBN = 12;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_OSPF = 13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_BGP = 14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_NT_AUTOSTATIC = 10002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_NT_STATIC = 10006;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPPROTO_NT_STATIC_NON_DOD = 10007;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_IPNET_TYPE_OTHER = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPNET_TYPE_INVALID = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPNET_TYPE_DYNAMIC = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPNET_TYPE_STATIC = 4;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_GETNUMBEROFINTERFACES = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETIFENTRY = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETIFTABLE = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETIPADDRTABLE = 4;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETIPNETTABLE = 5;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETIPFORWARDTABLE = 6;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETTCPTABLE = 7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETUDPTABLE = 8;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_GETIPSTATISTICS = 9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETICMPSTATISTICS = 10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETTCPSTATISTICS = 11;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETUDPSTATISTICS = 12;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_SETIFENTRY = 13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_CREATEIPFORWARDENTRY = 14;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_SETIPFORWARDENTRY = 15;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_DELETEIPFORWARDENTRY = 16;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_SETIPSTATISTICS = 17;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_SETIPTTL = 18;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_CREATEIPNETENTRY = 19;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_SETIPNETENTRY = 20;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_DELETEIPNETENTRY = 21;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_FLUSHIPNETTABLE = 22;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_CREATEPROXYARPENTRY = 23;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_DELETEPROXTARPENTRY = 24;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_SETTCPENTRY = 25;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETINTERFACEINFO = 26;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETUNIDIRECTIONALADAPTERINFO = 27;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>WSA_GETBESTINTERFACE = 28;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETBESTROUTE = 29;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_NOTIFYADDRCHANGE = 30;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_NOTIFYROUTECHANGE = 31;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETADAPTERINDEX = 32;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_ADDIPADDRESS = 33;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_DELETEIPADDRESS = 34;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETNETWORKPARAMS = 35;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETADAPTERSINFO = 36;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETPERADAPTERINFO = 37;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPRELEASEADDRESS = 38;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_IPRENEWADDRESS = 39;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_SENDARP = 40;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETRTTANDHOPCOUNT = 41;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_GETFRIENDLYIFINDEX = 42;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_ENABLEROUTER = 43;</code>
 +
| &nbsp;
 +
|-
 +
| <code>WSA_UNENABLEROUTER = 44;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Address info flag''' <code> AI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Flags used in "hints" argument to getaddrinfo()
 +
|-
 +
|colspan="2"|Note: Under Linux these values may be different
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>AI_PASSIVE = $00000001;</code>
 +
| Socket address will be used in bind() call
 +
|-
 +
| <code>AI_CANONNAME = $00000002;</code>
 +
| Return canonical name from DNS in the first ai_canonname (Cannot be used with AI_FQDN)
 +
|-
 +
| <code>AI_NUMERICHOST = $00000004;</code>
 +
| Nodename must be a numeric address string
 +
|-
 +
| <code>AI_NUMERICSERV = $00000008;</code>
 +
| Servicename must be a numeric port string
 +
|-
 +
| <code>AI_ALL = $00000100;</code>
 +
| Return both IPv6 and IPv4 addresses
 +
|-
 +
| <code>AI_ADDRCONFIG = $00000400;</code>
 +
| Only return addresses if a global address is configured (IPv4 or IPv6), loopback addresses do not count as global.
 +
|-
 +
| <code>AI_V4MAPPED = $00000800;</code>
 +
| Map returned IPv4 addresses to IPv6 address format
 +
|-
 +
| <code>AI_NON_AUTHORITATIVE = $00004000;</code>
 +
| Allow both autoritive and non authoritive return addresses (NS_EMAIL only)
 +
|-
 +
| <code>AI_SECURE = $00008000;</code>
 +
| Obtain result using enhanced security only (NS_EMAIL only)
 +
|-
 +
| <code>AI_RETURN_PREFERRED_NAMES = $00010000;</code>
 +
| Return preferred names (NS_EMAIL only)
 +
|-
 +
| <code>AI_FQDN = $00020000;</code>
 +
| Return the FQDN for the single name specified on NodeName (Cannot be used with AI_CANONNAME)
 +
|-
 +
| <code>AI_FILESERVER = $00040000;</code>
 +
| The requested name is being used for file sharing (Hint Only)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;">
 +
<div style="font-size: 14px; padding-left: 12px;">'''Name info flag''' <code> NI_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Flags for getnameinfo()
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NI_NOFQDN = $01;</code>
 +
| Only return nodename portion for local hosts
 +
|-
 +
| <code>NI_NUMERICHOST = $02;</code>
 +
| Return numeric form of the host's address
 +
|-
 +
| <code>NI_NAMEREQD = $04;</code>
 +
| Error if the host's name not in DNS
 +
|-
 +
| <code>NI_NUMERICSERV = $08;</code>
 +
| Return numeric form of the service (port #)
 +
|-
 +
| <code>NI_DGRAM = $10;</code>
 +
| Service is a datagram service
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NI_MAXHOST = 1025;</code>
 +
| Max size of a fully-qualified domain name
 +
|-
 +
| <code>NI_MAXSERV = 32;</code>
 +
| Max size of a service name
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Integer types'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>tOS_INT = LongInt;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>tOS_UINT = DWORD;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>ptOS_INT = ^tOS_INT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>ptOS_UINT = ^tOS_UINT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>u_int = tOS_UINT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pu_int = ^u_int;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Character types'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>u_char = Char;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pu_char = ^u_char;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Numeric types'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>u_short = Word;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pu_short = ^u_short;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>u_long = DWORD;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>pu_long = ^u_long;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Socket types'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TSocket = GlobalTypes.TSocket;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''WSA event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>WSAEVENT = GlobalTypes.WSAEVENT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>PWSAEVENT = ^WSAEVENT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>LPWSAEVENT = PWSAEVENT;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''MB character'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>PMBChar = PChar;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''FD set'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TFDSet = fdset;</code>
 +
 
 +
<code>PFDSet = ^TFDSet;</code>
 +
 
 +
<code>fdset = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>fd_count: u_int;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>fd_array: array[0..FD_SETSIZE-1] of TSocket;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Time value'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TTimeVal = timeval;</code>
 +
 
 +
<code>PTimeVal = ^TTimeVal;</code>
 +
 
 +
<code>timeval = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>tv_sec: LongInt;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>tv_usec: LongInt;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Host entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>THostEnt = hostent;</code>
 +
 
 +
<code>PHostEnt = ^THostEnt;</code>
 +
 
 +
<code>hostent = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>h_name: PChar;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>h_aliases: ^PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>h_addrtype: Smallint;</code>
 +
| &nbsp;
 +
|-
 +
| <code>h_length: Smallint;</code>
 +
| &nbsp;
 +
|-
 +
| <code>case Byte of</code>
 +
| &nbsp;
 +
|-
 +
| <code>0: (h_addr_list: ^PChar);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1: (h_addr: ^PChar)</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Network entry''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TNetEnt = netent;</code>
 +
 
 +
<code>PNetEnt = ^TNetEnt;</code>
 +
 
 +
<code>netent = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>n_name: PChar;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>n_aliases: ^PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>n_addrtype: Smallint;</code>
 +
| &nbsp;
 +
|-
 +
| <code>n_net: u_long;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''Service entry''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TServEnt = servent;</code>
 +
 
 +
<code>PServEnt = ^TServEnt;</code>
 +
 
 +
<code>servent = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>s_name: PChar;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>s_aliases: ^PChar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>s_port: Smallint;</code>
 +
| &nbsp;
 +
|-
 +
| <code>s_proto: PChar;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''Protocol entry''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TProtoEnt = protoent;</code>
 +
 
 +
<code>PProtoEnt = ^TProtoEnt;</code>
 +
 
 +
<code>protoent = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>p_name: PChar;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>p_aliases: ^Pchar;</code>
 +
| &nbsp;
 +
|-
 +
| <code>p_proto: Smallint;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Address types'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>SunB = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>s_b1, s_b2, s_b3, s_b4: u_char;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>SunW = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>s_w1, s_w2: u_short;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''IPv4 address'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TInAddr = in_addr;</code>
 +
 
 +
<code>PInAddr = ^TInAddr;</code>
 +
 
 +
<code>in_addr = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>case integer of</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>0: (S_un_b: SunB);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1: (S_un_w: SunW);</code>
 +
| &nbsp;
 +
|-
 +
| <code>2: (S_addr: u_long);</code>
 +
| &nbsp;
 +
|-
 +
| <code>3: (S_bytes: packed array[1..4] of Byte);</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''IPv6 address'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TIn6Addr = in6_addr;</code>
 +
 
 +
<code>PIn6Addr = ^TIn6Addr;</code>
 +
 
 +
<code>in6_addr = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: IPv6 version of above
 +
|-
 +
| <code>case byte of</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>0: (u6_addr8 : array[0..15] of byte);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1: (u6_addr16 : array[0..7] of Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>2: (u6_addr32 : array[0..3] of Cardinal);</code>
 +
| &nbsp;
 +
|-
 +
| <code>3: (s6_addr8 : array[0..15] of shortint);</code>
 +
| &nbsp;
 +
|-
 +
| <code>4: (s6_addr : array[0..15] of shortint);</code>
 +
| &nbsp;
 +
|-
 +
| <code>5: (s6_addr16 : array[0..7] of smallint);</code>
 +
| &nbsp;
 +
|-
 +
| <code>6: (s6_addr32 : array[0..3] of LongInt);</code>
 +
| &nbsp;
 +
|-
 +
| <code>case integer of</code>
 +
| &nbsp;
 +
|-
 +
| <code>0: (S6_u8: array[0..15] of u_char);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1: (S6_u32: array[0..3] of u_int);</code>
 +
| &nbsp;
 +
|-
 +
| <code>2: (S6_u64: array[0..1] of Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>S6_addr: array [0..15] of Byte;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''IPX address'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TIpxAddr = ipx_addr;</code>
 +
 
 +
<code>PIpxAddr = ^TIpxAddr;</code>
 +
 
 +
<code>ipx_addr = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: IPX version of above
 +
|-
 +
| <code>S_net: array [0..3] of Byte;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>S_node: array [0..5] of Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>S_socket: Word;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''Socket address IPv4'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TSockAddrIn = sockaddr_in;</code>
 +
 
 +
<code>PSockAddrIn = ^TSockAddrIn;</code>
 +
 
 +
<code>sockaddr_in = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>case Integer of</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>0: (sin_family: u_short;</code>
 +
| &nbsp;
 +
|-
 +
| <code>sin_port: u_short;</code>
 +
| &nbsp;
 +
|-
 +
| <code>sin_addr: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>sin_zero: array[0..7] of Char);</code>
 +
| &nbsp;
 +
|-
 +
| <code>1: (sa_family: u_short;</code>
 +
| &nbsp;
 +
|-
 +
| <code>sa_data: array[0..13] of Char)</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>  
 +
 
 +
'''Socket address IPv6'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TSockAddr6 = sockaddr_in6;</code>
 +
 
 +
<code>PSOCKADDR6 = ^TSockAddr6;</code>
 +
 
 +
<code>TSockAddrIn6 = sockaddr_in6;</code>
 +
 
 +
<code>PSockAddrIn6 = ^TSockAddrIn6;</code>
 +
 
 +
<code>sockaddr_in6 = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: IPv6 version of above
 +
|-
 +
| <code>sin6_family: u_short;</code>
 +
| AF_INET6
 +
|-
 +
| <code>sin6_port: u_short;</code>
 +
| transport layer port #
 +
|-
 +
| <code>sin6_flowinfo: u_int;</code>
 +
| IPv6 flow information
 +
|-
 +
| <code>sin6_addr: in6_addr;</code>
 +
| IPv6 address
 +
|-
 +
| <code>sin6_scope_id: u_int;</code>
 +
| set of interfaces for a scope
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Socket address IPX'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TSockAddrIpx = sockaddr_ipx;</code>
 +
 
 +
<code>PSockAddrIpx = ^TSockAddrIpx;</code>
 +
 
 +
<code>sockaddr_ipx = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: IPX version of above
 +
|-
 +
| <code>sipx_family: u_short;</code>
 +
| AF_IPX
 +
|-
 +
| <code>sipx_addr: ipx_addr;</code>
 +
| IPX address
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Socket address'''
 +
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>PSOCKADDR = ^TSockAddr;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>TSockAddr = sockaddr_in;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Socket protocol'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TSockProto = sockproto;</code>
 +
 
 +
<code>PSockProto = ^TSockProto;</code>
 +
 
 +
<code>sockproto = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Structure used by kernel to pass protocol information in raw sockets
 +
|-
 +
| <code>sp_family: u_short;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>sp_protocol: u_short;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Linger'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TLinger = linger;</code>
 +
 
 +
<code>PLinger = ^TLinger;</code>
 +
 
 +
<code>linger = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Structure used for manipulating linger option
 +
|-
 +
| <code>l_onoff: u_short;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>l_linger: u_short;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA data''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAData = WSAData;</code>
 +
 
 +
<code>PWSAData = ^TWSAData;</code>
 +
 
 +
<code>WSAData = record </code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Also WSDATA
 +
|-
 +
| <code>wVersion: Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>wHighVersion: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>szDescription: array[0..WSADESCRIPTION_LEN] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>iMaxSockets: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>iMaxUdpDg: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>lpVendorInfo: PChar;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''Transmit file buffers''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TTransmitFileBuffers = _TRANSMIT_FILE_BUFFERS;</code>
 +
 
 +
<code>TRANSMIT_FILE_BUFFERS = _TRANSMIT_FILE_BUFFERS;</code>
 +
 
 +
<code>PTransmitFileBuffers = ^TTransmitFileBuffers;</code>
 +
 
 +
<code>_TRANSMIT_FILE_BUFFERS = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Head: Pointer;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>HeadLength: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Tail: Pointer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TailLength: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Multicast request'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TMulticastRequest = ip_mreq;</code>
 +
 
 +
<code>PMulticastRequest = ^TMulticastRequest;</code>
 +
 
 +
<code>ip_mreq = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP
 +
|-
 +
| <code>IMRMultiAddr : TInAddr;</code>
 +
| IP multicast address of group
 +
|-
 +
| <code>IMRInterface : TInAddr;</code>
 +
| local IP address of interface
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA interface row'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIfRow = WSA_IFROW;</code>
 +
 
 +
<code>PWSAIfRow = PWSA_IFROW;</code>
 +
 
 +
<code>PWSA_IFROW = ^WSA_IFROW;</code>
 +
 
 +
<code>WSA_IFROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Structures for WsControlEx (Note: Must be same as IP Helper)
 +
|-
 +
| <code>wszName: array [0..WSA_MAX_INTERFACE_NAME_LEN - 1] of WideChar;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwIndex: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwType: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwMtu: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwSpeed: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwPhysAddrLen: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>bPhysAddr: array [0..WSA_MAXLEN_PHYSADDR - 1] of Byte;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwAdminStatus: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOperStatus: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwLastChange: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInOctets: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInUcastPkts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInNUcastPkts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInDiscards: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInUnknownProtos: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutOctets: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutUcastPkts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutNUcastPkts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutDiscards: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutQLen: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwDescrLen: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>bDescr: array[0..WSA_MAXLEN_IFDESCR - 1] of Byte;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''WSA interface table''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIftable = WSA_IFTABLE;</code>
 +
 
 +
<code>PWSAIftable = PWSA_IFTABLE;</code>
 +
 
 +
<code>PWSA_IFTABLE = ^WSA_IFTABLE;</code>
 +
 
 +
<code>WSA_IFTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_IFROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA ICMP statistics'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIcmpStats = WSAICMPSTATS;</code>
 +
 
 +
<code>PWSAIcmpStats = ^TWSAIcmpStats;</code>
 +
 
 +
<code>WSAICMPSTATS = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwMsgs: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwDestUnreachs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwTimeExcds: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwParmProbs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwSrcQuenchs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRedirects: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwEchos: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwEchoReps: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwTimestamps: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwTimestampReps: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwAddrMasks: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwAddrMaskReps: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA ICMP information'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIcmpInfo = WSAICMPINFO;</code>
 +
 
 +
<code>PWSAIcmpInfo = ^TWSAIcmpInfo;</code>
 +
 
 +
<code>WSAICMPINFO = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>icmpInStats: WSAICMPSTATS;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>icmpOutStats: WSAICMPSTATS;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA ICMP'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIcmp = WSA_ICMP;</code>
 +
 
 +
<code>PWSAIcmp = PWSA_ICMP;</code>
 +
 
 +
<code>PWSA_ICMP = ^WSA_ICMP;</code>
 +
 
 +
<code>WSA_ICMP = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>stats: WSAICMPINFO;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA UDP statistics'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAUdpStats = WSA_UDPSTATS;</code>
 +
 
 +
<code>PWSAUdpStats = PWSA_UDPSTATS;</code>
 +
 
 +
<code>PWSA_UDPSTATS = ^WSA_UDPSTATS;</code>
 +
 
 +
<code>WSA_UDPSTATS = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwInDatagrams: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwNoPorts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutDatagrams: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwNumAddrs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA UDP row'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAUdpRow = WSA_UDPROW;</code>
 +
 
 +
<code>PWSAUdpRow = PWSA_UDPROW;</code>
 +
 
 +
<code>PWSA_UDPROW = ^WSA_UDPROW;</code>
 +
 
 +
<code>WSA_UDPROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwLocalAddr: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwLocalPort: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA UDP table'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAUdpTable = WSA_UDPTABLE;</code>
 +
 
 +
<code>PWSAUdpTable = PWSA_UDPTABLE;</code>
 +
 
 +
<code>PWSA_UDPTABLE = ^WSA_UDPTABLE;</code>
 +
 
 +
<code>WSA_UDPTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_UDPROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''WSA TCP statistics '''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSATcpStats = WSA_TCPSTATS;</code>
 +
 
 +
<code>PWSATcpStats = PWSA_TCPSTATS;</code>
 +
 
 +
<code>PWSA_TCPSTATS = ^WSA_TCPSTATS;</code>
 +
 
 +
<code>WSA_TCPSTATS = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwRtoAlgorithm: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwRtoMin: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRtoMax: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwMaxConn: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwActiveOpens: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwPassiveOpens: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwAttemptFails: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwEstabResets: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwCurrEstab: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInSegs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutSegs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRetransSegs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInErrs: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutRsts: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwNumConns: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA TCP row'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSATcpRow = WSA_TCPROW;</code>
 +
 
 +
<code>PWSATcpRow = PWSA_TCPROW;</code>
 +
 
 +
<code>PWSA_TCPROW = ^WSA_TCPROW;</code>
 +
 
 +
<code>WSA_TCPROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwState: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwLocalAddr: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwLocalPort: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRemoteAddr: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRemotePort: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA TCP table'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSATcpTable = WSA_TCPTABLE;</code>
 +
 
 +
<code>PWSATcpTable = PWSA_TCPTABLE;</code>
 +
 
 +
<code>PWSA_TCPTABLE = ^WSA_TCPTABLE;</code>
 +
 
 +
<code>WSA_TCPTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_TCPROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP statistics''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpStats = WSA_IPSTATS;</code>
 +
 
 +
<code>PWSAIpStats = PWSA_IPSTATS;</code>
 +
 
 +
<code>PWSA_IPSTATS = ^WSA_IPSTATS;</code>
 +
 
 +
<code>WSA_IPSTATS = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwForwarding: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwDefaultTTL: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInReceives: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInHdrErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInAddrErrors: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwDatagrams: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInUnknownProtos: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInDiscards: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwInDelivers: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutRequests: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwRoutingDiscards: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutDiscards: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwOutNoRoutes: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwReasmTimeout: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwReasmReqds: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwReasmOks: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwReasmFails: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwFragOks: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwFragFails: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwFragCreates: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwNumIf: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwNumAddr: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwNumRoutes: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA IP address row''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpAddrRow = WSA_IPADDRROW;</code>
 +
 
 +
<code>PWSAIpAddrRow = PWSA_IPADDRROW;</code>
 +
 
 +
<code>PWSA_IPADDRROW = ^WSA_IPADDRROW;</code>
 +
 
 +
<code>WSA_IPADDRROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwAddr: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwIndex: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwMask: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwBCastAddr: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwReasmSize: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>unused1: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>unused2: Word;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA IP address table''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpAddrTable = WSA_IPADDRTABLE;</code>
 +
 
 +
<code>PWSAIpAddrTable = PWSA_IPADDRTABLE;</code>
 +
 
 +
<code>PWSA_IPADDRTABLE = ^WSA_IPADDRTABLE;</code>
 +
 
 +
<code>WSA_IPADDRTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_IPADDRROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP forward number'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpForwardNumber = WSA_IPFORWARDNUMBER;</code>
 +
 
 +
<code>PWSAIpForwardNumber = PWSA_IPFORWARDNUMBER;</code>
 +
 
 +
<code>PWSA_IPFORWARDNUMBER = ^WSA_IPFORWARDNUMBER;</code>
 +
 
 +
<code>WSA_IPFORWARDNUMBER = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwValue: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP forward row'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpForwardRow = WSA_IPFORWARDROW;</code>
 +
 
 +
<code>PWSAIpForwardRow = PWSA_IPFORWARDROW;</code>
 +
 
 +
<code>PWSA_IPFORWARDROW = ^WSA_IPFORWARDROW;</code>
 +
 
 +
<code>WSA_IPFORWARDROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwForwardDest: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwForwardMask: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardPolicy: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardNextHop: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardIfIndex: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardType: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardProto: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardAge: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardNextHopAS: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardMetric1: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardMetric2: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardMetric3: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardMetric4: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwForwardMetric5: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP forward table'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpForwardTable = WSA_IPFORWARDTABLE;</code>
 +
 
 +
<code>PWSAIpForwardTable = PWSA_IPFORWARDTABLE;</code>
 +
 
 +
<code>PWSA_IPFORWARDTABLE = ^WSA_IPFORWARDTABLE;</code>
 +
 
 +
<code>WSA_IPFORWARDTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_IPFORWARDROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP net row'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpNetRow = WSA_IPNETROW;</code>
 +
 
 +
<code>PWSAIpNetRow = PWSA_IPNETROW;</code>
 +
 
 +
<code>PWSA_IPNETROW = ^WSA_IPNETROW;</code>
 +
 
 +
<code>WSA_IPNETROW = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwIndex: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>dwPhysAddrLen: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>bPhysAddr: array [0..WSA_MAXLEN_PHYSADDR - 1] of BYTE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwAddr: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>dwType: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''WSA IP net table''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpNetTable = WSA_IPNETTABLE;</code>
 +
 
 +
<code>PWSAIpNetTable = PWSA_IPNETTABLE;</code>
 +
 
 +
<code>PWSA_IPNETTABLE = ^WSA_IPNETTABLE;</code>
 +
 
 +
<code>WSA_IPNETTABLE = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>dwNumEntries: DWORD;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>table: array [0..WSA_ANY_SIZE - 1] of WSA_IPNETROW;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA IP adapter index map''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpAdapterIndexMap = WSA_IP_ADAPTER_INDEX_MAP;</code>
 +
 
 +
<code>PWSAIpAdapterIndexMap = PWSA_IP_ADAPTER_INDEX_MAP;</code>
 +
 
 +
<code>PWSA_IP_ADAPTER_INDEX_MAP = ^WSA_IP_ADAPTER_INDEX_MAP;</code>
 +
 
 +
<code>WSA_IP_ADAPTER_INDEX_MAP = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Index: ULONG;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Name: array [0..WSA_MAX_ADAPTER_NAME - 1] of WideChar;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA IP interface information''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpInterfaceInfo = WSA_IP_INTERFACE_INFO;</code>
 +
 
 +
<code>PWSAIpInterfaceInfo = PWSA_IP_INTERFACE_INFO;</code>
 +
 
 +
<code>PWSA_IP_INTERFACE_INFO = ^WSA_IP_INTERFACE_INFO;</code>
 +
 
 +
<code>WSA_IP_INTERFACE_INFO = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>NumAdapters: DWORD;</code>
 +
| LongInt
 +
|-
 +
| <code>Adapter: array [0..0] of WSA_IP_ADAPTER_INDEX_MAP;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA IP address string''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PWSA_IP_ADDRESS_STRING = ^WSA_IP_ADDRESS_STRING;</code>
 +
 
 +
<code>WSA_IP_MASK_STRING = WSA_IP_ADDRESS_STRING;</code>
 +
 
 +
<code>TWSAIpAddressString = WSA_IP_ADDRESS_STRING;</code>
 +
 
 +
<code>PWSAIpAddressString = PWSA_IP_MASK_STRING;</code>
 +
 
 +
<code>PWSA_IP_MASK_STRING = ^WSA_IP_MASK_STRING;</code>
 +
 
 +
<code>WSA_IP_ADDRESS_STRING = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>S: array [0..15] of Char;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA IP address string''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpAddrString = WSA_IP_ADDR_STRING;</code>
 +
 
 +
<code>PWSAIpAddrString = PWSA_IP_ADDR_STRING;</code>
 +
 
 +
<code>PWSA_IP_ADDR_STRING = ^WSA_IP_ADDR_STRING;</code>
 +
 
 +
<code>WSA_IP_ADDR_STRING = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Next: PWSA_IP_ADDR_STRING;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>IpAddress: WSA_IP_ADDRESS_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IpMask: WSA_IP_MASK_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Context: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA IP adapter information''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAIpAdapterInfo = WSA_IP_ADAPTER_INFO;</code>
 +
 
 +
<code>PWSAIpAdapterInfo = PWSA_IP_ADAPTER_INFO;</code>
 +
 
 +
<code>PWSA_IP_ADAPTER_INFO = ^WSA_IP_ADAPTER_INFO;</code>
 +
 
 +
<code>WSA_IP_ADAPTER_INFO = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>Next: PWSA_IP_ADAPTER_INFO;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>ComboIndex: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterName: array [0..WSA_MAX_ADAPTER_NAME_LENGTH + 3] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Description: array [0..WSA_MAX_ADAPTER_DESCRIPTION_LENGTH + 3] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AddressLength: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Address: array [0..WSA_MAX_ADAPTER_ADDRESS_LENGTH - 1] of BYTE;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Index: DWORD;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Type_: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DhcpEnabled: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>CurrentIpAddress: PWSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>IpAddressList: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>GatewayList: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DhcpServer: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>HaveWins: BOOL;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PrimaryWinsServer: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>SecondaryWinsServer: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>LeaseObtained: time_t;</code>
 +
| &nbsp;
 +
|-
 +
| <code>LeaseExpires: time_t;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA fixed information''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAFixedInfo = WSA_FIXED_INFO;</code>
 +
 
 +
<code>PWSAFixedInfo = PWSA_FIXED_INFO;</code>
 +
 
 +
<code>PWSA_FIXED_INFO = ^WSA_FIXED_INFO;</code>
 +
 
 +
<code>WSA_FIXED_INFO = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>HostName: array [0..WSA_MAX_HOSTNAME_LEN + 3] of Char;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>DomainName: array[0..WSA_MAX_DOMAIN_NAME_LEN + 3] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>CurrentDnsServer: PWSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>DnsServerList: WSA_IP_ADDR_STRING;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NodeType: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ScopeId: array [0..WSA_MAX_SCOPE_ID_LEN + 3] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EnableRouting: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EnableProxy: UINT;</code>
 +
| &nbsp;
 +
|-
 +
| <code>EnableDns: UINT;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''Net to address'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>PNetToAddr = ^TNetToAddr;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>TNetToAddr = array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''WSA binding'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSABinding = WSABinding;</code>
 +
 
 +
<code>PWSABinding = ^TWSABinding;</code>
 +
 
 +
<code>WSABinding = record </code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Binding (Address)
 +
|-
 +
| <code>Version: Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>ConfigType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigServer: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingAddress: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingNetmask: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingGateway: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextBinding: PWSABinding;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA provider''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAProvider = WSAProvider;</code>
 +
 
 +
<code>PWSAProvider = ^TWSAProvider;</code>
 +
 
 +
<code>WSAProvider = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Provider (Transport)
 +
|-
 +
| <code>Version: Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>TransportFamily: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransportType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransportHandle: Pointer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigServer: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProviderAddress: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProviderNetmask: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProviderGateway: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProviderName: array[0..MAX_NAME_SIZE] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextProvider: PWSAProvider;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA interface''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAInterface = WSAInterface;</code>
 +
 
 +
<code>PWSAInterface = ^TWSAInterface;</code>
 +
 
 +
<code>WSAInterface = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Interface (Adapter)
 +
|-
 +
| <code>Version: Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>AdapterType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterInt: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterPort: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterName: array[0..MAX_NAME_SIZE] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterHandle: Pointer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FirstProvider: PWSAProvider;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextInterface: PWSAInterface;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA configuration''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAConfig = WSAConfig;</code>
 +
 
 +
<code>PWSAConfig = ^TWSAConfig;</code>
 +
 
 +
<code>WSAConfig = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: General Network Configuration
 +
|-
 +
| <code>Version: Word;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Hostname: array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Namesuffix: array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Nameservers: array[0..MAX_NAME_SERVERS - 1] of TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FirstInterface: PWSAInterface;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA network binding''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAExtendedBinding = WSAExtendedBinding;</code>
 +
 
 +
<code>PWSAExtendedBinding = ^TWSAExtendedBinding;</code>
 +
 
 +
<code>WSAExtendedBinding = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Binding (Address)
 +
|-
 +
| <code>Size: LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Version: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigServer: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigServer6: TIn6Addr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigInitDelay: LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigRetryCount: LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ConfigRetryTimeout: LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingAddress: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingNetmask: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingGateway: TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingAddress6: TIn6Addr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingNetmask6: TIn6Addr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>BindingGateway6: TIn6Addr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Namesuffix: array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Nameservers: array[0..MAX_NAME_SERVERS - 1] of TInAddr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Nameservers6: array[0..MAX_NAME_SERVERS - 1] of TIn6Addr;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextBinding: PWSAExtendedBinding;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA network provider''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAExtendedProvider = WSAExtendedProvider;</code>
 +
 
 +
<code>PWSAExtendedProvider = ^TWSAExtendedProvider;</code>
 +
 
 +
<code>WSAExtendedProvider = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Provider (Transport)
 +
|-
 +
| <code>Size: LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Version: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransportFamily: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransportType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TransportHandle: Pointer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ProviderName: array[0..MAX_NAME_SIZE] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FirstBinding: PWSAExtendedBinding;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextProvider: PWSAExtendedProvider;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''WSA network interface''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAExtendedInterface = WSAExtendedInterface;</code>
 +
 
 +
<code>PWSAExtendedInterface = ^TWSAExtendedInterface;</code>
 +
 
 +
<code>WSAExtendedInterface = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: A network Interface (Adapter)
 +
|-
 +
| <code>Size: LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Version: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterType: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterInt: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterPort: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterName: array[0..MAX_NAME_SIZE] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>AdapterHandle: Pointer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FirstProvider: PWSAExtendedProvider;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NextInterface: PWSAExtendedInterface;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
 +
'''WSA network configuration''' 
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>TWSAExtendedConfig = WSAExtendedConfig;</code>
 +
 
 +
<code>PWSAExtendedConfig = ^TWSAExtendedConfig;</code>
 +
 
 +
<code>WSAExtendedConfig = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: General Network Configuration
 +
|-
 +
| <code>Size: LongWord;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>Version: Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Hostname: array[0..MAX_NAME_SIZE - 1] of Char;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FirstInterface: PWSAExtendedInterface;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Address information'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PAddrInfo = ^TAddrInfo;</code>
 +
 
 +
<code>TAddrInfo = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Structure used in getaddrinfo() call
 +
|-
 +
| <code>ai_flags:LongInt;</code>
 +
| AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST
 +
|-
 +
| <code>ai_family:LongInt;</code>
 +
| PF_xxx
 +
|-
 +
| <code>ai_socktype:LongInt;</code>
 +
| SOCK_xxx
 +
|-
 +
| <code>ai_protocol:LongInt;</code>
 +
| 0 or IPPROTO_xxx for IPv4 and IPv6
 +
|-
 +
| <code>ai_addrlen:size_t;</code>
 +
| Length of ai_addr
 +
|-
 +
| <code>ai_canonname:PChar;</code>
 +
| Canonical name for nodename
 +
|-
 +
| <code>ai_addr:PSockAddr;</code>
 +
| Binary address
 +
|-
 +
| <code>ai_next:PAddrInfo;</code>
 +
| Next structure in linked list
 +
|-
 +
|}
 +
</div></div> 
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
Line 34: Line 3,790:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 46: Line 3,802:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 58: Line 3,814:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 70: Line 3,826:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 82: Line 3,838:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 94: Line 3,850:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 106: Line 3,862:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 118: Line 3,874:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 130: Line 3,886:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Latest revision as of 02:01, 6 November 2024

Return to Unit Reference


Description


Ultibo Global Socket Definitions unit

Constants



Global socket constants FD_*
FD_SETSIZE = 64;  
 
IOCPARM_MASK = $7f;  
IOC_VOID = $20000000;  
IOC_OUT = $40000000;  
IOC_IN = $80000000;  
IOC_INOUT = (IOC_IN or IOC_OUT);  
 
FIONREAD = Cardinal( IOC_OUT or get # bytes to read
((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 127);  
FIONBIO = Cardinal(IOC_IN or set/clear non-blocking i/o
((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 126);  
FIOASYNC = Cardinal(IOC_IN or set/clear async i/o
((4 and IOCPARM_MASK) shl 16) or (102 shl 8) or 125);  
 
SIOCSHIWAT = Cardinal( IOC_IN or set high watermark
((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 0);  
SIOCGHIWAT = Cardinal( IOC_OUT or get high watermark
((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 1);  
SIOCSLOWAT = Cardinal( IOC_IN or set low watermark
((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 2);  
SIOCGLOWAT = Cardinal( IOC_OUT or get low watermark
((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 3);  
SIOCATMARK = Cardinal( IOC_OUT or at oob mark
((4 and IOCPARM_MASK) shl 16) or (115 shl 8) or 7);  
 
IMPLINK_IP = 155;  
IMPLINK_LOWEXPER = 156;  
IMPLINK_HIGHEXPER = 158;  
 
TF_DISCONNECT = $01;  
TF_REUSE_SOCKET = $02;  
TF_WRITE_BEHIND = $04;  
 
INVALID_SOCKET = TSocket(NOT(0)); This is used instead of -1, since the TSocket type is unsigned.
SOCKET_ERROR = -1;  
 
Level number for (get/set)sockopt() to apply to socket itself
SOL_SOCKET = $ffff; options for socket level
 
Maximum queue length specifiable by listen
SOMAXCONN = $7fffffff;  
 
Define constant based on rfc883, used by gethostbyxxxx() calls
MAXGETHOSTSTRUCT = 1024;  
 
Define flags to be used with the WSAAsyncSelect() call
FD_READ = $01;  
FD_WRITE = $02;  
FD_OOB = $04;  
FD_ACCEPT = $08;  
FD_CONNECT = $10;  
FD_CLOSE = $20;  
 
WSADESCRIPTION_LEN = 256;  
WSASYS_STATUS_LEN = 128;  
 
Global Socket constants for enhanced Winsock functions
MAX_NAME_SIZE = 80;  
MAX_NAME_ALIASES = 5;  
MAX_NAME_SERVERS = 5;  
MAX_HOST_ALIASES = 16;  
 
INET_ADDRSTR_ANY = '0.0.0.0';  
INET6_ADDRSTR_INIT = '0::0';  
 
INET_ADDRSTR_BROADCAST = '255.255.255.255';  
 
INET_ADDRSTRLEN = 16; Max size of numeric form of IPv4 address
INET6_ADDRSTRLEN = 46; Max size of numeric form of IPv6 address


IP protocol IPPROTO_*
IPPROTO_IP = 0; dummy for IP
IPPROTO_ICMP = 1; control message protocol
IPPROTO_IGMP = 2; group management protocol
IPPROTO_GGP = 3; gateway^2 (deprecated)
IPPROTO_TCP = 6; tcp
IPPROTO_EGP = 8; egp
IPPROTO_PUP =12; pup
IPPROTO_UDP =17; user datagram protocol
IPPROTO_HMP =20; hmp
IPPROTO_IDP =22; xns idp
IPPROTO_RDP =27; rdp
IPPROTO_IPV6 = 41; IP6 header
IPPROTO_ROUTING = 43; IP6 routing header
IPPROTO_FRAGMENT = 44; IP6 fragmentation header
IPPROTO_ICMPV6 = 58; ICMP6
IPPROTO_RVD = 66; rvd
IPPROTO_ND = 77; UNOFFICIAL net disk proto
IPPROTO_RAW = 255; raw IP packet
IPPROTO_MAX = 256;  
 
NSPROTO_IPX = 1000; ipx protocol
NSPROTO_SPX = 1256; spx protocol
NSPROTO_SPXII = 1257; spxii protocol


IP port IPPORT_*
Port/socket numbers: network standard functions
IPPORT_ANY = 0;  
IPPORT_ECHO = 7;  
IPPORT_DISCARD = 9;  
IPPORT_SYSTAT = 11;  
IPPORT_DAYTIME = 13;  
IPPORT_NETSTAT = 15;  
IPPORT_FTP = 21;  
IPPORT_TELNET = 23;  
IPPORT_SMTP = 25;  
IPPORT_TIMESERVER = 37;  
IPPORT_NAMESERVER = 42;  
IPPORT_WHOIS = 43;  
IPPORT_DNS = 53;  
IPPORT_MTP = 57;  
IPPORT_BOOTPS = 67;  
IPPORT_BOOTPC = 68;  
 
Port/socket numbers: host specific functions
IPPORT_TFTP = 69;  
IPPORT_RJE = 77;  
IPPORT_FINGER = 79;  
IPPORT_TTYLINK = 87;  
IPPORT_SUPDUP = 95;  
 
UNIX TCP sockets
IPPORT_EXECSERVER = 512;  
IPPORT_LOGINSERVER = 513;  
IPPORT_CMDSERVER = 514;  
IPPORT_EFSSERVER = 520;  
 
UNIX UDP sockets
IPPORT_BIFFUDP = 512;  
IPPORT_WHOSERVER = 513;  
IPPORT_ROUTESERVER = 520;  
 
Ports < IPPORT_RESERVED are reserved for privileged processes (e.g. root)
IPPORT_RESERVED = 1024;  


IP options IP_*
Options for use with [gs]etsockopt at the IP level
 
IP_OPTIONS = 1;  
IP_MULTICAST_IF = 2; set/get IP multicast interface
IP_MULTICAST_TTL = 3; set/get IP multicast timetolive
IP_MULTICAST_LOOP = 4; set/get IP multicast loopback
IP_ADD_MEMBERSHIP = 5; add an IP group membership
IP_DROP_MEMBERSHIP = 6; drop an IP group membership
IP_TTL = 7; set/get IP Time To Live
IP_TOS = 8; set/get IP Type Of Service
IP_DONTFRAGMENT = 9; set/get IP Don't Fragment flag
IP_HDRINCL = 10; set/get IP Header include
 
IP_DEFAULT_MULTICAST_TTL = 1; normally limit m'casts to 1 hop
IP_DEFAULT_MULTICAST_LOOP = 1; normally hear sends if a member
IP_MAX_MEMBERSHIPS = 20; per socket; must fit in one mbuf


Socket type SOCK_*
SOCK_UNSPEC = 0; unspecified
SOCK_STREAM = 1; stream socket
SOCK_DGRAM = 2; datagram socket
SOCK_RAW = 3; raw-protocol interface
SOCK_RDM = 4; reliably-delivered message
SOCK_SEQPACKET = 5; sequenced packet stream
SOCK_PACKET = 10; linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level.


Socket options SO_*
Option flags per-socket
 
SO_DEBUG = $0001; turn on debugging info recording
SO_ACCEPTCONN = $0002; socket has had listen()
SO_REUSEADDR = $0004; allow local address reuse
SO_KEEPALIVE = $0008; keep connections alive
SO_DONTROUTE = $0010; just use interface addresses
SO_BROADCAST = $0020; permit sending of broadcast msgs
SO_USELOOPBACK = $0040; bypass hardware when possible
SO_LINGER = $0080; linger on close if data present
SO_OOBINLINE = $0100; leave received OOB data in line
SO_REUSEPORT = $0200; allow local address & port reuse
SO_TIMESTAMP = $0400; timestamp received dgram traffic
SO_ACCEPTFILTER = $1000; there is an accept filter
 
SO_DONTLINGER = not(SO_LINGER); ($ff7f)
SO_EXCLUSIVEADDRUSE = not(SO_REUSEADDR); disallow local address reuse ($fffb)
 
Additional options
SO_SNDBUF = $1001; send buffer size
SO_RCVBUF = $1002; receive buffer size
SO_SNDLOWAT = $1003; send low-water mark
SO_RCVLOWAT = $1004; receive low-water mark
SO_SNDTIMEO = $1005; send timeout
SO_RCVTIMEO = $1006; receive timeout
SO_ERROR = $1007; get error status and clear
SO_TYPE = $1008; get socket type
SO_CONNTIMEO = $1009; connection timeout
 
Options for connect and disconnect data and options. Used only by non-TCP/IP transports such as DECNet, OSI TP4, etc.
SO_CONNDATA = $7000;  
SO_CONNOPT = $7001;  
SO_DISCDATA = $7002;  
SO_DISCOPT = $7003;  
SO_CONNDATALEN = $7004;  
SO_CONNOPTLEN = $7005;  
SO_DISCDATALEN = $7006;  
SO_DISCOPTLEN = $7007;  
 
Option for opening sockets for synchronous access
SO_OPENTYPE = $7008;  
SO_SYNCHRONOUS_ALERT = $10;  
SO_SYNCHRONOUS_NONALERT = $20;  
 
Other NT-specific options
SO_MAXDG = $7009;  
SO_MAXPATHDG = $700A;  
SO_UPDATE_ACCEPT_CONTEXT = $700B;  
SO_CONNECT_TIME = $700C;  


TCP options TCP_*
TCP_NODELAY = $0001;  
TCP_MAXSEG = $0002;  
TCP_NOPUSH = $0004;  
TCP_NOOPT = $0008;  
TCP_BSDURGENT = $7000; Implement BSD Urgent instead of RFC793/1122
 
TCP_WSCALE = $0010;  
TCP_NOSACK = $0020;  


UDP options UDP_*
UDP_NOCHECKSUM = $0001;  


Address family AF_*
AF_UNSPEC = 0; unspecified
AF_UNIX = 1; local to host (pipes, portals)
AF_INET = 2; internetwork: UDP, TCP, etc.
AF_IMPLINK = 3; arpanet imp addresses
AF_PUP = 4; pup protocols: e.g. BSP
AF_CHAOS = 5; mit CHAOS protocols
AF_IPX = 6; IPX and SPX
AF_NS = 6; XEROX NS protocols
AF_ISO = 7; ISO protocols
AF_OSI = AF_ISO; OSI is ISO
AF_ECMA = 8; european computer manufacturers
AF_DATAKIT = 9; datakit protocols
AF_CCITT = 10; CCITT protocols, X.25 etc
AF_SNA = 11; IBM SNA
AF_DECnet = 12; DECnet
AF_DLI = 13; Direct data link interface
AF_LAT = 14; LAT
AF_HYLINK = 15; NSC Hyperchannel
AF_APPLETALK = 16; AppleTalk
AF_NETBIOS = 17; NetBios-style addresses
AF_VOICEVIEW = 18; VoiceView
AF_FIREFOX = 19; FireFox
AF_UNKNOWN1 = 20; Somebody is using this!
AF_BAN = 21; Banyan
AF_ATM = 22; Native ATM Services
AF_INET6 = 23; Internetwork Version 6
AF_CLUSTER = 24; Microsoft Wolfpack
AF_12844 = 25; IEEE 1284.4 WG AF
AF_IRDA = 26; IrDA
AF_NETDES = 28; Network Designers OSI & gateway enabled
 
AF_MAX = 29;  


Protocol family PF_*
PF_UNSPEC = AF_UNSPEC;  
PF_UNIX = AF_UNIX;  
PF_INET = AF_INET;  
PF_IMPLINK = AF_IMPLINK;  
PF_PUP = AF_PUP;  
PF_CHAOS = AF_CHAOS;  
PF_NS = AF_NS;  
PF_IPX = AF_IPX;  
PF_OSI = AF_OSI;  
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_VOICEVIEW = AF_VOICEVIEW;  
PF_FIREFOX = AF_FIREFOX;  
PF_UNKNOWN1 = AF_UNKNOWN1;  
PF_BAN = AF_BAN;  
PF_ATM = AF_ATM;  
PF_INET6 = AF_INET6;  
PF_CLUSTER = AF_CLUSTER;  
PF_12844 = AF_12844;  
PF_IRDA = AF_IRDA;  
PF_NETDES = AF_NETDES;  
 
PF_MAX = AF_MAX;  


Message flag MSG_*
MSG_OOB = $1; process out-of-band data
MSG_PEEK = $2; peek at incoming message
MSG_DONTROUTE = $4; send without using routing tables
 
MSG_INTERRUPT = $10; send/recv in the interrupt context
MSG_MAXIOVLEN = 16;  
 
MSG_PARTIAL = $8000; partial send or recv for message xport


Socket error WSAE*, EAI_*
All Windows Sockets error constants are biased by WSABASEERR from the "normal"
 
WSABASEERR = 10000;  
 
Windows Sockets definitions of regular Microsoft C error constants
WSAEINTR = (WSABASEERR+4);  
WSAEBADF = (WSABASEERR+9);  
WSAEACCES = (WSABASEERR+13);  
WSAEFAULT = (WSABASEERR+14);  
WSAEINVAL = (WSABASEERR+22);  
WSAEMFILE = (WSABASEERR+24);  
 
Windows Sockets definitions of regular Berkeley error constants
WSAEWOULDBLOCK = (WSABASEERR+35);  
WSAEINPROGRESS = (WSABASEERR+36);  
WSAEALREADY = (WSABASEERR+37);  
WSAENOTSOCK = (WSABASEERR+38);  
WSAEDESTADDRREQ = (WSABASEERR+39);  
WSAEMSGSIZE = (WSABASEERR+40);  
WSAEPROTOTYPE = (WSABASEERR+41);  
WSAENOPROTOOPT = (WSABASEERR+42);  
WSAEPROTONOSUPPORT = (WSABASEERR+43);  
WSAESOCKTNOSUPPORT = (WSABASEERR+44);  
WSAEOPNOTSUPP = (WSABASEERR+45);  
WSAEPFNOSUPPORT = (WSABASEERR+46);  
WSAEAFNOSUPPORT = (WSABASEERR+47);  
WSAEADDRINUSE = (WSABASEERR+48);  
WSAEADDRNOTAVAIL = (WSABASEERR+49);  
WSAENETDOWN = (WSABASEERR+50);  
WSAENETUNREACH = (WSABASEERR+51);  
WSAENETRESET = (WSABASEERR+52);  
WSAECONNABORTED = (WSABASEERR+53);  
WSAECONNRESET = (WSABASEERR+54);  
WSAENOBUFS = (WSABASEERR+55);  
WSAEISCONN = (WSABASEERR+56);  
WSAENOTCONN = (WSABASEERR+57);  
WSAESHUTDOWN = (WSABASEERR+58);  
WSAETOOMANYREFS = (WSABASEERR+59);  
WSAETIMEDOUT = (WSABASEERR+60);  
WSAECONNREFUSED = (WSABASEERR+61);  
WSAELOOP = (WSABASEERR+62);  
WSAENAMETOOLONG = (WSABASEERR+63);  
WSAEHOSTDOWN = (WSABASEERR+64);  
WSAEHOSTUNREACH = (WSABASEERR+65);  
WSAENOTEMPTY = (WSABASEERR+66);  
WSAEPROCLIM = (WSABASEERR+67);  
WSAEUSERS = (WSABASEERR+68);  
WSAEDQUOT = (WSABASEERR+69);  
WSAESTALE = (WSABASEERR+70);  
WSAEREMOTE = (WSABASEERR+71);  
 
WSAEDISCON = (WSABASEERR+101);  
 
Extended Windows Sockets error constant definitions
WSASYSNOTREADY = (WSABASEERR+91);  
WSAVERNOTSUPPORTED = (WSABASEERR+92);  
WSANOTINITIALISED = (WSABASEERR+93);  
 
WSAENOMORE = (WSABASEERR+102);  
WSAECANCELLED = (WSABASEERR+103);  
WSAEINVALIDPROCTABLE = (WSABASEERR+104);  
WSAEINVALIDPROVIDER = (WSABASEERR+105);  
WSAEPROVIDERFAILEDINIT = (WSABASEERR+106);  
WSASYSCALLFAILURE = (WSABASEERR+107);  
WSASERVICE_NOT_FOUND = (WSABASEERR+108);  
WSATYPE_NOT_FOUND = (WSABASEERR+109);  
WSA_E_NO_MORE = (WSABASEERR+110);  
WSA_E_CANCELLED = (WSABASEERR+111);  
WSAEREFUSED = (WSABASEERR+112);  
 
Error return codes from gethostbyname() and gethostbyaddr() (when using the resolver). Note that these errors are retrieved via WSAGetLastError() and must therefore follow the rules for avoiding clashes with error numbers from specific implementations or language run-time systems. For this reason the codes are based at WSABASEERR+1001. Note also that [WSA]NO_ADDRESS is defined only for compatibility purposes.
 
Authoritative Answer: Host not found
WSAHOST_NOT_FOUND = (WSABASEERR+1001);  
HOST_NOT_FOUND = WSAHOST_NOT_FOUND;  
 
Non-Authoritative: Host not found, or SERVERFAIL
WSATRY_AGAIN = (WSABASEERR+1002);  
TRY_AGAIN = WSATRY_AGAIN;  
 
Non recoverable errors, FORMERR, REFUSED, NOTIMP
WSANO_RECOVERY = (WSABASEERR+1003)  
NO_RECOVERY = WSANO_RECOVERY;  
 
Valid name, no data record of requested type
WSANO_DATA = (WSABASEERR+1004);  
NO_DATA = WSANO_DATA;  
 
no address, look for MX record
WSANO_ADDRESS = WSANO_DATA;  
NO_ADDRESS = WSANO_ADDRESS;  
 
WinSock 2 extension -- new error codes and type definition
WSA_IO_PENDING = ERROR_IO_PENDING;  
WSA_IO_INCOMPLETE = ERROR_IO_INCOMPLETE;  
WSA_INVALID_HANDLE = ERROR_INVALID_HANDLE;  
WSA_INVALID_PARAMETER = ERROR_INVALID_PARAMETER;  
WSA_NOT_ENOUGH_MEMORY = ERROR_NOT_ENOUGH_MEMORY;  
WSA_OPERATION_ABORTED = ERROR_OPERATION_ABORTED;  
WSA_INVALID_EVENT = WSAEVENT(nil);  
WSA_MAXIMUM_WAIT_EVENTS = MAXIMUM_WAIT_OBJECTS;  
WSA_WAIT_FAILED = $ffffffff;  
WSA_WAIT_EVENT_0 = WAIT_OBJECT_0;  
WSA_WAIT_IO_COMPLETION = WAIT_IO_COMPLETION;  
WSA_WAIT_TIMEOUT = WAIT_TIMEOUT;  
WSA_INFINITE = INFINITE;  
 
Windows Sockets errors redefined as regular Berkeley error constants. These are commented out in Windows NT to avoid conflicts with errno.h. Use the WSA constants instead.
EWOULDBLOCK = WSAEWOULDBLOCK;  
EINPROGRESS = WSAEINPROGRESS;  
EALREADY = WSAEALREADY;  
ENOTSOCK = WSAENOTSOCK;  
EDESTADDRREQ = WSAEDESTADDRREQ;  
EMSGSIZE = WSAEMSGSIZE;  
EPROTOTYPE = WSAEPROTOTYPE;  
ENOPROTOOPT = WSAENOPROTOOPT;  
EPROTONOSUPPORT = WSAEPROTONOSUPPORT;  
ESOCKTNOSUPPORT = WSAESOCKTNOSUPPORT;  
EOPNOTSUPP = WSAEOPNOTSUPP;  
EPFNOSUPPORT = WSAEPFNOSUPPORT;  
EAFNOSUPPORT = WSAEAFNOSUPPORT;  
EADDRINUSE = WSAEADDRINUSE;  
EADDRNOTAVAIL = WSAEADDRNOTAVAIL;  
ENETDOWN = WSAENETDOWN;  
ENETUNREACH = WSAENETUNREACH;  
ENETRESET = WSAENETRESET;  
ECONNABORTED = WSAECONNABORTED;  
ECONNRESET = WSAECONNRESET;  
ENOBUFS = WSAENOBUFS;  
EISCONN = WSAEISCONN;  
ENOTCONN = WSAENOTCONN;  
ESHUTDOWN = WSAESHUTDOWN;  
ETOOMANYREFS = WSAETOOMANYREFS;  
ETIMEDOUT = WSAETIMEDOUT;  
ECONNREFUSED = WSAECONNREFUSED;  
ELOOP = WSAELOOP;  
ENAMETOOLONG = WSAENAMETOOLONG;  
EHOSTDOWN = WSAEHOSTDOWN;  
EHOSTUNREACH = WSAEHOSTUNREACH;  
ENOTEMPTY = WSAENOTEMPTY;  
EPROCLIM = WSAEPROCLIM;  
EUSERS = WSAEUSERS;  
EDQUOT = WSAEDQUOT;  
ESTALE = WSAESTALE;  
EREMOTE = WSAEREMOTE;  
 
ENOTREADY = WSASYSNOTREADY;  
EVERNOTSUPPORTED = WSAVERNOTSUPPORTED;  
ENOTINITIALISED = WSANOTINITIALISED;  
 
Error codes from getaddrinfo()
EAI_AGAIN = WSATRY_AGAIN;  
EAI_BADFLAGS = WSAEINVAL;  
EAI_FAIL = WSANO_RECOVERY;  
EAI_FAMILY = WSAEAFNOSUPPORT;  
EAI_MEMORY = WSA_NOT_ENOUGH_MEMORY;  
EAI_NODATA = WSANO_DATA;  
EAI_NONAME = WSAHOST_NOT_FOUND;  
EAI_SERVICE = WSATYPE_NOT_FOUND;  
EAI_SOCKTYPE = WSAESOCKTNOSUPPORT;  
 
EAI_NODATA = EAI_NONAME;  


Shutdown options SD_*
SD_RECEIVE = $00;  
SD_SEND = $01;  
SD_BOTH = $02;  


WsControlEx options WSA_*
Global Socket constants for undocumented Winsock functions
 
WSA_MAX_INTERFACE_NAME_LEN = 256;  
WSA_ANY_SIZE = 1;  
 
WSA_MAX_ADAPTER_NAME = 128;  
 
WSA_MAX_ADAPTER_DESCRIPTION_LENGTH = 128;  
WSA_MAX_ADAPTER_NAME_LENGTH = 256;  
WSA_MAX_ADAPTER_ADDRESS_LENGTH = 8;  
WSA_MAX_HOSTNAME_LEN = 128;  
WSA_MAX_DOMAIN_NAME_LEN = 128;  
WSA_MAX_SCOPE_ID_LEN = 256;  
 
WSA_MAXLEN_IFDESCR = 256;  
WSA_MAXLEN_PHYSADDR = 8;  
 
WSA_USE_CURRENT_TTL = DWORD(-1);  
WSA_USE_CURRENT_FORWARDING = DWORD(-1);  
 
WSA_IF_OPER_STATUS_NON_OPERATIONAL = 0;  
WSA_IF_OPER_STATUS_UNREACHABLE = 1;  
WSA_IF_OPER_STATUS_DISCONNECTED = 2;  
WSA_IF_OPER_STATUS_CONNECTING = 3;  
WSA_IF_OPER_STATUS_CONNECTED = 4;  
WSA_IF_OPER_STATUS_OPERATIONAL = 5;  
 
WSA_IF_TYPE_OTHER = 1; Some other type of network interface
WSA_IF_TYPE_ETHERNET_CSMACD = 6; An Ethernet network interface
WSA_IF_TYPE_ISO88025_TOKENRING = 9; A token ring network interface
WSA_IF_TYPE_FDDI = 15; A Fiber Distributed Data Interface (FDDI) network interface
WSA_IF_TYPE_PPP = 23; A PPP network interface
WSA_IF_TYPE_SOFTWARE_LOOPBACK = 24; A software loopback network interface
WSA_IF_TYPE_SLIP = 28; A SLIP network interface
WSA_IF_TYPE_ATM = 37; An ATM network interface
WSA_IF_TYPE_IEEE80211 = 71; An IEEE 802.11 wireless network interface
WSA_IF_TYPE_TUNNEL = 131; A tunnel type encapsulation network interface
WSA_IF_TYPE_IEEE1394 = 144; An IEEE 1394 (Firewire) high performance serial bus network interface
WSA_IF_TYPE_IEEE80216_WMAN = 237; A mobile broadband interface for WiMax devices
WSA_IF_TYPE_WWANPP = 243; A mobile broadband interface for GSM-based devices
WSA_IF_TYPE_WWANPP2 = 244; A mobile broadband interface for CDMA-based devices
 
WSA_IF_ADMIN_STATUS_UP = 1;  
WSA_IF_ADMIN_STATUS_DOWN = 2;  
WSA_IF_ADMIN_STATUS_TESTING = 3;  
 
WSA_TCP_STATE_CLOSED = 1;  
WSA_TCP_STATE_LISTEN = 2;  
WSA_TCP_STATE_SYN_SENT = 3;  
WSA_TCP_STATE_SYN_RCVD = 4;  
WSA_TCP_STATE_ESTAB = 5;  
WSA_TCP_STATE_FIN_WAIT1 = 6;  
WSA_TCP_STATE_FIN_WAIT2 = 7;  
WSA_TCP_STATE_CLOSE_WAIT = 8;  
WSA_TCP_STATE_CLOSING = 9;  
WSA_TCP_STATE_LAST_ACK = 10;  
WSA_TCP_STATE_TIME_WAIT = 11;  
WSA_TCP_STATE_DELETE_TCB = 12;  
 
WSA_IP_FORWARDING = 1;  
WSA_IP_NOT_FORWARDING = 2;  
 
WSA_IPROUTE_TYPE_OTHER = 1;  
WSA_IPROUTE_TYPE_INVALID = 2;  
WSA_IPROUTE_TYPE_DIRECT = 3;  
WSA_IPROUTE_TYPE_INDIRECT = 4;  
WSA_IPROUTE_METRIC_UNUSED = DWORD(-1);  
 
WSA_IPPROTO_OTHER = 1;  
WSA_IPPROTO_LOCAL = 2;  
WSA_IPPROTO_NETMGMT = 3;  
WSA_IPPROTO_ICMP = 4;  
WSA_IPPROTO_EGP = 5;  
WSA_IPPROTO_GGP = 6;  
WSA_IPPROTO_HELLO = 7;  
WSA_IPPROTO_RIP = 8;  
WSA_IPPROTO_IS_IS = 9;  
WSA_IPPROTO_ES_IS = 10;  
WSA_IPPROTO_CISCO = 11;  
WSA_IPPROTO_BBN = 12;  
WSA_IPPROTO_OSPF = 13;  
WSA_IPPROTO_BGP = 14;  
WSA_IPPROTO_NT_AUTOSTATIC = 10002;  
WSA_IPPROTO_NT_STATIC = 10006;  
WSA_IPPROTO_NT_STATIC_NON_DOD = 10007;  
 
WSA_IPNET_TYPE_OTHER = 1;  
WSA_IPNET_TYPE_INVALID = 2;  
WSA_IPNET_TYPE_DYNAMIC = 3;  
WSA_IPNET_TYPE_STATIC = 4;  
 
WSA_GETNUMBEROFINTERFACES = 1;  
WSA_GETIFENTRY = 2;  
WSA_GETIFTABLE = 3;  
WSA_GETIPADDRTABLE = 4;  
WSA_GETIPNETTABLE = 5;  
WSA_GETIPFORWARDTABLE = 6;  
WSA_GETTCPTABLE = 7;  
WSA_GETUDPTABLE = 8;  
 
WSA_GETIPSTATISTICS = 9;  
WSA_GETICMPSTATISTICS = 10;  
WSA_GETTCPSTATISTICS = 11;  
WSA_GETUDPSTATISTICS = 12;  
 
WSA_SETIFENTRY = 13;  
WSA_CREATEIPFORWARDENTRY = 14;  
WSA_SETIPFORWARDENTRY = 15;  
WSA_DELETEIPFORWARDENTRY = 16;  
 
WSA_SETIPSTATISTICS = 17;  
WSA_SETIPTTL = 18;  
 
WSA_CREATEIPNETENTRY = 19;  
WSA_SETIPNETENTRY = 20;  
WSA_DELETEIPNETENTRY = 21;  
WSA_FLUSHIPNETTABLE = 22;  
 
WSA_CREATEPROXYARPENTRY = 23;  
WSA_DELETEPROXTARPENTRY = 24;  
 
WSA_SETTCPENTRY = 25;  
WSA_GETINTERFACEINFO = 26;  
WSA_GETUNIDIRECTIONALADAPTERINFO = 27;  
 
WSA_GETBESTINTERFACE = 28;  
WSA_GETBESTROUTE = 29;  
WSA_NOTIFYADDRCHANGE = 30;  
WSA_NOTIFYROUTECHANGE = 31;  
WSA_GETADAPTERINDEX = 32;  
WSA_ADDIPADDRESS = 33;  
WSA_DELETEIPADDRESS = 34;  
WSA_GETNETWORKPARAMS = 35;  
WSA_GETADAPTERSINFO = 36;  
WSA_GETPERADAPTERINFO = 37;  
WSA_IPRELEASEADDRESS = 38;  
WSA_IPRENEWADDRESS = 39;  
WSA_SENDARP = 40;  
WSA_GETRTTANDHOPCOUNT = 41;  
WSA_GETFRIENDLYIFINDEX = 42;  
WSA_ENABLEROUTER = 43;  
WSA_UNENABLEROUTER = 44;  


Address info flag AI_*
Flags used in "hints" argument to getaddrinfo()
Note: Under Linux these values may be different
 
AI_PASSIVE = $00000001; Socket address will be used in bind() call
AI_CANONNAME = $00000002; Return canonical name from DNS in the first ai_canonname (Cannot be used with AI_FQDN)
AI_NUMERICHOST = $00000004; Nodename must be a numeric address string
AI_NUMERICSERV = $00000008; Servicename must be a numeric port string
AI_ALL = $00000100; Return both IPv6 and IPv4 addresses
AI_ADDRCONFIG = $00000400; Only return addresses if a global address is configured (IPv4 or IPv6), loopback addresses do not count as global.
AI_V4MAPPED = $00000800; Map returned IPv4 addresses to IPv6 address format
AI_NON_AUTHORITATIVE = $00004000; Allow both autoritive and non authoritive return addresses (NS_EMAIL only)
AI_SECURE = $00008000; Obtain result using enhanced security only (NS_EMAIL only)
AI_RETURN_PREFERRED_NAMES = $00010000; Return preferred names (NS_EMAIL only)
AI_FQDN = $00020000; Return the FQDN for the single name specified on NodeName (Cannot be used with AI_CANONNAME)
AI_FILESERVER = $00040000; The requested name is being used for file sharing (Hint Only)


Name info flag NI_*
Flags for getnameinfo()
 
NI_NOFQDN = $01; Only return nodename portion for local hosts
NI_NUMERICHOST = $02; Return numeric form of the host's address
NI_NAMEREQD = $04; Error if the host's name not in DNS
NI_NUMERICSERV = $08; Return numeric form of the service (port #)
NI_DGRAM = $10; Service is a datagram service
 
NI_MAXHOST = 1025; Max size of a fully-qualified domain name
NI_MAXSERV = 32; Max size of a service name


Type definitions



Integer types

tOS_INT = LongInt;
tOS_UINT = DWORD;
ptOS_INT = ^tOS_INT;
ptOS_UINT = ^tOS_UINT;
u_int = tOS_UINT;
pu_int = ^u_int;

Character types

u_char = Char;
pu_char = ^u_char;

Numeric types

u_short = Word;
pu_short = ^u_short;
u_long = DWORD;
pu_long = ^u_long;

Socket types

TSocket = GlobalTypes.TSocket;

WSA event

WSAEVENT = GlobalTypes.WSAEVENT;
PWSAEVENT = ^WSAEVENT;
LPWSAEVENT = PWSAEVENT;

MB character

PMBChar = PChar;

FD set

TFDSet = fdset;

PFDSet = ^TFDSet;

fdset = record

fd_count: u_int;  
fd_array: array[0..FD_SETSIZE-1] of TSocket;  

Time value

TTimeVal = timeval;

PTimeVal = ^TTimeVal;

timeval = record

tv_sec: LongInt;  
tv_usec: LongInt;  

Host entry

THostEnt = hostent;

PHostEnt = ^THostEnt;

hostent = record

h_name: PChar;  
h_aliases: ^PChar;  
h_addrtype: Smallint;  
h_length: Smallint;  
case Byte of  
0: (h_addr_list: ^PChar);  
1: (h_addr: ^PChar)  

Network entry

TNetEnt = netent;

PNetEnt = ^TNetEnt;

netent = record

n_name: PChar;  
n_aliases: ^PChar;  
n_addrtype: Smallint;  
n_net: u_long;  

Service entry

TServEnt = servent;

PServEnt = ^TServEnt;

servent = record

s_name: PChar;  
s_aliases: ^PChar;  
s_port: Smallint;  
s_proto: PChar;  

Protocol entry

TProtoEnt = protoent;

PProtoEnt = ^TProtoEnt;

protoent = record

p_name: PChar;  
p_aliases: ^Pchar;  
p_proto: Smallint;  

Address types

SunB = packed record

s_b1, s_b2, s_b3, s_b4: u_char;  


SunW = packed record

s_w1, s_w2: u_short;  

IPv4 address

TInAddr = in_addr;

PInAddr = ^TInAddr;

in_addr = record

case integer of  
0: (S_un_b: SunB);  
1: (S_un_w: SunW);  
2: (S_addr: u_long);  
3: (S_bytes: packed array[1..4] of Byte);  

IPv6 address

TIn6Addr = in6_addr;

PIn6Addr = ^TIn6Addr;

in6_addr = record

Note: IPv6 version of above
case byte of  
0: (u6_addr8 : array[0..15] of byte);  
1: (u6_addr16 : array[0..7] of Word);  
2: (u6_addr32 : array[0..3] of Cardinal);  
3: (s6_addr8 : array[0..15] of shortint);  
4: (s6_addr : array[0..15] of shortint);  
5: (s6_addr16 : array[0..7] of smallint);  
6: (s6_addr32 : array[0..3] of LongInt);  
case integer of  
0: (S6_u8: array[0..15] of u_char);  
1: (S6_u32: array[0..3] of u_int);  
2: (S6_u64: array[0..1] of Int64);  
S6_addr: array [0..15] of Byte;  

IPX address

TIpxAddr = ipx_addr;

PIpxAddr = ^TIpxAddr;

ipx_addr = record

Note: IPX version of above
S_net: array [0..3] of Byte;  
S_node: array [0..5] of Byte;  
S_socket: Word;  

Socket address IPv4

TSockAddrIn = sockaddr_in;

PSockAddrIn = ^TSockAddrIn;

sockaddr_in = record

case Integer of  
0: (sin_family: u_short;  
sin_port: u_short;  
sin_addr: TInAddr;  
sin_zero: array[0..7] of Char);  
1: (sa_family: u_short;  
sa_data: array[0..13] of Char)  

Socket address IPv6

TSockAddr6 = sockaddr_in6;

PSOCKADDR6 = ^TSockAddr6;

TSockAddrIn6 = sockaddr_in6;

PSockAddrIn6 = ^TSockAddrIn6;

sockaddr_in6 = record

Note: IPv6 version of above
sin6_family: u_short; AF_INET6
sin6_port: u_short; transport layer port #
sin6_flowinfo: u_int; IPv6 flow information
sin6_addr: in6_addr; IPv6 address
sin6_scope_id: u_int; set of interfaces for a scope

Socket address IPX

TSockAddrIpx = sockaddr_ipx;

PSockAddrIpx = ^TSockAddrIpx;

sockaddr_ipx = record

Note: IPX version of above
sipx_family: u_short; AF_IPX
sipx_addr: ipx_addr; IPX address

Socket address

PSOCKADDR = ^TSockAddr;
TSockAddr = sockaddr_in;

Socket protocol

TSockProto = sockproto;

PSockProto = ^TSockProto;

sockproto = record

Note: Structure used by kernel to pass protocol information in raw sockets
sp_family: u_short;  
sp_protocol: u_short;  

Linger

TLinger = linger;

PLinger = ^TLinger;

linger = record

Note: Structure used for manipulating linger option
l_onoff: u_short;  
l_linger: u_short;  

WSA data

TWSAData = WSAData;

PWSAData = ^TWSAData;

WSAData = record

Note: Also WSDATA
wVersion: Word;  
wHighVersion: Word;  
szDescription: array[0..WSADESCRIPTION_LEN] of Char;  
szSystemStatus: array[0..WSASYS_STATUS_LEN] of Char;  
iMaxSockets: Word;  
iMaxUdpDg: Word;  
lpVendorInfo: PChar;  

Transmit file buffers

TTransmitFileBuffers = _TRANSMIT_FILE_BUFFERS;

TRANSMIT_FILE_BUFFERS = _TRANSMIT_FILE_BUFFERS;

PTransmitFileBuffers = ^TTransmitFileBuffers;

_TRANSMIT_FILE_BUFFERS = record

Head: Pointer;  
HeadLength: DWORD;  
Tail: Pointer;  
TailLength: DWORD;  

Multicast request

TMulticastRequest = ip_mreq;

PMulticastRequest = ^TMulticastRequest;

ip_mreq = record

Note: Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP
IMRMultiAddr : TInAddr; IP multicast address of group
IMRInterface : TInAddr; local IP address of interface

WSA interface row

TWSAIfRow = WSA_IFROW;

PWSAIfRow = PWSA_IFROW;

PWSA_IFROW = ^WSA_IFROW;

WSA_IFROW = record

Note: Structures for WsControlEx (Note: Must be same as IP Helper)
wszName: array [0..WSA_MAX_INTERFACE_NAME_LEN - 1] of WideChar;  
dwIndex: DWORD;  
dwType: DWORD;  
dwMtu: DWORD;  
dwSpeed: DWORD;  
dwPhysAddrLen: DWORD;  
bPhysAddr: array [0..WSA_MAXLEN_PHYSADDR - 1] of Byte;  
dwAdminStatus: DWORD;  
dwOperStatus: DWORD;  
dwLastChange: DWORD;  
dwInOctets: DWORD;  
dwInUcastPkts: DWORD;  
dwInNUcastPkts: DWORD;  
dwInDiscards: DWORD;  
dwInErrors: DWORD;  
dwInUnknownProtos: DWORD;  
dwOutOctets: DWORD;  
dwOutUcastPkts: DWORD;  
dwOutNUcastPkts: DWORD;  
dwOutDiscards: DWORD;  
dwOutErrors: DWORD;  
dwOutQLen: DWORD;  
dwDescrLen: DWORD;  
bDescr: array[0..WSA_MAXLEN_IFDESCR - 1] of Byte;  

WSA interface table

TWSAIftable = WSA_IFTABLE;

PWSAIftable = PWSA_IFTABLE;

PWSA_IFTABLE = ^WSA_IFTABLE;

WSA_IFTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_IFROW;  

WSA ICMP statistics

TWSAIcmpStats = WSAICMPSTATS;

PWSAIcmpStats = ^TWSAIcmpStats;

WSAICMPSTATS = record

dwMsgs: DWORD;  
dwErrors: DWORD;  
dwDestUnreachs: DWORD;  
dwTimeExcds: DWORD;  
dwParmProbs: DWORD;  
dwSrcQuenchs: DWORD;  
dwRedirects: DWORD;  
dwEchos: DWORD;  
dwEchoReps: DWORD;  
dwTimestamps: DWORD;  
dwTimestampReps: DWORD;  
dwAddrMasks: DWORD;  
dwAddrMaskReps: DWORD;  

WSA ICMP information

TWSAIcmpInfo = WSAICMPINFO;

PWSAIcmpInfo = ^TWSAIcmpInfo;

WSAICMPINFO = record

icmpInStats: WSAICMPSTATS;  
icmpOutStats: WSAICMPSTATS;  

WSA ICMP

TWSAIcmp = WSA_ICMP;

PWSAIcmp = PWSA_ICMP;

PWSA_ICMP = ^WSA_ICMP;

WSA_ICMP = record

stats: WSAICMPINFO;  

WSA UDP statistics

TWSAUdpStats = WSA_UDPSTATS;

PWSAUdpStats = PWSA_UDPSTATS;

PWSA_UDPSTATS = ^WSA_UDPSTATS;

WSA_UDPSTATS = record

dwInDatagrams: DWORD;  
dwNoPorts: DWORD;  
dwInErrors: DWORD;  
dwOutDatagrams: DWORD;  
dwNumAddrs: DWORD;  

WSA UDP row

TWSAUdpRow = WSA_UDPROW;

PWSAUdpRow = PWSA_UDPROW;

PWSA_UDPROW = ^WSA_UDPROW;

WSA_UDPROW = record

dwLocalAddr: DWORD;  
dwLocalPort: DWORD;  

WSA UDP table

TWSAUdpTable = WSA_UDPTABLE;

PWSAUdpTable = PWSA_UDPTABLE;

PWSA_UDPTABLE = ^WSA_UDPTABLE;

WSA_UDPTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_UDPROW;  

WSA TCP statistics

TWSATcpStats = WSA_TCPSTATS;

PWSATcpStats = PWSA_TCPSTATS;

PWSA_TCPSTATS = ^WSA_TCPSTATS;

WSA_TCPSTATS = record

dwRtoAlgorithm: DWORD;  
dwRtoMin: DWORD;  
dwRtoMax: DWORD;  
dwMaxConn: DWORD;  
dwActiveOpens: DWORD;  
dwPassiveOpens: DWORD;  
dwAttemptFails: DWORD;  
dwEstabResets: DWORD;  
dwCurrEstab: DWORD;  
dwInSegs: DWORD;  
dwOutSegs: DWORD;  
dwRetransSegs: DWORD;  
dwInErrs: DWORD;  
dwOutRsts: DWORD;  
dwNumConns: DWORD;  

WSA TCP row

TWSATcpRow = WSA_TCPROW;

PWSATcpRow = PWSA_TCPROW;

PWSA_TCPROW = ^WSA_TCPROW;

WSA_TCPROW = record

dwState: DWORD;  
dwLocalAddr: DWORD;  
dwLocalPort: DWORD;  
dwRemoteAddr: DWORD;  
dwRemotePort: DWORD;  

WSA TCP table

TWSATcpTable = WSA_TCPTABLE;

PWSATcpTable = PWSA_TCPTABLE;

PWSA_TCPTABLE = ^WSA_TCPTABLE;

WSA_TCPTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_TCPROW;  

WSA IP statistics

TWSAIpStats = WSA_IPSTATS;

PWSAIpStats = PWSA_IPSTATS;

PWSA_IPSTATS = ^WSA_IPSTATS;

WSA_IPSTATS = record

dwForwarding: DWORD;  
dwDefaultTTL: DWORD;  
dwInReceives: DWORD;  
dwInHdrErrors: DWORD;  
dwInAddrErrors: DWORD;  
dwForwDatagrams: DWORD;  
dwInUnknownProtos: DWORD;  
dwInDiscards: DWORD;  
dwInDelivers: DWORD;  
dwOutRequests: DWORD;  
dwRoutingDiscards: DWORD;  
dwOutDiscards: DWORD;  
dwOutNoRoutes: DWORD;  
dwReasmTimeout: DWORD;  
dwReasmReqds: DWORD;  
dwReasmOks: DWORD;  
dwReasmFails: DWORD;  
dwFragOks: DWORD;  
dwFragFails: DWORD;  
dwFragCreates: DWORD;  
dwNumIf: DWORD;  
dwNumAddr: DWORD;  
dwNumRoutes: DWORD;  

WSA IP address row

TWSAIpAddrRow = WSA_IPADDRROW;

PWSAIpAddrRow = PWSA_IPADDRROW;

PWSA_IPADDRROW = ^WSA_IPADDRROW;

WSA_IPADDRROW = record

dwAddr: DWORD;  
dwIndex: DWORD;  
dwMask: DWORD;  
dwBCastAddr: DWORD;  
dwReasmSize: DWORD;  
unused1: Word;  
unused2: Word;  

WSA IP address table

TWSAIpAddrTable = WSA_IPADDRTABLE;

PWSAIpAddrTable = PWSA_IPADDRTABLE;

PWSA_IPADDRTABLE = ^WSA_IPADDRTABLE;

WSA_IPADDRTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_IPADDRROW;  

WSA IP forward number

TWSAIpForwardNumber = WSA_IPFORWARDNUMBER;

PWSAIpForwardNumber = PWSA_IPFORWARDNUMBER;

PWSA_IPFORWARDNUMBER = ^WSA_IPFORWARDNUMBER;

WSA_IPFORWARDNUMBER = record

dwValue: DWORD;  

WSA IP forward row

TWSAIpForwardRow = WSA_IPFORWARDROW;

PWSAIpForwardRow = PWSA_IPFORWARDROW;

PWSA_IPFORWARDROW = ^WSA_IPFORWARDROW;

WSA_IPFORWARDROW = record

dwForwardDest: DWORD;  
dwForwardMask: DWORD;  
dwForwardPolicy: DWORD;  
dwForwardNextHop: DWORD;  
dwForwardIfIndex: DWORD;  
dwForwardType: DWORD;  
dwForwardProto: DWORD;  
dwForwardAge: DWORD;  
dwForwardNextHopAS: DWORD;  
dwForwardMetric1: DWORD;  
dwForwardMetric2: DWORD;  
dwForwardMetric3: DWORD;  
dwForwardMetric4: DWORD;  
dwForwardMetric5: DWORD;  

WSA IP forward table

TWSAIpForwardTable = WSA_IPFORWARDTABLE;

PWSAIpForwardTable = PWSA_IPFORWARDTABLE;

PWSA_IPFORWARDTABLE = ^WSA_IPFORWARDTABLE;

WSA_IPFORWARDTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_IPFORWARDROW;  

WSA IP net row

TWSAIpNetRow = WSA_IPNETROW;

PWSAIpNetRow = PWSA_IPNETROW;

PWSA_IPNETROW = ^WSA_IPNETROW;

WSA_IPNETROW = record

dwIndex: DWORD;  
dwPhysAddrLen: DWORD;  
bPhysAddr: array [0..WSA_MAXLEN_PHYSADDR - 1] of BYTE;  
dwAddr: DWORD;  
dwType: DWORD;  

WSA IP net table

TWSAIpNetTable = WSA_IPNETTABLE;

PWSAIpNetTable = PWSA_IPNETTABLE;

PWSA_IPNETTABLE = ^WSA_IPNETTABLE;

WSA_IPNETTABLE = record

dwNumEntries: DWORD;  
table: array [0..WSA_ANY_SIZE - 1] of WSA_IPNETROW;  

WSA IP adapter index map

TWSAIpAdapterIndexMap = WSA_IP_ADAPTER_INDEX_MAP;

PWSAIpAdapterIndexMap = PWSA_IP_ADAPTER_INDEX_MAP;

PWSA_IP_ADAPTER_INDEX_MAP = ^WSA_IP_ADAPTER_INDEX_MAP;

WSA_IP_ADAPTER_INDEX_MAP = record

Index: ULONG;  
Name: array [0..WSA_MAX_ADAPTER_NAME - 1] of WideChar;  

WSA IP interface information

TWSAIpInterfaceInfo = WSA_IP_INTERFACE_INFO;

PWSAIpInterfaceInfo = PWSA_IP_INTERFACE_INFO;

PWSA_IP_INTERFACE_INFO = ^WSA_IP_INTERFACE_INFO;

WSA_IP_INTERFACE_INFO = record

NumAdapters: DWORD; LongInt
Adapter: array [0..0] of WSA_IP_ADAPTER_INDEX_MAP;  

WSA IP address string

PWSA_IP_ADDRESS_STRING = ^WSA_IP_ADDRESS_STRING;

WSA_IP_MASK_STRING = WSA_IP_ADDRESS_STRING;

TWSAIpAddressString = WSA_IP_ADDRESS_STRING;

PWSAIpAddressString = PWSA_IP_MASK_STRING;

PWSA_IP_MASK_STRING = ^WSA_IP_MASK_STRING;

WSA_IP_ADDRESS_STRING = record

S: array [0..15] of Char;  

WSA IP address string

TWSAIpAddrString = WSA_IP_ADDR_STRING;

PWSAIpAddrString = PWSA_IP_ADDR_STRING;

PWSA_IP_ADDR_STRING = ^WSA_IP_ADDR_STRING;

WSA_IP_ADDR_STRING = record

Next: PWSA_IP_ADDR_STRING;  
IpAddress: WSA_IP_ADDRESS_STRING;  
IpMask: WSA_IP_MASK_STRING;  
Context: DWORD;  

WSA IP adapter information

TWSAIpAdapterInfo = WSA_IP_ADAPTER_INFO;

PWSAIpAdapterInfo = PWSA_IP_ADAPTER_INFO;

PWSA_IP_ADAPTER_INFO = ^WSA_IP_ADAPTER_INFO;

WSA_IP_ADAPTER_INFO = record

Next: PWSA_IP_ADAPTER_INFO;  
ComboIndex: DWORD;  
AdapterName: array [0..WSA_MAX_ADAPTER_NAME_LENGTH + 3] of Char;  
Description: array [0..WSA_MAX_ADAPTER_DESCRIPTION_LENGTH + 3] of Char;  
AddressLength: UINT;  
Address: array [0..WSA_MAX_ADAPTER_ADDRESS_LENGTH - 1] of BYTE;  
Index: DWORD;  
Type_: UINT;  
DhcpEnabled: UINT;  
CurrentIpAddress: PWSA_IP_ADDR_STRING;  
IpAddressList: WSA_IP_ADDR_STRING;  
GatewayList: WSA_IP_ADDR_STRING;  
DhcpServer: WSA_IP_ADDR_STRING;  
HaveWins: BOOL;  
PrimaryWinsServer: WSA_IP_ADDR_STRING;  
SecondaryWinsServer: WSA_IP_ADDR_STRING;  
LeaseObtained: time_t;  
LeaseExpires: time_t;  

WSA fixed information

TWSAFixedInfo = WSA_FIXED_INFO;

PWSAFixedInfo = PWSA_FIXED_INFO;

PWSA_FIXED_INFO = ^WSA_FIXED_INFO;

WSA_FIXED_INFO = record

HostName: array [0..WSA_MAX_HOSTNAME_LEN + 3] of Char;  
DomainName: array[0..WSA_MAX_DOMAIN_NAME_LEN + 3] of Char;  
CurrentDnsServer: PWSA_IP_ADDR_STRING;  
DnsServerList: WSA_IP_ADDR_STRING;  
NodeType: UINT;  
ScopeId: array [0..WSA_MAX_SCOPE_ID_LEN + 3] of Char;  
EnableRouting: UINT;  
EnableProxy: UINT;  
EnableDns: UINT;  

Net to address

PNetToAddr = ^TNetToAddr;
TNetToAddr = array[0..MAX_NAME_SIZE - 1] of Char;

WSA binding

TWSABinding = WSABinding;

PWSABinding = ^TWSABinding;

WSABinding = record

Note: A network Binding (Address)
Version: Word;  
ConfigType: Word;  
ConfigServer: TInAddr;  
BindingAddress: TInAddr;  
BindingNetmask: TInAddr;  
BindingGateway: TInAddr;  
NextBinding: PWSABinding;  

WSA provider

TWSAProvider = WSAProvider;

PWSAProvider = ^TWSAProvider;

WSAProvider = record

Note: A network Provider (Transport)
Version: Word;  
TransportFamily: Word;  
TransportType: Word;  
TransportHandle: Pointer;  
ConfigType: Word;  
ConfigServer: TInAddr;  
ProviderAddress: TInAddr;  
ProviderNetmask: TInAddr;  
ProviderGateway: TInAddr;  
ProviderName: array[0..MAX_NAME_SIZE] of Char;  
NextProvider: PWSAProvider;  

WSA interface

TWSAInterface = WSAInterface;

PWSAInterface = ^TWSAInterface;

WSAInterface = record

Note: A network Interface (Adapter)
Version: Word;  
AdapterType: Word;  
AdapterInt: Word;  
AdapterPort: Word;  
AdapterName: array[0..MAX_NAME_SIZE] of Char;  
AdapterHandle: Pointer;  
FirstProvider: PWSAProvider;  
NextInterface: PWSAInterface;  

WSA configuration

TWSAConfig = WSAConfig;

PWSAConfig = ^TWSAConfig;

WSAConfig = record

Note: General Network Configuration
Version: Word;  
Hostname: array[0..MAX_NAME_SIZE - 1] of Char;  
Namesuffix: array[0..MAX_NAME_SIZE - 1] of Char;  
Nameservers: array[0..MAX_NAME_SERVERS - 1] of TInAddr;  
FirstInterface: PWSAInterface;  

WSA network binding

TWSAExtendedBinding = WSAExtendedBinding;

PWSAExtendedBinding = ^TWSAExtendedBinding;

WSAExtendedBinding = record

Note: A network Binding (Address)
Size: LongWord;  
Version: Word;  
ConfigType: Word;  
ConfigServer: TInAddr;  
ConfigServer6: TIn6Addr;  
ConfigInitDelay: LongWord;  
ConfigRetryCount: LongWord;  
ConfigRetryTimeout: LongWord;  
BindingAddress: TInAddr;  
BindingNetmask: TInAddr;  
BindingGateway: TInAddr;  
BindingAddress6: TIn6Addr;  
BindingNetmask6: TIn6Addr;  
BindingGateway6: TIn6Addr;  
Namesuffix: array[0..MAX_NAME_SIZE - 1] of Char;  
Nameservers: array[0..MAX_NAME_SERVERS - 1] of TInAddr;  
Nameservers6: array[0..MAX_NAME_SERVERS - 1] of TIn6Addr;  
NextBinding: PWSAExtendedBinding;  

WSA network provider

TWSAExtendedProvider = WSAExtendedProvider;

PWSAExtendedProvider = ^TWSAExtendedProvider;

WSAExtendedProvider = record

Note: A network Provider (Transport)
Size: LongWord;  
Version: Word;  
TransportFamily: Word;  
TransportType: Word;  
TransportHandle: Pointer;  
ProviderName: array[0..MAX_NAME_SIZE] of Char;  
FirstBinding: PWSAExtendedBinding;  
NextProvider: PWSAExtendedProvider;  

WSA network interface

TWSAExtendedInterface = WSAExtendedInterface;

PWSAExtendedInterface = ^TWSAExtendedInterface;

WSAExtendedInterface = record

Note: A network Interface (Adapter)
Size: LongWord;  
Version: Word;  
AdapterType: Word;  
AdapterInt: Word;  
AdapterPort: Word;  
AdapterName: array[0..MAX_NAME_SIZE] of Char;  
AdapterHandle: Pointer;  
FirstProvider: PWSAExtendedProvider;  
NextInterface: PWSAExtendedInterface;  

WSA network configuration

TWSAExtendedConfig = WSAExtendedConfig;

PWSAExtendedConfig = ^TWSAExtendedConfig;

WSAExtendedConfig = record

Note: General Network Configuration
Size: LongWord;  
Version: Word;  
Hostname: array[0..MAX_NAME_SIZE - 1] of Char;  
FirstInterface: PWSAExtendedInterface;  

Address information

PAddrInfo = ^TAddrInfo;

TAddrInfo = record

Note: Structure used in getaddrinfo() call
ai_flags:LongInt; AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST
ai_family:LongInt; PF_xxx
ai_socktype:LongInt; SOCK_xxx
ai_protocol:LongInt; 0 or IPPROTO_xxx for IPv4 and IPv6
ai_addrlen:size_t; Length of ai_addr
ai_canonname:PChar; Canonical name for nodename
ai_addr:PSockAddr; Binary address
ai_next:PAddrInfo; Next structure in linked list


Public variables


None defined

Function declarations



Global socket functions

procedure FD_CLR(Socket: TSocket; var FDSet: TFDSet);
Description: To be documented
Note None documented


function FD_ISSET(Socket: TSocket; var FDSet: TFDSet): Boolean;
Description: To be documented
Note None documented


procedure FD_SET(Socket: TSocket; var FDSet: TFDSet);
Description: To be documented
Note None documented


procedure FD_ZERO(var FDSet: TFDSet);
Description: To be documented
Note None documented


function SequenceLT(A,B:LongInt):Boolean; inline;
Description: To be documented
Note None documented


function SequenceLEQ(A,B:LongInt):Boolean; inline;
Description: To be documented
Note None documented


function SequenceGT(A,B:LongInt):Boolean; inline;
Description: To be documented
Note None documented


function SequenceGEQ(A,B:LongInt):Boolean; inline;
Description: To be documented
Note None documented


function ProtocolToString(Protocol:Word):String;
Description: To be documented
Note None documented


Return to Unit Reference