Front Haul Interface Library first seed code contribution
[o-du/phy.git] / fhi_lib / lib / src / xran_hash.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2019 Intel.
4 *
5 *   Licensed under the Apache License, Version 2.0 (the "License");
6 *   you may not use this file except in compliance with the License.
7 *   You may obtain a copy of the License at
8 *
9 *       http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *   Unless required by applicable law or agreed to in writing, software
12 *   distributed under the License is distributed on an "AS IS" BASIS,
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *   See the License for the specific language governing permissions and
15 *   limitations under the License.
16 *
17 *******************************************************************************/
18
19
20 /**
21  * @brief Definitions and support functions to process XRAN packet
22  * @file xran_hash.h
23  * @ingroup group_source_xran
24  * @author Intel Corporation
25  **/
26
27 #ifndef _XRAN_HASH_H
28 #define _XRAN_HASH_H
29
30 #include <rte_common.h>
31 #include <rte_hash.h>
32 #include <rte_hash_crc.h>
33
34 #define DEFAULT_HASH_FUNC       rte_hash_crc
35
36
37 struct rte_hash *xran_section_init_hash(uint16_t dir, uint16_t cid, int max_num_sections);
38 void xran_section_free_hash(struct rte_hash *hash);
39
40 void xran_section_reset_hash(struct rte_hash *hash);
41 int xran_section_add_hash(const struct rte_hash *hash, uint16_t section_id, int index);
42 int xran_section_lookup(const struct rte_hash *hash, uint16_t section_id);
43 int xran_section_iterate(const struct rte_hash *hash, uint32_t *next);
44
45 #endif