RCVD DO NAWS
SENT WILL NAWS
SENT IAC SB NAWS 0 178 0 70
RCVD DO LINEMODE
SENT DO SUPPRESS GO AHEAD
SENT WILL LINEMODE
SENT IAC SB LINEMODE SLC
SYNCH NOSUPPORT 0;
IP VARIABLE|FLUSHIN|FLUSHOUT 3;
AO VARIABLE 15;
AYT NOSUPPORT 0;
ABORT VARIABLE|FLUSHIN|FLUSHOUT 28;
EOF VARIABLE 4;
SUSP VARIABLE|FLUSHIN 26;
EC VARIABLE 127;
EL VARIABLE 21;
XON VARIABLE 17;
XOFF VARIABLE 19;
FORW1 NOSUPPORT 0;
FORW2 NOSUPPORT 0;

[talkerd: Sent IAC DO 'Negotiate About Window Size']
[talkerd: Sent IAC DO 'Linemode']
Give me a name:
RCVD WILL SUPPRESS GO AHEAD
RCVD IAC SB LINEMODE MODE EDIT|TRAPSIG

[talkerd: Received IAC WILL 'Negotiate About Window Size']
[talkerd: You enabled 'Negotiate About Window Size' for me]
[talkerd: Starting sub-negotiation]

[talkerd: Received sub-negotiation for 'Negotiate About Window Size']
[talkerd: Sub-negotiation data][Negotiate About Window Size]
[0][178]
[0][70]
[talkerd: End of data]
[talkerd: Unsupported subnegotiation 'Negotiate About Window Size']

[talkerd: Received IAC DO 'Supress Go Ahead']
[talkerd: I enabled 'Supress Go Ahead' for you]
[talkerd: Received IAC WILL 'Linemode']
[talkerd: You enabled 'Linemode' for me]

[talkerd: Starting sub-negotiation]
[talkerd: Received sub-negotiation for 'Linemode']
[talkerd: Sub-negotiation data][Linemode][Set Local Characters]
[Synch][NOSUPPORT][0]
[IP][VALUE|FLUSHOUT|FLUSHIN][3]
[AO][VALUE][15]
[AYT][NOSUPPORT][0]
[ABORT][VALUE|FLUSHOUT|FLUSHIN][28]
[EOF][VALUE][4]
[SUSP][VALUE|FLUSHIN][26]
[EC][VALUE][127]
[EL][VALUE][21]
[XON][VALUE][17]
[XOFF][VALUE][19]
[FORW1][NOSUPPORT][0]
[FORW2][NOSUPPORT][0]
[talkerd: End of data]

[talkerd: Starting sub-negotiation]
[talkerd: Received sub-negotiation for 'Linemode']
[talkerd: Sub-negotiation data][Linemode][Mode]
[EDIT|TRAPSIG|MODE_ACK]
[talkerd: End of data]


#Sub-negotiation commands

/* Telnet LINEMODE codes */
#define LM_MODE		1
#define		LM_EDIT			1
#define		LM_TRAPSIG		2
#define		LM_MODE_ACK		4
#define		LM_SOFT_TAB		8
#define		LM_LIT_ECHO		16
#define LM_FORWARDMASK	2
#define LM_SLC		3
#define		LM_SLC_SYNCH	1
#define		LM_SLC_BRK		2
#define		LM_SLC_IP		3
#define		LM_SLC_AO		4
#define		LM_SLC_AYT		5
#define		LM_SLC_EOR		6
#define		LM_SLC_ABORT	7
#define		LM_SLC_EOF		8
#define		LM_SLC_SUSP		9
#define		LM_SLC_EC		10
#define		LM_SLC_EL		11
#define		LM_SLC_EW		12
#define		LM_SLC_RP		13
#define		LM_SLC_LNEXT	14
#define		LM_SLC_XON		15
#define		LM_SLC_XOFF		16
#define		LM_SLC_FORW1	17
#define		LM_SLC_FORW2	18
#define		LM_SLC_MCL		19
#define		LM_SLC_MCR		20
#define		LM_SLC_MCWL		21
#define		LM_SLC_MCWR		22
#define		LM_SLC_MCBOL	23
#define		LM_SLC_MCEOL	24
#define		LM_SLC_INSRT	25
#define		LM_SLC_OVER		26
#define		LM_SLC_ECR		27
#define		LM_SLC_EWR		28
#define		LM_SLC_EBOL		29
#define		LM_SLC_EEOL		30

#define		LM_SLC_DEFAULT		3
#define		LM_SLC_VALUE		2
#define		LM_SLC_CANTCHANGE	1
#define		LM_SLC_NOSUPPORT	0
#define		LM_SLC_LEVELBITS	3

#define		LM_SLC_ACK			128
#define		LM_SLC_FLUSHIN		64
#define		LM_SLC_FLUSHOUT		32

#define	LM_EOF		236
#define	LM_SUSP		237
#define	LM_ABORT	238

/* Other Telnet sub-negoation command codes */
#define TSB_STATUS		5
#define TSB_DET			20
#define TSB_TTYPE		24			/* Terminal type */
#define TSB_TUID		26
#define TSB_OUTMRK		27
#define TSB_TTYLOC		28
#define TSB_3270-REGIME	29
#define TSB_NAWS		31
#define TSB_TSPEED		32			/* Terminal speed */
#define TSB_TGL_FLOW_CTL 33
#define TSB_AUTHENTIFY	37			/* Authentication */
#define TSB_NEW_ENVIRON	39
#define TSB_CHARSET		42
#define TSB_EXOPL		255
