FD.io VPP  v21.10.1-2-g0a485f517
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/ethernet/ethernet.h>
22 #include <vnet/ethernet/packet.h>
23 #include <vnet/ip/ip_packet.h>
24 #include <vnet/ip/ip4_packet.h>
25 #include <vnet/ip/ip6_packet.h>
26 #include <vlib/cli.h>
27 #include <vnet/l2/l2_input.h>
28 #include <vnet/l2/l2_output.h>
29 #include <vnet/l2/feat_bitmap.h>
30 #include <vppinfra/error.h>
31 #include <vppinfra/hash.h>
32 #include <vppinfra/cache.h>
33 
35 
36 typedef enum
37 {
45 
46 typedef enum
47 {
53 
54 typedef enum
55 {
59 
60 typedef enum
61 {
67 
68 typedef struct _l2_classify_main
69 {
70  /* Next nodes for L2 input and output features */
71  u32 l2_inp_feat_next[32];
72  u32 l2_out_feat_next[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  /* convenience variables */
82 
83 typedef struct _l2_classify_main l2_output_classify_main_t;
84 
87 
90 
92  int enable_disable);
93 
95  u32 ip6_table_index,
96  u32 other_table_index);
97 
99  int enable_disable);
100 
102  u32 ip6_table_index,
103  u32 other_table_index);
104 
105 #endif /* __included_vnet_l2_input_classify_h__ */
106 
107 /*
108  * fd.io coding-style-patch-verification: ON
109  *
110  * Local Variables:
111  * eval: (c-set-style "gnu")
112  * End:
113  */
vlib.h
L2_INPUT_CLASSIFY_NEXT_LI
@ L2_INPUT_CLASSIFY_NEXT_LI
Definition: l2_classify.h:42
L2_INPUT_CLASSIFY_TABLE_IP6
@ L2_INPUT_CLASSIFY_TABLE_IP6
Definition: l2_classify.h:49
L2_OUTPUT_CLASSIFY_N_TABLES
@ L2_OUTPUT_CLASSIFY_N_TABLES
Definition: l2_classify.h:65
l2_input_classify_node
vlib_node_registration_t l2_input_classify_node
(constructor) VLIB_REGISTER_NODE (l2_input_classify_node)
Definition: l2_input_classify.c:447
L2_INPUT_CLASSIFY_NEXT_IP6_INPUT
@ L2_INPUT_CLASSIFY_NEXT_IP6_INPUT
Definition: l2_classify.h:41
l2_output_classify_main_t
struct _l2_classify_main l2_output_classify_main_t
Definition: l2_classify.h:83
vnet_l2_output_classify_enable_disable
void vnet_l2_output_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.
Definition: l2_output_classify.c:506
l2_input_classify_main
l2_input_classify_main_t l2_input_classify_main
l2 input classifier main data structure.
Definition: l2_input_classify.c:74
vnet_classify_main
vnet_classify_main_t vnet_classify_main
Definition: vnet_classify.c:32
L2_INPUT_CLASSIFY_N_NEXT
@ L2_INPUT_CLASSIFY_N_NEXT
Definition: l2_classify.h:43
l2_input_classify_table_id_t
l2_input_classify_table_id_t
Definition: l2_classify.h:46
L2_INPUT_CLASSIFY_N_TABLES
@ L2_INPUT_CLASSIFY_N_TABLES
Definition: l2_classify.h:51
L2_OUTPUT_CLASSIFY_NEXT_DROP
@ L2_OUTPUT_CLASSIFY_NEXT_DROP
Definition: l2_classify.h:56
L2_OUTPUT_CLASSIFY_TABLE_IP4
@ L2_OUTPUT_CLASSIFY_TABLE_IP4
Definition: l2_classify.h:62
ip_packet.h
ethernet.h
ip6_packet.h
L2_INPUT_CLASSIFY_NEXT_IP4_INPUT
@ L2_INPUT_CLASSIFY_NEXT_IP4_INPUT
Definition: l2_classify.h:40
hash.h
L2_INPUT_CLASSIFY_NEXT_ETHERNET_INPUT
@ L2_INPUT_CLASSIFY_NEXT_ETHERNET_INPUT
Definition: l2_classify.h:39
l2_output_classify_table_id_t
l2_output_classify_table_id_t
Definition: l2_classify.h:60
packet.h
error.h
l2_output.h
l2_input_classify_next_t
l2_input_classify_next_t
Definition: l2_classify.h:36
L2_INPUT_CLASSIFY_NEXT_DROP
@ L2_INPUT_CLASSIFY_NEXT_DROP
Definition: l2_classify.h:38
L2_OUTPUT_CLASSIFY_TABLE_OTHER
@ L2_OUTPUT_CLASSIFY_TABLE_OTHER
Definition: l2_classify.h:64
L2_INPUT_CLASSIFY_TABLE_OTHER
@ L2_INPUT_CLASSIFY_TABLE_OTHER
Definition: l2_classify.h:50
L2_INPUT_CLASSIFY_TABLE_IP4
@ L2_INPUT_CLASSIFY_TABLE_IP4
Definition: l2_classify.h:48
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
l2_input.h
ip4_packet.h
vnet_main_t
Definition: vnet.h:76
cache.h
l2_output_classify_node
vlib_node_registration_t l2_output_classify_node
(constructor) VLIB_REGISTER_NODE (l2_output_classify_node)
Definition: l2_output_classify.c:440
vnet_l2_output_classify_set_tables
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.
Definition: l2_output_classify.c:525
u32
unsigned int u32
Definition: types.h:88
cli.h
vnet_classify_main_t
struct _vnet_classify_main vnet_classify_main_t
Definition: vnet_classify.h:61
vnet_classify.h
l2_input_classify_main_t
struct _l2_classify_main l2_input_classify_main_t
vnet_main
vnet_main_t vnet_main
Definition: misc.c:43
vlib_main_t
Definition: main.h:102
feat_bitmap.h
vnet_l2_input_classify_set_tables
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.
Definition: l2_input_classify.c:535
L2_OUTPUT_CLASSIFY_N_NEXT
@ L2_OUTPUT_CLASSIFY_N_NEXT
Definition: l2_classify.h:57
l2_output_classify_next_t
l2_output_classify_next_t
Definition: l2_classify.h:54
l2_output_classify_main
l2_output_classify_main_t l2_output_classify_main
l2 output classifier main data structure.
Definition: l2_output_classify.c:66
L2_OUTPUT_CLASSIFY_TABLE_IP6
@ L2_OUTPUT_CLASSIFY_TABLE_IP6
Definition: l2_classify.h:63
vlib_main
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
Definition: main.c:1914
vnet.h
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vnet_l2_input_classify_enable_disable
void vnet_l2_input_classify_enable_disable(u32 sw_if_index, int enable_disable)
Enable/disable l2 input classification on a specific interface.
Definition: l2_input_classify.c:517