| 1 |
#ifndef HEADER_CURL_ARPA_TELNET_H |
| 2 |
#define HEADER_CURL_ARPA_TELNET_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#ifndef CURL_DISABLE_TELNET |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
#define CURL_TELOPT_BINARY 0 |
| 31 |
#define CURL_TELOPT_ECHO 1 |
| 32 |
#define CURL_TELOPT_SGA 3 |
| 33 |
#define CURL_TELOPT_EXOPL 255 |
| 34 |
#define CURL_TELOPT_TTYPE 24 |
| 35 |
#define CURL_TELOPT_NAWS 31 |
| 36 |
#define CURL_TELOPT_XDISPLOC 35 |
| 37 |
|
| 38 |
#define CURL_TELOPT_NEW_ENVIRON 39 |
| 39 |
#define CURL_NEW_ENV_VAR 0 |
| 40 |
#define CURL_NEW_ENV_VALUE 1 |
| 41 |
|
| 42 |
#ifndef CURL_DISABLE_VERBOSE_STRINGS |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
static const char * const telnetoptions[]= |
| 47 |
{ |
| 48 |
"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", |
| 49 |
"NAME", "STATUS", "TIMING MARK", "RCTE", |
| 50 |
"NAOL", "NAOP", "NAOCRD", "NAOHTS", |
| 51 |
"NAOHTD", "NAOFFD", "NAOVTS", "NAOVTD", |
| 52 |
"NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO", |
| 53 |
"DE TERMINAL", "SUPDUP", "SUPDUP OUTPUT", "SEND LOCATION", |
| 54 |
"TERM TYPE", "END OF RECORD", "TACACS UID", "OUTPUT MARKING", |
| 55 |
"TTYLOC", "3270 REGIME", "X3 PAD", "NAWS", |
| 56 |
"TERM SPEED", "LFLOW", "LINEMODE", "XDISPLOC", |
| 57 |
"OLD-ENVIRON", "AUTHENTICATION", "ENCRYPT", "NEW-ENVIRON" |
| 58 |
}; |
| 59 |
#define CURL_TELOPT(x) telnetoptions[x] |
| 60 |
#else |
| 61 |
#define CURL_TELOPT(x) "" |
| 62 |
#endif |
| 63 |
|
| 64 |
#define CURL_TELOPT_MAXIMUM CURL_TELOPT_NEW_ENVIRON |
| 65 |
|
| 66 |
#define CURL_TELOPT_OK(x) ((x) <= CURL_TELOPT_MAXIMUM) |
| 67 |
|
| 68 |
#define CURL_NTELOPTS 40 |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
#define CURL_xEOF 236 |
| 74 |
#define CURL_SE 240 |
| 75 |
#define CURL_NOP 241 |
| 76 |
#define CURL_DM 242 |
| 77 |
#define CURL_GA 249 |
| 78 |
#define CURL_SB 250 |
| 79 |
#define CURL_WILL 251 |
| 80 |
#define CURL_WONT 252 |
| 81 |
#define CURL_DO 253 |
| 82 |
#define CURL_DONT 254 |
| 83 |
#define CURL_IAC 255 |
| 84 |
|
| 85 |
#ifndef CURL_DISABLE_VERBOSE_STRINGS |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
static const char * const telnetcmds[]= |
| 90 |
{ |
| 91 |
"EOF", "SUSP", "ABORT", "EOR", "SE", |
| 92 |
"NOP", "DMARK", "BRK", "IP", "AO", |
| 93 |
"AYT", "EC", "EL", "GA", "SB", |
| 94 |
"WILL", "WONT", "DO", "DONT", "IAC" |
| 95 |
}; |
| 96 |
#endif |
| 97 |
|
| 98 |
#define CURL_TELCMD_MINIMUM CURL_xEOF |
| 99 |
#define CURL_TELCMD_MAXIMUM CURL_IAC |
| 100 |
|
| 101 |
#define CURL_TELQUAL_IS 0 |
| 102 |
#define CURL_TELQUAL_SEND 1 |
| 103 |
#define CURL_TELQUAL_INFO 2 |
| 104 |
#define CURL_TELQUAL_NAME 3 |
| 105 |
|
| 106 |
#define CURL_TELCMD_OK(x) ( ((unsigned int)(x) >= CURL_TELCMD_MINIMUM) && \ |
| 107 |
((unsigned int)(x) <= CURL_TELCMD_MAXIMUM) ) |
| 108 |
|
| 109 |
#ifndef CURL_DISABLE_VERBOSE_STRINGS |
| 110 |
#define CURL_TELCMD(x) telnetcmds[(x)-CURL_TELCMD_MINIMUM] |
| 111 |
#else |
| 112 |
#define CURL_TELCMD(x) "" |
| 113 |
#endif |
| 114 |
|
| 115 |
#endif |
| 116 |
|
| 117 |
#endif |