From ea6e16bc20e4706c99c89ec7b7f3ab3be1791a4c Mon Sep 17 00:00:00 2001 From: assar Date: Fri, 15 Jun 2001 00:25:44 +0000 Subject: add the option -S for printing port numbers symbolically but addresses numerically. clean up the CFLAGS in Makefile. --- usr.bin/netstat/inet.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'usr.bin/netstat/inet.c') diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c index aee1aed..ebbab35 100644 --- a/usr.bin/netstat/inet.c +++ b/usr.bin/netstat/inet.c @@ -259,7 +259,7 @@ protopr(proto, name, af) so->so_rcv.sb_cc, so->so_snd.sb_cc); } - if (nflag) { + if (numeric_port) { if (inp->inp_vflag & INP_IPV4) { inetprint(&inp->inp_laddr, (int)inp->inp_lport, name, 1); @@ -686,11 +686,11 @@ igmp_stats(off, name) * Pretty print an Internet address (net address + port). */ void -inetprint(in, port, proto,numeric) +inetprint(in, port, proto, numeric_port) register struct in_addr *in; int port; char *proto; - int numeric; + int numeric_port; { struct servent *sp = 0; char line[80], *cp; @@ -699,9 +699,9 @@ inetprint(in, port, proto,numeric) if (Wflag) sprintf(line, "%s.", inetname(in)); else - sprintf(line, "%.*s.", (Aflag && !numeric) ? 12 : 16, inetname(in)); + sprintf(line, "%.*s.", (Aflag && !numeric_port) ? 12 : 16, inetname(in)); cp = index(line, '\0'); - if (!numeric && port) + if (!numeric_port && port) sp = getservbyport((int)port, proto); if (sp || port == 0) sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); @@ -716,7 +716,7 @@ inetprint(in, port, proto,numeric) /* * Construct an Internet address representation. - * If the nflag has been supplied, give + * If numeric_addr has been supplied, give * numeric value, otherwise try for symbolic name. */ char * @@ -729,7 +729,7 @@ inetname(inp) struct netent *np; cp = 0; - if (!nflag && inp->s_addr != INADDR_ANY) { + if (!numeric_addr && inp->s_addr != INADDR_ANY) { int net = inet_netof(*inp); int lna = inet_lnaof(*inp); -- cgit v1.1