aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin
diff options
context:
space:
mode:
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);