Difference between revisions of "Unit Transport"

From Ultibo.org
Jump to: navigation, search
Line 487: Line 487:
 
----
 
----
  
''To be documented''
+
 
 +
'''Transport manager'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportManager = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create(ASettings:TNetworkSettings; AAdapters:TAdapterManager);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FSettings:TNetworkSettings;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FAdapters:TAdapterManager;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FTransports:TNetworkList;</code>
 +
| List of TNetworkTransport objects
 +
|-
 +
| <code>FMonitors:TNetworkList;</code>
 +
| List of TNetworkMonitor objects
 +
|-
 +
| <code>FAuthenticators:TNetworkList;</code>
 +
| List of TNetworkAuthenticator objects
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Settings:TNetworkSettings read FSettings;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Adapters:TAdapterManager read FAdapters;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddTransport(ATransport:TNetworkTransport):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveTransport(ATransport:TNetworkTransport):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetTransportByType(AFamily,APacketType:Word; ALock:Boolean; AState:LongWord):TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetTransportByTransport(ATransport:TNetworkTransport; ALock:Boolean; AState:LongWord):TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetTransportByNext(APrevious:TNetworkTransport; ALock,AUnlock:Boolean; AState:LongWord):TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddMonitor(AMonitor:TNetworkMonitor):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveMonitor(AMonitor:TNetworkMonitor):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetMonitorByMonitor(AMonitor:TNetworkMonitor; ALock:Boolean; AState:LongWord):TNetworkMonitor;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetMonitorByNext(APrevious:TNetworkMonitor; ALock,AUnlock: Boolean; AState:LongWord):TNetworkMonitor;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAuthenticator(AAuthenticator:TNetworkAuthenticator):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAuthenticator(AAuthenticator:TNetworkAuthenticator):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetAuthenticatorByType(AAuthType:Word; ALock:Boolean; AState:LongWord):TNetworkAuthenticator;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAuthenticatorByAuthenticator(AAuthenticator:TNetworkAuthenticator; ALock:Boolean; AState:LongWord):TNetworkAuthenticator;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAuthenticatorByNext(APrevious:TNetworkAuthenticator; ALock,AUnlock:Boolean; AState:LongWord):TNetworkAuthenticator;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartTransports:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopTransports:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessTransports:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function EnumerateTransports(ACallback:TTransportCallback):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindTransports(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindTransports(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartMonitors:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopMonitors:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessMonitors:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function EnumerateMonitors(ACallback:TMonitorCallback):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindMonitors(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindMonitors(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartAuthenticators:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopAuthenticators:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessAuthenticators:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function EnumerateAuthenticators(ACallback:TAuthenticatorCallback):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindAuthenticators(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindAuthenticators(AAdapter:TNetworkAdapter):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport buffer'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportBuffer = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create(ATransport:TNetworkTransport);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FTransport:TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport buffer extended'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportBufferEx = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create(ATransport:TNetworkTransport);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FTransport:TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterOwner:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport adapter'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportAdapter = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Downstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Name:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Index:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Handle:THandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PacketType:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Adapter:TNetworkAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Hardware:THardwareAddress;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Broadcast:THardwareAddress;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>MTU:Word;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ConfigType:Word;</code>
 +
| BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
 +
|-
 +
| <code>Configured:Boolean;</code>
 +
| Adapter has been configured
 +
|-
 +
| <code>Configuring:Boolean;</code>
 +
| Adapter is being configured
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''Transport binding'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportBinding = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Midstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Name:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Index:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Adapter:TTransportAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>ConfigType:Word;</code>
 +
| BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
 +
|-
 +
| <code>Configured:Boolean;</code>
 +
| Adapter has been configured
 +
|-
 +
| <code>Configuring:Boolean;</code>
 +
| Adapter is being configured
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport protocol'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportProtocol = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Upstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Protocol:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>PacketHandler:TTransportPacketHandler;</code>
 +
| &nbsp;
 +
|-
 +
| <code>ControlHandler:TTransportControlHandler;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport filter'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportFilter = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Upstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Protocol:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FilterHandler:TTransportFilterHandler;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport configuration'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportConfig = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Upstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>ConfigType:Word;</code>
 +
| BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
 +
|-
 +
| <code>ConfigAuto:Boolean;</code>
 +
| Supports Auto Configuration
 +
|-
 +
| <code>ConfigHandler:TTransportConfigHandler;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Network transport'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TNetworkTransport = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create(AManager:TTransportManager; const AName:String);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FManager:TTransportManager;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FName:String;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FFamily:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FPacketType:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FAdapters:TNetworkList;</code>
 +
| List of TTransportAdapter objects
 +
|-
 +
| <code>FBindings:TNetworkList;</code>
 +
| List of TTransportBinding objects
 +
|-
 +
| <code>FProtocols:TNetworkList;</code>
 +
| List of TTransportProtocol objects
 +
|-
 +
| <code>FFilters:TNetworkList;</code>
 +
| List of TTransportFilter objects
 +
|-
 +
| <code>FConfigs:TNetworkList;</code>
 +
| List of TTransportConfig objects
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FStatistics:TTransportStatistics;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TTransportAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByNext(APrevious:TTransportAdapter; ALock,AUnlock:Boolean; AState:LongWord):TTransportAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetProtocolByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportProtocol;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetProtocolByType(AProtocol:Word; ALock:Boolean; AState:LongWord):TTransportProtocol;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetProtocolByProtocol(AProtocol:TTransportProtocol; ALock:Boolean; AState:LongWord):TTransportProtocol;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetProtocolByNext(APrevious:TTransportProtocol; ALock,AUnlock:Boolean; AState:LongWord):TTransportProtocol;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetFilterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportFilter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetFilterByProtocol(AProtocol:Word; ALock:Boolean; AState:LongWord):TTransportFilter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetFilterByFilter(AFilter:TTransportFilter; ALock:Boolean; AState:LongWord):TTransportFilter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetFilterByNext(APrevious:TTransportFilter; ALock,AUnlock:Boolean; AState:LongWord):TTransportFilter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetConfigByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportConfig;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConfigByType(AConfigType:Word; ALock:Boolean; AState:LongWord):TTransportConfig;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConfigByConfig(AConfig:TTransportConfig; ALock:Boolean; AState:LongWord):TTransportConfig;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConfigByNext(APrevious:TTransportConfig; ALock,AUnlock:Boolean; AState:LongWord):TTransportConfig;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAdapter(AAdapter:TNetworkAdapter; AConfigType:Word; AAddress,ANetmask,AGateway,AServer:Pointer):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddProtocol(AProtocol:Word; APacketHandler:TTransportPacketHandler; AControlHandler:TTransportControlHandler):THandle; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveProtocol(AHandle:THandle; AProtocol:Word):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddFilter(AProtocol:Word; AFilterHandler:TTransportFilterHandler):THandle; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveFilter(AHandle:THandle; AProtocol:Word):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddConfig(AConfigType:Word; AConfigAuto:Boolean; AConfigHandler:TTransportConfigHandler):THandle; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveConfig(AHandle:THandle; AConfigType:Word):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function SendPacket(ASocket:TTransportSocket; ASource,ADest:Pointer; APacket:PPacketFragment; ASize,AFlags:Integer):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function SendControl(ASource,ADest:Pointer; AProtocol,ACommand,ACode:Word; AAddress,AData:Pointer; ASize:Integer):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FilterPacket(ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ForwardPacket(AAdapter:TTransportAdapter; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Manager:TTransportManager read FManager;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Name:String read FName;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property Family:Word read FFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property PacketType:Word read FPacketType;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function SetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetStatistics:TTransportStatistics; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartTransport:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopTransport:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessTransport:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindTransport(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindTransport(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Monitor adapter'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TMonitorAdapter = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Downstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Handle:THandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Adapter:TNetworkAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Network monitor'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TNetworkMonitor = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: eg Packet Capture
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create(AManager:TTransportManager);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FManager:TTransportManager;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAdapters:TNetworkList;</code>
 +
| List of TMonitorAdapter objects
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TMonitorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TMonitorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByNext(APrevious:TMonitorAdapter; ALock,AUnlock:Boolean; AState:LongWord):TMonitorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Manager:TTransportManager read FManager;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartMonitor:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopMonitor:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessMonitor:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindMonitor(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindMonitor(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Authenticator adapter'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TAuthenticatorAdapter = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Downstream
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>Handle:THandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>Adapter:TNetworkAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Network authenticator'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TNetworkAuthenticator = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: eg EAP/RSN
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create(AManager:TTransportManager);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FManager:TTransportManager;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAuthType:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FInitDelay:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRetryCount:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRetryTimeout:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FAdapters:TNetworkList;</code>
 +
| List of TAuthenticatorAdapter objects
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAuthenticatorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TAuthenticatorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAdapterByNext(APrevious:TAuthenticatorAdapter; ALock,AUnlock:Boolean; AState:LongWord):TAuthenticatorAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAdapter(AAdapter:TNetworkAdapter; AAuthType:Word; ACipher,AKey,AEntity,AToken:Pointer):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Manager:TTransportManager read FManager;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property AuthType:Word read FAuthType;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property InitDelay:LongWord read FInitDelay;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RetryCount:LongWord read FRetryCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RetryTimeout:LongWord read FRetryTimeout;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function StartAuthenticator:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function StopAuthenticator:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ProcessAuthenticator:Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function BindAuthenticator(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function UnbindAuthenticator(AAdapter:TNetworkAdapter):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport socket'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportSocket = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create(ATransport:TNetworkTransport);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLocalLock:TMutexHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetFamily(AFamily:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetStruct(AStruct:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetProto(AProto:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetOwner(AOwner:TSocketList);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetSocketError(ASocketError:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetOpenTime(const AOpenTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetCloseTime(const ACloseTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLingerTime(const ALingerTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetTimewaitTime(const ATimewaitTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetKeepAliveTime(const AKeepAliveTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FTransport:TNetworkTransport;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FFamily:Word;</code>
 +
| AF_INET, AF_INET6, AF_IPX etc
 +
|-
 +
| <code>FStruct:Word;</code>
 +
| SOCK_STREAM, SOCK_DGRAM etc
 +
|-
 +
| <code>FProto:Word;</code>
 +
| IPPROTO_UDP, IPPROTO_TCP etc
 +
|-
 +
| <code>FOwner:TSocketList;</code>
 +
| List that this Socket belongs to (eg AcceptQueue)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FSocketError:Integer;</code>
 +
| CONN_REFUSED etc
 +
|-
 +
| <code>FSocketState:TSocketState;</code>
 +
| SS_UNCONNECTED, SS_ISCONNECTED etc
 +
|-
 +
| <code>FSocketOptions:TSocketOptions;</code>
 +
| SO_ACCEPTCONN, SO_BROADCAST etc
 +
|-
 +
| <code>FOpenTime:Int64;</code>
 +
| Socket was Opened ar [msec] (TCP_STATE_ESTAB)
 +
|-
 +
| <code>FCloseTime:Int64;</code>
 +
| Socket was Closed at [msec] (TCP_STATE_CLOSED)
 +
|-
 +
| <code>FLingerTime:Int64;</code>
 +
| Went into Linger at [msec]
 +
|-
 +
| <code>FTimewaitTime:Int64;</code>
 +
| Went into Timewait at [msec] (TCP_STATE_TIMEWAIT)
 +
|-
 +
| <code>FKeepAliveTime:Int64;</code>
 +
| Last KeepAlive Packet at [msec]
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FTransportState:TTransportState;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FTransportOptions:TTransportOptions;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Family:Word read FFamily write SetFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Struct:Word read FStruct write SetStruct;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Proto:Word read FProto write SetProto;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Owner:TSocketList read FOwner write SetOwner;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property SocketError:Integer read FSocketError write SetSocketError;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property SocketState:TSocketState read FSocketState;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property SocketOptions:TSocketOptions read FSocketOptions;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property OpenTime:Int64 read FOpenTime write SetOpenTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property CloseTime:Int64 read FCloseTime write SetCloseTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property LingerTime:Int64 read FLingerTime write SetLingerTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property TimewaitTime:Int64 read FTimewaitTime write SetTimewaitTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property KeepAliveTime:Int64 read FKeepAliveTime write SetKeepAliveTime;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property TransportState:TTransportState read FTransportState;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property TransportOptions:TTransportOptions read FTransportOptions;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property Transport:TNetworkTransport read FTransport;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetOption(ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function SetOption(ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function IoCtl(ACommand:DWORD; var AArgument:u_long):Integer; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function IsConnected(ALocalAddress,ARemoteAddress:Pointer; ALocalPort,ARemotePort:Word; ABroadcast:Boolean):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function IsListening(ALocalAddress,ARemoteAddress:Pointer; ALocalPort,ARemotePort:Word; ABroadcast:Boolean):Boolean; virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Socket list'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSocketList = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: For tracking Sockets belonging to a List (eg AcceptQueue)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FList:TList;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure RemoveListItems;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetCount:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetItem(AIndex:Integer):TTransportSocket;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetItem(AIndex:Integer; AItem:TTransportSocket);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Count:Integer read GetCount;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Items[Index:Integer]:TTransportSocket read GetItem write SetItem;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function Add(ASocket:TTransportSocket):Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function Remove(ASocket:TTransportSocket):Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function First:TTransportSocket;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function Last:TTransportSocket;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure ClearList;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Socket state'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSocketState = class(TObject) </code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: For Socket State tracking SS_UNCONNECTED, SS_PRIV etc
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FState:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetUnconnected:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetUnconnected(AUnconnected:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConnected:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetConnected(AConnected:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConnecting:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetConnecting(AConnecting:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetDisconnecting:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetDisconnecting(ADisconnecting:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetCantSendMore:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetCantSendMore(ACantSendMore:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetCantRecvMore:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetCantRecvMore(ACantRecvMore:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetRecvAtMark:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRecvAtMark(ARecvAtMark:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetPrivileged:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetPrivileged(APrivileged:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetNonBlocking:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetNonBlocking(ANonBlocking:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAsync:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetAsync(AAsync:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetListening:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetListening(AListening:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetLocalAddress:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLocalAddress(ALocalAddress:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetRemoteAddress:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRemoteAddress(ARemoteAddress:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetConnRefused:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetConnRefused(AConnRefused:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetClosed:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetClosed(AClosed:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Unconnected:Boolean read GetUnconnected write SetUnconnected;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Connected:Boolean read GetConnected write SetConnected;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Connecting:Boolean read GetConnecting write SetConnecting;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Disconnecting:Boolean read GetDisconnecting write SetDisconnecting;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property CantSendMore:Boolean read GetCantSendMore write SetCantSendMore;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property CantRecvMore:Boolean read GetCantRecvMore write SetCantRecvMore;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RecvAtMark:Boolean read GetRecvAtMark write SetRecvAtMark;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property Privileged:Boolean read GetPrivileged write SetPrivileged;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property NonBlocking:Boolean read GetNonBlocking write SetNonBlocking;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Async:Boolean read GetAsync write SetAsync;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Listening:Boolean read GetListening write SetListening;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property LocalAddress:Boolean read GetLocalAddress write SetLocalAddress;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RemoteAddress:Boolean read GetRemoteAddress write SetRemoteAddress;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ConnRefused:Boolean read GetConnRefused write SetConnRefused;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Closed:Boolean read GetClosed write SetClosed;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Socket buffer'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSocketBuffer = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: Base Socket Buffer Class
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create(ASocket:TTransportSocket);</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TMutexHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FSocket:TTransportSocket;</code>
 +
| Socket owning this buffer
 +
|-
 +
| <code>FBuffer:TMemoryStream;</code>
 +
| Memory Buffer for Data
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FSize:LongWord;</code>
 +
| Physical Size of Data Buffer
 +
|-
 +
| <code>FStart:Pointer;</code>
 +
| First Byte of Data Buffer
 +
|-
 +
| <code>FEnd:Pointer;</code>
 +
| Last Byte of Data Buffer
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FUsed:LongWord;</code>
 +
| Amount of Buffer Used
 +
|-
 +
| <code>FFree:LongWord;</code>
 +
| Amount of Buffer Free
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetSize(ASize:LongWord); virtual;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Size:LongWord read FSize write SetSize;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetUsed:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetFree:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Socket options'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TSocketOptions = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: For Get/Set Options Level = SOL_SOCKET Option = SO_KEEPALIVE, SO_ACCEPTCONN, SO_BROADCAST etc
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FOptions:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FLinger:TLinger;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FSendBuffer:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRecvBuffer:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FSendLowMark:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRecvLowMark:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FSendTimeout:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRecvTimeout:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FConnTimeout:LongWord;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetLinger(const ALinger:TLinger);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetSendBuffer(ASendBuffer:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRecvBuffer(ARecvBuffer:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetSendLowMark(ASendLowMark:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRecvLowMark(ARecvLowMark:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetSendTimeout(ASendTimeout:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRecvTimeout(ARecvTimeout:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetConnTimeout(AConnTimeout:LongWord);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetDebug:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetDebug(ADebug:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetAccept:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetAccept(AAccept:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetReuseAddress:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetReuseAddress(AReuseAddress:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetKeepAlive:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetKeepAlive(AKeepAlive:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetDontRoute:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetDontRoute(ADontRoute:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetBroadcast:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetBroadcast(ABroadcast:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetUseLoopback:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetUseLoopback(AUseLoopback:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetUrgentInline:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetUrgentInline(AUrgentInline:Boolean);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Linger:TLinger read FLinger write SetLinger;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property SendBuffer:Integer read FSendBuffer write SetSendBuffer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RecvBuffer:Integer read FRecvBuffer write SetRecvBuffer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property SendLowMark:Integer read FSendLowMark write SetSendLowMark;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RecvLowMark:Integer read FRecvLowMark write SetRecvLowMark;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property SendTimeout:LongWord read FSendTimeout write SetSendTimeout;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RecvTimeout:LongWord read FRecvTimeout write SetRecvTimeout;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ConnTimeout:LongWord read FConnTimeout write SetConnTimeout;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>property Debug:Boolean read GetDebug write SetDebug;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Accept:Boolean read GetAccept write SetAccept;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property ReuseAddress:Boolean read GetReuseAddress write SetReuseAddress;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property KeepAlive:Boolean read GetKeepAlive write SetKeepAlive;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property DontRoute:Boolean read GetDontRoute write SetDontRoute;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Broadcast:Boolean read GetBroadcast write SetBroadcast;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property UseLoopback:Boolean read GetUseLoopback write SetUseLoopback;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property UrgentInline:Boolean read GetUrgentInline write SetUrgentInline;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport state'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportState = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Transport options'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TTransportOptions = class(TObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: For Get/Set Options at the Transport Level (eg IPPROTO_IP)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Host entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>THostEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAliases:TStringList; </code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetName(const AName:String);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetFamily(AFamily:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLength(ALength:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetHostType(AHostType:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetHostTime(const AHostTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FFamily:Integer;</code>
 +
| Always 2 for AF_INET
 +
|-
 +
| <code>FLength:Integer;</code>
 +
| Always 4 for AF_INET
 +
|-
 +
| <code>FHostType:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FHostTime:Int64;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Name:String read GetName write SetName;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Family:Integer read FFamily write SetFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Length:Integer read FLength write SetLength;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property HostType:Word read FHostType write SetHostType;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property HostTime:Int64 read FHostTime write SetHostTime;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FindAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Route entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TRouteEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLocalLock:TMutexHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetFamily(AFamily:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLength(ALength:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetMetric(AMetric:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRouteType(ARouteType:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetRouteTime(const ARouteTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FFamily:Integer;</code>
 +
| Always 2 for AF_INET
 +
|-
 +
| <code>FLength:Integer;</code>
 +
| Always 4 for AF_INET
 +
|-
 +
| <code>FMetric:Integer;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRouteType:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FRouteTime:Int64;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Family:Integer read FFamily write SetFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Length:Integer read FLength write SetLength;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Metric:Integer read FMetric write SetMetric;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RouteType:Word read FRouteType write SetRouteType;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property RouteTime:Int64 read FRouteTime write SetRouteTime;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Address entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TAddressEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TSynchronizerHandle;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FLocalLock:TMutexHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>procedure SetFamily(AFamily:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLength(ALength:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetAddressType(AAddressType:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetAddressTime(const AAddressTime:Int64);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetAdapter(AAdapter:TNetworkAdapter);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FFamily:Integer;</code>
 +
| Always 2 for AF_INET
 +
|-
 +
| <code>FLength:Integer;</code>
 +
| Always 4 for AF_INET
 +
|-
 +
| <code>FAddressType:Word;</code>
 +
| Dynamic/Static/Multicast/Broadcast/Primary/Secondary
 +
|-
 +
| <code>FAddressTime:Int64;</code>
 +
| Flush time for Dynamic entries
 +
|-
 +
| <code>FAdapter:TNetworkAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Family:Integer read FFamily write SetFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Length:Integer read FLength write SetLength;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property AddressType:Word read FAddressType write SetAddressType;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property AddressTime:Int64 read FAddressTime write SetAddressTime;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Adapter:TNetworkAdapter read FAdapter write SetAdapter;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function ReaderLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReaderConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterUnlock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function WriterConvert:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Network entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TNetworkEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAliases:TStringList;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetName(const AName:String);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetFamily(AFamily:Integer);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetLength(ALength:Integer);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FFamily:Integer;</code>
 +
| Always 2 for AF_INET
 +
|-
 +
| <code>FLength:Integer;</code>
 +
| Always 4 for AF_INET
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Name:String read GetName write SetName;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Family:Integer read FFamily write SetFamily;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Length:Integer read FLength write SetLength;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FindAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Service entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TServEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAliases:TStringList;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetName(const AName:String);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetPort(APort:Word);</code>
 +
| &nbsp;
 +
|-
 +
| <code>function GetProtocol:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetProtocol(const AProtocol:String);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FPort:Word;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FProtocol:String;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Name:String read GetName write SetName;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Port:Word read FPort write SetPort;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Protocol:String read GetProtocol write SetProtocol;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FindAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Protocol entry'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
 
 +
<code>TProtoEntry = class(TListObject)</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>constructor Create;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>destructor Destroy; override;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
 +
|-
 +
| <code>FLock:TCriticalSectionHandle;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>FAliases:TStringList;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function GetName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetName(const AName:String);</code>
 +
| &nbsp;
 +
|-
 +
| <code>procedure SetNumber(ANumber:Word);</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
 +
|-
 +
| <code>FName:String;</code>
 +
| &nbsp;
 +
|-
 +
| <code>FNumber:Word;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
 +
|-
 +
| <code>property Name:String read GetName write SetName;</code>
 +
| &nbsp;
 +
|-
 +
| <code>property Number:Word read FNumber write SetNumber;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AcquireLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function ReleaseLock:Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function FindAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>function AddAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
| <code>function RemoveAlias(const Alias:String):Boolean;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div> 
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===

Revision as of 03:26, 22 March 2017

Return to Unit Reference


Description


Ultibo Network Transport interface unit

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



Transport specific constants *_TYPE_*
HOST_TYPE_DYNAMIC = 0;  
HOST_TYPE_STATIC = 1;  
HOST_TYPE_LOOPBACK = 2;  
 
ROUTE_TYPE_DYNAMIC = 0;  
ROUTE_TYPE_STATIC = 1;  
ROUTE_TYPE_LOOPBACK = 2; Loopback Route
ROUTE_TYPE_GATEWAY = 3; Default Route
ROUTE_TYPE_MULTICAST = 4; Multicast Route
ROUTE_TYPE_BROADCAST = 5; Broadcast Route
 
ADDRESS_TYPE_DYNAMIC = 0; Remote Dynamic Address
ADDRESS_TYPE_STATIC = 1; Remote Static Address
ADDRESS_TYPE_LOCAL = 2; Local Address (ARP/RARP Only)
ADDRESS_TYPE_LOOPBACK = 3; Local Loopback
ADDRESS_TYPE_MULTICAST = 4; Local Multicast
ADDRESS_TYPE_BROADCAST = 5; Local Broadcast
 
ADDRESS_TYPE_PRIMARY = 6; Same as Local but used by IP/IP6
ADDRESS_TYPE_SECONDARY = 7; Same as Local but used by IP/IP6


Host constants *_HOST_*
MAX_HOST_LIFE = 600000; 10 Minute Host lifespan


Route constants *_ROUTE_*
MAX_ROUTE_LIFE = 600000; 10 min Route lifespan


Address constants *_ADDRESS_*
MAX_ADDRESS_LIFE = 300000; 5 min Address (ARP) lifespan
IP_ADDRESS_SIZE = 4; SizeOf(TInAddr)
IP6_ADDRESS_SIZE = 16; SizeOf(TIn6Addr)
IPX_ADDRESS_SIZE = 12; SizeOf(TIpxAddr)


Transport socket constants TTL_*
TTL_DEFAULT = 128; Default to 128 Seconds/Hops (Defined as 64)
TOS_DEFAULT = 0;  
HOPLIMIT_DEFAULT = 255; Default to 255 Hops (Defined as 64)
ID_INCREMENT = 1; Default Increment for ID Numbers
TTL_DECREMENT = 1; Default Decrement for TTL when Forwarding
SEND_TIMEOUT = 0; Default to wait forever on Send
RECV_TIMEOUT = 0; Default to wait forever on Recv
CLOSE_TIMEOUT = 3000; Time that Socket is kept before destruction
LINGER_TIMEOUT = 60000; Time that Socket goes into Linger state for
CONNECT_TIMEOUT = 5000; Time that Socket waits for connect completion
TIMEWAIT_TIMEOUT = 240000; Time that Socket goes into TimeWait state for (2 x MSL)


Shutdown constants SHUTDOWN_*
SHUTDOWN_RECV = 0;  
SHUTDOWN_SEND = 1;  
SHUTDOWN_BOTH = 2;  


Select constants SELECT_*
SELECT_READ = 0;  
SELECT_WRITE = 1;  
SELECT_ERROR = 2;  


Socket state constants SS_*
SS_NOFDREF = $0001; no file table ref any more
SS_UNCONNECTED = SS_NOFDREF; or just created socket
SS_ISCONNECTED = $0002; socket connected to a peer
SS_ISCONNECTING = $0004; in process of connecting
SS_ISDISCONNECTING = $0008; in process of disconnecting
SS_CANTSENDMORE = $0010; can't send more data
SS_CANTRCVMORE = $0020; can't receive more data
SS_RCVATMARK = $0040; at mark on input
 
SS_PRIV = $0080; privileged for broadcast
SS_NBIO = $0100; non-blocking ops
SS_ASYNC = $0200; async i/o notify
SS_ISCONFIRMING = $0400; accepting connection req
SS_ISLISTENING = SS_ISCONFIRMING; non standard
 
SS_LOCAL_ADDR = $0800; has local address/port (not used)
SS_REMOTE_ADDR = $1000; has remote address/port (not used)
SS_CONN_REFUSED = $2000; connection refused (ICMP_UNREACH)
SS_CLOSED = $4000; socket has been closed


IP4 transport constants IP_*
IP_LOOPBACK_ADDRESS:TInAddr = (S_addr: $7F000001); 127.0.0.1
IP_LOOPBACK_NETWORK:TInAddr = (S_addr: $7F000000); 127.0.0.0
IP_LOOPBACK_NETMASK:TInAddr = (S_addr: $FF000000); 255.0.0.0
IP_BROADCAST_ADDRESS:TInAddr = (S_addr: $FFFFFFFF); 255.255.255.255
IP_BROADCAST_NETWORK:TInAddr = (S_addr: $FFFFFFFF); 255.255.255.255
IP_BROADCAST_NETMASK:TInAddr = (S_addr: $FFFFFFFF); 255.255.255.255
IP_DEFAULT_ADDRESS:TInAddr = (S_addr: $00000000); 0.0.0.0
IP_DEFAULT_NETWORK:TInAddr = (S_addr: $00000000); 0.0.0.0
IP_DEFAULT_NETMASK:TInAddr = (S_addr: $00000000); 0.0.0.0
IP_MULTICAST_HOSTS:TInAddr = (S_addr: $E0000001); 224.0.0.1 (All Hosts)
IP_MULTICAST_ROUTERS:TInAddr = (S_addr: $E0000002); 224.0.0.2 (All Routers)
IP_MULTICAST_NETWORK:TInAddr = (S_addr: $E0000000); 224.0.0.0
IP_MULTICAST_NETMASK:TInAddr = (S_addr: $F0000000); 240.0.0.0
Note: The recommended range for general use is 234.0.0.0 to 238.255.255.255
 
IP_CLASSA_NETMASK:TInAddr = (S_addr: $FF000000); 255.0.0.0
IP_CLASSB_NETMASK:TInAddr = (S_addr: $FFFF0000); 255.255.0.0
IP_CLASSC_NETMASK:TInAddr = (S_addr: $FFFFFF00); 255.255.255.0
IP_CLASSD_NETMASK:TInAddr = (S_addr: $F0000000); 240.0.0.0
IP_CLASSE_NETMASK:TInAddr = (S_addr: $F0000000); 240.0.0.0


IP6 transport constants IP6_*
IP6_LOOPBACK_ADDRESS:TIn6Addr = (S6_addr: ($00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01));  
IP6_DEFAULT_ADDRESS:TIn6Addr = (S6_addr: ($00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00));  


Type definitions



Transport statistics

PTransportStatistics = ^TTransportStatistics;

TTransportStatistics = record

Note: Generic Transport
PacketsIn:Int64;  
PacketsOut:Int64;  
BytesIn:Int64;  
BytesOut:Int64;  
ErrorsIn:Int64;  
ErrorsOut:Int64;  
PacketsLost:Int64;  

IP4 nameservers

PIPNameservers = ^TIPNameservers;

TIPNameservers = array[0..MAX_NAME_SERVERS - 1] of TInAddr;

Note: IP4 Transport
   

IP6 nameservers

PIP6Nameservers = ^TIP6Nameservers;

TIP6Nameservers = array[0..MAX_NAME_SERVERS - 1] of TIn6Addr;

Note: IP6 Transport
   

Transport callback

TTransportCallback = function(ATransport:TNetworkTransport):Boolean of object;

Monitor callback

TMonitorCallback = function(AMonitor:TNetworkMonitor):Boolean of object;

Authenticator callback

TAuthenticatorCallback = function(AAuthenticator:TNetworkAuthenticator):Boolean of object;

Transport packet handler

TTransportPacketHandler = function(AHandle:THandle; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean of object;

Transport control handler

TTransportControlHandler = function(AHandle:THandle; ASource,ADest:Pointer; AProtocol,ACommand,ACode:Word; AAddress,AData:Pointer; ASize:Integer):Boolean of object;

Transport filter handler

TTransportFilterHandler = function(AHandle:THandle; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean of object;

Transport configuration handler

TTransportConfigHandler = function(AHandle:THandle; AAdapter:TTransportAdapter; ACommand:Word):Boolean of object;


Class definitions



Transport manager

TTransportManager = class(TObject)

constructor Create(ASettings:TNetworkSettings; AAdapters:TAdapterManager);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FSettings:TNetworkSettings;  
FAdapters:TAdapterManager;  
 
FTransports:TNetworkList; List of TNetworkTransport objects
FMonitors:TNetworkList; List of TNetworkMonitor objects
FAuthenticators:TNetworkList; List of TNetworkAuthenticator objects
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
public
property Settings:TNetworkSettings read FSettings;  
property Adapters:TAdapterManager read FAdapters;  
 
function AddTransport(ATransport:TNetworkTransport):Boolean;  
function RemoveTransport(ATransport:TNetworkTransport):Boolean;  
 
function GetTransportByType(AFamily,APacketType:Word; ALock:Boolean; AState:LongWord):TNetworkTransport;  
function GetTransportByTransport(ATransport:TNetworkTransport; ALock:Boolean; AState:LongWord):TNetworkTransport;  
function GetTransportByNext(APrevious:TNetworkTransport; ALock,AUnlock:Boolean; AState:LongWord):TNetworkTransport;  
 
function AddMonitor(AMonitor:TNetworkMonitor):Boolean;  
function RemoveMonitor(AMonitor:TNetworkMonitor):Boolean;  
 
function GetMonitorByMonitor(AMonitor:TNetworkMonitor; ALock:Boolean; AState:LongWord):TNetworkMonitor;  
function GetMonitorByNext(APrevious:TNetworkMonitor; ALock,AUnlock: Boolean; AState:LongWord):TNetworkMonitor;  
 
function AddAuthenticator(AAuthenticator:TNetworkAuthenticator):Boolean;  
function RemoveAuthenticator(AAuthenticator:TNetworkAuthenticator):Boolean;  
 
function GetAuthenticatorByType(AAuthType:Word; ALock:Boolean; AState:LongWord):TNetworkAuthenticator;  
function GetAuthenticatorByAuthenticator(AAuthenticator:TNetworkAuthenticator; ALock:Boolean; AState:LongWord):TNetworkAuthenticator;  
function GetAuthenticatorByNext(APrevious:TNetworkAuthenticator; ALock,AUnlock:Boolean; AState:LongWord):TNetworkAuthenticator;  
 
function StartTransports:Boolean;  
function StopTransports:Boolean;  
function ProcessTransports:Boolean;  
 
function EnumerateTransports(ACallback:TTransportCallback):Boolean;  
 
function BindTransports(AAdapter:TNetworkAdapter):Boolean;  
function UnbindTransports(AAdapter:TNetworkAdapter):Boolean;  
 
function StartMonitors:Boolean;  
function StopMonitors:Boolean;  
function ProcessMonitors:Boolean;  
 
function EnumerateMonitors(ACallback:TMonitorCallback):Boolean;  
 
function BindMonitors(AAdapter:TNetworkAdapter):Boolean;  
function UnbindMonitors(AAdapter:TNetworkAdapter):Boolean;  
 
function StartAuthenticators:Boolean;  
function StopAuthenticators:Boolean;  
function ProcessAuthenticators:Boolean;  
 
function EnumerateAuthenticators(ACallback:TAuthenticatorCallback):Boolean;  
 
function BindAuthenticators(AAdapter:TNetworkAdapter):Boolean;  
function UnbindAuthenticators(AAdapter:TNetworkAdapter):Boolean;  

Transport buffer

TTransportBuffer = class(TObject)

constructor Create(ATransport:TNetworkTransport);  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
FTransport:TNetworkTransport;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  

Transport buffer extended

TTransportBufferEx = class(TObject)

constructor Create(ATransport:TNetworkTransport);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
protected
FTransport:TNetworkTransport;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  
function WriterOwner:Boolean;  

Transport adapter

TTransportAdapter = class(TListObject)

Note: Downstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Name:String;  
Index:LongWord;  
Handle:THandle;  
PacketType:Word;  
Adapter:TNetworkAdapter;  
Hardware:THardwareAddress;  
Broadcast:THardwareAddress;  
 
MTU:Word;  
 
ConfigType:Word; BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
Configured:Boolean; Adapter has been configured
Configuring:Boolean; Adapter is being configured
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Transport binding

TTransportBinding = class(TListObject)

Note: Midstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Name:String;  
Index:LongWord;  
Adapter:TTransportAdapter;  
 
ConfigType:Word; BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
Configured:Boolean; Adapter has been configured
Configuring:Boolean; Adapter is being configured
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Transport protocol

TTransportProtocol = class(TListObject)

Note: Upstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Protocol:Word;  
PacketHandler:TTransportPacketHandler;  
ControlHandler:TTransportControlHandler;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Transport filter

TTransportFilter = class(TListObject)

Note: Upstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Protocol:Word;  
FilterHandler:TTransportFilterHandler;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Transport configuration

TTransportConfig = class(TListObject)

Note: Upstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
ConfigType:Word; BOOTP/DHCP/RARP/STATIC/PSEUDO/LOOPBACK
ConfigAuto:Boolean; Supports Auto Configuration
ConfigHandler:TTransportConfigHandler;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Network transport

TNetworkTransport = class(TListObject)

constructor Create(AManager:TTransportManager; const AName:String);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
protected
FManager:TTransportManager;  
FName:String;  
 
FFamily:Word;  
FPacketType:Word;  
FAdapters:TNetworkList; List of TTransportAdapter objects
FBindings:TNetworkList; List of TTransportBinding objects
FProtocols:TNetworkList; List of TTransportProtocol objects
FFilters:TNetworkList; List of TTransportFilter objects
FConfigs:TNetworkList; List of TTransportConfig objects
 
FStatistics:TTransportStatistics;  
 
function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportAdapter;  
function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TTransportAdapter;  
function GetAdapterByNext(APrevious:TTransportAdapter; ALock,AUnlock:Boolean; AState:LongWord):TTransportAdapter;  
 
function GetProtocolByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportProtocol;  
function GetProtocolByType(AProtocol:Word; ALock:Boolean; AState:LongWord):TTransportProtocol;  
function GetProtocolByProtocol(AProtocol:TTransportProtocol; ALock:Boolean; AState:LongWord):TTransportProtocol;  
function GetProtocolByNext(APrevious:TTransportProtocol; ALock,AUnlock:Boolean; AState:LongWord):TTransportProtocol;  
 
function GetFilterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportFilter;  
function GetFilterByProtocol(AProtocol:Word; ALock:Boolean; AState:LongWord):TTransportFilter;  
function GetFilterByFilter(AFilter:TTransportFilter; ALock:Boolean; AState:LongWord):TTransportFilter;  
function GetFilterByNext(APrevious:TTransportFilter; ALock,AUnlock:Boolean; AState:LongWord):TTransportFilter;  
 
function GetConfigByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TTransportConfig;  
function GetConfigByType(AConfigType:Word; ALock:Boolean; AState:LongWord):TTransportConfig;  
function GetConfigByConfig(AConfig:TTransportConfig; ALock:Boolean; AState:LongWord):TTransportConfig;  
function GetConfigByNext(APrevious:TTransportConfig; ALock,AUnlock:Boolean; AState:LongWord):TTransportConfig;  
 
function AddAdapter(AAdapter:TNetworkAdapter; AConfigType:Word; AAddress,ANetmask,AGateway,AServer:Pointer):Boolean; virtual;  
function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;  
 
function AddProtocol(AProtocol:Word; APacketHandler:TTransportPacketHandler; AControlHandler:TTransportControlHandler):THandle; virtual;  
function RemoveProtocol(AHandle:THandle; AProtocol:Word):Boolean; virtual;  
 
function AddFilter(AProtocol:Word; AFilterHandler:TTransportFilterHandler):THandle; virtual;  
function RemoveFilter(AHandle:THandle; AProtocol:Word):Boolean; virtual;  
 
function AddConfig(AConfigType:Word; AConfigAuto:Boolean; AConfigHandler:TTransportConfigHandler):THandle; virtual;  
function RemoveConfig(AHandle:THandle; AConfigType:Word):Boolean; virtual;  
 
function SendPacket(ASocket:TTransportSocket; ASource,ADest:Pointer; APacket:PPacketFragment; ASize,AFlags:Integer):Integer; virtual;  
function SendControl(ASource,ADest:Pointer; AProtocol,ACommand,ACode:Word; AAddress,AData:Pointer; ASize:Integer):Boolean; virtual;  
 
function FilterPacket(ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; virtual;  
function ForwardPacket(AAdapter:TTransportAdapter; ASource,ADest,APacket:Pointer; ASize:Integer; ABroadcast:Boolean):Boolean; virtual;  
public
property Manager:TTransportManager read FManager;  
property Name:String read FName;  
 
property Family:Word read FFamily;  
property PacketType:Word read FPacketType;  
 
function GetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; virtual;  
function SetSockOpt(ASocket:TTransportSocket; ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; virtual;  
 
function GetStatistics:TTransportStatistics; virtual;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
 
function StartTransport:Boolean; virtual;  
function StopTransport:Boolean; virtual;  
function ProcessTransport:Boolean; virtual;  
 
function BindTransport(AAdapter:TNetworkAdapter):Boolean; virtual;  
function UnbindTransport(AAdapter:TNetworkAdapter):Boolean; virtual;  

Monitor adapter

TMonitorAdapter = class(TListObject)

Note: Downstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Handle:THandle;  
Adapter:TNetworkAdapter;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Network monitor

TNetworkMonitor = class(TListObject)

Note: eg Packet Capture
 
constructor Create(AManager:TTransportManager);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
protected
FManager:TTransportManager;  
 
FAdapters:TNetworkList; List of TMonitorAdapter objects
 
function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TMonitorAdapter;  
function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TMonitorAdapter;  
function GetAdapterByNext(APrevious:TMonitorAdapter; ALock,AUnlock:Boolean; AState:LongWord):TMonitorAdapter;  
 
function AddAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;  
function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;  
public
property Manager:TTransportManager read FManager;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
 
function StartMonitor:Boolean; virtual;  
function StopMonitor:Boolean; virtual;  
function ProcessMonitor:Boolean; virtual;  
 
function BindMonitor(AAdapter:TNetworkAdapter):Boolean; virtual;  
function UnbindMonitor(AAdapter:TNetworkAdapter):Boolean; virtual;  

Authenticator adapter

TAuthenticatorAdapter = class(TListObject)

Note: Downstream
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
public
Handle:THandle;  
Adapter:TNetworkAdapter;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  

Network authenticator

TNetworkAuthenticator = class(TListObject)

Note: eg EAP/RSN
 
constructor Create(AManager:TTransportManager);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
protected
FManager:TTransportManager;  
 
FAuthType:Word;  
FInitDelay:LongWord;  
FRetryCount:LongWord;  
FRetryTimeout:LongWord;  
FAdapters:TNetworkList; List of TAuthenticatorAdapter objects
 
function GetAdapterByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TAuthenticatorAdapter;  
function GetAdapterByAdapter(AAdapter:TNetworkAdapter; ALock:Boolean; AState:LongWord):TAuthenticatorAdapter;  
function GetAdapterByNext(APrevious:TAuthenticatorAdapter; ALock,AUnlock:Boolean; AState:LongWord):TAuthenticatorAdapter;  
 
function AddAdapter(AAdapter:TNetworkAdapter; AAuthType:Word; ACipher,AKey,AEntity,AToken:Pointer):Boolean; virtual;  
function RemoveAdapter(AAdapter:TNetworkAdapter):Boolean; virtual;  
public
property Manager:TTransportManager read FManager;  
property AuthType:Word read FAuthType;  
property InitDelay:LongWord read FInitDelay;  
property RetryCount:LongWord read FRetryCount;  
property RetryTimeout:LongWord read FRetryTimeout;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
 
function StartAuthenticator:Boolean; virtual;  
function StopAuthenticator:Boolean; virtual;  
function ProcessAuthenticator:Boolean; virtual;  
 
function BindAuthenticator(AAdapter:TNetworkAdapter):Boolean; virtual;  
function UnbindAuthenticator(AAdapter:TNetworkAdapter):Boolean; virtual;  

Transport socket

TTransportSocket = class(TListObject)

constructor Create(ATransport:TNetworkTransport);  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
 
procedure SetFamily(AFamily:Word);  
procedure SetStruct(AStruct:Word);  
procedure SetProto(AProto:Word);  
procedure SetOwner(AOwner:TSocketList);  
 
procedure SetSocketError(ASocketError:Integer);  
procedure SetOpenTime(const AOpenTime:Int64);  
procedure SetCloseTime(const ACloseTime:Int64);  
procedure SetLingerTime(const ALingerTime:Int64);  
procedure SetTimewaitTime(const ATimewaitTime:Int64);  
procedure SetKeepAliveTime(const AKeepAliveTime:Int64);  
protected
FTransport:TNetworkTransport;  
 
FFamily:Word; AF_INET, AF_INET6, AF_IPX etc
FStruct:Word; SOCK_STREAM, SOCK_DGRAM etc
FProto:Word; IPPROTO_UDP, IPPROTO_TCP etc
FOwner:TSocketList; List that this Socket belongs to (eg AcceptQueue)
 
FSocketError:Integer; CONN_REFUSED etc
FSocketState:TSocketState; SS_UNCONNECTED, SS_ISCONNECTED etc
FSocketOptions:TSocketOptions; SO_ACCEPTCONN, SO_BROADCAST etc
FOpenTime:Int64; Socket was Opened ar [msec] (TCP_STATE_ESTAB)
FCloseTime:Int64; Socket was Closed at [msec] (TCP_STATE_CLOSED)
FLingerTime:Int64; Went into Linger at [msec]
FTimewaitTime:Int64; Went into Timewait at [msec] (TCP_STATE_TIMEWAIT)
FKeepAliveTime:Int64; Last KeepAlive Packet at [msec]
 
FTransportState:TTransportState;  
FTransportOptions:TTransportOptions;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
public
property Family:Word read FFamily write SetFamily;  
property Struct:Word read FStruct write SetStruct;  
property Proto:Word read FProto write SetProto;  
property Owner:TSocketList read FOwner write SetOwner;  
 
property SocketError:Integer read FSocketError write SetSocketError;  
property SocketState:TSocketState read FSocketState;  
property SocketOptions:TSocketOptions read FSocketOptions;  
property OpenTime:Int64 read FOpenTime write SetOpenTime;  
property CloseTime:Int64 read FCloseTime write SetCloseTime;  
property LingerTime:Int64 read FLingerTime write SetLingerTime;  
property TimewaitTime:Int64 read FTimewaitTime write SetTimewaitTime;  
property KeepAliveTime:Int64 read FKeepAliveTime write SetKeepAliveTime;  
 
property TransportState:TTransportState read FTransportState;  
property TransportOptions:TTransportOptions read FTransportOptions;  
 
property Transport:TNetworkTransport read FTransport;  
 
function GetOption(ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; virtual;  
function SetOption(ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; virtual;  
function IoCtl(ACommand:DWORD; var AArgument:u_long):Integer; virtual;  
 
function IsConnected(ALocalAddress,ARemoteAddress:Pointer; ALocalPort,ARemotePort:Word; ABroadcast:Boolean):Boolean; virtual;  
function IsListening(ALocalAddress,ARemoteAddress:Pointer; ALocalPort,ARemotePort:Word; ABroadcast:Boolean):Boolean; virtual;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  

Socket list

TSocketList = class(TObject)

Note: For tracking Sockets belonging to a List (eg AcceptQueue)
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
FList:TList;  
 
procedure RemoveListItems;  
function GetCount:Integer;  
function GetItem(AIndex:Integer):TTransportSocket;  
procedure SetItem(AIndex:Integer; AItem:TTransportSocket);  
public
property Count:Integer read GetCount;  
property Items[Index:Integer]:TTransportSocket read GetItem write SetItem;  
 
function Add(ASocket:TTransportSocket):Integer;  
function Remove(ASocket:TTransportSocket):Integer;  
function First:TTransportSocket;  
function Last:TTransportSocket;  
procedure ClearList;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  

Socket state

TSocketState = class(TObject)

Note: For Socket State tracking SS_UNCONNECTED, SS_PRIV etc
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
FState:LongWord;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function GetUnconnected:Boolean;  
procedure SetUnconnected(AUnconnected:Boolean);  
function GetConnected:Boolean;  
procedure SetConnected(AConnected:Boolean);  
function GetConnecting:Boolean;  
procedure SetConnecting(AConnecting:Boolean);  
function GetDisconnecting:Boolean;  
procedure SetDisconnecting(ADisconnecting:Boolean);  
function GetCantSendMore:Boolean;  
procedure SetCantSendMore(ACantSendMore:Boolean);  
function GetCantRecvMore:Boolean;  
procedure SetCantRecvMore(ACantRecvMore:Boolean);  
function GetRecvAtMark:Boolean;  
procedure SetRecvAtMark(ARecvAtMark:Boolean);  
 
function GetPrivileged:Boolean;  
procedure SetPrivileged(APrivileged:Boolean);  
function GetNonBlocking:Boolean;  
procedure SetNonBlocking(ANonBlocking:Boolean);  
function GetAsync:Boolean;  
procedure SetAsync(AAsync:Boolean);  
function GetListening:Boolean;  
procedure SetListening(AListening:Boolean);  
 
function GetLocalAddress:Boolean;  
procedure SetLocalAddress(ALocalAddress:Boolean);  
function GetRemoteAddress:Boolean;  
procedure SetRemoteAddress(ARemoteAddress:Boolean);  
function GetConnRefused:Boolean;  
procedure SetConnRefused(AConnRefused:Boolean);  
function GetClosed:Boolean;  
procedure SetClosed(AClosed:Boolean);  
public
property Unconnected:Boolean read GetUnconnected write SetUnconnected;  
property Connected:Boolean read GetConnected write SetConnected;  
property Connecting:Boolean read GetConnecting write SetConnecting;  
property Disconnecting:Boolean read GetDisconnecting write SetDisconnecting;  
property CantSendMore:Boolean read GetCantSendMore write SetCantSendMore;  
property CantRecvMore:Boolean read GetCantRecvMore write SetCantRecvMore;  
property RecvAtMark:Boolean read GetRecvAtMark write SetRecvAtMark;  
 
property Privileged:Boolean read GetPrivileged write SetPrivileged;  
property NonBlocking:Boolean read GetNonBlocking write SetNonBlocking;  
property Async:Boolean read GetAsync write SetAsync;  
property Listening:Boolean read GetListening write SetListening;  
 
property LocalAddress:Boolean read GetLocalAddress write SetLocalAddress;  
property RemoteAddress:Boolean read GetRemoteAddress write SetRemoteAddress;  
property ConnRefused:Boolean read GetConnRefused write SetConnRefused;  
property Closed:Boolean read GetClosed write SetClosed;  

Socket buffer

TSocketBuffer = class(TObject)

Note: Base Socket Buffer Class
 
constructor Create(ASocket:TTransportSocket);  
destructor Destroy; override;  
private
FLock:TMutexHandle;  
protected
FSocket:TTransportSocket; Socket owning this buffer
FBuffer:TMemoryStream; Memory Buffer for Data
 
FSize:LongWord; Physical Size of Data Buffer
FStart:Pointer; First Byte of Data Buffer
FEnd:Pointer; Last Byte of Data Buffer
 
FUsed:LongWord; Amount of Buffer Used
FFree:LongWord; Amount of Buffer Free
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
procedure SetSize(ASize:LongWord); virtual;  
public
property Size:LongWord read FSize write SetSize;  
 
function GetUsed:LongWord;  
function GetFree:LongWord;  

Socket options

TSocketOptions = class(TObject)

Note: For Get/Set Options Level = SOL_SOCKET Option = SO_KEEPALIVE, SO_ACCEPTCONN, SO_BROADCAST etc
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
FOptions:LongWord;  
 
FLinger:TLinger;  
FSendBuffer:Integer;  
FRecvBuffer:Integer;  
FSendLowMark:Integer;  
FRecvLowMark:Integer;  
FSendTimeout:LongWord;  
FRecvTimeout:LongWord;  
FConnTimeout:LongWord;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
procedure SetLinger(const ALinger:TLinger);  
procedure SetSendBuffer(ASendBuffer:Integer);  
procedure SetRecvBuffer(ARecvBuffer:Integer);  
procedure SetSendLowMark(ASendLowMark:Integer);  
procedure SetRecvLowMark(ARecvLowMark:Integer);  
procedure SetSendTimeout(ASendTimeout:LongWord);  
procedure SetRecvTimeout(ARecvTimeout:LongWord);  
procedure SetConnTimeout(AConnTimeout:LongWord);  
 
function GetDebug:Boolean;  
procedure SetDebug(ADebug:Boolean);  
function GetAccept:Boolean;  
procedure SetAccept(AAccept:Boolean);  
function GetReuseAddress:Boolean;  
procedure SetReuseAddress(AReuseAddress:Boolean);  
function GetKeepAlive:Boolean;  
procedure SetKeepAlive(AKeepAlive:Boolean);  
function GetDontRoute:Boolean;  
procedure SetDontRoute(ADontRoute:Boolean);  
function GetBroadcast:Boolean;  
procedure SetBroadcast(ABroadcast:Boolean);  
function GetUseLoopback:Boolean;  
procedure SetUseLoopback(AUseLoopback:Boolean);  
function GetUrgentInline:Boolean;  
procedure SetUrgentInline(AUrgentInline:Boolean);  
public
property Linger:TLinger read FLinger write SetLinger;  
property SendBuffer:Integer read FSendBuffer write SetSendBuffer;  
property RecvBuffer:Integer read FRecvBuffer write SetRecvBuffer;  
property SendLowMark:Integer read FSendLowMark write SetSendLowMark;  
property RecvLowMark:Integer read FRecvLowMark write SetRecvLowMark;  
property SendTimeout:LongWord read FSendTimeout write SetSendTimeout;  
property RecvTimeout:LongWord read FRecvTimeout write SetRecvTimeout;  
property ConnTimeout:LongWord read FConnTimeout write SetConnTimeout;  
 
property Debug:Boolean read GetDebug write SetDebug;  
property Accept:Boolean read GetAccept write SetAccept;  
property ReuseAddress:Boolean read GetReuseAddress write SetReuseAddress;  
property KeepAlive:Boolean read GetKeepAlive write SetKeepAlive;  
property DontRoute:Boolean read GetDontRoute write SetDontRoute;  
property Broadcast:Boolean read GetBroadcast write SetBroadcast;  
property UseLoopback:Boolean read GetUseLoopback write SetUseLoopback;  
property UrgentInline:Boolean read GetUrgentInline write SetUrgentInline;  

Transport state

TTransportState = class(TObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  

Transport options

TTransportOptions = class(TObject)

Note: For Get/Set Options at the Transport Level (eg IPPROTO_IP)
 
constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
protected
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  

Host entry

THostEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
 
FAliases:TStringList;  
 
function GetName:String;  
procedure SetName(const AName:String);  
procedure SetFamily(AFamily:Integer);  
procedure SetLength(ALength:Integer);  
procedure SetHostType(AHostType:Word);  
procedure SetHostTime(const AHostTime:Int64);  
protected
FName:String;  
FFamily:Integer; Always 2 for AF_INET
FLength:Integer; Always 4 for AF_INET
FHostType:Word;  
FHostTime:Int64;  
public
property Name:String read GetName write SetName;  
property Family:Integer read FFamily write SetFamily;  
property Length:Integer read FLength write SetLength;  
property HostType:Word read FHostType write SetHostType;  
property HostTime:Int64 read FHostTime write SetHostTime;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function FindAlias(const Alias:String):Boolean;  
 
function AddAlias(const Alias:String):Boolean;  
function RemoveAlias(const Alias:String):Boolean;  

Route entry

TRouteEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
 
procedure SetFamily(AFamily:Integer);  
procedure SetLength(ALength:Integer);  
procedure SetMetric(AMetric:Integer);  
procedure SetRouteType(ARouteType:Word);  
procedure SetRouteTime(const ARouteTime:Int64);  
protected
FFamily:Integer; Always 2 for AF_INET
FLength:Integer; Always 4 for AF_INET
FMetric:Integer;  
FRouteType:Word;  
FRouteTime:Int64;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
public
property Family:Integer read FFamily write SetFamily;  
property Length:Integer read FLength write SetLength;  
property Metric:Integer read FMetric write SetMetric;  
property RouteType:Word read FRouteType write SetRouteType;  
property RouteTime:Int64 read FRouteTime write SetRouteTime;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  

Address entry

TAddressEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TSynchronizerHandle;  
FLocalLock:TMutexHandle;  
 
procedure SetFamily(AFamily:Integer);  
procedure SetLength(ALength:Integer);  
procedure SetAddressType(AAddressType:Word);  
procedure SetAddressTime(const AAddressTime:Int64);  
procedure SetAdapter(AAdapter:TNetworkAdapter);  
protected
FFamily:Integer; Always 2 for AF_INET
FLength:Integer; Always 4 for AF_INET
FAddressType:Word; Dynamic/Static/Multicast/Broadcast/Primary/Secondary
FAddressTime:Int64; Flush time for Dynamic entries
FAdapter:TNetworkAdapter;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
public
property Family:Integer read FFamily write SetFamily;  
property Length:Integer read FLength write SetLength;  
property AddressType:Word read FAddressType write SetAddressType;  
property AddressTime:Int64 read FAddressTime write SetAddressTime;  
property Adapter:TNetworkAdapter read FAdapter write SetAdapter;  
 
function ReaderLock:Boolean;  
function ReaderUnlock:Boolean;  
function ReaderConvert:Boolean;  
function WriterLock:Boolean;  
function WriterUnlock:Boolean;  
function WriterConvert:Boolean;  

Network entry

TNetworkEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
 
FAliases:TStringList;  
 
function GetName:String;  
procedure SetName(const AName:String);  
procedure SetFamily(AFamily:Integer);  
procedure SetLength(ALength:Integer);  
protected
FName:String;  
FFamily:Integer; Always 2 for AF_INET
FLength:Integer; Always 4 for AF_INET
public
property Name:String read GetName write SetName;  
property Family:Integer read FFamily write SetFamily;  
property Length:Integer read FLength write SetLength;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function FindAlias(const Alias:String):Boolean;  
 
function AddAlias(const Alias:String):Boolean;  
function RemoveAlias(const Alias:String):Boolean;  

Service entry

TServEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
 
FAliases:TStringList;  
 
function GetName:String;  
procedure SetName(const AName:String);  
procedure SetPort(APort:Word);  
function GetProtocol:String;  
procedure SetProtocol(const AProtocol:String);  
protected
FName:String;  
FPort:Word;  
FProtocol:String;  
public
property Name:String read GetName write SetName;  
property Port:Word read FPort write SetPort;  
property Protocol:String read GetProtocol write SetProtocol;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function FindAlias(const Alias:String):Boolean;  
 
function AddAlias(const Alias:String):Boolean;  
function RemoveAlias(const Alias:String):Boolean;  

Protocol entry

TProtoEntry = class(TListObject)

constructor Create;  
destructor Destroy; override;  
private
FLock:TCriticalSectionHandle;  
 
FAliases:TStringList;  
 
function GetName:String;  
procedure SetName(const AName:String);  
procedure SetNumber(ANumber:Word);  
protected
FName:String;  
FNumber:Word;  
public
property Name:String read GetName write SetName;  
property Number:Word read FNumber write SetNumber;  
 
function AcquireLock:Boolean;  
function ReleaseLock:Boolean;  
 
function FindAlias(const Alias:String):Boolean;  
 
function AddAlias(const Alias:String):Boolean;  
function RemoveAlias(const Alias:String):Boolean;  


Public variables



Transport specific variables

TransportManager:TTransportManager;


Function declarations



Initialization functions

procedure TransportInit;
Description: To be documented
Note None documented


function TransportStart:LongWord;
Description: To be documented
Note None documented


function TransportStop:LongWord;
Description: To be documented
Note None documented


function TransportBind:LongWord;
Description: To be documented
Note None documented


function TransportUnbind:LongWord;
Description: To be documented
Note None documented


Transport functions

function InAddrToHost(const AAddress:TInAddr):TInAddr; inline;
Description: Convert an InAddr in Network order to Host order
Note None documented


function InAddrToNetwork(const AAddress:TInAddr):TInAddr; inline;
Description: Convert an InAddr in Host order to Network order
Note None documented


function InAddrToString(const AAddress:TInAddr):String;
Description: Convert an InAddr to a String
Note Expects Address to be in Network order


function StringToInAddr(const AAddress:String):TInAddr;
Description: Convert a String to an InAddr
Note Returns Address in Network order


function InAddrIsEqual(const AAddress1,AAddress2:TInAddr):Boolean;
Description: Check the supplied addresses to see if they are the same
Note Expects Address to be in Host order


function InAddrIsDefault(const AAddress:TInAddr):Boolean;
Description: Check the supplied address to see if it is the default address
Note Expects Address to be in Host order


function InAddrIsLoopback(const AAddress:TInAddr):Boolean;
Description: Check the supplied address to see if it is a loopback address
Note Expects Address to be in Host order


function InAddrIsBroadcast(const AAddress:TInAddr):Boolean;
Description: Check the supplied address to see if it is the broadcast address
Note Expects Address to be in Host order


function InAddrIsMulticast(const AAddress:TInAddr):Boolean;
Description: Check the supplied address to see if it is a multicast address
Note Expects Address to be in Host order


function In6AddrToString(const AAddress:TIn6Addr):String;
Description: To be documented
Note None documented


function StringToIn6Addr(const AAddress:String):TIn6Addr;
Description: To be documented
Note None documented


function In6AddrIsEqual(const AAddress1,AAddress2:TIn6Addr):Boolean;
Description: Check the supplied addresses to see if they are the same
Note None documented


function In6AddrIsDefault(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is the default address
Note None documented


function In6AddrIsLoopback(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a loopback address
Note None documented


function In6AddrIsLinkLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a link local address
Note None documented


function In6AddrIsSiteLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a site local address
Note None documented


function In6AddrIsV4Mapped(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a V4 mapped address
Note None documented


function In6AddrIsV4Compatible(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a V4 compatible address
Note None documented


function In6AddrIsMulticast(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast address
Note None documented


function In6AddrIsMulticastNodeLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast node local address
Note None documented


function In6AddrIsMulticastLinkLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast link local address
Note None documented


function In6AddrIsMulticastSiteLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast site local address
Note None documented


function In6AddrIsMulticastOrgLocal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast org local address
Note None documented


function In6AddrIsMulticastGlobal(const AAddress:TIn6Addr):Boolean;
Description: Check the supplied address to see if it is a multicast global address
Note None documented


function IpxAddrToString(const AAddress:TIpxAddr):String;
Description: To be documented
Note None documented


function StringToIpxAddr(const AAddress:String):TIpxAddr;
Description: To be documented
Note None documented


function GetChecksum(ABuffer:Pointer; AOffset,ALength:Word):Word;
Description: Calculate the 1s Compliment Checksum of the Supplied Buffer
Note None documented


function GetChecksum2(APseudo,ABuffer:Pointer; APseudoLength,ABufferOffset,ABufferLength:Word):Word;
Description: Calculate the 1s Compliment Checksum of the Supplied Pseudo and Buffer
Note Pseudo is expected to start from Offset 0


function GetChecksum3(APseudo,AHeader,AData:Pointer; APseudoLength,AHeaderLength,ADataOffset,ADataLength:Word):Word;
Description: Calculate the 1s Compliment Checksum of the Supplied Pseudo, Header and Data
Note Pseudo and Header are expected to start from Offset 0


function GetChecksum4(APseudo,AHeader,AOptions,AData:Pointer; APseudoLength,AHeaderLength,AOptionsLength,ADataOffset,ADataLength:Word):Word;
Description: Calculate the 1s Compliment Checksum of the Supplied Pseudo, Header, Options and Data
Note Pseudo, Header and Options are expected to start from Offset 0


Transport helper functions

function HostTypeToString(AType:Word):String;
Description: To be documented
Note None documented


function RouteTypeToString(AType:Word):String;
Description: To be documented
Note None documented


function AddressTypeToString(AType:Word):String;
Description: To be documented
Note None documented


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


function SocketTypeToString(ASocketType:Word):String;
Description: To be documented
Note None documented


function AddressFamilyToString(AFamily:Word):String;
Description: To be documented
Note None documented


Return to Unit Reference