1 /* $NetBSD: ext.h,v 1.22 2012/01/10 23:39:11 joerg Exp $ */
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * from: @(#)ext.h 8.2 (Berkeley) 12/15/93
35 * Telnet server variable declarations
37 extern char options
[256];
38 extern char do_dont_resp
[256];
39 extern char will_wont_resp
[256];
40 extern int linemode
; /* linemode on/off */
42 extern int uselinemode
; /* what linemode to use (on/off) */
43 extern int editmode
; /* edit modes in use */
44 extern int useeditmode
; /* edit modes to use */
45 extern int alwayslinemode
; /* command line option */
46 # ifdef KLUDGELINEMODE
47 extern int lmodetype
; /* Client support for linemode */
48 # endif /* KLUDGELINEMODE */
50 extern int flowmode
; /* current flow control state */
51 extern int restartany
; /* restart output on any character state */
53 extern int diagnostic
; /* telnet diagnostic capabilities */
54 #endif /* DIAGNOSTICS */
56 extern int require_secure_login
;
59 extern int auth_level
;
62 extern slcfun slctab
[NSLC
+ 1]; /* slc mapping table */
63 extern char terminaltype
[41];
66 * I/O data buffers, pointers, and counters.
68 extern char ptyobuf
[BUFSIZ
+NETSLOP
], *pfrontp
, *pbackp
;
69 extern char netibuf
[BUFSIZ
], *netip
;
70 extern char netobuf
[BUFSIZ
+NETSLOP
], *nfrontp
, *nbackp
;
71 extern char *neturg
; /* one past last bye of urgent data */
75 extern int SYNCHing
; /* we are in TELNET SYNCH mode */
77 #include <sys/cdefs.h>
81 add_slc(char, char, cc_t
),
83 change_slc(int, int, cc_t
),
85 clientstat(int, int, int),
86 copy_termbuf(char *, int),
89 do_opt_slc(unsigned char *, int),
93 edithost(const char *, const char *),
94 fatal(int, const char *) __dead
,
95 fatalperror(int, const char *) __dead
,
96 get_slc_defaults(void),
105 printoption(const char *, int),
106 printdata(const char *, char *, int),
108 printsub(int, unsigned char *, int),
123 start_login(char *, int, char *) __dead
,
125 startslave(char *, int, char *),
133 putf(const char *, char *);
136 end_slc(unsigned char **),
139 spcset(int, cc_t
*, cc_t
**),
144 tty_restartany(void),
145 tty_isbinaryin(void),
146 tty_isbinaryout(void),
161 tty_setlinemode(int),
168 writenet(unsigned char *, int);
170 extern int output_data(const char *, ...)
171 __attribute__((__format__(__printf__
, 1, 2)));
172 extern int output_datalen(const char *, size_t);
175 extern char *nclearto
;
176 #endif /* ENCRYPTION */
179 * The following are some clocks used to decide how to interpret
180 * the relationship between various variables.
184 system
, /* what the current time is */
185 echotoggle
, /* last time user entered echo character */
186 modenegotiated
, /* last time operating mode negotiated */
187 didnetreceive
, /* last time we read data from network */
188 ttypesubopt
, /* ttype subopt is received */
189 tspeedsubopt
, /* tspeed subopt is received */
190 environsubopt
, /* environ subopt is received */
191 oenvironsubopt
, /* old environ subopt is received */
192 xdisplocsubopt
, /* xdisploc subopt is received */
193 baseline
, /* time started to do timed action */
194 gotDM
; /* when did we last see a data mark */
198 # define DEFAULT_IM "\r\n\r\n4.4 BSD UNIX (%h) (%t)\r\n\r\r\n\r"
201 #ifdef AUTHENTICATION
202 #include <libtelnet/auth.h>
206 #include <libtelnet/encrypt.h>