aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/header.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src/header.h')
-rw-r--r--lib/src/header.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/lib/src/header.h b/lib/src/header.h
index 3864064f2..b21fe5c84 100644
--- a/lib/src/header.h
+++ b/lib/src/header.h
@@ -16,15 +16,20 @@
/**
* @file header.h
* @brief hICN header data structures.
- * details.
+ *
+ * NOTE: These structures are used as convenient facade for accessing
+ * the encapsulated headers. They are not written taking compiler padding
+ * into account, then a sizeof() on these struct could not give the expected
+ * result. For accessing the size of the hicn headers use the macros at the end of
+ * this file.
*/
+
#ifndef HICN_HEADER_H
#define HICN_HEADER_H
#include "common.h"
#include "protocol.h"
-
typedef struct
{
_ipv6_header_t ip;
@@ -94,6 +99,25 @@ typedef union
hicn_protocol_t protocol;
} hicn_header_t;
+
+#define HICN_V6_TCP_HDRLEN (IPV6_HDRLEN + TCP_HDRLEN)
+#define HICN_V6_ICMP_HDRLEN (IPV6_HDRLEN + ICMP_HDRLEN)
+#define HICN_V6_WLDR_HDRLEN (IPV6_HDRLEN + ICMPWLDR_HDRLEN)
+
+#define HICN_V6_TCP_AH_HDRLEN (HICN_V6_TCP_HDRLEN + AH_HDRLEN)
+#define HICN_V6_ICMP_AH_HDRLEN (HICN_V6_ICMP_HDRLEN + AH_HDRLEN)
+
+
+#define HICN_V4_TCP_HDRLEN (IPV4_HDRLEN + TCP_HDRLEN)
+#define HICN_V4_ICMP_HDRLEN (IPV4_HDRLEN + ICMP_HDRLEN)
+#define HICN_V4_WLDR_HDRLEN (IPV4_HDRLEN + ICMPWLDR_HDRLEN)
+
+#define HICN_V4_TCP_AH_HDRLEN (HICN_V4_TCP_HDRLEN + AH_HDRLEN)
+#define HICN_V4_ICMP_AH_HDRLEN (HICN_V4_ICMP_HDRLEN + AH_HDRLEN)
+
+
+
+
#endif /* HICN_HEADER_H */
/*