Difference between revisions of "Unit GlobalSock"

From Ultibo.org
Jump to: navigation, search
Line 1,671: Line 1,671:
 
----
 
----
  
''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 in 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 in IPv6'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<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;"
 +
|-
 +
|colspan="2"|Note: Structure used by kernel to store most addresses.
 +
|-
 +
| <code>PSOCKADDR = ^TSockAddr;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>TSockAddr = sockaddr_in;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Socket address IPv6'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>PSOCKADDR6 = ^TSockAddr6;</code>
 +
| style="width: 40%;"|
 +
|-
 +
| <code>TSockAddr6 = sockaddr_in6;</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 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 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: LongInt;</code>
 +
| time_t
 +
|-
 +
| <code>LeaseExpires: LongInt;</code>
 +
| time_t
 +
|-
 +
|}
 +
</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 ===

Revision as of 00:26, 3 March 2017

Return to Unit Reference


Description


Ultibo Global Socket Definitions

To be documented

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 = 5;  
 
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 constants 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 constants 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 = 5;  
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 constants 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 constants 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 option constants 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_DONTLINGER = $ff7f;  
 
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 option constants 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 option constants UDP_*
UDP_NOCHECKSUM = $0001;  


Address family constants 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 constants 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 constants 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 constants 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 option constants 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_IP_FORWARDING = 1;  
WSA_IP_NOT_FORWARDING = 2;  
 
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 constants 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 constants 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 in 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 in IPv6

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

Note: Structure used by kernel to store most addresses.
PSOCKADDR = ^TSockAddr;
TSockAddr = sockaddr_in;

Socket address IPv6

PSOCKADDR6 = ^TSockAddr6;
TSockAddr6 = sockaddr_in6;

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 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 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: LongInt; time_t
LeaseExpires: LongInt; 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