aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-plugin
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-07-08 16:10:13 +0000
committerMauro Sardara <msardara@cisco.com>2022-08-10 11:57:10 +0200
commit8f0a8bf572b9b8123121338a31462440bad65857 (patch)
treeecac67f0ad005b2eb0a1bd25c8f242497ffddea1 /hicn-plugin
parent8d27045832427a0ea345f48bfb2c42f46a357af1 (diff)
feat: add interest manifest serialization/deserialization
Also: add helpers for interest manifest Ref: HICN-738 Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: Ia531605148e00ccbe446da0f4f2d8caae2b098be Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-plugin')
-rw-r--r--hicn-plugin/src/hicn.h7
-rw-r--r--hicn-plugin/src/interest_pcslookup_node.c6
-rw-r--r--hicn-plugin/src/parser.h4
3 files changed, 17 insertions, 0 deletions
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)