FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
fib_node_list.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /**
16  * @brief a hetrogeneous w.r.t. FIB node type, list of FIB nodes.
17  * Since we cannot use C pointers, due to memeory reallocs, the next/prev
18  * are described as an index to an element. Each element contains a pointer
19  * (key:{type, index}) to a FIB node.
20  */
21 
22 #ifndef __FIB_NODE_LIST_H__
23 #define __FIB_NODE_LIST_H__
24 
25 #include <vnet/fib/fib_node.h>
26 
28 extern void fib_node_list_destroy(fib_node_list_t *list);
29 
31  int owner_id,
35  int owner_id,
38 extern void fib_node_list_remove(fib_node_list_t head,
39  u32 sibling);
40 extern void fib_node_list_elt_remove(u32 sibling);
41 
42 extern int fib_node_list_advance(u32 sibling);
43 
45  fib_node_ptr_t *ptr);
46 
48  fib_node_ptr_t *ptr);
49 
51 
52 /**
53  * @brief Callback function invoked during a list walk
54  */
56  void *args);
57 
58 extern void fib_node_list_walk(fib_node_list_t head,
60  void *args);
61 
62 extern void fib_node_list_memory_show(void);
63 
64 #endif
fib_node_list_memory_show
void fib_node_list_memory_show(void)
Definition: fib_node_list.c:381
fib_node_list_elt_remove
void fib_node_list_elt_remove(u32 sibling)
Definition: fib_node_list.c:250
fib_node_list_t
u32 fib_node_list_t
A list of FIB nodes.
Definition: fib_node.h:209
fib_node_list_push_front
u32 fib_node_list_push_front(fib_node_list_t head, int owner_id, fib_node_type_t type, fib_node_index_t index)
Insert an element at the from of the list.
Definition: fib_node_list.c:156
fib_node_list_remove
void fib_node_list_remove(fib_node_list_t head, u32 sibling)
Definition: fib_node_list.c:234
fib_node.h
fib_node_list_get_size
u32 fib_node_list_get_size(fib_node_list_t head)
Definition: fib_node_list.c:313
fib_node_type_t
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
fib_node_list_walk_cb_t
walk_rc_t(* fib_node_list_walk_cb_t)(fib_node_ptr_t *owner, void *args)
Callback function invoked during a list walk.
Definition: fib_node_list.h:55
fib_node_ptr_t_
A representation of one pointer to another node.
Definition: fib_node.h:195
fib_node_list_create
fib_node_list_t fib_node_list_create(void)
a hetrogeneous w.r.t.
Definition: fib_node_list.c:125
fib_node_list_advance
int fib_node_list_advance(u32 sibling)
Advance the sibling one step (toward the tail) in the list.
Definition: fib_node_list.c:264
fib_node_list_elt_get_next
int fib_node_list_elt_get_next(u32 elt, fib_node_ptr_t *ptr)
Definition: fib_node_list.c:291
fib_node_list_destroy
void fib_node_list_destroy(fib_node_list_t *list)
Definition: fib_node_list.c:137
index
u32 index
Definition: flow_types.api:221
fib_node_list_push_back
u32 fib_node_list_push_back(fib_node_list_t head, int owner_id, fib_node_type_t type, fib_node_index_t index)
Definition: fib_node_list.c:183
fib_node_list_get_front
int fib_node_list_get_front(fib_node_list_t head, fib_node_ptr_t *ptr)
Definition: fib_node_list.c:328
u32
unsigned int u32
Definition: types.h:88
elt
app_rx_mq_elt_t * elt
Definition: application.c:488
fib_node_list_walk
void fib_node_list_walk(fib_node_list_t head, fib_node_list_walk_cb_t fn, void *args)
Walk the list of node.
Definition: fib_node_list.c:354
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123