]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_nht.h
Merge pull request #2758 from donaldsharp/pim_join
[mirror_frr.git] / bgpd / bgp_nht.h
CommitLineData
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 *
896014f4
DL
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
fb018d25
DS
19 */
20
21#ifndef _BGP_NHT_H
22#define _BGP_NHT_H
23
24/**
25 * bgp_parse_nexthop_update() - parse a nexthop update message from Zebra.
26 */
7076bb2f 27extern void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id);
fb018d25
DS
28
29/**
30 * bgp_find_nexthop() - lookup the nexthop cache table for the bnc object
31 * ARGUMENTS:
32 * p - path for which the nexthop object is being looked up
fc9a856f 33 * connected - True if NH MUST be a connected route
fb018d25 34 */
fc9a856f 35extern int bgp_find_nexthop(struct bgp_info *p, int connected);
fb018d25
DS
36
37/**
38 * bgp_find_or_add_nexthop() - lookup the nexthop cache table for the bnc
39 * object. If not found, create a new object and register with ZEBRA for
40 * nexthop notification.
41 * ARGUMENTS:
960035b2
PZ
42 * bgp_route - BGP instance of route
43 * bgp_nexthop - BGP instance of nexthop
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 */
960035b2
PZ
49extern int bgp_find_or_add_nexthop(struct bgp *bgp_route,
50 struct bgp *bgp_nexthop, afi_t a, struct bgp_info *p,
51 struct peer *peer, int connected);
fb018d25
DS
52
53/**
54 * bgp_unlink_nexthop() - Unlink the nexthop object from the path structure.
55 * ARGUMENTS:
56 * p - path structure.
57 */
58extern void bgp_unlink_nexthop(struct bgp_info *p);
d62a17ae 59void bgp_unlink_nexthop_by_peer(struct peer *);
fb018d25 60
9a233a02
DS
61/**
62 * bgp_delete_connected_nexthop() - Reset the 'peer' pointer for a connected
63 * nexthop entry. If no paths reference the nexthop, it will be unregistered
64 * and freed.
65 * ARGUMENTS:
66 * afi - afi: AFI_IP or AF_IP6
67 * peer - Ptr to peer
68 */
d62a17ae 69extern void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer);
9a233a02 70
ee7ca6c0 71/*
72 * Cleanup nexthop registration and status information for BGP nexthops
73 * pertaining to this VRF. This is invoked upon VRF deletion.
74 */
75extern void bgp_cleanup_nexthops(struct bgp *bgp);
76
fb018d25 77#endif /* _BGP_NHT_H */