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