Skip to content

Documentation/netutils: add comprehensive guide for telnetd - #20586

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
Swatantra-66:doc/telnetd-guide
Oct 11, 2026
Merged

xiaoxiang781216 merged 1 commit into
apache:masterfrom
Swatantra-66:doc/telnetd-guide

Conversation

@Swatantra-66

@Swatantra-66 Swatantra-66 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Addresses #11081.

This PR replaces the 31-line placeholder stub in Documentation/applications/netutils/telnetd/index.rst with a comprehensive, authoritative documentation guide for the telnetd (Telnet daemon) network utility.

Part of the ongoing netutils documentation enhancement series (alongside #20472, #20493, #20513, #20514, and #20578).

Contents Added:

  1. Protocol Specifications & Standards:
    • Covers RFC 854 (Core Telnet Specification), RFC 855 (Option Specifications), and RFC 1073 (Window Size - NAWS).
    • Security considerations addressing unencrypted plaintext transmission, management network isolation, and Dropbear SSH alternatives.
  2. Operational Architecture & Lifecycle:
    • Detailed breakdown and ASCII workflow of the modular split between apps/netutils/telnetd (user-space daemon) and drivers/net/telnet.c (kernel character driver factory).
    • Dynamic /dev/telnet%d character driver allocation, IAC command state machine, and dup2() STDIO virtualization.
    • Line-ending handling: RFC 854 transmit formatting (CR LF / deferred CR NUL) and transparent receive passthrough to shell line discipline.
  3. Comprehensive Configuration Options:
    • Configuration tables for daemon settings, driver ring buffers (CONFIG_TELNET_RXBUFFER_SIZE, CONFIG_TELNET_TXBUFFER_SIZE, CONFIG_TELNET_MAXLCLIENTS), and NSH Telnet console (CONFIG_NSH_TELNET, ports, daemon/client stack & priorities).
    • STDIO packet buffering optimization guidelines (CONFIG_STDIO_LINEBUFFER, CONFIG_STDIO_BUFFER_SIZE >= 64).
  4. Public C API Reference:
    • Complete field-level documentation for struct telnetd_config_s and telnetd_daemon().
  5. Complete Application Example:
    • Runnable C implementation demonstrating background listener task creation and interactive shell callbacks for both flat/protected (t_entry) and kernel (t_path) builds.
  6. Client Connection Walkthroughs:
    • Terminal connection guides for Linux, macOS (including Homebrew installation prerequisite and netcat alternative), and Windows (PuTTY).
  7. Troubleshooting & Best Practices Table:
    • Addressing character latency, connection refused, task stack sizing, client limits, and escape sequence commands.

Impact

  • Documentation only. No runtime, API, or binary code changes.

Testing

  • Verified with tools/checkpatch.sh -g HEAD (0 errors, 0 warnings).
  • Built and validated with Sphinx and Docutils rST parser (0 syntax or indentation errors).

Provide a complete documentation guide for the telnetd (Telnet daemon)
network utility in Documentation/applications/netutils/telnetd/index.rst,
replacing the previous 31-line placeholder stub.

Includes:
- Protocol architecture overview (modular split between apps/netutils/telnetd
  daemon and drivers/net/telnet.c character driver factory, /dev/telnet%d
  session wrapping, standard I/O redirection via dup2, child task execution)
- RFC 854 / RFC 855 / RFC 1073 (NAWS) protocol compliance and IAC state
  machine handling
- Transmit line-ending formatting (CR LF / CR NUL) and transparent
  receive passthrough to shell line discipline
- Security considerations regarding unencrypted plaintext transmission,
  network isolation, and encrypted alternatives (Dropbear SSH)
- Comprehensive configuration options tables for daemon, driver, and NSH
  Telnet console (apps/nshlib)
- STDIO buffering and packet efficiency guidelines (CONFIG_STDIO_LINEBUFFER,
  CONFIG_STDIO_BUFFER_SIZE)
- Public C API documentation for struct telnetd_config_s and telnetd_daemon()
- Complete, runnable C application example demonstrating standalone custom
  shell bringup, background listener task creation, and connection lifecycle
  for flat/protected builds (t_entry) and kernel builds (t_path)
- Client connection walkthroughs for Linux, macOS (including Homebrew
  installation note and netcat alternative), and Windows (PuTTY, telnet)
- Troubleshooting and best practices table for buffer sizing, connection
  failures, and escape sequences

Signed-off-by: Swatantra Yadav <[email protected]>
@github-actions github-actions Bot added Area: Documentation Improvements or additions to documentation Size: L The size of the change in this PR is large labels Oct 11, 2026
@acassis

acassis commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Thank you @Swatantra-66

@xiaoxiang781216
xiaoxiang781216 merged commit 4bc1ab2 into apache:master Oct 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Documentation Improvements or additions to documentation Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants