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:
8 * http://www.apache.org/licenses/LICENSE-2.0
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 *------------------------------------------------------------------
18 #ifndef _ACL_HASH_LOOKUP_TYPES_H_
19 #define _ACL_HASH_LOOKUP_TYPES_H_
23 /* The structure representing the single entry with hash representation */
26 /* these two entries refer to the original ACL# and rule# within that ACL */
30 u32 base_mask_type_index;
36 * The structure holding the information necessary for the hash-based ACL operation
39 /* hash ACL applied on these lookup contexts */
41 hash_ace_info_t *rules;
42 /* a boolean flag set when the hash acl info is initialized */
52 u32 applied_entry_index;
53 } collision_match_rule_t;
56 /* original non-compiled ACL */
59 /* the index of the hash_ace_info_t */
60 u32 hash_ace_info_index;
61 /* applied mask type index */
64 * index of applied entry, which owns the colliding_rules vector
66 u32 collision_head_ae_index;
68 * Collision rule vector for matching - set only on head entry
70 collision_match_rule_t *colliding_rules;
72 * number of hits on this entry
76 * acl position in vector of ACLs within lookup context
80 * Action of this applied ACE
83 } applied_hash_ace_entry_t;
87 /* applied ACLs so we can track them independently from main ACL module */
89 } applied_hash_acl_info_t;
95 u32 applied_entry_index;
100 } hash_acl_lookup_value_t;
105 /* first rule # for this mask */
106 u32 first_rule_index;
107 /* Debug Information */
110 } hash_applied_mask_info_t;
113 #define CT_ASSERT_EQUAL(name, x,y) typedef int assert_ ## name ## _compile_time_assertion_failed[((x) == (y))-1]
115 CT_ASSERT_EQUAL(hash_acl_lookup_value_t_is_u64, sizeof(hash_acl_lookup_value_t), sizeof(u64));
117 #undef CT_ASSERT_EQUAL