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