Line up `netstat -rl' display.

This commit is contained in:
Ruslan Ermilov 2001-06-15 18:15:11 +00:00
parent 5d291a2f8e
commit eba04a8da9

View File

@ -250,16 +250,17 @@ pr_rthdr(int af)
printf("%-8.8s ","Address");
if (af == AF_INET || lflag)
if (lflag)
printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %5.5s %*.*s %6s\n",
printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %6.6s %*.*s %6s\n",
WID_DST(af), WID_DST(af), "Destination",
WID_GW(af), WID_GW(af), "Gateway",
"Flags", "Refs", "Use", "Mtu",
WID_IF(af), WID_IF(af), "Netif", "Expire");
else
printf("%-*.*s %-*.*s %-6.6s %6.6s%8.8s %8.8s %6s\n",
printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %*.*s %6s\n",
WID_DST(af), WID_DST(af), "Destination",
WID_GW(af), WID_GW(af), "Gateway",
"Flags", "Refs", "Use", "Netif", "Expire");
"Flags", "Refs", "Use",
WID_IF(af), WID_IF(af), "Netif", "Expire");
else
printf("%-*.*s %-*.*s %-6.6s %8.8s %6s\n",
WID_DST(af), WID_DST(af), "Destination",
@ -607,7 +608,7 @@ p_rtentry(struct rtentry *rt)
WID_GW(addr.u_sa.sa_family));
p_flags(rt->rt_flags, "%-6.6s ");
if (addr.u_sa.sa_family == AF_INET || lflag) {
printf("%6ld %8ld", rt->rt_refcnt, rt->rt_use);
printf("%6ld %8ld ", rt->rt_refcnt, rt->rt_use);
if (lflag) {
if (rt->rt_rmx.rmx_mtu != 0)
printf("%6lu ", rt->rt_rmx.rmx_mtu);
@ -623,7 +624,8 @@ p_rtentry(struct rtentry *rt)
snprintf(prettyname, sizeof prettyname,
"%s%d", name, ifnet.if_unit);
}
printf("%8.8s", prettyname);
printf("%*.*s", WID_IF(addr.u_sa.sa_family),
WID_IF(addr.u_sa.sa_family), prettyname);
if (rt->rt_rmx.rmx_expire) {
time_t expire_time;