DPDK  22.07.0
rte_lpm6.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 #ifndef _RTE_LPM6_H_
5 #define _RTE_LPM6_H_
6 
12 #include <stdint.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 
19 #define RTE_LPM6_MAX_DEPTH 128
20 #define RTE_LPM6_IPV6_ADDR_SIZE 16
21 
22 #define RTE_LPM6_NAMESIZE 32
23 
25 struct rte_lpm6;
26 
29  uint32_t max_rules;
30  uint32_t number_tbl8s;
31  int flags;
32 };
33 
53 struct rte_lpm6 *
54 rte_lpm6_create(const char *name, int socket_id,
55  const struct rte_lpm6_config *config);
56 
67 struct rte_lpm6 *
68 rte_lpm6_find_existing(const char *name);
69 
79 void
80 rte_lpm6_free(struct rte_lpm6 *lpm);
81 
96 int
97 rte_lpm6_add(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth,
98  uint32_t next_hop);
99 
115 int
116 rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth,
117  uint32_t *next_hop);
118 
131 int
132 rte_lpm6_delete(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth);
133 
148 int
149 rte_lpm6_delete_bulk_func(struct rte_lpm6 *lpm,
150  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], uint8_t *depths, unsigned n);
151 
158 void
159 rte_lpm6_delete_all(struct rte_lpm6 *lpm);
160 
173 int
174 rte_lpm6_lookup(const struct rte_lpm6 *lpm, const uint8_t *ip, uint32_t *next_hop);
175 
192 int
193 rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm,
194  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE],
195  int32_t *next_hops, unsigned int n);
196 
197 #ifdef __cplusplus
198 }
199 #endif
200 
201 #endif
int rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm, uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], int32_t *next_hops, unsigned int n)
uint32_t number_tbl8s
Definition: rte_lpm6.h:30
int rte_lpm6_delete(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth)
int rte_lpm6_lookup(const struct rte_lpm6 *lpm, const uint8_t *ip, uint32_t *next_hop)
int rte_lpm6_add(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth, uint32_t next_hop)
struct rte_lpm6 * rte_lpm6_create(const char *name, int socket_id, const struct rte_lpm6_config *config)
int rte_lpm6_delete_bulk_func(struct rte_lpm6 *lpm, uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], uint8_t *depths, unsigned n)
int rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, const uint8_t *ip, uint8_t depth, uint32_t *next_hop)
struct rte_lpm6 * rte_lpm6_find_existing(const char *name)
void rte_lpm6_delete_all(struct rte_lpm6 *lpm)
void rte_lpm6_free(struct rte_lpm6 *lpm)
uint32_t max_rules
Definition: rte_lpm6.h:29