diff options
author | 2022-06-30 13:58:25 +0200 | |
---|---|---|
committer | 2022-07-01 12:11:33 +0200 | |
commit | 012843b1c0bc0838e69085ed83a79ec8b6f97360 (patch) | |
tree | 4fa320673884488e4a1bf879ec144e99f134a3fb /hicn-plugin/src/hicn.h | |
parent | 6b94663b2455e212009a544ae23bb6a8c55407f8 (diff) |
Revision and refactor of the VPP plugin with fixes for the
packet generator. Hash table for the packet cache has been
changed with the bihash.
Co-authored-by: Mauro Sardara <msardara@cisco.com>
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Change-Id: I0e0191a9f109d37081d32cc55d577ea43533f8c0
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'hicn-plugin/src/hicn.h')
-rw-r--r-- | hicn-plugin/src/hicn.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/hicn-plugin/src/hicn.h b/hicn-plugin/src/hicn.h index 22309e3e5..3b197d6b4 100644 --- a/hicn-plugin/src/hicn.h +++ b/hicn-plugin/src/hicn.h @@ -61,28 +61,24 @@ typedef u8 weight_t; typedef struct { /** - * Hash of the name (8) + * IDs to prefetch a PIT/CS entry (4) */ - u64 name_hash; + u32 pcs_entry_id; /** - * IDs to prefetch a PIT/CS entry (4+4+1+1) + * DPO/Stategy VFT ID. This is also the DPO type (4) */ - u32 node_id; - u32 bucket_id; - u8 hash_entry_id; - u8 hash_bucket_flags; + dpo_type_t vft_id; /** - * hICN buffer flags (1) + * DPO context ID (4) */ - u8 flags; + u32 dpo_ctx_id; /** - * used for data path (1+1) + * hICN buffer flags (1) */ - u8 dpo_ctx_id; - u8 vft_id; + u8 flags; /** * Ingress face (4) @@ -95,6 +91,7 @@ typedef struct hicn_type_t type; hicn_name_t name; u16 port; + hicn_lifetime_t lifetime; } hicn_buffer_t; STATIC_ASSERT (sizeof (hicn_buffer_t) <= @@ -113,14 +110,10 @@ hicn_is_v6 (hicn_header_t *pkt_hdr) return ((pkt_hdr->v4.ip.version_ihl >> 4) != 4); } -always_inline void -hicn_buffer_get_name_and_namelen (vlib_buffer_t *b0, u8 **nameptr, - u16 *namelen) +always_inline hicn_name_t * +hicn_buffer_get_name (vlib_buffer_t *b) { - *nameptr = (u8 *) (&hicn_get_buffer (b0)->name); - *namelen = ip_address_is_v4 (&hicn_get_buffer (b0)->name.prefix) ? - HICN_V4_NAME_LEN : - HICN_V6_NAME_LEN; + return &hicn_get_buffer (b)->name; } always_inline u8 @@ -135,6 +128,13 @@ hicn_buffer_set_flags (vlib_buffer_t *b, u8 flags) hicn_buffer_t *hb = hicn_get_buffer (b); hb->flags |= flags; } + +always_inline hicn_lifetime_t +hicn_buffer_get_lifetime (vlib_buffer_t *b) +{ + return hicn_get_buffer (b)->lifetime; +} + #endif /* __HICN_H__ */ /* |