xref: /csrg-svn/libexec/telnetd/ext.h (revision 46809)
138905Sborman /*
238905Sborman  * Copyright (c) 1989 The Regents of the University of California.
338905Sborman  * All rights reserved.
438905Sborman  *
542673Sbostic  * %sccs.include.redist.c%
638905Sborman  *
7*46809Sdab  *	@(#)ext.h	5.7 (Berkeley) 03/01/91
838905Sborman  */
938905Sborman 
1038905Sborman /*
1138905Sborman  * Telnet server variable declarations
1238905Sborman  */
1344364Sborman extern char	options[256];
1439503Sborman extern char	do_dont_resp[256];
1539503Sborman extern char	will_wont_resp[256];
1638905Sborman extern int	linemode;	/* linemode on/off */
1738905Sborman #ifdef	LINEMODE
1838905Sborman extern int	uselinemode;	/* what linemode to use (on/off) */
1938905Sborman extern int	editmode;	/* edit modes in use */
2038905Sborman extern int	useeditmode;	/* edit modes to use */
2138905Sborman extern int	alwayslinemode;	/* command line option */
2238905Sborman # ifdef	KLUDGELINEMODE
2338905Sborman extern int	lmodetype;	/* Client support for linemode */
2438905Sborman # endif	/* KLUDGELINEMODE */
2538905Sborman #endif	/* LINEMODE */
2638905Sborman extern int	flowmode;	/* current flow control state */
2744364Sborman #ifdef DIAGNOSTICS
2844364Sborman extern int	diagnostic;	/* telnet diagnostic capabilities */
2944364Sborman #endif /* DIAGNOSTICS */
3044364Sborman #ifdef BFTPDAEMON
3144364Sborman extern int	bftpd;		/* behave as bftp daemon */
3244364Sborman #endif /* BFTPDAEMON */
33*46809Sdab #if	defined(SecurID)
34*46809Sdab extern int	require_SecurID;
35*46809Sdab #endif
36*46809Sdab #if	defined(AUTHENTICATE)
37*46809Sdab extern int	auth_level;
38*46809Sdab #endif
3938905Sborman 
4038905Sborman extern slcfun	slctab[NSLC + 1];	/* slc mapping table */
4138905Sborman 
4238905Sborman char	*terminaltype;
4338905Sborman 
4438905Sborman /*
4538905Sborman  * I/O data buffers, pointers, and counters.
4638905Sborman  */
4738905Sborman extern char	ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
4838905Sborman 
4938905Sborman extern char	netibuf[BUFSIZ], *netip;
5038905Sborman 
5138905Sborman extern char	netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
5238905Sborman extern char	*neturg;		/* one past last bye of urgent data */
5338905Sborman 
5438905Sborman extern int	pcc, ncc;
5538905Sborman 
5640242Sborman #if defined(CRAY2) && defined(UNICOS5)
5739531Sborman extern int unpcc;  /* characters left unprocessed by CRAY-2 terminal routine */
5839531Sborman extern char *unptyip;  /* pointer to remaining characters in buffer */
5939531Sborman #endif
6039531Sborman 
6138905Sborman extern int	pty, net;
6238905Sborman extern char	*line;
6338905Sborman extern int	SYNCHing;		/* we are in TELNET SYNCH mode */
6438905Sborman 
65*46809Sdab #ifndef	P
66*46809Sdab # ifdef	__STDC__
67*46809Sdab #  define P(x)	x
68*46809Sdab # else
69*46809Sdab #  define P(x)	()
70*46809Sdab # endif
71*46809Sdab #endif
72*46809Sdab 
73*46809Sdab extern void
74*46809Sdab 	_termstat P((void)),
75*46809Sdab 	add_slc P((int, int, int)),
76*46809Sdab 	check_slc P((void)),
77*46809Sdab 	change_slc P((int, int, int)),
78*46809Sdab 	cleanup P((int)),
79*46809Sdab 	clientstat P((int, int, int)),
80*46809Sdab 	copy_termbuf P((char *, int)),
81*46809Sdab 	deferslc P((void)),
82*46809Sdab 	defer_terminit P((void)),
83*46809Sdab 	do_opt_slc P((unsigned char *, int)),
84*46809Sdab 	doeof P((void)),
85*46809Sdab 	dooption P((int)),
86*46809Sdab 	dontoption P((int)),
87*46809Sdab 	edithost P((char *, char *)),
88*46809Sdab 	fatal P((int, char *)),
89*46809Sdab 	fatalperror P((int, char *)),
90*46809Sdab 	get_slc_defaults P((void)),
91*46809Sdab 	init_env P((void)),
92*46809Sdab 	init_termbuf P((void)),
93*46809Sdab 	interrupt P((void)),
94*46809Sdab 	localstat P((void)),
95*46809Sdab 	netclear P((void)),
96*46809Sdab 	netflush P((void)),
9744364Sborman #ifdef DIAGNOSTICS
98*46809Sdab 	printoption P((char *, int)),
99*46809Sdab 	printdata P((char *, char *, int)),
100*46809Sdab 	printsub P((int, unsigned char *, int)),
10144364Sborman #endif
102*46809Sdab 	ptyflush P((void)),
103*46809Sdab 	putchr P((int)),
104*46809Sdab 	putf P((char *, char *)),
105*46809Sdab 	recv_ayt P((void)),
106*46809Sdab 	send_do P((int, int)),
107*46809Sdab 	send_dont P((int, int)),
108*46809Sdab 	send_slc P((void)),
109*46809Sdab 	send_status P((void)),
110*46809Sdab 	send_will P((int, int)),
111*46809Sdab 	send_wont P((int, int)),
112*46809Sdab 	sendbrk P((void)),
113*46809Sdab 	sendsusp P((void)),
114*46809Sdab 	set_termbuf P((void)),
115*46809Sdab 	start_login P((char *, int, char *)),
116*46809Sdab 	start_slc P((int)),
117*46809Sdab #if	defined(AUTHENTICATE)
118*46809Sdab 	start_slave P((char *)),
119*46809Sdab #else
120*46809Sdab 	start_slave P((char *, int, char *)),
121*46809Sdab #endif
122*46809Sdab 	suboption P((void)),
123*46809Sdab 	telrcv P((void)),
124*46809Sdab 	ttloop P((void)),
125*46809Sdab 	tty_binaryin P((int)),
126*46809Sdab 	tty_binaryout P((int));
12744364Sborman 
128*46809Sdab extern int
129*46809Sdab 	end_slc P((unsigned char **)),
130*46809Sdab 	getnpty P((void)),
131*46809Sdab 	getpty P((void)),
132*46809Sdab 	login_tty P((int)),
133*46809Sdab 	spcset P((int, cc_t *, cc_t **)),
134*46809Sdab 	stilloob P((int)),
135*46809Sdab 	terminit P((void)),
136*46809Sdab 	termstat P((void)),
137*46809Sdab 	tty_flowmode P((void)),
138*46809Sdab 	tty_isbinaryin P((void)),
139*46809Sdab 	tty_isbinaryout P((void)),
140*46809Sdab 	tty_iscrnl P((void)),
141*46809Sdab 	tty_isecho P((void)),
142*46809Sdab 	tty_isediting P((void)),
143*46809Sdab 	tty_islitecho P((void)),
144*46809Sdab 	tty_isnewmap P((void)),
145*46809Sdab 	tty_israw P((void)),
146*46809Sdab 	tty_issofttab P((void)),
147*46809Sdab 	tty_istrapsig P((void)),
148*46809Sdab 	tty_linemode P((void));
149*46809Sdab 
150*46809Sdab extern void
151*46809Sdab 	tty_rspeed P((int)),
152*46809Sdab 	tty_setecho P((int)),
153*46809Sdab 	tty_setedit P((int)),
154*46809Sdab 	tty_setlinemode P((int)),
155*46809Sdab 	tty_setlitecho P((int)),
156*46809Sdab 	tty_setsig P((int)),
157*46809Sdab 	tty_setsofttab P((int)),
158*46809Sdab 	tty_tspeed P((int)),
159*46809Sdab 	willoption P((int)),
160*46809Sdab 	wontoption P((int)),
161*46809Sdab 	writenet P((unsigned char *, int));
162*46809Sdab 
163*46809Sdab #if	defined(ENCRYPT)
164*46809Sdab extern void	(*encrypt_output) P((unsigned char *, int));
165*46809Sdab extern int	(*decrypt_input) P((int));
166*46809Sdab extern char	*nclearto;
167*46809Sdab #endif
168*46809Sdab 
169*46809Sdab 
17038905Sborman /*
17138905Sborman  * The following are some clocks used to decide how to interpret
17238905Sborman  * the relationship between various variables.
17338905Sborman  */
17438905Sborman 
17538905Sborman extern struct {
17638905Sborman     int
17738905Sborman 	system,			/* what the current time is */
17838905Sborman 	echotoggle,		/* last time user entered echo character */
17938905Sborman 	modenegotiated,		/* last time operating mode negotiated */
18038905Sborman 	didnetreceive,		/* last time we read data from network */
18138905Sborman 	ttypesubopt,		/* ttype subopt is received */
18238905Sborman 	tspeedsubopt,		/* tspeed subopt is received */
18344364Sborman 	environsubopt,		/* environ subopt is received */
18444364Sborman 	xdisplocsubopt,		/* xdisploc subopt is received */
18538905Sborman 	baseline,		/* time started to do timed action */
18638905Sborman 	gotDM;			/* when did we last see a data mark */
18738905Sborman } clocks;
18838905Sborman 
18938905Sborman 
19040242Sborman #if	defined(CRAY2) && defined(UNICOS5)
19138905Sborman extern int	needtermstat;
19238905Sborman #endif
19338905Sborman 
19438905Sborman #ifndef	CRAY
19538905Sborman #define DEFAULT_IM	"\r\n\r\n4.3 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
19638905Sborman #else
19738905Sborman #define DEFAULT_IM	"\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
19838905Sborman #endif
199