Date: Fri, 31 Jul 2009 22:28:13 GMT From: Gabor Pali <pgj@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 166883 for review Message-ID: <200907312228.n6VMSD22092071@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=166883 Change 166883 by pgj@petymeg-current on 2009/07/31 22:27:24 All the stats-related kvm(3) symbols have been eliminated from netstat(1). Affected files ... .. //depot/projects/soc2009/pgj_libstat/src/usr.bin/netstat/main.c#43 edit Differences ... ==== //depot/projects/soc2009/pgj_libstat/src/usr.bin/netstat/main.c#43 (text+ko) ==== @@ -100,7 +100,6 @@ struct protox { int pr_index; /* index into nlist of cb head */ - int pr_sindex; /* index into nlist of stat block */ u_char pr_wanted; /* 1 if wanted, 0 otherwise */ void (*pr_cblocks)(u_long, const char *, int, int); /* control blocks printing routine */ @@ -113,99 +112,99 @@ int pr_usesysctl; /* non-zero if we use sysctl, not kvm */ int pr_protocol; } protox[] = { - { 0, 0, 1, NULL, tcp_stats, stat_TCP, + { 0, 1, NULL, tcp_stats, stat_TCP, NULL, NULL, "tcp", 1, IPPROTO_TCP }, - { 0, 0, 1, NULL, udp_stats, stat_UDP, + { 0, 1, NULL, udp_stats, stat_UDP, NULL, NULL, "udp", 1, IPPROTO_UDP }, #ifdef SCTP - { -1, 0, 1, sctp_protopr, sctp_stats, stat_SCTP, + { -1, 1, sctp_protopr, sctp_stats, stat_SCTP, NULL, NULL, "sctp", 1, IPPROTO_SCTP }, #endif - { 0, -1, 1, NULL, NULL, stat_MAX, + { 0, 1, NULL, NULL, stat_MAX, NULL, NULL, "divert", 1, IPPROTO_DIVERT }, - { 0, 0, 1, NULL, ip_stats, stat_IP, + { 0, 1, NULL, ip_stats, stat_IP, NULL, NULL, "ip", 1, IPPROTO_RAW }, - { 0, 0, 1, NULL, icmp_stats, stat_ICMP, + { 0, 1, NULL, icmp_stats, stat_ICMP, NULL, NULL, "icmp", 1, IPPROTO_ICMP }, - { 0, 0, 1, NULL, igmp_stats, stat_IGMP, + { 0, 1, NULL, igmp_stats, stat_IGMP, NULL, NULL, "igmp", 1, IPPROTO_IGMP }, #ifdef IPSEC - { -1, 0, 1, NULL, ipsec_stats, stat_IPsec, /* keep as compat */ + { -1, 1, NULL, ipsec_stats, stat_IPsec, /* keep as compat */ NULL, NULL, "ipsec", 0, 0}, - { -1, 0, 1, NULL, ah_stats, stat_AH, + { -1, 1, NULL, ah_stats, stat_AH, NULL, NULL, "ah", 0, 0}, - { -1, 0, 1, NULL, esp_stats, stat_ESP, + { -1, 1, NULL, esp_stats, stat_ESP, NULL, NULL, "esp", 0, 0}, - { -1, 0, 1, NULL, ipcomp_stats, stat_IPcomp, + { -1, 1, NULL, ipcomp_stats, stat_IPcomp, NULL, NULL, "ipcomp", 0, 0}, #endif - { 0, 0, 1, NULL, pim_stats, stat_PIM, + { 0, 1, NULL, pim_stats, stat_PIM, NULL, NULL, "pim", 1, IPPROTO_PIM }, - { -1, 0, 1, NULL, carp_stats, stat_CARP, + { -1, 1, NULL, carp_stats, stat_CARP, NULL, NULL, "carp", 1, 0 }, - { -1, 0, 1, NULL, pfsync_stats, stat_pfsync, + { -1, 1, NULL, pfsync_stats, stat_pfsync, NULL, NULL, "pfsync", 1, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, NULL, 0, 0 } }; #ifdef INET6 struct protox ip6protox[] = { - { 0, 0, 1, NULL, tcp_stats, stat_TCP, + { 0, 1, NULL, tcp_stats, stat_TCP, NULL, NULL, "tcp", 1, IPPROTO_TCP }, - { 0, 0, 1, NULL, udp_stats, stat_UDP, + { 0, 1, NULL, udp_stats, stat_UDP, NULL, NULL, "udp", 1, IPPROTO_UDP }, - { 0, 0, 1, NULL, ip6_stats, stat_IP6, + { 0, 1, NULL, ip6_stats, stat_IP6, NULL, ip6_ifstats, "ip6", 1, IPPROTO_RAW }, - { 0, 0, 1, NULL, icmp6_stats, stat_ICMP6, + { 0, 1, NULL, icmp6_stats, stat_ICMP6, NULL, icmp6_ifstats, "icmp6", 1, IPPROTO_ICMPV6 }, #ifdef IPSEC - { -1, 0, 1, NULL, ipsec_stats, stat_IPsec, + { -1, 1, NULL, ipsec_stats, stat_IPsec, NULL, NULL, "ipsec6", 0, 0 }, #endif #ifdef notyet - { -1, 0, 1, NULL, pim6_stats, stat_PIM6, + { -1, 1, NULL, pim6_stats, stat_PIM6, NULL, NULL, "pim6", 1, 0 }, #endif - { -1, 0, 1, NULL, rip6_stats, stat_RIP6, + { -1, 1, NULL, rip6_stats, stat_RIP6, NULL, NULL, "rip6", 1, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, NULL, 0, 0 } }; #endif /*INET6*/ #ifdef IPSEC struct protox pfkeyprotox[] = { - { -1, 0, 1, NULL, pfkey_stats, stat_pfkey, + { -1, 1, NULL, pfkey_stats, stat_pfkey, NULL, NULL, "pfkey", 0, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, NULL, 0, 0 } }; #endif struct protox atalkprotox[] = { - { N_DDPCB, 0, 1, atalkprotopr, ddp_stats, stat_DDP, + { N_DDPCB, 1, atalkprotopr, ddp_stats, stat_DDP, NULL, NULL, "ddp", 0, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, NULL, 0, 0 } }; #ifdef NETGRAPH struct protox netgraphprotox[] = { - { N_NGSOCKS, -1, 1, netgraphprotopr, NULL, stat_MAX, + { N_NGSOCKS, 1, netgraphprotopr, NULL, stat_MAX, NULL, NULL, "ctrl", 0, 0 }, - { N_NGSOCKS, -1, 1, netgraphprotopr, NULL, stat_MAX, + { N_NGSOCKS, 1, netgraphprotopr, NULL, stat_MAX, NULL, NULL, "data", 0, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, NULL, 0, 0 } }; #endif #ifdef IPX struct protox ipxprotox[] = { - { N_IPX, 0, 1, ipxprotopr, ipx_stats, stat_IPX, + { N_IPX, 1, ipxprotopr, ipx_stats, stat_IPX, NULL, NULL, "ipx", 0, 0 }, - { N_IPX, 0, 1, ipxprotopr, spx_stats, stat_SPX, + { N_IPX, 1, ipxprotopr, spx_stats, stat_SPX, NULL, NULL, "spx", 0, 0 }, - { -1, -1, 0, NULL, NULL, stat_MAX, + { -1, 0, NULL, NULL, stat_MAX, NULL, NULL, 0, 0, 0 } }; #endif @@ -611,28 +610,14 @@ tp->pr_name); return; } else { - /* XXX: temp. hack */ if (tp->pr_nstats != NULL) statpr(tp->pr_nstats, tp->pr_stx, tp->pr_name); - else { - pr = tp->pr_stats; - if (!pr) { - if (pflag) - printf("%s: no stats routine\n", - tp->pr_name); + else + if (pflag) { + printf("%s: no stats routine\n", + tp->pr_name); return; } - if (tp->pr_usesysctl && live) - off = 0; - else if (tp->pr_sindex < 0) { - if (pflag) - printf( - "%s: stats routine doesn't work on cores\n", - tp->pr_name); - return; - } else - off = nl[tp->pr_sindex].n_value; - } } } else { pr = tp->pr_cblocks;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907312228.n6VMSD22092071>