diff options
author | mdodd <mdodd@FreeBSD.org> | 2001-10-09 05:58:26 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2001-10-09 05:58:26 +0000 |
commit | 40ada64ef51dce61469fb22f3381bf251cf0971d (patch) | |
tree | a2dc49fd9f27da404a276a150dace8e34688c65e /usr.bin/netstat/if.c | |
parent | 8a2238495388989bf4e7245e1ff0188e2dd4ac5b (diff) | |
download | FreeBSD-src-40ada64ef51dce61469fb22f3381bf251cf0971d.zip FreeBSD-src-40ada64ef51dce61469fb22f3381bf251cf0971d.tar.gz |
Minor output formatting for 'netstat -i':
- Right align Mtu
- Print AF_INET family with correct field width.
Diffstat (limited to 'usr.bin/netstat/if.c')
-rw-r--r-- | usr.bin/netstat/if.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 4fb63b8..1b89cce 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -203,7 +203,7 @@ intpr(int interval, u_long ifnetaddr, void (*pfunc)(char *)) return; if (!pfunc) { - printf("%-5.5s %-5.5s %-13.13s %-15.15s %8.8s %5.5s", + printf("%-5.5s %5.5s %-11.11s %-17.17s %8.8s %5.5s", "Name", "Mtu", "Network", "Address", "Ipkts", "Ierrs"); if (bflag) printf(" %10.10s","Ibytes"); @@ -268,9 +268,9 @@ intpr(int interval, u_long ifnetaddr, void (*pfunc)(char *)) drops = ifnet.if_snd.ifq_drops; if (ifaddraddr == 0) { - printf("%-5.5s %-5lu ", name, ifnet.if_mtu); - printf("%-13.13s ", "none"); - printf("%-15.15s ", "none"); + printf("%-5.5s %5lu ", name, ifnet.if_mtu); + printf("%-11.11s ", "none"); + printf("%-17.17s ", "none"); } else { if (kread(ifaddraddr, (char *)&ifaddr, sizeof ifaddr)) { ifaddraddr = 0; @@ -285,7 +285,7 @@ intpr(int interval, u_long ifnetaddr, void (*pfunc)(char *)) (u_long)TAILQ_NEXT(&ifaddr.ifa, ifa_link); continue; } - printf("%-5.5s %-5lu ", name, ifnet.if_mtu); + printf("%-5.5s %5lu ", name, ifnet.if_mtu); switch (sa->sa_family) { case AF_UNSPEC: printf("%-13.13s ", "none"); @@ -302,11 +302,11 @@ intpr(int interval, u_long ifnetaddr, void (*pfunc)(char *)) printf("%-13.13s ", netname(in.s_addr, ifaddr.in.ia_subnetmask)); #else - printf("%-13.13s ", + printf("%-11.11s ", netname(htonl(ifaddr.in.ia_subnet), ifaddr.in.ia_subnetmask)); #endif - printf("%-15.15s ", + printf("%-17.17s ", routename(sin->sin_addr.s_addr)); network_layer = 1; |