acl-plugin: implement ACL lookup contexts for "ACL as a service" use by other plugins
[vpp.git] / src / plugins / acl / lookup_context.h
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef included_acl_lookup_context_h
17 #define included_acl_lookup_context_h
18
19 typedef struct {
20   /* A name of the portion of the code using the ACL infra */
21   char *user_module_name;
22   /* text label for the first u32 user value assigned to context */
23   char *val1_label;
24   /* text label for the second u32 user value assigned to context */
25   char *val2_label;
26   /* vector of lookup contexts of this user */
27   u32 *lookup_contexts;
28 } acl_lookup_context_user_t;
29
30 typedef struct {
31   /* vector of acl #s within this context */
32   u32 *acl_indices;
33   /* index of corresponding acl_lookup_context_user_t */
34   u32 context_user_id;
35   /* per-instance user value 1 */
36   u32 user_val1;
37   /* per-instance user value 2 */
38   u32 user_val2;
39 } acl_lookup_context_t;
40
41 void acl_plugin_lookup_context_notify_acl_change(u32 acl_num);
42
43 void acl_plugin_show_lookup_context (u32 lc_index);
44 void acl_plugin_show_lookup_user (u32 user_index);
45
46
47 /* These are in the hash matching for now */
48 void acl_plugin_show_tables_mask_type (void);
49 void acl_plugin_show_tables_acl_hash_info (u32 acl_index);
50 void acl_plugin_show_tables_applied_info (u32 sw_if_index);
51 void acl_plugin_show_tables_bihash (u32 show_bihash_verbose);
52
53 /* Debug functions to turn validate/trace on and off */
54 void acl_plugin_hash_acl_set_validate_heap(int on);
55 void acl_plugin_hash_acl_set_trace_heap(int on);
56
57
58
59 #endif
60