Date: Sun, 3 Jan 1999 19:59:07 -0600 (CST) From: fullermd@futuresouth.com To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/9301: Listen option to rwhod(8) Message-ID: <199901040159.TAA23631@mortis.futuresouth.com>
next in thread | raw e-mail | index | archive | help
>Number: 9301
>Category: bin
>Synopsis: Listen option to rwhod(8)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jan 3 18:00:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Matthew Fuller
>Release: FreeBSD 2.2.8-STABLE i386
>Organization:
>Environment:
Made against HEAD (r1.8) but should apply seamlessly to RELENG_2_2
(if someone wants to stick it back there for some reason)
>Description:
Add a -l option to rwhod for listen-only mode; doesn't broadcast
information, but allows you to monitor the other machines silently.
Man page also updated.
>How-To-Repeat:
>Fix:
Index: rwhod.8
===================================================================
RCS file: /usr/cvs/src/usr.sbin/rwhod/rwhod.8,v
retrieving revision 1.8
diff -u -r1.8 rwhod.8
--- rwhod.8 1998/12/17 11:05:57 1.8
+++ rwhod.8 1999/01/04 01:21:59
@@ -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,9 @@
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 -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.
@@ -69,6 +72,15 @@
option enables insecure mode, which causes
.Nm
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
Index: rwhod.c
===================================================================
RCS file: /usr/cvs/src/usr.sbin/rwhod/rwhod.c,v
retrieving revision 1.8
diff -u -r1.8 rwhod.c
--- rwhod.c 1998/12/17 11:05:57 1.8
+++ rwhod.c 1999/01/04 01:08:05
@@ -116,6 +116,7 @@
/* (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 };
@@ -197,6 +198,8 @@
}
else if (strcmp(*argv, "-i") == 0)
insecure_mode = 1;
+ else if (strcmp(*argv, "-l") == 0)
+ quiet_mode = 1;
else
usage();
argv++, argc--;
@@ -255,8 +258,10 @@
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);
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901040159.TAA23631>
