2 * gbp.h : Group Based Policy
4 * Copyright (c) 2018 Cisco and/or its affiliates.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 #include <plugins/gbp/gbp.h>
19 #include <plugins/gbp/gbp_classify.h>
20 #include <vnet/l2/l2_input.h>
22 gbp_src_classify_main_t gbp_src_classify_main;
25 gbp_src_classify_init (vlib_main_t * vm)
27 gbp_src_classify_main_t *em = &gbp_src_classify_main;
29 vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "gbp-src-classify");
31 /* Initialize the feature next-node indexes */
32 feat_bitmap_init_next_nodes (vm,
35 l2input_get_feat_names (),
36 em->l2_input_feat_next[GBP_SRC_CLASSIFY_NULL]);
38 node = vlib_get_node_by_name (vm, (u8 *) "gbp-null-classify");
39 feat_bitmap_init_next_nodes (vm,
42 l2input_get_feat_names (),
43 em->l2_input_feat_next[GBP_SRC_CLASSIFY_PORT]);
45 node = vlib_get_node_by_name (vm, (u8 *) "l2-gbp-lpm-classify");
46 feat_bitmap_init_next_nodes (vm,
49 l2input_get_feat_names (),
50 em->l2_input_feat_next[GBP_SRC_CLASSIFY_LPM]);
52 node = vlib_get_node_by_name (vm, (u8 *) "l2-gbp-lpm-anon-classify");
53 feat_bitmap_init_next_nodes (vm,
56 l2input_get_feat_names (),
57 em->l2_input_feat_next
58 [GBP_SRC_CLASSIFY_LPM_ANON]);
63 VLIB_INIT_FUNCTION (gbp_src_classify_init);
66 * fd.io coding-style-patch-verification: ON
69 * eval: (c-set-style "gnu")