summaryrefslogtreecommitdiffstats
path: root/lib/src/protocol/udp.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/protocol/udp.h')
-rw-r--r--lib/src/protocol/udp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/src/protocol/udp.h b/lib/src/protocol/udp.h
index 58cd65095..75d1ea98c 100644
--- a/lib/src/protocol/udp.h
+++ b/lib/src/protocol/udp.h
@@ -16,6 +16,11 @@
#ifndef HICN_PROTOCOL_UDP_H
#define HICN_PROTOCOL_UDP_H
+/*
+ * The length of the UDP header struct must be 8 bytes.
+ */
+#define EXPECTED_UDP_HDRLEN 8
+
typedef struct
{
u16 src_port;
@@ -25,6 +30,8 @@ typedef struct
} _udp_header_t;
#define UDP_HDRLEN sizeof(_udp_header_t)
+static_assert (EXPECTED_UDP_HDRLEN == UDP_HDRLEN,
+ "Size of UDP struct does not match its expected size.");
#endif /* HICN_PROTOCOL_UDP_H */