FD.io VPP  v20.09-64-g4f7b92f0a
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 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)
 
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
 
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

◆ 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:373
vlib_log_class_t ipsec_tun_protect_logger
The logger.
Definition: ipsec_tun.c:29

Definition at line 72 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:29

Definition at line 80 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_protect_add_adj()

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

Definition at line 165 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 252 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 852 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 837 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 845 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 874 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 360 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 439 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 769 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 184 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 122 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 130 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 206 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 323 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 411 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 266 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 374 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 470 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 616 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 600 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 557 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 495 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 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_walk()

void ipsec_tun_protect_walk ( ipsec_tun_protect_walk_cb_t  fn,
void *  ctx 
)

Definition at line 801 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 814 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 89 of file ipsec_tun.c.

+ Here is the call graph for this function:
+ 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 885 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 912 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 106 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 954 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 46 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 39 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:845
static void ipsec_tun_protect_adj_delegate_adj_created(adj_index_t ai)
Definition: ipsec_tun.c:852
static void ipsec_tun_protect_adj_delegate_adj_deleted(adj_delegate_t *ad)
Definition: ipsec_tun.c:837
static u8 * ipsec_tun_protect_adj_delegate_format(const adj_delegate_t *aed, u8 *s)
Definition: ipsec_tun.c:874

VFT registered with the adjacency delegate.

Definition at line 940 of file ipsec_tun.c.

◆ ipsec_tun_node_regs

u32 ipsec_tun_node_regs[N_AF]
static

Definition at line 86 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 68 of file ipsec_tun.c.

◆ ipsec_tun_protect_logger

vlib_log_class_t ipsec_tun_protect_logger

The logger.

Definition at line 29 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 34 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 44 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:885
static void ipsec_tun_teib_entry_deleted(const teib_entry_t *ne)
Definition: ipsec_tun.c:912

Definition at line 947 of file ipsec_tun.c.

◆ itp_db

ipsec_tun_protect_db_t itp_db
static

Definition at line 66 of file ipsec_tun.c.