Difference between revisions of "Unit Transport"
Line 20: | Line 20: | ||
---- | ---- | ||
− | '' | + | |
+ | <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;">'''Transport specific constants''' <code> *_TYPE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>HOST_TYPE_DYNAMIC = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>HOST_TYPE_STATIC = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>HOST_TYPE_LOOPBACK = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_DYNAMIC = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_STATIC = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_LOOPBACK = 2;</code> | ||
+ | | Loopback Route | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_GATEWAY = 3;</code> | ||
+ | | Default Route | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_MULTICAST = 4;</code> | ||
+ | | Multicast Route | ||
+ | |- | ||
+ | | <code>ROUTE_TYPE_BROADCAST = 5;</code> | ||
+ | | Broadcast Route | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_DYNAMIC = 0;</code> | ||
+ | | Remote Dynamic Address | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_STATIC = 1;</code> | ||
+ | | Remote Static Address | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_LOCAL = 2;</code> | ||
+ | | Local Address (ARP/RARP Only) | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_LOOPBACK = 3;</code> | ||
+ | | Local Loopback | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_MULTICAST = 4;</code> | ||
+ | | Local Multicast | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_BROADCAST = 5;</code> | ||
+ | | Local Broadcast | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_PRIMARY = 6;</code> | ||
+ | | Same as Local but used by IP/IP6 | ||
+ | |- | ||
+ | | <code>ADDRESS_TYPE_SECONDARY = 7;</code> | ||
+ | | Same as Local but used by IP/IP6 | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''Host constants''' <code> *_HOST_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MAX_HOST_LIFE = 600000;</code> | ||
+ | | 10 Minute Host lifespan | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''Route constants''' <code> *_ROUTE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MAX_ROUTE_LIFE = 600000;</code> | ||
+ | | 10 min Route lifespan | ||
+ | |- | ||
+ | |} | ||
+ | </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 constants''' <code> *_ADDRESS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>MAX_ADDRESS_LIFE = 300000;</code> | ||
+ | | 5 min Address (ARP) lifespan | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''IP4 transport constants''' <code> IP_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IP_ADDRESS_SIZE = 4;</code> | ||
+ | | SizeOf(TInAddr) | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''IP6 transport constants''' <code> IP6_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IP6_ADDRESS_SIZE = 16;</code> | ||
+ | | SizeOf(TIn6Addr) | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''IPX transport constants''' <code> IPX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>IPX_ADDRESS_SIZE = 12;</code> | ||
+ | | SizeOf(TIpxAddr) | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''Transport socket constants''' <code> TTL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>TTL_DEFAULT = 128;</code> | ||
+ | | Default to 128 Seconds/Hops (Defined as 64) | ||
+ | |- | ||
+ | | <code>TOS_DEFAULT = 0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>HOPLIMIT_DEFAULT = 255;</code> | ||
+ | | Default to 255 Hops (Defined as 64) | ||
+ | |- | ||
+ | | <code>ID_INCREMENT = 1;</code> | ||
+ | | Default Increment for ID Numbers | ||
+ | |- | ||
+ | | <code>TTL_DECREMENT = 1;</code> | ||
+ | | Default Decrement for TTL when Forwarding | ||
+ | |- | ||
+ | | <code>SEND_TIMEOUT = 0;</code> | ||
+ | | Default to wait forever on Send | ||
+ | |- | ||
+ | | <code>RECV_TIMEOUT = 0;</code> | ||
+ | | Default to wait forever on Recv | ||
+ | |- | ||
+ | | <code>CLOSE_TIMEOUT = 3000;</code> | ||
+ | | Time that Socket is kept before destruction | ||
+ | |- | ||
+ | | <code>LINGER_TIMEOUT = 60000;</code> | ||
+ | | Time that Socket goes into Linger state for | ||
+ | |- | ||
+ | | <code>CONNECT_TIMEOUT = 5000;</code> | ||
+ | | Time that Socket waits for connect completion | ||
+ | |- | ||
+ | | <code>TIMEWAIT_TIMEOUT = 240000;</code> | ||
+ | | Time that Socket goes into TimeWait state for (2 x MSL) | ||
+ | |- | ||
+ | |} | ||
+ | </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 constants''' <code> SHUTDOWN_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SHUTDOWN_RECV = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SHUTDOWN_SEND = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SHUTDOWN_BOTH = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </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;">'''Select constants''' <code> SELECT_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SELECT_READ = 0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SELECT_WRITE = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SELECT_ERROR = 2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </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 state constants''' <code> SS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SS_NOFDREF = $0001;</code> | ||
+ | | no file table ref any more | ||
+ | |- | ||
+ | | <code>SS_UNCONNECTED = SS_NOFDREF;</code> | ||
+ | | or just created socket | ||
+ | |- | ||
+ | | <code>SS_ISCONNECTED = $0002;</code> | ||
+ | | socket connected to a peer | ||
+ | |- | ||
+ | | <code>SS_ISCONNECTING = $0004;</code> | ||
+ | | in process of connecting | ||
+ | |- | ||
+ | | <code>SS_ISDISCONNECTING = $0008;</code> | ||
+ | | in process of disconnecting | ||
+ | |- | ||
+ | | <code>SS_CANTSENDMORE = $0010;</code> | ||
+ | | can't send more data | ||
+ | |- | ||
+ | | <code>SS_CANTRCVMORE = $0020;</code> | ||
+ | | can't receive more data | ||
+ | |- | ||
+ | | <code>SS_RCVATMARK = $0040;</code> | ||
+ | | at mark on input | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SS_PRIV = $0080;</code> | ||
+ | | privileged for broadcast | ||
+ | |- | ||
+ | | <code>SS_NBIO = $0100;</code> | ||
+ | | non-blocking ops | ||
+ | |- | ||
+ | | <code>SS_ASYNC = $0200;</code> | ||
+ | | async i/o notify | ||
+ | |- | ||
+ | | <code>SS_ISCONFIRMING = $0400;</code> | ||
+ | | accepting connection req | ||
+ | |- | ||
+ | | <code>SS_ISLISTENING = SS_ISCONFIRMING;</code> | ||
+ | | non standard | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SS_LOCAL_ADDR = $0800;</code> | ||
+ | | has local address/port (not used) | ||
+ | |- | ||
+ | | <code>SS_REMOTE_ADDR = $1000;</code> | ||
+ | | has remote address/port (not used) | ||
+ | |- | ||
+ | | <code>SS_CONN_REFUSED = $2000;</code> | ||
+ | | connection refused (ICMP_UNREACH) | ||
+ | |- | ||
+ | | <code>SS_CLOSED = $4000;</code> | ||
+ | | socket has been closed | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === |
Revision as of 04:39, 18 December 2016
Return to Unit Reference
Contents
[hide]Description
Network Transport
Notes:
Includes all global transport definitions plus base class for Network transports.
Currently supported transports are IP, ARP, RARP, IPX and IP6.
All HostToNetwork swaps occur at the level where they are appropriate (ie the level of their header).
Bindings is provided to support Transports (such as IP) which can provide multiple addresses on a single adapter. It is not used by the Protocol or Winsock layer and is only used by the transport where appropriate. In such cases the ConfigType in the Adapter object is not used and the Binding is used instead.
Constants
*_TYPE_*
*_HOST_*
*_ROUTE_*
*_ADDRESS_*
IP_*
IP6_*
IPX_*
TTL_*
SHUTDOWN_*
SELECT_*
SS_*
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
Transport functions
function InAddrToHost(const AAddress:TInAddr):TInAddr; inline;
function InAddrToNetwork(const AAddress:TInAddr):TInAddr; inline;
function InAddrToString(const AAddress:TInAddr):String;
function StringToInAddr(const AAddress:String):TInAddr;
function InAddrIsEqual(const AAddress1,AAddress2:TInAddr):Boolean;
function InAddrIsDefault(const AAddress:TInAddr):Boolean;
function InAddrIsLoopback(const AAddress:TInAddr):Boolean;
function InAddrIsBroadcast(const AAddress:TInAddr):Boolean;
function InAddrIsMulticast(const AAddress:TInAddr):Boolean;
function In6AddrIsEqual(const AAddress1,AAddress2:TIn6Addr):Boolean;
function In6AddrIsDefault(const AAddress:TIn6Addr):Boolean;
function In6AddrIsLoopback(const AAddress:TIn6Addr):Boolean;
function In6AddrIsLinkLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsSiteLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsV4Mapped(const AAddress:TIn6Addr):Boolean;
function In6AddrIsV4Compatible(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticast(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticastNodeLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticastLinkLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticastSiteLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticastOrgLocal(const AAddress:TIn6Addr):Boolean;
function In6AddrIsMulticastGlobal(const AAddress:TIn6Addr):Boolean;
function GetChecksum(ABuffer:Pointer; AOffset,ALength:Word):Word;
function GetChecksum2(APseudo,ABuffer:Pointer; APseudoLength,ABufferOffset,ABufferLength:Word):Word;
function GetChecksum3(APseudo,AHeader,AData:Pointer; APseudoLength,AHeaderLength,ADataOffset,ADataLength:Word):Word;
function GetChecksum4(APseudo,AHeader,AOptions,AData:Pointer; APseudoLength,AHeaderLength,AOptionsLength,ADataOffset,ADataLength:Word):Word;
Transport helper functions
Return to Unit Reference