FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
wireguard_if.c File Reference
+ Include dependency graph for wireguard_if.c:

Go to the source code of this file.

Macros

#define WG_ITF_MAX_INSTANCE   (16 * 1024)
 

Functions

static u8format_wg_if_name (u8 *s, va_list *args)
 
u8format_wg_if (u8 *s, va_list *args)
 
index_t wg_if_find_by_sw_if_index (u32 sw_if_index)
 
static walk_rc_t wg_if_find_peer_by_public_key (index_t peeri, void *data)
 
static noise_remote_twg_remote_get (const uint8_t public[NOISE_PUBLIC_KEY_LEN])
 
static uint32_t wg_index_set (noise_remote_t *remote)
 
static void wg_index_drop (uint32_t key)
 
static clib_error_twg_if_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
void wg_if_update_adj (vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
 
 VNET_DEVICE_CLASS (wg_if_device_class)
 
 VNET_HW_INTERFACE_CLASS (wg_hw_interface_class)
 
static u32 wg_if_instance_alloc (u32 want)
 
static int wg_if_instance_free (u32 instance)
 
int wg_if_create (u32 user_instance, const u8 private_key[NOISE_PUBLIC_KEY_LEN], u16 port, const ip_address_t *src_ip, u32 *sw_if_indexp)
 
int wg_if_delete (u32 sw_if_index)
 
void wg_if_peer_add (wg_if_t *wgi, index_t peeri)
 
void wg_if_peer_remove (wg_if_t *wgi, index_t peeri)
 
void wg_if_walk (wg_if_walk_cb_t fn, void *data)
 
index_t wg_if_peer_walk (wg_if_t *wgi, wg_if_peer_walk_cb_t fn, void *data)
 
static void wg_if_table_bind_v4 (ip4_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
static void wg_if_table_bind_v6 (ip6_main_t *im, uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index)
 
static clib_error_twg_if_module_init (vlib_main_t *vm)
 

Variables

wg_if_twg_if_pool
 Data-plane exposed functions. More...
 
static uwordwg_if_instances
 
static index_twg_if_index_by_sw_if_index
 
index_twg_if_index_by_port
 

Macro Definition Documentation

◆ WG_ITF_MAX_INSTANCE

#define WG_ITF_MAX_INSTANCE   (16 * 1024)

Definition at line 160 of file wireguard_if.c.

Function Documentation

◆ format_wg_if()

u8* format_wg_if ( u8 s,
va_list *  args 
)

Definition at line 30 of file wireguard_if.c.

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

◆ format_wg_if_name()

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

Definition at line 23 of file wireguard_if.c.

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

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( wg_if_device_class  )
+ Here is the caller graph for this function:

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( wg_hw_interface_class  )
+ Here is the caller graph for this function:

◆ wg_if_admin_up_down()

static clib_error_t* wg_if_admin_up_down ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 118 of file wireguard_if.c.

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

◆ wg_if_create()

int wg_if_create ( u32  user_instance,
const u8  private_key[NOISE_PUBLIC_KEY_LEN],
u16  port,
const ip_address_t src_ip,
u32 sw_if_indexp 
)

Definition at line 224 of file wireguard_if.c.

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

◆ wg_if_delete()

int wg_if_delete ( u32  sw_if_index)

Definition at line 300 of file wireguard_if.c.

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

◆ wg_if_find_by_sw_if_index()

index_t wg_if_find_by_sw_if_index ( u32  sw_if_index)

Definition at line 65 of file wireguard_if.c.

+ Here is the caller graph for this function:

◆ wg_if_find_peer_by_public_key()

static walk_rc_t wg_if_find_peer_by_public_key ( index_t  peeri,
void *  data 
)
static

Definition at line 77 of file wireguard_if.c.

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

◆ wg_if_instance_alloc()

static u32 wg_if_instance_alloc ( u32  want)
static

Definition at line 163 of file wireguard_if.c.

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

◆ wg_if_instance_free()

static int wg_if_instance_free ( u32  instance)
static

Definition at line 206 of file wireguard_if.c.

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

◆ wg_if_module_init()

static clib_error_t* wg_if_module_init ( vlib_main_t vm)
static

Definition at line 420 of file wireguard_if.c.

+ Here is the call graph for this function:

◆ wg_if_peer_add()

void wg_if_peer_add ( wg_if_t wgi,
index_t  peeri 
)

Definition at line 329 of file wireguard_if.c.

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

◆ wg_if_peer_remove()

void wg_if_peer_remove ( wg_if_t wgi,
index_t  peeri 
)

Definition at line 339 of file wireguard_if.c.

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

◆ wg_if_peer_walk()

index_t wg_if_peer_walk ( wg_if_t wgi,
wg_if_peer_walk_cb_t  fn,
void *  data 
)

Definition at line 363 of file wireguard_if.c.

+ Here is the caller graph for this function:

◆ wg_if_table_bind_v4()

static void wg_if_table_bind_v4 ( ip4_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 380 of file wireguard_if.c.

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

◆ wg_if_table_bind_v6()

static void wg_if_table_bind_v6 ( ip6_main_t im,
uword  opaque,
u32  sw_if_index,
u32  new_fib_index,
u32  old_fib_index 
)
static

Definition at line 400 of file wireguard_if.c.

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

◆ wg_if_update_adj()

void wg_if_update_adj ( vnet_main_t vnm,
u32  sw_if_index,
adj_index_t  ai 
)

Definition at line 137 of file wireguard_if.c.

+ Here is the call graph for this function:

◆ wg_if_walk()

void wg_if_walk ( wg_if_walk_cb_t  fn,
void *  data 
)

Definition at line 349 of file wireguard_if.c.

+ Here is the caller graph for this function:

◆ wg_index_drop()

static void wg_index_drop ( uint32_t  key)
static

Definition at line 111 of file wireguard_if.c.

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

◆ wg_index_set()

static uint32_t wg_index_set ( noise_remote_t remote)
static

Definition at line 101 of file wireguard_if.c.

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

◆ wg_remote_get()

static noise_remote_t* wg_remote_get ( const uint8_t  public[NOISE_PUBLIC_KEY_LEN])
static

Definition at line 88 of file wireguard_if.c.

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

Variable Documentation

◆ wg_if_index_by_port

index_t* wg_if_index_by_port

Definition at line 20 of file wireguard_if.c.

◆ wg_if_index_by_sw_if_index

index_t* wg_if_index_by_sw_if_index
static

Definition at line 17 of file wireguard_if.c.

◆ wg_if_instances

uword* wg_if_instances
static

Definition at line 14 of file wireguard_if.c.

◆ wg_if_pool

wg_if_t* wg_if_pool

Data-plane exposed functions.

Definition at line 11 of file wireguard_if.c.