-/* $OpenBSD: commands.c,v 1.58 2014/07/20 04:07:16 guenther Exp $ */
+/* $OpenBSD: commands.c,v 1.59 2014/07/20 05:22:02 guenther Exp $ */
/* $NetBSD: commands.c,v 1.14 1996/03/24 22:03:48 jtk Exp $ */
/*
*/
#include "telnet_locl.h"
+
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+
#include <err.h>
+#include <pwd.h>
+#include <stdarg.h>
int tos = -1;
return 0; /* NOTREACHED */
}
-/*VARARGS*/
- int
-quit()
+int
+quit(void)
{
(void) call(bye, "bye", "fromquit", 0);
Exit(0);
- return 0; /*NOTREACHED*/
}
/*VARARGS*/
int error;
struct sockaddr_in sin;
unsigned long temp;
- extern char *inet_ntoa();
char *srp = 0;
int srlen;
char *cmd, *hostp = 0, *portp = 0, *user = 0, *aliasp = 0;
{
static char lsr[44];
char *cp, *cp2, *lsrp, *lsrep;
- int tmp;
struct in_addr sin_addr;
struct hostent *host = 0;
char c;
if (!c)
cp2 = 0;
- if ((tmp = inet_addr(cp)) != -1) {
- sin_addr.s_addr = tmp;
+ if ((sin_addr.s_addr = inet_addr(cp)) != INADDR_NONE) {
} else if ((host = gethostbyname(cp))) {
memmove((caddr_t)&sin_addr,
host->h_addr_list[0],
-/* $OpenBSD: externs.h,v 1.19 2014/07/20 03:00:31 deraadt Exp $ */
+/* $OpenBSD: externs.h,v 1.20 2014/07/20 05:22:02 guenther Exp $ */
/* $KTH: externs.h,v 1.16 1997/11/29 02:28:35 joda Exp $ */
/*
cc_t *tcval (int);
-int quit (void);
+__dead int quit(void);
/* genget.c */
void printsub(int direction, unsigned char *pointer, int length);
void EmptyTerminal(void);
void SetForExit(void);
-void Exit(int returnCode);
+__dead void Exit(int returnCode);
void ExitString(char *string, int returnCode);
extern struct termios new_tc;
-/* $OpenBSD: main.c,v 1.23 2014/07/19 23:50:38 guenther Exp $ */
+/* $OpenBSD: main.c,v 1.24 2014/07/20 05:22:02 guenther Exp $ */
/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
/*
int argc;
char *argv[];
{
- extern char *optarg;
- extern int optind;
int ch;
char *user, *alias;
const char *errstr;
-/* $OpenBSD: network.c,v 1.10 2014/07/19 23:50:38 guenther Exp $ */
+/* $OpenBSD: network.c,v 1.11 2014/07/20 05:22:02 guenther Exp $ */
/* $NetBSD: network.c,v 1.5 1996/02/28 21:04:06 thorpej Exp $ */
/*
*/
#include "telnet_locl.h"
-#include <err.h>
+#include <poll.h>
Ring netoring, netiring;
unsigned char netobuf[2*BUFSIZ], netibuf[BUFSIZ];
if (value < 0) {
perror("poll");
- (void) quit();
- /* NOTREACHED */
+ quit();
}
if (pfd[0].revents & POLLRDBAND)
return 1;
-/* $OpenBSD: sys_bsd.c,v 1.16 2014/07/19 23:50:38 guenther Exp $ */
+/* $OpenBSD: sys_bsd.c,v 1.17 2014/07/20 05:22:02 guenther Exp $ */
/* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */
/*
*/
#include "telnet_locl.h"
-#include <err.h>
+#include <sys/ioctl.h>
+#include <poll.h>
/*
* The following routines try to encapsulate what is system dependent
* 1 Do add this character
*/
-extern void xmitAO(), xmitEL(), xmitEC(), intp(), sendbrk();
-
int
TerminalSpecialChars(c)
int c;
-/* $OpenBSD: telnet_locl.h,v 1.5 2014/07/19 23:50:38 guenther Exp $ */
+/* $OpenBSD: telnet_locl.h,v 1.6 2014/07/20 05:22:02 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 <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
#include <ctype.h>
-#include <signal.h>
#include <errno.h>
-#include <setjmp.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-/* termios.h *must* be included before curses.h */
-#include <termios.h>
#include <fcntl.h>
#include <netdb.h>
-#include <pwd.h>
-#include <poll.h>
-#include <sys/time.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
#include <time.h>
-#include <sys/param.h>
-#include <sys/ioctl.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <sys/file.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <arpa/inet.h>
+#include <unistd.h>
#include <arpa/telnet.h>
#include "externs.h"
#include "defines.h"
-/* prototypes */
-
-/* $OpenBSD: utilities.c,v 1.12 2014/07/19 23:50:38 guenther Exp $ */
+/* $OpenBSD: utilities.c,v 1.13 2014/07/20 05:22:02 guenther Exp $ */
/* $NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $ */
/*
* SUCH DAMAGE.
*/
+/* these three defines affect the behavior of <arpa/telnet.h> */
#define TELOPTS
#define TELCMDS
#define SLC_NAMES
#include "telnet_locl.h"
+#include <poll.h>
FILE *NetTrace = 0; /* Not in bss, since needs to stay */
int prettydump;