summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorjoerg <joerg@NetBSD.org>2020-04-23 00:03:40 +0000
committerjoerg <joerg@NetBSD.org>2020-04-23 00:03:40 +0000
commit0008303cd997374b9bdfae5c0c91e15ec3ecea96 (patch)
treedc0a53834bf2db327be29dc8a5a7d9127eeed47e /libexec
parent3e1bfb4fc3e293147fca94d6b0e69c813cf0760c (diff)
Don't play #define games with extern, just have a separate list to avoid commons
Diffstat (limited to 'libexec')
-rw-r--r--libexec/telnetd/ext.h4
-rw-r--r--libexec/telnetd/global.c51
2 files changed, 50 insertions, 5 deletions
diff --git a/libexec/telnetd/ext.h b/libexec/telnetd/ext.h
index 6726aab7b26..c79fe28e7e1 100644
--- a/libexec/telnetd/ext.h
+++ b/libexec/telnetd/ext.h
@@ -1,4 +1,4 @@
-/* $NetBSD: ext.h,v 1.22 2012/01/10 23:39:11 joerg Exp $ */
+/* $NetBSD: ext.h,v 1.23 2020/04/23 00:03:40 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -179,7 +179,7 @@ extern char *nclearto;
* The following are some clocks used to decide how to interpret
* the relationship between various variables.
*/
-extern struct {
+extern struct clockstate {
int
system, /* what the current time is */
echotoggle, /* last time user entered echo character */
diff --git a/libexec/telnetd/global.c b/libexec/telnetd/global.c
index 2b5ef2d4fd7..89b97ec9515 100644
--- a/libexec/telnetd/global.c
+++ b/libexec/telnetd/global.c
@@ -1,4 +1,4 @@
-/* $NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $ */
+/* $NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)global.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $");
+__RCSID("$NetBSD: global.c,v 1.9 2020/04/23 00:03:40 joerg Exp $");
#endif
#endif /* not lint */
@@ -47,5 +47,50 @@ __RCSID("$NetBSD: global.c,v 1.8 2003/08/07 09:46:51 agc Exp $");
*/
#include <defs.h>
-#define extern
#include <ext.h>
+
+char options[256];
+char do_dont_resp[256];
+char will_wont_resp[256];
+int linemode; /* linemode on/off */
+#ifdef LINEMODE
+int uselinemode; /* what linemode to use (on/off) */
+int editmode; /* edit modes in use */
+int useeditmode; /* edit modes to use */
+int alwayslinemode; /* command line option */
+# ifdef KLUDGELINEMODE
+int lmodetype; /* Client support for linemode */
+# endif /* KLUDGELINEMODE */
+#endif /* LINEMODE */
+int flowmode; /* current flow control state */
+int restartany; /* restart output on any character state */
+#ifdef DIAGNOSTICS
+int diagnostic; /* telnet diagnostic capabilities */
+#endif /* DIAGNOSTICS */
+#ifdef SECURELOGIN
+int require_secure_login;
+#endif
+#ifdef AUTHENTICATION
+int auth_level;
+#endif
+
+slcfun slctab[NSLC + 1]; /* slc mapping table */
+char terminaltype[41];
+
+/*
+ * I/O data buffers, pointers, and counters.
+ */
+char ptyobuf[BUFSIZ+NETSLOP], *pfrontp, *pbackp;
+char netibuf[BUFSIZ], *netip;
+char netobuf[BUFSIZ+NETSLOP], *nfrontp, *nbackp;
+char *neturg; /* one past last bye of urgent data */
+int pcc, ncc;
+int pty, net;
+char *line;
+int SYNCHing; /* we are in TELNET SYNCH mode */
+
+#ifdef ENCRYPTION
+char *nclearto;
+#endif /* ENCRYPTION */
+
+struct clockstate clocks;