From 8f0a8bf572b9b8123121338a31462440bad65857 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 8 Jul 2022 16:10:13 +0000 Subject: feat: add interest manifest serialization/deserialization Also: add helpers for interest manifest Ref: HICN-738 Signed-off-by: Mauro Sardara Change-Id: Ia531605148e00ccbe446da0f4f2d8caae2b098be Signed-off-by: Mauro Sardara --- hicn-plugin/src/hicn.h | 7 +++++++ hicn-plugin/src/interest_pcslookup_node.c | 6 ++++++ hicn-plugin/src/parser.h | 4 ++++ 3 files changed, 17 insertions(+) (limited to 'hicn-plugin/src') diff --git a/hicn-plugin/src/hicn.h b/hicn-plugin/src/hicn.h index 9acd9662f..84d268357 100644 --- a/hicn-plugin/src/hicn.h +++ b/hicn-plugin/src/hicn.h @@ -83,6 +83,7 @@ typedef struct hicn_name_t name; */ u16 port; + u16 payload_type; hicn_lifetime_t lifetime; } hicn_buffer_t; @@ -139,6 +140,12 @@ hicn_buffer_get_lifetime (vlib_buffer_t *b) return hicn_get_buffer (b)->lifetime; } +always_inline hicn_payload_type_t +hicn_buffer_get_payload_type (vlib_buffer_t *b) +{ + return hicn_get_buffer (b)->payload_type; +} + #endif /* __HICN_H__ */ /* diff --git a/hicn-plugin/src/interest_pcslookup_node.c b/hicn-plugin/src/interest_pcslookup_node.c index f0683727a..ab6a31e08 100644 --- a/hicn-plugin/src/interest_pcslookup_node.c +++ b/hicn-plugin/src/interest_pcslookup_node.c @@ -126,6 +126,12 @@ hicn_interest_pcslookup_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, stats.pkts_interest_count++; + // Interest manifest? + if (hicn_buffer_get_payload_type (b0) == HPT_MANIFEST) + { + ; + } + // Maybe trace if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) && (b0->flags & VLIB_BUFFER_IS_TRACED))) diff --git a/hicn-plugin/src/parser.h b/hicn-plugin/src/parser.h index 1d297e510..f9b3e43ae 100644 --- a/hicn-plugin/src/parser.h +++ b/hicn-plugin/src/parser.h @@ -36,6 +36,7 @@ \ u16 *port; \ hicn_lifetime_t *lifetime; \ + hicn_payload_type_t payload_type; \ \ hicn_packet_buffer_t *pkbuf = &hicn_get_buffer (pkt)->pkbuf; \ \ @@ -58,6 +59,9 @@ if (*lifetime > hicn_main.pit_lifetime_max_ms) \ *lifetime = hicn_main.pit_lifetime_max_ms; \ \ + /* get payload type */ \ + hicn_packet_get_payload_type (pkbuf, &payload_type); \ + hicn_get_buffer (pkt)->payload_type = (u16) (payload_type); \ return ret; \ } \ while (0) -- cgit 1.2.3-korg