]>
Commit | Line | Data |
---|---|---|
fb018d25 DS |
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 | * | |
896014f4 DL |
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 | |
fb018d25 DS |
20 | */ |
21 | ||
22 | #ifndef _ZEBRA_RNH_H | |
23 | #define _ZEBRA_RNH_H | |
24 | ||
25 | #include "prefix.h" | |
26 | #include "vty.h" | |
27 | ||
51e94aa7 EDP |
28 | #ifdef __cplusplus |
29 | extern "C" { | |
30 | #endif | |
31 | ||
453844ab QY |
32 | extern void zebra_rnh_init(void); |
33 | ||
f9215571 | 34 | static inline const char *rnh_type2str(enum rnh_type type) |
0a7be328 DS |
35 | { |
36 | switch (type) { | |
37 | case RNH_NEXTHOP_TYPE: | |
38 | return "Nexthop"; | |
39 | case RNH_IMPORT_CHECK_TYPE: | |
40 | return "Import"; | |
41 | } | |
42 | ||
43 | return "ERROR"; | |
44 | } | |
45 | ||
b72ede27 | 46 | extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, |
f9215571 | 47 | enum rnh_type type, bool *exists); |
b72ede27 | 48 | extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid, |
f9215571 | 49 | enum rnh_type type); |
d62a17ae | 50 | extern void zebra_free_rnh(struct rnh *rnh); |
d62a17ae | 51 | extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, |
f9215571 | 52 | enum rnh_type type, vrf_id_t vrfid); |
31f937fb SM |
53 | extern int zebra_send_rnh_update(struct rnh *rnh, struct zserv *client, |
54 | enum rnh_type type, vrf_id_t vrf_id, | |
55 | uint32_t srte_color); | |
1fddcd0a | 56 | extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *, bool *); |
731a75fe | 57 | extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *); |
078430f6 | 58 | extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client, |
f9215571 | 59 | enum rnh_type type); |
73bf60a0 | 60 | extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force, |
f9215571 | 61 | enum rnh_type type, struct prefix *p); |
73bf60a0 | 62 | extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty, |
f9215571 | 63 | enum rnh_type type, struct prefix *p); |
51e94aa7 | 64 | |
5a0bdc78 PG |
65 | extern int rnh_resolve_via_default(struct zebra_vrf *zvrf, int family); |
66 | ||
b59839af DS |
67 | extern bool rnh_nexthop_valid(const struct route_entry *re, |
68 | const struct nexthop *nh); | |
69 | ||
aef1d540 MS |
70 | /* UI control to avoid notifications if backup nexthop status changes */ |
71 | void rnh_set_hide_backups(bool hide_p); | |
72 | bool rnh_get_hide_backups(void); | |
73 | ||
51e94aa7 EDP |
74 | #ifdef __cplusplus |
75 | } | |
76 | #endif | |
77 | ||
fb018d25 | 78 | #endif /*_ZEBRA_RNH_H */ |