diff options
author | wollman <wollman@FreeBSD.org> | 1995-09-22 17:24:51 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-09-22 17:24:51 +0000 |
commit | b5c39e2cde8b22b6c117ad552b41374fa7327fa4 (patch) | |
tree | 702d78b38d362910a2e9ceb5fd73c9768c2a7ed4 /usr.sbin/tcpdump | |
parent | 5d32187f535bda096b77e3ac34a4f15ddf4aa3bc (diff) | |
download | FreeBSD-src-b5c39e2cde8b22b6c117ad552b41374fa7327fa4.zip FreeBSD-src-b5c39e2cde8b22b6c117ad552b41374fa7327fa4.tar.gz |
Print EtherTalk packets correctly; closes PR 649.
Document `-T' option in manual page.
Submitted by: Toshihiro Kanda <candy@fct.kgc.co.jp> (first fix only)
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/tcpdump/print-atalk.c | 19 | ||||
-rw-r--r-- | usr.sbin/tcpdump/tcpdump/tcpdump.1 | 12 |
2 files changed, 23 insertions, 8 deletions
diff --git a/usr.sbin/tcpdump/tcpdump/print-atalk.c b/usr.sbin/tcpdump/tcpdump/print-atalk.c index a6dceea..8bcb8ff 100644 --- a/usr.sbin/tcpdump/tcpdump/print-atalk.c +++ b/usr.sbin/tcpdump/tcpdump/print-atalk.c @@ -22,7 +22,7 @@ */ #ifndef lint static char rcsid[] = - "@(#)$Header: print-atalk.c,v 1.36 94/06/20 19:44:34 leres Exp $ (LBL)"; + "@(#)$Header: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/print-atalk.c,v 1.2 1995/03/08 12:52:25 olah Exp $ (LBL)"; #endif #include <sys/param.h> @@ -100,9 +100,16 @@ atalk_print(register const u_char *bp, int length) register const struct atShortDDP *sdp; u_short snet; +#if 0 lp = (struct LAP *)bp; bp += sizeof(*lp); length -= sizeof(*lp); +#else + { + static struct LAP lp_ = {0, 0, lapDDP}; + lp = &lp_; + } +#endif switch (lp->type) { case lapShortDDP: @@ -532,7 +539,7 @@ ataddr_string(u_short atnet, u_char athost) if (tp2->addr == i) { tp->addr = (atnet << 8) | athost; tp->nxt = (struct hnamemem *)calloc(1, sizeof(*tp)); - (void)sprintf(nambuf, "%s.%d", tp2->name, athost); + (void)sprintf(nambuf, "%s.%02x", tp2->name, athost); tp->name = savestr(nambuf); return (tp->name); } @@ -540,10 +547,10 @@ ataddr_string(u_short atnet, u_char athost) tp->addr = (atnet << 8) | athost; tp->nxt = (struct hnamemem *)calloc(1, sizeof(*tp)); if (athost != 255) - (void)sprintf(nambuf, "%d.%d.%d", + (void)sprintf(nambuf, "%02x.%02x.%02x", atnet >> 8, atnet & 0xff, athost); else - (void)sprintf(nambuf, "%d.%d", atnet >> 8, atnet & 0xff); + (void)sprintf(nambuf, "%02x.%02x", atnet >> 8, atnet & 0xff); i = strlen(nambuf) + 1; tp->name = strcpy(malloc((u_int) i), nambuf); @@ -564,8 +571,8 @@ ddpskt_string(register int skt) static char buf[8]; if (nflag) { - (void)sprintf(buf, "%d", skt); + (void)sprintf(buf, "%02x", skt); return (buf); } - return (tok2str(skt2str, "%d", skt)); + return (tok2str(skt2str, "%02x", skt)); } diff --git a/usr.sbin/tcpdump/tcpdump/tcpdump.1 b/usr.sbin/tcpdump/tcpdump/tcpdump.1 index 2bb5c9f..663fd75 100644 --- a/usr.sbin/tcpdump/tcpdump/tcpdump.1 +++ b/usr.sbin/tcpdump/tcpdump/tcpdump.1 @@ -1,4 +1,4 @@ -.\" @(#) $Header: tcpdump.1,v 1.45 94/06/20 18:54:27 leres Exp $ (LBL) +.\" @(#) $Id: /home/ncvs/src/usr.sbin/tcpdump/tcpdump/tcpdump.1,v 1.3 1995/03/08 12:52:47 olah Exp $ (LBL) .\" .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994 .\" The Regents of the University of California. All rights reserved. @@ -20,7 +20,7 @@ .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" -.TH TCPDUMP 1 "20 Jun 1994" +.TH TCPDUMP 1 "22 Sept 1995" .SH NAME tcpdump \- dump traffic on a network .SH SYNOPSIS @@ -34,6 +34,9 @@ tcpdump \- dump traffic on a network ] [ .B \-F .I file +] [ +.B \-T +.I type ] .br .ti +8 @@ -155,6 +158,11 @@ Print absolute, rather than relative, TCP sequence numbers. .B \-tt Print an unformatted timestamp on each dump line. .TP +.B \-T +Print unrecognized UDP packets as if they were type +.IR type . +Valid types are `vat', `wb', `rpc', and `rtp'. +.TP .B \-v (Slightly more) verbose output. For example, the time to live and type of service information in an IP packet is printed. |