2 * Copyright (c) 2015 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #ifndef __included_vnet_l2_classify_h__
17 #define __included_vnet_l2_classify_h__
19 #include <vlib/vlib.h>
20 #include <vnet/vnet.h>
21 #include <vnet/pg/pg.h>
22 #include <vnet/ethernet/ethernet.h>
23 #include <vnet/ethernet/packet.h>
24 #include <vnet/ip/ip_packet.h>
25 #include <vnet/ip/ip4_packet.h>
26 #include <vnet/ip/ip6_packet.h>
28 #include <vnet/l2/l2_input.h>
29 #include <vnet/l2/feat_bitmap.h>
30 #include <vppinfra/error.h>
31 #include <vppinfra/hash.h>
32 #include <vppinfra/cache.h>
34 #include <vnet/classify/vnet_classify.h>
37 L2_CLASSIFY_NEXT_DROP,
38 L2_CLASSIFY_NEXT_ETHERNET_INPUT,
39 L2_CLASSIFY_NEXT_IP4_INPUT,
40 L2_CLASSIFY_NEXT_IP6_INPUT,
46 L2_CLASSIFY_TABLE_IP4,
47 L2_CLASSIFY_TABLE_IP6,
48 L2_CLASSIFY_TABLE_OTHER,
50 } l2_classify_table_id_t;
54 // Next nodes for each feature
55 u32 feat_next_node_index[32];
57 /* Per-address-family classifier table vectors */
58 u32 * classify_table_index_by_sw_if_index [L2_CLASSIFY_N_TABLES];
60 /* convenience variables */
61 vlib_main_t * vlib_main;
62 vnet_main_t * vnet_main;
63 vnet_classify_main_t * vnet_classify_main;
66 l2_classify_main_t l2_classify_main;
68 vlib_node_registration_t l2_classify_node;
70 void vnet_l2_classify_enable_disable (u32 sw_if_index,
73 int vnet_l2_classify_set_tables (u32 sw_if_index, u32 ip4_table_index,
74 u32 ip6_table_index, u32 other_table_index);
76 #endif /* __included_vnet_l2_classify_h__ */