FD.io VPP
v18.04-17-g3a0d853
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
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
/* The structure representing the single entry with hash representation */
22
typedef
struct
{
23
/* these two entries refer to the original ACL# and rule# within that ACL */
24
u32
acl_index
;
25
u32
ace_index
;
26
27
u32
mask_type_index
;
28
u8
src_portrange_not_powerof2
;
29
u8
dst_portrange_not_powerof2
;
30
31
fa_5tuple_t
match
;
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
/* The mask types present in this ACL */
40
uword
*
mask_type_index_bitmap
;
41
/* hash ACL applied on these lookup contexts */
42
u32
*
lc_index_list
;
43
hash_ace_info_t
*
rules
;
44
/* a boolean flag set when the hash acl info is initialized */
45
int
hash_acl_exists
;
46
}
hash_acl_info_t
;
47
48
typedef
struct
{
49
/* original non-compiled ACL */
50
u32
acl_index
;
51
u32
ace_index
;
52
/* the index of the hash_ace_info_t */
53
u32
hash_ace_info_index
;
54
/*
55
* in case of the same key having multiple entries,
56
* this holds the index of the next entry.
57
*/
58
u32
next_applied_entry_index
;
59
/*
60
* previous entry in the list of the chained ones,
61
* if ~0 then this is entry in the hash.
62
*/
63
u32
prev_applied_entry_index
;
64
/*
65
* chain tail, if this is the first entry
66
*/
67
u32
tail_applied_entry_index
;
68
/*
69
* number of hits on this entry
70
*/
71
u64
hitcount
;
72
/*
73
* acl position in vector of ACLs within lookup context
74
*/
75
u32
acl_position
;
76
/*
77
* Action of this applied ACE
78
*/
79
u8
action
;
80
}
applied_hash_ace_entry_t
;
81
82
typedef
struct
{
83
/*
84
* A logical OR of all the applied_ace_hash_entry_t=>
85
* hash_ace_info_t=>mask_type_index bits set
86
*/
87
uword
*
mask_type_index_bitmap
;
88
/* applied ACLs so we can track them independently from main ACL module */
89
u32
*
applied_acls
;
90
}
applied_hash_acl_info_t
;
91
92
93
typedef
union
{
94
u64
as_u64
;
95
struct
{
96
u32
applied_entry_index
;
97
u16
reserved_u16
;
98
u8
reserved_u8
;
99
/* means there is some other entry in front intersecting with this one */
100
u8
shadowed:1;
101
u8
need_portrange_check:1;
102
u8
reserved_flags:6;
103
};
104
}
hash_acl_lookup_value_t
;
105
106
#define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
107
108
CT_ASSERT_EQUAL
(hash_acl_lookup_value_t_is_u64,
sizeof
(
hash_acl_lookup_value_t
),
sizeof
(
u64
));
109
110
#undef CT_ASSERT_EQUAL
111
112
#endif
hash_ace_info_t::acl_index
u32 acl_index
Definition:
hash_lookup_types.h:24
hash_acl_lookup_value_t::reserved_u8
u8 reserved_u8
Definition:
hash_lookup_types.h:98
applied_hash_acl_info_t::applied_acls
u32 * applied_acls
Definition:
hash_lookup_types.h:89
applied_hash_ace_entry_t::acl_index
u32 acl_index
Definition:
hash_lookup_types.h:50
hash_acl_info_t::hash_acl_exists
int hash_acl_exists
Definition:
hash_lookup_types.h:45
applied_hash_ace_entry_t::action
u8 action
Definition:
hash_lookup_types.h:79
applied_hash_ace_entry_t::hash_ace_info_index
u32 hash_ace_info_index
Definition:
hash_lookup_types.h:53
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:96
applied_hash_ace_entry_t
Definition:
hash_lookup_types.h:48
hash_acl_lookup_value_t::reserved_u16
u16 reserved_u16
Definition:
hash_lookup_types.h:97
applied_hash_ace_entry_t::acl_position
u32 acl_position
Definition:
hash_lookup_types.h:75
applied_hash_ace_entry_t::next_applied_entry_index
u32 next_applied_entry_index
Definition:
hash_lookup_types.h:58
u64
unsigned long u64
Definition:
types.h:89
hash_ace_info_t
Definition:
hash_lookup_types.h:22
hash_acl_info_t::mask_type_index_bitmap
uword * mask_type_index_bitmap
Definition:
hash_lookup_types.h:40
hash_ace_info_t::ace_index
u32 ace_index
Definition:
hash_lookup_types.h:25
hash_ace_info_t::dst_portrange_not_powerof2
u8 dst_portrange_not_powerof2
Definition:
hash_lookup_types.h:29
hash_acl_lookup_value_t::as_u64
u64 as_u64
Definition:
hash_lookup_types.h:94
hash_acl_info_t
Definition:
hash_lookup_types.h:38
applied_hash_ace_entry_t::hitcount
u64 hitcount
Definition:
hash_lookup_types.h:71
hash_acl_info_t::rules
hash_ace_info_t * rules
Definition:
hash_lookup_types.h:43
applied_hash_acl_info_t::mask_type_index_bitmap
uword * mask_type_index_bitmap
Definition:
hash_lookup_types.h:87
hash_acl_lookup_value_t
Definition:
hash_lookup_types.h:93
u32
unsigned int u32
Definition:
types.h:88
applied_hash_acl_info_t
Definition:
hash_lookup_types.h:82
uword
u64 uword
Definition:
types.h:112
applied_hash_ace_entry_t::prev_applied_entry_index
u32 prev_applied_entry_index
Definition:
hash_lookup_types.h:63
u16
unsigned short u16
Definition:
types.h:57
u8
unsigned char u8
Definition:
types.h:56
CT_ASSERT_EQUAL
#define CT_ASSERT_EQUAL(name, x, y)
Definition:
hash_lookup_types.h:106
hash_ace_info_t::mask_type_index
u32 mask_type_index
Definition:
hash_lookup_types.h:27
applied_hash_ace_entry_t::tail_applied_entry_index
u32 tail_applied_entry_index
Definition:
hash_lookup_types.h:67
hash_ace_info_t::match
fa_5tuple_t match
Definition:
hash_lookup_types.h:31
hash_ace_info_t::src_portrange_not_powerof2
u8 src_portrange_not_powerof2
Definition:
hash_lookup_types.h:28
applied_hash_ace_entry_t::ace_index
u32 ace_index
Definition:
hash_lookup_types.h:51
hash_acl_info_t::lc_index_list
u32 * lc_index_list
Definition:
hash_lookup_types.h:42
fa_5tuple_t
Definition:
fa_node.h:47
src
plugins
acl
hash_lookup_types.h
Generated on Mon Oct 1 2018 08:01:53 for FD.io VPP by
1.8.11