summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rwhod
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1999-01-11 05:27:37 +0000
committersteve <steve@FreeBSD.org>1999-01-11 05:27:37 +0000
commit710a04e8b4ed8d86aa05f8184e8993e3b202034f (patch)
tree1bea41190b199f35aebb65bccdbe81b946fe9df1 /usr.sbin/rwhod
parent1bd58206f3f35c7827173a25cf797e7bf1da4137 (diff)
downloadFreeBSD-src-710a04e8b4ed8d86aa05f8184e8993e3b202034f.zip
FreeBSD-src-710a04e8b4ed8d86aa05f8184e8993e3b202034f.tar.gz
Implement the -l commandline option which turns off broadcast of
information, but still allows you to monitor other machines. PR: 9301 Submitted by: Matthew Fuller <fullermd@futuresouth.com>
Diffstat (limited to 'usr.sbin/rwhod')
-rw-r--r--usr.sbin/rwhod/rwhod.816
-rw-r--r--usr.sbin/rwhod/rwhod.c13
2 files changed, 24 insertions, 5 deletions
diff --git a/usr.sbin/rwhod/rwhod.8 b/usr.sbin/rwhod/rwhod.8
index f1aa636..8050ca9 100644
--- a/usr.sbin/rwhod/rwhod.8
+++ b/usr.sbin/rwhod/rwhod.8
@@ -40,6 +40,7 @@
.Sh SYNOPSIS
.Nm rwhod
.Op Fl i
+.Op Fl l
.Op Fl m Op Ar ttl
.Sh DESCRIPTION
.Nm Rwhod
@@ -54,7 +55,11 @@ or
messages on a network.
.Pp
.Nm Rwhod
-operates as both a producer and consumer of status information.
+operates as both a producer and consumer of status information,
+unless the
+.Fl l
+(listen mode) option is specified, in which case
+it acts as a consumer only.
As a producer of information it periodically
queries the state of the system and constructs
status messages which are broadcasted or multicasted on a network.
@@ -71,6 +76,15 @@ option enables insecure mode, which causes
to ignore the source port on incoming packets.
.Pp
The
+.Fl l
+option enables listen mode, which causes
+.Nm
+to not broadcast any information.
+This allows you to monitor other machines'
+.Nm
+information, without broadcasting your own.
+.Pp
+The
.Fl m
option causes
.Nm
diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c
index dcd6def..6b6899f 100644
--- a/usr.sbin/rwhod/rwhod.c
+++ b/usr.sbin/rwhod/rwhod.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
#endif
static const char rcsid[] =
- "$Id: rwhod.c,v 1.7 1997/10/13 11:27:55 charnier Exp $";
+ "$Id: rwhod.c,v 1.8 1998/12/17 11:05:57 des Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -116,6 +116,7 @@ static const char rcsid[] =
/* (belongs in protocols/rwhod.h) */
int insecure_mode;
+int quiet_mode;
int multicast_mode = NO_MULTICAST;
int multicast_scope;
struct sockaddr_in multicast_addr = { sizeof multicast_addr, AF_INET };
@@ -196,7 +197,9 @@ main(argc, argv)
else multicast_mode = PER_INTERFACE_MULTICAST;
}
else if (strcmp(*argv, "-i") == 0)
- insecure_mode = 1;
+ insecure_mode = 1;
+ else if (strcmp(*argv, "-l") == 0)
+ quiet_mode = 1;
else
usage();
argv++, argc--;
@@ -255,8 +258,10 @@ main(argc, argv)
setuid(unpriv_uid);
if (!configure(s))
exit(1);
- signal(SIGALRM, onalrm);
- onalrm(0);
+ if (!quiet_mode) {
+ signal(SIGALRM, onalrm);
+ onalrm(0);
+ }
for (;;) {
struct whod wd;
int cc, whod, len = sizeof(from);
OpenPOWER on IntegriCloud