]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_rnh.h
bgpd-nht-import-check-fix.patch
[mirror_frr.git] / zebra / zebra_rnh.h
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. */
30 struct rnh
31 {
32 u_char flags;
33
34 #define ZEBRA_NHT_CONNECTED 0x1
35 #define ZEBRA_NHT_DELETED 0x2
36 #define ZEBRA_NHT_EXACT_MATCH 0x4
37
38 struct rib *state;
39 struct prefix resolved_route;
40 struct list *client_list;
41 struct list *zebra_static_route_list; /* static routes dependent on this NH */
42 struct route_node *node;
43 int filtered[ZEBRA_ROUTE_MAX]; /* if this has been filtered for client */
44 };
45
46 typedef enum
47 {
48 RNH_NEXTHOP_TYPE,
49 RNH_IMPORT_CHECK_TYPE
50 } rnh_type_t;
51
52 extern int zebra_rnh_ip_default_route;
53 extern int zebra_rnh_ipv6_default_route;
54
55 extern struct rnh *zebra_add_rnh(struct prefix *p, u_int32_t vrfid,
56 rnh_type_t type);
57 extern struct rnh *zebra_lookup_rnh(struct prefix *p, u_int32_t vrfid,
58 rnh_type_t type);
59 extern void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type);
60 extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, rnh_type_t type);
61 extern void zebra_register_rnh_static_nh(struct prefix *, struct route_node *);
62 extern void zebra_deregister_rnh_static_nh(struct prefix *, struct route_node *);
63 extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
64 rnh_type_t type);
65 extern int zebra_evaluate_rnh(int vrfid, int family, int force, rnh_type_t type,
66 struct prefix *p);
67 extern int zebra_dispatch_rnh_table(int vrfid, int family, struct zserv *cl, rnh_type_t);
68 extern void zebra_print_rnh_table(int vrfid, int family, struct vty *vty, rnh_type_t);
69 extern char *rnh_str(struct rnh *rnh, char *buf, int size);
70 extern int zebra_cleanup_rnh_client(int vrf, int family, struct zserv *client,
71 rnh_type_t type);
72 #endif /*_ZEBRA_RNH_H */