Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/netstat use the names from the include files.



details:   https://anonhg.NetBSD.org/src/rev/5bb48d2c4fc9
branches:  trunk
changeset: 772215:5bb48d2c4fc9
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 24 20:18:35 2011 +0000

description:
use the names from the include files.

diffstat:

 usr.bin/netstat/inet.c |  31 +++++--------------------------
 1 files changed, 5 insertions(+), 26 deletions(-)

diffs (73 lines):

diff -r 757fb3004c01 -r 5bb48d2c4fc9 usr.bin/netstat/inet.c
--- a/usr.bin/netstat/inet.c    Sat Dec 24 20:08:39 2011 +0000
+++ b/usr.bin/netstat/inet.c    Sat Dec 24 20:18:35 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inet.c,v 1.100 2011/10/04 21:12:40 shattered Exp $     */
+/*     $NetBSD: inet.c,v 1.101 2011/12/24 20:18:35 christos Exp $      */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)inet.c       8.4 (Berkeley) 4/20/94";
 #else
-__RCSID("$NetBSD: inet.c,v 1.100 2011/10/04 21:12:40 shattered Exp $");
+__RCSID("$NetBSD: inet.c,v 1.101 2011/12/24 20:18:35 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -54,6 +54,7 @@
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <netinet/in_pcb.h>
+#define ICMP_STRINGS
 #include <netinet/ip_icmp.h>
 
 #ifdef INET6
@@ -595,28 +596,6 @@
 #undef p
 }
 
-static const char *icmpnames[] = {
-       "echo reply",
-       "#1",
-       "#2",
-       "destination unreachable",
-       "source quench",
-       "routing redirect",
-       "alternate host address",
-       "#7",
-       "echo",
-       "router advertisement",
-       "router solicitation",
-       "time exceeded",
-       "parameter problem",
-       "time stamp",
-       "time stamp reply",
-       "information request",
-       "information request reply",
-       "address mask request",
-       "address mask reply",
-};
-
 /*
  * Dump ICMP statistics.
  */
@@ -651,7 +630,7 @@
                                printf("\tOutput histogram:\n");
                                first = 0;
                        }
-                       printf("\t\t%s: %" PRIu64 "\n", icmpnames[i],
+                       printf("\t\t%s: %" PRIu64 "\n", icmp_type[i],
                           icmpstat[ICMP_STAT_OUTHIST + i]);
                }
        p(ICMP_STAT_BADCODE, "\t%" PRIu64 " message%s with bad code fields\n");
@@ -666,7 +645,7 @@
                                printf("\tInput histogram:\n");
                                first = 0;
                        }
-                       printf("\t\t%s: %" PRIu64 "\n", icmpnames[i],
+                       printf("\t\t%s: %" PRIu64 "\n", icmp_type[i],
                            icmpstat[ICMP_STAT_INHIST + i]);
                }
        p(ICMP_STAT_REFLECT, "\t%" PRIu64 " message response%s generated\n");



Home | Main Index | Thread Index | Old Index