Skip to content
Snippets Groups Projects
Select Git revision
  • 0b81f96043613f0929bfe704353c9e23d436d36f
  • master default protected
  • 9.0
  • 8.0
  • nt-tools
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2020
  • v8.0.2018
  • v8.0.2016
  • v8.0.2014
  • v8.0.2012
  • v8.0.2008
  • v8.0.2006
  • v8.0.2004
  • v8.0.2002
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
41 results

TELNET.pmod

Blame
  • TELNET.pmod 24.17 KiB
    //
    // $Id: TELNET.pmod,v 1.14 2000/12/28 15:03:30 grubba Exp $
    //
    // The TELNET protocol as described by RFC 764 and others.
    //
    // Henrik Grubbström <grubba@idonex.se> 1998-04-04
    //
    
    #pike __REAL_VERSION__
    
    // #define TELNET_DEBUG
    
    #ifdef TELNET_DEBUG
    #define DWRITE(X)	werror(X)
    #else
    #define DWRITE(X)
    #endif /* TELNET_DEBUG */
    
    //! Implements TELNET as described by RFC 764 and RFC 854
    //!
    //! Also implements the Q method of TELNET option negotiation
    //! as specified by RFC 1143.
    
    //! Table of IAC-codes.
    class TelnetCodes {
    
    constant IAC = 255;		/* interpret as command: */
    constant DONT = 254;		/* you are not to use option */
    constant DO = 253;		/* please, you use option */
    constant WONT = 252;		/* I won't use option */
    constant WILL = 251;		/* I will use option */
    constant SB = 250;		/* interpret as subnegotiation */
    constant GA = 249;		/* you may reverse the line */
    constant EL = 248;		/* erase the current line */
    constant EC = 247;		/* erase the current character */
    constant AYT = 246;		/* are you there */
    constant AO = 245;		/* abort output--but let prog finish */
    constant IP = 244;		/* interrupt process--permanently */
    constant BREAK = 243;		/* break */
    constant DM = 242;		/* data mark--for connect. cleaning */
    constant NOP = 241;		/* nop */
    constant SE = 240;		/* end sub negotiation */
    constant EOR = 239;             /* end of record (transparent mode) */
    constant ABORT = 238;		/* Abort process */
    constant SUSP = 237;		/* Suspend process */
    constant xEOF = 236;		/* End of file: EOF is already used... */
    
    constant SYNCH = 242;		/* for telfunc calls */
    };
    
    inherit TelnetCodes;
    
    
    //! Table of TELNET options.
    class Telopts {
    
    constant TELOPT_BINARY = 0;	/* 8-bit data path */
    constant TELOPT_ECHO = 1;	/* echo */
    constant TELOPT_RCP = 2;	/* prepare to reconnect */
    constant TELOPT_SGA = 3;        /* suppress go ahead */
    constant TELOPT_NAMS = 4;       /* approximate message size */
    constant TELOPT_STATUS = 5;     /* give status */
    constant TELOPT_TM = 6;         /* timing mark */
    constant TELOPT_RCTE = 7;	/* remote controlled transmission and echo */
    constant TELOPT_NAOL = 8;	/* negotiate about output line width */
    constant TELOPT_NAOP = 9;	/* negotiate about output page size */
    constant TELOPT_NAOCRD = 10;	/* negotiate about CR disposition */
    constant TELOPT_NAOHTS = 11;	/* negotiate about horizontal tabstops */
    constant TELOPT_NAOHTD = 12;	/* negotiate about horizontal tab disposition */
    constant TELOPT_NAOFFD = 13;	/* negotiate about formfeed disposition */