]> mj.ucw.cz Git - nwho.git/commitdiff
Use <inttypes.h> instead of <asm/types.h>
authorMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:00:34 +0000 (16:00 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:00:34 +0000 (16:00 +0100)
net.h
nwho.c
nwhod.c

diff --git a/net.h b/net.h
index 7b65eca11c096f32864d3057ce28d6dff6104a60..02d1c374ab26e3c012ed8a8be0b40c37e5c033f7 100644 (file)
--- a/net.h
+++ b/net.h
@@ -7,6 +7,10 @@
  *     of the GNU General Public License. See file COPYING in any of the GNU packages.
  */
 
+#include <inttypes.h>
+
+typedef uint32_t u32;
+
 #define MAX_USERS 128
 
 struct userinfo {
@@ -14,17 +18,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];
+  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];
 };
 
diff --git a/nwho.c b/nwho.c
index d7e1f196f5dbe5273d168d5e2586cf2501796f3f..d5630c6f60241a0be17240776345030bd76071c3 100644 (file)
--- a/nwho.c
+++ b/nwho.c
@@ -1,7 +1,7 @@
 /*
  *     The Remote User Information Lister
  *
- *     (c) 1997--2002 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2010 Martin Mares <mj@ucw.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.
@@ -15,7 +15,6 @@
 #include <dirent.h>
 #include <time.h>
 #include <netinet/in.h>
-#include <asm/types.h>
 
 #include "net.h"
 
diff --git a/nwhod.c b/nwhod.c
index 6f288321a32fc8329bb05992856fababede6a16c..710a0082e7507415629db061bb3923e3b96130d9 100644 (file)
--- a/nwhod.c
+++ b/nwhod.c
@@ -32,7 +32,7 @@ struct hostrec {
   struct hostrec *next;
   char name[32];
   time_t last_rec;                     /* 0=down */
-  __u32 addr;
+  u32 addr;
 };
 
 static int sock, port;
@@ -194,7 +194,7 @@ save_pkt(char *name, struct rywho_pkt *pkt, int len)
 }
 
 static inline int                      /* Validation checks not implemented yet */
-is_valid(__u32 ipa)
+is_valid(u32 ipa)
 {
   return 1;
 }