17 #include <vpp/app/version.h> 57 switch (address_family)
61 static char *start_nodes[] = {
"adl-input" };
62 static char *feature_nodes[] = {
69 feature_nodes,
ARRAY_LEN (feature_nodes));
74 static char *start_nodes[] = {
"adl-input" };
75 static char *feature_nodes[] = {
81 feature_nodes,
ARRAY_LEN (feature_nodes));
87 static char *start_nodes[] = {
"adl-input" };
88 static char *feature_nodes[] = {
94 feature_nodes,
ARRAY_LEN (feature_nodes));
118 ci, default_next, data, sizeof (*data));
125 ci, default_next, data,
156 .runs_after =
VLIB_INITS (
"ip4_allowlist_init",
"ip6_allowlist_init"),
163 .arc_name =
"device-input",
164 .node_name =
"adl-input",
175 sw_if_index, enable_disable, 0, 0);
186 int enable_disable = 1;
200 if (sw_if_index == ~0)
209 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
211 (0,
"Invalid interface, only works on physical ports");
214 case VNET_API_ERROR_UNIMPLEMENTED:
226 .path =
"adl interface",
228 "adl interface <interface-name> [disable]",
242 u32 next_to_add_del = 0;
257 switch(address_family)
260 is_add = (a->
ip4 != 0);
269 return VNET_API_ERROR_NO_SUCH_FIB;
276 is_add = (a->
ip6 != 0);
284 return VNET_API_ERROR_NO_SUCH_FIB;
306 data, sizeof (*data));
316 data, sizeof (*data));
344 else if (
unformat (input,
"default"))
349 else if (
unformat (input,
"fib-id %d", &fib_id))
355 if (sw_if_index == ~0)
370 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
372 (0,
"Invalid interface, only works on physical ports");
375 case VNET_API_ERROR_NO_SUCH_FIB:
380 case VNET_API_ERROR_UNIMPLEMENTED:
395 .path =
"adl allowlist",
397 "adl allowlist <interface-name> [ip4][ip6][default][fib-id <NN>][disable]",
405 .version = VPP_BUILD_VER,
406 .description =
"Allow/deny list plugin",
void vnet_config_init(vlib_main_t *vm, vnet_config_main_t *cm, char *start_node_names[], int n_start_node_names, char *feature_node_names[], int n_feature_node_names)
vnet_main_t * vnet_get_main(void)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
VNET_FEATURE_INIT(adl, static)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static clib_error_t * adl_allowlist_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 vnet_config_del_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
unformat_function_t unformat_vnet_sw_interface
adl_config_main_t adl_config_mains[VNET_N_ADLS]
static clib_error_t * adl_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 * node_index_by_feature_index
#define VLIB_INIT_FUNCTION(x)
int adl_allowlist_enable_disable(adl_allowlist_enable_disable_args_t *a)
#define clib_error_return(e, args...)
int adl_interface_enable_disable(u32 sw_if_index, int enable_disable)
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(adl_sw_interface_add_del)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
vnet_device_class_t vnet_local_interface_device_class
vnet_config_main_t config_main
uword * fib_index_by_table_id
#define clib_warning(format, args...)
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * adl_init(vlib_main_t *vm)
u32 vnet_config_add_feature(vlib_main_t *vm, vnet_config_main_t *cm, u32 config_string_heap_index, u32 feature_index, void *feature_config, u32 n_feature_config_bytes)
u32 * config_index_by_sw_if_index
vlib_node_registration_t adl_input_node
(constructor) VLIB_REGISTER_NODE (adl_input_node)
#define VNET_FEATURES(...)
static clib_error_t * adl_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
ip4_main_t ip4_main
Global ip4 main structure.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
static void ethernet_setup_node(vlib_main_t *vm, u32 node_index)
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)