xref: /dpdk/lib/table/rte_table_acl.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 
5 #ifndef __INCLUDE_RTE_TABLE_ACL_H__
6 #define __INCLUDE_RTE_TABLE_ACL_H__
7 
8 /**
9  * @file
10  * RTE Table ACL
11  *
12  * This table uses the Access Control List (ACL) algorithm to uniquely
13  * associate data to lookup keys.
14  *
15  * Use-cases: Firewall rule database, etc.
16  */
17 
18 #include <stdint.h>
19 
20 #include "rte_acl.h"
21 
22 #include "rte_table.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /** ACL table parameters */
29 struct rte_table_acl_params {
30 	/** Name */
31 	const char *name;
32 
33 	/** Maximum number of ACL rules in the table */
34 	uint32_t n_rules;
35 
36 	/** Number of fields in the ACL rule specification */
37 	uint32_t n_rule_fields;
38 
39 	/** Format specification of the fields of the ACL rule */
40 	struct rte_acl_field_def field_format[RTE_ACL_MAX_FIELDS];
41 };
42 
43 /** ACL rule specification for entry add operation */
44 struct rte_table_acl_rule_add_params {
45 	/** ACL rule priority, with 0 as the highest priority */
46 	int32_t  priority;
47 
48 	/** Values for the fields of the ACL rule to be added to the table */
49 	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
50 };
51 
52 /** ACL rule specification for entry delete operation */
53 struct rte_table_acl_rule_delete_params {
54 	/** Values for the fields of the ACL rule to be deleted from table */
55 	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
56 };
57 
58 /** ACL table operations */
59 extern struct rte_table_ops rte_table_acl_ops;
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif
66