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