Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Classes | Macros | Typedefs | Functions | Variables
pcs.h File Reference
#include "hashtb.h"
#include "face_db.h"
#include "strategy_dpo_manager.h"
#include "error.h"
#include "cache_policies/cs_policy.h"
#include "faces/face.h"
Include dependency graph for pcs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hicn_pcs_entry_s
 
struct  hicn_pit_cs_s
 

Macros

#define HICN_PIT_NULL_TYPE   0
 
#define HICN_PIT_TYPE   1
 
#define HICN_CS_TYPE   2
 
#define SEC_MS   1000
 
#define HICN_INFRA_FAST_TIMER_SECS   1
 
#define HICN_INFRA_FAST_TIMER_MSECS   (HICN_INFRA_FAST_TIMER_SECS * SEC_MS)
 
#define HICN_INFRA_SLOW_TIMER_SECS   60
 
#define HICN_INFRA_SLOW_TIMER_MSECS   (HICN_INFRA_SLOW_TIMER_SECS * SEC_MS)
 
#define HICN_PCS_ENTRY_CS_FLAG   0x01
 
#define HICN_CS_ENTRY_OPAQUE_SIZE   HICN_HASH_NODE_APP_DATA_SIZE - 36
 

Typedefs

typedef struct hicn_pcs_entry_s hicn_pcs_entry_t
 
typedef struct hicn_pit_cs_s hicn_pit_cs_t
 

Functions

struct __attribute__ ((packed)) hicn_pcs_shared_s
 Structure representing a face. It containes the fields shared among all the types of faces as well it leaves some space for storing additional information specific to each type. More...
 
int hicn_pit_create (hicn_pit_cs_t *p, u32 num_elems)
 
always_inline void hicn_pit_to_cs (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *pcs_entry, hicn_hash_entry_t *hash_entry, hicn_hash_node_t *node, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id, hicn_face_id_t inface_id, u8 is_appface)
 
always_inline void hicn_pcs_cs_update (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *old_entry, hicn_pcs_entry_t *entry, hicn_hash_node_t *node)
 
always_inline void hicn_pcs_cs_delete (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entry, hicn_hash_node_t **node, hicn_hash_entry_t *hash_entry, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id)
 
always_inline int hicn_pcs_cs_insert (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, hicn_hash_node_t *node, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, u32 *bucket_id, u8 *bucket_is_overflow)
 
always_inline int hicn_pcs_cs_insert_update (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, hicn_hash_node_t *node, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, u32 *bucket_id, u8 *bucket_is_overflow, hicn_face_id_t inface)
 
always_inline int hicn_pcs_pit_insert (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, hicn_hash_node_t *node, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, u32 *bucket_id, u8 *bucket_is_overflow)
 
always_inline void hicn_pcs_pit_delete (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, hicn_hash_node_t **node, vlib_main_t *vm, hicn_hash_entry_t *hash_entry, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id)
 
always_inline int hicn_pcs_insert (vlib_main_t *vm, hicn_pit_cs_t *pitcs, hicn_pcs_entry_t *entry, hicn_hash_node_t *node, hicn_hash_entry_t **hash_entry, u64 hashval, u32 *node_id, index_t *dpo_ctx_id, u8 *vft_id, u8 *is_cs, u8 *hash_entry_id, u32 *bucket_id, u8 *bucket_is_overflow)
 
always_inline void hicn_pcs_delete (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, hicn_hash_node_t **node, vlib_main_t *vm, hicn_hash_entry_t *hash_entry, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id)
 
always_inline void hicn_pcs_remove_lock (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, hicn_hash_node_t **node, vlib_main_t *vm, hicn_hash_entry_t *hash_entry, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id)
 
always_inline void hicn_cs_delete_trimmed (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, hicn_hash_entry_t *hash_entry, hicn_hash_node_t **node, vlib_main_t *vm)
 
always_inline void hicn_pcs_delete_internal (hicn_pit_cs_t *pitcs, hicn_pcs_entry_t **pcs_entryp, hicn_hash_entry_t *hash_entry, hicn_hash_node_t **node, vlib_main_t *vm, const hicn_dpo_vft_t *dpo_vft, dpo_id_t *hicn_dpo_id)
 
always_inline u16 hicn_infra_seq16_sum (u16 addend1, u16 addend2)
 
always_inline int hicn_infra_seq16_cmp (u16 a, u16 b)
 
always_inline int hicn_infra_seq16_lt (u16 a, u16 b)
 
always_inline int hicn_infra_seq16_le (u16 a, u16 b)
 
always_inline int hicn_infra_seq16_gt (u16 a, u16 b)
 
always_inline int hicn_infra_seq16_ge (u16 a, u16 b)
 
always_inline u16 hicn_infra_ms2clicks (u64 time_ms, u64 ms_per_click)
 
always_inline u16 hicn_infra_get_fast_exp_time (u64 lifetime_ms)
 
always_inline u16 hicn_infra_get_slow_exp_time (u64 lifetime_ms)
 

Variables

 hicn_pcs_shared_t
 
 hicn_pit_entry_t
 
u16 hicn_infra_fast_timer
 
u16 hicn_infra_slow_timer
 

Detailed Description

This file implement the PIT and CS which are collapsed in the same structure, thereore an entry is either a PIT entry of a CS entry. The implementation consist of a hash table where each entry of the hash table contains a PIT or CS entry, some counters to maintain the status of the PIT/CS and the reference to the eviction policy for the CS. The default eviction policy id FIFO.

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

Structure representing a face. It containes the fields shared among all the types of faces as well it leaves some space for storing additional information specific to each type.

Key definition for the mhash table. An face is uniquely identified by ip address, the interface id and a dpo pointing to the next node in the vlib graph. The ip address can correspond to the remote ip address of the next hicn hop, or to the local address of the receiving interface. The former is used to retrieve the incoming face when an interest is received, the latter when the arring packet is a data. If the face is a regular face In case of iface, the following structure can be filled in different ways:

  • dpo equal to DPO_INVALID when the iface is a regular hICN iface
  • in case of udp_tunnel dpo = { .dpoi_index = tunnel_id, .dpoi_type = DPO_FIRST, //We don't need the type, we leave it invalid .dpoi_proto = DPO_PROTO_IP4 or DPO_PROTO_IP6, .dpoi_next_node = HICN6_IFACE_OUTPUT_NEXT_UDP4_ENCAP or HICN6_IFACE_OUTPUT_NEXT_UDP6_ENCAP or HICN4_IFACE_OUTPUT_NEXT_UDP4_ENCAP or HICN4_IFACE_OUTPUT_NEXT_UDP6_ENCAP }