FD.io VPP  v20.09-64-g4f7b92f0a
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") \
_(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 36 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 90 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 257 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 74 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 59 of file wireguard_input.c.

+ Here is the call graph for this function:
+ 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 111 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 274 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)
}
#define foreach_wg_input_error

Definition at line 44 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",
},
}
static u8 * format_wg_input_trace(u8 *s, va_list *args)
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
#define ARRAY_LEN(x)
Definition: clib.h:67
static char * wg_input_error_strings[]

(constructor) VLIB_REGISTER_NODE (wg_input_node)

Definition at line 450 of file wireguard_input.c.