diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-04-26 19:22:31 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-04-26 19:22:31 +0000 |
commit | 6fd27862b97e1c98093ff633b0dfd1d9ceb7fef5 (patch) | |
tree | d1e745867f1a2fe7ba9f9852310bbe8570b2d209 /usr.bin | |
parent | e8d35c6c2d81b53754ad51a8da6b987279d4afa3 (diff) |
add -n flag (do not reverse-lookup). pb and deraadt ok
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/extern.h | 3 | ||||
-rw-r--r-- | usr.bin/systat/main.c | 12 | ||||
-rw-r--r-- | usr.bin/systat/netcmds.c | 8 | ||||
-rw-r--r-- | usr.bin/systat/netstat.c | 10 | ||||
-rw-r--r-- | usr.bin/systat/systat.1 | 5 |
5 files changed, 19 insertions, 19 deletions
diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 8eabff91f78..911807695ce 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.12 2004/04/14 19:53:04 deraadt Exp $ */ +/* $OpenBSD: extern.h,v 1.13 2004/04/26 19:22:30 itojun Exp $ */ /* $NetBSD: extern.h,v 1.3 1996/05/10 23:16:34 thorpej Exp $ */ /*- @@ -55,6 +55,7 @@ extern int nhosts; extern int nports; extern int protos; extern int verbose; +extern int nflag; struct inpcb; diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 527d16f769c..78e5acf5ee2 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.29 2004/04/14 19:53:04 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.30 2004/04/26 19:22:30 itojun Exp $ */ /* $NetBSD: main.c,v 1.8 1996/05/10 23:16:36 thorpej Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: main.c,v 1.29 2004/04/14 19:53:04 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.30 2004/04/26 19:22:30 itojun Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -70,6 +70,7 @@ double avenrun[3]; int col; int naptime = 5; int verbose = 1; /* to report kvm read errs */ +int nflag = 0; int hz, stathz; char c; char *namp; @@ -96,8 +97,11 @@ main(int argc, char *argv[]) setegid(getgid()); setgid(getgid()); - while ((ch = getopt(argc, argv, "w:")) != -1) + while ((ch = getopt(argc, argv, "nw:")) != -1) switch (ch) { + case 'n': + nflag = 1; + break; case 'w': if ((naptime = atoi(optarg)) <= 0) errx(1, "interval <= 0."); @@ -195,7 +199,7 @@ gethz(void) static void usage(void) { - fprintf(stderr, "usage: systat [-w wait] [display] [refresh-interval]\n"); + fprintf(stderr, "usage: systat [-n] [-w wait] [display] [refresh-interval]\n"); exit(1); } diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c index 032c4e4d689..41786a583a5 100644 --- a/usr.bin/systat/netcmds.c +++ b/usr.bin/systat/netcmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netcmds.c,v 1.12 2003/06/03 02:56:17 millert Exp $ */ +/* $OpenBSD: netcmds.c,v 1.13 2004/04/26 19:22:30 itojun Exp $ */ /* $NetBSD: netcmds.c,v 1.4 1995/05/21 17:14:38 mycroft Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: netcmds.c,v 1.12 2003/06/03 02:56:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: netcmds.c,v 1.13 2004/04/26 19:22:30 itojun Exp $"; #endif /* not lint */ /* @@ -341,11 +341,7 @@ showhosts(void) struct sockaddr *sa; int flags; -#if 0 flags = nflag ? NI_NUMERICHOST : 0; -#else - flags = 0; -#endif for (p = hosts; p < hosts+nhosts; p++) { sa = (struct sockaddr *)&p->addr; if (getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, diff --git a/usr.bin/systat/netstat.c b/usr.bin/systat/netstat.c index 699edb642db..5ee0684460f 100644 --- a/usr.bin/systat/netstat.c +++ b/usr.bin/systat/netstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netstat.c,v 1.24 2003/06/03 02:56:17 millert Exp $ */ +/* $OpenBSD: netstat.c,v 1.25 2004/04/26 19:22:30 itojun Exp $ */ /* $NetBSD: netstat.c,v 1.3 1995/06/18 23:53:07 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)netstat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: netstat.c,v 1.24 2003/06/03 02:56:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: netstat.c,v 1.25 2004/04/26 19:22:30 itojun Exp $"; #endif /* not lint */ /* @@ -123,7 +123,6 @@ static struct { } netcb; static int aflag = 0; -static int nflag = 0; static int lastrow = 1; void @@ -551,10 +550,7 @@ inet6name(struct in6_addr *in6) struct sockaddr_in6 sin6; int flags; - if (nflag) - flags = NI_NUMERICHOST; - else - flags = 0; + flags = nflag ? NI_NUMERICHOST : 0; if (IN6_IS_ADDR_UNSPECIFIED(in6)) return "*"; memset(&sin6, 0, sizeof(sin6)); diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1 index 617a48f5d25..ebe97d73a87 100644 --- a/usr.bin/systat/systat.1 +++ b/usr.bin/systat/systat.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: systat.1,v 1.33 2004/02/20 22:07:08 jmc Exp $ +.\" $OpenBSD: systat.1,v 1.34 2004/04/26 19:22:30 itojun Exp $ .\" $NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $ .\" .\" Copyright (c) 1985, 1990, 1993 @@ -38,6 +38,7 @@ .Nd display system statistics on a CRT .Sh SYNOPSIS .Nm systat +.Op Fl n .Op Fl w Ar wait .Op Ar display .Op Ar refresh-interval @@ -82,6 +83,8 @@ This allows each display to have certain display-specific commands. .Pp The options are as follows: .Bl -tag -width "refresh-interval" +.It Fl n +Do not try to reverse-map IP address. .It Fl w Ar wait Specifies the screen refresh time interval in seconds. This option is overridden by |