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:
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 __vnet_adl_h__
17 #define __vnet_adl_h__
19 #include <vlib/vlib.h>
20 #include <vnet/vnet.h>
22 #include <vppinfra/error.h>
23 #include <vppinfra/hash.h>
24 #include <vnet/vnet.h>
25 #include <vnet/ip/ip.h>
26 #include <vnet/l2/l2_input.h>
27 #include <vnet/ethernet/ethernet.h>
28 #include <vnet/ip/ip4_packet.h>
29 #include <vnet/ip/ip6_packet.h>
39 /* First check src address against allowlist */
42 DEFAULT_RX_ADL_ALLOWLIST,
44 /* Pkts not otherwise dropped go to xxx-input */
49 /* Going, going, gone... */
56 vnet_config_main_t config_main;
57 u32 * config_index_by_sw_if_index;
65 adl_config_main_t adl_config_mains[VNET_N_ADLS];
70 vlib_main_t * vlib_main;
71 vnet_main_t * vnet_main;
74 extern adl_main_t adl_main;
76 extern vlib_node_registration_t adl_input_node;
78 int adl_interface_enable_disable (u32 sw_if_index, int enable_disable);
86 } adl_allowlist_enable_disable_args_t;
88 int adl_allowlist_enable_disable (adl_allowlist_enable_disable_args_t *a);
90 /* Plugin private opaque union type */
92 /* MUST be in sync with .../src/vnet/buffer.h */
93 u32 sw_if_index[VLIB_N_RX_TX];
99 /* end of must be in sync with .../src/vnet/buffer.h */
102 /* COP - configurable junk filter(s) */
105 /* Current configuration index. */
106 u32 current_config_index;
109 } adl_buffer_opaque_t;
111 #define adl_buffer(b) ((adl_buffer_opaque_t *) (b)->opaque)
113 #endif /* __vnet_adl_h__ */