FD.io VPP  v17.10-9-gd594711
Vector Packet Processing
hash_lookup.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_H_
19 #define _ACL_HASH_LOOKUP_H_
20 
21 #include <stddef.h>
22 #include "acl.h"
23 
24 /*
25  * Do the necessary to logically apply the ACL to the existing vector of ACLs looked up
26  * during the packet processing
27  */
28 
29 void hash_acl_apply(acl_main_t *am, u32 sw_if_index, u8 is_input, int acl_index);
30 
31 /* Remove the ACL from the packet processing lookups on a given interface */
32 
33 void hash_acl_unapply(acl_main_t *am, u32 sw_if_index, u8 is_input, int acl_index);
34 
35 /*
36  * Add an ACL or delete an ACL. ACL may already have been referenced elsewhere,
37  * so potentially we also need to do the work to enable the lookups.
38  */
39 
40 void hash_acl_add(acl_main_t *am, int acl_index);
41 void hash_acl_delete(acl_main_t *am, int acl_index);
42 
43 /*
44  * Do the work required to match a given 5-tuple from the packet,
45  * and return the action as well as populate the values pointed
46  * to by the *_match_p pointers and maybe trace_bitmap.
47  */
48 
49 u8
50 hash_multi_acl_match_5tuple (u32 sw_if_index, fa_5tuple_t * pkt_5tuple, int is_l2,
51  int is_ip6, int is_input, u32 * acl_match_p,
52  u32 * rule_match_p, u32 * trace_bitmap);
53 
54 
55 /*
56  * The debug function to show the contents of the ACL lookup hash
57  */
58 void show_hash_acl_hash(vlib_main_t * vm, acl_main_t *am, u32 verbose);
59 
60 /* Debug functions to turn validate/trace on and off */
63 
64 #endif
void show_hash_acl_hash(vlib_main_t *vm, acl_main_t *am, u32 verbose)
Definition: hash_lookup.c:890
u8 hash_multi_acl_match_5tuple(u32 sw_if_index, fa_5tuple_t *pkt_5tuple, int is_l2, int is_ip6, int is_input, u32 *acl_match_p, u32 *rule_match_p, u32 *trace_bitmap)
Definition: hash_lookup.c:871
void hash_acl_unapply(acl_main_t *am, u32 sw_if_index, u8 is_input, int acl_index)
Definition: hash_lookup.c:524
void hash_acl_delete(acl_main_t *am, int acl_index)
Definition: hash_lookup.c:827
vlib_main_t * vm
Definition: buffer.c:283
void hash_acl_apply(acl_main_t *am, u32 sw_if_index, u8 is_input, int acl_index)
Definition: hash_lookup.c:303
unsigned int u32
Definition: types.h:88
void hash_acl_add(acl_main_t *am, int acl_index)
Definition: hash_lookup.c:770
unsigned char u8
Definition: types.h:56
void acl_plugin_hash_acl_set_trace_heap(acl_main_t *am, int on)
Definition: hash_lookup.c:291
void acl_plugin_hash_acl_set_validate_heap(acl_main_t *am, int on)
Definition: hash_lookup.c:276