]> mj.ucw.cz Git - nwho.git/blobdiff - nwho.h
More work on bringing the Debian packaging up to date
[nwho.git] / nwho.h
diff --git a/nwho.h b/nwho.h
index 1c22c54f4e611b14768e0b6e7e49d9b4509d0dad..69bc7a469b5ea3bc8aceca1dd4541b34487cb326 100644 (file)
--- a/nwho.h
+++ b/nwho.h
@@ -5,6 +5,7 @@
  */
 
 #include <inttypes.h>
+#include <netinet/in.h>
 
 typedef uint32_t u32;
 
@@ -40,3 +41,12 @@ struct nwho_pkt {
 
 #define STRINGIFY(x) STRINGIFY2(x)
 #define STRINGIFY2(x) #x
+
+static inline int nwho_pkt_size(struct nwho_pkt *pkt)
+{
+  return sizeof(struct nwho_pkt) - (MAX_USERS - ntohl(pkt->num_users))*sizeof(struct userinfo);
+}
+
+/* util.c */
+
+void die(char *msg, ...) __attribute__((noreturn));