OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [common/] [current/] [include/] [arpa/] [telnet.h] - Blame information for rev 857

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      include/arpa/telnet.h
4
//
5
//==========================================================================
6
// ####BSDCOPYRIGHTBEGIN####                                    
7
// -------------------------------------------                  
8
// This file is part of eCos, the Embedded Configurable Operating System.
9
//
10
// Portions of this software may have been derived from FreeBSD, OpenBSD,
11
// or other sources, and if so are covered by the appropriate copyright
12
// and license included herein.                                 
13
//
14
// Portions created by the Free Software Foundation are         
15
// Copyright (C) 2002 Free Software Foundation, Inc.            
16
// -------------------------------------------                  
17
// ####BSDCOPYRIGHTEND####                                      
18
//==========================================================================
19
 
20
/*
21
 * Copyright (c) 1983 Regents of the University of California.
22
 * All rights reserved.
23
 *
24
 * Redistribution and use in source and binary forms, with or without
25
 * modification, are permitted provided that the following conditions
26
 * are met:
27
 * 1. Redistributions of source code must retain the above copyright
28
 *    notice, this list of conditions and the following disclaimer.
29
 * 2. Redistributions in binary form must reproduce the above copyright
30
 *    notice, this list of conditions and the following disclaimer in the
31
 *    documentation and/or other materials provided with the distribution.
32
 * 3. All advertising materials mentioning features or use of this software
33
 *    must display the following acknowledgement:
34
 *      This product includes software developed by the University of
35
 *      California, Berkeley and its contributors.
36
 * 4. Neither the name of the University nor the names of its contributors
37
 *    may be used to endorse or promote products derived from this software
38
 *    without specific prior written permission.
39
 *
40
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
41
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
44
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50
 * SUCH DAMAGE.
51
 *
52
 *      @(#)telnet.h    5.14 (Berkeley) 4/3/91
53
 */
54
 
55
#ifndef _ARPA_TELNET_H_
56
#define _ARPA_TELNET_H_
57
 
58
/*
59
 * Definitions for the TELNET protocol.
60
 */
61
#define IAC     255             /* interpret as command: */
62
#define DONT    254             /* you are not to use option */
63
#define DO      253             /* please, you use option */
64
#define WONT    252             /* I won't use option */
65
#define WILL    251             /* I will use option */
66
#define SB      250             /* interpret as subnegotiation */
67
#define GA      249             /* you may reverse the line */
68
#define EL      248             /* erase the current line */
69
#define EC      247             /* erase the current character */
70
#define AYT     246             /* are you there */
71
#define AO      245             /* abort output--but let prog finish */
72
#define IP      244             /* interrupt process--permanently */
73
#define BREAK   243             /* break */
74
#define DM      242             /* data mark--for connect. cleaning */
75
#define NOP     241             /* nop */
76
#define SE      240             /* end sub negotiation */
77
#define EOR     239             /* end of record (transparent mode) */
78
#define ABORT   238             /* Abort process */
79
#define SUSP    237             /* Suspend process */
80
#define xEOF    236             /* End of file: EOF is already used... */
81
 
82
#define SYNCH   242             /* for telfunc calls */
83
 
84
#ifdef TELCMDS
85
char *telcmds[] = {
86
        "EOF", "SUSP", "ABORT", "EOR",
87
        "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
88
        "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
89
};
90
#else
91
extern char *telcmds[];
92
#endif
93
 
94
#define TELCMD_FIRST    xEOF
95
#define TELCMD_LAST     IAC
96
#define TELCMD_OK(x)    ((x) <= TELCMD_LAST && (x) >= TELCMD_FIRST)
97
#define TELCMD(x)       telcmds[(x)-TELCMD_FIRST]
98
 
99
/* telnet options */
100
#define TELOPT_BINARY   0        /* 8-bit data path */
101
#define TELOPT_ECHO     1       /* echo */
102
#define TELOPT_RCP      2       /* prepare to reconnect */
103
#define TELOPT_SGA      3       /* suppress go ahead */
104
#define TELOPT_NAMS     4       /* approximate message size */
105
#define TELOPT_STATUS   5       /* give status */
106
#define TELOPT_TM       6       /* timing mark */
107
#define TELOPT_RCTE     7       /* remote controlled transmission and echo */
108
#define TELOPT_NAOL     8       /* negotiate about output line width */
109
#define TELOPT_NAOP     9       /* negotiate about output page size */
110
#define TELOPT_NAOCRD   10      /* negotiate about CR disposition */
111
#define TELOPT_NAOHTS   11      /* negotiate about horizontal tabstops */
112
#define TELOPT_NAOHTD   12      /* negotiate about horizontal tab disposition */
113
#define TELOPT_NAOFFD   13      /* negotiate about formfeed disposition */
114
#define TELOPT_NAOVTS   14      /* negotiate about vertical tab stops */
115
#define TELOPT_NAOVTD   15      /* negotiate about vertical tab disposition */
116
#define TELOPT_NAOLFD   16      /* negotiate about output LF disposition */
117
#define TELOPT_XASCII   17      /* extended ascic character set */
118
#define TELOPT_LOGOUT   18      /* force logout */
119
#define TELOPT_BM       19      /* byte macro */
120
#define TELOPT_DET      20      /* data entry terminal */
121
#define TELOPT_SUPDUP   21      /* supdup protocol */
122
#define TELOPT_SUPDUPOUTPUT 22  /* supdup output */
123
#define TELOPT_SNDLOC   23      /* send location */
124
#define TELOPT_TTYPE    24      /* terminal type */
125
#define TELOPT_EOR      25      /* end or record */
126
#define TELOPT_TUID     26      /* TACACS user identification */
127
#define TELOPT_OUTMRK   27      /* output marking */
128
#define TELOPT_TTYLOC   28      /* terminal location number */
129
#define TELOPT_3270REGIME 29    /* 3270 regime */
130
#define TELOPT_X3PAD    30      /* X.3 PAD */
131
#define TELOPT_NAWS     31      /* window size */
132
#define TELOPT_TSPEED   32      /* terminal speed */
133
#define TELOPT_LFLOW    33      /* remote flow control */
134
#define TELOPT_LINEMODE 34      /* Linemode option */
135
#define TELOPT_XDISPLOC 35      /* X Display Location */
136
#define TELOPT_ENVIRON  36      /* Environment variables */
137
#define TELOPT_AUTHENTICATION 37/* Authenticate */
138
#define TELOPT_ENCRYPT  38      /* Encryption option */
139
#define TELOPT_EXOPL    255     /* extended-options-list */
140
 
141
 
142
#define NTELOPTS        (1+TELOPT_ENCRYPT)
143
#ifdef TELOPTS
144
char *telopts[NTELOPTS+1] = {
145
        "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
146
        "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
147
        "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
148
        "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
149
        "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
150
        "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
151
        "TACACS UID", "OUTPUT MARKING", "TTYLOC",
152
        "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
153
        "LINEMODE", "XDISPLOC", "ENVIRON", "AUTHENTICATION",
154
        "ENCRYPT",
155
        0,
156
};
157
#define TELOPT_FIRST    TELOPT_BINARY
158
#define TELOPT_LAST     TELOPT_ENCRYPT
159
#define TELOPT_OK(x)    ((x) <= TELOPT_LAST && (x) >= TELOPT_FIRST)
160
#define TELOPT(x)       telopts[(x)-TELOPT_FIRST]
161
#endif
162
 
163
/* sub-option qualifiers */
164
#define TELQUAL_IS      0        /* option is... */
165
#define TELQUAL_SEND    1       /* send option */
166
#define TELQUAL_INFO    2       /* ENVIRON: informational version of IS */
167
#define TELQUAL_REPLY   2       /* AUTHENTICATION: client version of IS */
168
#define TELQUAL_NAME    3       /* AUTHENTICATION: client version of IS */
169
 
170
/*
171
 * LINEMODE suboptions
172
 */
173
 
174
#define LM_MODE         1
175
#define LM_FORWARDMASK  2
176
#define LM_SLC          3
177
 
178
#define MODE_EDIT       0x01
179
#define MODE_TRAPSIG    0x02
180
#define MODE_ACK        0x04
181
#define MODE_SOFT_TAB   0x08
182
#define MODE_LIT_ECHO   0x10
183
 
184
#define MODE_MASK       0x1f
185
 
186
/* Not part of protocol, but needed to simplify things... */
187
#define MODE_FLOW               0x0100
188
#define MODE_ECHO               0x0200
189
#define MODE_INBIN              0x0400
190
#define MODE_OUTBIN             0x0800
191
#define MODE_FORCE              0x1000
192
 
193
#define SLC_SYNCH       1
194
#define SLC_BRK         2
195
#define SLC_IP          3
196
#define SLC_AO          4
197
#define SLC_AYT         5
198
#define SLC_EOR         6
199
#define SLC_ABORT       7
200
#define SLC_EOF         8
201
#define SLC_SUSP        9
202
#define SLC_EC          10
203
#define SLC_EL          11
204
#define SLC_EW          12
205
#define SLC_RP          13
206
#define SLC_LNEXT       14
207
#define SLC_XON         15
208
#define SLC_XOFF        16
209
#define SLC_FORW1       17
210
#define SLC_FORW2       18
211
 
212
#define NSLC            18
213
 
214
/*
215
 * For backwards compatability, we define SLC_NAMES to be the
216
 * list of names if SLC_NAMES is not defined.
217
 */
218
#define SLC_NAMELIST    "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
219
                        "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
220
                        "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
221
#ifdef  SLC_NAMES
222
char *slc_names[] = {
223
        SLC_NAMELIST
224
};
225
#else
226
extern char *slc_names[];
227
#define SLC_NAMES SLC_NAMELIST
228
#endif
229
 
230
#define SLC_NAME_OK(x)  ((x) >= 0 && (x) < NSLC)
231
#define SLC_NAME(x)     slc_names[x]
232
 
233
#define SLC_NOSUPPORT   0
234
#define SLC_CANTCHANGE  1
235
#define SLC_VARIABLE    2
236
#define SLC_DEFAULT     3
237
#define SLC_LEVELBITS   0x03
238
 
239
#define SLC_FUNC        0
240
#define SLC_FLAGS       1
241
#define SLC_VALUE       2
242
 
243
#define SLC_ACK         0x80
244
#define SLC_FLUSHIN     0x40
245
#define SLC_FLUSHOUT    0x20
246
 
247
#define ENV_VALUE       0
248
#define ENV_VAR         1
249
#define ENV_ESC         2
250
 
251
/*
252
 * AUTHENTICATION suboptions
253
 */
254
 
255
/*
256
 * Who is authenticating who ...
257
 */
258
#define AUTH_WHO_CLIENT         0        /* Client authenticating server */
259
#define AUTH_WHO_SERVER         1       /* Server authenticating client */
260
#define AUTH_WHO_MASK           1
261
 
262
/*
263
 * amount of authentication done
264
 */
265
#define AUTH_HOW_ONE_WAY        0
266
#define AUTH_HOW_MUTUAL         2
267
#define AUTH_HOW_MASK           2
268
 
269
#define AUTHTYPE_NULL           0
270
#define AUTHTYPE_KERBEROS_V4    1
271
#define AUTHTYPE_KERBEROS_V5    2
272
#define AUTHTYPE_SPX            3
273
#define AUTHTYPE_MINK           4
274
#define AUTHTYPE_CNT            5
275
 
276
#define AUTHTYPE_TEST           99
277
 
278
#ifdef  AUTH_NAMES
279
char *authtype_names[] = {
280
        "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
281
};
282
#else
283
extern char *authtype_names[];
284
#endif
285
 
286
#define AUTHTYPE_NAME_OK(x)     ((x) >= 0 && (x) < AUTHTYPE_CNT)
287
#define AUTHTYPE_NAME(x)        authtype_names[x]
288
 
289
/*
290
 * ENCRYPTion suboptions
291
 */
292
#define ENCRYPT_IS              0        /* I pick encryption type ... */
293
#define ENCRYPT_SUPPORT         1       /* I support encryption types ... */
294
#define ENCRYPT_REPLY           2       /* Initial setup response */
295
#define ENCRYPT_START           3       /* Am starting to send encrypted */
296
#define ENCRYPT_END             4       /* Am ending encrypted */
297
#define ENCRYPT_REQSTART        5       /* Request you start encrypting */
298
#define ENCRYPT_REQEND          6       /* Request you send encrypting */
299
#define ENCRYPT_ENC_KEYID       7
300
#define ENCRYPT_DEC_KEYID       8
301
#define ENCRYPT_CNT             9
302
 
303
#define ENCTYPE_ANY             0
304
#define ENCTYPE_DES_CFB64       1
305
#define ENCTYPE_DES_OFB64       2
306
#define ENCTYPE_CNT             3
307
 
308
#ifdef  ENCRYPT_NAMES
309
char *encrypt_names[] = {
310
        "IS", "SUPPORT", "REPLY", "START", "END",
311
        "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
312
        0,
313
};
314
char *enctype_names[] = {
315
        "ANY", "DES_CFB64",  "DES_OFB64",  0,
316
};
317
#else
318
extern char *encrypt_names[];
319
extern char *enctype_names[];
320
#endif
321
 
322
 
323
#define ENCRYPT_NAME_OK(x)      ((x) >= 0 && (x) < ENCRYPT_CNT)
324
#define ENCRYPT_NAME(x)         encrypt_names[x]
325
 
326
#define ENCTYPE_NAME_OK(x)      ((x) >= 0 && (x) < ENCTYPE_CNT)
327
#define ENCTYPE_NAME(x)         enctype_names[x]
328
 
329
#endif /* !_ARPA_TELNET_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.