ext.h revision 1.1 1 1.1 cgd /*
2 1.1 cgd * Copyright (c) 1989 The Regents of the University of California.
3 1.1 cgd * 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.1 cgd * @(#)ext.h 5.7 (Berkeley) 3/1/91
34 1.1 cgd */
35 1.1 cgd
36 1.1 cgd /*
37 1.1 cgd * Telnet server variable declarations
38 1.1 cgd */
39 1.1 cgd extern char options[256];
40 1.1 cgd extern char do_dont_resp[256];
41 1.1 cgd extern char will_wont_resp[256];
42 1.1 cgd extern int linemode; /* linemode on/off */
43 1.1 cgd #ifdef LINEMODE
44 1.1 cgd extern int uselinemode; /* what linemode to use (on/off) */
45 1.1 cgd extern int editmode; /* edit modes in use */
46 1.1 cgd extern int useeditmode; /* edit modes to use */
47 1.1 cgd extern int alwayslinemode; /* command line option */
48 1.1 cgd # ifdef KLUDGELINEMODE
49 1.1 cgd extern int lmodetype; /* Client support for linemode */
50 1.1 cgd # endif /* KLUDGELINEMODE */
51 1.1 cgd #endif /* LINEMODE */
52 1.1 cgd extern int flowmode; /* current flow control state */
53 1.1 cgd #ifdef DIAGNOSTICS
54 1.1 cgd extern int diagnostic; /* telnet diagnostic capabilities */
55 1.1 cgd #endif /* DIAGNOSTICS */
56 1.1 cgd #ifdef BFTPDAEMON
57 1.1 cgd extern int bftpd; /* behave as bftp daemon */
58 1.1 cgd #endif /* BFTPDAEMON */
59 1.1 cgd #if defined(SecurID)
60 1.1 cgd extern int require_SecurID;
61 1.1 cgd #endif
62 1.1 cgd #if defined(AUTHENTICATE)
63 1.1 cgd extern int auth_level;
64 1.1 cgd #endif
65 1.1 cgd
66 1.1 cgd extern slcfun slctab[NSLC + 1]; /* slc mapping table */
67 1.1 cgd
68 1.1 cgd char *terminaltype;
69 1.1 cgd
70 1.1 cgd /*
71 1.1 cgd * I/O data buffers, pointers, and counters.
72 1.1 cgd */
73 1.1 cgd extern char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
74 1.1 cgd
75 1.1 cgd extern char netibuf[BUFSIZ], *netip;
76 1.1 cgd
77 1.1 cgd extern char netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
78 1.1 cgd extern char *neturg; /* one past last bye of urgent data */
79 1.1 cgd
80 1.1 cgd extern int pcc, ncc;
81 1.1 cgd
82 1.1 cgd #if defined(CRAY2) && defined(UNICOS5)
83 1.1 cgd extern int unpcc; /* characters left unprocessed by CRAY-2 terminal routine */
84 1.1 cgd extern char *unptyip; /* pointer to remaining characters in buffer */
85 1.1 cgd #endif
86 1.1 cgd
87 1.1 cgd extern int pty, net;
88 1.1 cgd extern char *line;
89 1.1 cgd extern int SYNCHing; /* we are in TELNET SYNCH mode */
90 1.1 cgd
91 1.1 cgd #ifndef P
92 1.1 cgd # ifdef __STDC__
93 1.1 cgd # define P(x) x
94 1.1 cgd # else
95 1.1 cgd # define P(x) ()
96 1.1 cgd # endif
97 1.1 cgd #endif
98 1.1 cgd
99 1.1 cgd extern void
100 1.1 cgd _termstat P((void)),
101 1.1 cgd add_slc P((int, int, int)),
102 1.1 cgd check_slc P((void)),
103 1.1 cgd change_slc P((int, int, int)),
104 1.1 cgd cleanup P((int)),
105 1.1 cgd clientstat P((int, int, int)),
106 1.1 cgd copy_termbuf P((char *, int)),
107 1.1 cgd deferslc P((void)),
108 1.1 cgd defer_terminit P((void)),
109 1.1 cgd do_opt_slc P((unsigned char *, int)),
110 1.1 cgd doeof P((void)),
111 1.1 cgd dooption P((int)),
112 1.1 cgd dontoption P((int)),
113 1.1 cgd edithost P((char *, char *)),
114 1.1 cgd fatal P((int, char *)),
115 1.1 cgd fatalperror P((int, char *)),
116 1.1 cgd get_slc_defaults P((void)),
117 1.1 cgd init_env P((void)),
118 1.1 cgd init_termbuf P((void)),
119 1.1 cgd interrupt P((void)),
120 1.1 cgd localstat P((void)),
121 1.1 cgd netclear P((void)),
122 1.1 cgd netflush P((void)),
123 1.1 cgd #ifdef DIAGNOSTICS
124 1.1 cgd printoption P((char *, int)),
125 1.1 cgd printdata P((char *, char *, int)),
126 1.1 cgd printsub P((int, unsigned char *, int)),
127 1.1 cgd #endif
128 1.1 cgd ptyflush P((void)),
129 1.1 cgd putchr P((int)),
130 1.1 cgd putf P((char *, char *)),
131 1.1 cgd recv_ayt P((void)),
132 1.1 cgd send_do P((int, int)),
133 1.1 cgd send_dont P((int, int)),
134 1.1 cgd send_slc P((void)),
135 1.1 cgd send_status P((void)),
136 1.1 cgd send_will P((int, int)),
137 1.1 cgd send_wont P((int, int)),
138 1.1 cgd sendbrk P((void)),
139 1.1 cgd sendsusp P((void)),
140 1.1 cgd set_termbuf P((void)),
141 1.1 cgd start_login P((char *, int, char *)),
142 1.1 cgd start_slc P((int)),
143 1.1 cgd #if defined(AUTHENTICATE)
144 1.1 cgd start_slave P((char *)),
145 1.1 cgd #else
146 1.1 cgd start_slave P((char *, int, char *)),
147 1.1 cgd #endif
148 1.1 cgd suboption P((void)),
149 1.1 cgd telrcv P((void)),
150 1.1 cgd ttloop P((void)),
151 1.1 cgd tty_binaryin P((int)),
152 1.1 cgd tty_binaryout P((int));
153 1.1 cgd
154 1.1 cgd extern int
155 1.1 cgd end_slc P((unsigned char **)),
156 1.1 cgd getnpty P((void)),
157 1.1 cgd getpty P((void)),
158 1.1 cgd login_tty P((int)),
159 1.1 cgd spcset P((int, cc_t *, cc_t **)),
160 1.1 cgd stilloob P((int)),
161 1.1 cgd terminit P((void)),
162 1.1 cgd termstat P((void)),
163 1.1 cgd tty_flowmode P((void)),
164 1.1 cgd tty_isbinaryin P((void)),
165 1.1 cgd tty_isbinaryout P((void)),
166 1.1 cgd tty_iscrnl P((void)),
167 1.1 cgd tty_isecho P((void)),
168 1.1 cgd tty_isediting P((void)),
169 1.1 cgd tty_islitecho P((void)),
170 1.1 cgd tty_isnewmap P((void)),
171 1.1 cgd tty_israw P((void)),
172 1.1 cgd tty_issofttab P((void)),
173 1.1 cgd tty_istrapsig P((void)),
174 1.1 cgd tty_linemode P((void));
175 1.1 cgd
176 1.1 cgd extern void
177 1.1 cgd tty_rspeed P((int)),
178 1.1 cgd tty_setecho P((int)),
179 1.1 cgd tty_setedit P((int)),
180 1.1 cgd tty_setlinemode P((int)),
181 1.1 cgd tty_setlitecho P((int)),
182 1.1 cgd tty_setsig P((int)),
183 1.1 cgd tty_setsofttab P((int)),
184 1.1 cgd tty_tspeed P((int)),
185 1.1 cgd willoption P((int)),
186 1.1 cgd wontoption P((int)),
187 1.1 cgd writenet P((unsigned char *, int));
188 1.1 cgd
189 1.1 cgd #if defined(ENCRYPT)
190 1.1 cgd extern void (*encrypt_output) P((unsigned char *, int));
191 1.1 cgd extern int (*decrypt_input) P((int));
192 1.1 cgd extern char *nclearto;
193 1.1 cgd #endif
194 1.1 cgd
195 1.1 cgd
196 1.1 cgd /*
197 1.1 cgd * The following are some clocks used to decide how to interpret
198 1.1 cgd * the relationship between various variables.
199 1.1 cgd */
200 1.1 cgd
201 1.1 cgd extern struct {
202 1.1 cgd int
203 1.1 cgd system, /* what the current time is */
204 1.1 cgd echotoggle, /* last time user entered echo character */
205 1.1 cgd modenegotiated, /* last time operating mode negotiated */
206 1.1 cgd didnetreceive, /* last time we read data from network */
207 1.1 cgd ttypesubopt, /* ttype subopt is received */
208 1.1 cgd tspeedsubopt, /* tspeed subopt is received */
209 1.1 cgd environsubopt, /* environ subopt is received */
210 1.1 cgd xdisplocsubopt, /* xdisploc subopt is received */
211 1.1 cgd baseline, /* time started to do timed action */
212 1.1 cgd gotDM; /* when did we last see a data mark */
213 1.1 cgd } clocks;
214 1.1 cgd
215 1.1 cgd
216 1.1 cgd #if defined(CRAY2) && defined(UNICOS5)
217 1.1 cgd extern int needtermstat;
218 1.1 cgd #endif
219 1.1 cgd
220 1.1 cgd #ifndef CRAY
221 1.1 cgd #define DEFAULT_IM "\r\n\r\n4.3 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
222 1.1 cgd #else
223 1.1 cgd #define DEFAULT_IM "\r\n\r\nCray UNICOS (%h) (%t)\r\n\r\r\n\r"
224 1.1 cgd #endif
225