FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
fib_walk.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 #ifndef __FIB_WALK_H__
17 #define __FIB_WALK_H__
18 
19 #include <vnet/fib/fib_node.h>
20 
21 /**
22  * @brief Walk priorities.
23  * Strict priorities. All walks a priority n are completed before n+1 is started.
24  * Increasing numerical value implies decreasing priority.
25  */
27 {
31 
32 #define FIB_WALK_PRIORITY_NUM ((fib_walk_priority_t)(FIB_WALK_PRIORITY_LOW+1))
33 
34 #define FIB_WALK_PRIORITIES { \
35  [FIB_WALK_PRIORITY_HIGH] = "high", \
36  [FIB_WALK_PRIORITY_LOW] = "low", \
37 }
38 
39 #define FOR_EACH_FIB_WALK_PRIORITY(_prio) \
40  for ((_prio) = FIB_WALK_PRIORITY_HIGH; \
41  (_prio) < FIB_WALK_PRIORITY_NUM; \
42  (_prio)++)
43 
44 extern void fib_walk_module_init(void);
45 
46 extern void fib_walk_async(fib_node_type_t parent_type,
47  fib_node_index_t parent_index,
50 
51 extern void fib_walk_sync(fib_node_type_t parent_type,
52  fib_node_index_t parent_index,
54 
55 extern u8* format_fib_walk_priority(u8 *s, va_list *ap);
56 
57 extern void fib_walk_process_enable(void);
58 extern void fib_walk_process_disable(void);
59 
60 #endif
61 
u8 * format_fib_walk_priority(u8 *s, va_list *ap)
Definition: fib_walk.c:188
void fib_walk_module_init(void)
Definition: fib_walk.c:917
void fib_walk_process_disable(void)
Definition: fib_walk.c:1173
fib_walk_priority_t_
Walk priorities.
Definition: fib_walk.h:26
void fib_walk_async(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_walk_priority_t prio, fib_node_back_walk_ctx_t *ctx)
Definition: fib_walk.c:673
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
enum fib_walk_priority_t_ fib_walk_priority_t
Walk priorities.
Context passed between object during a back walk.
Definition: fib_node.h:199
long ctx[MAX_CONNS]
Definition: main.c:122
unsigned char u8
Definition: types.h:56
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
void fib_walk_sync(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_back_walk_ctx_t *ctx)
Back walk all the children of a FIB node.
Definition: fib_walk.c:727
void fib_walk_process_enable(void)
Definition: fib_walk.c:1164