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