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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #ifndef __FIB_WALK_H__
17 #define __FIB_WALK_H__
19 #include <vnet/fib/fib_node.h>
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.
26 typedef enum fib_walk_priority_t_
28 FIB_WALK_PRIORITY_HIGH = 0,
29 FIB_WALK_PRIORITY_LOW = 1,
30 } fib_walk_priority_t;
32 #define FIB_WALK_PRIORITY_NUM ((fib_walk_priority_t)(FIB_WALK_PRIORITY_LOW+1))
34 #define FIB_WALK_PRIORITIES { \
35 [FIB_WALK_PRIORITY_HIGH] = "high", \
36 [FIB_WALK_PRIORITY_LOW] = "low", \
39 #define FOR_EACH_FIB_WALK_PRIORITY(_prio) \
40 for ((_prio) = FIB_WALK_PRIORITY_HIGH; \
41 (_prio) < FIB_WALK_PRIORITY_NUM; \
44 extern void fib_walk_module_init(void);
46 extern void fib_walk_async(fib_node_type_t parent_type,
47 fib_node_index_t parent_index,
48 fib_walk_priority_t prio,
49 fib_node_back_walk_ctx_t *ctx);
51 extern void fib_walk_sync(fib_node_type_t parent_type,
52 fib_node_index_t parent_index,
53 fib_node_back_walk_ctx_t *ctx);
55 extern u8* format_fib_walk_priority(u8 *s, va_list *ap);
57 extern void fib_walk_process_enable(void);
58 extern void fib_walk_process_disable(void);