diff options
Diffstat (limited to 'src/packet.h')
-rw-r--r-- | src/packet.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/packet.h b/src/packet.h index a27b644..286192e 100644 --- a/src/packet.h +++ b/src/packet.h @@ -29,6 +29,8 @@ #include "types.h" +#include <arpa/inet.h> + #define GP_BABEL_VERSION 0 @@ -39,5 +41,9 @@ struct __attribute__((packed)) gp_babel_packet { uint8_t tlv[]; }; +static inline size_t gp_babel_packet_size(const gp_babel_packet_t *packet) { + return sizeof(gp_babel_packet_t)+ntohs(packet->len); +} + #endif /* _GMRF_PROTO_BABEL_PACKET_H_ */ |