2 * Zebra next hop tracking header
3 * Copyright (C) 2013 Cumulus Networks, Inc.
5 * This file is part of GNU Zebra.
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
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.
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
28 /* Nexthop structure. */
32 #define ZEBRA_NHT_CONNECTED 0x1
33 #define ZEBRA_NHT_DELETED 0x2
34 #define ZEBRA_NHT_EXACT_MATCH 0x4
39 struct route_entry
*state
;
40 struct prefix resolved_route
;
41 struct list
*client_list
;
43 /* pseudowires dependent on this nh */
44 struct list
*zebra_pseudowire_list
;
46 struct route_node
*node
;
49 * if this has been filtered for the client
51 int filtered
[ZEBRA_ROUTE_MAX
];
54 typedef enum { RNH_NEXTHOP_TYPE
, RNH_IMPORT_CHECK_TYPE
} rnh_type_t
;
56 extern int zebra_rnh_ip_default_route
;
57 extern int zebra_rnh_ipv6_default_route
;
59 extern void zebra_rnh_init(void);
61 static inline int rnh_resolve_via_default(int family
)
63 if (((family
== AF_INET
) && zebra_rnh_ip_default_route
)
64 || ((family
== AF_INET6
) && zebra_rnh_ipv6_default_route
))
70 extern struct rnh
*zebra_add_rnh(struct prefix
*p
, vrf_id_t vrfid
,
72 extern struct rnh
*zebra_lookup_rnh(struct prefix
*p
, vrf_id_t vrfid
,
74 extern void zebra_free_rnh(struct rnh
*rnh
);
75 extern void zebra_delete_rnh(struct rnh
*rnh
, rnh_type_t type
);
76 extern void zebra_add_rnh_client(struct rnh
*rnh
, struct zserv
*client
,
77 rnh_type_t type
, vrf_id_t vrfid
);
78 extern void zebra_register_rnh_pseudowire(vrf_id_t
, struct zebra_pw
*);
79 extern void zebra_deregister_rnh_pseudowire(vrf_id_t
, struct zebra_pw
*);
80 extern void zebra_remove_rnh_client(struct rnh
*rnh
, struct zserv
*client
,
82 extern void zebra_evaluate_rnh(vrf_id_t vrfid
, int family
, int force
,
83 rnh_type_t type
, struct prefix
*p
);
84 extern void zebra_print_rnh_table(vrf_id_t vrfid
, int family
, struct vty
*vty
,
86 extern char *rnh_str(struct rnh
*rnh
, char *buf
, int size
);
87 #endif /*_ZEBRA_RNH_H */