FD.io VPP  v21.01.1
Vector Packet Processing
ipsec_tun.h File Reference
+ Include dependency graph for ipsec_tun.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ipsec_tun_lkup_result_t_
 result of a lookup in the protection bihash More...
 
struct  ipsec4_tunnel_kv_t
 
struct  ipsec6_tunnel_kv_t_
 
struct  ipsec_ep_t_
 
struct  ipsec_tun_protect_t_
 

Macros

#define foreach_ipsec_protect_flags
 
#define ITP_MAX_N_SA_IN   4
 
#define FOR_EACH_IPSEC_PROTECT_INPUT_SAI(_itp, _sai, body)
 
#define FOR_EACH_IPSEC_PROTECT_INPUT_SA(_itp, _sa, body)
 

Typedefs

typedef enum ipsec_protect_flags_t_ ipsec_protect_flags_t
 
typedef struct ipsec_tun_lkup_result_t_ ipsec_tun_lkup_result_t
 result of a lookup in the protection bihash More...
 
typedef struct ipsec4_tunnel_kv_t ipsec4_tunnel_kv_t
 
typedef struct ipsec6_tunnel_kv_t_ ipsec6_tunnel_kv_t
 
typedef struct ipsec_ep_t_ ipsec_ep_t
 
typedef struct ipsec_tun_protect_t_ ipsec_tun_protect_t
 
typedef walk_rc_t(* ipsec_tun_protect_walk_cb_t) (index_t itpi, void *arg)
 

Enumerations

enum  ipsec_protect_flags_t_ { IPSEC_PROTECT_NONE = 0, foreach_ipsec_protect_flags }
 

Functions

u8format_ipsec_tun_protect_flags (u8 *s, va_list *args)
 
 STATIC_ASSERT_SIZEOF (ipsec4_tunnel_kv_t, sizeof(clib_bihash_kv_8_16_t))
 
 STATIC_ASSERT_OFFSET_OF (ipsec4_tunnel_kv_t, value, STRUCT_OFFSET_OF(clib_bihash_kv_8_16_t, value))
 
static void ipsec4_tunnel_mk_key (ipsec4_tunnel_kv_t *k, const ip4_address_t *ip, u32 spi)
 
static void ipsec4_tunnel_extract_key (const ipsec4_tunnel_kv_t *k, ip4_address_t *ip, u32 *spi)
 
 STATIC_ASSERT_SIZEOF (ipsec6_tunnel_kv_t, sizeof(clib_bihash_kv_24_16_t))
 
 STATIC_ASSERT_OFFSET_OF (ipsec6_tunnel_kv_t, value, STRUCT_OFFSET_OF(clib_bihash_kv_24_16_t, value))
 
u8format_ipsec4_tunnel_kv (u8 *s, va_list *args)
 
u8format_ipsec6_tunnel_kv (u8 *s, va_list *args)
 
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 (u32 sw_if_index, const ip_address_t *nh, u32 sa_out, u32 *sa_ins)
 
int ipsec_tun_protect_update_in (u32 sw_if_index, const ip_address_t *nh, 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_del (u32 sw_if_index, const ip_address_t *nh)
 
void ipsec_tun_protect_walk (ipsec_tun_protect_walk_cb_t fn, void *cttx)
 
void ipsec_tun_protect_walk_itf (u32 sw_if_index, ipsec_tun_protect_walk_cb_t fn, void *cttx)
 
u8format_ipsec_tun_protect (u8 *s, va_list *args)
 
u8format_ipsec_tun_protect_index (u8 *s, va_list *args)
 
void ipsec_tun_register_nodes (ip_address_family_t af)
 
void ipsec_tun_unregister_nodes (ip_address_family_t af)
 
void ipsec_tun_table_init (ip_address_family_t af, uword table_size, u32 n_buckets)
 
static ipsec_tun_protect_tipsec_tun_protect_get (u32 index)
 
static index_t ipsec_tun_protect_get_sa_out (adj_index_t ai)
 

Variables

vlib_node_registration_t ipsec4_tun_input_node
 (constructor) VLIB_REGISTER_NODE (ipsec4_tun_input_node) More...
 
vlib_node_registration_t ipsec6_tun_input_node
 (constructor) VLIB_REGISTER_NODE (ipsec6_tun_input_node) More...
 
ipsec_tun_protect_tipsec_tun_protect_pool
 Pool of tunnel protection objects. More...
 
index_tipsec_tun_protect_sa_by_adj_index
 Adj index to TX SA mapping. More...
 

Macro Definition Documentation

◆ FOR_EACH_IPSEC_PROTECT_INPUT_SA

#define FOR_EACH_IPSEC_PROTECT_INPUT_SA (   _itp,
  _sa,
  body 
)
Value:
{ \
u32 __ii; \
for (__ii = 0; __ii < _itp->itp_n_sa_in; __ii++) { \
_sa = ipsec_sa_get(itp->itp_in_sas[__ii]); \
body; \
} \
}
static ipsec_sa_t * ipsec_sa_get(u32 sa_index)
Definition: ipsec.h:290

Definition at line 137 of file ipsec_tun.h.

◆ FOR_EACH_IPSEC_PROTECT_INPUT_SAI

#define FOR_EACH_IPSEC_PROTECT_INPUT_SAI (   _itp,
  _sai,
  body 
)
Value:
{ \
u32 __ii; \
for (__ii = 0; __ii < _itp->itp_n_sa_in; __ii++) { \
_sai = itp->itp_in_sas[__ii]; \
body; \
} \
}

Definition at line 129 of file ipsec_tun.h.

◆ foreach_ipsec_protect_flags

#define foreach_ipsec_protect_flags
Value:
_(L2, 1, "l2") \
_(ENCAPED, 2, "encapped") \
_(ITF, 4, "itf") \

Definition at line 20 of file ipsec_tun.h.

◆ ITP_MAX_N_SA_IN

#define ITP_MAX_N_SA_IN   4

Definition at line 104 of file ipsec_tun.h.

Typedef Documentation

◆ ipsec4_tunnel_kv_t

◆ ipsec6_tunnel_kv_t

◆ ipsec_ep_t

typedef struct ipsec_ep_t_ ipsec_ep_t

◆ ipsec_protect_flags_t

◆ ipsec_tun_lkup_result_t

result of a lookup in the protection bihash

◆ ipsec_tun_protect_t

◆ ipsec_tun_protect_walk_cb_t

typedef walk_rc_t(* ipsec_tun_protect_walk_cb_t) (index_t itpi, void *arg)

Definition at line 159 of file ipsec_tun.h.

Enumeration Type Documentation

◆ ipsec_protect_flags_t_

Enumerator
IPSEC_PROTECT_NONE 
foreach_ipsec_protect_flags 

Definition at line 25 of file ipsec_tun.h.

Function Documentation

◆ format_ipsec4_tunnel_kv()

u8* format_ipsec4_tunnel_kv ( u8 s,
va_list *  args 
)

Definition at line 402 of file ipsec_format.c.

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

◆ format_ipsec6_tunnel_kv()

u8* format_ipsec6_tunnel_kv ( u8 s,
va_list *  args 
)

Definition at line 420 of file ipsec_format.c.

+ Here is the caller graph for this function:

◆ format_ipsec_tun_protect()

u8* format_ipsec_tun_protect ( u8 s,
va_list *  args 
)

Definition at line 376 of file ipsec_format.c.

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

◆ format_ipsec_tun_protect_flags()

u8* format_ipsec_tun_protect_flags ( u8 s,
va_list *  args 
)

Definition at line 360 of file ipsec_format.c.

+ Here is the caller graph for this function:

◆ format_ipsec_tun_protect_index()

u8* format_ipsec_tun_protect_index ( u8 s,
va_list *  args 
)

Definition at line 346 of file ipsec_format.c.

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

◆ ipsec4_tunnel_extract_key()

static void ipsec4_tunnel_extract_key ( const ipsec4_tunnel_kv_t k,
ip4_address_t ip,
u32 spi 
)
inlinestatic

Definition at line 69 of file ipsec_tun.h.

+ Here is the caller graph for this function:

◆ ipsec4_tunnel_mk_key()

static void ipsec4_tunnel_mk_key ( ipsec4_tunnel_kv_t k,
const ip4_address_t ip,
u32  spi 
)
inlinestatic

Definition at line 62 of file ipsec_tun.h.

+ 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_get()

static ipsec_tun_protect_t* ipsec_tun_protect_get ( u32  index)
inlinestatic

Definition at line 185 of file ipsec_tun.h.

+ Here is the caller graph for this function:

◆ ipsec_tun_protect_get_sa_out()

static index_t ipsec_tun_protect_get_sa_out ( adj_index_t  ai)
inlinestatic

Definition at line 192 of file ipsec_tun.h.

+ 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 sa_ins 
)

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_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 *  cttx 
)

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 *  cttx 
)

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_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:

◆ STATIC_ASSERT_OFFSET_OF() [1/2]

STATIC_ASSERT_OFFSET_OF ( ipsec4_tunnel_kv_t  ,
value  ,
STRUCT_OFFSET_OF(clib_bihash_kv_8_16_t, value  
)

◆ STATIC_ASSERT_OFFSET_OF() [2/2]

STATIC_ASSERT_OFFSET_OF ( ipsec6_tunnel_kv_t  ,
value  ,
STRUCT_OFFSET_OF(clib_bihash_kv_24_16_t, value  
)

◆ STATIC_ASSERT_SIZEOF() [1/2]

STATIC_ASSERT_SIZEOF ( ipsec4_tunnel_kv_t  ,
sizeof(clib_bihash_kv_8_16_t  
)

◆ STATIC_ASSERT_SIZEOF() [2/2]

STATIC_ASSERT_SIZEOF ( ipsec6_tunnel_kv_t  ,
sizeof(clib_bihash_kv_24_16_t  
)

Variable Documentation

◆ ipsec4_tun_input_node

vlib_node_registration_t ipsec4_tun_input_node

(constructor) VLIB_REGISTER_NODE (ipsec4_tun_input_node)

Definition at line 373 of file ipsec_tun_in.c.

◆ ipsec6_tun_input_node

vlib_node_registration_t ipsec6_tun_input_node

(constructor) VLIB_REGISTER_NODE (ipsec6_tun_input_node)

Definition at line 396 of file ipsec_tun_in.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.