]> mj.ucw.cz Git - nwho.git/blob - net.h
Updated copyright year
[nwho.git] / net.h
1 /*
2  *      The Remote User Info Distribution Protocol
3  *
4  *      (c) 1997--2010 Martin Mares <mj@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU General Public License. See file COPYING in any of the GNU packages.
8  */
9
10 #include <inttypes.h>
11
12 typedef uint32_t u32;
13
14 #define MAX_USERS 128
15
16 struct userinfo {
17   char name[10];
18   char con[8];
19   char mesg_y;
20   char pad;
21   u32 login_time;
22   u32 idle_time;
23 };
24
25 struct rywho_pkt {
26   u32 magic;                            /* Guard against ancient nwho versions */
27   u32 local_time;
28   u32 server_time;                      /* Reserved for use by the server */
29   u32 num_users;
30   u32 uptime;
31   u32 avl[3];
32   struct userinfo users[MAX_USERS];
33 };
34
35 #define NWHO_SPOOL_DIR "/var/state/nwho"
36 #define NWHO_MAGIC 0x21913332
37 #define NWHO_PORT 811
38
39 #define DEFAULT_SEND_TIME 30
40 #define DEFAULT_PRUNE_TIME 30
41 #define DEFAULT_DOWN_TIME 120
42 #define DEFAULT_DEAD_TIME 4*86400