|
Hybrid ICN (hICN) plugin
v21.06-rc0-4-g18fa668
|
#include <vnet/dpo/dpo.h>#include <vnet/fib/fib_table.h>#include "params.h"#include "faces/face.h"

Go to the source code of this file.
Macros | |
| #define | HICN_FIB_TABLE 10 |
| #define | NEXT_HOP_INVALID ~0 |
| #define | INIT_SEQ 0 |
Functions | |
| struct | __attribute__ ((packed)) hicn_dpo_ctx_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... | |
| always_inline void | init_dpo_ctx (hicn_dpo_ctx_t *dpo_ctx, const hicn_face_id_t *next_hop, int nh_len, dpo_type_t dpo_type, dpo_proto_t proto) |
| Initialize the hICN dpo ctx. More... | |
| void | hicn_strategy_init_dpo_ctx_pool (void) |
| Initialize the pool containing the hICN dpo ctx. More... | |
| hicn_dpo_ctx_t * | hicn_strategy_dpo_ctx_alloc () |
| Allocate a new hICN dpo ctx from the pool. | |
| hicn_dpo_ctx_t * | hicn_strategy_dpo_ctx_get (index_t index) |
| Retrieve an existing hICN dpo ctx from the pool. | |
| index_t | hicn_strategy_dpo_ctx_get_index (hicn_dpo_ctx_t *cd) |
| Retrieve the index of the hICN dpo ctx. | |
| void | hicn_strategy_dpo_ctx_lock (dpo_id_t *dpo) |
| Lock the dpo of a strategy ctx. More... | |
| void | hicn_strategy_dpo_ctx_unlock (dpo_id_t *dpo) |
| Unlock the dpo of a strategy ctx. More... | |
| int | hicn_strategy_dpo_ctx_add_nh (hicn_face_id_t nh, hicn_dpo_ctx_t *dpo_ctx, u8 *pos) |
| Add or update a next hop in the dpo ctx. More... | |
| int | hicn_strategy_dpo_ctx_del_nh (hicn_face_id_t face_id, hicn_dpo_ctx_t *dpo_ctx) |
| Delete a next hop in the dpo ctx. More... | |
| STATIC_ASSERT (sizeof(hicn_dpo_ctx_t)<=2 *CLIB_CACHE_LINE_BYTES, "sizeof hicn_dpo_ctx_t is greater than 128B") | |
Variables | |
| hicn_dpo_ctx_t | |
| hicn_dpo_ctx_t * | hicn_strategy_dpo_ctx_pool |
This file implements the general hICN DPO ctx (shared among all the strategies).
An hICN DPO ctx contains the list of next hops, auxiliaries fields to maintain the dpo, map-me specifics (tfib_entry_count and seq), the dpo_type and 64B to let each strategy to store additional information. Each next hop is an hicn_face_id_t that refers to an index for an hICN face. The dpo_type is used to identify the strategy and to retrieve the vft corresponding to the strategy (see strategy.h) and to the dpo ctx (see strategy_dpo_manager.h)
| 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:
| int hicn_strategy_dpo_ctx_add_nh | ( | hicn_face_id_t | nh, |
| hicn_dpo_ctx_t * | dpo_ctx, | ||
| u8 * | pos | ||
| ) |
Add or update a next hop in the dpo ctx.
This function is meant to be used in the control plane and not in the data plane, as it is not optimized for the latter.
| nh | Next hop to insert in the dpo ctx |
| dpo_ctx | Dpo ctx to update with the new or updated next hop |
| pos | Return the position of the nh that has been added |
| int hicn_strategy_dpo_ctx_del_nh | ( | hicn_face_id_t | face_id, |
| hicn_dpo_ctx_t * | dpo_ctx | ||
| ) |
Delete a next hop in the dpo ctx.
| face_id | Face identifier of the next hop |
| dpo_ctx | Dpo ctx to update by removing the face |
| void hicn_strategy_dpo_ctx_lock | ( | dpo_id_t * | dpo | ) |
Lock the dpo of a strategy ctx.
| dpo | Identifier of the dpo of the strategy ctx |
| void hicn_strategy_dpo_ctx_unlock | ( | dpo_id_t * | dpo | ) |
Unlock the dpo of a strategy ctx.
| dpo | Identifier of the dpo of the strategy ctx |
| void hicn_strategy_init_dpo_ctx_pool | ( | void | ) |
Initialize the pool containing the hICN dpo ctx.
| always_inline void init_dpo_ctx | ( | hicn_dpo_ctx_t * | dpo_ctx, |
| const hicn_face_id_t * | next_hop, | ||
| int | nh_len, | ||
| dpo_type_t | dpo_type, | ||
| dpo_proto_t | proto | ||
| ) |
Initialize the hICN dpo ctx.
| dpo_ctx | Pointer to the hICN dpo ctx to initialize |
| next_hop | List of netx hops to store in the dpo ctx |
| nh_len | Number of elements in the list of next hops |
| dpo_type | Type of dpo. It identifies the strategy. |
1.8.17