diff options
author | ru <ru@FreeBSD.org> | 2004-04-12 15:00:48 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-04-12 15:00:48 +0000 |
commit | 4998d56908acfa474baafa8e5238f77cc0c6b0bf (patch) | |
tree | 8a9698f9194feab6d27f233c9d2ada905bc6021b /usr.bin | |
parent | 14233a5a33b48cba3a578f53a32ee727e8f622a4 (diff) | |
download | FreeBSD-src-4998d56908acfa474baafa8e5238f77cc0c6b0bf.zip FreeBSD-src-4998d56908acfa474baafa8e5238f77cc0c6b0bf.tar.gz |
Show link-level multicast packet counters with the -a option.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/netstat/if.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index f66943a..90a5a0a 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -163,6 +163,8 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *)) u_long ipackets; u_long obytes; u_long ibytes; + u_long omcasts; + u_long imcasts; u_long oerrors; u_long ierrors; u_long collisions; @@ -248,6 +250,8 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *)) ipackets = ifnet.if_ipackets; obytes = ifnet.if_obytes; ibytes = ifnet.if_ibytes; + omcasts = ifnet.if_omcasts; + imcasts = ifnet.if_imcasts; oerrors = ifnet.if_oerrors; ierrors = ifnet.if_ierrors; collisions = ifnet.if_collisions; @@ -465,9 +469,17 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *)) } break; } - if (fmt) - printf("%*s %s\n", + if (fmt) { + printf("%*s %-17.17s", Wflag ? 27 : 25, "", fmt); + if (msa.sa.sa_family == AF_LINK) { + printf(" %8lu", imcasts); + printf("%*s", + bflag ? 17 : 6, ""); + printf(" %8lu", omcasts); + } + putchar('\n'); + } } } } |