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
nof the rotating chargen pattern:widthcharacters startingninto 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
dataandencoding(utf8, the default, orhex). - 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
limitcharacters. - 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).