|
|
(9 intermediate revisions by the same user not shown) |
Line 5: |
Line 5: |
| ---- | | ---- |
| | | |
− | '''Ultibo Network Protocol interface unit''' | + | '''Ultibo Network Protocol Interface unit''' |
− | | + | |
− | ''To be documented''
| + | |
| | | |
| === Constants === | | === Constants === |
Line 28: |
Line 26: |
| <br /> | | <br /> |
| <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> |
− | <div style="font-size: 14px; padding-left: 12px;">'''Protocol timer''' <code> SOCKET_TIMER_* </code></div> | + | <div style="font-size: 14px; padding-left: 12px;">'''Protocol timer key values''' <code> SOCKET_TIMER_KEY_* </code></div> |
| <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> |
| {| class="wikitable" style="font-size: 14px; background: white;" | | {| class="wikitable" style="font-size: 14px; background: white;" |
Line 40: |
Line 38: |
| | <code>SOCKET_TIMER_KEY_MIN = TIMER_KEY_MIN;</code> | | | <code>SOCKET_TIMER_KEY_MIN = TIMER_KEY_MIN;</code> |
| | | | | |
| + | |- |
| + | |} |
| + | </div></div> |
| + | <br /> |
| + | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> |
| + | <div style="font-size: 14px; padding-left: 12px;">'''Protocol timer flag values''' <code> SOCKET_TIMER_FLAG_* </code></div> |
| + | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> |
| + | {| class="wikitable" style="font-size: 14px; background: white;" |
| + | |- |
| + | | <code>SOCKET_TIMER_FLAG_NONE = $00000000;</code> |
| + | | |
| + | |- |
| + | | <code>SOCKET_TIMER_FLAG_ACTIVE = $00000001;</code> |
| + | | The socket timer item is active in a timer |
| + | |- |
| + | | <code>SOCKET_TIMER_FLAG_DYNAMIC = $00000002;</code> |
| + | | The socket timer item was allocated dynamically |
| |- | | |- |
| |} | | |} |
Line 252: |
Line 267: |
| | <code>Key:Integer;</code> | | | <code>Key:Integer;</code> |
| | Ordering key for timer list | | | Ordering key for timer list |
| + | |- |
| + | | <code>Flags:LongWord;</code> |
| + | | Flags for this timer item |
| |- | | |- |
| | <code>Socket:TObject;</code> | | | <code>Socket:TObject;</code> |
Line 297: |
Line 315: |
| | | |
| | | |
− | '''Protocol manager''' | + | '''Protocol specific classes''' |
| | | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | <code>TProtocolManager = 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; ATransports:TTransportManager);</code> | + | | [[TProtocolManager|<code>TProtocolManager = class(TObject)</code>]] |
− | | style="width: 50%;"|
| + | |
| |- | | |- |
− | | <code>destructor Destroy; override;</code> | + | |} |
− | | | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
| |- | | |- |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | + | | [[TProtocolTransport|<code>TProtocolTransport = class(TListObject)</code>]] |
| |- | | |- |
− | | <code>FLock:TSynchronizerHandle;</code> | + | |} |
− | | | + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
| |- | | |- |
− | | <code>FSettings:TNetworkSettings;</code> | + | | [[TNetworkProtocol|<code>TNetworkProtocol = class(TListObject)</code>]] |
− | |
| + | |
− | |-
| + | |
− | | <code>FTransports:TTransportManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FProtocols:TNetworkList;</code>
| + | |
− | | List of TNetworkProtocol objects
| + | |
− | |-
| + | |
− | | <code>FFilters:TNetworkList;</code> | + | |
− | | List of TNetworkFilter objects
| + | |
− | |-
| + | |
− | | <code>FConfigs:TNetworkList;</code>
| + | |
− | | List of TNetworkConfig objects
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Settings:TNetworkSettings read FSettings;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property Transports:TTransportManager read FTransports;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddProtocol(AProtocol:TNetworkProtocol):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveProtocol(AProtocol:TNetworkProtocol):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetProtocolByType(AProtocol,ASocketType:Word; ALock:Boolean; AState:LongWord):TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetProtocolByProtocol(AProtocol:TNetworkProtocol; ALock:Boolean; AState:LongWord):TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetProtocolByNext(APrevious:TNetworkProtocol; ALock,AUnlock:Boolean; AState:LongWord):TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddFilter(AFilter:TNetworkFilter):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveFilter(AFilter:TNetworkFilter):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetFilterByProtocol(AProtocol:Word; ALock:Boolean; AState:LongWord):TNetworkFilter;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetFilterByFilter(AFilter:TNetworkFilter; ALock:Boolean; AState:LongWord):TNetworkFilter;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetFilterByNext(APrevious:TNetworkFilter; ALock,AUnlock:Boolean; AState:LongWord):TNetworkFilter;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddConfig(AConfig:TNetworkConfig):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveConfig(AConfig:TNetworkConfig):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetConfigByType(AConfigType:Word; ALock:Boolean; AState:LongWord):TNetworkConfig;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetConfigByConfig(AConfig:TNetworkConfig; ALock:Boolean; AState:LongWord):TNetworkConfig;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetConfigByNext(APrevious:TNetworkConfig; ALock,AUnlock:Boolean; AState:LongWord):TNetworkConfig;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SetConfigByType(AConfigType:Word; AInitDelay,ARetryCount,ARetryTimeout:LongWord):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartProtocols:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopProtocols:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessProtocols:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ProcessSockets:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function EnumerateProtocols(ACallback:TProtocolCallback):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindProtocols(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindProtocols(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartFilters:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopFilters:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessFilters:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function EnumerateFilters(ACallback:TFilterCallback):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindFilters(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindFilters(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartConfigs:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopConfigs:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessConfigs:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function EnumerateConfigs(ACallback:TConfigCallback):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindConfigs(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindConfigs(ATransport:TNetworkTransport):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function CheckSocket(ASocket:TSocket; ALock:Boolean; AState:LongWord):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function Select(ANfds:Integer; AReadfds,AWritefds,AExceptfds:PFDSet; ATimeout:PTimeVal):LongInt;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Socket(AFamily,AStruct,AProtocol:Integer):TSocket;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Protocol transport'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TProtocolTransport = 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 | + | | [[TSocketTimer|<code>TSocketTimer = class(TObject)</code>]] |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create;</code> | + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>Handle:THandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Protocol:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Transport:TNetworkTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Network protocol'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TNetworkProtocol = 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:TProtocolManager; const AName:String);</code> | + | | [[TSocketThread|<code>TSocketThread = class(TThread)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FManager:TProtocolManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FName:String;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FProtocol:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FSocketType:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FTransports:TNetworkList;</code>
| + | |
− | | List of TProtocolTransport objects
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FTimer:TSocketTimer;</code>
| + | |
− | | Timer for socket processing
| + | |
− | |-
| + | |
− | | <code>FThread:TSocketThread;</code>
| + | |
− | | Thread for socket processing
| + | |
− | |-
| + | |
− | | <code>FPorts:TNetworkList;</code>
| + | |
− | | List of TProtocolPort objects
| + | |
− | |-
| + | |
− | | <code>FSockets:TNetworkList;</code>
| + | |
− | | List of TProtocolSocket objects
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FStatistics:TProtocolStatistics;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetTransportByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TProtocolTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByFamily(AFamily:Word; ALock:Boolean; AState:LongWord):TProtocolTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByTransport(ATransport:TNetworkTransport; ALock:Boolean; AState:LongWord):TProtocolTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByNext(APrevious:TProtocolTransport; ALock,AUnlock:Boolean; AState:LongWord):TProtocolTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function OpenPort(ASocket:TProtocolSocket; APort:Word):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ClosePort(ASocket:TProtocolSocket):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function FindPort(APort:Word; AWrite,ALock:Boolean):TProtocolPort; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetSocketByNext(APrevious:TProtocolSocket; ALock,AUnlock:Boolean; AState:LongWord):TProtocolSocket;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function CheckSocket(ASocket:TProtocolSocket; ALock:Boolean; AState:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function FindSocket(AFamily,AStruct,AProtocol:Word; ALocalAddress,ARemoteAddress:Pointer; ALocalPort,ARemotePort:Word; ABroadcast,AListen,ALock:Boolean; AState:LongWord):TProtocolSocket; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>procedure FlushSockets(All:Boolean); virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SelectStart(ASource,ADest:PFDSet):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function SelectCheck(ASource,ADest:PFDSet;ACode:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SendPacket(ASocket:TProtocolSocket; ASource,ADest:Pointer; ASourcePort,ADestPort:Word; APacket:PPacketFragment; ASize,AFlags:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Manager:TProtocolManager read FManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property Name:String read FName; </code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>property Protocol:Word read FProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property SocketType:Word read FSocketType;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function Accept(ASocket:TProtocolSocket; ASockAddr:PSockAddr; AAddrLength:PInteger):TProtocolSocket; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Bind(ASocket:TProtocolSocket; var ASockAddr:TSockAddr; AAddrLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function CloseSocket(ASocket:TProtocolSocket):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Connect(ASocket:TProtocolSocket; var ASockAddr:TSockAddr; AAddrLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function IoctlSocket(ASocket:TProtocolSocket; ACmd:DWORD; var AArg:u_long):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetPeerName(ASocket:TProtocolSocket; var ASockAddr:TSockAddr; var AAddrLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetSockName(ASocket:TProtocolSocket; var ASockAddr:TSockAddr; var AAddrLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetSockOpt(ASocket:TProtocolSocket; ALevel,AOptName:Integer; AOptValue:PChar; var AOptLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Listen(ASocket:TProtocolSocket; ABacklog:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Recv(ASocket:TProtocolSocket; var ABuffer; ALength,AFlags:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RecvFrom(ASocket:TProtocolSocket; var ABuffer; ALength,AFlags:Integer; var AFromAddr:TSockAddr; var AFromLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Select(ANfds:Integer; AReadfds,AWritefds,AExceptfds:PFDSet; ATimeout:PTimeVal):LongInt; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Send(ASocket:TProtocolSocket; var ABuffer; ALength,AFlags:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function SendTo(ASocket:TProtocolSocket; var ABuffer; ALength,AFlags:Integer; var AToAddr:TSockAddr; AToLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function SetSockOpt(ASocket:TProtocolSocket; ALevel,AOptName:Integer; AOptValue:PChar; AOptLength:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Shutdown(ASocket:TProtocolSocket; AHow:Integer):Integer; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function Socket(AFamily,AStruct,AProtocol:Integer):TProtocolSocket; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetStatistics:TProtocolStatistics; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartProtocol:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopProtocol:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessProtocol:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ProcessSockets:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessSocket(ASocket:TProtocolSocket):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindProtocol(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindProtocol(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function CheckTimer:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessTimer:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SendSocket(ASocket:TProtocolSocket):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ScheduleSocket(ASocket:TProtocolSocket; ATimeout:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnscheduleSocket(ASocket:TProtocolSocket):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ScheduleSocketItem(ASocket:TProtocolSocket; AItem:PSocketTimerItem; ATimeout:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnscheduleSocketItem(ASocket:TProtocolSocket; AItem:PSocketTimerItem):Boolean; virtual;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− |
| + | |
− | '''Socket timer'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TSocketTimer = 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(AProtocol:TNetworkProtocol);</code> | + | | [[TProtocolPort|<code>TProtocolPort = class(TListObject)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FProtocol:TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FLock:TMutexHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FInterval:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FCheckTimer:TTimerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FProcessSemaphore:TSemaphoreHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FCount:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FMaxCount:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FFirst:PSocketTimerItem;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FLast:PSocketTimerItem;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AcquireLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReleaseLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function Dequeue(AMax:Integer):TProtocolSocket;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function FirstKey:Integer;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function InsertKey(ASocket:TProtocolSocket; AItem:PSocketTimerItem; AKey:Integer):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function DeleteKey(ASocket:TProtocolSocket; AItem:PSocketTimerItem):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function DecrementKey:Integer;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Count:LongWord read FCount;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property MaxCount:LongWord read FMaxCount;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartTimer(AInterval:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopTimer:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function CheckTimer:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessTimer:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ScheduleSocket(ASocket:TProtocolSocket; ATimeout:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnscheduleSocket(ASocket:TProtocolSocket):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ScheduleSocketItem(ASocket:TProtocolSocket; AItem:PSocketTimerItem; ATimeout:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnscheduleSocketItem(ASocket:TProtocolSocket; AItem:PSocketTimerItem):Boolean; virtual;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Socket thread'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TSocketThread = class(TThread)</code>
| + | |
− | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
| + | |
− | {| class="wikitable" style="font-size: 14px; background: white;"
| + | |
| |- | | |- |
− | | <code>constructor Create(AProtocol:TNetworkProtocol);</code> | + | | [[TProtocolSocket|<code>TProtocolSocket = class(TTransportSocket)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FProtocol:TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>procedure Execute; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>function SendSocket(ASocket:TProtocolSocket):Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Protocol port'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TProtocolPort = 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> | + | | [[TProtocolState|<code>TProtocolState = class(TObject)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TMutexHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>Port:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Sockets:TList;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AcquireLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReleaseLock:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Protocol socket'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TProtocolSocket = class(TTransportSocket)</code>
| + | |
− | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
| + | |
− | {| class="wikitable" style="font-size: 14px; background: white;"
| + | |
| |- | | |- |
− | | <code>constructor Create(AProtocol:TNetworkProtocol; ATransport:TNetworkTransport);</code> | + | | [[TProtocolOptions|<code>TProtocolOptions = class(TObject)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FSocketChange:TEventHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FProtocol:TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FProtocolState:TProtocolState;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FProtocolOptions:TProtocolOptions;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function CheckSocket(ASocket:TProtocolSocket; ALock:Boolean; AState:LongWord):Boolean;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property ProtocolState:TProtocolState read FProtocolState;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property ProtocolOptions:TProtocolOptions read FProtocolOptions;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>property Protocol:TNetworkProtocol read FProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function WaitChange:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WaitChangeEx(ATimeout:LongWord):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function SignalChange:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SendSocket:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ScheduleSocket(ATimeout:LongWord):Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnscheduleSocket:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Protocol state'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TProtocolState = 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> | + | | [[TFilterTransport|<code>TFilterTransport = class(TListObject)</code>]] |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code> | + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TCriticalSectionHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FLocalPort:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FRemotePort:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AcquireLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReleaseLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>procedure SetLocalPort(ALocalPort:Word);</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>procedure SetRemotePort(ARemotePort:Word);</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property LocalPort:Word read FLocalPort write SetLocalPort;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property RemotePort:Word read FRemotePort write SetRemotePort;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Protocol options'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TProtocolOptions = 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 Protocol Level (eg IPPROTO_TCP, IPPROTO_UDP) | + | | [[TNetworkFilter|<code>TNetworkFilter = class(TListObject)</code>]] |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create;</code> | + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TCriticalSectionHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>function AcquireLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReleaseLock:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Filter transport'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TFilterTransport = 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 | + | | [[TConfigTransport|<code>TConfigTransport = class(TListObject)</code>]] |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create;</code> | + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>Handle:THandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Protocol:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Transport:TNetworkTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Network filter'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TNetworkFilter = 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 IP Filter | + | | [[TNetworkConfig|<code>TNetworkConfig = class(TListObject)</code>]] |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create(AManager:TProtocolManager);</code> | + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FManager:TProtocolManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FProtocol:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FTransports:TNetworkList;</code>
| + | |
− | | List of TFilterTransport objects
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetTransportByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TFilterTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByFamily(AFamily:Word; ALock:Boolean; AState:LongWord):TFilterTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByTransport(ATransport:TNetworkTransport; ALock:Boolean; AState:LongWord):TFilterTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByNext(APrevious:TFilterTransport; ALock,AUnlock:Boolean; AState:LongWord):TFilterTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Manager:TProtocolManager read FManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property Protocol:Word read FProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartFilter:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopFilter:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessFilter:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindFilter(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindFilter(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | '''Configuration transport'''
| + | |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TConfigTransport = 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 | + | | [[TNetworkClient|<code>TNetworkClient = class(TListObject)</code>]] |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create;</code> | + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>Handle:THandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>ConfigType:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>Transport:TNetworkTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div> | + | <br /> |
| | | |
− | '''Network configuration'''
| + | === Public variables === |
| + | ---- |
| | | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| |
| | | |
− | <code>TNetworkConfig = class(TListObject)</code>
| + | '''Protocol specific variables''' |
− | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
| + | |
− | {| class="wikitable" style="font-size: 14px; background: white;"
| + | |
− | |-
| + | |
− | |colspan="2"|Note: eg DHCP/BOOTP/RARP/STATIC/PSEUDO
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create(AManager:TProtocolManager);</code>
| + | |
− | | style="width: 50%;"|
| + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FManager:TProtocolManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>FConfigType:Word;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FInitDelay:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FRetryCount:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FRetryTimeout:LongWord;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>FTransports:TNetworkList;</code>
| + | |
− | | List of TConfigTransport objects
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function GetTransportByHandle(AHandle:THandle; ALock:Boolean; AState:LongWord):TConfigTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByFamily(AFamily:Word; ALock:Boolean; AState:LongWord):TConfigTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByTransport(ATransport:TNetworkTransport; ALock:Boolean; AState:LongWord):TConfigTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function GetTransportByNext(APrevious:TConfigTransport; ALock,AUnlock:Boolean; AState:LongWord):TConfigTransport;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function AddTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function RemoveTransport(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Manager:TProtocolManager read FManager;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property ConfigType:Word read FConfigType;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property InitDelay:LongWord read FInitDelay;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property RetryCount:LongWord read FRetryCount;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>property RetryTimeout:LongWord read FRetryTimeout;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartConfig:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopConfig:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ProcessConfig:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function BindConfig(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function UnbindConfig(ATransport:TNetworkTransport):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function SetConfig(AInitDelay,ARetryCount,ARetryTimeout:LongWord):Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |}
| + | |
− | </div></div>
| + | |
| | | |
− | '''Network client'''
| + | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" |
− | | + | |
− | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
| + | |
− | | + | |
− | <code>TNetworkClient = 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 DNS/WINS
| + | | <code>ProtocolManager:TProtocolManager;</code> |
− | |-
| + | | style="width: 40%;"| |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>constructor Create(AProtocol:TNetworkProtocol);</code> | + | |
− | | style="width: 50%;"| | + | |
− | |-
| + | |
− | | <code>destructor Destroy; override;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div>
| + | |
− | |-
| + | |
− | | <code>FLock:TSynchronizerHandle;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div>
| + | |
− | |-
| + | |
− | | <code>FProtocol:TNetworkProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div>
| + | |
− | |-
| + | |
− | | <code>property Protocol:TNetworkProtocol read FProtocol;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function ReaderLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function ReaderUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterLock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function WriterUnlock:Boolean;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | |colspan="2"|
| + | |
− | |-
| + | |
− | | <code>function StartClient:Boolean; virtual;</code>
| + | |
− | |
| + | |
− | |-
| + | |
− | | <code>function StopClient:Boolean; virtual;</code>
| + | |
− | |
| + | |
| |- | | |- |
| |} | | |} |
− | </div></div>
| |
| <br /> | | <br /> |
− |
| |
− | === Public variables ===
| |
− | ----
| |
− |
| |
− | ''None defined''
| |
| | | |
| === Function declarations === | | === Function declarations === |
Line 1,580: |
Line 415: |
| {| class="wikitable" style="font-size: 14px; background: white;" | | {| class="wikitable" style="font-size: 14px; background: white;" |
| |- | | |- |
− | ! '''Note''' | + | ! Note |
| | None documented | | | None documented |
| |- | | |- |
Line 1,592: |
Line 427: |
| {| class="wikitable" style="font-size: 14px; background: white;" | | {| class="wikitable" style="font-size: 14px; background: white;" |
| |- | | |- |
− | ! '''Note''' | + | ! Note |
| | None documented | | | None documented |
| |- | | |- |
Line 1,604: |
Line 439: |
| {| class="wikitable" style="font-size: 14px; background: white;" | | {| class="wikitable" style="font-size: 14px; background: white;" |
| |- | | |- |
− | ! '''Note''' | + | ! Note |
| | None documented | | | None documented |
| |- | | |- |
Line 1,619: |
Line 454: |
| {| class="wikitable" style="font-size: 14px; background: white;" | | {| class="wikitable" style="font-size: 14px; background: white;" |
| |- | | |- |
− | ! '''Note''' | + | ! Note |
| | None documented | | | None documented |
| |- | | |- |