rwhod.h revision 2163
1202181Sthompsa/*
2210275Sthompsa * Copyright (c) 1983, 1993
3202181Sthompsa *	The Regents of the University of California.  All rights reserved.
4202181Sthompsa *
5202181Sthompsa * Redistribution and use in source and binary forms, with or without
6202181Sthompsa * modification, are permitted provided that the following conditions
7202181Sthompsa * are met:
8202181Sthompsa * 1. Redistributions of source code must retain the above copyright
9202181Sthompsa *    notice, this list of conditions and the following disclaimer.
10202181Sthompsa * 2. Redistributions in binary form must reproduce the above copyright
11202181Sthompsa *    notice, this list of conditions and the following disclaimer in the
12202181Sthompsa *    documentation and/or other materials provided with the distribution.
13202181Sthompsa * 3. All advertising materials mentioning features or use of this software
14202181Sthompsa *    must display the following acknowledgement:
15202181Sthompsa *	This product includes software developed by the University of
16202181Sthompsa *	California, Berkeley and its contributors.
17202181Sthompsa * 4. Neither the name of the University nor the names of its contributors
18202181Sthompsa *    may be used to endorse or promote products derived from this software
19202181Sthompsa *    without specific prior written permission.
20202181Sthompsa *
21202181Sthompsa * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22202181Sthompsa * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23202181Sthompsa * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24202181Sthompsa * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25202181Sthompsa * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26202181Sthompsa * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27202181Sthompsa * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28202181Sthompsa * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29202181Sthompsa * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30202181Sthompsa * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31202181Sthompsa * SUCH DAMAGE.
32202181Sthompsa *
33202181Sthompsa *	@(#)rwhod.h	8.1 (Berkeley) 6/2/93
34202181Sthompsa */
35202181Sthompsa
36202181Sthompsa#ifndef _PROTOCOLS_RWHOD_H_
37202181Sthompsa#define	_PROTOCOLS_RWHOD_H_
38202181Sthompsa
39202181Sthompsa/*
40202181Sthompsa * rwho protocol packet format.
41202181Sthompsa */
42202181Sthompsastruct	outmp {
43202181Sthompsa	char	out_line[8];		/* tty name */
44202181Sthompsa	char	out_name[8];		/* user id */
45210275Sthompsa	long	out_time;		/* time on */
46202181Sthompsa};
47202181Sthompsa
48202181Sthompsastruct	whod {
49202181Sthompsa	char	wd_vers;		/* protocol version # */
50202181Sthompsa	char	wd_type;		/* packet type, see below */
51202181Sthompsa	char	wd_pad[2];
52202181Sthompsa	int	wd_sendtime;		/* time stamp by sender */
53202181Sthompsa	int	wd_recvtime;		/* time stamp applied by receiver */
54202181Sthompsa	char	wd_hostname[32];	/* hosts's name */
55202181Sthompsa	int	wd_loadav[3];		/* load average as in uptime */
56202181Sthompsa	int	wd_boottime;		/* time system booted */
57202181Sthompsa	struct	whoent {
58202181Sthompsa		struct	outmp we_utmp;	/* active tty info */
59202181Sthompsa		int	we_idle;	/* tty idle time */
60202181Sthompsa	} wd_we[1024 / sizeof (struct whoent)];
61202181Sthompsa};
62202181Sthompsa
63202181Sthompsa#define	WHODVERSION	1
64202181Sthompsa#define	WHODTYPE_STATUS	1		/* host status */
65202181Sthompsa
66202181Sthompsa#define	_PATH_RWHODIR	"/var/rwho"
67202181Sthompsa
68212136Sthompsa#endif /* !_RWHOD_H_ */
69212136Sthompsa