Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 1 | /* BGP Nexthop tracking |
| 2 | * Copyright (C) 2013 Cumulus Networks, Inc. |
| 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the Free |
| 18 | * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 | * 02111-1307, USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef _BGP_NHT_H |
| 23 | #define _BGP_NHT_H |
| 24 | |
| 25 | /** |
| 26 | * bgp_parse_nexthop_update() - parse a nexthop update message from Zebra. |
| 27 | */ |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 28 | void bgp_parse_nexthop_update (void); |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 29 | |
| 30 | /** |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 31 | * bgp_nexthop_check() - check if the bnc object is valid. |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 32 | * ARGUMENTS: |
| 33 | * p - path for which the nexthop object is being looked up |
Dinesh Dutt | d9ab53a | 2015-05-19 17:47:21 -0700 | [diff] [blame] | 34 | * connected - True if NH MUST be a connected route |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 35 | */ |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 36 | int bgp_nexthop_check (struct bgp_info *, int connected); |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 37 | |
| 38 | /** |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 39 | * bgp_ensure_nexthop() - Ensure a bgp_nexthop_cache object exists for |
| 40 | * the given prefix or peer. If an existing one is not found, |
| 41 | * create a new object and register with ZEBRA for nexthop |
| 42 | * notification. |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 43 | * ARGUMENTS: |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 44 | * afi: AFI_IP or AF_IP6 |
| 45 | * struct bgp_info *: path for which the nexthop object is |
| 46 | * being looked up |
| 47 | * OR |
| 48 | * struct peer The BGP peer associated with this NHT |
Dinesh Dutt | d9ab53a | 2015-05-19 17:47:21 -0700 | [diff] [blame] | 49 | * connected - True if NH MUST be a connected route |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 50 | */ |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 51 | int bgp_ensure_nexthop (struct bgp_info *, struct peer *, int connected); |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 52 | |
| 53 | /** |
| 54 | * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure. |
| 55 | * ARGUMENTS: |
Paul Jakma | 3dda6b3 | 2016-09-06 16:57:40 +0100 | [diff] [blame] | 56 | * struct bgp_info *: path structure. |
| 57 | */ |
| 58 | void bgp_unlink_nexthop (struct bgp_info *); |
| 59 | |
| 60 | /** |
| 61 | * bgp_unlink_nexthop() - Unlink the nexthop object for the given peer. |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 62 | */ |
| 63 | extern void bgp_unlink_nexthop(struct bgp_info *p); |
Paul Jakma | 19e6c19 | 2016-09-06 17:23:48 +0100 | [diff] [blame] | 64 | void bgp_unlink_nexthop_by_peer (struct peer *); |
Pradosh Mohapatra | 60cc959 | 2015-11-09 20:21:41 -0500 | [diff] [blame] | 65 | |
| 66 | #endif /* _BGP_NHT_H */ |