Mirror of git://git.busybox.net/busybox with our patches on top
Source
/* vi: set sw=4 ts=4: */
/*
* telnet implementation for busybox
*
* Author: Tomi Ollila <too@iki.fi>
* Copyright (C) 1994-2000 by Tomi Ollila
*
* Created: Thu Apr 7 13:29:41 1994 too
* Last modified: Fri Jun 9 14:34:24 2000 too
*
* Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*
* HISTORY
* Revision 3.1 1994/04/17 11:31:54 too
* initial revision
* Modified 2000/06/13 for inclusion into BusyBox by Erik Andersen <andersen@codepoet.org>
* Modified 2001/05/07 to add ability to pass TTYPE to remote host by Jim McQuillan
* <jam@ltsp.org>
* Modified 2004/02/11 to add ability to pass the USER variable to remote host
* by Fernando Silveira <swrh@gmx.net>
*
*/
enum {
DATABUFSIZE = 128,
IACBUFSIZE = 128,
CHM_TRY = 0,
CHM_ON = 1,
CHM_OFF = 2,
UF_ECHO = 0x01,
UF_SGA = 0x02,
TS_0 = 1,
TS_IAC = 2,
TS_OPT = 3,
TS_SUB1 = 4,
TS_SUB2 = 5,
};
typedef unsigned char byte;
enum { netfd = 3 };
struct globals {
int iaclen; /* could even use byte, but it's a loss on x86 */
byte telstate; /* telnet negotiation state from network input */
byte telwish; /* DO, DONT, WILL, WONT */
byte charmode;
byte telflags;
byte do_termios;