Subject: Re: a working lisp telnetd?
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 17 Jul 2005 05:17:29 -0500
Newsgroups: comp.lang.lisp
Message-ID: <vdGdnRSA4O6krUffRVn-3w@speakeasy.net>
GP lisper  <spambait@clouddancer.com> wrote:
+---------------
| Finger or Whois are essentially a single connection, squirt some info
| down the pipe and disconnect.  A hard part of telnetd is serving
| multiple connections.
+---------------

Sorry to contradict, but that's the *easy* part! The hard part of
doing a *real* "telnetd" is handling all the fiddly DO/DONT/WILL/WONT
commands (called "options" in the Telnet spec, but many of them are
not at all optional), and especially their negotiations. And then
there's the need to have hooks into the underlying TCP's "urgent
pointer" mechanism to handle interrupt-type Telnet commands.

People here on comp.lang.lisp somtimes complain that the Common Lisp
pathname mechanism was designed to accomodate the vagaries of
"strange operating systems that nobody uses anymore". Hah! You
ain't seen *nuttin'* in the way of supporting "strange operating
systems" 'til you try to do a complete implementation of Telnet!

Start by implementing RFCs 854 & 855, then implement all the RFCs
with the pattern "Telnet.*Option" in the title, some 50+ of them
[I may have missed a few]:

 RFC 651 Revised Telnet status option.
     652 Telnet output carriage-return disposition option.
     653 Telnet output horizontal tabstops option.
     654 Telnet output horizontal tab disposition option.
     655 Telnet output formfeed disposition option.
     656 Telnet output vertical tabstops option.
     657 Telnet output vertical tab disposition option.
     659 Announcing additional Telnet options.
     698 Telnet extended ASCII option.
     726 Remote Controlled Transmission and Echoing Telnet option.
     727 Telnet logout option.
     729 Telnet byte macro option.
     731 Telnet Data Entry Terminal option.
     732 Telnet Data Entry Terminal option.
     735 Revised Telnet byte macro option.
     736 Telnet SUPDUP option.
     748 Telnet randomly-lose option.
     749 Telnet SUPDUP-Output option.
     779 Telnet send-location option.
     855 Telnet Option Specifications.
     857 Telnet Echo Option.
     858 Telnet Suppress Go Ahead Option.
     859 Telnet Status Option.
     860 Telnet Timing Mark Option.
     861 Telnet Extended Options: List Option.
     884 Telnet terminal type option.
     885 Telnet end of record option.
     927 TACACS user identification Telnet option.
     930 Telnet terminal type option.
     933 Output marking Telnet option.
     946 Telnet terminal location number option.
    1041 Telnet 3270 regime option.
    1043 Telnet Data Entry Terminal option: DODIIS implementation.
    1053 Telnet X.3 PAD option.
    1073 Telnet window size option.
    1079 Telnet terminal speed option.
    1080 Telnet remote flow control option.
    1091 Telnet terminal-type option.
    1096 Telnet X display location option.
    1097 Telnet subliminal-message option.
    1116 Telnet Linemode option.
    1143 The Q Method of Implementing TELNET Option Negotiation.
    1184 Telnet Linemode Option.
    1372 Telnet Remote Flow Control Option.
    1408 Telnet Environment Option.
    1409 Telnet Authentication Option.
    1416 Telnet Authentication Option.
    1571 Telnet Environment Option Interoperability Issues.
    1572 Telnet Environment Option.
    2066 TELNET CHARSET Option.
    2217 Telnet Com Port Control Option.
    2840 TELNET KERMIT OPTION.
    2941 Telnet Authentication Option.
    2946 Telnet Data Encryption Option.

then jump to RFC 1123, Section 3, and check your conformance with
all the MUST/SHOULD/MAY/SHOULD_NOT/MUST_NOT requirements [just under
50 of them, funny coincidence]. And then if you're *really* trying
to play nice, see if your IP implementation (yes, IP, *two* layers
down from Telnet!) is willing to set the Telnet Type-of-Service Value
in each IP packet of the TCP connection carrying your Telnet session
[RFCs 1060 & 1349].

Then figure out how you're going to support it now that you've
implemented this steaming pile!  ;-}  ;-}


-Rob [who once wrote a "tn3270d" server for a
      Unix that was running on top of VM/370...]


p.s. O.k., o.k., you can safely ignore RFCs 748 & 1097. But at least
read them first...  ;-}  ;-}

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607