Difference between revisions of "Unit Services"

From Ultibo.org
Jump to: navigation, search
 
(24 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
----
 
----
  
''To be documented''
+
'''Ultibo Services Interface unit'''
  
 
=== Constants ===
 
=== Constants ===
 
----
 
----
  
''To be documented''
+
 
 +
<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;">'''Ping constants''' <code> PING_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>PING_DEFAULT_SIZE = 32;</code>
 +
| Default number of bytes of data to send with echo (Ping) request
 +
|-
 +
| <code>PING_MAXIMUM_SIZE = 65500;</code>
 +
| Maximum number of bytes of data to send with echo (Ping) request
 +
|-
 +
| <code>PING_DEFAULT_COUNT = 4;</code>
 +
| Default number of echo (ping) requests to send in a sequence
 +
|-
 +
| <code>PING_DEFAULT_TIMEOUT = 3000;</code>
 +
| Default time to wait for echo (Ping) response (Milliseconds)
 +
|-
 +
|}
 +
</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;">'''NTP specific constants''' <code> NTP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>NTP_VERSION_1 = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_VERSION_2 = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_VERSION_3 = 3;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_VERSION_4 = 4;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_VERSION_MASK = $07;</code>
 +
| shl 3
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_VERSION = NTP_VERSION_4;</code>
 +
| Current NTP/SNTP version
 +
|-
 +
| <code>NTP_MIN_VERSION = NTP_VERSION_2;</code>
 +
| Minimum acceptable NTP/SNTP version
 +
|-
 +
| <code>NTP_MAX_VERSION = NTP_VERSION_4;</code>
 +
| Maximum acceptable NTP/SNTP version
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_PACKET_SIZE = 48;</code>
 +
| SizeOf(TNTPPacket)
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_TIMESTAMP_START = 94354848000000000;</code>
 +
| Offset between 1/1/1601 (Ultibo) and 1/1/1900 (NTP Timestamp)
 +
|-
 +
|}
 +
</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;">'''NTP leap indicator''' <code> NTP_LEAP_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>NTP_LEAP_NONE = 0;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_LEAP_LAST_61 = 1;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_LEAP_LAST_59 = 2;</code>
 +
| &nbsp;
 +
|-
 +
| <code>NTP_LEAP_ALARM = 3;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_LEAP_MASK = $03;</code>
 +
| shl 6
 +
|-
 +
|}
 +
</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;">'''NTP mode''' <code> NTP_MODE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>NTP_MODE_RESERVED = 0;</code>
 +
| Reserved
 +
|-
 +
| <code>NTP_MODE_SYMMETRIC_ACTIVE = 1;</code>
 +
| Symmetric active
 +
|-
 +
| <code>NTP_MODE_SYMMETRIC_PASSIVE = 2;</code>
 +
| Symmetric passive
 +
|-
 +
| <code>NTP_MODE_CLIENT = 3;</code>
 +
| Client
 +
|-
 +
| <code>NTP_MODE_SERVER = 4;</code>
 +
| Server
 +
|-
 +
| <code>NTP_MODE_BROADCAST = 5;</code>
 +
| Broadcast
 +
|-
 +
| <code>NTP_MODE_CONTROL = 6;</code>
 +
| Reserved for NTP control message
 +
|-
 +
| <code>NTP_MODE_PRIVATE = 7;</code>
 +
| Reserved for private use
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>NTP_MODE_MASK = $07;</code>
 +
| shl 0
 +
|-
 +
|}
 +
</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;">'''NTP stratum''' <code> NTP_STRATUM_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>NTP_STRATUM_INVALID = 0;</code>
 +
| unspecified or invalid
 +
|-
 +
| <code>NTP_STRATUM_PRIMARY = 1;</code>
 +
| primary server (e.g., equipped with a GPS receiver)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY2 = 2;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY3 = 3;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY4 = 4;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY5 = 5;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY6 = 6;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY7 = 7;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY8 = 8;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY9 = 9;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY10 = 10;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY11 = 11;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY12 = 12;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY13 = 13;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY14 = 14;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_SECONDARY15 = 15;</code>
 +
| secondary server (via NTP)
 +
|-
 +
| <code>NTP_STRATUM_UNSYNCRONIZED = 16;</code>
 +
| unsynchronized
 +
|-
 +
| <code>NTP_STRATUM_RESERVED = 17;</code>
 +
| reserved
 +
|-
 +
|}
 +
</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;">'''Telnet character''' <code> TELNET_CHAR_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_CHAR_NUL = #0;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>TELNET_CHAR_CR = #13;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_CHAR_LF = #10;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_CHAR_BELL = #7;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_CHAR_TAB = #9;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_CHAR_ESC = #27;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_CHAR_BACKSPACE = #127;</code>
 +
| &nbsp;
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>TELNET_BUFFER_SIZE = SIZE_2K;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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;">'''Telnet escape sequence''' <code> TELNET_SEQUENCE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_SEQUENCE_UP_ARROW = #27#91#65;</code>
 +
| ESC[A
 +
|-
 +
| <code>TELNET_SEQUENCE_DOWN_ARROW = #27#91#66;</code>
 +
| ESC[B
 +
|-
 +
| <code>TELNET_SEQUENCE_RIGHT_ARROW = #27#91#67;</code>
 +
| ESC[C
 +
|-
 +
| <code>TELNET_SEQUENCE_LEFT_ARROW = #27#91#68;</code>
 +
| ESC[D
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>TELNET_SEQUENCE_HOME = #27#91#49#126;</code>
 +
| ESC[1~
 +
|-
 +
| <code>TELNET_SEQUENCE_INSERT = #27#91#50#126;</code>
 +
| ESC[2~
 +
|-
 +
| <code>TELNET_SEQUENCE_DELETE = #27#91#51#126;</code>
 +
| ESC[3~
 +
|-
 +
| <code>TELNET_SEQUENCE_END = #27#91#52#126;</code>
 +
| ESC[4~
 +
|-
 +
| <code>TELNET_SEQUENCE_PGUP = #27#91#53#126;</code>
 +
| ESC[5~
 +
|-
 +
| <code>TELNET_SEQUENCE_PGDN = #27#91#54#126;</code>
 +
| ESC[6~
 +
|-
 +
|colspan="2"|&nbsp;
 +
|-
 +
| <code>TELNET_SEQUENCE_F1 = #27#91#49#49#126;</code>
 +
| ESC[11~
 +
|-
 +
| <code>TELNET_SEQUENCE_F2 = #27#91#49#50#126;</code>
 +
| ESC[12~
 +
|-
 +
| <code>TELNET_SEQUENCE_F3 = #27#91#49#51#126;</code>
 +
| ESC[13~
 +
|-
 +
| <code>TELNET_SEQUENCE_F4 = #27#91#49#52#126;</code>
 +
| ESC[14~
 +
|-
 +
| <code>TELNET_SEQUENCE_F5 = #27#91#49#53#126;</code>
 +
| ESC[15~
 +
|-
 +
| <code>TELNET_SEQUENCE_F6 = #27#91#49#55#126;</code>
 +
| ESC[17~
 +
|-
 +
| <code>TELNET_SEQUENCE_F7 = #27#91#49#56#126;</code>
 +
| ESC[18~
 +
|-
 +
| <code>TELNET_SEQUENCE_F8 = #27#91#49#57#126;</code>
 +
| ESC[19~
 +
|-
 +
| <code>TELNET_SEQUENCE_F9 = #27#91#50#48#126;</code>
 +
| ESC[20~
 +
|-
 +
| <code>TELNET_SEQUENCE_F10 = #27#91#50#49#126;</code>
 +
| ESC[21~
 +
|-
 +
|}
 +
</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;">'''Telnet buffer''' <code> TELNET_BUFFER_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_BUFFER_SIZE = SIZE_2K;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</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;">'''Telnet state''' <code> TELNET_STATE_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_STATE_NONE = $00000000;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
| <code>TELNET_STATE_TRANSMIT_BINARY = $00000001;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_ECHO = $00000002;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_SUPPRESS_GA = $00000004;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_TERMINAL_TYPE = $00000008;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_WINDOW_SIZE = $00000010;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_TERMINAL_SPEED = $00000020;</code>
 +
| &nbsp;
 +
|-
 +
| <code>TELNET_STATE_NEW_ENVIRONMENT = $00000040;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</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;">'''Telnet command''' <code> TELNET_COMMAND_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_COMMAND_EOR = 239;</code>
 +
| 0xEF end of record command
 +
|-
 +
| <code>TELNET_COMMAND_SE = 240;</code>
 +
| 0xF0 end of subnegotiations command
 +
|-
 +
| <code>TELNET_COMMAND_NOP = 241;</code>
 +
| 0xF1 no operation command
 +
|-
 +
| <code>TELNET_COMMAND_DM = 242;</code>
 +
| 0xF2 data mark command
 +
|-
 +
| <code>TELNET_COMMAND_BRK = 243;</code>
 +
| 0xF3 break NVT charater
 +
|-
 +
| <code>TELNET_COMMAND_IP = 244;</code>
 +
| 0xF4 interrupt process command
 +
|-
 +
| <code>TELNET_COMMAND_AO = 245;</code>
 +
| 0xF5 abort output command
 +
|-
 +
| <code>TELNET_COMMAND_AYT = 246;</code>
 +
| 0xF6 are you there command
 +
|-
 +
| <code>TELNET_COMMAND_EC = 247;</code>
 +
| 0xF7 erase character command
 +
|-
 +
| <code>TELNET_COMMAND_EL = 248;</code>
 +
| 0xF8 erase line command
 +
|-
 +
| <code>TELNET_COMMAND_GA = 249;</code>
 +
| 0xF9 go ahead command
 +
|-
 +
| <code>TELNET_COMMAND_SB = 250;</code>
 +
| 0xFA begin option subnegotiations command
 +
|-
 +
| <code>TELNET_COMMAND_WILL = 251;</code>
 +
| 0xFB will enable option
 +
|-
 +
| <code>TELNET_COMMAND_WONT = 252;</code>
 +
| 0xFC won't enable option
 +
|-
 +
| <code>TELNET_COMMAND_DO = 253;</code>
 +
| 0xFD request other party enables option
 +
|-
 +
| <code>TELNET_COMMAND_DONT = 254;</code>
 +
| 0xFE request other party doesn't enable option
 +
|-
 +
| <code>TELNET_COMMAND_IAC = 255;</code>
 +
| 0xFF interpret as command
 +
|-
 +
|}
 +
</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;">'''Telnet option''' <code> TELNET_OPTION_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>TELNET_OPTION_TRANSMIT_BINARY = 0;</code>
 +
| 0x00 transmit binary option
 +
|-
 +
| <code>TELNET_OPTION_ECHO = 1;</code>
 +
| 0x01 echo option
 +
|-
 +
| <code>TELNET_OPTION_SUPPRESS_GA = 3;</code>
 +
| 0x03 suppress go ahead option
 +
|-
 +
| <code>TELNET_OPTION_TERMINAL_TYPE = 24;</code>
 +
| 0x18 terminal type
 +
|-
 +
| <code>TELNET_OPTION_WINDOW_SIZE = 31;</code>
 +
| 0x1F negotiate window size
 +
|-
 +
| <code>TELNET_OPTION_TERMINAL_SPEED = 32;</code>
 +
| 0x20 terminal speed
 +
|-
 +
| <code>TELNET_OPTION_NEW_ENVIRONMENT = 39;</code>
 +
| 0x27 new environment
 +
|-
 +
|}
 +
</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;">'''SysLog logging''' <code> SYSLOG_LOGGING_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SYSLOG_LOGGING_DESCRIPTION = 'SysLog Logging';</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</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;">'''SysLog facility code''' <code> SYSLOG_FACILITY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SYSLOG_FACILITY_KERNEL = 0;</code>
 +
| kernel messages
 +
|-
 +
| <code>SYSLOG_FACILITY_USER = 1;</code>
 +
| user-level messages
 +
|-
 +
| <code>SYSLOG_FACILITY_MAIL = 2;</code>
 +
| mail system
 +
|-
 +
| <code>SYSLOG_FACILITY_SYSTEM = 3;</code>
 +
| system daemons
 +
|-
 +
| <code>SYSLOG_FACILITY_SECURITY = 4;</code>
 +
| security/authorization messages (note 1)
 +
|-
 +
| <code>SYSLOG_FACILITY_SYSLOG = 5;</code>
 +
| messages generated internally by syslogd
 +
|-
 +
| <code>SYSLOG_FACILITY_PRINTER = 6;</code>
 +
| line printer subsystem
 +
|-
 +
| <code>SYSLOG_FACILITY_NEWS = 7;</code>
 +
| network news subsystem
 +
|-
 +
| <code>SYSLOG_FACILITY_UUCP = 8;</code>
 +
| UUCP subsystem
 +
|-
 +
| <code>SYSLOG_FACILITY_CLOCK = 9;</code>
 +
| clock daemon (note 2)
 +
|-
 +
| <code>SYSLOG_FACILITY_AUTH = 10;</code>
 +
| security/authorization messages (note 1)
 +
|-
 +
| <code>SYSLOG_FACILITY_FTP = 11;</code>
 +
| FTP daemon
 +
|-
 +
| <code>SYSLOG_FACILITY_NTP = 12;</code>
 +
| NTP subsystem
 +
|-
 +
| <code>SYSLOG_FACILITY_AUDIT = 13;</code>
 +
| log audit (note 1)
 +
|-
 +
| <code>SYSLOG_FACILITY_ALERT = 14;</code>
 +
| log alert (note 1)
 +
|-
 +
| <code>SYSLOG_FACILITY_CLOCK2 = 15;</code>
 +
| clock daemon (note 2)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL0 = 16;</code>
 +
| local use 0 (local0)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL1 = 17;</code>
 +
| local use 1 (local1)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL2 = 18;</code>
 +
| local use 2 (local2)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL3 = 19;</code>
 +
| local use 3 (local3)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL4 = 20;</code>
 +
| local use 4 (local4)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL5 = 21;</code>
 +
| local use 5 (local5)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL6 = 22;</code>
 +
| local use 6 (local6)
 +
|-
 +
| <code>SYSLOG_FACILITY_LOCAL7 = 23;</code>
 +
| local use 7 (local7)
 +
|-
 +
|}
 +
</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;">'''SysLog severity code''' <code> SYSLOG_SEVERITY_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SYSLOG_SEVERITY_EMERGENCY = 0;</code>
 +
| Emergency: system is unusable
 +
|-
 +
| <code>SYSLOG_SEVERITY_ALERT = 1;</code>
 +
| Alert: action must be taken immediately
 +
|-
 +
| <code>SYSLOG_SEVERITY_CRITICAL = 2;</code>
 +
| Critical: critical conditions
 +
|-
 +
| <code>SYSLOG_SEVERITY_ERROR = 3;</code>
 +
| Error: error conditions
 +
|-
 +
| <code>SYSLOG_SEVERITY_WARNING = 4;</code>
 +
| Warning: warning conditions
 +
|-
 +
| <code>SYSLOG_SEVERITY_NOTICE = 5;</code>
 +
| Notice: normal but significant condition
 +
|-
 +
| <code>SYSLOG_SEVERITY_INFORMATION = 6;</code>
 +
| Informational: informational messages
 +
|-
 +
| <code>SYSLOG_SEVERITY_DEBUG = 7;</code>
 +
| Debug: debug-level messages
 +
|-
 +
|}
 +
</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;">'''Service logging''' <code> SERVICE_LOG_* </code></div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>SERVICE_LOG_LEVEL_DEBUG = LOG_LEVEL_DEBUG;</code>
 +
| Service debugging messages
 +
|-
 +
| <code>SERVICE_LOG_LEVEL_INFO = LOG_LEVEL_INFO;</code>
 +
| Service informational messages, such as a service being created or destroyed
 +
|-
 +
| <code>SERVICE_LOG_LEVEL_WARN = LOG_LEVEL_WARN;</code>
 +
| Service warning messages
 +
|-
 +
| <code>SERVICE_LOG_LEVEL_ERROR = LOG_LEVEL_ERROR;</code>
 +
| Service error messages
 +
|-
 +
| <code>SERVICE_LOG_LEVEL_NONE = LOG_LEVEL_NONE;</code>
 +
| No Service messages
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''NTP short'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PNTPShort = ^TNTPShort;</code>
 +
 
 +
<code>TNTPShort = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: NTP Short Format
 +
|-
 +
| <code>Seconds:Word;</code>
 +
| Seconds
 +
|-
 +
| <code>Fraction:Word;</code>
 +
| Fraction
 +
|-
 +
|}
 +
</div></div>
 +
 +
'''NTP timestamp'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PNTPTimestamp = ^TNTPTimestamp;</code>
 +
 
 +
<code>TNTPTimestamp = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|Note: NTP Timestamp Format
 +
|-
 +
| <code>Seconds:LongWord;</code>
 +
| Seconds
 +
|-
 +
| <code>Fraction:LongWord;</code>
 +
| Seconds Fraction (0-padded)
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''NTP date format'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PNTPDate = ^TNTPDate;</code>
 +
 
 +
<code>TNTPDate = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>EraNumber:LongWord;</code>
 +
| Era Number
 +
|-
 +
| <code>EraOffset:LongWord;</code>
 +
| Era Offset
 +
|-
 +
| <code>Fraction:Int64;</code>
 +
| Fraction
 +
|-
 +
|}
 +
</div></div> 
 +
 
 +
'''NTP packet'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PNTPPacket = ^TNTPPacket;</code>
 +
 
 +
<code>TNTPPacket = packed record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| <code>LeapVersionMode:Byte;</code>
 +
| Leap Indicator (2 bits)/Version (3 bits)/Mode (3 bits)
 +
|-
 +
| <code>Stratum:Byte;</code>
 +
| This is an eight-bit unsigned integer indicating the stratum
 +
|-
 +
| <code>PollInterval:Byte;</code>
 +
| This is an eight-bit unsigned integer used as an exponent of two, where the resulting value is the maximum interval between successive messages in seconds.
 +
|-
 +
| <code>Precision:ShortInt;</code>
 +
| This is an eight-bit signed integer used as an exponent of two, where the resulting value is the precision of the system clock in seconds.
 +
|-
 +
| <code>RootDelay:LongInt;</code>
 +
| This is a 32-bit signed fixed-point number indicating the total roundtrip delay to the primary reference source, in seconds with the fraction point between bits 15 and 16.
 +
|-
 +
| <code>RootDispersion:LongWord;</code>
 +
| This is a 32-bit unsigned fixed-point number indicating the maximum error due to the clock frequency tolerance, in seconds with the fraction point between bits 15 and 16.
 +
|-
 +
| <code>ReferenceIdentifier:array[0..3] of Byte;</code>
 +
| This is a 32-bit bitstring identifying the particular reference source
 +
|-
 +
| <code>ReferenceTimestamp:TNTPTimestamp;</code>
 +
| This field is the time the system clock was last set or corrected, in 64-bit timestamp format.
 +
|-
 +
| <code>OriginateTimestamp:TNTPTimestamp;</code>
 +
| This is the time at which the request departed the client for the server, in 64-bit timestamp format.
 +
|-
 +
| <code>ReceiveTimestamp:TNTPTimestamp;</code>
 +
| This is the time at which the request arrived at the server or the reply arrived at the client, in 64-bit timestamp format.
 +
|-
 +
| <code>TransmitTimestamp:TNTPTimestamp;</code>
 +
| This is the time at which the request departed the client or the reply departed the server, in 64-bit timestamp format.
 +
|-
 +
| <code>KeyIdentifier:LongWord;</code>
 +
| Optional for NTP authentication
 +
|-
 +
| <code>MessageDigest:array[0..15] of Byte;</code>
 +
| Optional for NTP authentication
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Syslog logging'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PSyslogLogging = ^TSyslogLogging;</code>
 +
 
 +
<code>TSyslogLogging = record</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
|colspan="2"|''Logging Properties''
 +
|-
 +
| <code>Logging:TLoggingDevice;</code>
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|colspan="2"|''Syslog Properties''
 +
|-
 +
| <code>Client:TSyslogClient;</code>
 +
| &nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
 
 +
'''Telnet host event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetHostEvent = function(AConnection:TTelnetConnection):Boolean of Object;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Telnet count event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetCountEvent = function(AConnection:TTelnetConnection):Boolean of Object;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Telnet initialize event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetInitEvent = function(AConnection:TTelnetConnection):Boolean of Object;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Telnet character event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetCharEvent = function(AConnection:TTelnetConnection; AChar:Char):Boolean of Object;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Telnet command event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetCommandEvent = function(AConnection:TTelnetConnection; ACommand,AOption:Byte; AData:Pointer; ASize:LongWord):Boolean of Object;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Telnet connection event'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TTelnetConnectionEvent = procedure(AConnection:TTelnetConnection) of Object; </code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
 +
 
 +
=== Class definitions ===
 +
----
 +
 
 +
 
 +
'''Ping classes'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TPingClient|<code>TPingClient = class(TWinsock2RAWClient)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TNTPClient|<code>TNTPClient = class(TWinsock2UDPClient)</code>]]
 +
|-
 +
|}
 +
 
 +
'''Telnet classes'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TTelnetBuffer|<code>TTelnetBuffer = class(TObject)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TTelnetConnection|<code>TTelnetConnection = class(TListObject)</code>]]
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TTelnetListener|<code>TTelnetListener = class(TWinsock2TCPListener)</code>]]
 +
|-
 +
|}
 +
 
 +
'''SysLog classes'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TSyslogClient|<code>TSyslogClient = class(TObject)</code>]]
 +
|-
 +
|}
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Service logging'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>SERVICE_DEFAULT_LOG_LEVEL:LongWord = SERVICE_LOG_LEVEL_DEBUG;</code>
 +
| style="width: 40%;"|Minimum level for Service messages. Only messages with level greater than or equal to this will be printed.
 +
|-
 +
|}
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>SERVICE_LOG_ENABLED:Boolean;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
<br />
  
 
=== Function declarations ===
 
=== Function declarations ===
Line 34: Line 854:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 49: Line 869:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function WholeSeconds(Time:Int64):Int64;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Truncate a time value in 100ns intervals to whole seconds only</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 
|-
 
|-
 
|}
 
|}
Line 64: Line 896:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 76: Line 908:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 88: Line 920:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 100: Line 932:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 112: Line 944:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function SysLogLoggingSetTarget(Logging:PLoggingDevice; const Target:String):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 
|-
 
|-
 
|}
 
|}
Line 122: Line 966:
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLog(Level:LongWord;const AText:String);</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLog(Level:LongWord; const AText:String);</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 134: Line 978:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogInfo(const AText:String);</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogInfo(const AText:String); inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 146: Line 990:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogError(const AText:String);</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogWarn(const AText:String); inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 158: Line 1,002:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogDebug(const AText:String);</pre>
+
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogError(const AText:String); inline;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</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;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">procedure ServiceLogDebug(const AText:String); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 
|-
 
|-
 
|}
 
|}
Line 171: Line 1,027:
  
 
'''NTP helper functions'''
 
'''NTP helper functions'''
 +
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function NTPTimestampToHost(const Timestamp:TNTPTimestamp):TNTPTimestamp;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function NTPTimestampToHost(const Timestamp:TNTPTimestamp):TNTPTimestamp;</pre>
Line 177: Line 1,034:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 189: Line 1,046:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| None documented
 
|-
 
|-
 
|}
 
|}
Line 201: Line 1,058:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Expects Timestamp to be in Host order
+
| Expects Timestamp to be in Network order. Returns Timestamp in Network order.
 
|-
 
|-
 
|}
 
|}
Line 213: Line 1,070:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Expects Timestamp to be in Host order
+
| Expects Timestamp to be in Network order. Returns Timestamp in Network order.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function NTPTimestampDivide(const Timestamp:TNTPTimestamp; Divisor:LongWord):TNTPTimestamp;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Expects Timestamp to be in Network order. Returns Timestamp in Network order.
 
|-
 
|-
 
|}
 
|}
Line 225: Line 1,094:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Returns Timestamp in Host order
+
| Returns Timestamp in Network order
 
|-
 
|-
 
|}
 
|}
Line 237: Line 1,106:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| Expects Timestamp to be in Host order
+
| Expects Timestamp to be in Network order
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function NTPTimestampToString(const Timestamp:TNTPTimestamp):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Expects Timestamp to be in Network order
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''Telnet helper functions'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TelnetCommandToString(Command:Byte):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TelnetCommandHasOption(Command:Byte):Boolean;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function TelnetOptionToString(Option:Byte):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
'''SysLog helper functions'''
 +
 
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function FileTimeToSysLogDateTime(const AFileTime:TFileTime):String;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function LoggingFacilityToSysLogFacility(Facility:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function LoggingSeverityToSysLogSeverity(Severity:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 
|-
 
|-
 
|}
 
|}

Latest revision as of 04:43, 2 November 2022

Return to Unit Reference


Description


Ultibo Services Interface unit

Constants



[Expand]
Ping constants PING_*


[Expand]
NTP specific constants NTP_*


[Expand]
NTP leap indicator NTP_LEAP_*


[Expand]
NTP mode NTP_MODE_*


[Expand]
NTP stratum NTP_STRATUM_*


[Expand]
Telnet character TELNET_CHAR_*


[Expand]
Telnet escape sequence TELNET_SEQUENCE_*


[Expand]
Telnet buffer TELNET_BUFFER_*


[Expand]
Telnet state TELNET_STATE_*


[Expand]
Telnet command TELNET_COMMAND_*


[Expand]
Telnet option TELNET_OPTION_*


[Expand]
SysLog logging SYSLOG_LOGGING_*


[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 classes

TPingClient = class(TWinsock2RAWClient)
TNTPClient = class(TWinsock2UDPClient)

Telnet classes

TTelnetBuffer = class(TObject)
TTelnetConnection = class(TListObject)
TTelnetListener = class(TWinsock2TCPListener)

SysLog classes

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


[Expand]
function WholeSeconds(Time:Int64):Int64;
Description: Truncate a time value in 100ns intervals to whole seconds only


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); inline;
Description: To be documented


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


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


[Expand]
procedure ServiceLogDebug(const AText:String); inline;
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 NTPTimestampDivide(const Timestamp:TNTPTimestamp; Divisor:LongWord):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


[Expand]
function NTPTimestampToString(const Timestamp:TNTPTimestamp):String;
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