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