| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $ */ | | 1 | /* $NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1989, 1993 | | 4 | * Copyright (c) 1989, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -24,28 +24,73 @@ | | | @@ -24,28 +24,73 @@ |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 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 | | 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 | | 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 | | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | | 29 | * SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | #ifndef lint | | 33 | #ifndef lint |
34 | #if 0 | | 34 | #if 0 |
35 | static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93"; | | 35 | static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93"; |
36 | #else | | 36 | #else |
37 | __RCSID("$NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $"); | | 37 | __RCSID("$NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $"); |
38 | #endif | | 38 | #endif |
39 | #endif /* not lint */ | | 39 | #endif /* not lint */ |
40 | | | 40 | |
41 | /* | | 41 | /* |
42 | * Allocate global variables. We do this | | 42 | * Allocate global variables. We do this |
43 | * by including the header file that defines | | 43 | * by including the header file that defines |
44 | * them all as externs, but first we define | | 44 | * them all as externs, but first we define |
45 | * the keyword "extern" to be nothing, so that | | 45 | * the keyword "extern" to be nothing, so that |
46 | * we will actually allocate the space. | | 46 | * we will actually allocate the space. |
47 | */ | | 47 | */ |
48 | | | 48 | |
49 | #include <defs.h> | | 49 | #include <defs.h> |
50 | #define extern | | | |
51 | #include <ext.h> | | 50 | #include <ext.h> |
| | | 51 | |
| | | 52 | char options[256]; |
| | | 53 | char do_dont_resp[256]; |
| | | 54 | char will_wont_resp[256]; |
| | | 55 | int linemode; /* linemode on/off */ |
| | | 56 | #ifdef LINEMODE |
| | | 57 | int uselinemode; /* what linemode to use (on/off) */ |
| | | 58 | int editmode; /* edit modes in use */ |
| | | 59 | int useeditmode; /* edit modes to use */ |
| | | 60 | int alwayslinemode; /* command line option */ |
| | | 61 | # ifdef KLUDGELINEMODE |
| | | 62 | int lmodetype; /* Client support for linemode */ |
| | | 63 | # endif /* KLUDGELINEMODE */ |
| | | 64 | #endif /* LINEMODE */ |
| | | 65 | int flowmode; /* current flow control state */ |
| | | 66 | int restartany; /* restart output on any character state */ |
| | | 67 | #ifdef DIAGNOSTICS |
| | | 68 | int diagnostic; /* telnet diagnostic capabilities */ |
| | | 69 | #endif /* DIAGNOSTICS */ |
| | | 70 | #ifdef SECURELOGIN |
| | | 71 | int require_secure_login; |
| | | 72 | #endif |
| | | 73 | #ifdef AUTHENTICATION |
| | | 74 | int auth_level; |
| | | 75 | #endif |
| | | 76 | |
| | | 77 | slcfun slctab[NSLC + 1]; /* slc mapping table */ |
| | | 78 | char terminaltype[41]; |
| | | 79 | |
| | | 80 | /* |
| | | 81 | * I/O data buffers, pointers, and counters. |
| | | 82 | */ |
| | | 83 | char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp; |
| | | 84 | char netibuf[BUFSIZ], *netip; |
| | | 85 | char netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp; |
| | | 86 | char *neturg; /* one past last bye of urgent data */ |
| | | 87 | int pcc, ncc; |
| | | 88 | int pty, net; |
| | | 89 | char *line; |
| | | 90 | int SYNCHing; /* we are in TELNET SYNCH mode */ |
| | | 91 | |
| | | 92 | #ifdef ENCRYPTION |
| | | 93 | char *nclearto; |
| | | 94 | #endif /* ENCRYPTION */ |
| | | 95 | |
| | | 96 | struct clockstate clocks; |