]> mj.ucw.cz Git - nwho.git/commitdiff
Renamed rywho_pkt to nwho_pkt
authorMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:03:50 +0000 (16:03 +0100)
committerMartin Mares <mj@ucw.cz>
Fri, 31 Dec 2010 15:03:50 +0000 (16:03 +0100)
net.h
nwho.c
nwhod.c

diff --git a/net.h b/net.h
index dba22f5d57f98aa19c6a2b76b383c30796998235..23fdf3088f09bf5b986752a6b9fc92347cc8ecbb 100644 (file)
--- a/net.h
+++ b/net.h
@@ -19,7 +19,7 @@ struct userinfo {
   u32 idle_time;
 };
 
-struct rywho_pkt {
+struct nwho_pkt {
   u32 magic;                           /* Guard against ancient nwho versions */
   u32 local_time;
   u32 server_time;                     /* Reserved for use by the server */
diff --git a/nwho.c b/nwho.c
index 53dfc9b587ee08d044ba01d018595d2a3fdb7195..7edcd0cd521caaa07658f353a1cfe137ad550ecd 100644 (file)
--- a/nwho.c
+++ b/nwho.c
@@ -45,7 +45,7 @@ puttime(int s)
 }
 
 static void
-show_uptime(char *name, struct rywho_pkt *p)
+show_uptime(char *name, struct nwho_pkt *p)
 {
   int i;
 
@@ -66,7 +66,7 @@ show_uptime(char *name, struct rywho_pkt *p)
 }
 
 static void
-show_users(char *name, struct rywho_pkt *p)
+show_users(char *name, struct nwho_pkt *p)
 {
   int u;
   int m = ntohl(p->num_users);
@@ -92,7 +92,7 @@ scan(void)
 {
   DIR *d;
   struct dirent *e;
-  struct rywho_pkt pkt;
+  struct nwho_pkt pkt;
   int fd, r;
   int is = 0;
 
@@ -118,9 +118,9 @@ scan(void)
          }
        r = read(fd, &pkt, sizeof(pkt));
        close(fd);
-       if (r < sizeof(struct rywho_pkt) - MAX_USERS*sizeof(struct userinfo)
+       if (r < sizeof(struct nwho_pkt) - MAX_USERS*sizeof(struct userinfo)
            || pkt.magic != htonl(NWHO_MAGIC)
-           || r != sizeof(struct rywho_pkt) - (MAX_USERS - ntohl(pkt.num_users))*sizeof(struct userinfo))
+           || r != sizeof(struct nwho_pkt) - (MAX_USERS - ntohl(pkt.num_users))*sizeof(struct userinfo))
          {
            fprintf(stderr, "%s: Malformed record\n", e->d_name);
            continue;
diff --git a/nwhod.c b/nwhod.c
index 8d98bc8dd5831564fb6f6b73cf6927891f51851c..f432d00d67f418f21ee83a0d0d88285fe4e1a33c 100644 (file)
--- a/nwhod.c
+++ b/nwhod.c
@@ -83,7 +83,7 @@ net_init(char *name)
 }
 
 static void
-scan_utmp(struct rywho_pkt *p, time_t now)
+scan_utmp(struct nwho_pkt *p, time_t now)
 {
   struct utmp *u;
   int cnt = 0;
@@ -121,7 +121,7 @@ scan_utmp(struct rywho_pkt *p, time_t now)
 }
 
 static void
-scan_load(struct rywho_pkt *p)
+scan_load(struct nwho_pkt *p)
 {
   int n, i, j[6];
   char buf[256];
@@ -150,7 +150,7 @@ scan_load(struct rywho_pkt *p)
 }
 
 static void
-make_pkt(struct rywho_pkt *pkt)
+make_pkt(struct nwho_pkt *pkt)
 {
   bzero(pkt, sizeof(pkt));
   pkt->magic = htonl(NWHO_MAGIC);
@@ -175,7 +175,7 @@ cleanup(void)
 }
 
 static void
-save_pkt(char *name, struct rywho_pkt *pkt, int len)
+save_pkt(char *name, struct nwho_pkt *pkt, int len)
 {
   int fd = open(name, O_WRONLY | O_CREAT, 0666);
   if (fd < 0)
@@ -200,9 +200,9 @@ static void
 receive(void)
 {
   int r, al;
-  struct rywho_pkt pkt;
+  struct nwho_pkt pkt;
   struct sockaddr_in sa;
-  int n = sizeof(struct rywho_pkt) - MAX_USERS * sizeof(struct userinfo);
+  int n = sizeof(struct nwho_pkt) - MAX_USERS * sizeof(struct userinfo);
   struct hostrec *e;
   struct hostent *h;
   char *c;
@@ -280,7 +280,7 @@ receive(void)
 static void
 local_scan(void)
 {
-  struct rywho_pkt pkt;
+  struct nwho_pkt pkt;
   static char hostname[64];
 
   make_pkt(&pkt);
@@ -349,7 +349,7 @@ server(void)
 static void
 client(char *serv)
 {
-  struct rywho_pkt pkt;
+  struct nwho_pkt pkt;
 
   net_init(serv);
   utmpname(UTMP_FILE);