|
|
1.1 ! root 1: /* rwho.h */ ! 2: ! 3: /* Data structures and constants for RWHO packet processing */ ! 4: ! 5: #define RMACLEN 32 /* length of machine name */ ! 6: #define RWNLOAD 3 /* number of "load averages" */ ! 7: #define RWNLEN 8 /* name length in rwho packet */ ! 8: #define RWCSIZ 30 /* size of rwho cache */ ! 9: #define RWMAXP 800 /* max packet length accepted */ ! 10: #define RWMINP 60 /* size of rwho pac, no users */ ! 11: #define RWDELAY 180 /* delay for output in seconds */ ! 12: #define RWCDOWN 360 /* consider down if this old */ ! 13: #define RWMAXDT (60L*60L*24L*7L) /* maximum down time before */ ! 14: /* machine removed from cache */ ! 15: #define RWIN rwhoind /* Rwho input process code */ ! 16: #define RWISTK 1024 /* Rwho input process stack */ ! 17: #define RWIPRIO 20 /* Rwho input process priority */ ! 18: #define RWINAM "rwhoin" /* Rwho input process name */ ! 19: #define RWIARGS 0 /* Rwho input process arguments */ ! 20: #define RWOUT rwhod /* Rwho output process code */ ! 21: #define RWOSTK 1024 /* Rwho output process stack */ ! 22: #define RWOPRIO 20 /* Rwho output process priority */ ! 23: #define RWONAM "rwhod" /* Rwho output process name */ ! 24: #define RWOARGS 0 /* Rwho output process arguments*/ ! 25: ! 26: extern int RWIN(), RWOUT(); ! 27: ! 28: struct rwent { /* rwho cache entry */ ! 29: char rwmach[RMACLEN]; /* Name of machine that is up */ ! 30: long rwboot; /* when machine was booted */ ! 31: long rwlast; /* Local time last packet recvd */ ! 32: long rwslast; /* Sender's time in last packet */ ! 33: long rwload[3]; /* Load averages as in uptime */ ! 34: int rwusers; /* Number of users logged in */ ! 35: }; ! 36: ! 37: struct rwinfo { /* all rwho information */ ! 38: struct rwent rwcache[RWCSIZ];/* cache of received info */ ! 39: int rwnent; /* number of valid cache entries*/ ! 40: Bool rwsend; /* send out rwho packets? */ ! 41: long rwbtime; /* time I was booted */ ! 42: char rbuf[RWMAXP]; /* to hold input packets */ ! 43: }; ! 44: ! 45: extern struct rwinfo Rwho; ! 46: ! 47: /* Declarations that describe the format of rwho packets on the net */ ! 48: ! 49: struct rwhopac { /* format of rwho packet */ ! 50: char rw_vers; /* protocol version number */ ! 51: char rw_type; /* packet type */ ! 52: char rw_pad[2]; ! 53: long rw_sndtim; /* sender's time stamp */ ! 54: long rw_rtim; /* receiver's time stamp */ ! 55: char rw_host[32]; /* sending host's name */ ! 56: long rw_load[3]; /* load averages */ ! 57: long rw_btim; /* boot time of sender */ ! 58: struct rw_who { ! 59: char rw_tty[RWNLEN]; /* UNIX tty name */ ! 60: char rw_nam[RWNLEN]; /* user's name */ ! 61: long rw_ton; /* time user logged on */ ! 62: long rw_idle; /* user's idle time */ ! 63: } rw_rww[1024 / sizeof(struct rw_who)]; ! 64: }; ! 65: ! 66: #define RWVERSION 1 /* protocol version number */ ! 67: #define RWSTATUS 1 /* host status */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.