-u32
-register_match_action_nexts (u32 next_in_ip4, u32 next_in_ip6,
- u32 next_out_ip4, u32 next_out_ip6)
-{
- acl_main_t *am = &acl_main;
- if (am->n_match_actions == 255)
- {
- return ~0;
- }
- u32 act = am->n_match_actions;
- am->n_match_actions++;
- am->acl_in_ip4_match_next[act] = next_in_ip4;
- am->acl_in_ip6_match_next[act] = next_in_ip6;
- am->acl_out_ip4_match_next[act] = next_out_ip4;
- am->acl_out_ip6_match_next[act] = next_out_ip6;
- return act;
-}
-
-void
-acl_setup_nodes (void)
-{
- vlib_main_t *vm = vlib_get_main ();
- acl_main_t *am = &acl_main;
- vlib_node_t *n;
-
- n = vlib_get_node_by_name (vm, (u8 *) "l2-input-classify");
- am->l2_input_classify_next_acl_old =
- vlib_node_add_next_with_slot (vm, n->index, acl_in_node.index, ~0);
- n = vlib_get_node_by_name (vm, (u8 *) "l2-output-classify");
- am->l2_output_classify_next_acl_old =
- vlib_node_add_next_with_slot (vm, n->index, acl_out_node.index, ~0);
-
- feat_bitmap_init_next_nodes (vm, acl_in_node.index, L2INPUT_N_FEAT,
- l2input_get_feat_names (),
- am->acl_in_node_feat_next_node_index);
-
- feat_bitmap_init_next_nodes (vm, acl_out_node.index, L2OUTPUT_N_FEAT,
- l2output_get_feat_names (),
- am->acl_out_node_feat_next_node_index);
-
- memset (&am->acl_in_ip4_match_next[0], 0,
- sizeof (am->acl_in_ip4_match_next));
- memset (&am->acl_in_ip6_match_next[0], 0,
- sizeof (am->acl_in_ip6_match_next));
- memset (&am->acl_out_ip4_match_next[0], 0,
- sizeof (am->acl_out_ip4_match_next));
- memset (&am->acl_out_ip6_match_next[0], 0,
- sizeof (am->acl_out_ip6_match_next));
- am->n_match_actions = 0;
-
- am->l2_input_classify_next_acl_ip4 = am->l2_input_classify_next_acl_old;
- am->l2_input_classify_next_acl_ip6 = am->l2_input_classify_next_acl_old;
- am->l2_output_classify_next_acl_ip4 = am->l2_output_classify_next_acl_old;
- am->l2_output_classify_next_acl_ip6 = am->l2_output_classify_next_acl_old;
-
- register_match_action_nexts (0, 0, 0, 0); /* drop */
- register_match_action_nexts (~0, ~0, ~0, ~0); /* permit */
- register_match_action_nexts (ACL_IN_L2S_INPUT_IP4_ADD, ACL_IN_L2S_INPUT_IP6_ADD, ACL_OUT_L2S_OUTPUT_IP4_ADD, ACL_OUT_L2S_OUTPUT_IP6_ADD); /* permit + create session */
-}
-
-void
-acl_setup_fa_nodes (void)
-{
- vlib_main_t *vm = vlib_get_main ();
- acl_main_t *am = &acl_main;
- vlib_node_t *n, *n4, *n6;
-
- n = vlib_get_node_by_name (vm, (u8 *) "l2-input-classify");
- n4 = vlib_get_node_by_name (vm, (u8 *) "acl-plugin-in-ip4-l2");
- n6 = vlib_get_node_by_name (vm, (u8 *) "acl-plugin-in-ip6-l2");
-
-
- am->fa_l2_input_classify_next_acl_ip4 =
- vlib_node_add_next_with_slot (vm, n->index, n4->index, ~0);
- am->fa_l2_input_classify_next_acl_ip6 =
- vlib_node_add_next_with_slot (vm, n->index, n6->index, ~0);
-
- feat_bitmap_init_next_nodes (vm, n4->index, L2INPUT_N_FEAT,
- l2input_get_feat_names (),
- am->fa_acl_in_ip4_l2_node_feat_next_node_index);
-
- feat_bitmap_init_next_nodes (vm, n6->index, L2INPUT_N_FEAT,
- l2input_get_feat_names (),
- am->fa_acl_in_ip6_l2_node_feat_next_node_index);
-
-
- n = vlib_get_node_by_name (vm, (u8 *) "l2-output-classify");
- n4 = vlib_get_node_by_name (vm, (u8 *) "acl-plugin-out-ip4-l2");
- n6 = vlib_get_node_by_name (vm, (u8 *) "acl-plugin-out-ip6-l2");
-
- am->fa_l2_output_classify_next_acl_ip4 =
- vlib_node_add_next_with_slot (vm, n->index, n4->index, ~0);
- am->fa_l2_output_classify_next_acl_ip6 =
- vlib_node_add_next_with_slot (vm, n->index, n6->index, ~0);
-
- feat_bitmap_init_next_nodes (vm, n4->index, L2OUTPUT_N_FEAT,
- l2output_get_feat_names (),
- am->fa_acl_out_ip4_l2_node_feat_next_node_index);
-
- feat_bitmap_init_next_nodes (vm, n6->index, L2OUTPUT_N_FEAT,
- l2output_get_feat_names (),
- am->fa_acl_out_ip6_l2_node_feat_next_node_index);
-
- am->l2_input_classify_next_acl_ip4 = am->fa_l2_input_classify_next_acl_ip4;
- am->l2_input_classify_next_acl_ip6 = am->fa_l2_input_classify_next_acl_ip6;
- am->l2_output_classify_next_acl_ip4 = am->fa_l2_output_classify_next_acl_ip4;
- am->l2_output_classify_next_acl_ip6 = am->fa_l2_output_classify_next_acl_ip6;
-
-}
-
-void
-acl_set_timeout_sec(int timeout_type, u32 value)