summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-12-04 03:44:46 +0000
committersteve <steve@FreeBSD.org>1997-12-04 03:44:46 +0000
commit6136cd11ff8b2721f7ec0f1d33a221cc30ff5666 (patch)
tree7c09304826c74f0f3b79ae9a936a98dfd16ae4d5 /usr.bin/systat
parentd06debb088318cefea304bdcc695e7a060a6cdd2 (diff)
downloadFreeBSD-src-6136cd11ff8b2721f7ec0f1d33a221cc30ff5666.zip
FreeBSD-src-6136cd11ff8b2721f7ec0f1d33a221cc30ff5666.tar.gz
Use 'proto <tcp|udp|all>' to select the protocol to display
in netstat-mode to avoid a conflict with tcp-mode. Also while documenting this new feature in the manpage, fix a minor display nit. PR: 5159 Submitted by: Sergei Chechetkin <csl@whale.sunbay.crimea.ua>
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/netcmds.c24
-rw-r--r--usr.bin/systat/systat.19
2 files changed, 21 insertions, 12 deletions
diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c
index 94dc3ca..1427213 100644
--- a/usr.bin/systat/netcmds.c
+++ b/usr.bin/systat/netcmds.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)netcmds.c 8.1 (Berkeley) 6/6/93";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: netcmds.c,v 1.6 1997/02/22 19:57:16 peter Exp $";
#endif /* not lint */
/*
@@ -83,8 +83,14 @@ netcmd(cmd, args)
char *cmd, *args;
{
- if (prefix(cmd, "tcp") || prefix(cmd, "udp")) {
- selectproto(cmd);
+ if (prefix(cmd, "proto")) {
+ if (*args == '\0') {
+ move(CMDLINE, 0);
+ clrtoeol();
+ addstr("which proto?");
+ } else if (!selectproto(args)) {
+ error("%s: Unknown protocol.", args);
+ }
return (1);
}
if (prefix(cmd, "ignore") || prefix(cmd, "display")) {
@@ -166,15 +172,17 @@ static int
selectproto(proto)
char *proto;
{
- int new = protos;
if (proto == 0 || streq(proto, "all"))
- new = TCP|UDP;
+ protos = TCP | UDP;
else if (streq(proto, "tcp"))
- new = TCP;
+ protos = TCP;
else if (streq(proto, "udp"))
- new = UDP;
- return (new != protos, protos = new);
+ protos = UDP;
+ else
+ return (0);
+
+ return (protos);
}
static void
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index fd7717f..74210700 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -396,14 +396,15 @@ Toggle the displaying of server processes awaiting requests (this
is the equivalent of the
.Fl a
flag to
-.Ar netstat 1 ) .
+.Xr netstat 1 ) .
.It Cm numbers
Display network addresses numerically.
.It Cm names
Display network addresses symbolically.
-.It Ar protocol
-Display only network connections using the indicated protocol
-(currently either ``tcp'' or ``udp'').
+.It Cm proto Ar protocol
+Display only network connections using the indicated
+.Ar protocol .
+Supported protocols are ``tcp'', ``udp'', and ``all''.
.It Cm ignore Op Ar items
Do not display information about connections associated with
the specified hosts or ports. Hosts and ports may be specified
OpenPOWER on IntegriCloud