23 while (*s && *s !=
',')
40 int num_feature_start_nodes,
44 uword * index_by_name;
48 char ** these_constraints;
49 char * this_constraint_c;
50 u8 ** constraints = 0;
51 u8 * constraint_tuple;
53 u8 ** orig, ** closure;
56 u8 * a_name, * b_name;
61 char ** feature_nodes = 0;
63 u8 ** keys_to_delete = 0;
90 node_name =
format (0,
"%s%c", this_reg->node_name, 0);
97 these_constraints = this_reg->runs_before;
99 while (these_constraints [0])
101 this_constraint_c = these_constraints[0];
103 constraint_tuple =
format (0,
"%s,%s%c", node_name,
104 this_constraint_c, 0);
105 vec_add1 (constraints, constraint_tuple);
108 this_reg = this_reg->next;
111 n_features =
vec_len (node_names);
114 for (i = 0; i <
vec_len (constraints); i++)
116 this_constraint = constraints[
i];
118 if (
comma_split (this_constraint, &a_name, &b_name))
138 orig[a_index][b_index] = 1;
147 for (i = 0; i < n_features; i++)
149 for (j = 0; j < n_features; j++)
152 goto item_constrained;
157 for (k = 0; k < n_features; k++)
171 if (vec_len (result) != n_features)
173 (0,
"ip%s_feature_init_cast (cast=%d), no partial order!",
174 is_ip4 ?
"4" :
"6", cast);
184 for (i = n_features-1; i >= 0; i--)
186 p =
hash_get (reg_by_index, result[i]);
189 *this_reg->feature_index = n_features - (i+1);
190 vec_add1 (feature_nodes, this_reg->node_name);
196 num_feature_start_nodes,
212 for (i = 0; i <
vec_len(keys_to_delete); i++)
222 #define foreach_af_cast \ 223 _(4, VNET_UNICAST, "ip4 unicast") \ 224 _(4, VNET_MULTICAST, "ip4 multicast") \ 225 _(6, VNET_UNICAST, "ip6 unicast") \ 226 _(6, VNET_MULTICAST, "ip6 multicast") 242 features = im##a->feature_nodes[c]; \ 243 vlib_cli_output (vm, "%s:", s); \ 244 for (i = 0; i < vec_len(features); i++) \ 245 vlib_cli_output (vm, " %s\n", features[i]); \ 254 .path =
"show ip features",
255 .short_help =
"show ip features",
279 u32 current_config_index;
291 for (af = 0; af < 2; af++)
304 (af == 0) ?
"4" :
"6",
311 ASSERT(current_config_index
332 .path =
"show ip interface features",
333 .short_help =
"show ip interface features <intfc>",
vnet_ip_feature_registration_t * next_mc_feature
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
vnet_config_feature_t * features
u32 * config_index_by_sw_if_index
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)
ip_config_main_t rx_config_mains[VNET_N_CAST]
rx/tx interface/feature configuration.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define hash_set_mem(h, key, value)
ip_lookup_main_t lookup_main
unformat_function_t unformat_vnet_sw_interface
format_function_t format_vnet_sw_if_index_name
static clib_error_t * show_ip_interface_features_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
char ** feature_nodes[VNET_N_CAST]
Save results for show command.
vnet_main_t * vnet_get_main(void)
#define hash_create_string(elts, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
clib_error_t * ip_feature_init_cast(vlib_main_t *vm, ip_config_main_t *cm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, vnet_cast_t cast, int is_ip4)
u8 ** clib_ptclosure_alloc(int n)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static int comma_split(u8 *s, u8 **a, u8 **b)
void clib_ptclosure_free(u8 **ptc)
u32 * config_pool_index_by_user_index
vnet_ip_feature_registration_t * next_uc_feature
Feature path configuration lists.
#define vec_free(V)
Free vector's memory (no header).
#define hash_create(elts, value_bytes)
ip_lookup_main_t lookup_main
static clib_error_t * show_ip_features_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static char * feature_start_nodes[]
char ** feature_nodes[VNET_N_CAST]
#define vec_elt(v, i)
Get vector value at index i.
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)
#define hash_foreach_pair(p, v, body)
u8 ** clib_ptclosure(u8 **orig)
#define hash_get_mem(h, key)
vnet_ip_feature_registration_t * next_mc_feature
ip4_main_t ip4_main
Global ip4 main structure.
vnet_config_t * config_pool
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define clib_error_return(e, args...)
vnet_config_main_t config_main
struct _vnet_ip_feature_registration vnet_ip_feature_registration_t
vnet_ip_feature_registration_t * next_uc_feature