FD.io VPP  v20.05-21-gb1500e9ff
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 (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:358
vlib_log_class_t ipsec_tun_protect_logger
The logger.
Definition: ipsec_tun.c:28

Definition at line 71 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:28

Definition at line 79 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 158 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 245 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 813 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 798 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 806 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 841 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 350 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 421 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 733 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 177 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 121 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 ( const ipsec_tun_protect_t itp)
static

Definition at line 129 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 199 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 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_set_crypto_addr()

static void ipsec_tun_protect_set_crypto_addr ( ipsec_tun_protect_t itp)
static

Definition at line 396 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 256 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 359 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 452 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 598 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 582 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 539 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 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_update_out()

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

Definition at line 490 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 762 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 775 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 88 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 852 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 879 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 105 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 921 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 45 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 38 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:806
static void ipsec_tun_protect_adj_delegate_adj_created(adj_index_t ai)
Definition: ipsec_tun.c:813
static void ipsec_tun_protect_adj_delegate_adj_deleted(adj_delegate_t *ad)
Definition: ipsec_tun.c:798
static u8 * ipsec_tun_protect_adj_delegate_format(const adj_delegate_t *aed, u8 *s)
Definition: ipsec_tun.c:841

VFT registered with the adjacency delegate.

Definition at line 907 of file ipsec_tun.c.

◆ ipsec_tun_node_regs

u32 ipsec_tun_node_regs[N_AF]
static

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

◆ ipsec_tun_protect_logger

vlib_log_class_t ipsec_tun_protect_logger

The logger.

Definition at line 28 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 33 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 43 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:852
static void ipsec_tun_teib_entry_deleted(const teib_entry_t *ne)
Definition: ipsec_tun.c:879

Definition at line 914 of file ipsec_tun.c.

◆ itp_db

ipsec_tun_protect_db_t itp_db
static

Definition at line 65 of file ipsec_tun.c.