FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
wireguard_input.c File Reference
+ Include dependency graph for wireguard_input.c:

Go to the source code of this file.

Data Structures

struct  wg_input_trace_t
 

Macros

#define foreach_wg_input_error
 

Enumerations

enum  wg_input_error_t { WG_INPUT_N_ERROR }
 
enum  wg_input_next_t {
  WG_INPUT_NEXT_HANDOFF_HANDSHAKE, WG_INPUT_NEXT_HANDOFF_DATA, WG_INPUT_NEXT_IP4_INPUT, WG_INPUT_NEXT_PUNT,
  WG_INPUT_NEXT_ERROR, WG_INPUT_N_NEXT
}
 

Functions

u8format_wg_message_type (u8 *s, va_list *args)
 
static u8format_wg_input_trace (u8 *s, va_list *args)
 
static wg_input_error_t wg_handshake_process (vlib_main_t *vm, wg_main_t *wmp, vlib_buffer_t *b)
 
static_always_inline bool fib_prefix_is_cover_addr_4 (const fib_prefix_t *p1, const ip4_address_t *ip4)
 
VLIB_NODE_FN() wg_input_node (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 

Variables

static char * wg_input_error_strings []
 
vlib_node_registration_t wg_input_node
 (constructor) VLIB_REGISTER_NODE (wg_input_node) More...
 

Macro Definition Documentation

◆ foreach_wg_input_error

#define foreach_wg_input_error
Value:
_ (NONE, "No error") \
_ (HANDSHAKE_MAC, "Invalid MAC handshake") \
_ (PEER, "Peer error") \
_ (INTERFACE, "Interface error") \
_ (DECRYPTION, "Failed during decryption") \
_ (KEEPALIVE_SEND, "Failed while sending Keepalive") \
_ (HANDSHAKE_SEND, "Failed while sending Handshake") \
_ (HANDSHAKE_RECEIVE, "Failed while receiving Handshake") \
_ (TOO_BIG, "Packet too big") \
_ (UNDEFINED, "Undefined error")

Definition at line 25 of file wireguard_input.c.

Enumeration Type Documentation

◆ wg_input_error_t

Enumerator
WG_INPUT_N_ERROR 

Definition at line 37 of file wireguard_input.c.

◆ wg_input_next_t

Enumerator
WG_INPUT_NEXT_HANDOFF_HANDSHAKE 
WG_INPUT_NEXT_HANDOFF_DATA 
WG_INPUT_NEXT_IP4_INPUT 
WG_INPUT_NEXT_PUNT 
WG_INPUT_NEXT_ERROR 
WG_INPUT_N_NEXT 

Definition at line 91 of file wireguard_input.c.

Function Documentation

◆ fib_prefix_is_cover_addr_4()

static_always_inline bool fib_prefix_is_cover_addr_4 ( const fib_prefix_t p1,
const ip4_address_t ip4 
)

Definition at line 258 of file wireguard_input.c.

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

◆ format_wg_input_trace()

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

Definition at line 75 of file wireguard_input.c.

+ Here is the call graph for this function:

◆ format_wg_message_type()

u8* format_wg_message_type ( u8 s,
va_list *  args 
)

Definition at line 60 of file wireguard_input.c.

+ Here is the caller graph for this function:

◆ wg_handshake_process()

static wg_input_error_t wg_handshake_process ( vlib_main_t vm,
wg_main_t wmp,
vlib_buffer_t b 
)
static

Definition at line 112 of file wireguard_input.c.

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

◆ wg_input_node()

VLIB_NODE_FN() wg_input_node ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)

Definition at line 275 of file wireguard_input.c.

+ Here is the call graph for this function:

Variable Documentation

◆ wg_input_error_strings

char* wg_input_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 45 of file wireguard_input.c.

◆ wg_input_node

vlib_node_registration_t wg_input_node
Initial value:
=
{
.name = "wg-input",
.vector_size = sizeof (u32),
.format_trace = format_wg_input_trace,
.error_strings = wg_input_error_strings,
.n_next_nodes = WG_INPUT_N_NEXT,
.next_nodes = {
[WG_INPUT_NEXT_HANDOFF_HANDSHAKE] = "wg-handshake-handoff",
[WG_INPUT_NEXT_HANDOFF_DATA] = "wg-input-data-handoff",
[WG_INPUT_NEXT_IP4_INPUT] = "ip4-input-no-checksum",
[WG_INPUT_NEXT_PUNT] = "error-punt",
[WG_INPUT_NEXT_ERROR] = "error-drop",
},
}

(constructor) VLIB_REGISTER_NODE (wg_input_node)

Definition at line 452 of file wireguard_input.c.

WG_INPUT_NEXT_IP4_INPUT
@ WG_INPUT_NEXT_IP4_INPUT
Definition: wireguard_input.c:95
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
WG_INPUT_N_NEXT
@ WG_INPUT_N_NEXT
Definition: wireguard_input.c:98
WG_INPUT_NEXT_ERROR
@ WG_INPUT_NEXT_ERROR
Definition: wireguard_input.c:97
WG_INPUT_NEXT_HANDOFF_DATA
@ WG_INPUT_NEXT_HANDOFF_DATA
Definition: wireguard_input.c:94
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
WG_INPUT_NEXT_HANDOFF_HANDSHAKE
@ WG_INPUT_NEXT_HANDOFF_HANDSHAKE
Definition: wireguard_input.c:93
WG_INPUT_NEXT_PUNT
@ WG_INPUT_NEXT_PUNT
Definition: wireguard_input.c:96
format_wg_input_trace
static u8 * format_wg_input_trace(u8 *s, va_list *args)
Definition: wireguard_input.c:75
u32
unsigned int u32
Definition: types.h:88
foreach_wg_input_error
#define foreach_wg_input_error
Definition: wireguard_input.c:25
wg_input_error_strings
static char * wg_input_error_strings[]
Definition: wireguard_input.c:45
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123