15129044dSC.J. Collier/*-
25129044dSC.J. Collier *   BSD LICENSE
35129044dSC.J. Collier *
45129044dSC.J. Collier *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
55129044dSC.J. Collier *   All rights reserved.
65129044dSC.J. Collier *
75129044dSC.J. Collier *   Redistribution and use in source and binary forms, with or without
85129044dSC.J. Collier *   modification, are permitted provided that the following conditions
95129044dSC.J. Collier *   are met:
105129044dSC.J. Collier *
115129044dSC.J. Collier *     * Redistributions of source code must retain the above copyright
125129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer.
135129044dSC.J. Collier *     * Redistributions in binary form must reproduce the above copyright
145129044dSC.J. Collier *       notice, this list of conditions and the following disclaimer in
155129044dSC.J. Collier *       the documentation and/or other materials provided with the
165129044dSC.J. Collier *       distribution.
175129044dSC.J. Collier *     * Neither the name of Intel Corporation nor the names of its
185129044dSC.J. Collier *       contributors may be used to endorse or promote products derived
195129044dSC.J. Collier *       from this software without specific prior written permission.
205129044dSC.J. Collier *
215129044dSC.J. Collier *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
225129044dSC.J. Collier *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
235129044dSC.J. Collier *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
245129044dSC.J. Collier *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
255129044dSC.J. Collier *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
265129044dSC.J. Collier *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
275129044dSC.J. Collier *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
285129044dSC.J. Collier *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
295129044dSC.J. Collier *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
305129044dSC.J. Collier *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
315129044dSC.J. Collier *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
325129044dSC.J. Collier */
335129044dSC.J. Collier
345129044dSC.J. Collier#ifndef __INCLUDE_RTE_TABLE_ACL_H__
355129044dSC.J. Collier#define __INCLUDE_RTE_TABLE_ACL_H__
365129044dSC.J. Collier
375129044dSC.J. Collier#ifdef __cplusplus
385129044dSC.J. Collierextern "C" {
395129044dSC.J. Collier#endif
405129044dSC.J. Collier
415129044dSC.J. Collier/**
425129044dSC.J. Collier * @file
435129044dSC.J. Collier * RTE Table ACL
445129044dSC.J. Collier *
455129044dSC.J. Collier * This table uses the Access Control List (ACL) algorithm to uniquely
465129044dSC.J. Collier * associate data to lookup keys.
475129044dSC.J. Collier *
485129044dSC.J. Collier * Use-cases: Firewall rule database, etc.
495129044dSC.J. Collier *
505129044dSC.J. Collier ***/
515129044dSC.J. Collier
525129044dSC.J. Collier#include <stdint.h>
535129044dSC.J. Collier
545129044dSC.J. Collier#include "rte_acl.h"
555129044dSC.J. Collier
565129044dSC.J. Collier#include "rte_table.h"
575129044dSC.J. Collier
585129044dSC.J. Collier/** ACL table parameters */
595129044dSC.J. Collierstruct rte_table_acl_params {
605129044dSC.J. Collier	/** Name */
615129044dSC.J. Collier	const char *name;
625129044dSC.J. Collier
635129044dSC.J. Collier	/** Maximum number of ACL rules in the table */
645129044dSC.J. Collier	uint32_t n_rules;
655129044dSC.J. Collier
665129044dSC.J. Collier	/** Number of fields in the ACL rule specification */
675129044dSC.J. Collier	uint32_t n_rule_fields;
685129044dSC.J. Collier
695129044dSC.J. Collier	/** Format specification of the fields of the ACL rule */
705129044dSC.J. Collier	struct rte_acl_field_def field_format[RTE_ACL_MAX_FIELDS];
715129044dSC.J. Collier};
725129044dSC.J. Collier
735129044dSC.J. Collier/** ACL rule specification for entry add operation */
745129044dSC.J. Collierstruct rte_table_acl_rule_add_params {
755129044dSC.J. Collier	/** ACL rule priority, with 0 as the highest priority */
765129044dSC.J. Collier	int32_t  priority;
775129044dSC.J. Collier
785129044dSC.J. Collier	/** Values for the fields of the ACL rule to be added to the table */
795129044dSC.J. Collier	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
805129044dSC.J. Collier};
815129044dSC.J. Collier
825129044dSC.J. Collier/** ACL rule specification for entry delete operation */
835129044dSC.J. Collierstruct rte_table_acl_rule_delete_params {
845129044dSC.J. Collier	/** Values for the fields of the ACL rule to be deleted from table */
855129044dSC.J. Collier	struct rte_acl_field field_value[RTE_ACL_MAX_FIELDS];
865129044dSC.J. Collier};
875129044dSC.J. Collier
885129044dSC.J. Collier/** ACL table operations */
895129044dSC.J. Collierextern struct rte_table_ops rte_table_acl_ops;
905129044dSC.J. Collier
915129044dSC.J. Collier#ifdef __cplusplus
925129044dSC.J. Collier}
935129044dSC.J. Collier#endif
945129044dSC.J. Collier
955129044dSC.J. Collier#endif
96