Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Classes | Typedefs | Functions | Variables
strategy_dpo_manager.h File Reference
#include "strategy_dpo_ctx.h"
#include "strategy.h"
Include dependency graph for strategy_dpo_manager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  hicn_dpo_vft_s
 Definition of the virtual function table for a hICN DPO. More...
 

Typedefs

typedef struct hicn_dpo_vft_s hicn_dpo_vft_t
 Definition of the virtual function table for a hICN DPO. More...
 

Functions

dpo_type_t hicn_dpo_register_new_type (const char *const *const *hicn_nodes, const hicn_dpo_vft_t *hicn_dpo_vft, const hicn_strategy_vft_t *hicn_strategy_vft, const dpo_vft_t *dpo_ctx_vft)
 Register a new hICN dpo to the manager. More...
 
u32 dpo_is_hicn (const dpo_id_t *dpo)
 Check if the type of the dpo is among the list of hicn dpo types. More...
 
u8 hicn_dpo_get_vft_id (const dpo_id_t *dpo)
 Return the dpo_vtf and strategy_vtf identifier. More...
 
const hicn_dpo_vft_thicn_dpo_get_vft (dpo_type_t vfts_id)
 Get the vft to manage the dpo context. More...
 
const hicn_dpo_vft_thicn_dpo_get_vft_from_id (u8 strategy_id)
 Get the vft to manage the dpo context from the strategy id. More...
 
const hicn_strategy_vft_thicn_dpo_get_strategy_vft (dpo_type_t vfts_id)
 Get the vft with the hICN strategy functions. More...
 
const hicn_strategy_vft_thicn_dpo_get_strategy_vft_from_id (u8 vfts_id)
 Get the vft with the hICN strategy functions from the strategy id. More...
 
void hicn_dpos_init (void)
 Initialize all the types hicn dpo registered. More...
 
u8 * format_hicn_strategy_list (u8 *s, int n,...)
 Print the list of the registered hICN DPO. More...
 
u8 hicn_dpo_strategy_id_is_valid (int strategy_id)
 Check if a given id points to a strategy and the corresponding dpo ctx. More...
 
int hicn_strategy_get_all_available (void)
 Return the number of available strategies. This number can be used to as an upperbond for valid vfts_id. More...
 
void hicn_dpo_register (const hicn_dpo_vft_t *hicn_dpo)
 Registers a module at compilation time to be initialized as part of the ctor.
 

Variables

hicn_dpo_vft_t default_dpo
 

Detailed Description

This file implements structs and helper functions to manipulate hICN dpo. An hICN DPO is a combination of:

Typedef Documentation

◆ hicn_dpo_vft_t

Definition of the virtual function table for a hICN DPO.

The following virtual function table template that glues together the fuction to interact with the context and the creating the dpo

Function Documentation

◆ dpo_is_hicn()

u32 dpo_is_hicn ( const dpo_id_t *  dpo)

Check if the type of the dpo is among the list of hicn dpo types.

Iterate through the list of dpo types registered in the hicn dpo manager.

Parameters
dpoThe id of the dpo to which check the type
Returns
1 if there is a match, 0 otherwise.

◆ format_hicn_strategy_list()

u8* format_hicn_strategy_list ( u8 *  s,
int  n,
  ... 
)

Print the list of the registered hICN DPO.

Parameters
sString to which to append the list of hICN DPO (strategies)
nnumber of parameters to pass
Returns
The string with the list of hICN DPO (strategies)

◆ hicn_dpo_get_strategy_vft()

const hicn_strategy_vft_t* hicn_dpo_get_strategy_vft ( dpo_type_t  vfts_id)

Get the vft with the hICN strategy functions.

Parameters
Theid of the hicn_strategy_vft to retrieve.
Returns
The vft struct that contains the list hICN strategy functions.

◆ hicn_dpo_get_strategy_vft_from_id()

const hicn_strategy_vft_t* hicn_dpo_get_strategy_vft_from_id ( u8  vfts_id)

Get the vft with the hICN strategy functions from the strategy id.

Parameters
Theid of the hicn_strategy_vft to retrieve.
Returns
The vft struct that contains the list hICN strategy functions.

◆ hicn_dpo_get_vft()

const hicn_dpo_vft_t* hicn_dpo_get_vft ( dpo_type_t  vfts_id)

Get the vft to manage the dpo context.

Parameters
Theid of the hicn_dpo_vft to retrieve.
Returns
The vft struct that contains the list of callbacks that allows to manage the dpo context.

◆ hicn_dpo_get_vft_from_id()

const hicn_dpo_vft_t* hicn_dpo_get_vft_from_id ( u8  strategy_id)

Get the vft to manage the dpo context from the strategy id.

Parameters
Thestrategy id of the hicn_dpo_vft to retrieve.
Returns
The vft struct that contains the list of callbacks that allows to manage the dpo context.

◆ hicn_dpo_get_vft_id()

u8 hicn_dpo_get_vft_id ( const dpo_id_t *  dpo)

Return the dpo_vtf and strategy_vtf identifier.

Iterate through the list of dpo types registered in the hicn dpo manager and retrieve the corresponding dpo_vtf/strategy_vtf identifier.

Parameters
dpoThe id of the dpo to which check the type
Returns
the dpo_vft/strategy_vft id or HICN_ERROR_DPO_NOT_FOUND in case the dpo is not an hICN dpo.

◆ hicn_dpo_register_new_type()

dpo_type_t hicn_dpo_register_new_type ( const char *const *const *  hicn_nodes,
const hicn_dpo_vft_t hicn_dpo_vft,
const hicn_strategy_vft_t hicn_strategy_vft,
const dpo_vft_t *  dpo_ctx_vft 
)

Register a new hICN dpo to the manager.

Registering a hICN DPO allows the plugin to be aware of the new dpo an be able to apply it to the FIB entries.

Parameters
hicn_nodesA list of vpp to which pass an interest that matches with the FIB entry to which the hICN DPO is applied. This list must contain the name of the strategy node (or nodes in case of differentiation between IPv4 and IPv6). Unless really needed otherwise (i.e., different implementation of iface input), the list of node to use should be one provided in the strategy.h (hicn_nodes_strategy)
hicn_dpo_vftThe structure holding the virtual function table to interact with the hICN dpo and its context.
hicn_strategy_vftThe structure holding the virtual function table containing the hICN strategy functions.
Returns
the dpo type registered in the VPP Data plane graph.

◆ hicn_dpo_strategy_id_is_valid()

u8 hicn_dpo_strategy_id_is_valid ( int  strategy_id)

Check if a given id points to a strategy and the corresponding dpo ctx.

Parameters
Theid of the strategy to check.
Returns
HICN_ERROR_NONE is the id is valid, otherwise EINVAL

◆ hicn_dpos_init()

void hicn_dpos_init ( void  )

Initialize all the types hicn dpo registered.

Call the init functions of all the hicn dpo implemented. This init is called when the plugin bootstrap.

◆ hicn_strategy_get_all_available()

int hicn_strategy_get_all_available ( void  )

Return the number of available strategies. This number can be used to as an upperbond for valid vfts_id.

Returns
Return the number of available strategies.