summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-09-07 12:00:50 +0000
committerru <ru@FreeBSD.org>2001-09-07 12:00:50 +0000
commit63326af6cd5d7d77a690b61ec9797fbd94a36ad0 (patch)
treeeffc196829f7d31cec8a88b1e38317340096ff7b /usr.bin/netstat
parent733af41f5a8c821afd7b0bfc9fc0e9db8b770646 (diff)
downloadFreeBSD-src-63326af6cd5d7d77a690b61ec9797fbd94a36ad0.zip
FreeBSD-src-63326af6cd5d7d77a690b61ec9797fbd94a36ad0.tar.gz
Deprecate the -l option in favour of more natural -W.
The compatibility glue is still provided. (This change is not yet reflected in the manpage, nor in usage(). This will be fixed at a later time today, with the general manpage cleanup commit.)
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/inet6.c4
-rw-r--r--usr.bin/netstat/main.c5
-rw-r--r--usr.bin/netstat/mroute6.c4
-rw-r--r--usr.bin/netstat/netstat.h1
-rw-r--r--usr.bin/netstat/route.c12
5 files changed, 11 insertions, 15 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index 44a9b51..af2382a 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -1049,7 +1049,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric)
char line[80], *cp;
int width;
- sprintf(line, "%.*s.", lflag ? 39 :
+ sprintf(line, "%.*s.", Wflag ? 39 :
(Aflag && !numeric) ? 12 : 16, inet6name(in6));
cp = index(line, '\0');
if (!numeric && port)
@@ -1058,7 +1058,7 @@ inet6print(struct in6_addr *in6, int port, char *proto, int numeric)
sprintf(cp, "%.8s", sp ? sp->s_name : "*");
else
sprintf(cp, "%d", ntohs((u_short)port));
- width = lflag ? 45 : Aflag ? 18 : 22;
+ width = Wflag ? 45 : Aflag ? 18 : 22;
printf("%-*.*s ", width, width, line);
}
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 30dfaa8..d2242d4 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -322,7 +322,6 @@ int bflag; /* show i/f total bytes in/out */
int dflag; /* show i/f dropped packets */
int gflag; /* show group (multicast) routing or stats */
int iflag; /* show interfaces */
-int lflag; /* show routing table with use and ref */
int Lflag; /* show size of listen queues */
int mflag; /* show memory stats */
int numeric_addr; /* show addresses numerically */
@@ -413,9 +412,6 @@ main(argc, argv)
case 'i':
iflag = 1;
break;
- case 'l':
- lflag = 1;
- break;
case 'L':
Lflag = 1;
break;
@@ -455,6 +451,7 @@ main(argc, argv)
af = AF_UNIX;
break;
case 'W':
+ case 'l':
Wflag = 1;
break;
case 'w':
diff --git a/usr.bin/netstat/mroute6.c b/usr.bin/netstat/mroute6.c
index 16368b8..712e36a 100644
--- a/usr.bin/netstat/mroute6.c
+++ b/usr.bin/netstat/mroute6.c
@@ -88,8 +88,8 @@
#include "netstat.h"
-#define WID_ORG (lflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */
-#define WID_GRP (lflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
+#define WID_ORG (Wflag ? 39 : (numeric_addr ? 29 : 18)) /* width of origin column */
+#define WID_GRP (Wflag ? 18 : (numeric_addr ? 16 : 18)) /* width of group column */
void
mroute6pr(u_long mfcaddr, u_long mifaddr)
diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h
index 3efa21e..eca68c0 100644
--- a/usr.bin/netstat/netstat.h
+++ b/usr.bin/netstat/netstat.h
@@ -42,7 +42,6 @@ extern int bflag; /* show i/f total bytes in/out */
extern int dflag; /* show i/f dropped packets */
extern int gflag; /* show group (multicast) routing or stats */
extern int iflag; /* show interfaces */
-extern int lflag; /* show routing table with use and ref */
extern int Lflag; /* show size of listen queues */
extern int mflag; /* show memory stats */
extern int numeric_addr; /* show addresses numerically */
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 4390a2e..e75084d 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -228,9 +228,9 @@ pr_family(int af)
#define WID_IF(af) 6 /* width of netif column */
#else
#define WID_DST(af) \
- ((af) == AF_INET6 ? (lflag ? 39 : (numeric_addr ? 33: 18)) : 18)
+ ((af) == AF_INET6 ? (Wflag ? 39 : (numeric_addr ? 33: 18)) : 18)
#define WID_GW(af) \
- ((af) == AF_INET6 ? (lflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
+ ((af) == AF_INET6 ? (Wflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
#define WID_IF(af) ((af) == AF_INET6 ? 8 : 6)
#endif /*INET6*/
@@ -243,8 +243,8 @@ pr_rthdr(int af)
if (Aflag)
printf("%-8.8s ","Address");
- if (af == AF_INET || lflag)
- if (lflag)
+ if (af == AF_INET || Wflag)
+ if (Wflag)
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",
@@ -602,9 +602,9 @@ p_rtentry(struct rtentry *rt)
p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST,
WID_GW(addr.u_sa.sa_family));
p_flags(rt->rt_flags, "%-6.6s ");
- if (addr.u_sa.sa_family == AF_INET || lflag) {
+ if (addr.u_sa.sa_family == AF_INET || Wflag) {
printf("%6ld %8ld ", rt->rt_refcnt, rt->rt_use);
- if (lflag) {
+ if (Wflag) {
if (rt->rt_rmx.rmx_mtu != 0)
printf("%6lu ", rt->rt_rmx.rmx_mtu);
else
OpenPOWER on IntegriCloud