summaryrefslogtreecommitdiffstats
path: root/hicn-plugin/src/faces
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-08-26 15:02:12 +0000
committerMauro Sardara <msardara@cisco.com>2022-09-01 13:20:29 +0000
commit940228d74920fbfd6707e1324711164360cca52d (patch)
tree1810371558a8f3efd5e9eb2e5ac042c98e354d50 /hicn-plugin/src/faces
parent8d7d5327ca86871cdf1d2ce404ca88bb2a58630f (diff)
feat(hicn-plugin): interest manifest
Ref: HICN-748 Change-Id: Ie403de53a93094dca997cec379db6f5d3ce8e6be Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-plugin/src/faces')
-rw-r--r--hicn-plugin/src/faces/iface_node.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hicn-plugin/src/faces/iface_node.c b/hicn-plugin/src/faces/iface_node.c
index 598a68db6..edfd2cd63 100644
--- a/hicn-plugin/src/faces/iface_node.c
+++ b/hicn-plugin/src/faces/iface_node.c
@@ -63,6 +63,7 @@ typedef struct
typedef enum
{
HICN4_IFACE_INPUT_NEXT_INTEREST,
+ HICN4_IFACE_INPUT_NEXT_INTEREST_MANIFEST,
HICN4_IFACE_INPUT_NEXT_MAPME,
HICN4_IFACE_INPUT_NEXT_ERROR_DROP,
HICN4_IFACE_INPUT_N_NEXT,
@@ -81,6 +82,7 @@ typedef struct
typedef enum
{
HICN6_IFACE_INPUT_NEXT_INTEREST,
+ HICN6_IFACE_INPUT_NEXT_INTEREST_MANIFEST,
HICN6_IFACE_INPUT_NEXT_MAPME,
HICN6_IFACE_INPUT_NEXT_ERROR_DROP,
HICN6_IFACE_INPUT_N_NEXT,
@@ -181,7 +183,7 @@ typedef enum
IP_HEADER_##ipv *ip_hdr = NULL; \
hicn_buffer_t *hicnb0; \
int ret0 = HICN_ERROR_NONE; \
- u8 is_icmp0; \
+ u8 is_icmp0, is_manifest0; \
/* Prefetch for next iteration. */ \
if (n_left_from > 1) \
{ \
@@ -206,6 +208,7 @@ typedef enum
ret0 = \
hicn_interest_parse_pkt (b0, vlib_buffer_length_in_chain (vm, b0)); \
is_icmp0 = (ret0 == HICN_ERROR_PARSER_MAPME_PACKET); \
+ is_manifest0 = hicnb0->payload_type == HPT_MANIFEST; \
ret0 = (ret0 == HICN_ERROR_NONE) || \
(ret0 == HICN_ERROR_PARSER_MAPME_PACKET); \
if (PREDICT_FALSE (!ret0)) \
@@ -215,7 +218,7 @@ typedef enum
else \
{ \
next0 = is_icmp0 * NEXT_MAPME_IP##ipv + \
- (1 - is_icmp0) * NEXT_INTEREST_IP##ipv; \
+ (1 - is_icmp0) * (NEXT_INTEREST_IP##ipv + is_manifest0); \
\
next_iface0 = NEXT_DATA_LOOKUP_IP##ipv; \
sw_if0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
@@ -273,7 +276,7 @@ typedef enum
vlib_buffer_t *b0, *b1; \
u32 bi0, bi1, next0, next1; \
u32 next_iface0, next_iface1, sw_if0 = ~0, sw_if1 = ~0; \
- u8 is_icmp0, is_icmp1; \
+ u8 is_icmp0, is_icmp1, is_manifest0, is_manifest1; \
IP_HEADER_##ipv *ip_hdr0 = NULL; \
IP_HEADER_##ipv *ip_hdr1 = NULL; \
int ret0 = HICN_ERROR_NONE, ret1 = HICN_ERROR_NONE; \
@@ -314,6 +317,8 @@ typedef enum
hicn_interest_parse_pkt (b1, vlib_buffer_length_in_chain (vm, b1)); \
is_icmp0 = ret0 == HICN_ERROR_PARSER_MAPME_PACKET; \
is_icmp1 = ret1 == HICN_ERROR_PARSER_MAPME_PACKET; \
+ is_manifest0 = hicnb0->payload_type == HPT_MANIFEST; \
+ is_manifest1 = hicnb1->payload_type == HPT_MANIFEST; \
ret0 = (ret0 == HICN_ERROR_NONE) || \
(ret0 == HICN_ERROR_PARSER_MAPME_PACKET); \
ret1 = (ret1 == HICN_ERROR_NONE) || \
@@ -322,10 +327,10 @@ typedef enum
if (PREDICT_TRUE (ret0 && ret1)) \
{ \
next0 = is_icmp0 * NEXT_MAPME_IP##ipv + \
- (1 - is_icmp0) * NEXT_INTEREST_IP##ipv; \
+ (1 - is_icmp0) * (NEXT_INTEREST_IP##ipv + is_manifest0); \
\
next1 = is_icmp1 * NEXT_MAPME_IP##ipv + \
- (1 - is_icmp1) * NEXT_INTEREST_IP##ipv; \
+ (1 - is_icmp1) * (NEXT_INTEREST_IP##ipv + is_manifest1); \
\
next_iface0 = NEXT_DATA_LOOKUP_IP##ipv; \
sw_if0 = vnet_buffer (b0)->sw_if_index[VLIB_RX]; \
@@ -562,6 +567,7 @@ VLIB_REGISTER_NODE (hicn4_iface_input_node) =
.next_nodes =
{
[HICN4_IFACE_INPUT_NEXT_INTEREST] = "hicn-interest-pcslookup",
+ [HICN4_IFACE_INPUT_NEXT_INTEREST_MANIFEST] = "hicn-interest-manifest-pcslookup",
[HICN4_IFACE_INPUT_NEXT_MAPME] = "hicn-mapme-ctrl",
[HICN4_IFACE_INPUT_NEXT_ERROR_DROP] = "error-drop",
},
@@ -636,6 +642,7 @@ VLIB_REGISTER_NODE (hicn6_iface_input_node) =
.next_nodes =
{
[HICN6_IFACE_INPUT_NEXT_INTEREST] = "hicn-interest-pcslookup",
+ [HICN6_IFACE_INPUT_NEXT_INTEREST_MANIFEST] = "hicn-interest-manifest-pcslookup",
[HICN6_IFACE_INPUT_NEXT_MAPME] = "hicn-mapme-ctrl",
[HICN6_IFACE_INPUT_NEXT_ERROR_DROP] = "error-drop",
},