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