1.\" Copyright (c) 1983, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)rwhod.8 8.2 (Berkeley) 12/11/93 33.\" $FreeBSD: src/usr.sbin/rwhod/rwhod.8,v 1.13.2.4 2003/03/11 22:31:33 trhodes Exp $ 34.\" $DragonFly: src/usr.sbin/rwhod/rwhod.8,v 1.2 2003/06/17 04:30:03 dillon Exp $ 35.\" 36.Dd December 11, 1993 37.Dt RWHOD 8 38.Os 39.Sh NAME 40.Nm rwhod 41.Nd system status server 42.Sh SYNOPSIS 43.Nm 44.Op Fl i 45.Op Fl p 46.Op Fl l 47.Op Fl m Op Ar ttl 48.Sh DESCRIPTION 49The 50.Nm 51utility is the server which maintains the database used by the 52.Xr rwho 1 53and 54.Xr ruptime 1 55programs. Its operation is predicated on the ability to 56.Em broadcast 57or 58.Em multicast 59messages on a network. 60.Pp 61The 62.Nm 63utility operates as both a producer and consumer of status information, 64unless the 65.Fl l 66(listen mode) option is specified, in which case 67it acts as a consumer only. 68As a producer of information it periodically 69queries the state of the system and constructs 70status messages which are broadcasted or multicasted on a network. 71As a consumer of information, it listens for other 72.Nm 73servers' status messages, validating them, then recording 74them in a collection of files located in the directory 75.Pa /var/rwho . 76.Pp 77The 78.Fl i 79option enables insecure mode, which causes 80.Nm 81to ignore the source port on incoming packets. 82.Pp 83The 84.Fl p 85option tells 86.Nm 87to ignore all 88.Dv POINTOPOINT 89interfaces. This is useful if you do not wish to keep dial on demand 90interfaces permanently active. 91.Pp 92The 93.Fl l 94option enables listen mode, which causes 95.Nm 96to not broadcast any information. 97This allows you to monitor other machines' 98.Nm 99information, without broadcasting your own. 100.Pp 101The 102.Fl m 103option causes 104.Nm 105to use IP multicast (instead of 106broadcast) on all interfaces that have 107the IFF_MULTICAST flag set in their "ifnet" structs 108(excluding the loopback interface). The multicast 109reports are sent with a time-to-live of 1, to prevent 110forwarding beyond the directly-connected subnet(s). 111.Pp 112If the optional 113.Ar ttl 114argument is supplied with the 115.Fl m 116flag, 117.Nm 118will send IP multicast datagrams with a 119time-to-live of 120.Ar ttl , 121via a SINGLE interface rather 122than all interfaces. 123.Ar ttl 124must be between 0 and 12532 (or MAX_MULTICAST_SCOPE). Note that 126.Fl m Ar 1 127is different from 128.Fl m , 129in that 130.Fl m Ar 1 131specifies transmission on one interface only. 132.Pp 133When 134.Fl m 135is used without a 136.Ar ttl 137argument, the program accepts multicast 138.Nm 139reports from all multicast-capable interfaces. If a 140.Ar ttl 141argument is given, it accepts multicast reports from only one interface, the 142one on which reports are sent (which may be controlled via the host's routing 143table). Regardless of the 144.Fl m 145option, the program accepts broadcast or 146unicast reports from all interfaces. Thus, this program will hear the 147reports of old, non-multicasting 148.Nm Ns s , 149but, if multicasting is used, 150those old 151.Nm Ns s 152won't hear the reports generated by this program. 153.Pp 154The server transmits and receives messages at the port indicated 155in the ``who'' service specification; see 156.Xr services 5 . 157The messages sent and received, are of the form: 158.Bd -literal -offset indent 159struct outmp { 160 char out_line[8]; /* tty name */ 161 char out_name[8]; /* user id */ 162 long out_time; /* time on */ 163}; 164 165struct whod { 166 char wd_vers; 167 char wd_type; 168 char wd_fill[2]; 169 int wd_sendtime; 170 int wd_recvtime; 171 char wd_hostname[32]; 172 int wd_loadav[3]; 173 int wd_boottime; 174 struct whoent { 175 struct outmp we_utmp; 176 int we_idle; 177 } wd_we[1024 / sizeof (struct whoent)]; 178}; 179.Ed 180.Pp 181All fields are converted to network byte order prior to 182transmission. The load averages are as calculated by the 183.Xr w 1 184program, and represent load averages over the 5, 10, and 15 minute 185intervals prior to a server's transmission; they are multiplied by 100 186for representation in an integer. The host name 187included is that returned by the 188.Xr gethostname 3 189system call, with any trailing domain name omitted. 190The array at the end of the message contains information about 191the users logged in to the sending machine. This information 192includes the contents of the 193.Xr utmp 5 194entry for each non-idle terminal line and a value indicating the 195time in seconds since a character was last received on the terminal line. 196.Pp 197Messages received by the 198.Nm rwho 199server are discarded unless they originated at an 200.Nm rwho 201server's port or the 202.Fl i 203option was specified. In addition, if the host's name, as specified 204in the message, contains any unprintable 205.Tn ASCII 206characters, the 207message is discarded. Valid messages received by 208.Nm 209are placed in files named 210.Pa whod.hostname 211in the directory 212.Pa /var/rwho . 213These files contain only the most recent message, in the 214format described above. 215.Pp 216Status messages are generated approximately once every 2173 minutes. 218.Nm Rwhod 219performs an 220.Xr nlist 3 221on 222.Pa /kernel 223every 30 minutes to guard against 224the possibility that this file is not the system 225image currently operating. 226.Sh SEE ALSO 227.Xr ruptime 1 , 228.Xr rwho 1 229.Sh BUGS 230Status information should be sent only upon request rather than continuously. 231People often interpret the server dying 232or network communication failures 233as a machine going down. 234.Sh HISTORY 235The 236.Nm 237utility appeared in 238.Bx 4.2 . 239