FD.io VPP
v20.05.1-6-gf53edbc3b
Vector Packet Processing
cop.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2016 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_cop_h__
17
#define __vnet_cop_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_COP_IP4
,
34
VNET_COP_IP6
,
35
VNET_COP_DEFAULT
,
36
VNET_N_COPS
,
37
}
vnet_cop_t
;
38
39
typedef
enum
{
40
/* First check src address against whitelist */
41
IP4_RX_COP_WHITELIST
,
42
IP6_RX_COP_WHITELIST
,
43
DEFAULT_RX_COP_WHITELIST
,
44
45
/* Pkts not otherwise dropped go to xxx-input */
46
IP4_RX_COP_INPUT
,
47
IP6_RX_COP_INPUT
,
48
DEFAULT_RX_COP_INPUT
,
49
50
/* Going, going, gone... */
51
RX_COP_DROP
,
52
53
COP_RX_N_FEATURES
,
54
}
cop_feature_type_t
;
55
56
typedef
struct
{
57
vnet_config_main_t
config_main
;
58
u32
*
config_index_by_sw_if_index
;
59
}
cop_config_main_t
;
60
61
typedef
struct
{
62
u32
fib_index
;
63
}
cop_config_data_t
;
64
65
typedef
struct
{
66
cop_config_main_t
cop_config_mains[
VNET_N_COPS
];
67
68
/* convenience */
69
vlib_main_t
*
vlib_main
;
70
vnet_main_t
*
vnet_main
;
71
}
cop_main_t
;
72
73
extern
cop_main_t
cop_main
;
74
75
extern
vlib_node_registration_t
cop_input_node
;
76
77
int
cop_interface_enable_disable
(
u32
sw_if_index
,
int
enable_disable);
78
79
typedef
struct
{
80
u32
sw_if_index
;
81
u8
ip4
;
82
u8
ip6
;
83
u8
default_cop
;
84
u32
fib_id
;
85
}
cop_whitelist_enable_disable_args_t
;
86
87
int
cop_whitelist_enable_disable
(
cop_whitelist_enable_disable_args_t
*
a
);
88
89
#endif
/* __vnet_cop_h__ */
VNET_COP_IP6
Definition:
cop.h:34
a
a
Definition:
bitmap.h:538
VNET_COP_DEFAULT
Definition:
cop.h:35
ip6_packet.h
cop_whitelist_enable_disable_args_t::sw_if_index
u32 sw_if_index
Definition:
cop.h:80
cop_whitelist_enable_disable_args_t::default_cop
u8 default_cop
Definition:
cop.h:83
cop_main
cop_main_t cop_main
Definition:
cop.c:17
ip.h
DEFAULT_RX_COP_WHITELIST
Definition:
cop.h:43
u8
unsigned char u8
Definition:
types.h:56
hash.h
cop_whitelist_enable_disable_args_t::ip4
u8 ip4
Definition:
cop.h:81
IP6_RX_COP_WHITELIST
Definition:
cop.h:42
RX_COP_DROP
Definition:
cop.h:51
DEFAULT_RX_COP_INPUT
Definition:
cop.h:48
cop_main_t::vnet_main
vnet_main_t * vnet_main
Definition:
cop.h:70
l2_input.h
IP4_RX_COP_WHITELIST
Definition:
cop.h:41
sw_if_index
vl_api_interface_index_t sw_if_index
Definition:
gre.api:53
IP6_RX_COP_INPUT
Definition:
cop.h:47
cop_config_main_t::config_index_by_sw_if_index
u32 * config_index_by_sw_if_index
Definition:
cop.h:58
u32
unsigned int u32
Definition:
types.h:88
VNET_COP_IP4
Definition:
cop.h:33
ethernet.h
vnet_config_main_t
Definition:
config.h:86
cop_input_node
vlib_node_registration_t cop_input_node
(constructor) VLIB_REGISTER_NODE (cop_input_node)
Definition:
node1.c:258
ip4_packet.h
cop_feature_type_t
cop_feature_type_t
Definition:
cop.h:39
VNET_N_COPS
Definition:
cop.h:36
cop_whitelist_enable_disable_args_t::fib_id
u32 fib_id
Definition:
cop.h:84
vnet.h
cop_config_main_t
Definition:
cop.h:56
cop_whitelist_enable_disable_args_t
Definition:
cop.h:79
vlib.h
pg.h
vnet_main_t
Definition:
vnet.h:51
cop_whitelist_enable_disable_args_t::ip6
u8 ip6
Definition:
cop.h:82
vnet_cop_t
vnet_cop_t
Definition:
cop.h:32
cop_config_data_t
Definition:
cop.h:61
COP_RX_N_FEATURES
Definition:
cop.h:53
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vlib_main_t
Definition:
main.h:83
IP4_RX_COP_INPUT
Definition:
cop.h:46
cop_interface_enable_disable
int cop_interface_enable_disable(u32 sw_if_index, int enable_disable)
Definition:
cop.c:149
error.h
cop_main_t::vlib_main
vlib_main_t * vlib_main
Definition:
cop.h:69
cop_whitelist_enable_disable
int cop_whitelist_enable_disable(cop_whitelist_enable_disable_args_t *a)
Definition:
cop.c:227
cop_main_t
Definition:
cop.h:65
cop_config_data_t::fib_index
u32 fib_index
Definition:
cop.h:62
cop_config_main_t::config_main
vnet_config_main_t config_main
Definition:
cop.h:57
src
vnet
cop
cop.h
Generated on Mon Oct 12 2020 16:04:43 for FD.io VPP by
1.8.13