version 1.38, 2009/07/16 23:14:10 |
version 1.39, 2009/07/17 14:21:37 |
|
|
p(ip6s_cantfrag, "\t%llu datagram%s that can't be fragmented\n"); |
p(ip6s_cantfrag, "\t%llu datagram%s that can't be fragmented\n"); |
p(ip6s_badscope, "\t%llu packet%s that violated scope rules\n"); |
p(ip6s_badscope, "\t%llu packet%s that violated scope rules\n"); |
p(ip6s_notmember, "\t%llu multicast packet%s which we don't join\n"); |
p(ip6s_notmember, "\t%llu multicast packet%s which we don't join\n"); |
for (i = 0; i < 256; i++) |
for (first = 1, i = 0; i < 256; i++) |
if (ip6stat.ip6s_nxthist[i] != 0) { |
if (ip6stat.ip6s_nxthist[i] != 0) { |
|
if (first) { |
|
printf("\tInput packet histogram:\n"); |
|
first = 0; |
|
} |
n = NULL; |
n = NULL; |
if (ip6nh[i]) |
if (ip6nh[i]) |
n = ip6nh[i]; |
n = ip6nh[i]; |
else if ((ep = getprotobynumber(i)) != NULL) |
else if ((ep = getprotobynumber(i)) != NULL) |
n = ep->p_name; |
n = ep->p_name; |
if (n) |
if (n) |
printf("\t%llu %s packets\n", |
printf("\t\t%s: %llu\n", n, |
(unsigned long long)ip6stat.ip6s_nxthist[i], n); |
(unsigned long long)ip6stat.ip6s_nxthist[i]); |
else |
else |
printf("\t%llu proto %d packets\n", |
printf("\t\t#%d: %llu\n", i, |
(unsigned long long)ip6stat.ip6s_nxthist[i], i); |
(unsigned long long)ip6stat.ip6s_nxthist[i]); |
} |
} |
printf("\tMbuf statistics:\n"); |
printf("\tMbuf statistics:\n"); |
p(ip6s_m1, "\t\t%llu one mbuf%s\n"); |
p(ip6s_m1, "\t\t%llu one mbuf%s\n"); |
|
|
char ifbuf[IFNAMSIZ]; |
char ifbuf[IFNAMSIZ]; |
if (ip6stat.ip6s_m2m[i] != 0) { |
if (ip6stat.ip6s_m2m[i] != 0) { |
if (first) { |
if (first) { |
printf("\t\ttwo or more mbufs:\n"); |
printf("\t\ttwo or more mbuf:\n"); |
first = 0; |
first = 0; |
} |
} |
printf("\t\t\t%s = %llu\n", |
printf("\t\t\t%s = %llu\n", |
|
|
icmp6_stats(char *name) |
icmp6_stats(char *name) |
{ |
{ |
struct icmp6stat icmp6stat; |
struct icmp6stat icmp6stat; |
int i; |
int i, first; |
int mib[] = { CTL_NET, AF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_STATS }; |
int mib[] = { CTL_NET, AF_INET6, IPPROTO_ICMPV6, ICMPV6CTL_STATS }; |
size_t len = sizeof(icmp6stat); |
size_t len = sizeof(icmp6stat); |
|
|
|
|
"\t%llu error%s not generated because old message was icmp6 or so\n"); |
"\t%llu error%s not generated because old message was icmp6 or so\n"); |
p(icp6s_toofreq, |
p(icp6s_toofreq, |
"\t%llu error%s not generated because of rate limitation\n"); |
"\t%llu error%s not generated because of rate limitation\n"); |
for (i = 0; i < 256; i++) |
for (first = 1, i = 0; i < 256; i++) |
if (icmp6stat.icp6s_outhist[i] != 0) { |
if (icmp6stat.icp6s_outhist[i] != 0) { |
|
if (first) { |
|
printf("\tOutput packet histogram:\n"); |
|
first = 0; |
|
} |
printf("\t\t%s: %llu\n", icmp6names[i], |
printf("\t\t%s: %llu\n", icmp6names[i], |
(unsigned long long)icmp6stat.icp6s_outhist[i]); |
(unsigned long long)icmp6stat.icp6s_outhist[i]); |
} |
} |
|
|
p(icp6s_tooshort, "\t%llu message%s < minimum length\n"); |
p(icp6s_tooshort, "\t%llu message%s < minimum length\n"); |
p(icp6s_checksum, "\t%llu bad checksum%s\n"); |
p(icp6s_checksum, "\t%llu bad checksum%s\n"); |
p(icp6s_badlen, "\t%llu message%s with bad length\n"); |
p(icp6s_badlen, "\t%llu message%s with bad length\n"); |
for (i = 0; i < ICMP6_MAXTYPE; i++) |
for (first = 1, i = 0; i < ICMP6_MAXTYPE; i++) |
if (icmp6stat.icp6s_inhist[i] != 0) { |
if (icmp6stat.icp6s_inhist[i] != 0) { |
|
if (first) { |
|
printf("\tInput packet histogram:\n"); |
|
first = 0; |
|
} |
printf("\t\t%s: %llu\n", icmp6names[i], |
printf("\t\t%s: %llu\n", icmp6names[i], |
(unsigned long long)icmp6stat.icp6s_inhist[i]); |
(unsigned long long)icmp6stat.icp6s_inhist[i]); |
} |
} |
|
printf("\tHistogram of error messages to be generated:\n"); |
p_5(icp6s_odst_unreach_noroute, "\t\t%llu no route\n"); |
p_5(icp6s_odst_unreach_noroute, "\t\t%llu no route\n"); |
p_5(icp6s_odst_unreach_admin, "\t\t%llu administratively prohibited\n"); |
p_5(icp6s_odst_unreach_admin, "\t\t%llu administratively prohibited\n"); |
p_5(icp6s_odst_unreach_beyondscope, "\t\t%llu beyond scope\n"); |
p_5(icp6s_odst_unreach_beyondscope, "\t\t%llu beyond scope\n"); |