]>
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 | ||
a50b580a DS |
32 | extern int zebra_rnh_ip_default_route; |
33 | extern int zebra_rnh_ipv6_default_route; | |
34 | ||
453844ab QY |
35 | extern void zebra_rnh_init(void); |
36 | ||
44bdf159 DS |
37 | static inline int rnh_resolve_via_default(int family) |
38 | { | |
39 | if (((family == AF_INET) && zebra_rnh_ip_default_route) | |
40 | || ((family == AF_INET6) && zebra_rnh_ipv6_default_route)) | |
41 | return 1; | |
42 | else | |
43 | return 0; | |
44 | } | |
45 | ||
b72ede27 | 46 | extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, |
1d30d1f4 | 47 | rnh_type_t type, bool *exists); |
b72ede27 | 48 | extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid, |
078430f6 | 49 | rnh_type_t 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, |
52 | rnh_type_t type, vrf_id_t vrfid); | |
731a75fe RW |
53 | extern void zebra_register_rnh_pseudowire(vrf_id_t, struct zebra_pw *); |
54 | extern void zebra_deregister_rnh_pseudowire(vrf_id_t, struct zebra_pw *); | |
078430f6 DS |
55 | extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client, |
56 | rnh_type_t type); | |
73bf60a0 | 57 | extern void zebra_evaluate_rnh(struct zebra_vrf *zvrf, afi_t afi, int force, |
d62a17ae | 58 | rnh_type_t type, struct prefix *p); |
73bf60a0 | 59 | extern void zebra_print_rnh_table(vrf_id_t vrfid, afi_t afi, struct vty *vty, |
dbeca484 | 60 | rnh_type_t type, struct prefix *p); |
fb018d25 | 61 | extern char *rnh_str(struct rnh *rnh, char *buf, int size); |
51e94aa7 EDP |
62 | |
63 | #ifdef __cplusplus | |
64 | } | |
65 | #endif | |
66 | ||
fb018d25 | 67 | #endif /*_ZEBRA_RNH_H */ |