]>
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 | ||
28 | /* Nexthop structure. */ | |
29 | struct rnh | |
30 | { | |
31 | u_char flags; | |
078430f6 | 32 | |
fc9a856f | 33 | #define ZEBRA_NHT_CONNECTED 0x1 |
70c0f184 | 34 | #define ZEBRA_NHT_DELETED 0x2 |
078430f6 DS |
35 | #define ZEBRA_NHT_EXACT_MATCH 0x4 |
36 | ||
d82ae0de | 37 | /* VRF identifier. */ |
38 | vrf_id_t vrf_id; | |
39 | ||
fb018d25 | 40 | struct rib *state; |
c5f7794f | 41 | struct prefix resolved_route; |
fb018d25 | 42 | struct list *client_list; |
6e26278c | 43 | struct list *zebra_static_route_list; /* static routes dependent on this NH */ |
fb018d25 | 44 | struct route_node *node; |
9f0ea7d4 | 45 | int filtered[ZEBRA_ROUTE_MAX]; /* if this has been filtered for client */ |
fb018d25 DS |
46 | }; |
47 | ||
078430f6 DS |
48 | typedef enum |
49 | { | |
50 | RNH_NEXTHOP_TYPE, | |
51 | RNH_IMPORT_CHECK_TYPE | |
52 | } rnh_type_t; | |
53 | ||
a50b580a DS |
54 | extern int zebra_rnh_ip_default_route; |
55 | extern int zebra_rnh_ipv6_default_route; | |
56 | ||
b72ede27 | 57 | extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, |
078430f6 | 58 | rnh_type_t type); |
b72ede27 | 59 | extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid, |
078430f6 | 60 | rnh_type_t type); |
5a8dfcd8 | 61 | extern void zebra_free_rnh (struct rnh *rnh); |
078430f6 | 62 | extern void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type); |
7076bb2f FL |
63 | extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, rnh_type_t type, |
64 | vrf_id_t vrfid); | |
d82ae0de | 65 | extern void zebra_register_rnh_static_nh(vrf_id_t, struct prefix *, struct route_node *); |
66 | extern void zebra_deregister_rnh_static_nexthops (vrf_id_t, struct nexthop *nexthop, | |
67 | struct route_node *rn); | |
68 | extern void zebra_deregister_rnh_static_nh(vrf_id_t, struct prefix *, struct route_node *); | |
078430f6 DS |
69 | extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client, |
70 | rnh_type_t type); | |
d50b5bdd | 71 | extern void zebra_evaluate_rnh(vrf_id_t vrfid, int family, int force, rnh_type_t type, |
078430f6 | 72 | struct prefix *p); |
b72ede27 | 73 | extern void zebra_print_rnh_table(vrf_id_t vrfid, int family, struct vty *vty, rnh_type_t); |
fb018d25 | 74 | extern char *rnh_str(struct rnh *rnh, char *buf, int size); |
b72ede27 | 75 | extern int zebra_cleanup_rnh_client(vrf_id_t vrf, int family, struct zserv *client, |
078430f6 | 76 | rnh_type_t type); |
fb018d25 | 77 | #endif /*_ZEBRA_RNH_H */ |