FD.io VPP  v21.01.1
Vector Packet Processing
ipsec_tun.c File Reference
+ Include dependency graph for ipsec_tun.c:

Go to the source code of this file.

Data Structures

struct  ipsec_tun_protect_itf_db_t_
 The DB of all added per-nh tunnel protectiond. More...
 
struct  ipsec_tun_protect_db_t_
 

Macros

#define IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS   (64 * 1024)
 
#define IPSEC_TUN_DEFAULT_HASH_MEMORY_SIZE   512 << 20
 
#define ITP_DBG(_itp, _fmt, _args...)
 
#define ITP_DBG2(_fmt, _args...)
 

Typedefs

typedef struct ipsec_tun_protect_itf_db_t_ ipsec_tun_protect_itf_db_t
 The DB of all added per-nh tunnel protectiond. More...
 
typedef struct ipsec_tun_protect_db_t_ ipsec_tun_protect_db_t
 

Functions

void ipsec_tun_register_nodes (ip_address_family_t af)
 
void ipsec_tun_unregister_nodes (ip_address_family_t af)
 
static const ipsec_tun_protect_tipsec_tun_protect_from_const_base (const adj_delegate_t *ad)
 
static u32 ipsec_tun_protect_get_adj_next (vnet_link_t linkt, const ipsec_tun_protect_t *itp)
 
static void ipsec_tun_protect_add_adj (adj_index_t ai, const ipsec_tun_protect_t *itp)
 
static index_t ipsec_tun_protect_find (u32 sw_if_index, const ip_address_t *nh)
 
static void ipsec_tun_protect_rx_db_add (ipsec_main_t *im, const ipsec_tun_protect_t *itp)
 
static adj_walk_rc_t ipsec_tun_protect_adj_add (adj_index_t ai, void *arg)
 
static void ipsec_tun_protect_tx_db_add (ipsec_tun_protect_t *itp)
 
static void ipsec_tun_protect_rx_db_remove (ipsec_main_t *im, const ipsec_tun_protect_t *itp)
 
static adj_walk_rc_t ipsec_tun_protect_adj_remove (adj_index_t ai, void *arg)
 
static void ipsec_tun_protect_tx_db_remove (ipsec_tun_protect_t *itp)
 
static void ipsec_tun_protect_set_crypto_addr (ipsec_tun_protect_t *itp)
 
static void ipsec_tun_protect_config (ipsec_main_t *im, ipsec_tun_protect_t *itp, u32 sa_out, u32 *sas_in)
 
static void ipsec_tun_protect_unconfig (ipsec_main_t *im, ipsec_tun_protect_t *itp)
 
int ipsec_tun_protect_update_one (u32 sw_if_index, const ip_address_t *nh, u32 sa_out, u32 sa_in)
 
int ipsec_tun_protect_update_out (u32 sw_if_index, const ip_address_t *nh, u32 sa_out)
 
int ipsec_tun_protect_update_in (u32 sw_if_index, const ip_address_t *nh, u32 sa_in)
 
static void ipsec_tun_protect_update_from_teib (ipsec_tun_protect_t *itp, const teib_entry_t *ne)
 
int ipsec_tun_protect_update (u32 sw_if_index, const ip_address_t *nh, u32 sa_out, u32 *sas_in)
 
int ipsec_tun_protect_del (u32 sw_if_index, const ip_address_t *nh)
 
void ipsec_tun_protect_walk (ipsec_tun_protect_walk_cb_t fn, void *ctx)
 
void ipsec_tun_protect_walk_itf (u32 sw_if_index, ipsec_tun_protect_walk_cb_t fn, void *ctx)
 
static void ipsec_tun_protect_adj_delegate_adj_deleted (adj_delegate_t *ad)
 
static void ipsec_tun_protect_adj_delegate_adj_modified (adj_delegate_t *ad)
 
static void ipsec_tun_protect_adj_delegate_adj_created (adj_index_t ai)
 
static u8ipsec_tun_protect_adj_delegate_format (const adj_delegate_t *aed, u8 *s)
 
static void ipsec_tun_teib_entry_added (const teib_entry_t *ne)
 
static void ipsec_tun_teib_entry_deleted (const teib_entry_t *ne)
 
void ipsec_tun_table_init (ip_address_family_t af, uword table_size, u32 n_buckets)
 
clib_error_tipsec_tunnel_protect_init (vlib_main_t *vm)
 
static clib_error_tipsec_config (vlib_main_t *vm, unformat_input_t *input)
 

Variables

vlib_log_class_t ipsec_tun_protect_logger
 The logger. More...
 
ipsec_tun_protect_tipsec_tun_protect_pool
 Pool of tunnel protection objects. More...
 
static adj_delegate_type_t ipsec_tun_adj_delegate_type
 Adj delegate registered type. More...
 
index_tipsec_tun_protect_sa_by_adj_index
 Adj index to TX SA mapping. More...
 
const ip_address_t IP_ADDR_ALL_0 = IP_ADDRESS_V4_ALL_0S
 
static ipsec_tun_protect_db_t itp_db
 
static const ipsec_tun_protect_itf_db_t IPSEC_TUN_PROTECT_DEFAULT_DB_ENTRY
 
static u32 ipsec_tun_node_regs [N_AF]
 
static const adj_delegate_vft_t ipsec_tun_adj_delegate_vft
 VFT registered with the adjacency delegate. More...
 
static const teib_vft_t ipsec_tun_teib_vft
 

Macro Definition Documentation

◆ IPSEC_TUN_DEFAULT_HASH_MEMORY_SIZE

#define IPSEC_TUN_DEFAULT_HASH_MEMORY_SIZE   512 << 20

Definition at line 33 of file ipsec_tun.c.

◆ IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS

#define IPSEC_TUN_DEFAULT_HASH_NUM_BUCKETS   (64 * 1024)

Definition at line 32 of file ipsec_tun.c.

◆ ITP_DBG

#define ITP_DBG (   _itp,
  _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug(ipsec_tun_protect_logger, \
"[%U]: " _fmt, \
_itp, ##_args); \
}
u8 * format_ipsec_tun_protect(u8 *s, va_list *args)
Definition: ipsec_format.c:376
vlib_log_class_t ipsec_tun_protect_logger
The logger.
Definition: ipsec_tun.c:38

Definition at line 81 of file ipsec_tun.c.

◆ ITP_DBG2

#define ITP_DBG2 (   _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug(ipsec_tun_protect_logger, \
_fmt, ##_args); \
}
vlib_log_class_t ipsec_tun_protect_logger
The logger.
Definition: ipsec_tun.c:38

Definition at line 89 of file ipsec_tun.c.

Typedef Documentation

◆ ipsec_tun_protect_db_t

◆ ipsec_tun_protect_itf_db_t

The DB of all added per-nh tunnel protectiond.

Function Documentation

◆ ipsec_config()

static clib_error_t* ipsec_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1028 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_protect_add_adj()

static void ipsec_tun_protect_add_adj ( adj_index_t  ai,
const ipsec_tun_protect_t itp 
)
static

Definition at line 175 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_adj_add()

static adj_walk_rc_t ipsec_tun_protect_adj_add ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 284 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_adj_delegate_adj_created()

static void ipsec_tun_protect_adj_delegate_adj_created ( adj_index_t  ai)
static

Definition at line 887 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_protect_adj_delegate_adj_deleted()

static void ipsec_tun_protect_adj_delegate_adj_deleted ( adj_delegate_t ad)
static

Definition at line 872 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_protect_adj_delegate_adj_modified()

static void ipsec_tun_protect_adj_delegate_adj_modified ( adj_delegate_t ad)
static

Definition at line 880 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_protect_adj_delegate_format()

static u8* ipsec_tun_protect_adj_delegate_format ( const adj_delegate_t aed,
u8 s 
)
static

Definition at line 909 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_protect_adj_remove()

static adj_walk_rc_t ipsec_tun_protect_adj_remove ( adj_index_t  ai,
void *  arg 
)
static

Definition at line 398 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_config()

static void ipsec_tun_protect_config ( ipsec_main_t im,
ipsec_tun_protect_t itp,
u32  sa_out,
u32 sas_in 
)
static

Definition at line 477 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_del()

int ipsec_tun_protect_del ( u32  sw_if_index,
const ip_address_t nh 
)

Definition at line 804 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_find()

static index_t ipsec_tun_protect_find ( u32  sw_if_index,
const ip_address_t nh 
)
static

Definition at line 194 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_from_const_base()

static const ipsec_tun_protect_t* ipsec_tun_protect_from_const_base ( const adj_delegate_t ad)
inlinestatic

Definition at line 131 of file ipsec_tun.c.

+ Here is the caller graph for this function:

◆ ipsec_tun_protect_get_adj_next()

static u32 ipsec_tun_protect_get_adj_next ( vnet_link_t  linkt,
const ipsec_tun_protect_t itp 
)
static

Definition at line 139 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_rx_db_add()

static void ipsec_tun_protect_rx_db_add ( ipsec_main_t im,
const ipsec_tun_protect_t itp 
)
static

Definition at line 216 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_rx_db_remove()

static void ipsec_tun_protect_rx_db_remove ( ipsec_main_t im,
const ipsec_tun_protect_t itp 
)
static

Definition at line 355 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_set_crypto_addr()

static void ipsec_tun_protect_set_crypto_addr ( ipsec_tun_protect_t itp)
static

Definition at line 449 of file ipsec_tun.c.

+ Here is the caller graph for this function:

◆ ipsec_tun_protect_tx_db_add()

static void ipsec_tun_protect_tx_db_add ( ipsec_tun_protect_t itp)
static

Definition at line 298 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_tx_db_remove()

static void ipsec_tun_protect_tx_db_remove ( ipsec_tun_protect_t itp)
static

Definition at line 412 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_unconfig()

static void ipsec_tun_protect_unconfig ( ipsec_main_t im,
ipsec_tun_protect_t itp 
)
static

Definition at line 508 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_update()

int ipsec_tun_protect_update ( u32  sw_if_index,
const ip_address_t nh,
u32  sa_out,
u32 sas_in 
)

Definition at line 654 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_update_from_teib()

static void ipsec_tun_protect_update_from_teib ( ipsec_tun_protect_t itp,
const teib_entry_t ne 
)
static

Definition at line 638 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_update_in()

int ipsec_tun_protect_update_in ( u32  sw_if_index,
const ip_address_t nh,
u32  sa_in 
)

Definition at line 595 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_update_one()

int ipsec_tun_protect_update_one ( u32  sw_if_index,
const ip_address_t nh,
u32  sa_out,
u32  sa_in 
)

Definition at line 533 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_update_out()

int ipsec_tun_protect_update_out ( u32  sw_if_index,
const ip_address_t nh,
u32  sa_out 
)

Definition at line 546 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_protect_walk()

void ipsec_tun_protect_walk ( ipsec_tun_protect_walk_cb_t  fn,
void *  ctx 
)

Definition at line 836 of file ipsec_tun.c.

+ Here is the caller graph for this function:

◆ ipsec_tun_protect_walk_itf()

void ipsec_tun_protect_walk_itf ( u32  sw_if_index,
ipsec_tun_protect_walk_cb_t  fn,
void *  ctx 
)

Definition at line 849 of file ipsec_tun.c.

+ Here is the caller graph for this function:

◆ ipsec_tun_register_nodes()

void ipsec_tun_register_nodes ( ip_address_family_t  af)

Definition at line 98 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tun_table_init()

void ipsec_tun_table_init ( ip_address_family_t  af,
uword  table_size,
u32  n_buckets 
)

Definition at line 976 of file ipsec_tun.c.

+ Here is the caller graph for this function:

◆ ipsec_tun_teib_entry_added()

static void ipsec_tun_teib_entry_added ( const teib_entry_t ne)
static

Definition at line 920 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_teib_entry_deleted()

static void ipsec_tun_teib_entry_deleted ( const teib_entry_t ne)
static

Definition at line 941 of file ipsec_tun.c.

+ Here is the call graph for this function:

◆ ipsec_tun_unregister_nodes()

void ipsec_tun_unregister_nodes ( ip_address_family_t  af)

Definition at line 115 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ipsec_tunnel_protect_init()

clib_error_t* ipsec_tunnel_protect_init ( vlib_main_t vm)

Definition at line 991 of file ipsec_tun.c.

+ Here is the call graph for this function:

Variable Documentation

◆ IP_ADDR_ALL_0

const ip_address_t IP_ADDR_ALL_0 = IP_ADDRESS_V4_ALL_0S

Definition at line 55 of file ipsec_tun.c.

◆ ipsec_tun_adj_delegate_type

adj_delegate_type_t ipsec_tun_adj_delegate_type
static

Adj delegate registered type.

Definition at line 48 of file ipsec_tun.c.

◆ ipsec_tun_adj_delegate_vft

const adj_delegate_vft_t ipsec_tun_adj_delegate_vft
static
Initial value:
= {
}
static void ipsec_tun_protect_adj_delegate_adj_modified(adj_delegate_t *ad)
Definition: ipsec_tun.c:880
static void ipsec_tun_protect_adj_delegate_adj_created(adj_index_t ai)
Definition: ipsec_tun.c:887
static void ipsec_tun_protect_adj_delegate_adj_deleted(adj_delegate_t *ad)
Definition: ipsec_tun.c:872
static u8 * ipsec_tun_protect_adj_delegate_format(const adj_delegate_t *aed, u8 *s)
Definition: ipsec_tun.c:909

VFT registered with the adjacency delegate.

Definition at line 963 of file ipsec_tun.c.

◆ ipsec_tun_node_regs

u32 ipsec_tun_node_regs[N_AF]
static

Definition at line 95 of file ipsec_tun.c.

◆ IPSEC_TUN_PROTECT_DEFAULT_DB_ENTRY

const ipsec_tun_protect_itf_db_t IPSEC_TUN_PROTECT_DEFAULT_DB_ENTRY
static
Initial value:
= {
.id_itp = INDEX_INVALID,
}
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
Definition: dpo.h:47

Definition at line 77 of file ipsec_tun.c.

◆ ipsec_tun_protect_logger

vlib_log_class_t ipsec_tun_protect_logger

The logger.

Definition at line 38 of file ipsec_tun.c.

◆ ipsec_tun_protect_pool

ipsec_tun_protect_t* ipsec_tun_protect_pool

Pool of tunnel protection objects.

Definition at line 43 of file ipsec_tun.c.

◆ ipsec_tun_protect_sa_by_adj_index

index_t* ipsec_tun_protect_sa_by_adj_index

Adj index to TX SA mapping.

Definition at line 53 of file ipsec_tun.c.

◆ ipsec_tun_teib_vft

const teib_vft_t ipsec_tun_teib_vft
static
Initial value:
= {
}
static void ipsec_tun_teib_entry_added(const teib_entry_t *ne)
Definition: ipsec_tun.c:920
static void ipsec_tun_teib_entry_deleted(const teib_entry_t *ne)
Definition: ipsec_tun.c:941

Definition at line 970 of file ipsec_tun.c.

◆ itp_db

ipsec_tun_protect_db_t itp_db
static

Definition at line 75 of file ipsec_tun.c.