diff options
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/inet.c | 41 | ||||
-rw-r--r-- | usr.bin/netstat/inet6.c | 36 | ||||
-rw-r--r-- | usr.bin/netstat/main.c | 4 | ||||
-rw-r--r-- | usr.bin/netstat/mroute6.c | 6 |
4 files changed, 5 insertions, 82 deletions
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index 8bbac52bf9d..ceae24934d1 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet.c,v 1.152 2016/11/11 15:01:43 bluhm Exp $ */ +/* $OpenBSD: inet.c,v 1.153 2016/12/22 11:04:44 rzalamena Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* @@ -49,7 +49,6 @@ #include <netinet/icmp_var.h> #include <netinet/igmp_var.h> #include <netinet/ip_var.h> -#include <netinet/pim_var.h> #include <netinet/tcp.h> #include <netinet/tcp_seq.h> #define TCPSTATES @@ -771,44 +770,6 @@ igmp_stats(char *name) #undef py } -/* - * Dump PIM statistics structure. - */ -void -pim_stats(char *name) -{ - struct pimstat pimstat; - int mib[] = { CTL_NET, PF_INET, IPPROTO_PIM, PIMCTL_STATS }; - size_t len = sizeof(pimstat); - - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), - &pimstat, &len, NULL, 0) == -1) { - if (errno != ENOPROTOOPT) - warn("%s", name); - return; - } - - printf("%s:\n", name); -#define p(f, m) if (pimstat.f || sflag <= 1) \ - printf(m, pimstat.f, plural(pimstat.f)) -#define py(f, m) if (pimstat.f || sflag <= 1) \ - printf(m, pimstat.f, pimstat.f != 1 ? "ies" : "y") - - p(pims_rcv_total_msgs, "\t%llu message%s received\n"); - p(pims_rcv_total_bytes, "\t%llu byte%s received\n"); - p(pims_rcv_tooshort, "\t%llu message%s received with too few bytes\n"); - p(pims_rcv_badsum, "\t%llu message%s received with bad checksum\n"); - p(pims_rcv_badversion, "\t%llu message%s received with bad version\n"); - p(pims_rcv_registers_msgs, "\t%llu data register message%s received\n"); - p(pims_rcv_registers_bytes, "\t%llu data register byte%s received\n"); - p(pims_rcv_registers_wrongiif, "\t%llu data register message%s received on wrong iif\n"); - p(pims_rcv_badregisters, "\t%llu bad register%s received\n"); - p(pims_snd_registers_msgs, "\t%llu data register message%s sent\n"); - p(pims_snd_registers_bytes, "\t%llu data register byte%s sent\n"); -#undef p -#undef py -} - struct rpcnams { struct rpcnams *next; in_port_t port; diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 9e8be861345..299d0bffb33 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet6.c,v 1.50 2016/03/28 07:30:28 jca Exp $ */ +/* $OpenBSD: inet6.c,v 1.51 2016/12/22 11:04:44 rzalamena Exp $ */ /* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ /* * Copyright (c) 1983, 1988, 1993 @@ -45,7 +45,6 @@ #include <netinet/ip_var.h> #include <netinet6/ip6_var.h> #include <netinet6/in6_var.h> -#include <netinet6/pim6_var.h> #include <netinet6/raw_ip6.h> #include <netinet6/ip6_divert.h> @@ -168,7 +167,7 @@ static char *ip6nh[] = { "#100", "#101", "#102", - "PIM", + "#103", "#104", "#105", "#106", @@ -826,37 +825,6 @@ icmp6_stats(char *name) } /* - * Dump PIM statistics structure. - */ -void -pim6_stats(char *name) -{ - struct pim6stat pim6stat; - int mib[] = { CTL_NET, PF_INET6, IPPROTO_PIM, PIM6CTL_STATS }; - size_t len = sizeof(pim6stat); - - if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), - &pim6stat, &len, NULL, 0) == -1) { - if (errno != ENOPROTOOPT) - warn("%s", name); - return; - } - - printf("%s:\n", name); -#define p(f, m) if (pim6stat.f || sflag <= 1) \ - printf(m, (unsigned long long)pim6stat.f, plural(pim6stat.f)) - - p(pim6s_rcv_total, "\t%llu message%s received\n"); - p(pim6s_rcv_tooshort, "\t%llu message%s received with too few bytes\n"); - p(pim6s_rcv_badsum, "\t%llu message%s received with bad checksum\n"); - p(pim6s_rcv_badversion, "\t%llu message%s received with bad version\n"); - p(pim6s_rcv_registers, "\t%llu register%s received\n"); - p(pim6s_rcv_badregisters, "\t%llu bad register%s received\n"); - p(pim6s_snd_registers, "\t%llu register%s sent\n"); -#undef p -} - -/* * Dump raw ip6 statistics structure. */ void diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 8c7bbc9dd2f..e534b166634 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.110 2016/07/20 19:57:54 bluhm Exp $ */ +/* $OpenBSD: main.c,v 1.111 2016/12/22 11:04:44 rzalamena Exp $ */ /* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */ /* @@ -84,7 +84,6 @@ struct protox { { carp_stats, "carp", 0 }, { pfsync_stats, "pfsync", 0 }, { div_stats, "divert", IPPROTO_DIVERT }, - { pim_stats, "pim", 0 }, { pflow_stats, "pflow", 0 }, { NULL, NULL, 0 } }; @@ -93,7 +92,6 @@ struct protox ip6protox[] = { { ip6_stats, "ip6", IPPROTO_IPV6 }, { div6_stats, "divert6", IPPROTO_DIVERT }, { icmp6_stats, "icmp6", 0 }, - { pim6_stats, "pim6", 0 }, { rip6_stats, "rip6", 0 }, { NULL, NULL, 0 } }; diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c index 7a85cc6c94b..b6e83d95339 100644 --- a/usr.bin/netstat/mroute6.c +++ b/usr.bin/netstat/mroute6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mroute6.c,v 1.21 2016/08/27 04:13:43 guenther Exp $ */ +/* $OpenBSD: mroute6.c,v 1.22 2016/12/22 11:04:44 rzalamena Exp $ */ /* * Copyright (C) 1998 WIDE Project. @@ -107,8 +107,6 @@ mroute6pr(void) case 0: printf("no IPv6 multicast routing compiled into this system\n"); return; - case IPPROTO_PIM: - break; default: printf("IPv6 multicast routing protocol %u, unknown\n", mrtproto); @@ -212,8 +210,6 @@ mrt6_stats(void) case 0: printf("no IPv6 multicast routing compiled into this system\n"); return; - case IPPROTO_PIM: - break; default: printf("IPv6 multicast routing protocol %u, unknown\n", mrt6proto); |