FD.io VPP  v20.05.1-5-g09f167997
Vector Packet Processing
ip6_link.c File Reference
+ Include dependency graph for ip6_link.c:

Go to the source code of this file.

Data Structures

struct  ip6_link_delegate_t_
 
struct  ip6_link_t_
 

Macros

#define FOREACH_IP6_LINK_DELEGATE(_ild, _il, body)
 
#define FOREACH_IP6_LINK_DELEGATE_ID(_id)   for (_id = 0; _id < il_delegate_id; _id++)
 
#define IP6_LINK_DBG(...)   vlib_log_debug (ip6_link_logger, __VA_ARGS__);
 
#define IP6_LINK_INFO(...)   vlib_log_notice (ip6_link_logger, __VA_ARGS__);
 

Typedefs

typedef struct ip6_link_delegate_t_ ip6_link_delegate_t
 
typedef struct ip6_link_t_ ip6_link_t
 

Functions

static bool ip6_link_delegate_is_init (const ip6_link_delegate_t *ild)
 
static bool ip6_link_is_enabled_i (const ip6_link_t *il)
 
static void ip6_link_local_address_from_mac (ip6_address_t *ip, const u8 *mac)
 
static void ip6_mac_address_from_link_local (u8 *mac, const ip6_address_t *ip)
 
static ip6_link_tip6_link_get (u32 sw_if_index)
 
bool ip6_link_is_enabled (u32 sw_if_index)
 
int ip6_link_enable (u32 sw_if_index, const ip6_address_t *link_local_addr)
 IPv6 Configuration on an interface. More...
 
static void ip6_link_delegate_flush (ip6_link_t *il)
 
static void ip6_link_last_lock_gone (ip6_link_t *il)
 
static void ip6_link_unlock (ip6_link_t *il)
 
int ip6_link_disable (u32 sw_if_index)
 
const ip6_address_t * ip6_get_link_local_address (u32 sw_if_index)
 
adj_index_t ip6_link_get_mcast_adj (u32 sw_if_index)
 
int ip6_src_address_for_packet (u32 sw_if_index, const ip6_address_t *dst, ip6_address_t *src)
 
int ip6_link_set_local_address (u32 sw_if_index, const ip6_address_t *address)
 
ip6_link_delegate_id_t ip6_link_delegate_register (const ip6_link_delegate_vft_t *vft)
 
index_t ip6_link_delegate_get (u32 sw_if_index, ip6_link_delegate_id_t id)
 
bool ip6_link_delegate_update (u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
 
void ip6_link_delegate_remove (u32 sw_if_index, ip6_link_delegate_id_t id, index_t ii)
 
static void ip6_link_add_del_address (ip6_main_t *im, uword opaque, u32 sw_if_index, ip6_address_t *address, u32 address_length, u32 if_address_index, u32 is_delete)
 
static clib_error_tip6_link_interface_add_del (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (ip6_link_interface_add_del)
 
static clib_error_tip6_link_init (vlib_main_t *vm)
 
static clib_error_ttest_ip6_link_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static u8ip6_print_addrs (u8 *s, u32 *addrs)
 
static u8format_ip6_link (u8 *s, va_list *arg)
 
static clib_error_tip6_link_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tenable_ip6_interface_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdisable_ip6_interface_cmd (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static const ip6_link_delegate_t ip6_link_delegate_uninit
 
static ip6_link_delegate_id_t il_delegate_id
 last used delegate ID More...
 
static ip6_link_delegate_vft_til_delegate_vfts
 VFT registered per-delegate type. More...
 
static ip6_link_tip6_links
 Per interface configs. More...
 
static u64 il_randomizer
 Randomizer. More...
 
static vlib_log_class_t ip6_link_logger
 Logging. More...
 
static vlib_cli_command_t test_link_command
 (constructor) VLIB_CLI_COMMAND (test_link_command) More...
 
static vlib_cli_command_t ip6_link_show_command
 (constructor) VLIB_CLI_COMMAND (ip6_link_show_command) More...
 
static vlib_cli_command_t enable_ip6_interface_command
 (constructor) VLIB_CLI_COMMAND (enable_ip6_interface_command) More...
 
static vlib_cli_command_t disable_ip6_interface_command
 (constructor) VLIB_CLI_COMMAND (disable_ip6_interface_command) More...
 

Macro Definition Documentation

◆ FOREACH_IP6_LINK_DELEGATE

#define FOREACH_IP6_LINK_DELEGATE (   _ild,
  _il,
  body 
)
Value:
{ \
if (NULL != _il) { \
vec_foreach (_ild, _il->il_delegates) { \
body; \
} \
} \
}

Definition at line 52 of file ip6_link.c.

◆ FOREACH_IP6_LINK_DELEGATE_ID

#define FOREACH_IP6_LINK_DELEGATE_ID (   _id)    for (_id = 0; _id < il_delegate_id; _id++)

Definition at line 62 of file ip6_link.c.

◆ IP6_LINK_DBG

#define IP6_LINK_DBG (   ...)    vlib_log_debug (ip6_link_logger, __VA_ARGS__);

Definition at line 80 of file ip6_link.c.

◆ IP6_LINK_INFO

#define IP6_LINK_INFO (   ...)    vlib_log_notice (ip6_link_logger, __VA_ARGS__);

Definition at line 83 of file ip6_link.c.

Typedef Documentation

◆ ip6_link_delegate_t

◆ ip6_link_t

typedef struct ip6_link_t_ ip6_link_t

Function Documentation

◆ disable_ip6_interface_cmd()

static clib_error_t* disable_ip6_interface_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 828 of file ip6_link.c.

+ Here is the call graph for this function:

◆ enable_ip6_interface_cmd()

static clib_error_t* enable_ip6_interface_cmd ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 788 of file ip6_link.c.

+ Here is the call graph for this function:

◆ format_ip6_link()

static u8* format_ip6_link ( u8 s,
va_list *  arg 
)
static

Definition at line 624 of file ip6_link.c.

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

◆ ip6_get_link_local_address()

const ip6_address_t* ip6_get_link_local_address ( u32  sw_if_index)

Definition at line 315 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_add_del_address()

static void ip6_link_add_del_address ( ip6_main_t im,
uword  opaque,
u32  sw_if_index,
ip6_address_t *  address,
u32  address_length,
u32  if_address_index,
u32  is_delete 
)
static

Definition at line 480 of file ip6_link.c.

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

◆ ip6_link_delegate_flush()

static void ip6_link_delegate_flush ( ip6_link_t il)
static

Definition at line 246 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_delegate_get()

index_t ip6_link_delegate_get ( u32  sw_if_index,
ip6_link_delegate_id_t  id 
)

Definition at line 423 of file ip6_link.c.

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

◆ ip6_link_delegate_is_init()

static bool ip6_link_delegate_is_init ( const ip6_link_delegate_t ild)
static

Definition at line 87 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_delegate_register()

ip6_link_delegate_id_t ip6_link_delegate_register ( const ip6_link_delegate_vft_t vft)

Definition at line 409 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_delegate_remove()

void ip6_link_delegate_remove ( u32  sw_if_index,
ip6_link_delegate_id_t  id,
index_t  ii 
)

Definition at line 461 of file ip6_link.c.

+ Here is the call graph for this function:

◆ ip6_link_delegate_update()

bool ip6_link_delegate_update ( u32  sw_if_index,
ip6_link_delegate_id_t  id,
index_t  ii 
)

Definition at line 441 of file ip6_link.c.

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

◆ ip6_link_disable()

int ip6_link_disable ( u32  sw_if_index)

Definition at line 297 of file ip6_link.c.

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

◆ ip6_link_enable()

int ip6_link_enable ( u32  sw_if_index,
const ip6_address_t *  link_local_addr 
)

IPv6 Configuration on an interface.

Definition at line 149 of file ip6_link.c.

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

◆ ip6_link_get()

static ip6_link_t* ip6_link_get ( u32  sw_if_index)
static

Definition at line 126 of file ip6_link.c.

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

◆ ip6_link_get_mcast_adj()

adj_index_t ip6_link_get_mcast_adj ( u32  sw_if_index)

Definition at line 327 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_init()

static clib_error_t* ip6_link_init ( vlib_main_t vm)
static

Definition at line 547 of file ip6_link.c.

+ Here is the call graph for this function:

◆ ip6_link_interface_add_del()

static clib_error_t* ip6_link_interface_add_del ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 524 of file ip6_link.c.

+ Here is the call graph for this function:

◆ ip6_link_is_enabled()

bool ip6_link_is_enabled ( u32  sw_if_index)

Definition at line 142 of file ip6_link.c.

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

◆ ip6_link_is_enabled_i()

static bool ip6_link_is_enabled_i ( const ip6_link_t il)
static

Definition at line 93 of file ip6_link.c.

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

◆ ip6_link_last_lock_gone()

static void ip6_link_last_lock_gone ( ip6_link_t il)
static

Definition at line 262 of file ip6_link.c.

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

◆ ip6_link_local_address_from_mac()

static void ip6_link_local_address_from_mac ( ip6_address_t *  ip,
const u8 mac 
)
static

Definition at line 99 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_link_set_local_address()

int ip6_link_set_local_address ( u32  sw_if_index,
const ip6_address_t *  address 
)

Definition at line 372 of file ip6_link.c.

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

◆ ip6_link_show()

static clib_error_t* ip6_link_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 711 of file ip6_link.c.

+ Here is the call graph for this function:

◆ ip6_link_unlock()

static void ip6_link_unlock ( ip6_link_t il)
static

Definition at line 285 of file ip6_link.c.

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

◆ ip6_mac_address_from_link_local()

static void ip6_mac_address_from_link_local ( u8 mac,
const ip6_address_t *  ip 
)
static

Definition at line 114 of file ip6_link.c.

+ Here is the caller graph for this function:

◆ ip6_print_addrs()

static u8* ip6_print_addrs ( u8 s,
u32 addrs 
)
static

Definition at line 604 of file ip6_link.c.

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

◆ ip6_src_address_for_packet()

int ip6_src_address_for_packet ( u32  sw_if_index,
const ip6_address_t *  dst,
ip6_address_t *  src 
)

Definition at line 337 of file ip6_link.c.

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

◆ test_ip6_link_command_fn()

static clib_error_t* test_ip6_link_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 565 of file ip6_link.c.

+ Here is the call graph for this function:

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( ip6_link_interface_add_del  )
+ Here is the caller graph for this function:

Variable Documentation

◆ disable_ip6_interface_command

vlib_cli_command_t disable_ip6_interface_command
static
Initial value:
=
{
.path = "disable ip6 interface",
.short_help = "disable ip6 interface <interface>",
}

(constructor) VLIB_CLI_COMMAND (disable_ip6_interface_command)

Definition at line 859 of file ip6_link.c.

◆ enable_ip6_interface_command

vlib_cli_command_t enable_ip6_interface_command
static
Initial value:
=
{
.path = "enable ip6 interface",
.short_help = "enable ip6 interface <interface>",
}

(constructor) VLIB_CLI_COMMAND (enable_ip6_interface_command)

Definition at line 819 of file ip6_link.c.

◆ il_delegate_id

ip6_link_delegate_id_t il_delegate_id
static

last used delegate ID

Definition at line 66 of file ip6_link.c.

◆ il_delegate_vfts

ip6_link_delegate_vft_t* il_delegate_vfts
static

VFT registered per-delegate type.

Definition at line 69 of file ip6_link.c.

◆ il_randomizer

u64 il_randomizer
static

Randomizer.

Definition at line 75 of file ip6_link.c.

◆ ip6_link_delegate_uninit

const ip6_link_delegate_t ip6_link_delegate_uninit
static
Initial value:
= {
.ild_sw_if_index = ~0,
}

Definition at line 30 of file ip6_link.c.

◆ ip6_link_logger

vlib_log_class_t ip6_link_logger
static

Logging.

Definition at line 78 of file ip6_link.c.

◆ ip6_link_show_command

vlib_cli_command_t ip6_link_show_command
static
Initial value:
=
{
.path = "show ip6 interface",
.function = ip6_link_show,
.short_help = "show ip6 interface <interface>",
}

(constructor) VLIB_CLI_COMMAND (ip6_link_show_command)

Definition at line 779 of file ip6_link.c.

◆ ip6_links

ip6_link_t* ip6_links
static

Per interface configs.

Definition at line 72 of file ip6_link.c.

◆ test_link_command

vlib_cli_command_t test_link_command
static
Initial value:
=
{
.path = "test ip6 link",
.short_help = "test ip6 link <mac-address>",
}

(constructor) VLIB_CLI_COMMAND (test_link_command)

Definition at line 595 of file ip6_link.c.