FD.io VPP  v21.10.1-2-g0a485f517
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)
 
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_feature_update (u32 sw_if_index, u8 arc_index, u8 is_enable, void *data)
 
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)
 
static clib_error_tipsec_tunnel_protect_init (vlib_main_t *vm)
 

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
 
const static ipsec_tun_protect_itf_db_t IPSEC_TUN_PROTECT_DEFAULT_DB_ENTRY
 
static u32 ipsec_tun_node_regs [N_AF]
 
const static adj_delegate_vft_t ipsec_tun_adj_delegate_vft
 VFT registered with the adjacency delegate. More...
 
const static 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); \
}

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); \
}

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_tun_feature_update()

static void ipsec_tun_feature_update ( u32  sw_if_index,
u8  arc_index,
u8  is_enable,
void *  data 
)
static

Definition at line 782 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ Here is the caller 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 190 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 299 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 840 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 825 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 833 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 862 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 413 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 492 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 714 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 209 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 231 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 370 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 464 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 313 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 427 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 523 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 564 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 548 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 746 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 759 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 929 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 873 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 894 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()

static clib_error_t* ipsec_tunnel_protect_init ( vlib_main_t vm)
static

Definition at line 944 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 static adj_delegate_vft_t ipsec_tun_adj_delegate_vft
static
Initial value:

VFT registered with the adjacency delegate.

Definition at line 916 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 static ipsec_tun_protect_itf_db_t IPSEC_TUN_PROTECT_DEFAULT_DB_ENTRY
static
Initial value:
= {
.id_itp = INDEX_INVALID,
}

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 static teib_vft_t ipsec_tun_teib_vft
static
Initial value:
= {
}

Definition at line 923 of file ipsec_tun.c.

◆ itp_db

ipsec_tun_protect_db_t itp_db
static

Definition at line 75 of file ipsec_tun.c.

ipsec_tun_protect_adj_delegate_adj_deleted
static void ipsec_tun_protect_adj_delegate_adj_deleted(adj_delegate_t *ad)
Definition: ipsec_tun.c:825
ipsec_tun_protect_adj_delegate_adj_modified
static void ipsec_tun_protect_adj_delegate_adj_modified(adj_delegate_t *ad)
Definition: ipsec_tun.c:833
ipsec_tun_teib_entry_deleted
static void ipsec_tun_teib_entry_deleted(const teib_entry_t *ne)
Definition: ipsec_tun.c:894
ipsec_tun_protect_adj_delegate_adj_created
static void ipsec_tun_protect_adj_delegate_adj_created(adj_index_t ai)
Definition: ipsec_tun.c:840
format_ipsec_tun_protect
u8 * format_ipsec_tun_protect(u8 *s, va_list *args)
Definition: ipsec_format.c:355
ipsec_tun_protect_adj_delegate_format
static u8 * ipsec_tun_protect_adj_delegate_format(const adj_delegate_t *aed, u8 *s)
Definition: ipsec_tun.c:862
ipsec_tun_protect_logger
vlib_log_class_t ipsec_tun_protect_logger
The logger.
Definition: ipsec_tun.c:38
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:49
ipsec_tun_teib_entry_added
static void ipsec_tun_teib_entry_added(const teib_entry_t *ne)
Definition: ipsec_tun.c:873