ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

telnet.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 /*
00004 * Copyright (c) 1983 Regents of the University of California.
00005 * All rights reserved.
00006 *
00007 * Redistribution and use in source and binary forms are permitted provided
00008 * that: (1) source distributions retain this entire copyright notice and
00009 * comment, and (2) distributions including binaries display the following
00010 * acknowledgement:  ``This product includes software developed by the
00011 * University of California, Berkeley and its contributors'' in the
00012 * documentation or other materials provided with the distribution and in
00013 * all advertising materials mentioning features or use of this software.
00014 * Neither the name of the University nor the names of its contributors may
00015 * be used to endorse or promote products derived from this software without
00016 * specific prior written permission.
00017 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
00018 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
00019 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00020 *
00021 *   @(#)telnet.h    5.12 (Berkeley) 3/5/91
00022 */
00023 
00024 // This file modified 5/15/98 by Paul Brannan.
00025 // Added (unsigned char) to the #defines.
00026 // Formatted for readability.
00027 
00028 /*
00029 * Definitions for the TELNET protocol.
00030 */
00031 #define IAC     (unsigned char)255      /* interpret as command: */
00032 #define DONT    (unsigned char)254      /* you are not to use option */
00033 #define DO      (unsigned char)253      /* please, you use option */
00034 #define WONT    (unsigned char)252      /* I won't use option */
00035 #define WILL    (unsigned char)251      /* I will use option */
00036 #define SB      (unsigned char)250      /* interpret as subnegotiation */
00037 #define GA      (unsigned char)249      /* you may reverse the line */
00038 #define EL      (unsigned char)248      /* erase the current line */
00039 #define EC      (unsigned char)247      /* erase the current character */
00040 #define AYT     (unsigned char)246      /* are you there */
00041 #define AO      (unsigned char)245      /* abort output--but let prog finish */
00042 #define IP      (unsigned char)244      /* interrupt process--permanently */
00043 #define BREAK   (unsigned char)243      /* break */
00044 #define DM      (unsigned char)242      /* data mark--for connect. cleaning */
00045 #define NOP     (unsigned char)241      /* nop */
00046 #define SE      (unsigned char)240      /* end sub negotiation */
00047 #define EOR     (unsigned char)239             /* end of record (transparent mode) */
00048 #define ABORT   (unsigned char)238      /* Abort process */
00049 #define SUSP    (unsigned char)237      /* Suspend process */
00050 #define xEOF    (unsigned char)236      /* End of file: EOF is already used... */
00051 
00052 #define SYNCH   (unsigned char)242      /* for telfunc calls */
00053 
00054 #ifdef TELCMDS
00055 char *telcmds[] = {
00056     "EOF", "SUSP", "ABORT", "EOR",
00057         "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
00058         "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
00059 };
00060 #else
00061 extern char *telcmds[];
00062 #endif
00063 
00064 #define TELCMD_FIRST        xEOF
00065 #define TELCMD_LAST         IAC
00066 #define TELCMD_OK(x)        ((x) <= TELCMD_LAST && (x) >= TELCMD_FIRST)
00067 #define TELCMD(x)           telcmds[(x)-TELCMD_FIRST]
00068 
00069 /* telnet options */
00070 #define TELOPT_BINARY           (unsigned char)0    /* 8-bit data path */
00071 #define TELOPT_ECHO             (unsigned char)1    /* echo */
00072 #define TELOPT_RCP              (unsigned char)2    /* prepare to reconnect */
00073 #define TELOPT_SGA              (unsigned char)3    /* suppress go ahead */
00074 #define TELOPT_NAMS             (unsigned char)4    /* approximate message size */
00075 #define TELOPT_STATUS           (unsigned char)5    /* give status */
00076 #define TELOPT_TM               (unsigned char)6    /* timing mark */
00077 #define TELOPT_RCTE             (unsigned char)7    /* remote controlled transmission and echo */
00078 #define TELOPT_NAOL             (unsigned char)8    /* negotiate about output line width */
00079 #define TELOPT_NAOP             (unsigned char)9    /* negotiate about output page size */
00080 #define TELOPT_NAOCRD           (unsigned char)10   /* negotiate about CR disposition */
00081 #define TELOPT_NAOHTS           (unsigned char)11   /* negotiate about horizontal tabstops */
00082 #define TELOPT_NAOHTD           (unsigned char)12   /* negotiate about horizontal tab disposition */
00083 #define TELOPT_NAOFFD           (unsigned char)13   /* negotiate about formfeed disposition */
00084 #define TELOPT_NAOVTS           (unsigned char)14   /* negotiate about vertical tab stops */
00085 #define TELOPT_NAOVTD           (unsigned char)15   /* negotiate about vertical tab disposition */
00086 #define TELOPT_NAOLFD           (unsigned char)16   /* negotiate about output LF disposition */
00087 #define TELOPT_XASCII           (unsigned char)17   /* extended ascic character set */
00088 #define TELOPT_LOGOUT           (unsigned char)18   /* force logout */
00089 #define TELOPT_BM               (unsigned char)19   /* byte macro */
00090 #define TELOPT_DET              (unsigned char)20   /* data entry terminal */
00091 #define TELOPT_SUPDUP           (unsigned char)21   /* supdup protocol */
00092 #define TELOPT_SUPDUPOUTPUT     (unsigned char)22   /* supdup output */
00093 #define TELOPT_SNDLOC           (unsigned char)23   /* send location */
00094 #define TELOPT_TTYPE            (unsigned char)24   /* terminal type */
00095 #define TELOPT_EOR              (unsigned char)25   /* end or record */
00096 #define TELOPT_TUID             (unsigned char)26   /* TACACS user identification */
00097 #define TELOPT_OUTMRK           (unsigned char)27   /* output marking */
00098 #define TELOPT_TTYLOC           (unsigned char)28   /* terminal location number */
00099 #define TELOPT_3270REGIME       (unsigned char)29   /* 3270 regime */
00100 #define TELOPT_X3PAD            (unsigned char)30   /* X.3 PAD */
00101 #define TELOPT_NAWS             (unsigned char)31   /* window size */
00102 #define TELOPT_TSPEED           (unsigned char)32   /* terminal speed */
00103 #define TELOPT_LFLOW            (unsigned char)33   /* remote flow control */
00104 #define TELOPT_LINEMODE         (unsigned char)34   /* Linemode option */
00105 #define TELOPT_XDISPLOC         (unsigned char)35   /* X Display Location */
00106 #define TELOPT_ENVIRON          (unsigned char)36   /* Environment variables */
00107 #define TELOPT_AUTHENTICATION   (unsigned char)37   /* Authenticate */
00108 #define TELOPT_ENCRYPT          (unsigned char)38   /* Encryption option */
00109 #define TELOPT_EXOPL            (unsigned char)255  /* extended-options-list */
00110 
00111 
00112 #define NTELOPTS    (1+TELOPT_ENCRYPT)
00113 #ifdef TELOPTS
00114 char *telopts[NTELOPTS+1] = {
00115     "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
00116         "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
00117         "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
00118         "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
00119         "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
00120         "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
00121         "TACACS UID", "OUTPUT MARKING", "TTYLOC",
00122         "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
00123         "LINEMODE", "XDISPLOC", "ENVIRON", "AUTHENTICATION",
00124         "ENCRYPT",
00125         0,
00126 };
00127 #define TELOPT_FIRST    TELOPT_BINARY
00128 #define TELOPT_LAST TELOPT_ENCRYPT
00129 #define TELOPT_OK(x)    ((x) <= TELOPT_LAST && (x) >= TELOPT_FIRST)
00130 #define TELOPT(x)   telopts[(x)-TELOPT_FIRST]
00131 #endif
00132 
00133 /* sub-option qualifiers */
00134 #define TELQUAL_IS      (unsigned char)0    /* option is... */
00135 #define TELQUAL_SEND    (unsigned char)1    /* send option */
00136 #define TELQUAL_INFO    (unsigned char)2    /* ENVIRON: informational version of IS */
00137 #define TELQUAL_REPLY   (unsigned char)2    /* AUTHENTICATION: client version of IS */
00138 #define TELQUAL_NAME    (unsigned char)3    /* AUTHENTICATION: client version of IS */
00139 
00140 /*
00141 * LINEMODE suboptions
00142 */
00143 
00144 #define LM_MODE     1
00145 #define LM_FORWARDMASK  2
00146 #define LM_SLC      3
00147 
00148 #define MODE_EDIT   0x01
00149 #define MODE_TRAPSIG    0x02
00150 #define MODE_ACK    0x04
00151 #define MODE_SOFT_TAB   0x08
00152 #define MODE_LIT_ECHO   0x10
00153 
00154 #define MODE_MASK   0x1f
00155 
00156 /* Not part of protocol, but needed to simplify things... */
00157 #define MODE_FLOW       0x0100
00158 #define MODE_ECHO       0x0200
00159 #define MODE_INBIN      0x0400
00160 #define MODE_OUTBIN     0x0800
00161 #define MODE_FORCE      0x1000
00162 
00163 #define SLC_SYNCH   1
00164 #define SLC_BRK     2
00165 #define SLC_IP      3
00166 #define SLC_AO      4
00167 #define SLC_AYT     5
00168 #define SLC_EOR     6
00169 #define SLC_ABORT   7
00170 #define SLC_EOF     8
00171 #define SLC_SUSP    9
00172 #define SLC_EC      10
00173 #define SLC_EL      11
00174 #define SLC_EW      12
00175 #define SLC_RP      13
00176 #define SLC_LNEXT   14
00177 #define SLC_XON     15
00178 #define SLC_XOFF    16
00179 #define SLC_FORW1   17
00180 #define SLC_FORW2   18
00181 
00182 #define NSLC        18
00183 
00184 /*
00185 * For backwards compatability, we define SLC_NAMES to be the
00186 * list of names if SLC_NAMES is not defined.
00187 */
00188 #define SLC_NAMELIST    "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
00189     "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
00190 "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
00191 #ifdef  SLC_NAMES
00192 //char *slc_names[] = {
00193 //  SLC_NAMELIST
00194 //};
00195 #else
00196 extern char *slc_names[];
00197 #define SLC_NAMES SLC_NAMELIST
00198 #endif
00199 
00200 #define SLC_NAME_OK(x)  ((x) >= 0 && (x) < NSLC)
00201 #define SLC_NAME(x) slc_names[x]
00202 
00203 #define SLC_NOSUPPORT   0
00204 #define SLC_CANTCHANGE  1
00205 #define SLC_VARIABLE    2
00206 #define SLC_DEFAULT 3
00207 #define SLC_LEVELBITS   0x03
00208 
00209 #define SLC_FUNC    0
00210 #define SLC_FLAGS   1
00211 #define SLC_VALUE   2
00212 
00213 #define SLC_ACK     0x80
00214 #define SLC_FLUSHIN 0x40
00215 #define SLC_FLUSHOUT    0x20
00216 
00217 #define ENV_VALUE   0
00218 #define ENV_VAR     1
00219 #define ENV_ESC     2
00220 
00221 /*
00222 * AUTHENTICATION suboptions
00223 */
00224 
00225 /*
00226 * Who is authenticating who ...
00227 */
00228 #define AUTH_WHO_CLIENT     0   /* Client authenticating server */
00229 #define AUTH_WHO_SERVER     1   /* Server authenticating client */
00230 #define AUTH_WHO_MASK       1
00231 
00232 /*
00233 * amount of authentication done
00234 */
00235 #define AUTH_HOW_ONE_WAY    0
00236 #define AUTH_HOW_MUTUAL     2
00237 #define AUTH_HOW_MASK       2
00238 
00239 #define AUTHTYPE_NULL       0
00240 #define AUTHTYPE_KERBEROS_V4    1
00241 #define AUTHTYPE_KERBEROS_V5    2
00242 #define AUTHTYPE_SPX        3
00243 #define AUTHTYPE_MINK       4
00244 #define AUTHTYPE_CNT        5
00245 
00246 #define AUTHTYPE_TEST       99
00247 
00248 #ifdef  AUTH_NAMES
00249 char *authtype_names[] = {
00250     "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
00251 };
00252 #else
00253 extern char *authtype_names[];
00254 #endif
00255 
00256 #define AUTHTYPE_NAME_OK(x) ((x) >= 0 && (x) < AUTHTYPE_CNT)
00257 #define AUTHTYPE_NAME(x)    authtype_names[x]
00258 
00259 /*
00260 * ENCRYPTion suboptions
00261 */
00262 #define ENCRYPT_IS      0   /* I pick encryption type ... */
00263 #define ENCRYPT_SUPPORT     1   /* I support encryption types ... */
00264 #define ENCRYPT_REPLY       2   /* Initial setup response */
00265 #define ENCRYPT_START       3   /* Am starting to send encrypted */
00266 #define ENCRYPT_END     4   /* Am ending encrypted */
00267 #define ENCRYPT_REQSTART    5   /* Request you start encrypting */
00268 #define ENCRYPT_REQEND      6   /* Request you send encrypting */
00269 #define ENCRYPT_ENC_KEYID   7
00270 #define ENCRYPT_DEC_KEYID   8
00271 #define ENCRYPT_CNT     9
00272 
00273 #define ENCTYPE_ANY     0
00274 #define ENCTYPE_DES_CFB64   1
00275 #define ENCTYPE_DES_OFB64   2
00276 #define ENCTYPE_CNT     3
00277 
00278 #ifdef  ENCRYPT_NAMES
00279 char *encrypt_names[] = {
00280     "IS", "SUPPORT", "REPLY", "START", "END",
00281         "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
00282         0,
00283 };
00284 char *enctype_names[] = {
00285     "ANY", "DES_CFB64",  "DES_OFB64",  0,
00286 };
00287 #else
00288 extern char *encrypt_names[];
00289 extern char *enctype_names[];
00290 #endif
00291 
00292 
00293 #define ENCRYPT_NAME_OK(x)  ((x) >= 0 && (x) < ENCRYPT_CNT)
00294 #define ENCRYPT_NAME(x)     encrypt_names[x]
00295 
00296 #define ENCTYPE_NAME_OK(x)  ((x) >= 0 && (x) < ENCTYPE_CNT)
00297 #define ENCTYPE_NAME(x)     enctype_names[x]
00298 
00299 

Generated on Sat May 26 2012 04:16:11 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.