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