diff options
author | Bruce M Simpson <bms@FreeBSD.org> | 2004-03-31 09:17:26 +0000 |
---|---|---|
committer | Bruce M Simpson <bms@FreeBSD.org> | 2004-03-31 09:17:26 +0000 |
commit | 5b0fe47811aa43b75fc69dbf7338cace232a4d48 (patch) | |
tree | eb08e08f0f875c3b16f8e1aec86091f100906f1c /contrib/tcpdump/print-telnet.c | |
parent | c76561e4dc56e0caaeade9b482501e52daad5ce3 (diff) | |
download | src-5b0fe47811aa43b75fc69dbf7338cace232a4d48.tar.gz src-5b0fe47811aa43b75fc69dbf7338cace232a4d48.zip |
Import tcpdump 3.8.3, from http://www.tcpdump.org/releases/tcpdump-3.8.3.tar.gz
Notes
Notes:
svn path=/vendor/tcpdump/dist/; revision=127668
Diffstat (limited to 'contrib/tcpdump/print-telnet.c')
-rw-r--r-- | contrib/tcpdump/print-telnet.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/contrib/tcpdump/print-telnet.c b/contrib/tcpdump/print-telnet.c index c070c442f95b..b420d35b51be 100644 --- a/contrib/tcpdump/print-telnet.c +++ b/contrib/tcpdump/print-telnet.c @@ -37,11 +37,11 @@ */ /* * @(#)Copyright (c) 1994, Simon J. Gerraty. - * + * * This is free software. It comes with NO WARRANTY. - * Permission to use, modify and distribute this source code + * Permission to use, modify and distribute this source code * is granted subject to the following conditions. - * 1/ that the above copyright notice and this notice + * 1/ that the above copyright notice and this notice * are preserved in all copies. */ @@ -50,20 +50,14 @@ #endif #ifndef lint -static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.18 2001/09/10 06:40:08 fenner Exp $"; +static const char rcsid[] _U_ = + "@(#) $Header: /tcpdump/master/tcpdump/print-telnet.c,v 1.21.2.3 2003/12/29 22:42:23 hannes Exp $"; #endif -#include <sys/param.h> -#include <sys/time.h> -#include <sys/types.h> -#include <ctype.h> - -#include <netinet/in.h> +#include <tcpdump-stdinc.h> #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> #include "interface.h" @@ -115,7 +109,8 @@ numstr(int x) static int telnet_parse(const u_char *sp, u_int length, int print) { - int i, c, x; + int i, x; + u_int c; const u_char *osp, *p; #define FETCH(c, sp, length) \ do { \ @@ -161,7 +156,7 @@ telnet_parse(const u_char *sp, u_int length, int print) break; /* IAC SB .... IAC SE */ p = sp; - while (length > p + 1 - sp) { + while (length > (u_int)(p + 1 - sp)) { if (p[0] == IAC && p[1] == SE) break; p++; @@ -237,7 +232,7 @@ telnet_print(const u_char *sp, u_int length) int l; osp = sp; - + while (length > 0 && *sp == IAC) { l = telnet_parse(sp, length, 0); if (l < 0) @@ -249,7 +244,7 @@ telnet_print(const u_char *sp, u_int length) if (Xflag && 2 < vflag) { if (first) printf("\nTelnet:"); - hex_print_with_offset(sp, l, sp - osp); + hex_print_with_offset("\n", sp, l, sp - osp); if (l > 8) printf("\n\t\t\t\t"); else |