From: kenh Date: Thu, 10 Feb 2000 17:56:13 +0000 (+0000) Subject: Make the handling of the -v flag a little more sensible, and document it. X-Git-Tag: tcpdump-3.5.1~357 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/15f343100fbf027ab2eb9797b3db5c17c0e7139d Make the handling of the -v flag a little more sensible, and document it. --- diff --git a/print-rx.c b/print-rx.c index 85639468..e1ddaec0 100644 --- a/print-rx.c +++ b/print-rx.c @@ -13,7 +13,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.10 2000-02-09 16:29:00 kenh Exp $"; + "@(#) $Header: /tcpdump/master/tcpdump/print-rx.c,v 1.11 2000-02-10 17:56:13 kenh Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -417,28 +417,35 @@ rx_print(register const u_char *bp, int length, int sport, int dport, printf(" rx %s", tok2str(rx_types, "type %d", rxh->type)); - if (vflag > 1) { + if (vflag) { int firstflag = 0; - printf(" cid %08x call# %d seq %d ser %d", - (int) EXTRACT_32BITS(&rxh->cid), - (int) EXTRACT_32BITS(&rxh->callNumber), + + if (vflag > 1) + printf(" cid %08x call# %d", + (int) EXTRACT_32BITS(&rxh->cid), + (int) EXTRACT_32BITS(&rxh->callNumber)); + + printf(" seq %d ser %d", (int) EXTRACT_32BITS(&rxh->seq), (int) EXTRACT_32BITS(&rxh->serial)); + if (vflag > 2) printf(" secindex %d serviceid %hu", (int) rxh->securityIndex, EXTRACT_16BITS(&rxh->serviceId)); - for (i = 0; i < NUM_RX_FLAGS; i++) { - if (rxh->flags & rx_flags[i].v) { - if (!firstflag) { - firstflag = 1; - printf(" "); - } else { - printf(","); + + if (vflag > 1) + for (i = 0; i < NUM_RX_FLAGS; i++) { + if (rxh->flags & rx_flags[i].v) { + if (!firstflag) { + firstflag = 1; + printf(" "); + } else { + printf(","); + } + printf("<%s>", rx_flags[i].s); } - printf("<%s>", rx_flags[i].s); } - } } /* diff --git a/tcpdump.1 b/tcpdump.1 index d5cda88d..b727f188 100644 --- a/tcpdump.1 +++ b/tcpdump.1 @@ -1,4 +1,4 @@ -.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.75 2000-01-29 16:39:27 itojun Exp $ (LBL) +.\" @(#) $Header: /tcpdump/master/tcpdump/Attic/tcpdump.1,v 1.76 2000-02-10 17:56:14 kenh Exp $ (LBL) .\" .\" Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992, 1994, 1995, 1996, 1997 .\" The Regents of the University of California. All rights reserved. @@ -1149,11 +1149,14 @@ The format is intended to be self-describing, but it will probably not be useful to people who are not familiar with the workings of AFS and RX. .LP -If the -v (verbose) flag is given twice, additional information is printed, -such as the the RX call ID, call number, sequence number, serial number, -and the RX packet flags. +If the -v (verbose) flag is given, the RX call number and sequence number +are printed. +.LP +If the -v flag is given twice, additional information is printed. +such as the the RX call ID, serial number, and the RX packet flags. +The MTU negotiation information is also printed from RX ack packets. .LP -If the -v flag is given again, the security index and service id are printed. +If the -v flag three times, the security index and service id are printed. .LP Error codes are printed for abort packets, with the exception of Ubik beacon packets (because abort packets are used to signify a yes vote