Skip to main content

Module wire

Module wire 

Source
Expand description

Wire helpers for the classic inetd services: Echo (RFC 862), Discard (RFC 863), Chargen (RFC 864), QOTD (RFC 865), Daytime (RFC 867) and Time (RFC 868).

Constants§

IO_TIMEOUT
Write and per-reply deadline.
MAX_CHARGEN_LINE
Upper bound on a chargen line.
MAX_CHARGEN_UDP
RFC 864: a UDP chargen reply is between 0 and 512 characters.
MAX_DAYTIME_CHARS
Daytime text a handler may supply.
MAX_QUOTE_CHARS
RFC 865: a quote should be limited to 512 characters.
MAX_STREAM_REPLY
Bytes a client reads from a stream service (Daytime, QOTD, Time) before giving up.
READ_CHUNK
One TCP read, and the largest UDP datagram accepted.
SECONDS_1900_TO_1970
Seconds between 1900-01-01 and 1970-01-01 (RFC 868).

Functions§

chargen_line
Line n of the rotating chargen pattern: width characters starting n into the set.
charset
Validate a handler’s chargen character set: printable ASCII, 1 to 95 characters.
conforms_to_chargen
Whether text follows the rotating pattern of charset (any starting offset, any width).
daytime_now
RFC 867 suggests “Weekday, Month Day, Year HH:MM:SS-ZONE”.
decode
Bytes from an action’s data and encoding (utf8, the default, or hex).
default_charset
The RFC 864 character set: the 95 printable ASCII characters, space first.
describe_time
Describe a received RFC 868 value for a handler.
encode
Data for an event: text when it is printable UTF-8, hex otherwise, with the encoding named.
line
Handler text for a reply line: no control characters, at most limit characters.
requested_time
Unix seconds from a handler’s time_reply: unix_seconds, iso8601, or now.
time_bytes
RFC 868 time: seconds since 1900 as a 32-bit big-endian number (wrapping in 2036).