30 memset (data, 0,
sizeof(*data));
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));
161 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
181 u32 sw_if_index = ~0;
182 int enable_disable = 1;
196 if (sw_if_index == ~0)
205 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
207 (0,
"Invalid interface, only works on physical ports");
210 case VNET_API_ERROR_UNIMPLEMENTED:
222 .path =
"cop interface",
224 "cop interface <interface-name> [disable]",
238 u32 next_to_add_del = 0;
253 switch(address_family)
256 is_add = (a->
ip4 != 0);
265 return VNET_API_ERROR_NO_SUCH_FIB;
272 is_add = (a->
ip6 != 0);
280 return VNET_API_ERROR_NO_SUCH_FIB;
302 data, sizeof (*data));
307 data, sizeof (*data));
320 u32 sw_if_index = ~0;
333 else if (
unformat (input,
"default"))
338 else if (
unformat (input,
"fib-id %d", &fib_id))
344 if (sw_if_index == ~0)
359 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
361 (0,
"Invalid interface, only works on physical ports");
364 case VNET_API_ERROR_NO_SUCH_FIB:
369 case VNET_API_ERROR_UNIMPLEMENTED:
382 .path =
"cop whitelist",
384 "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]
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)
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
vnet_main_t * vnet_get_main(void)
#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_warning(format, args...)
#define vlib_call_init_function(vm, x)
static clib_error_t * ip6_whitelist_init(vlib_main_t *vm)
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)
int cop_interface_enable_disable(u32 sw_if_index, int enable_disable)
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)
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
static clib_error_t * ip4_whitelist_init(vlib_main_t *vm)
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 clib_error_return(e, args...)
#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