aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/netstat/route.c
diff options
context:
space:
mode:
authorAssar Westerlund <assar@FreeBSD.org>2001-06-15 00:25:44 +0000
committerAssar Westerlund <assar@FreeBSD.org>2001-06-15 00:25:44 +0000
commit65ea0024ba6f8aeac9b9f28532a63bc7ac6174ae (patch)
tree4c8e50bedba0b4b6d215e040dc90818e756c7c91 /usr.bin/netstat/route.c
parent953d6e00e90da2babadba0111b28defe768d26d3 (diff)
downloadsrc-65ea0024ba6f8aeac9b9f28532a63bc7ac6174ae.tar.gz
src-65ea0024ba6f8aeac9b9f28532a63bc7ac6174ae.zip
add the option -S for printing port numbers symbolically but addresses
numerically. clean up the CFLAGS in Makefile.
Notes
Notes: svn path=/head/; revision=78238
Diffstat (limited to 'usr.bin/netstat/route.c')
-rw-r--r--usr.bin/netstat/route.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 11e49b6e54c6..046dad1b5efa 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -235,9 +235,9 @@ pr_family(af)
#define WID_IF(af) 6 /* width of netif column */
#else
#define WID_DST(af) \
- ((af) == AF_INET6 ? (lflag ? 39 : (nflag ? 33: 18)) : 18)
+ ((af) == AF_INET6 ? (lflag ? 39 : (numeric_addr ? 33: 18)) : 18)
#define WID_GW(af) \
- ((af) == AF_INET6 ? (lflag ? 31 : (nflag ? 29 : 18)) : 18)
+ ((af) == AF_INET6 ? (lflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
#define WID_IF(af) ((af) == AF_INET6 ? 8 : 6)
#endif /*INET6*/
@@ -564,7 +564,7 @@ p_sockaddr(sa, mask, flags, width)
if (width < 0 )
printf("%s ", cp);
else {
- if (nflag)
+ if (numeric_addr)
printf("%-*s ", width, cp);
else
printf("%-*.*s ", width, width, cp);
@@ -662,7 +662,7 @@ routename(in)
struct hostent *hp;
cp = 0;
- if (!nflag) {
+ if (!numeric_addr) {
hp = gethostbyaddr((char *)&in, sizeof (struct in_addr),
AF_INET);
if (hp) {
@@ -744,7 +744,7 @@ netname(in, mask)
i = ntohl(in);
dmask = forgemask(i);
omask = mask;
- if (!nflag && i) {
+ if (!numeric_addr && i) {
net = i & dmask;
if (!(np = getnetbyaddr(i, AF_INET)) && net != i)
np = getnetbyaddr(net, AF_INET);
@@ -841,12 +841,12 @@ netname6(sa6, mask)
if (masklen == 0 && IN6_IS_ADDR_UNSPECIFIED(&sa6->sin6_addr))
return("default");
- if (nflag)
+ if (numeric_addr)
flag |= NI_NUMERICHOST;
getnameinfo((struct sockaddr *)sa6, sa6->sin6_len, line, sizeof(line),
NULL, 0, flag);
- if (nflag)
+ if (numeric_addr)
sprintf(&line[strlen(line)], "/%d", masklen);
return line;
@@ -864,7 +864,7 @@ routename6(sa6)
sa6_local.sin6_addr = sa6->sin6_addr;
sa6_local.sin6_scope_id = sa6->sin6_scope_id;
- if (nflag)
+ if (numeric_addr)
flag |= NI_NUMERICHOST;
getnameinfo((struct sockaddr *)&sa6_local, sa6_local.sin6_len,