FD.io VPP
v20.09-64-g4f7b92f0a
Vector Packet Processing
hash_lookup_types.h
Go to the documentation of this file.
1
/*
2
*------------------------------------------------------------------
3
* Copyright (c) 2017 Cisco and/or its affiliates.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at:
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*------------------------------------------------------------------
16
*/
17
18
#ifndef _ACL_HASH_LOOKUP_TYPES_H_
19
#define _ACL_HASH_LOOKUP_TYPES_H_
20
21
#include "
types.h
"
22
23
/* The structure representing the single entry with hash representation */
24
typedef
struct
{
25
fa_5tuple_t
match
;
26
/* these two entries refer to the original ACL# and rule# within that ACL */
27
u32
acl_index
;
28
u32
ace_index
;
29
30
u32
base_mask_type_index
;
31
32
u8
action
;
33
}
hash_ace_info_t
;
34
35
/*
36
* The structure holding the information necessary for the hash-based ACL operation
37
*/
38
typedef
struct
{
39
/* hash ACL applied on these lookup contexts */
40
u32
*
lc_index_list
;
41
hash_ace_info_t
*
rules
;
42
/* a boolean flag set when the hash acl info is initialized */
43
int
hash_acl_exists
;
44
}
hash_acl_info_t
;
45
46
47
typedef
struct
{
48
acl_rule_t
rule
;
49
u32
acl_index
;
50
u32
ace_index
;
51
u32
acl_position
;
52
u32
applied_entry_index
;
53
}
collision_match_rule_t
;
54
55
typedef
struct
{
56
/* original non-compiled ACL */
57
u32
acl_index
;
58
u32
ace_index
;
59
/* the index of the hash_ace_info_t */
60
u32
hash_ace_info_index
;
61
/* applied mask type index */
62
u32
mask_type_index
;
63
/*
64
* index of applied entry, which owns the colliding_rules vector
65
*/
66
u32
collision_head_ae_index
;
67
/*
68
* Collision rule vector for matching - set only on head entry
69
*/
70
collision_match_rule_t
*
colliding_rules
;
71
/*
72
* number of hits on this entry
73
*/
74
u64
hitcount
;
75
/*
76
* acl position in vector of ACLs within lookup context
77
*/
78
u32
acl_position
;
79
/*
80
* Action of this applied ACE
81
*/
82
u8
action
;
83
}
applied_hash_ace_entry_t
;
84
85
typedef
struct
{
86
87
/* applied ACLs so we can track them independently from main ACL module */
88
u32
*
applied_acls
;
89
}
applied_hash_acl_info_t
;
90
91
92
typedef
union
{
93
u64
as_u64
;
94
struct
{
95
u32
applied_entry_index
;
96
u16
reserved_u16
;
97
u8
reserved_u8
;
98
u8
reserved_flags
:8;
99
};
100
}
hash_acl_lookup_value_t
;
101
102
103
typedef
struct
{
104
u32
mask_type_index
;
105
/* first rule # for this mask */
106
u32
first_rule_index
;
107
/* Debug Information */
108
u32
num_entries
;
109
u32
max_collisions
;
110
}
hash_applied_mask_info_t
;
111
112
113
#define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
114
115
CT_ASSERT_EQUAL
(hash_acl_lookup_value_t_is_u64,
sizeof
(
hash_acl_lookup_value_t
),
sizeof
(
u64
));
116
117
#undef CT_ASSERT_EQUAL
118
119
#endif
hash_acl_lookup_value_t::reserved_flags
u8 reserved_flags
Definition:
hash_lookup_types.h:98
hash_ace_info_t::acl_index
u32 acl_index
Definition:
hash_lookup_types.h:27
hash_acl_lookup_value_t::reserved_u8
u8 reserved_u8
Definition:
hash_lookup_types.h:97
applied_hash_acl_info_t::applied_acls
u32 * applied_acls
Definition:
hash_lookup_types.h:88
applied_hash_ace_entry_t::acl_index
u32 acl_index
Definition:
hash_lookup_types.h:57
collision_match_rule_t::rule
acl_rule_t rule
Definition:
hash_lookup_types.h:48
u64
unsigned long u64
Definition:
types.h:89
hash_acl_info_t::hash_acl_exists
int hash_acl_exists
Definition:
hash_lookup_types.h:43
applied_hash_ace_entry_t::action
u8 action
Definition:
hash_lookup_types.h:82
applied_hash_ace_entry_t::hash_ace_info_index
u32 hash_ace_info_index
Definition:
hash_lookup_types.h:60
hash_ace_info_t::action
u8 action
Definition:
hash_lookup_types.h:32
hash_acl_lookup_value_t::applied_entry_index
u32 applied_entry_index
Definition:
hash_lookup_types.h:95
applied_hash_ace_entry_t
Definition:
hash_lookup_types.h:55
collision_match_rule_t::acl_index
u32 acl_index
Definition:
hash_lookup_types.h:49
u8
unsigned char u8
Definition:
types.h:56
collision_match_rule_t
Definition:
hash_lookup_types.h:47
hash_acl_lookup_value_t::reserved_u16
u16 reserved_u16
Definition:
hash_lookup_types.h:96
applied_hash_ace_entry_t::acl_position
u32 acl_position
Definition:
hash_lookup_types.h:78
hash_applied_mask_info_t
Definition:
hash_lookup_types.h:103
hash_ace_info_t::base_mask_type_index
u32 base_mask_type_index
Definition:
hash_lookup_types.h:30
u32
unsigned int u32
Definition:
types.h:88
hash_ace_info_t
Definition:
hash_lookup_types.h:24
hash_applied_mask_info_t::num_entries
u32 num_entries
Definition:
hash_lookup_types.h:108
applied_hash_ace_entry_t::colliding_rules
collision_match_rule_t * colliding_rules
Definition:
hash_lookup_types.h:70
hash_ace_info_t::ace_index
u32 ace_index
Definition:
hash_lookup_types.h:28
applied_hash_ace_entry_t::mask_type_index
u32 mask_type_index
Definition:
hash_lookup_types.h:62
collision_match_rule_t::applied_entry_index
u32 applied_entry_index
Definition:
hash_lookup_types.h:52
hash_acl_lookup_value_t::as_u64
u64 as_u64
Definition:
hash_lookup_types.h:93
u16
unsigned short u16
Definition:
types.h:57
hash_acl_info_t
Definition:
hash_lookup_types.h:38
applied_hash_ace_entry_t::hitcount
u64 hitcount
Definition:
hash_lookup_types.h:74
hash_acl_info_t::rules
hash_ace_info_t * rules
Definition:
hash_lookup_types.h:41
acl_rule_t
Definition:
types.h:21
hash_acl_lookup_value_t
Definition:
hash_lookup_types.h:92
collision_match_rule_t::acl_position
u32 acl_position
Definition:
hash_lookup_types.h:51
hash_applied_mask_info_t::max_collisions
u32 max_collisions
Definition:
hash_lookup_types.h:109
applied_hash_ace_entry_t::collision_head_ae_index
u32 collision_head_ae_index
Definition:
hash_lookup_types.h:66
applied_hash_acl_info_t
Definition:
hash_lookup_types.h:85
types.h
collision_match_rule_t::ace_index
u32 ace_index
Definition:
hash_lookup_types.h:50
CT_ASSERT_EQUAL
#define CT_ASSERT_EQUAL(name, x, y)
Definition:
hash_lookup_types.h:113
hash_applied_mask_info_t::mask_type_index
u32 mask_type_index
Definition:
hash_lookup_types.h:104
hash_ace_info_t::match
fa_5tuple_t match
Definition:
hash_lookup_types.h:25
hash_applied_mask_info_t::first_rule_index
u32 first_rule_index
Definition:
hash_lookup_types.h:106
applied_hash_ace_entry_t::ace_index
u32 ace_index
Definition:
hash_lookup_types.h:58
hash_acl_info_t::lc_index_list
u32 * lc_index_list
Definition:
hash_lookup_types.h:40
fa_5tuple_t
Definition:
fa_node.h:68
src
plugins
acl
hash_lookup_types.h
Generated on Thu Jun 3 2021 16:04:00 for FD.io VPP by
1.8.13