FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
interface_api.c File Reference
+ Include dependency graph for interface_api.c:

Go to the source code of this file.

Macros

#define REPLY_MSG_ID_BASE   msg_id_base
 
#define foreach_vpe_api_msg
 

Enumerations

enum  api_events {
  API_LINK_STATE_UP_EVENT = 1 << 1, API_LINK_STATE_DOWN_EVENT = 1 << 2, API_ADMIN_UP_EVENT = 1 << 3, API_ADMIN_DOWN_EVENT = 1 << 4,
  API_SW_INTERFACE_ADD_EVENT = 1 << 5, API_SW_INTERFACE_DEL_EVENT = 1 << 6
}
 

Functions

static void vl_api_sw_interface_set_flags_t_handler (vl_api_sw_interface_set_flags_t *mp)
 
static void vl_api_sw_interface_set_promisc_t_handler (vl_api_sw_interface_set_promisc_t *mp)
 
static void vl_api_hw_interface_set_mtu_t_handler (vl_api_hw_interface_set_mtu_t *mp)
 
static void vl_api_sw_interface_set_mtu_t_handler (vl_api_sw_interface_set_mtu_t *mp)
 
static void vl_api_sw_interface_set_ip_directed_broadcast_t_handler (vl_api_sw_interface_set_ip_directed_broadcast_t *mp)
 
static void send_sw_interface_details (vpe_api_main_t *am, vl_api_registration_t *rp, vnet_sw_interface_t *swif, u8 *interface_name, u32 context)
 
static void vl_api_sw_interface_dump_t_handler (vl_api_sw_interface_dump_t *mp)
 
static void vl_api_sw_interface_add_del_address_t_handler (vl_api_sw_interface_add_del_address_t *mp)
 
static void vl_api_sw_interface_set_table_t_handler (vl_api_sw_interface_set_table_t *mp)
 
int ip_table_bind (fib_protocol_t fproto, u32 sw_if_index, u32 table_id, u8 is_api)
 
static void send_sw_interface_get_table_reply (vl_api_registration_t *reg, u32 context, int retval, u32 vrf_id)
 
static void vl_api_sw_interface_get_table_t_handler (vl_api_sw_interface_get_table_t *mp)
 
static void vl_api_sw_interface_set_unnumbered_t_handler (vl_api_sw_interface_set_unnumbered_t *mp)
 
static void vl_api_sw_interface_clear_stats_t_handler (vl_api_sw_interface_clear_stats_t *mp)
 
static void send_sw_interface_event (vpe_api_main_t *am, vpe_client_registration_t *reg, vl_api_registration_t *vl_reg, u32 sw_if_index, enum api_events events)
 
static uword link_state_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 
static clib_error_tlink_up_down_function (vnet_main_t *vm, u32 hw_if_index, u32 flags)
 
static clib_error_tadmin_up_down_function (vnet_main_t *vm, u32 hw_if_index, u32 flags)
 
static clib_error_tsw_interface_add_del_function (vnet_main_t *vm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (admin_up_down_function)
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (link_up_down_function)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (sw_interface_add_del_function)
 
static void vl_api_sw_interface_tag_add_del_t_handler (vl_api_sw_interface_tag_add_del_t *mp)
 
static void vl_api_sw_interface_add_del_mac_address_t_handler (vl_api_sw_interface_add_del_mac_address_t *mp)
 
static void vl_api_sw_interface_set_mac_address_t_handler (vl_api_sw_interface_set_mac_address_t *mp)
 
static void vl_api_sw_interface_get_mac_address_t_handler (vl_api_sw_interface_get_mac_address_t *mp)
 
static void vl_api_sw_interface_set_interface_name_t_handler (vl_api_sw_interface_set_interface_name_t *mp)
 
static void vl_api_sw_interface_set_rx_mode_t_handler (vl_api_sw_interface_set_rx_mode_t *mp)
 
static void send_interface_rx_placement_details (vpe_api_main_t *am, vl_api_registration_t *rp, u32 sw_if_index, u32 worker_id, u32 queue_id, u8 mode, u32 context)
 
static void vl_api_sw_interface_rx_placement_dump_t_handler (vl_api_sw_interface_rx_placement_dump_t *mp)
 
static void vl_api_sw_interface_set_rx_placement_t_handler (vl_api_sw_interface_set_rx_placement_t *mp)
 
static void vl_api_create_vlan_subif_t_handler (vl_api_create_vlan_subif_t *mp)
 
static void vl_api_create_subif_t_handler (vl_api_create_subif_t *mp)
 
static void vl_api_delete_subif_t_handler (vl_api_delete_subif_t *mp)
 
static void vl_api_interface_name_renumber_t_handler (vl_api_interface_name_renumber_t *mp)
 
static void vl_api_create_loopback_t_handler (vl_api_create_loopback_t *mp)
 
static void vl_api_create_loopback_instance_t_handler (vl_api_create_loopback_instance_t *mp)
 
static void vl_api_delete_loopback_t_handler (vl_api_delete_loopback_t *mp)
 
static void vl_api_collect_detailed_interface_stats_t_handler (vl_api_collect_detailed_interface_stats_t *mp)
 
static void vl_api_sw_interface_address_replace_begin_t_handler (vl_api_sw_interface_address_replace_begin_t *mp)
 
static void vl_api_sw_interface_address_replace_end_t_handler (vl_api_sw_interface_address_replace_end_t *mp)
 
 pub_sub_handler (interface_events, INTERFACE_EVENTS)
 
static clib_error_tinterface_api_hookup (vlib_main_t *vm)
 
 VLIB_API_INIT_FUNCTION (interface_api_hookup)
 

Variables

static u16 msg_id_base
 
vpe_api_main_t vpe_api_main
 
static vlib_node_registration_t link_state_process_node
 (constructor) VLIB_REGISTER_NODE (link_state_process_node) More...
 

Macro Definition Documentation

◆ foreach_vpe_api_msg

#define foreach_vpe_api_msg
Value:
_ (SW_INTERFACE_SET_FLAGS, sw_interface_set_flags) \
_ (SW_INTERFACE_SET_PROMISC, sw_interface_set_promisc) \
_ (HW_INTERFACE_SET_MTU, hw_interface_set_mtu) \
_ (SW_INTERFACE_SET_MTU, sw_interface_set_mtu) \
_ (WANT_INTERFACE_EVENTS, want_interface_events) \
_ (SW_INTERFACE_DUMP, sw_interface_dump) \
_ (SW_INTERFACE_ADD_DEL_ADDRESS, sw_interface_add_del_address) \
_ (SW_INTERFACE_SET_RX_MODE, sw_interface_set_rx_mode) \
_ (SW_INTERFACE_RX_PLACEMENT_DUMP, sw_interface_rx_placement_dump) \
_ (SW_INTERFACE_SET_RX_PLACEMENT, sw_interface_set_rx_placement) \
_ (SW_INTERFACE_SET_TABLE, sw_interface_set_table) \
_ (SW_INTERFACE_GET_TABLE, sw_interface_get_table) \
_ (SW_INTERFACE_SET_UNNUMBERED, sw_interface_set_unnumbered) \
_ (SW_INTERFACE_CLEAR_STATS, sw_interface_clear_stats) \
_ (SW_INTERFACE_TAG_ADD_DEL, sw_interface_tag_add_del) \
_ (SW_INTERFACE_ADD_DEL_MAC_ADDRESS, sw_interface_add_del_mac_address) \
_ (SW_INTERFACE_SET_MAC_ADDRESS, sw_interface_set_mac_address) \
_ (SW_INTERFACE_GET_MAC_ADDRESS, sw_interface_get_mac_address) \
_ (CREATE_VLAN_SUBIF, create_vlan_subif) \
_ (CREATE_SUBIF, create_subif) \
_ (DELETE_SUBIF, delete_subif) \
_ (CREATE_LOOPBACK, create_loopback) \
_ (CREATE_LOOPBACK_INSTANCE, create_loopback_instance) \
_ (DELETE_LOOPBACK, delete_loopback) \
_ (INTERFACE_NAME_RENUMBER, interface_name_renumber) \
_ (COLLECT_DETAILED_INTERFACE_STATS, collect_detailed_interface_stats) \
_ (SW_INTERFACE_SET_IP_DIRECTED_BROADCAST, \
sw_interface_set_ip_directed_broadcast) \
_ (SW_INTERFACE_ADDRESS_REPLACE_BEGIN, sw_interface_address_replace_begin) \
_ (SW_INTERFACE_ADDRESS_REPLACE_END, sw_interface_address_replace_end)

Definition at line 49 of file interface_api.c.

◆ REPLY_MSG_ID_BASE

#define REPLY_MSG_ID_BASE   msg_id_base

Definition at line 42 of file interface_api.c.

Enumeration Type Documentation

◆ api_events

enum api_events
Enumerator
API_LINK_STATE_UP_EVENT 
API_LINK_STATE_DOWN_EVENT 
API_ADMIN_UP_EVENT 
API_ADMIN_DOWN_EVENT 
API_SW_INTERFACE_ADD_EVENT 
API_SW_INTERFACE_DEL_EVENT 

Definition at line 733 of file interface_api.c.

Function Documentation

◆ admin_up_down_function()

static clib_error_t * admin_up_down_function ( vnet_main_t vm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 857 of file interface_api.c.

+ Here is the call graph for this function:

◆ interface_api_hookup()

static clib_error_t* interface_api_hookup ( vlib_main_t vm)
static

Definition at line 1452 of file interface_api.c.

+ Here is the call graph for this function:

◆ ip_table_bind()

int ip_table_bind ( fib_protocol_t  fproto,
u32  sw_if_index,
u32  table_id,
u8  is_api 
)

Definition at line 474 of file interface_api.c.

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

◆ link_state_process()

static uword link_state_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 768 of file interface_api.c.

+ Here is the call graph for this function:

◆ link_up_down_function()

static clib_error_t * link_up_down_function ( vnet_main_t vm,
u32  hw_if_index,
u32  flags 
)
static

Definition at line 839 of file interface_api.c.

+ Here is the call graph for this function:

◆ pub_sub_handler()

pub_sub_handler ( interface_events  ,
INTERFACE_EVENTS   
)

◆ send_interface_rx_placement_details()

static void send_interface_rx_placement_details ( vpe_api_main_t am,
vl_api_registration_t rp,
u32  sw_if_index,
u32  worker_id,
u32  queue_id,
u8  mode,
u32  context 
)
static

Definition at line 1085 of file interface_api.c.

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

◆ send_sw_interface_details()

static void send_sw_interface_details ( vpe_api_main_t am,
vl_api_registration_t rp,
vnet_sw_interface_t swif,
u8 interface_name,
u32  context 
)
static

Definition at line 224 of file interface_api.c.

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

◆ send_sw_interface_event()

static void send_sw_interface_event ( vpe_api_main_t am,
vpe_client_registration_t reg,
vl_api_registration_t vl_reg,
u32  sw_if_index,
enum api_events  events 
)
static

Definition at line 744 of file interface_api.c.

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

◆ send_sw_interface_get_table_reply()

static void send_sw_interface_get_table_reply ( vl_api_registration_t reg,
u32  context,
int  retval,
u32  vrf_id 
)
static

Definition at line 602 of file interface_api.c.

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

◆ sw_interface_add_del_function()

static clib_error_t * sw_interface_add_del_function ( vnet_main_t vm,
u32  sw_if_index,
u32  flags 
)
static

Definition at line 878 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_collect_detailed_interface_stats_t_handler()

static void vl_api_collect_detailed_interface_stats_t_handler ( vl_api_collect_detailed_interface_stats_t mp)
static

Definition at line 1404 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_create_loopback_instance_t_handler()

static void vl_api_create_loopback_instance_t_handler ( vl_api_create_loopback_instance_t mp)
static

Definition at line 1368 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_create_loopback_t_handler()

static void vl_api_create_loopback_t_handler ( vl_api_create_loopback_t mp)
static

Definition at line 1349 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_create_subif_t_handler()

static void vl_api_create_subif_t_handler ( vl_api_create_subif_t mp)
static

Definition at line 1288 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_create_vlan_subif_t_handler()

static void vl_api_create_vlan_subif_t_handler ( vl_api_create_vlan_subif_t mp)
static

Definition at line 1207 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_delete_loopback_t_handler()

static void vl_api_delete_loopback_t_handler ( vl_api_delete_loopback_t mp)
static

Definition at line 1390 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_delete_subif_t_handler()

static void vl_api_delete_subif_t_handler ( vl_api_delete_subif_t mp)
static

Definition at line 1321 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_hw_interface_set_mtu_t_handler()

static void vl_api_hw_interface_set_mtu_t_handler ( vl_api_hw_interface_set_mtu_t mp)
static

Definition at line 139 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_interface_name_renumber_t_handler()

static void vl_api_interface_name_renumber_t_handler ( vl_api_interface_name_renumber_t mp)
static

Definition at line 1332 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_add_del_address_t_handler()

static void vl_api_sw_interface_add_del_address_t_handler ( vl_api_sw_interface_add_del_address_t mp)
static

Definition at line 414 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_add_del_mac_address_t_handler()

static void vl_api_sw_interface_add_del_mac_address_t_handler ( vl_api_sw_interface_add_del_mac_address_t mp)
static

Definition at line 925 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_address_replace_begin_t_handler()

static void vl_api_sw_interface_address_replace_begin_t_handler ( vl_api_sw_interface_address_replace_begin_t mp)
static

Definition at line 1418 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_address_replace_end_t_handler()

static void vl_api_sw_interface_address_replace_end_t_handler ( vl_api_sw_interface_address_replace_end_t mp)
static

Definition at line 1430 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_clear_stats_t_handler()

static void vl_api_sw_interface_clear_stats_t_handler ( vl_api_sw_interface_clear_stats_t mp)
static

Definition at line 686 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_dump_t_handler()

static void vl_api_sw_interface_dump_t_handler ( vl_api_sw_interface_dump_t mp)
static

Definition at line 349 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_get_mac_address_t_handler()

static void vl_api_sw_interface_get_mac_address_t_handler ( vl_api_sw_interface_get_mac_address_t mp)
static

Definition at line 982 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_get_table_t_handler()

static void vl_api_sw_interface_get_table_t_handler ( vl_api_sw_interface_get_table_t mp)
static

Definition at line 619 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_rx_placement_dump_t_handler()

static void vl_api_sw_interface_rx_placement_dump_t_handler ( vl_api_sw_interface_rx_placement_dump_t mp)
static

Definition at line 1106 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_flags_t_handler()

static void vl_api_sw_interface_set_flags_t_handler ( vl_api_sw_interface_set_flags_t mp)
static

Definition at line 82 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_interface_name_t_handler()

static void vl_api_sw_interface_set_interface_name_t_handler ( vl_api_sw_interface_set_interface_name_t mp)
static

Definition at line 1014 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_ip_directed_broadcast_t_handler()

static void vl_api_sw_interface_set_ip_directed_broadcast_t_handler ( vl_api_sw_interface_set_ip_directed_broadcast_t mp)
static

Definition at line 208 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_mac_address_t_handler()

static void vl_api_sw_interface_set_mac_address_t_handler ( vl_api_sw_interface_set_mac_address_t mp)
static

Definition at line 953 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_mtu_t_handler()

static void vl_api_sw_interface_set_mtu_t_handler ( vl_api_sw_interface_set_mtu_t mp)
static

Definition at line 185 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_promisc_t_handler()

static void vl_api_sw_interface_set_promisc_t_handler ( vl_api_sw_interface_set_promisc_t mp)
static

Definition at line 108 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_rx_mode_t_handler()

static void vl_api_sw_interface_set_rx_mode_t_handler ( vl_api_sw_interface_set_rx_mode_t mp)
static

Definition at line 1047 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_rx_placement_t_handler()

static void vl_api_sw_interface_set_rx_placement_t_handler ( vl_api_sw_interface_set_rx_placement_t mp)
static

Definition at line 1173 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_table_t_handler()

static void vl_api_sw_interface_set_table_t_handler ( vl_api_sw_interface_set_table_t mp)
static

Definition at line 454 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_set_unnumbered_t_handler()

static void vl_api_sw_interface_set_unnumbered_t_handler ( vl_api_sw_interface_set_unnumbered_t mp)
static

Definition at line 653 of file interface_api.c.

+ Here is the call graph for this function:

◆ vl_api_sw_interface_tag_add_del_t_handler()

static void vl_api_sw_interface_tag_add_del_t_handler ( vl_api_sw_interface_tag_add_del_t mp)
static

Definition at line 894 of file interface_api.c.

+ Here is the call graph for this function:

◆ VLIB_API_INIT_FUNCTION()

VLIB_API_INIT_FUNCTION ( interface_api_hookup  )

◆ VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION()

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( link_up_down_function  )

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( sw_interface_add_del_function  )

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( admin_up_down_function  )

Variable Documentation

◆ link_state_process_node

vlib_node_registration_t link_state_process_node
static
Initial value:
= {
.function = link_state_process,
.name = "vpe-link-state-process",
}

(constructor) VLIB_REGISTER_NODE (link_state_process_node)

Definition at line 827 of file interface_api.c.

◆ msg_id_base

u16 msg_id_base
static

Definition at line 45 of file interface_api.c.

◆ vpe_api_main

vpe_api_main_t vpe_api_main

Definition at line 47 of file interface_api.c.

collect_detailed_interface_stats
static int collect_detailed_interface_stats(void)
Definition: interface.h:966
link_state_process
static uword link_state_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: interface_api.c:768
VLIB_NODE_TYPE_PROCESS
@ VLIB_NODE_TYPE_PROCESS
Definition: node.h:84