]>
Commit | Line | Data |
---|---|---|
fb018d25 DS |
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 | */ | |
7076bb2f | 28 | extern void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id); |
fb018d25 DS |
29 | |
30 | /** | |
31 | * bgp_find_nexthop() - lookup the nexthop cache table for the bnc object | |
32 | * ARGUMENTS: | |
33 | * p - path for which the nexthop object is being looked up | |
fc9a856f | 34 | * connected - True if NH MUST be a connected route |
fb018d25 | 35 | */ |
fc9a856f | 36 | extern int bgp_find_nexthop(struct bgp_info *p, int connected); |
fb018d25 DS |
37 | |
38 | /** | |
39 | * bgp_find_or_add_nexthop() - lookup the nexthop cache table for the bnc | |
40 | * object. If not found, create a new object and register with ZEBRA for | |
41 | * nexthop notification. | |
42 | * ARGUMENTS: | |
75aead62 | 43 | * bgp - BGP instance |
fb018d25 DS |
44 | * a - afi: AFI_IP or AF_IP6 |
45 | * p - path for which the nexthop object is being looked up | |
fc9a856f DS |
46 | * peer - The BGP peer associated with this NHT |
47 | * connected - True if NH MUST be a connected route | |
fb018d25 | 48 | */ |
75aead62 DS |
49 | extern int bgp_find_or_add_nexthop(struct bgp *bgp, afi_t a, |
50 | struct bgp_info *p, struct peer *peer, int connected); | |
fb018d25 DS |
51 | |
52 | /** | |
53 | * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure. | |
54 | * ARGUMENTS: | |
55 | * p - path structure. | |
56 | */ | |
57 | extern void bgp_unlink_nexthop(struct bgp_info *p); | |
f9164b1d | 58 | void bgp_unlink_nexthop_by_peer (struct peer *); |
fb018d25 | 59 | |
9a233a02 DS |
60 | /** |
61 | * bgp_delete_connected_nexthop() - Reset the 'peer' pointer for a connected | |
62 | * nexthop entry. If no paths reference the nexthop, it will be unregistered | |
63 | * and freed. | |
64 | * ARGUMENTS: | |
65 | * afi - afi: AFI_IP or AF_IP6 | |
66 | * peer - Ptr to peer | |
67 | */ | |
68 | extern void bgp_delete_connected_nexthop (afi_t afi, struct peer *peer); | |
69 | ||
fb018d25 | 70 | #endif /* _BGP_NHT_H */ |