ext.h revision 1.6 1 /* $NetBSD: ext.h,v 1.6 1996/02/28 20:38:13 thorpej 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(SecurID)
63 extern int require_SecurID;
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 #if defined(AUTHENTICATION)
143 start_slave P((char *)),
144 #else
145 start_slave P((char *, int, char *)),
146 #endif
147 suboption P((void)),
148 telrcv P((void)),
149 ttloop P((void)),
150 tty_binaryin P((int)),
151 tty_binaryout P((int));
152
153 extern int
154 end_slc P((unsigned char **)),
155 getnpty P((void)),
156 #ifndef convex
157 getpty P((int *)),
158 #endif
159 login_tty P((int)),
160 spcset P((int, cc_t *, cc_t **)),
161 stilloob P((int)),
162 terminit P((void)),
163 termstat P((void)),
164 tty_flowmode P((void)),
165 tty_restartany P((void)),
166 tty_isbinaryin P((void)),
167 tty_isbinaryout P((void)),
168 tty_iscrnl P((void)),
169 tty_isecho P((void)),
170 tty_isediting P((void)),
171 tty_islitecho P((void)),
172 tty_isnewmap P((void)),
173 tty_israw P((void)),
174 tty_issofttab P((void)),
175 tty_istrapsig P((void)),
176 tty_linemode P((void));
177
178 extern void
179 tty_rspeed P((int)),
180 tty_setecho P((int)),
181 tty_setedit P((int)),
182 tty_setlinemode P((int)),
183 tty_setlitecho P((int)),
184 tty_setsig P((int)),
185 tty_setsofttab P((int)),
186 tty_tspeed P((int)),
187 willoption P((int)),
188 wontoption P((int)),
189 writenet P((unsigned char *, int));
190
191
192
193 /*
194 * The following are some clocks used to decide how to interpret
195 * the relationship between various variables.
196 */
197
198 extern struct {
199 int
200 system, /* what the current time is */
201 echotoggle, /* last time user entered echo character */
202 modenegotiated, /* last time operating mode negotiated */
203 didnetreceive, /* last time we read data from network */
204 ttypesubopt, /* ttype subopt is received */
205 tspeedsubopt, /* tspeed subopt is received */
206 environsubopt, /* environ subopt is received */
207 oenvironsubopt, /* old environ subopt is received */
208 xdisplocsubopt, /* xdisploc subopt is received */
209 baseline, /* time started to do timed action */
210 gotDM; /* when did we last see a data mark */
211 } clocks;
212
213
214 #if defined(CRAY2) && defined(UNICOS5)
215 extern int needtermstat;
216 #endif
217
218 #ifndef DEFAULT_IM
219 # ifdef CRAY
220 # define DEFAULT_IM "\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
221 # else
222 # ifdef sun
223 # define DEFAULT_IM "\r\n\r\nSunOS UNIX (%h) (%t)\r\n\r\r\n\r"
224 # else
225 # ifdef ultrix
226 # define DEFAULT_IM "\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
227 # else
228 # define DEFAULT_IM "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
229 # endif
230 # endif
231 # endif
232 #endif
233