|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 #include <sample/sample.api_enum.h>
28 #include <sample/sample.api_types.h>
30 #define REPLY_MSG_ID_BASE sm->msg_id_base
36 .description =
"Sample of VPP Plugin",
57 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
62 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
77 int enable_disable = 1;
100 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
102 (0,
"Invalid interface, only works on physical ports");
105 case VNET_API_ERROR_UNIMPLEMENTED:
120 .path =
"sample macswap",
122 "sample macswap <interface-name> [disable]",
132 vl_api_sample_macswap_enable_disable_reply_t * rmp;
139 REPLY_MACRO(VL_API_SAMPLE_MACSWAP_ENABLE_DISABLE_REPLY);
143 #include <sample/sample.api.c>
167 .arc_name =
"device-input",
168 .node_name =
"sample",
sample_main_t sample_main
vl_api_interface_index_t sw_if_index
vnet_sw_interface_type_t type
static void vl_api_sample_macswap_enable_disable_t_handler(vl_api_sample_macswap_enable_disable_t *mp)
Plugin API message handler.
static clib_error_t * sample_init(vlib_main_t *vm)
Initialize the sample plugin.
static clib_error_t * macswap_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static void setup_message_id_table(api_main_t *am)
vnet_main_t * vnet_get_main(void)
int sample_macswap_enable_disable(sample_main_t *sm, u32 sw_if_index, int enable_disable)
Enable/disable the macswap plugin.
#define VLIB_CLI_COMMAND(x,...)
vnet_sw_interface_t * sw_interfaces
VNET_FEATURE_INIT(sample, static)
Hook the sample plugin into the VPP graph hierarchy.
unformat_function_t unformat_vnet_sw_interface
#define VLIB_INIT_FUNCTION(x)
#define SAMPLE_PLUGIN_BUILD_VER
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
#define VNET_FEATURES(...)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ VNET_SW_INTERFACE_TYPE_HARDWARE
static vlib_cli_command_t sr_content_command
CLI command to enable/disable the sample macswap plugin.
vl_api_interface_index_t sw_if_index
vnet_interface_main_t interface_main