DPDK  18.11.11
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 #include <rte_compat.h>
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 
20 #define RTE_LPM6_MAX_DEPTH 128
21 #define RTE_LPM6_IPV6_ADDR_SIZE 16
22 
23 #define RTE_LPM6_NAMESIZE 32
24 
26 struct rte_lpm6;
27 
30  uint32_t max_rules;
31  uint32_t number_tbl8s;
32  int flags;
33 };
34 
54 struct rte_lpm6 *
55 rte_lpm6_create(const char *name, int socket_id,
56  const struct rte_lpm6_config *config);
57 
68 struct rte_lpm6 *
69 rte_lpm6_find_existing(const char *name);
70 
79 void
80 rte_lpm6_free(struct rte_lpm6 *lpm);
81 
96 int
97 rte_lpm6_add(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
98  uint32_t next_hop);
99 int
100 rte_lpm6_add_v20(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
101  uint8_t next_hop);
102 int
103 rte_lpm6_add_v1705(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
104  uint32_t next_hop);
105 
121 int
122 rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
123  uint32_t *next_hop);
124 int
125 rte_lpm6_is_rule_present_v20(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
126  uint8_t *next_hop);
127 int
128 rte_lpm6_is_rule_present_v1705(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth,
129  uint32_t *next_hop);
130 
143 int
144 rte_lpm6_delete(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth);
145 
160 int
161 rte_lpm6_delete_bulk_func(struct rte_lpm6 *lpm,
162  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE], uint8_t *depths, unsigned n);
163 
170 void
171 rte_lpm6_delete_all(struct rte_lpm6 *lpm);
172 
185 int
186 rte_lpm6_lookup(const struct rte_lpm6 *lpm, uint8_t *ip, uint32_t *next_hop);
187 int
188 rte_lpm6_lookup_v20(const struct rte_lpm6 *lpm, uint8_t *ip, uint8_t *next_hop);
189 int
190 rte_lpm6_lookup_v1705(const struct rte_lpm6 *lpm, uint8_t *ip,
191  uint32_t *next_hop);
192 
209 int
210 rte_lpm6_lookup_bulk_func(const struct rte_lpm6 *lpm,
211  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE],
212  int32_t *next_hops, unsigned int n);
213 int
214 rte_lpm6_lookup_bulk_func_v20(const struct rte_lpm6 *lpm,
215  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE],
216  int16_t *next_hops, unsigned int n);
217 int
218 rte_lpm6_lookup_bulk_func_v1705(const struct rte_lpm6 *lpm,
219  uint8_t ips[][RTE_LPM6_IPV6_ADDR_SIZE],
220  int32_t *next_hops, unsigned int n);
221 
222 #ifdef __cplusplus
223 }
224 #endif
225 
226 #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:31
struct rte_lpm6 * rte_lpm6_create(const char *name, int socket_id, const struct rte_lpm6_config *config)
int rte_lpm6_is_rule_present(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint32_t *next_hop)
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_lookup(const struct rte_lpm6 *lpm, uint8_t *ip, uint32_t *next_hop)
struct rte_lpm6 * rte_lpm6_find_existing(const char *name)
int rte_lpm6_delete(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth)
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:30
int rte_lpm6_add(struct rte_lpm6 *lpm, uint8_t *ip, uint8_t depth, uint32_t next_hop)