a0238ac3cdb35b6f876e89d1fcab4e11e4956181
[vpp.git] / vnet / vnet / fib / fib_internal.h
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_INTERNAL_H__
17 #define __FIB_INTERNAL_H__
18
19 #include <vnet/ip/ip.h>
20 #include <vnet/dpo/dpo.h>
21
22 /**
23  * Big train switch; FIB debugs on or off
24  */
25 #undef FIB_DEBUG
26
27 extern int fib_route_path_cmp(const fib_route_path_t *rpath1,
28                               const fib_route_path_t *rpath2);
29
30 /**
31  * @brief
32  *  Add or update an entry in the FIB's forwarding table.
33  * This is called from the fib_entry code. It is not meant to be used
34  * by the client/source.
35  *
36  * @param fib_index
37  *  The index of the FIB
38  *
39  * @param prefix
40  *  The prefix for the entry to add/update
41  *
42  * @param dpo
43  *  The data-path object to use for forwarding
44  */
45 extern void fib_table_fwding_dpo_update(u32 fib_index,
46                                         const fib_prefix_t *prefix,
47                                         const dpo_id_t *dpo);
48 /**
49  * @brief
50  *  remove an entry in the FIB's forwarding table
51  *
52  * @param fib_index
53  *  The index of the FIB
54  *
55  * @param prefix
56  *  The prefix for the entry to add/update
57  *
58  * @param dpo
59  *  The data-path object to use for forwarding
60  */
61 extern void fib_table_fwding_dpo_remove(u32 fib_index,
62                                         const fib_prefix_t *prefix,
63                                         const dpo_id_t *dpo);
64
65
66 #endif