Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 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 | |
Neale Ranns | ad422ed | 2016-11-02 14:20:04 +0000 | [diff] [blame] | 27 | extern void fib_prefix_from_mpls_label(mpls_label_t label, |
| 28 | fib_prefix_t *prf); |
| 29 | |
Neale Ranns | 0bfe5d8 | 2016-08-25 15:29:12 +0100 | [diff] [blame] | 30 | extern int fib_route_path_cmp(const fib_route_path_t *rpath1, |
| 31 | const fib_route_path_t *rpath2); |
| 32 | |
| 33 | /** |
| 34 | * @brief |
| 35 | * Add or update an entry in the FIB's forwarding table. |
| 36 | * This is called from the fib_entry code. It is not meant to be used |
| 37 | * by the client/source. |
| 38 | * |
| 39 | * @param fib_index |
| 40 | * The index of the FIB |
| 41 | * |
| 42 | * @param prefix |
| 43 | * The prefix for the entry to add/update |
| 44 | * |
| 45 | * @param dpo |
| 46 | * The data-path object to use for forwarding |
| 47 | */ |
| 48 | extern void fib_table_fwding_dpo_update(u32 fib_index, |
| 49 | const fib_prefix_t *prefix, |
| 50 | const dpo_id_t *dpo); |
| 51 | /** |
| 52 | * @brief |
| 53 | * remove an entry in the FIB's forwarding table |
| 54 | * |
| 55 | * @param fib_index |
| 56 | * The index of the FIB |
| 57 | * |
| 58 | * @param prefix |
| 59 | * The prefix for the entry to add/update |
| 60 | * |
| 61 | * @param dpo |
| 62 | * The data-path object to use for forwarding |
| 63 | */ |
| 64 | extern void fib_table_fwding_dpo_remove(u32 fib_index, |
| 65 | const fib_prefix_t *prefix, |
| 66 | const dpo_id_t *dpo); |
| 67 | |
| 68 | |
| 69 | #endif |