xref: /original-bsd/libexec/telnetd/ext.h (revision c3e32dec)
1 /*
2  * Copyright (c) 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ext.h	8.1 (Berkeley) 06/04/93
8  */
9 
10 /*
11  * Telnet server variable declarations
12  */
13 extern char	options[256];
14 extern char	do_dont_resp[256];
15 extern char	will_wont_resp[256];
16 extern int	linemode;	/* linemode on/off */
17 #ifdef	LINEMODE
18 extern int	uselinemode;	/* what linemode to use (on/off) */
19 extern int	editmode;	/* edit modes in use */
20 extern int	useeditmode;	/* edit modes to use */
21 extern int	alwayslinemode;	/* command line option */
22 # ifdef	KLUDGELINEMODE
23 extern int	lmodetype;	/* Client support for linemode */
24 # endif	/* KLUDGELINEMODE */
25 #endif	/* LINEMODE */
26 extern int	flowmode;	/* current flow control state */
27 extern int	restartany;	/* restart output on any character state */
28 #ifdef DIAGNOSTICS
29 extern int	diagnostic;	/* telnet diagnostic capabilities */
30 #endif /* DIAGNOSTICS */
31 #ifdef BFTPDAEMON
32 extern int	bftpd;		/* behave as bftp daemon */
33 #endif /* BFTPDAEMON */
34 #if	defined(SecurID)
35 extern int	require_SecurID;
36 #endif
37 #if	defined(AUTHENTICATION)
38 extern int	auth_level;
39 #endif
40 
41 extern slcfun	slctab[NSLC + 1];	/* slc mapping table */
42 
43 char	*terminaltype;
44 
45 /*
46  * I/O data buffers, pointers, and counters.
47  */
48 extern char	ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
49 
50 extern char	netibuf[BUFSIZ], *netip;
51 
52 extern char	netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
53 extern char	*neturg;		/* one past last bye of urgent data */
54 
55 extern int	pcc, ncc;
56 
57 #if defined(CRAY2) && defined(UNICOS5)
58 extern int unpcc;  /* characters left unprocessed by CRAY-2 terminal routine */
59 extern char *unptyip;  /* pointer to remaining characters in buffer */
60 #endif
61 
62 extern int	pty, net;
63 extern char	*line;
64 extern int	SYNCHing;		/* we are in TELNET SYNCH mode */
65 
66 #ifndef	P
67 # ifdef	__STDC__
68 #  define P(x)	x
69 # else
70 #  define P(x)	()
71 # endif
72 #endif
73 
74 extern void
75 	_termstat P((void)),
76 	add_slc P((int, int, int)),
77 	check_slc P((void)),
78 	change_slc P((int, int, int)),
79 	cleanup P((int)),
80 	clientstat P((int, int, int)),
81 	copy_termbuf P((char *, int)),
82 	deferslc P((void)),
83 	defer_terminit P((void)),
84 	do_opt_slc P((unsigned char *, int)),
85 	doeof P((void)),
86 	dooption P((int)),
87 	dontoption P((int)),
88 	edithost P((char *, char *)),
89 	fatal P((int, char *)),
90 	fatalperror P((int, char *)),
91 	get_slc_defaults P((void)),
92 	init_env P((void)),
93 	init_termbuf P((void)),
94 	interrupt P((void)),
95 	localstat P((void)),
96 	flowstat P((void)),
97 	netclear P((void)),
98 	netflush P((void)),
99 #ifdef DIAGNOSTICS
100 	printoption P((char *, int)),
101 	printdata P((char *, char *, int)),
102 	printsub P((int, unsigned char *, int)),
103 #endif
104 	ptyflush P((void)),
105 	putchr P((int)),
106 	putf P((char *, char *)),
107 	recv_ayt P((void)),
108 	send_do P((int, int)),
109 	send_dont P((int, int)),
110 	send_slc P((void)),
111 	send_status P((void)),
112 	send_will P((int, int)),
113 	send_wont P((int, int)),
114 	sendbrk P((void)),
115 	sendsusp P((void)),
116 	set_termbuf P((void)),
117 	start_login P((char *, int, char *)),
118 	start_slc P((int)),
119 #if	defined(AUTHENTICATION)
120 	start_slave P((char *)),
121 #else
122 	start_slave P((char *, int, char *)),
123 #endif
124 	suboption P((void)),
125 	telrcv P((void)),
126 	ttloop P((void)),
127 	tty_binaryin P((int)),
128 	tty_binaryout P((int));
129 
130 extern int
131 	end_slc P((unsigned char **)),
132 	getnpty P((void)),
133 #ifndef convex
134 	getpty P((int *)),
135 #endif convex
136 	login_tty P((int)),
137 	spcset P((int, cc_t *, cc_t **)),
138 	stilloob P((int)),
139 	terminit P((void)),
140 	termstat P((void)),
141 	tty_flowmode P((void)),
142 	tty_restartany P((void)),
143 	tty_isbinaryin P((void)),
144 	tty_isbinaryout P((void)),
145 	tty_iscrnl P((void)),
146 	tty_isecho P((void)),
147 	tty_isediting P((void)),
148 	tty_islitecho P((void)),
149 	tty_isnewmap P((void)),
150 	tty_israw P((void)),
151 	tty_issofttab P((void)),
152 	tty_istrapsig P((void)),
153 	tty_linemode P((void));
154 
155 extern void
156 	tty_rspeed P((int)),
157 	tty_setecho P((int)),
158 	tty_setedit P((int)),
159 	tty_setlinemode P((int)),
160 	tty_setlitecho P((int)),
161 	tty_setsig P((int)),
162 	tty_setsofttab P((int)),
163 	tty_tspeed P((int)),
164 	willoption P((int)),
165 	wontoption P((int)),
166 	writenet P((unsigned char *, int));
167 
168 #ifdef	ENCRYPTION
169 extern void	(*encrypt_output) P((unsigned char *, int));
170 extern int	(*decrypt_input) P((int));
171 extern char	*nclearto;
172 #endif	/* ENCRYPTION */
173 
174 
175 /*
176  * The following are some clocks used to decide how to interpret
177  * the relationship between various variables.
178  */
179 
180 extern struct {
181     int
182 	system,			/* what the current time is */
183 	echotoggle,		/* last time user entered echo character */
184 	modenegotiated,		/* last time operating mode negotiated */
185 	didnetreceive,		/* last time we read data from network */
186 	ttypesubopt,		/* ttype subopt is received */
187 	tspeedsubopt,		/* tspeed subopt is received */
188 	environsubopt,		/* environ subopt is received */
189 	xdisplocsubopt,		/* xdisploc subopt is received */
190 	baseline,		/* time started to do timed action */
191 	gotDM;			/* when did we last see a data mark */
192 } clocks;
193 
194 
195 #if	defined(CRAY2) && defined(UNICOS5)
196 extern int	needtermstat;
197 #endif
198 
199 #ifndef	DEFAULT_IM
200 # ifdef CRAY
201 #  define DEFAULT_IM	"\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
202 # else
203 #  ifdef sun
204 #   define DEFAULT_IM	"\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
205 #  else
206 #   ifdef ultrix
207 #    define DEFAULT_IM	"\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
208 #   else
209 #    define DEFAULT_IM	"\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
210 #   endif
211 #  endif
212 # endif
213 #endif
214