FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
adl.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016,2020 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 __vnet_adl_h__
17
#define __vnet_adl_h__
18
19
#include <
vlib/vlib.h
>
20
#include <
vnet/vnet.h
>
21
#include <
vnet/pg/pg.h
>
22
23
#include <
vppinfra/error.h
>
24
#include <
vppinfra/hash.h
>
25
#include <
vnet/vnet.h
>
26
#include <
vnet/ip/ip.h
>
27
#include <
vnet/l2/l2_input.h
>
28
#include <
vnet/ethernet/ethernet.h
>
29
#include <
vnet/ip/ip4_packet.h
>
30
#include <
vnet/ip/ip6_packet.h
>
31
32
typedef
enum
{
33
VNET_ADL_IP4
,
34
VNET_ADL_IP6
,
35
VNET_ADL_DEFAULT
,
36
VNET_N_ADLS
,
37
}
vnet_adl_t
;
38
39
typedef
enum
{
40
/* First check src address against allowlist */
41
IP4_RX_ADL_ALLOWLIST
,
42
IP6_RX_ADL_ALLOWLIST
,
43
DEFAULT_RX_ADL_ALLOWLIST
,
44
45
/* Pkts not otherwise dropped go to xxx-input */
46
IP4_RX_ADL_INPUT
,
47
IP6_RX_ADL_INPUT
,
48
DEFAULT_RX_ADL_INPUT
,
49
50
/* Going, going, gone... */
51
RX_ADL_DROP
,
52
53
ADL_RX_N_FEATURES
,
54
}
adl_feature_type_t
;
55
56
typedef
struct
{
57
vnet_config_main_t
config_main
;
58
u32
*
config_index_by_sw_if_index
;
59
}
adl_config_main_t
;
60
61
typedef
struct
{
62
u32
fib_index
;
63
}
adl_config_data_t
;
64
65
typedef
struct
{
66
adl_config_main_t
adl_config_mains[
VNET_N_ADLS
];
67
68
u16
msg_id_base
;
69
70
/* convenience */
71
vlib_main_t
*
vlib_main
;
72
vnet_main_t
*
vnet_main
;
73
}
adl_main_t
;
74
75
extern
adl_main_t
adl_main
;
76
77
extern
vlib_node_registration_t
adl_input_node
;
78
79
int
adl_interface_enable_disable
(
u32
sw_if_index
,
int
enable_disable);
80
81
typedef
struct
{
82
u32
sw_if_index
;
83
u8
ip4
;
84
u8
ip6
;
85
u8
default_adl
;
86
u32
fib_id
;
87
}
adl_allowlist_enable_disable_args_t
;
88
89
int
adl_allowlist_enable_disable
(
adl_allowlist_enable_disable_args_t
*
a
);
90
91
/* Plugin private opaque union type */
92
typedef
struct
{
93
/* MUST be in sync with .../src/vnet/buffer.h */
94
u32
sw_if_index
[
VLIB_N_RX_TX
];
95
i16
l2_hdr_offset
;
96
i16
l3_hdr_offset
;
97
i16
l4_hdr_offset
;
98
u8
feature_arc_index
;
99
u8
dont_waste_me
;
100
/* end of must be in sync with .../src/vnet/buffer.h */
101
union
102
{
103
/* COP - configurable junk filter(s) */
104
struct
105
{
106
/* Current configuration index. */
107
u32
current_config_index
;
108
} adl;
109
};
110
}
adl_buffer_opaque_t
;
111
112
#define adl_buffer(b) ((adl_buffer_opaque_t *) (b)->opaque)
113
114
#endif
/* __vnet_adl_h__ */
IP4_RX_ADL_INPUT
Definition:
adl.h:46
a
a
Definition:
bitmap.h:538
IP4_RX_ADL_ALLOWLIST
Definition:
adl.h:41
DEFAULT_RX_ADL_INPUT
Definition:
adl.h:48
adl_allowlist_enable_disable_args_t::ip4
u8 ip4
Definition:
adl.h:83
ip6_packet.h
adl_allowlist_enable_disable_args_t::default_adl
u8 default_adl
Definition:
adl.h:85
adl_buffer_opaque_t::l3_hdr_offset
i16 l3_hdr_offset
Definition:
adl.h:96
ip.h
adl_config_main_t
Definition:
adl.h:56
u8
unsigned char u8
Definition:
types.h:56
adl_main_t
Definition:
adl.h:65
hash.h
adl_allowlist_enable_disable_args_t::sw_if_index
u32 sw_if_index
Definition:
adl.h:82
adl_buffer_opaque_t::l4_hdr_offset
i16 l4_hdr_offset
Definition:
adl.h:97
l2_input.h
adl_main_t::msg_id_base
u16 msg_id_base
Definition:
adl.h:68
adl_buffer_opaque_t::current_config_index
u32 current_config_index
Definition:
adl.h:107
u32
unsigned int u32
Definition:
types.h:88
adl_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
adl.h:71
VNET_ADL_DEFAULT
Definition:
adl.h:35
adl_buffer_opaque_t::l2_hdr_offset
i16 l2_hdr_offset
Definition:
adl.h:95
ethernet.h
vnet_config_main_t
Definition:
config.h:86
ip4_packet.h
VLIB_N_RX_TX
Definition:
defs.h:48
u16
unsigned short u16
Definition:
types.h:57
adl_main
adl_main_t adl_main
Definition:
adl.c:20
adl_config_main_t::config_main
vnet_config_main_t config_main
Definition:
adl.h:57
vnet.h
adl_allowlist_enable_disable
int adl_allowlist_enable_disable(adl_allowlist_enable_disable_args_t *a)
Definition:
adl.c:233
adl_config_data_t
Definition:
adl.h:61
adl_interface_enable_disable
int adl_interface_enable_disable(u32 sw_if_index, int enable_disable)
Definition:
adl.c:169
ADL_RX_N_FEATURES
Definition:
adl.h:53
adl_allowlist_enable_disable_args_t::ip6
u8 ip6
Definition:
adl.h:84
vlib.h
pg.h
adl_config_data_t::fib_index
u32 fib_index
Definition:
adl.h:62
vnet_main_t
Definition:
vnet.h:54
adl_buffer_opaque_t::feature_arc_index
u8 feature_arc_index
Definition:
adl.h:98
adl_buffer_opaque_t
Definition:
adl.h:92
DEFAULT_RX_ADL_ALLOWLIST
Definition:
adl.h:43
adl_config_main_t::config_index_by_sw_if_index
u32 * config_index_by_sw_if_index
Definition:
adl.h:58
adl_input_node
vlib_node_registration_t adl_input_node
(constructor) VLIB_REGISTER_NODE (adl_input_node)
Definition:
node.c:259
adl_allowlist_enable_disable_args_t::fib_id
u32 fib_id
Definition:
adl.h:86
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
adl_feature_type_t
adl_feature_type_t
Definition:
adl.h:39
vnet_adl_t
vnet_adl_t
Definition:
adl.h:32
IP6_RX_ADL_INPUT
Definition:
adl.h:47
vlib_main_t
Definition:
main.h:120
IP6_RX_ADL_ALLOWLIST
Definition:
adl.h:42
VNET_ADL_IP4
Definition:
adl.h:33
VNET_ADL_IP6
Definition:
adl.h:34
error.h
VNET_N_ADLS
Definition:
adl.h:36
adl_buffer_opaque_t::dont_waste_me
u8 dont_waste_me
Definition:
adl.h:99
adl_allowlist_enable_disable_args_t
Definition:
adl.h:81
adl_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
adl.h:72
sw_if_index
vl_api_interface_index_t sw_if_index
Definition:
wireguard.api:33
i16
signed short i16
Definition:
types.h:46
RX_ADL_DROP
Definition:
adl.h:51
src
plugins
adl
adl.h
Generated on Thu Jun 3 2021 16:04:01 for FD.io VPP by
1.8.13