54 switch (address_family)
58 static char * start_nodes[] = {
"cop-input" };
59 static char * feature_nodes[] = {
71 static char * start_nodes[] = {
"cop-input" };
72 static char * feature_nodes[] = {
84 static char * start_nodes[] = {
"cop-input" };
85 static char * feature_nodes[] = {
117 data,
sizeof(*data));
122 data,
sizeof(*data));
145 .runs_after =
VLIB_INITS (
"ip4_whitelist_init",
"ip6_whitelist_init"),
159 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
180 int enable_disable = 1;
194 if (sw_if_index == ~0)
203 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
205 (0,
"Invalid interface, only works on physical ports");
208 case VNET_API_ERROR_UNIMPLEMENTED:
220 .path =
"cop interface",
222 "cop interface <interface-name> [disable]",
236 u32 next_to_add_del = 0;
251 switch(address_family)
254 is_add = (a->
ip4 != 0);
263 return VNET_API_ERROR_NO_SUCH_FIB;
270 is_add = (a->
ip6 != 0);
278 return VNET_API_ERROR_NO_SUCH_FIB;
300 data, sizeof (*data));
305 data, sizeof (*data));
331 else if (
unformat (input,
"default"))
336 else if (
unformat (input,
"fib-id %d", &fib_id))
342 if (sw_if_index == ~0)
357 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
359 (0,
"Invalid interface, only works on physical ports");
362 case VNET_API_ERROR_NO_SUCH_FIB:
367 case VNET_API_ERROR_UNIMPLEMENTED:
380 .path =
"cop whitelist",
382 "cop whitelist <interface-name> [ip4][ip6][default][fib-id <NN>][disable]",
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)
cop_config_main_t cop_config_mains[VNET_N_COPS]
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)
int vnet_hw_interface_rx_redirect_to_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
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)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unformat_function_t unformat_vnet_sw_interface
u32 * node_index_by_feature_index
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
u32 * config_index_by_sw_if_index
static clib_error_t * cop_whitelist_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
static clib_error_t * cop_init(vlib_main_t *vm)
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
vlib_node_registration_t cop_input_node
(constructor) VLIB_REGISTER_NODE (cop_input_node)
int cop_whitelist_enable_disable(cop_whitelist_enable_disable_args_t *a)
vnet_device_class_t vnet_local_interface_device_class
uword * fib_index_by_table_id
static clib_error_t * cop_sw_interface_add_del(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
#define clib_warning(format, args...)
int cop_interface_enable_disable(u32 sw_if_index, int enable_disable)
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * cop_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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)
vnet_sw_interface_type_t type
ip4_main_t ip4_main
Global ip4 main structure.
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(cop_sw_interface_add_del)
#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)
vnet_config_main_t config_main