FD.io VPP  v21.01.1
Vector Packet Processing
interface.c File Reference

Loopback Interfaces. More...

+ Include dependency graph for interface.c:

Go to the source code of this file.

Macros

#define LOOPBACK_MAX_INSTANCE   (16 * 1024)
 

Functions

static const u8ethernet_ip4_mcast_dst_addr (void)
 
static const u8ethernet_ip6_mcast_dst_addr (void)
 
u8ethernet_build_rewrite (vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
 build a rewrite string to use for sending packets of type 'link_type' to 'dst_address' More...
 
void ethernet_update_adjacency (vnet_main_t *vnm, u32 sw_if_index, u32 ai)
 
static void ethernet_interface_address_copy (ethernet_interface_address_t *dst, const u8 *mac)
 
static void ethernet_set_mac (vnet_hw_interface_t *hi, ethernet_interface_t *ei, const u8 *mac_address)
 
static clib_error_tethernet_mac_change (vnet_hw_interface_t *hi, const u8 *old_address, const u8 *mac_address)
 
 VNET_HW_INTERFACE_CLASS (ethernet_hw_interface_class)
 
uword unformat_ethernet_interface (unformat_input_t *input, va_list *args)
 
clib_error_tethernet_register_interface (vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, const u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
 
void ethernet_delete_interface (vnet_main_t *vnm, u32 hw_if_index)
 
u32 ethernet_set_flags (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static uword simulated_ethernet_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 Echo packets back to ethernet/l2-input. More...
 
static u8format_simulated_ethernet_name (u8 *s, va_list *args)
 
static clib_error_tsimulated_ethernet_admin_up_down (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 
static clib_error_tsimulated_ethernet_mac_change (vnet_hw_interface_t *hi, const u8 *old_address, const u8 *mac_address)
 
 VNET_DEVICE_CLASS (ethernet_simulated_device_class)
 
static u32 loopback_instance_alloc (u8 is_specified, u32 want)
 
static int loopback_instance_free (u32 instance)
 
int vnet_create_loopback_interface (u32 *sw_if_indexp, u8 *mac_address, u8 is_specified, u32 user_instance)
 
static clib_error_tcreate_simulated_ethernet_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
ethernet_interface_tethernet_get_interface (ethernet_main_t *em, u32 hw_if_index)
 
mac_address_tethernet_interface_add_del_address (ethernet_main_t *em, u32 hw_if_index, const u8 *address, u8 is_add)
 
int vnet_delete_loopback_interface (u32 sw_if_index)
 
int vnet_create_sub_interface (u32 sw_if_index, u32 id, u32 flags, u16 inner_vlan_id, u16 outer_vlan_id, u32 *sub_sw_if_index)
 
int vnet_delete_sub_interface (u32 sw_if_index)
 
static clib_error_tdelete_simulated_ethernet_interfaces (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tdelete_sub_interface (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tethernet_config (vlib_main_t *vm, unformat_input_t *input)
 

Variables

static vlib_cli_command_t create_simulated_ethernet_interface_command
 (constructor) VLIB_CLI_COMMAND (create_simulated_ethernet_interface_command) More...
 
static vlib_cli_command_t create_loopback_interface_command
 (constructor) VLIB_CLI_COMMAND (create_loopback_interface_command) More...
 
static vlib_cli_command_t delete_simulated_ethernet_interface_command
 (constructor) VLIB_CLI_COMMAND (delete_simulated_ethernet_interface_command) More...
 
static vlib_cli_command_t delete_loopback_interface_command
 (constructor) VLIB_CLI_COMMAND (delete_loopback_interface_command) More...
 
static vlib_cli_command_t delete_sub_interface_command
 (constructor) VLIB_CLI_COMMAND (delete_sub_interface_command) More...
 

Detailed Description

Loopback Interfaces.

This file contains code to manage loopback interfaces.

Definition in file interface.c.

Macro Definition Documentation

◆ LOOPBACK_MAX_INSTANCE

#define LOOPBACK_MAX_INSTANCE   (16 * 1024)

Definition at line 761 of file interface.c.

Function Documentation

◆ create_simulated_ethernet_interfaces()

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

Definition at line 910 of file interface.c.

+ Here is the call graph for this function:

◆ delete_simulated_ethernet_interfaces()

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

Definition at line 1124 of file interface.c.

+ Here is the call graph for this function:

◆ delete_sub_interface()

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

Definition at line 1153 of file interface.c.

+ Here is the call graph for this function:

◆ ethernet_build_rewrite()

u8* ethernet_build_rewrite ( vnet_main_t vnm,
u32  sw_if_index,
vnet_link_t  link_type,
const void *  dst_address 
)

build a rewrite string to use for sending packets of type 'link_type' to 'dst_address'

Definition at line 83 of file interface.c.

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

◆ ethernet_config()

static clib_error_t* ethernet_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1239 of file interface.c.

+ Here is the call graph for this function:

◆ ethernet_delete_interface()

void ethernet_delete_interface ( vnet_main_t vnm,
u32  hw_if_index 
)

Definition at line 393 of file interface.c.

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

◆ ethernet_get_interface()

ethernet_interface_t* ethernet_get_interface ( ethernet_main_t em,
u32  hw_if_index 
)

Definition at line 982 of file interface.c.

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

◆ ethernet_interface_add_del_address()

mac_address_t* ethernet_interface_add_del_address ( ethernet_main_t em,
u32  hw_if_index,
const u8 address,
u8  is_add 
)

Definition at line 992 of file interface.c.

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

◆ ethernet_interface_address_copy()

static void ethernet_interface_address_copy ( ethernet_interface_address_t dst,
const u8 mac 
)
static

Definition at line 272 of file interface.c.

+ Here is the caller graph for this function:

◆ ethernet_ip4_mcast_dst_addr()

static const u8* ethernet_ip4_mcast_dst_addr ( void  )
static

Definition at line 59 of file interface.c.

+ Here is the caller graph for this function:

◆ ethernet_ip6_mcast_dst_addr()

static const u8* ethernet_ip6_mcast_dst_addr ( void  )
static

Definition at line 69 of file interface.c.

+ Here is the caller graph for this function:

◆ ethernet_mac_change()

static clib_error_t* ethernet_mac_change ( vnet_hw_interface_t hi,
const u8 old_address,
const u8 mac_address 
)
static

Definition at line 293 of file interface.c.

+ Here is the call graph for this function:

◆ ethernet_register_interface()

clib_error_t* ethernet_register_interface ( vnet_main_t vnm,
u32  dev_class_index,
u32  dev_instance,
const u8 address,
u32 hw_if_index_return,
ethernet_flag_change_function_t  flag_change 
)

Definition at line 348 of file interface.c.

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

◆ ethernet_set_flags()

u32 ethernet_set_flags ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)

Definition at line 441 of file interface.c.

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

◆ ethernet_set_mac()

static void ethernet_set_mac ( vnet_hw_interface_t hi,
ethernet_interface_t ei,
const u8 mac_address 
)
static

Definition at line 284 of file interface.c.

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

◆ ethernet_update_adjacency()

void ethernet_update_adjacency ( vnet_main_t vnm,
u32  sw_if_index,
u32  ai 
)

Definition at line 198 of file interface.c.

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

◆ format_simulated_ethernet_name()

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

Definition at line 722 of file interface.c.

+ Here is the caller graph for this function:

◆ loopback_instance_alloc()

static u32 loopback_instance_alloc ( u8  is_specified,
u32  want 
)
static

Definition at line 764 of file interface.c.

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

◆ loopback_instance_free()

static int loopback_instance_free ( u32  instance)
static

Definition at line 811 of file interface.c.

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

◆ simulated_ethernet_admin_up_down()

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

Definition at line 729 of file interface.c.

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

◆ simulated_ethernet_interface_tx()

static uword simulated_ethernet_interface_tx ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Echo packets back to ethernet/l2-input.

Definition at line 489 of file interface.c.

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

◆ simulated_ethernet_mac_change()

static clib_error_t* simulated_ethernet_mac_change ( vnet_hw_interface_t hi,
const u8 old_address,
const u8 mac_address 
)
static

Definition at line 739 of file interface.c.

+ Here is the call graph for this function:

◆ unformat_ethernet_interface()

uword unformat_ethernet_interface ( unformat_input_t input,
va_list *  args 
)

Definition at line 327 of file interface.c.

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

◆ vnet_create_loopback_interface()

int vnet_create_loopback_interface ( u32 sw_if_indexp,
u8 mac_address,
u8  is_specified,
u32  user_instance 
)

Definition at line 831 of file interface.c.

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

◆ vnet_create_sub_interface()

int vnet_create_sub_interface ( u32  sw_if_index,
u32  id,
u32  flags,
u16  inner_vlan_id,
u16  outer_vlan_id,
u32 sub_sw_if_index 
)

Definition at line 1053 of file interface.c.

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

◆ vnet_delete_loopback_interface()

int vnet_delete_loopback_interface ( u32  sw_if_index)

Definition at line 1033 of file interface.c.

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

◆ vnet_delete_sub_interface()

int vnet_delete_sub_interface ( u32  sw_if_index)

Definition at line 1095 of file interface.c.

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

◆ VNET_DEVICE_CLASS()

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

◆ VNET_HW_INTERFACE_CLASS()

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

Variable Documentation

◆ create_loopback_interface_command

vlib_cli_command_t create_loopback_interface_command
static
Initial value:
= {
.path = "create loopback interface",
.short_help = "create loopback interface [mac <mac-addr>] [instance <instance>]",
}
static clib_error_t * create_simulated_ethernet_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:910

(constructor) VLIB_CLI_COMMAND (create_loopback_interface_command)

Definition at line 974 of file interface.c.

◆ create_simulated_ethernet_interface_command

vlib_cli_command_t create_simulated_ethernet_interface_command
static
Initial value:
= {
.path = "loopback create-interface",
.short_help = "loopback create-interface [mac <mac-addr>] [instance <instance>]",
}
static clib_error_t * create_simulated_ethernet_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:910

(constructor) VLIB_CLI_COMMAND (create_simulated_ethernet_interface_command)

Definition at line 955 of file interface.c.

◆ delete_loopback_interface_command

vlib_cli_command_t delete_loopback_interface_command
static
Initial value:
= {
.path = "delete loopback interface",
.short_help = "delete loopback interface intfc <interface>",
}
static clib_error_t * delete_simulated_ethernet_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:1124

(constructor) VLIB_CLI_COMMAND (delete_loopback_interface_command)

Definition at line 1209 of file interface.c.

◆ delete_simulated_ethernet_interface_command

vlib_cli_command_t delete_simulated_ethernet_interface_command
static
Initial value:
= {
.path = "loopback delete-interface",
.short_help = "loopback delete-interface intfc <interface>",
}
static clib_error_t * delete_simulated_ethernet_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:1124

(constructor) VLIB_CLI_COMMAND (delete_simulated_ethernet_interface_command)

Definition at line 1191 of file interface.c.

◆ delete_sub_interface_command

vlib_cli_command_t delete_sub_interface_command
static
Initial value:
= {
.path = "delete sub-interface",
.short_help = "delete sub-interface <interface>",
.function = delete_sub_interface,
}
static clib_error_t * delete_sub_interface(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: interface.c:1153

(constructor) VLIB_CLI_COMMAND (delete_sub_interface_command)

Definition at line 1224 of file interface.c.