Unit Services

From Ultibo.org
Revision as of 03:46, 27 March 2017 by Ultibo (Talk | contribs)

Jump to: navigation, search

Return to Unit Reference


Description


Ultibo Services interface unit

To be documented

Constants



[Expand]
NTP specific constants NTP_*


[Expand]
NTP leap indicator NTP_LEAP_*


[Expand]
NTP mode NTP_MODE_*


[Expand]
NTP stratum NTP_STRATUM_*


[Expand]
Telnet char TELNET_CHAR_*


[Expand]
Telnet state TELNET_STATE_*


[Expand]
Telnet command TELNET_COMMAND_*


[Expand]
Telnet option TELNET_OPTION_*


[Expand]
SysLog facility code SYSLOG_FACILITY_*


[Expand]
SysLog severity code SYSLOG_SEVERITY_*


[Expand]
Service logging SERVICE_LOG_*


Type definitions



NTP short

[Expand]

PNTPShort = ^TNTPShort;

TNTPShort = packed record

NTP timestamp

[Expand]

PNTPTimestamp = ^TNTPTimestamp;

TNTPTimestamp = packed record

NTP date format

[Expand]

PNTPDate = ^TNTPDate;

TNTPDate = packed record

NTP packet

[Expand]

PNTPPacket = ^TNTPPacket;

TNTPPacket = packed record

Syslog logging

[Expand]

PSyslogLogging = ^TSyslogLogging;

TSyslogLogging = record

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

[Expand]

TPingClient = class(TWinsock2RAWClient)

NTP client

[Expand]

TNTPClient = class(TWinsock2UDPClient)

Telnet buffer

[Expand]

TTelnetBuffer = class(TObject)

Telnet connection

[Expand]

TTelnetConnection = class(TListObject)

Telnet listener

[Expand]

TTelnetListener = class(TWinsock2TCPListener)

SysLog client

[Expand]

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

[Expand]
procedure ServicesInit;
Description: To be documented


NTP functions

[Expand]
procedure NTPUpdateTime(Client:TNTPClient);
Description: To be documented


SysLog functions

[Expand]
function SysLogLoggingStart(Logging:PLoggingDevice):LongWord;
Description: To be documented


[Expand]
function SysLogLoggingStop(Logging:PLoggingDevice):LongWord;
Description: To be documented


[Expand]
function SysLogLoggingOutput(Logging:PLoggingDevice; const Data:String):LongWord;
Description: To be documented


[Expand]
function SysLogLoggingOutputEx(Logging:PLoggingDevice; Facility,Severity:LongWord; const Tag,Content:String):LongWord;
Description: To be documented


[Expand]
function SysLogLoggingGetTarget(Logging:PLoggingDevice):String;
Description: To be documented


[Expand]
function SysLogLoggingSetTarget(Logging:PLoggingDevice; const Target:String):LongWord;
Description: To be documented


Service helper functions

[Expand]
procedure ServiceLog(Level:LongWord;const AText:String);
Description: To be documented


[Expand]
procedure ServiceLogInfo(const AText:String);
Description: To be documented


[Expand]
procedure ServiceLogError(const AText:String);
Description: To be documented


[Expand]
procedure ServiceLogDebug(const AText:String);
Description: To be documented


NTP helper functions

[Expand]
function NTPTimestampToHost(const Timestamp:TNTPTimestamp):TNTPTimestamp;
Description: Convert an NTP Timestamp to Host order


[Expand]
function NTPTimestampToNetwork(const Timestamp:TNTPTimestamp):TNTPTimestamp;
Description: Convert an NTP Timestamp to Network order


[Expand]
function NTPTimestampAdd(const Timestamp1,Timestamp2:TNTPTimestamp):TNTPTimestamp;
Description: To be documented


[Expand]
function NTPTimestampSubtract(const Timestamp1,Timestamp2:TNTPTimestamp):TNTPTimestamp;
Description: To be documented


[Expand]
function ClockTimeToNTPTimestamp(const Time:Int64):TNTPTimestamp;
Description: To be documented


[Expand]
function NTPTimestampToClockTime(const Timestamp:TNTPTimestamp):Int64;
Description: To be documented


Telnet helper functions

[Expand]
function TelnetCommandToString(Command:Byte):String;
Description: To be documented


[Expand]
function TelnetCommandHasOption(Command:Byte):Boolean;
Description: To be documented


[Expand]
function TelnetOptionToString(Option:Byte):String;
Description: To be documented


SysLog helper functions

[Expand]
function FileTimeToSysLogDateTime(const AFileTime:TFileTime):String;
Description: To be documented


[Expand]
function LoggingFacilityToSysLogFacility(Facility:LongWord):LongWord;
Description: To be documented


[Expand]
function LoggingSeverityToSysLogSeverity(Severity:LongWord):LongWord;
Description: To be documented


Return to Unit Reference