mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-01 12:19:28 +00:00
If -s -s is specified, don't show zero multicast routing statistics.
This commit is contained in:
parent
fbded4984e
commit
76840ccb9d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=83204
@ -168,30 +168,27 @@ mrt_stats(u_long mstaddr)
|
||||
kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat));
|
||||
}
|
||||
printf("IPv4 multicast forwarding:\n");
|
||||
printf(" %10lu multicast forwarding cache lookup%s\n",
|
||||
mrtstat.mrts_mfc_lookups, plural(mrtstat.mrts_mfc_lookups));
|
||||
printf(" %10lu multicast forwarding cache miss%s\n",
|
||||
mrtstat.mrts_mfc_misses, plurales(mrtstat.mrts_mfc_misses));
|
||||
printf(" %10lu upcall%s to mrouted\n",
|
||||
mrtstat.mrts_upcalls, plural(mrtstat.mrts_upcalls));
|
||||
printf(" %10lu upcall queue overflow%s\n",
|
||||
mrtstat.mrts_upq_ovflw, plural(mrtstat.mrts_upq_ovflw));
|
||||
printf(" %10lu upcall%s dropped due to full socket buffer\n",
|
||||
mrtstat.mrts_upq_sockfull, plural(mrtstat.mrts_upq_sockfull));
|
||||
printf(" %10lu cache cleanup%s\n",
|
||||
mrtstat.mrts_cache_cleanups, plural(mrtstat.mrts_cache_cleanups));
|
||||
printf(" %10lu datagram%s with no route for origin\n",
|
||||
mrtstat.mrts_no_route, plural(mrtstat.mrts_no_route));
|
||||
printf(" %10lu datagram%s arrived with bad tunneling\n",
|
||||
mrtstat.mrts_bad_tunnel, plural(mrtstat.mrts_bad_tunnel));
|
||||
printf(" %10lu datagram%s could not be tunneled\n",
|
||||
mrtstat.mrts_cant_tunnel, plural(mrtstat.mrts_cant_tunnel));
|
||||
printf(" %10lu datagram%s arrived on wrong interface\n",
|
||||
mrtstat.mrts_wrong_if, plural(mrtstat.mrts_wrong_if));
|
||||
printf(" %10lu datagram%s selectively dropped\n",
|
||||
mrtstat.mrts_drop_sel, plural(mrtstat.mrts_drop_sel));
|
||||
printf(" %10lu datagram%s dropped due to queue overflow\n",
|
||||
mrtstat.mrts_q_overflow, plural(mrtstat.mrts_q_overflow));
|
||||
printf(" %10lu datagram%s dropped for being too large\n",
|
||||
mrtstat.mrts_pkt2large, plural(mrtstat.mrts_pkt2large));
|
||||
|
||||
#define p(f, m) if (mrtstat.f || sflag <= 1) \
|
||||
printf(m, mrtstat.f, plural(mrtstat.f))
|
||||
#define p2(f, m) if (mrtstat.f || sflag <= 1) \
|
||||
printf(m, mrtstat.f, plurales(mrtstat.f))
|
||||
|
||||
p(mrts_mfc_lookups, "\t%lu multicast forwarding cache lookup%s\n");
|
||||
p2(mrts_mfc_misses, "\t%lu multicast forwarding cache miss%s\n");
|
||||
p(mrts_upcalls, "\t%lu upcall%s to mrouted\n");
|
||||
p(mrts_upq_ovflw, "\t%lu upcall queue overflow%s\n");
|
||||
p(mrts_upq_sockfull,
|
||||
"\t%lu upcall%s dropped due to full socket buffer\n");
|
||||
p(mrts_cache_cleanups, "\t%lu cache cleanup%s\n");
|
||||
p(mrts_no_route, "\t%lu datagram%s with no route for origin\n");
|
||||
p(mrts_bad_tunnel, "\t%lu datagram%s arrived with bad tunneling\n");
|
||||
p(mrts_cant_tunnel, "\t%lu datagram%s could not be tunneled\n");
|
||||
p(mrts_wrong_if, "\t%lu datagram%s arrived on wrong interface\n");
|
||||
p(mrts_drop_sel, "\t%lu datagram%s selectively dropped\n");
|
||||
p(mrts_q_overflow, "\t%lu datagram%s dropped due to queue overflow\n");
|
||||
p(mrts_pkt2large, "\t%lu datagram%s dropped for being too large\n");
|
||||
|
||||
#undef p2
|
||||
#undef p
|
||||
}
|
||||
|
@ -199,50 +199,35 @@ mrt6_stats(u_long mstaddr)
|
||||
|
||||
if (mstaddr == 0) {
|
||||
printf("No IPv6 multicast routing compiled into this"
|
||||
"system.\n");
|
||||
" system.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat));
|
||||
printf("IPv6 multicast forwarding:\n");
|
||||
printf(" %10llu multicast forwarding cache lookup%s\n",
|
||||
(unsigned long long)mrtstat.mrt6s_mfc_lookups,
|
||||
plural(mrtstat.mrt6s_mfc_lookups));
|
||||
printf(" %10llu multicast forwarding cache miss%s\n",
|
||||
(unsigned long long)mrtstat.mrt6s_mfc_misses,
|
||||
plurales(mrtstat.mrt6s_mfc_misses));
|
||||
printf(" %10llu upcall%s to mrouted\n",
|
||||
(unsigned long long)mrtstat.mrt6s_upcalls,
|
||||
plural(mrtstat.mrt6s_upcalls));
|
||||
printf(" %10llu upcall llueue overflow%s\n",
|
||||
(unsigned long long)mrtstat.mrt6s_upq_ovflw,
|
||||
plural(mrtstat.mrt6s_upq_ovflw));
|
||||
printf(" %10llu upcall%s dropped due to full socket buffer\n",
|
||||
(unsigned long long)mrtstat.mrt6s_upq_sockfull,
|
||||
plural(mrtstat.mrt6s_upq_sockfull));
|
||||
printf(" %10llu cache cleanup%s\n",
|
||||
(unsigned long long)mrtstat.mrt6s_cache_cleanups,
|
||||
plural(mrtstat.mrt6s_cache_cleanups));
|
||||
printf(" %10llu datagram%s with no route for origin\n",
|
||||
(unsigned long long)mrtstat.mrt6s_no_route,
|
||||
plural(mrtstat.mrt6s_no_route));
|
||||
printf(" %10llu datagram%s arrived with bad tunneling\n",
|
||||
(unsigned long long)mrtstat.mrt6s_bad_tunnel,
|
||||
plural(mrtstat.mrt6s_bad_tunnel));
|
||||
printf(" %10llu datagram%s could not be tunneled\n",
|
||||
(unsigned long long)mrtstat.mrt6s_cant_tunnel,
|
||||
plural(mrtstat.mrt6s_cant_tunnel));
|
||||
printf(" %10llu datagram%s arrived on wrong interface\n",
|
||||
(unsigned long long)mrtstat.mrt6s_wrong_if,
|
||||
plural(mrtstat.mrt6s_wrong_if));
|
||||
printf(" %10llu datagram%s selectively dropped\n",
|
||||
(unsigned long long)mrtstat.mrt6s_drop_sel,
|
||||
plural(mrtstat.mrt6s_drop_sel));
|
||||
printf(" %10llu datagram%s dropped due to llueue overflow\n",
|
||||
(unsigned long long)mrtstat.mrt6s_q_overflow,
|
||||
plural(mrtstat.mrt6s_q_overflow));
|
||||
printf(" %10llu datagram%s dropped for being too large\n",
|
||||
(unsigned long long)mrtstat.mrt6s_pkt2large,
|
||||
plural(mrtstat.mrt6s_pkt2large));
|
||||
|
||||
#define p(f, m) if (mrtstat.f || sflag <= 1) \
|
||||
printf(m, (unsigned long long)mrtstat.f, plural(mrtstat.f))
|
||||
#define p2(f, m) if (mrtstat.f || sflag <= 1) \
|
||||
printf(m, (unsigned long long)mrtstat.f, plurales(mrtstat.f))
|
||||
|
||||
p(mrt6s_mfc_lookups, "\t%llu multicast forwarding cache lookup%s\n");
|
||||
p2(mrt6s_mfc_misses, "\t%llu multicast forwarding cache miss%s\n");
|
||||
p(mrt6s_upcalls, "\t%llu upcall%s to mrouted\n");
|
||||
p(mrt6s_upq_ovflw, "\t%llu upcall llueue overflow%s\n");
|
||||
p(mrt6s_upq_sockfull,
|
||||
"\t%llu upcall%s dropped due to full socket buffer\n");
|
||||
p(mrt6s_cache_cleanups, "\t%llu cache cleanup%s\n");
|
||||
p(mrt6s_no_route, "\t%llu datagram%s with no route for origin\n");
|
||||
p(mrt6s_bad_tunnel, "\t%llu datagram%s arrived with bad tunneling\n");
|
||||
p(mrt6s_cant_tunnel, "\t%llu datagram%s could not be tunneled\n");
|
||||
p(mrt6s_wrong_if, "\t%llu datagram%s arrived on wrong interface\n");
|
||||
p(mrt6s_drop_sel, "\t%llu datagram%s selectively dropped\n");
|
||||
p(mrt6s_q_overflow,
|
||||
"\t%llu datagram%s dropped due to llueue overflow\n");
|
||||
p(mrt6s_pkt2large, "\t%llu datagram%s dropped for being too large\n");
|
||||
|
||||
#undef p2
|
||||
#undef p
|
||||
}
|
||||
#endif /*INET6*/
|
||||
|
Loading…
Reference in New Issue
Block a user