]> mj.ucw.cz Git - nwho.git/blobdiff - net.h
Let save_pkt() calculates the packet length internally
[nwho.git] / net.h
diff --git a/net.h b/net.h
index 4b6b7135cd2790c2464bc187da8af32b49851e2d..23fdf3088f09bf5b986752a6b9fc92347cc8ecbb 100644 (file)
--- a/net.h
+++ b/net.h
@@ -1,12 +1,13 @@
 /*
  *     The Remote User Info Distribution Protocol
  *
- *     (c) 1997--2001 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
- *
- *     This software may be freely distributed and used according to the terms
- *     of the GNU General Public License. See file COPYING in any of the GNU packages.
+ *     (c) 1997--2010 Martin Mares <mj@ucw.cz>
  */
 
+#include <inttypes.h>
+
+typedef uint32_t u32;
+
 #define MAX_USERS 128
 
 struct userinfo {
@@ -14,17 +15,17 @@ struct userinfo {
   char con[8];
   char mesg_y;
   char pad;
-  __u32 login_time;
-  __u32 idle_time;
+  u32 login_time;
+  u32 idle_time;
 };
 
-struct rywho_pkt {
-  __u32 magic;                         /* Guard against ancient nwho versions */
-  __u32 local_time;
-  __u32 server_time;                   /* Reserved for use by the server */
-  __u32 num_users;
-  __u32 uptime;
-  __u32 avl[3];
+struct nwho_pkt {
+  u32 magic;                           /* Guard against ancient nwho versions */
+  u32 local_time;
+  u32 server_time;                     /* Reserved for use by the server */
+  u32 num_users;
+  u32 uptime;
+  u32 avl[3];
   struct userinfo users[MAX_USERS];
 };
 
@@ -34,4 +35,5 @@ struct rywho_pkt {
 
 #define DEFAULT_SEND_TIME 30
 #define DEFAULT_PRUNE_TIME 30
-#define DEFAULT_DEAD_TIME 120
+#define DEFAULT_DOWN_TIME 120
+#define DEFAULT_DEAD_TIME 4*86400