Hi,

Any resistance?

-- 
Pekka Savola                  "Tell me of difficulties surmounted,
Netcore Oy                    not those you stumble over and fall"
Systems. Networks. Security.   -- Robert Jordan: A Crown of Swords

---------- Forwarded message ----------
Date: Sat, 13 Jan 2001 20:23:09 +0200 (EET)
From: Pekka Savola <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Convert port/protocol numbers to names unless -nn.

Hi,

As per discussions on workers list.

Try to convert protocol/port numbers to names with -n.  The rationale is
that -n is almost always used to avoid DNS lookups and these aren't
necessary with this kind of resolving.

-nn can be used for old behaviour.

-- 
Pekka Savola                  "Tell me of difficulties surmounted,
Netcore Oy                    not those you stumble over and fall"
Systems. Networks. Security.   -- Robert Jordan: A Crown of Swords
diff -uNr tcpdump-3.6.1.orig/addrtoname.c tcpdump-3.6.1/addrtoname.c
--- tcpdump-3.6.1.orig/addrtoname.c     Sat Jan 13 20:01:00 2001
+++ tcpdump-3.6.1/addrtoname.c  Sat Jan 13 19:59:23 2001
@@ -581,7 +581,7 @@
 
                while (table->name)
                        table = table->nxt;
-               if (nflag) {
+               if (nflag > 1) {
                        (void)snprintf(buf, sizeof(buf), "%d", port);
                        table->name = strdup(buf);
                } else
@@ -745,7 +745,7 @@
                f_localnet = localnet;
                f_netmask = mask;
        }
-       if (nflag)
+       if (nflag > 1)
                /*
                 * Simplest way to suppress names.
                 */
diff -uNr tcpdump-3.6.1.orig/tcpdump.1 tcpdump-3.6.1/tcpdump.1
--- tcpdump-3.6.1.orig/tcpdump.1        Sat Jan 13 19:51:47 2001
+++ tcpdump-3.6.1/tcpdump.1     Sat Jan 13 19:50:19 2001
@@ -175,7 +175,11 @@
 ``tcpdump\ \ \-l \ \ > dat\ \ &\ \ tail\ \ \-f\ \ dat''.
 .TP
 .B \-n
-Don't convert addresses (i.e., host addresses, port numbers, etc.) to names.
+Don't convert host addresses to names.  This can be used to avoid 
+DNS lookups.
+.TP
+.B \-nn
+Don't convert protocol and port numbers etc. to names either.  
 .TP
 .B \-N
 Don't print domain name qualification of host names.  E.g.,

Reply via email to