|
|
1.1 root 1: /* telnet.h */
2:
3: /* Synchronet telnet-related constants and function prototypes */
4:
1.1.1.2 ! root 5: /* $Id: telnet.h,v 1.13 2008/11/28 22:19:57 rswindell Exp $ */
1.1 root 6:
7: /****************************************************************************
8: * @format.tab-size 4 (Plain Text/Source Code File Header) *
9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
10: * *
1.1.1.2 ! root 11: * Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
1.1 root 12: * *
13: * This program is free software; you can redistribute it and/or *
14: * modify it under the terms of the GNU General Public License *
15: * as published by the Free Software Foundation; either version 2 *
16: * of the License, or (at your option) any later version. *
17: * See the GNU General Public License for more details: gpl.txt or *
18: * http://www.fsf.org/copyleft/gpl.html *
19: * *
20: * Anonymous FTP access to the most recent released source is available at *
21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
22: * *
23: * Anonymous CVS access to the development source and modification history *
24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: *
25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login *
26: * (just hit return, no password is necessary) *
27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src *
28: * *
29: * For Synchronet coding style and modification guidelines, see *
30: * http://www.synchro.net/source.html *
31: * *
32: * You are encouraged to submit any modifications (preferably in Unix diff *
33: * format) via e-mail to [email protected] *
34: * *
35: * Note: If this box doesn't appear square, then you need to fix your tabs. *
36: ****************************************************************************/
37:
38: #ifndef _TELNET_H
39: #define _TELNET_H
40:
41: #include "gen_defs.h" /* uchar */
42:
43: /* commands */
44:
45: #define TELNET_IAC 255 /* 0xff - Interpret as command */
46: #define TELNET_DONT 254 /* 0xfe - Don't do option */
47: #define TELNET_DO 253 /* 0xfd - Do option */
48: #define TELNET_WONT 252 /* 0xfc - Won't do option */
49: #define TELNET_WILL 251 /* 0xfb - Will do option */
50:
51: #define TELNET_SB 250 /* sub-negotiation */
52: #define TELNET_GA 249 /* Go ahead */
53: #define TELNET_EL 248 /* Erase line */
54: #define TELNET_EC 247 /* Erase char */
55: #define TELNET_AYT 246 /* Are you there? */
56: #define TELNET_AO 245 /* Abort output */
57: #define TELNET_IP 244 /* Interrupt process */
58: #define TELNET_BRK 243 /* Break */
59: #define TELNET_SYNC 242 /* Data mark */
60: #define TELNET_NOP 241 /* No operation */
61:
62: #define TELNET_SE 240 /* End of subnegotiation parameters. */
63:
64: /* options */
65:
66: enum {
67: TELNET_BINARY_TX
68: ,TELNET_ECHO
69: ,TELNET_RECONN
1.1.1.2 ! root 70: ,TELNET_SUP_GA /* suppress go ahead */
1.1 root 71: ,TELNET_APPROX_MSG_SIZE
72: ,TELNET_STATUS
73: ,TELNET_TIMING_MARK
74: ,TELNET_REMOTE_CTRL
75: ,TELNET_OUTPUT_LINE_WIDTH
76: ,TELNET_OUTPUT_PAGE_SIZE
1.1.1.2 ! root 77: ,TELNET_OUTPUT_CR_DISP /* 10 */
1.1 root 78: ,TELNET_OUTPUT_HTAB_STOPS
79: ,TELNET_OUTPUT_HTAB_DISP
80: ,TELNET_OUTPUT_FF_DISP
81: ,TELNET_OUTPUT_VTAB_STOPS
82: ,TELNET_OUTPUT_VTAB_DISP
83: ,TELNET_OUTPUT_LF_DISP
84: ,TELNET_EXASCII
85: ,TELNET_LOGOUT
86: ,TELNET_BYTE_MACRO
1.1.1.2 ! root 87: ,TELNET_DATA_ENTRY_TERM /* 20 */
1.1 root 88: ,TELNET_SUPDUP
89: ,TELNET_SUPDUP_OUTPUT
1.1.1.2 ! root 90: ,TELNET_SEND_LOCATION /* [RFC779], ASCII string argument */
1.1 root 91: ,TELNET_TERM_TYPE
92: ,TELNET_END_OF_RECORD
93: ,TELNET_TACACS_USERID
94: ,TELNET_OUTPUT_MARKING
1.1.1.2 ! root 95: ,TELNET_TERM_LOCATION_NUMBER /* 64-bit argument */
1.1 root 96: ,TELNET_3270
1.1.1.2 ! root 97: ,TELNET_X3_PAD /* 30 */
1.1 root 98: ,TELNET_NEGOTIATE_WINDOW_SIZE
99: ,TELNET_TERM_SPEED
100: ,TELNET_REMOTE_FLOW
101: ,TELNET_LINE_MODE
102: ,TELNET_X_DISPLAY_LOCATION
1.1.1.2 ! root 103: ,TELNET_ENVIRON /* Not used */
1.1 root 104: ,TELNET_AUTH_OPTION
105: ,TELNET_ENCRYPTION_OPTION
1.1.1.2 ! root 106: ,TELNET_NEW_ENVIRON /* RFC 1572 */
! 107: ,TELNET_3270E /* 40 */
! 108: ,TELNET_XAUTH /* [Earhart] */
! 109: ,TELNET_CHARSET /* [RFC2066] */
! 110: ,TELNET_RSP /* [Barnes] */
! 111: ,TELNET_COMPORT_CTRL /* [RFC2217] */
! 112: ,TLENET_SUP_LOCAL_ECHO /* [Atmar] */
! 113: ,TELNET_START_TLS /* [Boe] */
! 114: ,TELNET_KERMIT /* [RFC2840] */
! 115: ,TELNET_SEND_URL /* [Croft] */
! 116: ,TELNET_FORWARD_X /* [Altman] */
! 117:
1.1 root 118:
119: ,TELNET_EXOPL=255 /* Extended options list */
120: };
121:
122: /* Terminal-type sub option codes, see RFC 1091 */
123: #define TELNET_TERM_IS 0
124: #define TELNET_TERM_SEND 1
125: #define TELNET_TERM_MAXLEN 40
126:
1.1.1.2 ! root 127: /* New environment sub option codes, see RFC 1572 */
! 128: #define TELNET_ENVIRON_IS 0
! 129: #define TELNET_ENVIRON_SEND 1
! 130: #define TELNET_ENVIRON_INFO 2
! 131:
! 132: #define TELNET_ENVIRON_VAR 0
! 133: #define TELNET_ENVIRON_VALUE 1
! 134: #define TELNET_ENVIRON_ESC 2
! 135: #define TELNET_ENVIRON_USERVAR 3
! 136:
1.1 root 137: /* bits for telnet_mode */
138:
139: #define TELNET_MODE_GATE (1<<2) /* Pass-through telnet commands/responses */
140: #define TELNET_MODE_OFF (1<<3) /* This is not a Telnet connection */
141:
142: #ifdef DLLEXPORT
143: #undef DLLEXPORT
144: #endif
145: #ifdef DLLCALL
146: #undef DLLCALL
147: #endif
148:
149: #ifdef _WIN32
150: #ifdef SBBS_EXPORTS
151: #define DLLEXPORT __declspec(dllexport)
152: #else
153: #define DLLEXPORT __declspec(dllimport)
154: #endif
155: #ifdef __BORLANDC__
156: #define DLLCALL __stdcall
157: #else
158: #define DLLCALL
159: #endif
160: #else
161: #define DLLEXPORT
162: #define DLLCALL
163: #endif
164:
165: #ifdef __cplusplus
166: extern "C" {
167: #endif
168:
169: DLLEXPORT const char* DLLCALL telnet_cmd_desc(uchar cmd);
170: DLLEXPORT const char* DLLCALL telnet_opt_desc(uchar opt);
171: DLLEXPORT uchar DLLCALL telnet_opt_ack(uchar cmd);
172: DLLEXPORT uchar DLLCALL telnet_opt_nak(uchar cmd);
173:
174: #ifdef __cplusplus
175: }
176: #endif
177:
178: #endif /* don't add anything after this line */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.