2015-05-20 02:40:34 +02:00
|
|
|
/*
|
|
|
|
* Zebra next hop tracking header
|
|
|
|
* Copyright (C) 2013 Cumulus Networks, Inc.
|
|
|
|
*
|
|
|
|
* This file is part of GNU Zebra.
|
|
|
|
*
|
|
|
|
* GNU Zebra is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2, or (at your option) any
|
|
|
|
* later version.
|
|
|
|
*
|
|
|
|
* GNU Zebra is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with GNU Zebra; see the file COPYING. If not, write to the Free
|
|
|
|
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ZEBRA_RNH_H
|
|
|
|
#define _ZEBRA_RNH_H
|
|
|
|
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "vty.h"
|
|
|
|
|
|
|
|
/* Nexthop structure. */
|
|
|
|
struct rnh
|
|
|
|
{
|
|
|
|
u_char flags;
|
2015-05-20 03:04:20 +02:00
|
|
|
|
2015-05-20 02:47:21 +02:00
|
|
|
#define ZEBRA_NHT_CONNECTED 0x1
|
2015-05-20 03:04:10 +02:00
|
|
|
#define ZEBRA_NHT_DELETED 0x2
|
2015-05-20 03:04:20 +02:00
|
|
|
#define ZEBRA_NHT_EXACT_MATCH 0x4
|
|
|
|
|
2015-05-20 02:40:34 +02:00
|
|
|
struct rib *state;
|
2015-05-20 03:04:16 +02:00
|
|
|
struct prefix resolved_route;
|
2015-05-20 02:40:34 +02:00
|
|
|
struct list *client_list;
|
2015-05-20 02:47:22 +02:00
|
|
|
struct list *zebra_static_route_list; /* static routes dependent on this NH */
|
2015-05-20 02:40:34 +02:00
|
|
|
struct route_node *node;
|
2015-05-20 02:47:20 +02:00
|
|
|
int filtered[ZEBRA_ROUTE_MAX]; /* if this has been filtered for client */
|
2015-05-20 02:40:34 +02:00
|
|
|
};
|
|
|
|
|
2015-05-20 03:04:20 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RNH_NEXTHOP_TYPE,
|
|
|
|
RNH_IMPORT_CHECK_TYPE
|
|
|
|
} rnh_type_t;
|
|
|
|
|
2015-05-20 03:04:16 +02:00
|
|
|
extern int zebra_rnh_ip_default_route;
|
|
|
|
extern int zebra_rnh_ipv6_default_route;
|
|
|
|
|
2015-05-20 03:04:20 +02:00
|
|
|
extern struct rnh *zebra_add_rnh(struct prefix *p, u_int32_t vrfid,
|
|
|
|
rnh_type_t type);
|
|
|
|
extern struct rnh *zebra_lookup_rnh(struct prefix *p, u_int32_t vrfid,
|
|
|
|
rnh_type_t type);
|
|
|
|
extern void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type);
|
|
|
|
extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, rnh_type_t type);
|
2015-05-20 02:47:22 +02:00
|
|
|
extern void zebra_register_rnh_static_nh(struct prefix *, struct route_node *);
|
|
|
|
extern void zebra_deregister_rnh_static_nh(struct prefix *, struct route_node *);
|
2015-05-20 03:04:20 +02:00
|
|
|
extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
|
|
|
|
rnh_type_t type);
|
|
|
|
extern int zebra_evaluate_rnh(int vrfid, int family, int force, rnh_type_t type,
|
|
|
|
struct prefix *p);
|
|
|
|
extern int zebra_dispatch_rnh_table(int vrfid, int family, struct zserv *cl, rnh_type_t);
|
|
|
|
extern void zebra_print_rnh_table(int vrfid, int family, struct vty *vty, rnh_type_t);
|
2015-05-20 02:40:34 +02:00
|
|
|
extern char *rnh_str(struct rnh *rnh, char *buf, int size);
|
2015-05-20 03:04:20 +02:00
|
|
|
extern int zebra_cleanup_rnh_client(int vrf, int family, struct zserv *client,
|
|
|
|
rnh_type_t type);
|
2015-05-20 02:40:34 +02:00
|
|
|
#endif /*_ZEBRA_RNH_H */
|