-/* $OpenBSD: commands.c,v 1.61 2014/07/20 07:35:04 guenther Exp $ */
+/* $OpenBSD: commands.c,v 1.62 2014/07/20 08:12:45 guenther Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
#include "telnet_locl.h"
+#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
+#include <arpa/telnet.h>
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include <netdb.h>
#include <pwd.h>
#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
int tos = -1;
-/* $OpenBSD: externs.h,v 1.21 2014/07/20 07:35:04 guenther Exp $ */
+/* $OpenBSD: externs.h,v 1.22 2014/07/20 08:12:45 guenther Exp $ */
/* $KTH: externs.h,v 1.16 1997/11/29 02:28:35 joda Exp $ */
/*
termdata, /* Print out terminal data flow */
debug; /* Debug level */
-extern volatile sig_atomic_t intr_happened, intr_waiting; /* for interrupt handling */
-
extern cc_t escape; /* Escape to command mode */
extern cc_t rlogin; /* Rlogin mode escape character */
#ifdef KLUDGELINEMODE
-/* $OpenBSD: main.c,v 1.25 2014/07/20 06:39:41 guenther Exp $ */
+/* $OpenBSD: main.c,v 1.26 2014/07/20 08:12:45 guenther Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
#include "telnet_locl.h"
+#include <sys/socket.h>
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
int family = AF_UNSPEC;
-/* $OpenBSD: network.c,v 1.12 2014/07/20 06:24:19 guenther Exp $ */
+/* $OpenBSD: network.c,v 1.13 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: network.c,v 1.5 1996/02/28 21:04:06 thorpej Exp $ */
/*
*/
#include "telnet_locl.h"
+
+#include <sys/socket.h>
+#include <errno.h>
#include <poll.h>
Ring netoring, netiring;
-/* $OpenBSD: ring.c,v 1.7 2014/07/20 06:24:19 guenther Exp $ */
+/* $OpenBSD: ring.c,v 1.8 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $ */
/*
* SUCH DAMAGE.
*/
-#include "telnet_locl.h"
+#include <string.h>
+#include "ring.h"
/*
* This defines a structure for a ring buffer.
* to ZERO on allocation, we need to make sure, when interpreting the
* clock, that when the times are EQUAL, then the buffer is FULL.
*/
-static u_long ring_clock = 0;
+static unsigned long ring_clock = 0;
#define ring_empty(d) (((d)->consume == (d)->supply) && \
-/* $OpenBSD: ring.h,v 1.8 2014/07/20 06:24:19 guenther Exp $ */
+/* $OpenBSD: ring.h,v 1.9 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: ring.h,v 1.5 1996/02/28 21:04:09 thorpej Exp $ */
/*
unsigned char *top; /* highest address+1 in buffer */
unsigned char *mark; /* marker (user defined) */
int size; /* size in bytes of buffer */
- u_long consumetime; /* help us keep straight full, empty, etc. */
- u_long supplytime;
+ unsigned long consumetime; /* help us keep straight full, empty, etc. */
+ unsigned long supplytime;
} Ring;
/* Here are some functions and macros to deal with the ring buffer */
-/* $OpenBSD: sys_bsd.c,v 1.19 2014/07/20 07:35:04 guenther Exp $ */
+/* $OpenBSD: sys_bsd.c,v 1.20 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */
/*
#include "telnet_locl.h"
#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <arpa/telnet.h>
+#include <errno.h>
#include <poll.h>
+#include <string.h>
#include <unistd.h>
/*
longjmp(peerdied, -1);
}
-volatile sig_atomic_t intr_happened = 0;
-volatile sig_atomic_t intr_waiting = 0;
-
/* ARGSUSED */
void
intr(sig)
int sig;
{
- if (intr_waiting) {
- intr_happened = 1;
- return;
- }
if (localchars) {
intp();
return;
-/* $OpenBSD: telnet.c,v 1.23 2014/07/20 06:39:41 guenther Exp $ */
+/* $OpenBSD: telnet.c,v 1.24 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */
/*
#include "telnet_locl.h"
+#include <arpa/telnet.h>
#include <ctype.h>
#include <curses.h>
+#include <stdlib.h>
+#include <string.h>
#include <term.h>
#define strip(x) (eight ? (x) : ((x) & 0x7f))
-/* $OpenBSD: telnet_locl.h,v 1.8 2014/07/20 07:35:04 guenther Exp $ */
+/* $OpenBSD: telnet_locl.h,v 1.9 2014/07/20 08:12:46 guenther Exp $ */
/* $KTH: telnet_locl.h,v 1.13 1997/11/03 21:37:55 assar Exp $ */
/*
* SUCH DAMAGE.
*/
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <termios.h>
-#include <time.h>
-
-#include <arpa/telnet.h>
#include "ring.h"
#include "externs.h"
-/* $OpenBSD: terminal.c,v 1.9 2014/07/20 07:35:04 guenther Exp $ */
+/* $OpenBSD: terminal.c,v 1.10 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: terminal.c,v 1.5 1996/02/28 21:04:17 thorpej Exp $ */
/*
#include "telnet_locl.h"
+#include <arpa/telnet.h>
+#include <errno.h>
#include <unistd.h>
Ring ttyoring, ttyiring;
-/* $OpenBSD: utilities.c,v 1.15 2014/07/20 07:34:43 guenther Exp $ */
+/* $OpenBSD: utilities.c,v 1.16 2014/07/20 08:12:46 guenther Exp $ */
/* $NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $ */
/*
#include "telnet_locl.h"
+#include <arpa/telnet.h>
#include <ctype.h>
#include <limits.h>
#include <poll.h>
+#include <stdlib.h>
+#include <string.h>
FILE *NetTrace = 0; /* Not in bss, since needs to stay */
int prettydump;