24 #include <vpp/app/version.h> 28 #include <oddbuf/oddbuf.api_enum.h> 29 #include <oddbuf/oddbuf.api_types.h> 31 #define REPLY_MSG_ID_BASE omp->msg_id_base 48 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
53 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
56 sw_if_index, enable_disable, 0, 0);
68 int enable_disable = 1;
83 if (sw_if_index == ~0)
93 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
95 (0,
"Invalid interface, only works on physical ports");
98 case VNET_API_ERROR_UNIMPLEMENTED:
100 "Device driver doesn't support redirection");
112 .path =
"oddbuf enable-disable",
114 "oddbuf enable-disable <interface-name> [disable]",
123 vl_api_oddbuf_enable_disable_reply_t *rmp;
130 sw_if_index = clib_net_to_host_u32 (mp->
sw_if_index);
137 #include <oddbuf/oddbuf.api.c> 163 .arc_name =
"device-input",
164 .node_name =
"oddbuf",
172 .version = VPP_BUILD_VER,
173 .description =
"Awkward chained buffer geometry generator",
174 .default_disabled = 1,
196 else if (
unformat (line_input,
"first_offset %d",
211 .path =
"oddbuf configure",
213 "oddbuf configure n_to_copy <nn> offset <nn> first_offset <nn>",
static void vl_api_oddbuf_enable_disable_t_handler(vl_api_oddbuf_enable_disable_t *mp)
vnet_main_t * vnet_get_main(void)
vnet_interface_main_t interface_main
static clib_error_t * oddbuf_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * oddbuf_init(vlib_main_t *vm)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unformat_function_t unformat_vnet_sw_interface
#define VLIB_INIT_FUNCTION(x)
API to enable / disable oddbuf on an interface.
static clib_error_t * oddbuf_config_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
int oddbuf_enable_disable(oddbuf_main_t *omp, u32 sw_if_index, int enable_disable)
VNET_FEATURE_INIT(oddbuf, static)
#define BAD_SW_IF_INDEX_LABEL
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define VLIB_CLI_COMMAND(x,...)
#define VNET_FEATURES(...)
vl_api_interface_index_t sw_if_index
vnet_sw_interface_t * sw_interfaces
vnet_sw_interface_type_t type
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
vl_api_interface_index_t sw_if_index
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 VALIDATE_SW_IF_INDEX(mp)
oddbuf_main_t oddbuf_main