FD.io VPP  v18.04-17-g3a0d853
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 /* 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 */
26 
30 
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 */
41  /* hash ACL applied on these lookup contexts */
44  /* a boolean flag set when the hash acl info is initialized */
47 
48 typedef struct {
49  /* original non-compiled ACL */
52  /* the index of the hash_ace_info_t */
54  /*
55  * in case of the same key having multiple entries,
56  * this holds the index of the next entry.
57  */
59  /*
60  * previous entry in the list of the chained ones,
61  * if ~0 then this is entry in the hash.
62  */
64  /*
65  * chain tail, if this is the first entry
66  */
68  /*
69  * number of hits on this entry
70  */
72  /*
73  * acl position in vector of ACLs within lookup context
74  */
76  /*
77  * Action of this applied ACE
78  */
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  */
88  /* applied ACLs so we can track them independently from main ACL module */
91 
92 
93 typedef union {
95  struct {
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  };
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
u32 acl_index
u8 action
u32 hash_ace_info_index
u32 acl_position
u32 next_applied_entry_index
unsigned long u64
Definition: types.h:89
uword * mask_type_index_bitmap
u64 hitcount
hash_ace_info_t * rules
unsigned int u32
Definition: types.h:88
u64 uword
Definition: types.h:112
u32 prev_applied_entry_index
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56
#define CT_ASSERT_EQUAL(name, x, y)
u32 tail_applied_entry_index
u32 ace_index