Difference between revisions of "Unit Services"
Line 663: | Line 663: | ||
---- | ---- | ||
− | '' | + | |
+ | '''Ping client''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TPingClient = class(TWinsock2RAWClient)</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''NTP client''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TNTPClient = class(TWinsock2UDPClient)</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>constructor Create;</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"| | ||
+ | |- | ||
+ | | <code>FPollInterval:LongWord;</code> | ||
+ | | How often to poll the server (in seconds) | ||
+ | |- | ||
+ | | <code>FPollTimeout:LongWord;</code> | ||
+ | | How long before receive or send timeout occurs (in milliseconds) | ||
+ | |- | ||
+ | | <code>FPollRetries:LongWord;</code> | ||
+ | | How many times to retry a poll | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FRetryTimeout:LongWord;</code> | ||
+ | | How long to wait between poll retries (in milliseconds) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FInitialClockGet:Boolean;</code> | ||
+ | | Has the time been obtained at least once | ||
+ | |- | ||
+ | | <code>FInitialClockCount:LongWord;</code> | ||
+ | | How many times have we tried to obtain the initial clock | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FTimerHandle:TTimerHandle;</code> | ||
+ | | Handle for the NTP update timer | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function AcquireLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ReleaseLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetPollInterval(APollInterval:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetPollTimeout(APollTimeout:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetPollRetries(APollRetries:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetRetryTimeout(ARetryTimeout:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetInitialClockGet(AInitialClockGet:Boolean);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetInitialClockCount(AInitialClockCount:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetTimerHandle(ATimerHandle:TTimerHandle);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property PollInterval:LongWord read FPollInterval write SetPollInterval;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property PollTimeout:LongWord read FPollTimeout write SetPollTimeout;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property PollRetries:LongWord read FPollRetries write SetPollRetries;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property RetryTimeout:LongWord read FRetryTimeout write SetRetryTimeout;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property InitialClockGet:Boolean read FInitialClockGet write SetInitialClockGet;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property InitialClockCount:LongWord read FInitialClockCount write SetInitialClockCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property TimerHandle:TTimerHandle read FTimerHandle write SetTimerHandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetTime:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure IncrementInitialClockCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Telnet buffer''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TTelnetBuffer = 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"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>constructor Create(ASize:LongWord);</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"| | ||
+ | |- | ||
+ | | <code>FData:Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FSize:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FStart:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function AcquireLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ReleaseLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetCount:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property Count:LongWord read GetCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function ReadData:Char;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function WriteData(AChar:Char):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function WriteLock(var ASize:LongWord):Pointer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function WriteUnlock(ACount:LongWord):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Telnet connection''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TTelnetConnection = 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"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <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"| | ||
+ | |- | ||
+ | | <code>FHandle:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FRxByteCount:Int64;</code> | ||
+ | | Bytes Recv Count from Connection | ||
+ | |- | ||
+ | | <code>FTxByteCount:Int64;</code> | ||
+ | | Bytes Sent Count to Connection | ||
+ | |- | ||
+ | | <code>FRequestCount:Int64;</code> | ||
+ | | Requests Recv Count from Connection | ||
+ | |- | ||
+ | | <code>FResponseCount:Int64;</code> | ||
+ | | Responses Sent Count to Connection | ||
+ | |- | ||
+ | | <code>FRequestTime:TDateTime;</code> | ||
+ | | Last Request Time | ||
+ | |- | ||
+ | | <code>FResponseTime:TDateTime;</code> | ||
+ | | Last Response Time | ||
+ | |- | ||
+ | | <code>FRemoteAddress:String;</code> | ||
+ | | Address of Remote Client | ||
+ | |- | ||
+ | | <code>FLocalState:LongWord;</code> | ||
+ | | Local connection state (eg TELNET_STATE_ECHO) | ||
+ | |- | ||
+ | | <code>FRemoteState:LongWord;</code> | ||
+ | | Remote connection state (eg TELNET_STATE_ECHO) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FData:Pointer;</code> | ||
+ | | Private data for application | ||
+ | |- | ||
+ | | <code>FThread:TThread;</code> | ||
+ | | TWinsock2TCPServerThread | ||
+ | |- | ||
+ | | <code>FBuffer:TTelnetBuffer;</code> | ||
+ | | Buffer for received data | ||
+ | |- | ||
+ | | <code>FListener:TTelnetListener;</code> | ||
+ | | Listener for Connection | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function AcquireLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ReleaseLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetHandle(AHandle:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetRxByteCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRxByteCount(const ARxByteCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetTxByteCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetTxByteCount(const ATxByteCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetRequestCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRequestCount(const ARequestCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetResponseCount:Int64;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetResponseCount(const AResponseCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetRequestTime:TDateTime;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRequestTime(const ARequestTime:TDateTime);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetResponseTime:TDateTime;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetResponseTime(const AResponseTime:TDateTime);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetRemoteAddress:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRemoteAddress(const ARemoteAddress:String);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetLocalState(ALocalState:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRemoteState(ARemoteState:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetData(AData:Pointer);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetThread(AThread:TThread);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetListener(AListener:TTelnetListener);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property Handle:LongWord read FHandle write SetHandle;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RxByteCount:Int64 read GetRxByteCount write SetRxByteCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property TxByteCount:Int64 read GetTxByteCount write SetTxByteCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RequestCount:Int64 read GetRequestCount write SetRequestCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property ResponseCount:Int64 read GetResponseCount write SetResponseCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RequestTime:TDateTime read GetRequestTime write SetRequestTime;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property ResponseTime:TDateTime read GetResponseTime write SetResponseTime;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RemoteAddress:String read GetRemoteAddress write SetRemoteAddress;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property LocalState:LongWord read FLocalState write SetLocalState;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RemoteState:LongWord read FRemoteState write SetRemoteState;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property Data:Pointer read FData write SetData;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property Thread:TThread read FThread write SetThread;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property Buffer:TTelnetBuffer read FBuffer;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property Listener:TTelnetListener read FListener write SetListener;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure IncrementRxByteCount(const ARxByteCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure IncrementTxByteCount(const ATxByteCount:Int64);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure IncrementRequestCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure IncrementResponseCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''Telnet listener''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TTelnetListener = class(TWinsock2TCPListener)</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>constructor Create;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''private'''</div> | ||
+ | |- | ||
+ | | <code>FOnConnected:TTelnetConnectionEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FOnDisconnected:TTelnetConnectionEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FOnCheckHost:TTelnetHostEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FOnCheckCount:TTelnetCountEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FOnInit:TTelnetInitEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FOnChar:TTelnetCharEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FOnCommand:TTelnetCommandEvent;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div> | ||
+ | |- | ||
+ | | <code>procedure DoConnect(AThread:TWinsock2TCPServerThread); override;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure DoDisconnect(AThread:TWinsock2TCPServerThread); override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function DoCheckHost(AThread:TWinsock2TCPServerThread):Boolean; virtual;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function DoCheckCount(AThread:TWinsock2TCPServerThread):Boolean; virtual;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function DoExecute(AThread:TWinsock2TCPServerThread):Boolean; override;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure DoInit(AThread:TWinsock2TCPServerThread);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure DoChar(AThread:TWinsock2TCPServerThread; AChar:Char);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure DoCommand(AThread:TWinsock2TCPServerThread; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function SendEcho(AThread:TWinsock2TCPServerThread; AChar:Char):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property OnConnected:TTelnetConnectionEvent read FOnConnected write FOnConnected;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property OnDisconnected:TTelnetConnectionEvent read FOnDisconnected write FOnDisconnected;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property OnCheckHost:TTelnetHostEvent read FOnCheckHost write FOnCheckHost;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property OnCheckCount:TTelnetCountEvent read FOnCheckCount write FOnCheckCount;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>property OnInit:TTelnetInitEvent read FOnInit write FOnInit;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property OnChar:TTelnetCharEvent read FOnChar write FOnChar;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property OnCommand:TTelnetCommandEvent read FOnCommand write FOnCommand;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function GetChar(AThread:TWinsock2TCPServerThread; var AChar:Char):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function SendChar(AThread:TWinsock2TCPServerThread; AChar:Char):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function SendText(AThread:TWinsock2TCPServerThread; const AText:String):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function SendCommand(AThread:TWinsock2TCPServerThread; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord):Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | |||
+ | '''SysLog client''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | |||
+ | <code>TSyslogClient = 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"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>constructor Create;</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"| | ||
+ | |- | ||
+ | | <code>FProtocol:LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FBoundPort:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FRemoteHost:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FRemotePort:Word;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FOctetCounting:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>FUDPClient:TWinsock2UDPClient;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>FTCPClient:TWinsock2TCPClient;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function AcquireLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function ReleaseLock:Boolean;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>procedure SetProtocol(AProtocol:LongWord);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetBoundPort(ABoundPort:Word);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetRemoteHost:String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRemoteHost(const ARemoteHost:String);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetRemotePort(ARemotePort:Word);</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>procedure SetOctetCounting(AOctetCounting:Boolean);</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''protected'''</div> | ||
+ | |- | ||
+ | | <code>function GetPriority(AFacility,ASeverity:LongWord):String;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>function GetMessage(const APriority,AAddress,ATag,AContent:String):String;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|<div style="font-family: monospace,courier;">'''public'''</div> | ||
+ | |- | ||
+ | | <code>property Protocol:LongWord read FProtocol write SetProtocol;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property BoundPort:Word read FBoundPort write SetBoundPort;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RemoteHost:String read GetRemoteHost write SetRemoteHost;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property RemotePort:Word read FRemotePort write SetRemotePort;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>property OctetCounting:Boolean read FOctetCounting write SetOctetCounting;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>function SendMessage(AFacility,ASeverity:LongWord; const ATag,AContent:String):LongWord;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === |
Revision as of 04:28, 20 March 2017
Return to Unit Reference
Contents
[hide]Description
Ultibo Services interface unit
To be documented
Constants
NTP_*
NTP_LEAP_*
NTP_MODE_*
NTP_STRATUM_*
TELNET_CHAR_*
TELNET_STATE_*
TELNET_COMMAND_*
TELNET_OPTION_*
SYSLOG_FACILITY_*
SYSLOG_SEVERITY_*
SERVICE_LOG_*
Type definitions
NTP short
NTP timestamp
NTP date format
NTP packet
Syslog logging
Telnet host event
TTelnetHostEvent = function(AConnection:TTelnetConnection):Boolean of Object;
|
Telnet count event
TTelnetCountEvent = function(AConnection:TTelnetConnection):Boolean of Object;
|
Telnet initialize event
TTelnetInitEvent = function(AConnection:TTelnetConnection):Boolean of Object;
|
Telnet character event
TTelnetCharEvent = function(AConnection:TTelnetConnection; AChar:Char):Boolean of Object;
|
Telnet command event
TTelnetCommandEvent = function(AConnection:TTelnetConnection; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord):Boolean of Object;
|
Telnet connection event
TTelnetConnectionEvent = procedure(AConnection:TTelnetConnection) of Object;
|
Class definitions
Ping client
TPingClient = class(TWinsock2RAWClient)
NTP client
TNTPClient = class(TWinsock2UDPClient)
Telnet buffer
TTelnetBuffer = class(TObject)
Telnet connection
TTelnetConnection = class(TListObject)
Telnet listener
TTelnetListener = class(TWinsock2TCPListener)
SysLog client
TSyslogClient = class(TObject)
Public variables
Service logging
SERVICE_DEFAULT_LOG_LEVEL:LongWord = SERVICE_LOG_LEVEL_DEBUG;
|
Minimum level for Service messages. Only messages with level greater than or equal to this will be printed. |
SERVICE_LOG_ENABLED:Boolean;
|
Function declarations
Initialization functions
NTP functions
SysLog functions
function SysLogLoggingStart(Logging:PLoggingDevice):LongWord;
function SysLogLoggingOutput(Logging:PLoggingDevice; const Data:String):LongWord;
function SysLogLoggingOutputEx(Logging:PLoggingDevice; Facility,Severity:LongWord; const Tag,Content:String):LongWord;
function SysLogLoggingGetTarget(Logging:PLoggingDevice):String;
function SysLogLoggingSetTarget(Logging:PLoggingDevice; const Target:String):LongWord;
Service helper functions
NTP helper functions
function NTPTimestampToHost(const Timestamp:TNTPTimestamp):TNTPTimestamp;
function NTPTimestampToNetwork(const Timestamp:TNTPTimestamp):TNTPTimestamp;
function NTPTimestampAdd(const Timestamp1,Timestamp2:TNTPTimestamp):TNTPTimestamp;
function NTPTimestampSubtract(const Timestamp1,Timestamp2:TNTPTimestamp):TNTPTimestamp;
function ClockTimeToNTPTimestamp(const Time:Int64):TNTPTimestamp;
function NTPTimestampToClockTime(const Timestamp:TNTPTimestamp):Int64;
Telnet helper functions
SysLog helper functions
function FileTimeToSysLogDateTime(const AFileTime:TFileTime):String;
function LoggingFacilityToSysLogFacility(Facility:LongWord):LongWord;
function LoggingSeverityToSysLogSeverity(Severity:LongWord):LongWord;
Return to Unit Reference