FD.io VPP  v16.06
Vector Packet Processing
ikev2.c File Reference
+ Include dependency graph for ikev2.c:

Go to the source code of this file.

Data Structures

struct  ikev2_trace_t
 

Macros

#define ikev2_set_state(sa, v)
 
#define foreach_ikev2_error
 

Enumerations

enum  ikev2_error_t { IKEV2_N_ERROR }
 
enum  ikev2_next_t { IKEV2_NEXT_IP4_LOOKUP, IKEV2_NEXT_ERROR_DROP, IKEV2_N_NEXT }
 

Functions

static int ikev2_delete_tunnel_interface (vnet_main_t *vnm, ikev2_sa_t *sa, ikev2_child_sa_t *child)
 
static u8format_ikev2_trace (u8 *s, va_list *args)
 
static ikev2_sa_transform_tikev2_find_transform_data (ikev2_sa_transform_t *t)
 
static ikev2_sa_proposal_tikev2_select_proposal (ikev2_sa_proposal_t *proposals, ikev2_protocol_id_t prot_id)
 
ikev2_sa_transform_tikev2_sa_get_td_for_type (ikev2_sa_proposal_t *p, ikev2_transform_type_t type)
 
ikev2_child_sa_tikev2_sa_get_child (ikev2_sa_t *sa, u32 spi, ikev2_protocol_id_t prot_id)
 
void ikev2_sa_free_proposal_vector (ikev2_sa_proposal_t **v)
 
static void ikev2_sa_free_all_child_sa (ikev2_child_sa_t **childs)
 
static void ikev2_sa_del_child_sa (ikev2_sa_t *sa, ikev2_child_sa_t *child)
 
static void ikev2_sa_free_all_vec (ikev2_sa_t *sa)
 
static void ikev2_delete_sa (ikev2_sa_t *sa)
 
static void ikev2_generate_sa_init_data (ikev2_sa_t *sa)
 
static void ikev2_calc_keys (ikev2_sa_t *sa)
 
static void ikev2_calc_child_keys (ikev2_sa_t *sa, ikev2_child_sa_t *child)
 
static void ikev2_process_sa_init_req (vlib_main_t *vm, ikev2_sa_t *sa, ike_header_t *ike)
 
static u8ikev2_decrypt_sk_payload (ikev2_sa_t *sa, ike_header_t *ike, u8 *payload)
 
static void ikev2_initial_contact_cleanup (ikev2_sa_t *sa)
 
static void ikev2_process_auth_req (vlib_main_t *vm, ikev2_sa_t *sa, ike_header_t *ike)
 
static void ikev2_process_informational_req (vlib_main_t *vm, ikev2_sa_t *sa, ike_header_t *ike)
 
static void ikev2_process_create_child_sa_req (vlib_main_t *vm, ikev2_sa_t *sa, ike_header_t *ike)
 
static u8ikev2_sa_generate_authmsg (ikev2_sa_t *sa, int is_responder)
 
static int ikev2_ts_cmp (ikev2_ts_t *ts1, ikev2_ts_t *ts2)
 
static void ikev2_sa_match_ts (ikev2_sa_t *sa)
 
static void ikev2_sa_auth (ikev2_sa_t *sa)
 
static int ikev2_create_tunnel_interface (vnet_main_t *vnm, ikev2_sa_t *sa, ikev2_child_sa_t *child)
 
static u32 ikev2_generate_resp (ikev2_sa_t *sa, ike_header_t *ike)
 
static int ikev2_retransmit_sa_init (ike_header_t *ike, ip4_address_t iaddr, ip4_address_t raddr)
 
static int ikev2_retransmit_resp (ikev2_sa_t *sa, ike_header_t *ike)
 
static uword ikev2_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static ikev2_profile_tikev2_profile_index_by_name (u8 *name)
 
clib_error_tikev2_set_local_key (vlib_main_t *vm, u8 *file)
 
clib_error_tikev2_add_del_profile (vlib_main_t *vm, u8 *name, int is_add)
 
clib_error_tikev2_set_profile_auth (vlib_main_t *vm, u8 *name, u8 auth_method, u8 *auth_data, u8 data_hex_format)
 
clib_error_tikev2_set_profile_id (vlib_main_t *vm, u8 *name, u8 id_type, u8 *data, int is_local)
 
clib_error_tikev2_set_profile_ts (vlib_main_t *vm, u8 *name, u8 protocol_id, u16 start_port, u16 end_port, ip4_address_t start_addr, ip4_address_t end_addr, int is_local)
 
clib_error_tikev2_init (vlib_main_t *vm)
 

Variables

static vlib_node_registration_t ikev2_node
 (constructor) VLIB_REGISTER_NODE (ikev2_node) More...
 
static char * ikev2_error_strings []
 

Macro Definition Documentation

#define foreach_ikev2_error
Value:
_(PROCESSED, "IKEv2 packets processed") \
_(IKE_SA_INIT_RETRANSMIT, "IKE_SA_INIT retransmit ") \
_(IKE_SA_INIT_IGNORE, "IKE_SA_INIT ignore (IKE SA already auth)") \
_(IKE_REQ_RETRANSMIT, "IKE request retransmit") \
_(IKE_REQ_IGNORE, "IKE request ignore (old msgid)") \
_(NOT_IKEV2, "Non IKEv2 packets received")

Definition at line 52 of file ikev2.c.

#define ikev2_set_state (   sa,
 
)
Value:
do { \
(sa)->state = v; \
clib_warning("sa state changed to " #v); \
} while(0);
#define clib_warning(format, args...)
Definition: error.h:59
vhost_vring_state_t state
Definition: vhost-user.h:77

Definition at line 29 of file ikev2.c.

Enumeration Type Documentation

Enumerator
IKEV2_N_ERROR 

Definition at line 60 of file ikev2.c.

Enumerator
IKEV2_NEXT_IP4_LOOKUP 
IKEV2_NEXT_ERROR_DROP 
IKEV2_N_NEXT 

Definition at line 73 of file ikev2.c.

Function Documentation

static u8* format_ikev2_trace ( u8 s,
va_list *  args 
)
static

Definition at line 39 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_add_del_profile ( vlib_main_t vm,
u8 name,
int  is_add 
)

Definition at line 1956 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_calc_child_keys ( ikev2_sa_t sa,
ikev2_child_sa_t child 
)
static

Definition at line 423 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_calc_keys ( ikev2_sa_t sa)
static

Definition at line 349 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ikev2_create_tunnel_interface ( vnet_main_t vnm,
ikev2_sa_t sa,
ikev2_child_sa_t child 
)
static

Definition at line 1152 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* ikev2_decrypt_sk_payload ( ikev2_sa_t sa,
ike_header_t *  ike,
u8 payload 
)
static

Definition at line 539 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_delete_sa ( ikev2_sa_t sa)
static

Definition at line 292 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ikev2_delete_tunnel_interface ( vnet_main_t vnm,
ikev2_sa_t sa,
ikev2_child_sa_t child 
)
static

Definition at line 1262 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ikev2_sa_transform_t* ikev2_find_transform_data ( ikev2_sa_transform_t t)
static

Definition at line 80 of file ikev2.c.

+ Here is the caller graph for this function:

static u32 ikev2_generate_resp ( ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 1279 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_generate_sa_init_data ( ikev2_sa_t sa)
static

Definition at line 308 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_init ( vlib_main_t vm)

Definition at line 2091 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_initial_contact_cleanup ( ikev2_sa_t sa)
static

Definition at line 600 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword ikev2_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 1613 of file ikev2.c.

+ Here is the call graph for this function:

static void ikev2_process_auth_req ( vlib_main_t vm,
ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 634 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_process_create_child_sa_req ( vlib_main_t vm,
ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 827 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_process_informational_req ( vlib_main_t vm,
ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 757 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_process_sa_init_req ( vlib_main_t vm,
ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 467 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ikev2_profile_t* ikev2_profile_index_by_name ( u8 name)
static

Definition at line 1931 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ikev2_retransmit_resp ( ikev2_sa_t sa,
ike_header_t *  ike 
)
static

Definition at line 1570 of file ikev2.c.

+ Here is the caller graph for this function:

static int ikev2_retransmit_sa_init ( ike_header_t *  ike,
ip4_address_t  iaddr,
ip4_address_t  raddr 
)
static

Definition at line 1502 of file ikev2.c.

+ Here is the caller graph for this function:

static void ikev2_sa_auth ( ikev2_sa_t sa)
static

Definition at line 1052 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_sa_del_child_sa ( ikev2_sa_t sa,
ikev2_child_sa_t child 
)
static

Definition at line 249 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_sa_free_all_child_sa ( ikev2_child_sa_t **  childs)
static

Definition at line 232 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_sa_free_all_vec ( ikev2_sa_t sa)
static

Definition at line 262 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ikev2_sa_free_proposal_vector ( ikev2_sa_proposal_t **  v)

Definition at line 214 of file ikev2.c.

+ Here is the caller graph for this function:

static u8* ikev2_sa_generate_authmsg ( ikev2_sa_t sa,
int  is_responder 
)
static

Definition at line 947 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ikev2_child_sa_t* ikev2_sa_get_child ( ikev2_sa_t sa,
u32  spi,
ikev2_protocol_id_t  prot_id 
)

Definition at line 201 of file ikev2.c.

+ Here is the caller graph for this function:

ikev2_sa_transform_t* ikev2_sa_get_td_for_type ( ikev2_sa_proposal_t p,
ikev2_transform_type_t  type 
)

Definition at line 185 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void ikev2_sa_match_ts ( ikev2_sa_t sa)
static

Definition at line 1001 of file ikev2.c.

+ Here is the caller graph for this function:

static ikev2_sa_proposal_t* ikev2_select_proposal ( ikev2_sa_proposal_t proposals,
ikev2_protocol_id_t  prot_id 
)
static

Definition at line 107 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_set_local_key ( vlib_main_t vm,
u8 file 
)

Definition at line 1944 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_set_profile_auth ( vlib_main_t vm,
u8 name,
u8  auth_method,
u8 auth_data,
u8  data_hex_format 
)

Definition at line 1986 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_set_profile_id ( vlib_main_t vm,
u8 name,
u8  id_type,
u8 data,
int  is_local 
)

Definition at line 2016 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* ikev2_set_profile_ts ( vlib_main_t vm,
u8 name,
u8  protocol_id,
u16  start_port,
u16  end_port,
ip4_address_t  start_addr,
ip4_address_t  end_addr,
int  is_local 
)

Definition at line 2053 of file ikev2.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int ikev2_ts_cmp ( ikev2_ts_t ts1,
ikev2_ts_t ts2 
)
static

Definition at line 989 of file ikev2.c.

Variable Documentation

char* ikev2_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_ikev2_error
Definition: ikev2.c:52

Definition at line 67 of file ikev2.c.

vlib_node_registration_t ikev2_node
static
Initial value:
= {
.function = ikev2_node_fn,
.name = "ikev2",
.vector_size = sizeof (u32),
.format_trace = format_ikev2_trace,
.error_strings = ikev2_error_strings,
.n_next_nodes = IKEV2_N_NEXT,
.next_nodes = {
[IKEV2_NEXT_IP4_LOOKUP] = "ip4-lookup",
[IKEV2_NEXT_ERROR_DROP] = "error-drop",
},
}
static u8 * format_ikev2_trace(u8 *s, va_list *args)
Definition: ikev2.c:39
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static uword ikev2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ikev2.c:1613
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
static char * ikev2_error_strings[]
Definition: ikev2.c:67

(constructor) VLIB_REGISTER_NODE (ikev2_node)

Definition at line 50 of file ikev2.c.