]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_rnh.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / zebra / zebra_rnh.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Zebra next hop tracking header
4 * Copyright (C) 2013 Cumulus Networks, Inc.
5 */
6
7 #ifndef _ZEBRA_RNH_H
8 #define _ZEBRA_RNH_H
9
10 #include "prefix.h"
11 #include "vty.h"
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 extern void zebra_rnh_init(void);
18
19 extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, safi_t safi,
20 bool *exists);
21 extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
22 safi_t safi);
23 extern void zebra_free_rnh(struct rnh *rnh);
24 extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client,
25 vrf_id_t vrfid);
26 extern int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client,
27 vrf_id_t vrf_id, uint32_t srte_color);
28 extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *, bool *);
29 extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *);
30 extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client);
31 extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force,
32 const struct prefix *p, safi_t safi);
33 extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, safi_t safi,
34 struct vty *vty, const struct prefix *p,
35 json_object *json);
36
37 extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family);
38
39 extern bool rnh_nexthop_valid(const struct route_entry *re,
40 const struct nexthop *nh);
41
42 /* UI control to avoid notifications if backup nexthop status changes */
43 void rnh_set_hide_backups(bool hide_p);
44 bool rnh_get_hide_backups(void);
45
46 void show_nexthop_json_helper(json_object *json_nexthop,
47 const struct nexthop *nexthop,
48 const struct route_entry *re);
49 void show_route_nexthop_helper(struct vty *vty, const struct route_entry *re,
50 const struct nexthop *nexthop);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif /*_ZEBRA_RNH_H */