Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.sbin/tcpdump pull up rev 1.12 from trunk via patch ...



details:   https://anonhg.NetBSD.org/src/rev/245b610ead7c
branches:  netbsd-1-4
changeset: 469572:245b610ead7c
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Oct 11 05:39:09 1999 +0000

description:
pull up rev 1.12 from trunk via patch (requested by sjg):
  Add telnet option printing and hex/ascii dumps to tcpdump.

diffstat:

 usr.sbin/tcpdump/tcpdump.c |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (68 lines):

diff -r b31e03c9ccf8 -r 245b610ead7c usr.sbin/tcpdump/tcpdump.c
--- a/usr.sbin/tcpdump/tcpdump.c        Mon Oct 11 05:38:57 1999 +0000
+++ b/usr.sbin/tcpdump/tcpdump.c        Mon Oct 11 05:39:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tcpdump.c,v 1.9 1999/03/23 00:02:25 bad Exp $  */
+/*     $NetBSD: tcpdump.c,v 1.9.2.1 1999/10/11 05:39:09 cgd Exp $      */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -29,7 +29,7 @@
 #else
 __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
 The Regents of the University of California.  All rights reserved.\n");
-__RCSID("$NetBSD: tcpdump.c,v 1.9 1999/03/23 00:02:25 bad Exp $");
+__RCSID("$NetBSD: tcpdump.c,v 1.9.2.1 1999/10/11 05:39:09 cgd Exp $");
 #endif
 #endif
 
@@ -72,6 +72,7 @@
 int tflag = 1;                 /* print packet arrival time */
 int vflag;                     /* verbose */
 int xflag;                     /* print packet in hex */
+int Xflag;                     /* print packet in ascii as well as hex */
 
 int packettype;
 
@@ -156,7 +157,7 @@
 
        opterr = 0;
        while (
-           (op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xY")) != -1)
+           (op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xXY")) != -1)
                switch (op) {
 
                case 'a':
@@ -270,6 +271,10 @@
                        ++xflag;
                        break;
 
+               case 'X':
+                       ++Xflag;
+                       break;
+
                default:
                        usage();
                        /* NOTREACHED */
@@ -395,6 +400,10 @@
        register u_int i, s;
        register int nshorts;
 
+       if (Xflag) {
+               ascii_print(cp, length);
+               return;
+       }
        nshorts = (u_int) length / sizeof(u_short);
        i = 0;
        while (--nshorts >= 0) {
@@ -422,6 +431,10 @@
        register u_int i;
        register int nshorts;
 
+       if (Xflag) {
+               ascii_print(bp, length);
+               return;
+       }
        if ((long)bp & 1) {
                default_print_unaligned(bp, length);
                return;



Home | Main Index | Thread Index | Old Index