199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause 299a2dd95SBruce Richardson * Copyright(c) 2010-2014 Intel Corporation 399a2dd95SBruce Richardson */ 499a2dd95SBruce Richardson 599a2dd95SBruce Richardson #ifndef __INCLUDE_RTE_TABLE_ACL_H__ 699a2dd95SBruce Richardson #define __INCLUDE_RTE_TABLE_ACL_H__ 799a2dd95SBruce Richardson 899a2dd95SBruce Richardson /** 999a2dd95SBruce Richardson * @file 1099a2dd95SBruce Richardson * RTE Table ACL 1199a2dd95SBruce Richardson * 1299a2dd95SBruce Richardson * This table uses the Access Control List (ACL) algorithm to uniquely 1399a2dd95SBruce Richardson * associate data to lookup keys. 1499a2dd95SBruce Richardson * 1599a2dd95SBruce Richardson * Use-cases: Firewall rule database, etc. 163e4c5be9SThomas Monjalon */ 1799a2dd95SBruce Richardson 1899a2dd95SBruce Richardson #include <stdint.h> 1999a2dd95SBruce Richardson 2099a2dd95SBruce Richardson #include "rte_acl.h" 2199a2dd95SBruce Richardson 2299a2dd95SBruce Richardson #include "rte_table.h" 2399a2dd95SBruce Richardson 24*719834a6SMattias Rönnblom #ifdef __cplusplus 25*719834a6SMattias Rönnblom extern "C" { 26*719834a6SMattias Rönnblom #endif 27*719834a6SMattias Rönnblom 2899a2dd95SBruce Richardson /** ACL table parameters */ 2999a2dd95SBruce Richardson struct rte_table_acl_params { 3099a2dd95SBruce Richardson /** Name */ 3199a2dd95SBruce Richardson const char *name; 3299a2dd95SBruce Richardson 3399a2dd95SBruce Richardson /** Maximum number of ACL rules in the table */ 3499a2dd95SBruce Richardson uint32_t n_rules; 3599a2dd95SBruce Richardson 3699a2dd95SBruce Richardson /** Number of fields in the ACL rule specification */ 3799a2dd95SBruce Richardson uint32_t n_rule_fields; 3899a2dd95SBruce Richardson 3999a2dd95SBruce Richardson /** Format specification of the fields of the ACL rule */ 4099a2dd95SBruce Richardson struct rte_acl_field_def field_format[RTE_ACL_MAX_FIELDS]; 4199a2dd95SBruce Richardson }; 4299a2dd95SBruce Richardson 4399a2dd95SBruce Richardson /** ACL rule specification for entry add operation */ 4499a2dd95SBruce Richardson struct rte_table_acl_rule_add_params { 4599a2dd95SBruce Richardson /** ACL rule priority, with 0 as the highest priority */ 4699a2dd95SBruce Richardson int32_t priority; 4799a2dd95SBruce Richardson 4899a2dd95SBruce Richardson /** Values for the fields of the ACL rule to be added to the table */ 4999a2dd95SBruce Richardson struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS]; 5099a2dd95SBruce Richardson }; 5199a2dd95SBruce Richardson 5299a2dd95SBruce Richardson /** ACL rule specification for entry delete operation */ 5399a2dd95SBruce Richardson struct rte_table_acl_rule_delete_params { 5499a2dd95SBruce Richardson /** Values for the fields of the ACL rule to be deleted from table */ 5599a2dd95SBruce Richardson struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS]; 5699a2dd95SBruce Richardson }; 5799a2dd95SBruce Richardson 5899a2dd95SBruce Richardson /** ACL table operations */ 5999a2dd95SBruce Richardson extern struct rte_table_ops rte_table_acl_ops; 6099a2dd95SBruce Richardson 6199a2dd95SBruce Richardson #ifdef __cplusplus 6299a2dd95SBruce Richardson } 6399a2dd95SBruce Richardson #endif 6499a2dd95SBruce Richardson 6599a2dd95SBruce Richardson #endif 66