Patch #416079: fix the debug string output when receiving telnet commands.

added all the telnet options known to arpa/telnet.h
added all the options registered with IANA as of today
added the possibility for the user to have it's own option negotiation callback
This commit is contained in:
Martin v. Löwis 2001-09-06 08:51:38 +00:00
parent 7b0657027f
commit b0162f9afc
2 changed files with 95 additions and 6 deletions

View file

@ -9,7 +9,12 @@
The \module{telnetlib} module provides a \class{Telnet} class that
implements the Telnet protocol. See \rfc{854} for details about the
protocol.
protocol. In addition, it provides symbolic constants for the protocol
characters (IAC/DONT/DO/WONT/WILL), and for the telnet options. The
symbolic names of the telnet options follow the definitions in
\code{arpa/telnet.h}, with the leading \code{TELOPT_} removed. For
symbolic names of options which are traditionally not included in
\code{arpa/telnet.h}, see the module source itself.
\begin{classdesc}{Telnet}{\optional{host\optional{, port}}}
@ -158,6 +163,13 @@ or if more than one expression can match the same input, the
results are indeterministic, and may depend on the I/O timing.
\end{methoddesc}
\begin{methoddesc}{set_option_negotiation_callback}{callback}
Each time a telnet option is read on the input flow, this
\var{callback} (if set) is called with the following parameters :
callback(telnet socket, command (DO/DONT/WILL/WONT), option). No other
action is done afterwards by telnetlib.
\end{methoddesc}
\subsection{Telnet Example \label{telnet-example}}
\sectionauthor{Peter Funk}{pf@artcom-gmbh.de}