This directory contains the patches and programs necessary to handle
flow control properly in telnet and rlogin.  The primary symptom I'm
trying to fix is that when you enter emacs, ^S doesn't activate the
Emacs search command.  Fixing this involves a fair amount of stuff.
When you go into emacs, it turns off ixon in the termios flags.
telnetd and rlogind are supposed to transmit this fact over the net
connection to telnet and rlogin, which will turn off ixon on the
client system.  A similar mechanism is used to clear output when you
type ^C or ^O, and for rlogin to request window size information.  So
if this mechanism doesn't work, output won't stop as soon after ^C and
^O, and rlogin won't transmit the window size.

1) Packet mode is used by in.rlogind and in.telnetd to find out
when tty parameters change.  The implementation of this was just
generally messed up.  It didn't return all the flags it should have,
and never cleared any once setting them.

2) The definitions of TIOCPKT_DOSTOP and TIOCPKT_NOSTOP were reversed,
so even after fixing the first bug, thing didn't work.

3) telnetd, rlogind, and rlogin had not been debugged on a kernel
with this stuff fixed.  They didn't take advantage of it.

I've included the following:

chr_drv.diff - diffs to two files in /usr/src/linux/kernel/chr_drv
	to fix (1)
termios.diff - diffs to /usr/include/linux/termios.h (which is
	also /usr/src/linux/include/linux/termios.h, if your
	symlinks are set up right), to fix (2)
source and binaries for new versions of rlogin, rlogind, and telnetd,
	to fix (3)

Notes and warnings:

1) This code has been tested on 0.99pl12 with the networking that
comes with that release.  It has not been tried with the various alpha
releases of net-2.  However it *has* been tested with an experimental
that removes Linux TCP/IP completely and replaces it with the network
code from netBSD.  (As this code has been discussed only in the NET
channel, I suspect it would violate protocol for me to say anything
about where to get it.  People interested in it should join the NET
channel and ask there.)  The code works on both, except that rlogin
does not always send the window size with the netBSD code.  I'm not
sure exactly what the problem is, but I suspect SIGURG is not being
sent somewhere that it should be in the kernel.  Not that installing
the netBSD patches changes lots of headers files.  If this code is
compiled with those changed header files, the binaries will not work
correctly under the normal Linux TCP/IP.  Binaries built on a normal
Linux system will work either place.

2) The version of telnetd here is quite out of date.  Someone should
recompile the one normally shipped with Linux.  The one that comes
with Linux works fine, except that it has ixon and -ixon reversed
because it was compiled with the definitions reversed in the header
files.  The one here is OK, but it doesn't have a number of the newer
features present in the usual one.  (I used this version for testing
because it's simpler, and I don't have time to do anything more.
Sorry.)

3) The rlogin and rlogind here are based on sources that came with
SLS.  They should be fine.  I got frustrated with various minor
problems in rlogin, and changed it to use termios rather than the
simulated Berkeley tty ioctl's.  It wouldn't be hard to finish the job
and make a version that doesn't need libbsd at all.
