xref: /netbsd-src/libexec/telnetd/ext.h (revision 95d875fb90b1458e4f1de6950286ddcd6644bc61)
1 /*	$NetBSD: ext.h,v 1.9 1999/02/12 05:30:11 dean Exp $	*/
2 
3 /*
4  * Copyright (c) 1989, 1993
5  *	The Regents of the University of California.  All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *	This product includes software developed by the University of
18  *	California, Berkeley and its contributors.
19  * 4. Neither the name of the University nor the names of its contributors
20  *    may be used to endorse or promote products derived from this software
21  *    without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  *	from: @(#)ext.h	8.2 (Berkeley) 12/15/93
36  */
37 
38 /*
39  * Telnet server variable declarations
40  */
41 extern char	options[256];
42 extern char	do_dont_resp[256];
43 extern char	will_wont_resp[256];
44 extern int	linemode;	/* linemode on/off */
45 #ifdef	LINEMODE
46 extern int	uselinemode;	/* what linemode to use (on/off) */
47 extern int	editmode;	/* edit modes in use */
48 extern int	useeditmode;	/* edit modes to use */
49 extern int	alwayslinemode;	/* command line option */
50 # ifdef	KLUDGELINEMODE
51 extern int	lmodetype;	/* Client support for linemode */
52 # endif	/* KLUDGELINEMODE */
53 #endif	/* LINEMODE */
54 extern int	flowmode;	/* current flow control state */
55 extern int	restartany;	/* restart output on any character state */
56 #ifdef DIAGNOSTICS
57 extern int	diagnostic;	/* telnet diagnostic capabilities */
58 #endif /* DIAGNOSTICS */
59 #ifdef BFTPDAEMON
60 extern int	bftpd;		/* behave as bftp daemon */
61 #endif /* BFTPDAEMON */
62 #if	defined(SECURELOGIN)
63 extern int	require_secure_login;
64 #endif
65 #if	defined(AUTHENTICATION)
66 extern int	auth_level;
67 #endif
68 
69 extern slcfun	slctab[NSLC + 1];	/* slc mapping table */
70 
71 char	*terminaltype;
72 
73 /*
74  * I/O data buffers, pointers, and counters.
75  */
76 extern char	ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
77 
78 extern char	netibuf[BUFSIZ], *netip;
79 
80 extern char	netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
81 extern char	*neturg;		/* one past last bye of urgent data */
82 
83 extern int	pcc, ncc;
84 
85 #if defined(CRAY2) && defined(UNICOS5)
86 extern int unpcc;  /* characters left unprocessed by CRAY-2 terminal routine */
87 extern char *unptyip;  /* pointer to remaining characters in buffer */
88 #endif
89 
90 extern int	pty, net;
91 extern char	*line;
92 extern int	SYNCHing;		/* we are in TELNET SYNCH mode */
93 
94 #include <sys/cdefs.h>
95 #define P __P
96 
97 extern void
98 	_termstat P((void)),
99 	add_slc P((int, int, int)),
100 	check_slc P((void)),
101 	change_slc P((int, int, int)),
102 	cleanup P((int)),
103 	clientstat P((int, int, int)),
104 	copy_termbuf P((char *, int)),
105 	deferslc P((void)),
106 	defer_terminit P((void)),
107 	do_opt_slc P((unsigned char *, int)),
108 	doeof P((void)),
109 	dooption P((int)),
110 	dontoption P((int)),
111 	edithost P((char *, char *)),
112 	fatal P((int, char *)),
113 	fatalperror P((int, char *)),
114 	get_slc_defaults P((void)),
115 	init_env P((void)),
116 	init_termbuf P((void)),
117 	interrupt P((void)),
118 	localstat P((void)),
119 	flowstat P((void)),
120 	netclear P((void)),
121 	netflush P((void)),
122 #ifdef DIAGNOSTICS
123 	printoption P((char *, int)),
124 	printdata P((char *, char *, int)),
125 	printsub P((int, unsigned char *, int)),
126 #endif
127 	ptyflush P((void)),
128 	putchr P((int)),
129 	putf P((char *, char *)),
130 	recv_ayt P((void)),
131 	send_do P((int, int)),
132 	send_dont P((int, int)),
133 	send_slc P((void)),
134 	send_status P((void)),
135 	send_will P((int, int)),
136 	send_wont P((int, int)),
137 	sendbrk P((void)),
138 	sendsusp P((void)),
139 	set_termbuf P((void)),
140 	start_login P((char *, int, char *)),
141 	start_slc P((int)),
142 	startslave P((char *, int, char *)),
143 	suboption P((void)),
144 	telrcv P((void)),
145 	ttloop P((void)),
146 	tty_binaryin P((int)),
147 	tty_binaryout P((int));
148 
149 extern int
150 	end_slc P((unsigned char **)),
151 	getnpty P((void)),
152 #ifndef convex
153 	getpty P((int *)),
154 #endif
155 	login_tty P((int)),
156 	spcset P((int, cc_t *, cc_t **)),
157 	stilloob P((int)),
158 	terminit P((void)),
159 	termstat P((void)),
160 	tty_flowmode P((void)),
161 	tty_restartany P((void)),
162 	tty_isbinaryin P((void)),
163 	tty_isbinaryout P((void)),
164 	tty_iscrnl P((void)),
165 	tty_isecho P((void)),
166 	tty_isediting P((void)),
167 	tty_islitecho P((void)),
168 	tty_isnewmap P((void)),
169 	tty_israw P((void)),
170 	tty_issofttab P((void)),
171 	tty_istrapsig P((void)),
172 	tty_linemode P((void));
173 
174 extern void
175 	tty_rspeed P((int)),
176 	tty_setecho P((int)),
177 	tty_setedit P((int)),
178 	tty_setlinemode P((int)),
179 	tty_setlitecho P((int)),
180 	tty_setsig P((int)),
181 	tty_setsofttab P((int)),
182 	tty_tspeed P((int)),
183 	willoption P((int)),
184 	wontoption P((int)),
185 	writenet P((unsigned char *, int));
186 
187 
188 
189 /*
190  * The following are some clocks used to decide how to interpret
191  * the relationship between various variables.
192  */
193 
194 extern struct {
195     int
196 	system,			/* what the current time is */
197 	echotoggle,		/* last time user entered echo character */
198 	modenegotiated,		/* last time operating mode negotiated */
199 	didnetreceive,		/* last time we read data from network */
200 	ttypesubopt,		/* ttype subopt is received */
201 	tspeedsubopt,		/* tspeed subopt is received */
202 	environsubopt,		/* environ subopt is received */
203 	oenvironsubopt,		/* old environ subopt is received */
204 	xdisplocsubopt,		/* xdisploc subopt is received */
205 	baseline,		/* time started to do timed action */
206 	gotDM;			/* when did we last see a data mark */
207 } clocks;
208 
209 
210 #if	defined(CRAY2) && defined(UNICOS5)
211 extern int	needtermstat;
212 #endif
213 
214 #ifndef	DEFAULT_IM
215 # ifdef CRAY
216 #  define DEFAULT_IM	"\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
217 # else
218 #  ifdef sun
219 #   define DEFAULT_IM	"\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
220 #  else
221 #   ifdef ultrix
222 #    define DEFAULT_IM	"\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
223 #   else
224 #    define DEFAULT_IM	"\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
225 #   endif
226 #  endif
227 # endif
228 #endif
229