]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_rnh.h
88be69a81db31dc8fbc180a865806a3ec9c2496d
[mirror_frr.git] / zebra / zebra_rnh.h
1 /*
2 * Zebra next hop tracking header
3 * Copyright (C) 2013 Cumulus Networks, Inc.
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #ifndef _ZEBRA_RNH_H
23 #define _ZEBRA_RNH_H
24
25 #include "prefix.h"
26 #include "vty.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 extern void zebra_rnh_init(void);
33
34 extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, safi_t safi,
35 bool *exists);
36 extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
37 safi_t safi);
38 extern void zebra_free_rnh(struct rnh *rnh);
39 extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
40 vrf_id_t vrfid);
41 extern int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
42 vrf_id_t vrf_id, uint32_t srte_color);
43 extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *, bool *);
44 extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
45 extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client);
46 extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
47 const struct prefix *p, safi_t safi);
48 extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, safi_t safi,
49 struct vty *vty, const struct prefix *p,
50 json_object *json);
51
52 extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
53
54 extern bool rnh_nexthop_valid(const struct route_entry *re,
55 const struct nexthop *nh);
56
57 /* UI control to avoid notifications if backup nexthop status changes */
58 void rnh_set_hide_backups(bool hide_p);
59 bool rnh_get_hide_backups(void);
60
61 void show_nexthop_json_helper(json_object *json_nexthop,
62 const struct nexthop *nexthop,
63 const struct route_entry *re);
64 void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
65 const struct nexthop *nexthop);
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif /*_ZEBRA_RNH_H */