2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
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.
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
33 * @(#)ext.h 8.2 (Berkeley) 12/15/93
34 * $FreeBSD: src/crypto/telnet/telnetd/ext.h,v 1.2.8.4 2002/04/13 10:59:08 markm Exp $
35 * $DragonFly: src/crypto/telnet/telnetd/ext.h,v 1.3 2006/01/17 23:50:35 dillon Exp $
39 * Telnet server variable declarations
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 */
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 extern int lmodetype
; /* Client support for linemode */
52 extern int flowmode
; /* current flow control state */
53 extern int restartany
; /* restart output on any character state */
55 extern int diagnostic
; /* telnet diagnostic capabilities */
56 #endif /* DIAGNOSTICS */
58 extern int bftpd
; /* behave as bftp daemon */
59 #endif /* BFTPDAEMON */
61 extern int auth_level
;
64 extern slcfun slctab
[NSLC
+ 1]; /* slc mapping table */
66 #define TERMINAL_TYPE_SIZE 41 /* allocated space for terminaltype */
71 * I/O data buffers, pointers, and counters.
73 extern char ptyobuf
[BUFSIZ
+NETSLOP
], *pfrontp
, *pbackp
;
75 extern char netibuf
[BUFSIZ
], *netip
;
77 extern char netobuf
[BUFSIZ
], *nfrontp
, *nbackp
;
78 extern char *neturg
; /* one past last bye of urgent data */
84 extern int SYNCHing
; /* we are in TELNET SYNCH mode */
88 add_slc(char, char, cc_t
),
90 change_slc(char, char, cc_t
),
92 clientstat(int, int, int),
93 copy_termbuf(char *, size_t),
96 do_opt_slc(unsigned char *, int),
100 edithost(char *, char *),
101 fatal(int, const char *),
102 fatalperror(int, const char *),
103 get_slc_defaults(void),
112 printoption(const char *, int),
113 printdata(const char *, char *, int),
114 printsub(char, unsigned char *, int),
116 process_slc(unsigned char, unsigned char, cc_t
),
119 putf(char *, char *),
130 start_login(char *, int, char *),
132 #ifdef AUTHENTICATION
135 start_slave(char *, int, char *),
144 end_slc(unsigned char **),
150 spcset(int, cc_t
*, cc_t
**),
155 tty_restartany(void),
156 tty_isbinaryin(void),
157 tty_isbinaryout(void),
172 tty_setlinemode(int),
180 int output_data(const char *, ...) __printflike(1, 2);
181 void output_datalen(const char *, int);
182 void startslave(char *, int, char *);
185 extern void (*encrypt_output
)(unsigned char *, int);
186 extern int (*decrypt_input
)(int);
187 extern char *nclearto
;
188 #endif /* ENCRYPTION */
192 * The following are some clocks used to decide how to interpret
193 * the relationship between various variables.
198 system
, /* what the current time is */
199 echotoggle
, /* last time user entered echo character */
200 modenegotiated
, /* last time operating mode negotiated */
201 didnetreceive
, /* last time we read data from network */
202 ttypesubopt
, /* ttype subopt is received */
203 tspeedsubopt
, /* tspeed subopt is received */
204 environsubopt
, /* environ subopt is received */
205 oenvironsubopt
, /* old environ subopt is received */
206 xdisplocsubopt
, /* xdisploc subopt is received */
207 baseline
, /* time started to do timed action */
208 gotDM
; /* when did we last see a data mark */
213 # define DEFAULT_IM "\r\n\r\nULTRIX (%h) (%t)\r\n\r\r\n\r"
215 # if defined(__DragonFly__)
216 # define DEFAULT_IM "\r\n\r\nDragonFly (%h) (%t)\r\n\r\r\n\r"
217 # elif defined(__FreeBSD__)
218 # define DEFAULT_IM "\r\n\r\nFreeBSD (%h) (%t)\r\n\r\r\n\r"
220 # define DEFAULT_IM "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"