CNDP  22.08.0
cne_fib6.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>
3  * Copyright (c) 2019-2022 Intel Corporation
4  */
5 
6 #ifndef _CNE_FIB6_H_
7 #define _CNE_FIB6_H_
8 
17 // IWYU pragma: no_include "private_fib6.h"
18 
19 #include <stdint.h> // for uint8_t, uint64_t, uint32_t
20 #include <cne_common.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 struct cne_fib6;
27 struct cne_rib6;
28 
30 #define CNE_FIB6_IPV6_ADDR_SIZE 16
31 
36 };
37 
39 enum cne_fib_trie_nh_sz { CNE_FIB6_TRIE_2B = 1, CNE_FIB6_TRIE_4B, CNE_FIB6_TRIE_8B };
40 
47 };
48 
50 struct cne_fib6_conf {
51  enum cne_fib6_type type;
53  uint64_t default_nh;
54  int max_routes;
55  union {
56  struct {
57  enum cne_fib_trie_nh_sz nh_sz;
58  uint32_t num_tbl8;
59  } trie;
60  };
61 };
62 
73 struct cne_fib6 *cne_fib6_create(const char *name, struct cne_fib6_conf *conf);
74 
83 void cne_fib6_free(struct cne_fib6 *fib);
84 
99 int cne_fib6_add(struct cne_fib6 *fib, const uint8_t ip[CNE_FIB6_IPV6_ADDR_SIZE], uint8_t depth,
100  uint64_t next_hop);
101 
114 int cne_fib6_delete(struct cne_fib6 *fib, const uint8_t ip[CNE_FIB6_IPV6_ADDR_SIZE], uint8_t depth);
115 
133 int cne_fib6_lookup_bulk(struct cne_fib6 *fib, uint8_t ips[][CNE_FIB6_IPV6_ADDR_SIZE],
134  uint64_t *next_hops, int n);
135 
145 void *cne_fib6_get_dp(struct cne_fib6 *fib);
146 
156 struct cne_rib6 *cne_fib6_get_rib(struct cne_fib6 *fib);
157 
170 int cne_fib6_select_lookup(struct cne_fib6 *fib, enum cne_fib6_lookup_type type);
171 
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 #endif /* _CNE_FIB6_H_ */
#define CNE_FIB6_IPV6_ADDR_SIZE
Definition: cne_fib6.h:30
void * cne_fib6_get_dp(struct cne_fib6 *fib)
struct cne_fib6 * cne_fib6_create(const char *name, struct cne_fib6_conf *conf)
cne_fib_trie_nh_sz
Definition: cne_fib6.h:39
int cne_fib6_add(struct cne_fib6 *fib, const uint8_t ip[CNE_FIB6_IPV6_ADDR_SIZE], uint8_t depth, uint64_t next_hop)
void cne_fib6_free(struct cne_fib6 *fib)
int cne_fib6_lookup_bulk(struct cne_fib6 *fib, uint8_t ips[][CNE_FIB6_IPV6_ADDR_SIZE], uint64_t *next_hops, int n)
int cne_fib6_select_lookup(struct cne_fib6 *fib, enum cne_fib6_lookup_type type)
cne_fib6_type
Definition: cne_fib6.h:33
@ CNE_FIB6_TRIE
Definition: cne_fib6.h:35
@ CNE_FIB6_DUMMY
Definition: cne_fib6.h:34
struct cne_rib6 * cne_fib6_get_rib(struct cne_fib6 *fib)
int cne_fib6_delete(struct cne_fib6 *fib, const uint8_t ip[CNE_FIB6_IPV6_ADDR_SIZE], uint8_t depth)
cne_fib6_lookup_type
Definition: cne_fib6.h:42
@ CNE_FIB6_LOOKUP_TRIE_VECTOR_AVX512
Definition: cne_fib6.h:46
@ CNE_FIB6_LOOKUP_TRIE_SCALAR
Definition: cne_fib6.h:45
@ CNE_FIB6_LOOKUP_DEFAULT
Definition: cne_fib6.h:43
enum cne_fib6_type type
Definition: cne_fib6.h:51
uint64_t default_nh
Definition: cne_fib6.h:53