xref: /original-bsd/libexec/telnetd/ext.h (revision 4a884f8b)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ext.h	5.8 (Berkeley) 12/18/92
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 	netclear P((void)),
97 	netflush P((void)),
98 #ifdef DIAGNOSTICS
99 	printoption P((char *, int)),
100 	printdata P((char *, char *, int)),
101 	printsub P((int, unsigned char *, int)),
102 #endif
103 	ptyflush P((void)),
104 	putchr P((int)),
105 	putf P((char *, char *)),
106 	recv_ayt P((void)),
107 	send_do P((int, int)),
108 	send_dont P((int, int)),
109 	send_slc P((void)),
110 	send_status P((void)),
111 	send_will P((int, int)),
112 	send_wont P((int, int)),
113 	sendbrk P((void)),
114 	sendsusp P((void)),
115 	set_termbuf P((void)),
116 	start_login P((char *, int, char *)),
117 	start_slc P((int)),
118 #if	defined(AUTHENTICATION)
119 	start_slave P((char *)),
120 #else
121 	start_slave P((char *, int, char *)),
122 #endif
123 	suboption P((void)),
124 	telrcv P((void)),
125 	ttloop P((void)),
126 	tty_binaryin P((int)),
127 	tty_binaryout P((int));
128 
129 extern int
130 	end_slc P((unsigned char **)),
131 	getnpty P((void)),
132 	getpty P((void)),
133 	login_tty P((int)),
134 	spcset P((int, cc_t *, cc_t **)),
135 	stilloob P((int)),
136 	terminit P((void)),
137 	termstat P((void)),
138 	tty_flowmode P((void)),
139 	tty_restartany P((void)),
140 	tty_isbinaryin P((void)),
141 	tty_isbinaryout P((void)),
142 	tty_iscrnl P((void)),
143 	tty_isecho P((void)),
144 	tty_isediting P((void)),
145 	tty_islitecho P((void)),
146 	tty_isnewmap P((void)),
147 	tty_israw P((void)),
148 	tty_issofttab P((void)),
149 	tty_istrapsig P((void)),
150 	tty_linemode P((void));
151 
152 extern void
153 	tty_rspeed P((int)),
154 	tty_setecho P((int)),
155 	tty_setedit P((int)),
156 	tty_setlinemode P((int)),
157 	tty_setlitecho P((int)),
158 	tty_setsig P((int)),
159 	tty_setsofttab P((int)),
160 	tty_tspeed P((int)),
161 	willoption P((int)),
162 	wontoption P((int)),
163 	writenet P((unsigned char *, int));
164 
165 #if	defined(ENCRYPTION)
166 extern void	(*encrypt_output) P((unsigned char *, int));
167 extern int	(*decrypt_input) P((int));
168 extern char	*nclearto;
169 #endif
170 
171 
172 /*
173  * The following are some clocks used to decide how to interpret
174  * the relationship between various variables.
175  */
176 
177 extern struct {
178     int
179 	system,			/* what the current time is */
180 	echotoggle,		/* last time user entered echo character */
181 	modenegotiated,		/* last time operating mode negotiated */
182 	didnetreceive,		/* last time we read data from network */
183 	ttypesubopt,		/* ttype subopt is received */
184 	tspeedsubopt,		/* tspeed subopt is received */
185 	environsubopt,		/* environ subopt is received */
186 	xdisplocsubopt,		/* xdisploc subopt is received */
187 	baseline,		/* time started to do timed action */
188 	gotDM;			/* when did we last see a data mark */
189 } clocks;
190 
191 
192 #if	defined(CRAY2) && defined(UNICOS5)
193 extern int	needtermstat;
194 #endif
195 
196 #ifndef	DEFAULT_IM
197 # ifdef CRAY
198 #  define DEFAULT_IM	"\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
199 # else
200 #  ifdef sun
201 #   define DEFAULT_IM	"\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
202 #  else
203 #   ifdef ultrix
204 #    define DEFAULT_IM	"\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
205 #   else
206 #    define DEFAULT_IM	"\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
207 #   endif
208 #  endif
209 # endif
210 #endif
211