summaryrefslogtreecommitdiffstats
path: root/hicn-plugin
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2022-09-21 17:11:22 +0200
committerJordan Augé <jordan.auge+fdio@cisco.com>2022-09-30 09:17:13 +0200
commit3476dd9ddecc87d9212c3bf56a5be52079e27def (patch)
tree3c7ea2664e8f99fc4fd4588b9e4493f0dc9bbb93 /hicn-plugin
parent29647f687c8dadc90e2ba4d3a772eee09a1a4f1b (diff)
feat: support for new packet format in hicn-light
Ref: HICN-792 Change-Id: I3204006bd2dd2be6504c33035c6578ec0292455a Signed-off-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Diffstat (limited to 'hicn-plugin')
-rw-r--r--hicn-plugin/src/hicn.h6
-rw-r--r--hicn-plugin/src/mapme_eventmgr.c5
-rw-r--r--hicn-plugin/src/parser.h9
3 files changed, 5 insertions, 15 deletions
diff --git a/hicn-plugin/src/hicn.h b/hicn-plugin/src/hicn.h
index af23f3dde..7231773d7 100644
--- a/hicn-plugin/src/hicn.h
+++ b/hicn-plugin/src/hicn.h
@@ -72,7 +72,6 @@ typedef struct
/**
* Cached packet info
*/
- u16 port;
u16 payload_type;
hicn_lifetime_t lifetime;
@@ -90,8 +89,7 @@ typedef struct
STATIC_ASSERT (offsetof (hicn_buffer_t, pcs_entry_id) == 24, "");
STATIC_ASSERT (offsetof (hicn_buffer_t, vft_id) == 28, "");
STATIC_ASSERT (offsetof (hicn_buffer_t, dpo_ctx_id) == 32, "");
-STATIC_ASSERT (offsetof (hicn_buffer_t, port) == 36, "");
-STATIC_ASSERT (offsetof (hicn_buffer_t, payload_type) == 38, "");
+STATIC_ASSERT (offsetof (hicn_buffer_t, payload_type) == 36, "");
STATIC_ASSERT (offsetof (hicn_buffer_t, lifetime) == 40, "");
STATIC_ASSERT (offsetof (hicn_buffer_t, face_id) == 44, "");
STATIC_ASSERT (offsetof (hicn_buffer_t, flags) == 48, "");
@@ -126,7 +124,7 @@ hicn_buffer_is_v6 (vlib_buffer_t *b0)
{
hicn_packet_format_t format =
hicn_packet_get_format (&hicn_get_buffer (b0)->pkbuf);
- return format.l1 == IPPROTO_IPV6;
+ return HICN_PACKET_FORMAT_IS_IPV6 (format);
}
always_inline void
diff --git a/hicn-plugin/src/mapme_eventmgr.c b/hicn-plugin/src/mapme_eventmgr.c
index bbfe77819..866ac9a85 100644
--- a/hicn-plugin/src/mapme_eventmgr.c
+++ b/hicn-plugin/src/mapme_eventmgr.c
@@ -232,8 +232,9 @@ get_packet_buffer (vlib_main_t *vm, u32 node_index, u32 dpoi_index,
// pointer to IP layer ? do we need to prepare for ethernet ???
buffer = vlib_buffer_get_current (b);
- b->current_length = (format.l1 == IPPROTO_IPV6) ? EXPECTED_MAPME_V6_HDRLEN :
- EXPECTED_MAPME_V4_HDRLEN;
+ b->current_length = HICN_PACKET_FORMAT_IS_IPV6 (format) ?
+ EXPECTED_MAPME_V6_HDRLEN :
+ EXPECTED_MAPME_V4_HDRLEN;
return buffer;
}
diff --git a/hicn-plugin/src/parser.h b/hicn-plugin/src/parser.h
index e69a97755..e9f709481 100644
--- a/hicn-plugin/src/parser.h
+++ b/hicn-plugin/src/parser.h
@@ -34,7 +34,6 @@ parse (vlib_buffer_t *pkt, uword size)
int ret = HICN_ERROR_NONE;
- u16 *port;
hicn_lifetime_t *lifetime;
hicn_payload_type_t payload_type;
@@ -43,14 +42,6 @@ parse (vlib_buffer_t *pkt, uword size)
hicn_packet_set_buffer (pkbuf, vlib_buffer_get_current (pkt), size, size);
hicn_packet_analyze (&hicn_get_buffer (pkt)->pkbuf);
- /* get source port*/
- port = &hicn_get_buffer (pkt)->port;
- hicn_packet_get_src_port (pkbuf, port);
- if (PREDICT_FALSE (ret))
- {
- return HICN_ERROR_PARSER_PKT_INVAL;
- }
-
/* get lifetime*/
lifetime = &hicn_get_buffer (pkt)->lifetime;
hicn_packet_get_lifetime (pkbuf, lifetime);