59 u32 ip4_table_index,
u32 ip6_table_index,
60 u32 l2_table_index,
u32 is_add)
76 return VNET_API_ERROR_NO_SUCH_TABLE;
85 clib_warning (
"Non-existent intf_idx=%d with table_index=%d for delete",
86 sw_if_index, pct[ti]);
87 return VNET_API_ERROR_NO_SUCH_TABLE;
113 u32 sw_if_index = ~0;
114 u32 ip4_table_index = ~0;
115 u32 ip6_table_index = ~0;
116 u32 l2_table_index = ~0;
126 else if (
unformat (input,
"ip4-table %d", &ip4_table_index))
128 else if (
unformat (input,
"ip6-table %d", &ip6_table_index))
130 else if (
unformat (input,
"l2-table %d", &l2_table_index))
138 if (sw_if_index == ~0)
148 ip6_table_index, l2_table_index, is_add);
155 case VNET_API_ERROR_NO_MATCHING_INTERFACE:
158 case VNET_API_ERROR_NO_SUCH_ENTRY:
165 .path =
"set policer classify",
167 "set policer classify interface <int> [ip4-table <index>]\n" 168 " [ip6-table <index>] [l2-table <index>] [del]",
175 u32 * r = va_arg (*va,
u32 *);
216 for (i = 0; i <
vec_len (vec_tbl); i++)
229 .path =
"show classify policer",
230 .short_help =
"show classify policer type [ip4|ip6|l2]",
sll srl srl sll sra u16x4 i
u32 * config_index_by_sw_if_index
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
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)
ip_config_main_t rx_config_mains[VNET_N_CAST]
rx/tx interface/feature configuration.
ip_lookup_main_t lookup_main
unformat_function_t unformat_vnet_sw_interface
format_function_t format_vnet_sw_if_index_name
policer_classify_table_id_t
u32 ip4_unicast_rx_feature_policer_classify
Built-in unicast feature path indice, see ip_feature_init_cast()
vnet_main_t * vnet_get_main(void)
#define clib_warning(format, args...)
u32 * classify_table_index_by_sw_if_index[POLICER_CLASSIFY_N_TABLES]
vnet_config_main_t * vnet_config_main[POLICER_CLASSIFY_N_TABLES]
static clib_error_t * set_policer_classify_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 ip6_unicast_rx_feature_policer_classify
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
struct _vnet_classify_main vnet_classify_main_t
ip_lookup_main_t lookup_main
static clib_error_t * show_policer_classify_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)
static uword unformat_table_type(unformat_input_t *input, va_list *va)
#define vec_elt(v, i)
Get vector value at index i.
vnet_classify_main_t * vnet_classify_main
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
policer_classify_main_t policer_classify_main
ip4_main_t ip4_main
Global ip4 main structure.
static void vnet_policer_classify_feature_enable(vlib_main_t *vnm, policer_classify_main_t *pcm, u32 sw_if_index, policer_classify_table_id_t tid, int feature_enable)
int vnet_set_policer_classify_intfc(vlib_main_t *vm, u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 l2_table_index, u32 is_add)
#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