Table of Contents

Name

lgwping - send message to logiweb server and print response

Synopsis

lgwping [-v] [port [host [request]]]

Description

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.

Options

-v
Print version and exit.

port
The udp port number to send the request to. To see the default value, run lgwping without arguments.

host
The host to send the request to. This can be given as a domain name like logiweb.eu or as a dotted ip like 127.0.0.1. To see the default value, run lgwping without arguments.

request
The request to be sent in 'mixed endian hexadecimal'. A 'mixed endian hexadecimal' number consists of an even number of hexadecimal digits. Each pair of two digits represents a byte with the most significant digit first. Bytes, on the contrary, are stated in network byte order. The request defaults to 02 which encodes a Logiweb 'ping' message, c.f. logiweb(7) .

Examples

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.

Author

Klaus Grue, http://logiweb.eu/

See Also

logiweb(1) , logiweb(7) , lgwrelay(1)


Table of Contents