1*53ee8cc1Swenshuai.xi /* 2*53ee8cc1Swenshuai.xi * Copyright (c) 1983, 1993 3*53ee8cc1Swenshuai.xi * The Regents of the University of California. All rights reserved. 4*53ee8cc1Swenshuai.xi * 5*53ee8cc1Swenshuai.xi * Redistribution and use in source and binary forms, with or without 6*53ee8cc1Swenshuai.xi * modification, are permitted provided that the following conditions 7*53ee8cc1Swenshuai.xi * are met: 8*53ee8cc1Swenshuai.xi * 1. Redistributions of source code must retain the above copyright 9*53ee8cc1Swenshuai.xi * notice, this list of conditions and the following disclaimer. 10*53ee8cc1Swenshuai.xi * 2. Redistributions in binary form must reproduce the above copyright 11*53ee8cc1Swenshuai.xi * notice, this list of conditions and the following disclaimer in the 12*53ee8cc1Swenshuai.xi * documentation and/or other materials provided with the distribution. 13*53ee8cc1Swenshuai.xi * 4. Neither the name of the University nor the names of its contributors 14*53ee8cc1Swenshuai.xi * may be used to endorse or promote products derived from this software 15*53ee8cc1Swenshuai.xi * without specific prior written permission. 16*53ee8cc1Swenshuai.xi * 17*53ee8cc1Swenshuai.xi * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18*53ee8cc1Swenshuai.xi * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19*53ee8cc1Swenshuai.xi * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20*53ee8cc1Swenshuai.xi * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21*53ee8cc1Swenshuai.xi * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22*53ee8cc1Swenshuai.xi * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23*53ee8cc1Swenshuai.xi * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24*53ee8cc1Swenshuai.xi * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25*53ee8cc1Swenshuai.xi * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26*53ee8cc1Swenshuai.xi * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27*53ee8cc1Swenshuai.xi * SUCH DAMAGE. 28*53ee8cc1Swenshuai.xi * 29*53ee8cc1Swenshuai.xi * @(#)rwhod.h 8.1 (Berkeley) 6/2/93 30*53ee8cc1Swenshuai.xi */ 31*53ee8cc1Swenshuai.xi 32*53ee8cc1Swenshuai.xi #ifndef _PROTOCOLS_RWHOD_H 33*53ee8cc1Swenshuai.xi #define _PROTOCOLS_RWHOD_H 1 34*53ee8cc1Swenshuai.xi 35*53ee8cc1Swenshuai.xi #include <sys/types.h> 36*53ee8cc1Swenshuai.xi 37*53ee8cc1Swenshuai.xi /* 38*53ee8cc1Swenshuai.xi * rwho protocol packet format. 39*53ee8cc1Swenshuai.xi */ 40*53ee8cc1Swenshuai.xi struct outmp { 41*53ee8cc1Swenshuai.xi char out_line[8]; /* tty name */ 42*53ee8cc1Swenshuai.xi char out_name[8]; /* user id */ 43*53ee8cc1Swenshuai.xi int32_t out_time; /* time on */ 44*53ee8cc1Swenshuai.xi }; 45*53ee8cc1Swenshuai.xi 46*53ee8cc1Swenshuai.xi struct whod { 47*53ee8cc1Swenshuai.xi char wd_vers; /* protocol version # */ 48*53ee8cc1Swenshuai.xi char wd_type; /* packet type, see below */ 49*53ee8cc1Swenshuai.xi char wd_pad[2]; 50*53ee8cc1Swenshuai.xi int wd_sendtime; /* time stamp by sender */ 51*53ee8cc1Swenshuai.xi int wd_recvtime; /* time stamp applied by receiver */ 52*53ee8cc1Swenshuai.xi char wd_hostname[32]; /* hosts's name */ 53*53ee8cc1Swenshuai.xi int wd_loadav[3]; /* load average as in uptime */ 54*53ee8cc1Swenshuai.xi int wd_boottime; /* time system booted */ 55*53ee8cc1Swenshuai.xi struct whoent { 56*53ee8cc1Swenshuai.xi struct outmp we_utmp; /* active tty info */ 57*53ee8cc1Swenshuai.xi int we_idle; /* tty idle time */ 58*53ee8cc1Swenshuai.xi } wd_we[1024 / sizeof (struct whoent)]; 59*53ee8cc1Swenshuai.xi }; 60*53ee8cc1Swenshuai.xi 61*53ee8cc1Swenshuai.xi #define WHODVERSION 1 62*53ee8cc1Swenshuai.xi #define WHODTYPE_STATUS 1 /* host status */ 63*53ee8cc1Swenshuai.xi 64*53ee8cc1Swenshuai.xi /* We used to define _PATH_RWHODIR here but it's now in <paths.h>. */ 65*53ee8cc1Swenshuai.xi #include <paths.h> 66*53ee8cc1Swenshuai.xi 67*53ee8cc1Swenshuai.xi #endif /* protocols/rwhod.h */ 68