FD.io VPP  v17.01.1-3-gc6833f8
Vector Packet Processing
l2_classify.h
Go to the documentation of this file.
1 /*
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:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 
16 #ifndef __included_vnet_l2_input_classify_h__
17 #define __included_vnet_l2_input_classify_h__
18 
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>
27 #include <vlib/cli.h>
28 #include <vnet/l2/l2_input.h>
29 #include <vnet/l2/l2_output.h>
30 #include <vnet/l2/feat_bitmap.h>
31 #include <vppinfra/error.h>
32 #include <vppinfra/hash.h>
33 #include <vppinfra/cache.h>
34 
36 
37 typedef enum
38 {
46 
47 typedef enum
48 {
54 
55 typedef enum
56 {
60 
61 typedef enum
62 {
68 
69 typedef struct _l2_classify_main
70 {
71  /* Next nodes for each feature */
72  u32 feat_next_node_index[32];
73 
74  /* Per-address-family classifier table vectors */
75  u32 *classify_table_index_by_sw_if_index[L2_INPUT_CLASSIFY_N_TABLES];
76 
77  /* Next nodes for features and output interfaces */
78  l2_output_next_nodes_st next_nodes;
79 
80  /* convenience variables */
85 
86 typedef struct _l2_classify_main l2_output_classify_main_t;
87 
90 
93 
95  int enable_disable);
96 
97 int vnet_l2_input_classify_set_tables (u32 sw_if_index, u32 ip4_table_index,
98  u32 ip6_table_index,
99  u32 other_table_index);
100 
102  int enable_disable);
103 
104 int vnet_l2_output_classify_set_tables (u32 sw_if_index, u32 ip4_table_index,
105  u32 ip6_table_index,
106  u32 other_table_index);
107 
108 #endif /* __included_vnet_l2_input_classify_h__ */
109 
110 /*
111  * fd.io coding-style-patch-verification: ON
112  *
113  * Local Variables:
114  * eval: (c-set-style "gnu")
115  * End:
116  */
struct _vlib_node_registration vlib_node_registration_t
void vnet_l2_input_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.
vlib_node_registration_t l2_input_classify_node
(constructor) VLIB_REGISTER_NODE (l2_input_classify_node)
vlib_node_registration_t l2_output_classify_node
(constructor) VLIB_REGISTER_NODE (l2_output_classify_node)
int vnet_l2_output_classify_set_tables(u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 other_table_index)
Set l2 per-protocol, per-interface output classification tables.
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
Definition: main.c:1599
l2_input_classify_table_id_t
Definition: l2_classify.h:47
l2_output_classify_main_t l2_output_classify_main
l2 output classifier main data structure.
struct _l2_classify_main l2_output_classify_main_t
Definition: l2_classify.h:86
vnet_main_t vnet_main
Definition: misc.c:43
l2_output_classify_next_t
Definition: l2_classify.h:55
l2_input_classify_main_t l2_input_classify_main
l2 input classifier main data structure.
int vnet_l2_input_classify_set_tables(u32 sw_if_index, u32 ip4_table_index, u32 ip6_table_index, u32 other_table_index)
Set l2 per-protocol, per-interface input classification tables.
struct _vnet_classify_main vnet_classify_main_t
Definition: vnet_classify.h:69
unsigned int u32
Definition: types.h:88
l2_output_classify_table_id_t
Definition: l2_classify.h:61
l2_input_classify_next_t
Definition: l2_classify.h:37
vnet_classify_main_t vnet_classify_main
Definition: vnet_classify.c:22
struct _l2_classify_main l2_input_classify_main_t
void vnet_l2_output_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.