X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=nwho.h;h=69bc7a469b5ea3bc8aceca1dd4541b34487cb326;hb=04cb4ed3a6cfb676cac7c8ea35f0f4ccc43b7121;hp=1c22c54f4e611b14768e0b6e7e49d9b4509d0dad;hpb=6f436fe1021f801f29cee16af7f75358673374bc;p=nwho.git diff --git a/nwho.h b/nwho.h index 1c22c54..69bc7a4 100644 --- a/nwho.h +++ b/nwho.h @@ -5,6 +5,7 @@ */ #include +#include 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));