]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_rnh.h
zebra: remove recursively derived static routes correctly
[mirror_frr.git] / zebra / zebra_rnh.h
CommitLineData
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 *
17 * You should have received a copy of the GNU General Public License
18 * along with GNU Zebra; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22
23#ifndef _ZEBRA_RNH_H
24#define _ZEBRA_RNH_H
25
26#include "prefix.h"
27#include "vty.h"
28
29/* Nexthop structure. */
30struct rnh
31{
32 u_char flags;
078430f6 33
fc9a856f 34#define ZEBRA_NHT_CONNECTED 0x1
70c0f184 35#define ZEBRA_NHT_DELETED 0x2
078430f6
DS
36#define ZEBRA_NHT_EXACT_MATCH 0x4
37
d82ae0de 38 /* VRF identifier. */
39 vrf_id_t vrf_id;
40
fb018d25 41 struct rib *state;
c5f7794f 42 struct prefix resolved_route;
fb018d25 43 struct list *client_list;
6e26278c 44 struct list *zebra_static_route_list; /* static routes dependent on this NH */
fb018d25 45 struct route_node *node;
9f0ea7d4 46 int filtered[ZEBRA_ROUTE_MAX]; /* if this has been filtered for client */
fb018d25
DS
47};
48
078430f6
DS
49typedef enum
50 {
51 RNH_NEXTHOP_TYPE,
52 RNH_IMPORT_CHECK_TYPE
53 } rnh_type_t;
54
a50b580a
DS
55extern int zebra_rnh_ip_default_route;
56extern int zebra_rnh_ipv6_default_route;
57
b72ede27 58extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid,
078430f6 59 rnh_type_t type);
b72ede27 60extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
078430f6
DS
61 rnh_type_t type);
62extern void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type);
7076bb2f
FL
63extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
64 vrf_id_t vrfid);
d82ae0de 65extern void zebra_register_rnh_static_nh(vrf_id_t, struct prefix *, struct route_node *);
66extern void zebra_deregister_rnh_static_nexthops (vrf_id_t, struct nexthop *nexthop,
67 struct route_node *rn);
68extern void zebra_deregister_rnh_static_nh(vrf_id_t, struct prefix *, struct route_node *);
078430f6
DS
69extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
70 rnh_type_t type);
d50b5bdd 71extern void zebra_evaluate_rnh(vrf_id_t vrfid, int family, int force, rnh_type_t type,
078430f6 72 struct prefix *p);
b72ede27 73extern void zebra_print_rnh_table(vrf_id_t vrfid, int family, struct vty *vty, rnh_type_t);
fb018d25 74extern char *rnh_str(struct rnh *rnh, char *buf, int size);
b72ede27 75extern 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 */