Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/netstat/inet6.c
Show First 20 Lines • Show All 944 Lines • ▼ Show 20 Lines | |||||
* Dump ICMP6 statistics. | * Dump ICMP6 statistics. | ||||
*/ | */ | ||||
void | void | ||||
icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) | icmp6_stats(u_long off, const char *name, int af1 __unused, int proto __unused) | ||||
{ | { | ||||
struct icmp6stat icmp6stat; | struct icmp6stat icmp6stat; | ||||
int i, first; | int i, first; | ||||
if (fetch_stats("net.inet6.icmp6.stats", off, &icmp6stat, | if (fetch_stats("net.inet6.icmp6.stats." __XSTRING(ICMP6STAT_VER), | ||||
sizeof(icmp6stat), kread_counters) != 0) | off, &icmp6stat, sizeof(icmp6stat), kread_counters) != 0) | ||||
return; | return; | ||||
xo_emit("{T:/%s}:\n", name); | xo_emit("{T:/%s}:\n", name); | ||||
xo_open_container(name); | xo_open_container(name); | ||||
#define p(f, m) if (icmp6stat.f || sflag <= 1) \ | #define p(f, m) if (icmp6stat.f || sflag <= 1) \ | ||||
xo_emit(m, (uintmax_t)icmp6stat.f, plural(icmp6stat.f)) | xo_emit(m, (uintmax_t)icmp6stat.f, plural(icmp6stat.f)) | ||||
#define p_5(f, m) if (icmp6stat.f || sflag <= 1) \ | #define p_5(f, m) if (icmp6stat.f || sflag <= 1) \ | ||||
▲ Show 20 Lines • Show All 404 Lines • Show Last 20 Lines |