Paul Jakma | 5734509 | 2011-12-25 17:52:09 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is free software: you may copy, redistribute and/or modify it |
| 3 | * under the terms of the GNU General Public License as published by the |
| 4 | * Free Software Foundation, either version 2 of the License, or (at your |
| 5 | * option) any later version. |
| 6 | * |
| 7 | * This file is distributed in the hope that it will be useful, but |
| 8 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 10 | * General Public License for more details. |
| 11 | * |
| 12 | * You should have received a copy of the GNU General Public License |
| 13 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 14 | * |
| 15 | * This file incorporates work covered by the following copyright and |
| 16 | * permission notice: |
| 17 | * |
| 18 | Copyright (c) 2007, 2008 by Juliusz Chroboczek |
| 19 | Copyright 2011 by Matthieu Boutier and Juliusz Chroboczek |
| 20 | |
| 21 | Permission is hereby granted, free of charge, to any person obtaining a copy |
| 22 | of this software and associated documentation files (the "Software"), to deal |
| 23 | in the Software without restriction, including without limitation the rights |
| 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 25 | copies of the Software, and to permit persons to whom the Software is |
| 26 | furnished to do so, subject to the following conditions: |
| 27 | |
| 28 | The above copyright notice and this permission notice shall be included in |
| 29 | all copies or substantial portions of the Software. |
| 30 | |
| 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 37 | THE SOFTWARE. |
| 38 | */ |
| 39 | |
| 40 | struct xroute { |
| 41 | unsigned char prefix[16]; |
| 42 | unsigned char plen; |
| 43 | unsigned short metric; |
| 44 | unsigned int ifindex; |
| 45 | int proto; |
| 46 | }; |
| 47 | |
Paul Jakma | 5734509 | 2011-12-25 17:52:09 +0100 | [diff] [blame] | 48 | struct xroute *find_xroute(const unsigned char *prefix, unsigned char plen); |
| 49 | void flush_xroute(struct xroute *xroute); |
Paul Jakma | 5734509 | 2011-12-25 17:52:09 +0100 | [diff] [blame] | 50 | int babel_ipv4_route_add (struct zapi_ipv4 *api, struct prefix_ipv4 *prefix, |
| 51 | unsigned int ifindex, struct in_addr *nexthop); |
| 52 | int babel_ipv4_route_delete (struct zapi_ipv4 *api, struct prefix_ipv4 *prefix, |
| 53 | unsigned int ifindex); |
| 54 | int babel_ipv6_route_add (struct zapi_ipv6 *api, struct prefix_ipv6 *prefix, |
| 55 | unsigned int ifindex, struct in6_addr *nexthop); |
| 56 | int babel_ipv6_route_delete (struct zapi_ipv6 *api, struct prefix_ipv6 *prefix, |
| 57 | unsigned int ifindex); |
Matthieu Boutier | c35fafd | 2012-01-23 23:46:32 +0100 | [diff] [blame] | 58 | int xroutes_estimate(void); |
| 59 | void for_all_xroutes(void (*f)(struct xroute*, void*), void *closure); |