| 230 | } |
| 231 | |
| 232 | void |
| 233 | mrt6_stats() |
| 234 | { |
| 235 | struct mrt6stat mrtstat; |
| 236 | |
| 237 | if (fetch_stats("net.inet6.ip6.mrt6stat", 0, &mrtstat, |
| 238 | sizeof(mrtstat), kread_counters) != 0) |
| 239 | return; |
| 240 | |
| 241 | xo_open_container("multicast-statistics"); |
| 242 | xo_emit("{T:IPv6 multicast forwarding}:\n"); |
| 243 | |
| 244 | #define p(f, m) if (mrtstat.f || sflag <= 1) \ |
| 245 | xo_emit(m, (uintmax_t)mrtstat.f, plural(mrtstat.f)) |
| 246 | #define p2(f, m) if (mrtstat.f || sflag <= 1) \ |
| 247 | xo_emit(m, (uintmax_t)mrtstat.f, plurales(mrtstat.f)) |
| 248 | |
| 249 | p(mrt6s_mfc_lookups, "\t{:cache-lookups/%ju} " |
| 250 | "{N:/multicast forwarding cache lookup%s}\n"); |
| 251 | p2(mrt6s_mfc_misses, "\t{:cache-misses/%ju} " |
| 252 | "{N:/multicast forwarding cache miss%s}\n"); |
| 253 | p(mrt6s_upcalls, "\t{:upcalls/%ju} " |
| 254 | "{N:/upcall%s to multicast routing daemon}\n"); |
| 255 | p(mrt6s_upq_ovflw, "\t{:upcall-overflows/%ju} " |
| 256 | "{N:/upcall queue overflow%s}\n"); |
| 257 | p(mrt6s_upq_sockfull, "\t{:upcalls-dropped-full-buffer/%ju} " |
| 258 | "{N:/upcall%s dropped due to full socket buffer}\n"); |
| 259 | p(mrt6s_cache_cleanups, "\t{:cache-cleanups/%ju} " |
| 260 | "{N:/cache cleanup%s}\n"); |
| 261 | p(mrt6s_no_route, "\t{:dropped-no-origin/%ju} " |
| 262 | "{N:/datagram%s with no route for origin}\n"); |
| 263 | p(mrt6s_bad_tunnel, "\t{:dropped-bad-tunnel/%ju} " |
| 264 | "{N:/datagram%s arrived with bad tunneling}\n"); |
| 265 | p(mrt6s_cant_tunnel, "\t{:dropped-could-not-tunnel/%ju} " |
| 266 | "{N:/datagram%s could not be tunneled}\n"); |
| 267 | p(mrt6s_wrong_if, "\t{:dropped-wrong-incoming-interface/%ju} " |
| 268 | "{N:/datagram%s arrived on wrong interface}\n"); |
| 269 | p(mrt6s_drop_sel, "\t{:dropped-selectively/%ju} " |
| 270 | "{N:/datagram%s selectively dropped}\n"); |
| 271 | p(mrt6s_q_overflow, "\t{:dropped-queue-overflow/%ju} " |
| 272 | "{N:/datagram%s dropped due to queue overflow}\n"); |
| 273 | p(mrt6s_pkt2large, "\t{:dropped-too-large/%ju} " |
| 274 | "{N:/datagram%s dropped for being too large}\n"); |
| 275 | |
| 276 | #undef p2 |
| 277 | #undef p |
| 278 | xo_close_container("multicast-statistics"); |
| 279 | } |
| 280 | #endif /*INET6*/ |
no test coverage detected