aboutsummaryrefslogtreecommitdiffstats
path: root/lib/includes/hicn/mapme.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/includes/hicn/mapme.h')
-rw-r--r--lib/includes/hicn/mapme.h50
1 files changed, 5 insertions, 45 deletions
diff --git a/lib/includes/hicn/mapme.h b/lib/includes/hicn/mapme.h
index 63a5cd77e..b452a5dde 100644
--- a/lib/includes/hicn/mapme.h
+++ b/lib/includes/hicn/mapme.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -23,9 +23,9 @@
#include <stdint.h> // u32
#include <stdbool.h>
+#include <hicn/name.h>
+
#include "common.h"
-#include "protocol.h"
-#include "ops.h"
/**
* @brief MAP-Me configuration options
@@ -114,51 +114,11 @@ int hicn_mapme_parse_packet (const u8 *packet, hicn_prefix_t *prefix,
/* Default TTL */
#define HICN_MAPME_TTL 255 // typical for redirect (ref?)
-/*
- * The length of the MAPME4 header struct must be 120 bytes.
- */
-#define EXPECTED_MAPME_V4_HDRLEN 120
-
-/** @brief MAP-Me packet header for IPv4 */
-typedef struct
-{
- _ipv4_header_t ip;
- _icmprd4_header_t icmp_rd;
- seq_t seq;
- u8 len;
- u8 _pad[3];
-} hicn_mapme_v4_header_t;
+/* Should be moved to mapme.c, but header size still in use in VPP */
-/*
- * The length of the MAPME4 header struct must be bytes.
- */
+#define EXPECTED_MAPME_V4_HDRLEN 120
#define EXPECTED_MAPME_V6_HDRLEN 88
-/** @brief MAP-Me packet header for IPv6 */
-typedef struct
-{
- _ipv6_header_t ip;
- _icmprd_header_t icmp_rd;
- seq_t seq;
- u8 len;
- u8 _pad[3];
-} hicn_mapme_v6_header_t;
-
-/** @brief MAP-Me packet header (IP version agnostic) */
-typedef union
-{
- hicn_mapme_v4_header_t v4;
- hicn_mapme_v6_header_t v6;
-} hicn_mapme_header_t;
-
-#define HICN_MAPME_V4_HDRLEN sizeof (hicn_mapme_v4_header_t)
-#define HICN_MAPME_V6_HDRLEN sizeof (hicn_mapme_v6_header_t)
-
-static_assert (EXPECTED_MAPME_V4_HDRLEN == HICN_MAPME_V4_HDRLEN,
- "Size of MAPME_V4 struct does not match its expected size.");
-static_assert (EXPECTED_MAPME_V6_HDRLEN == HICN_MAPME_V6_HDRLEN,
- "Size of MAPME_V6 struct does not match its expected size.");
-
#endif /* HICN_MAPME_H */
/*