aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_table/rte_table_acl.h
blob: 516819213cb45d09d9f413b04d0f46a6f10cdfa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2010-2014 Intel Corporation
 */

#ifndef __INCLUDE_RTE_TABLE_ACL_H__
#define __INCLUDE_RTE_TABLE_ACL_H__

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @file
 * RTE Table ACL
 *
 * This table uses the Access Control List (ACL) algorithm to uniquely
 * associate data to lookup keys.
 *
 * Use-cases: Firewall rule database, etc.
 *
 ***/

#include <stdint.h>

#include "rte_acl.h"

#include "rte_table.h"

/** ACL table parameters */
struct rte_table_acl_params {
	/** Name */
	const char *name;

	/** Maximum number of ACL rules in the table */
	uint32_t n_rules;

	/** Number of fields in the ACL rule specification */
	uint32_t n_rule_fields;

	/** Format specification of the fields of the ACL rule */
	struct rte_acl_field_def field_format[RTE_ACL_MAX_FIELDS];
};

/** ACL rule specification for entry add operation */
struct rte_table_acl_rule_add_params {
	/** ACL rule priority, with 0 as the highest priority */
	int32_t  priority;

	/** Values for the fields of the ACL rule to be added to the table */
	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
};

/** ACL rule specification for entry delete operation */
struct rte_table_acl_rule_delete_params {
	/** Values for the fields of the ACL rule to be deleted from table */
	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
};

/** ACL table operations */
extern struct rte_table_ops rte_table_acl_ops;

#ifdef __cplusplus
}
#endif

#endif