FD.io VPP  v21.10.1-2-g0a485f517
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 175 of file wireguard_if.c.

Function Documentation

◆ format_wg_if()

u8* format_wg_if ( u8 s,
va_list *  args 
)

Definition at line 45 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 38 of file wireguard_if.c.

◆ VNET_DEVICE_CLASS()

VNET_DEVICE_CLASS ( wg_if_device_class  )

◆ VNET_HW_INTERFACE_CLASS()

VNET_HW_INTERFACE_CLASS ( wg_hw_interface_class  )

◆ 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 133 of file wireguard_if.c.

+ Here is the call 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 239 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 322 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 80 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 92 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 178 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 221 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 442 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 351 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 361 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 385 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 402 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 422 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 152 of file wireguard_if.c.

◆ wg_if_walk()

void wg_if_walk ( wg_if_walk_cb_t  fn,
void *  data 
)

Definition at line 371 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 126 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 116 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 103 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 35 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 32 of file wireguard_if.c.

◆ wg_if_instances

uword* wg_if_instances
static

Definition at line 29 of file wireguard_if.c.

◆ wg_if_pool

wg_if_t* wg_if_pool

Data-plane exposed functions.

Definition at line 26 of file wireguard_if.c.