lgwping - send message to logiweb server and print response
lgwping [-v] [port [host [request]]]
The lgwping program sends the given request to the Logiweb server listening at the given address and the given udp port and then prints the response. The lgwping program is typically used to send a Logiweb 'ping' request to a Logiweb server to see whether or not a Logiweb server listens at the given port.
In the example below, a user types 'lgwping' without options. Then lgwping types 'lgwping 65535 127.0.0.1 02' to indicate what default options it has used. The default values are determined at compile time. Then lgwping sends a Logiweb 'ping' (02) to the given host (127.0.0.1, the local host) and the given udp port (65535) and then prints the Logiweb 'pong' message received from the Logiweb server listening at the given port. The 'pong' is written in mixed endian hexadecimal. Then the example is repeated, giving a new 'pong' whose time stamp differs from the first pong.
> lgwping lgwping 65535 127.0.0.1 02 result: 03CCEFE7E9F7E5E201CAF9CCD6D49AA10806 > lgwping lgwping 65535 127.0.0.1 02 result: 03CCEFE7E9F7E5E201DBCB82D7D49AA10806
For a description of 'ping', 'pong', and other Logiweb messages, see logiweb(7) . In short, however, the anatomy of the 'pong' is thus: 03 is the identifier of a pong message. CCEFE7E9F7E5E201 identifies the Logiweb system. CCEFE7E9F7E5E2 is the character sequence 'Logiweb' with 128 added to the unicode of each character, 01 marks the end of the identifier (because it is below 128) and also serves as a version number. DBCB82D7D49AA10806 indicates the number of seconds that have elapsed since the Logiweb epoch. The Logiweb epoch is at International Atomic Time (TAI) 00:00:00 of Modified Julian Day (MJD) 0. DBCB82D7D49AA108 is the mantissa with the least significant byte first. 06 is minus the exponent, indicating that the responding server measures in microseconds.
Klaus Grue, http://logiweb.eu/
logiweb(1) , logiweb(7) , lgwrelay(1)