1998-12-06 18:21:23 +00:00
|
|
|
/*
|
|
|
|
* BIRD -- Static Route Generator
|
|
|
|
*
|
2000-01-17 11:52:50 +00:00
|
|
|
* (c) 1998--2000 Martin Mares <mj@ucw.cz>
|
1998-12-06 18:21:23 +00:00
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BIRD_STATIC_H_
|
|
|
|
#define _BIRD_STATIC_H_
|
|
|
|
|
2015-07-24 16:02:07 +00:00
|
|
|
#include "nest/route.h"
|
|
|
|
#include "nest/bfd.h"
|
|
|
|
|
1999-02-05 21:38:22 +00:00
|
|
|
struct static_config {
|
|
|
|
struct proto_config c;
|
2010-11-11 11:24:27 +00:00
|
|
|
list iface_routes; /* Routes to search on interface events */
|
|
|
|
list other_routes; /* Routes hooked to neighbor cache and reject routes */
|
2011-09-24 00:21:52 +00:00
|
|
|
int check_link; /* Whether iface link state is used */
|
|
|
|
struct rtable_config *igp_table; /* Table used for recursive next hop lookups */
|
1998-12-06 18:21:23 +00:00
|
|
|
};
|
|
|
|
|
2010-11-11 11:24:27 +00:00
|
|
|
|
1999-02-05 21:38:22 +00:00
|
|
|
void static_init_config(struct static_config *);
|
1998-12-06 18:21:23 +00:00
|
|
|
|
|
|
|
struct static_route {
|
|
|
|
node n;
|
1998-12-08 18:31:31 +00:00
|
|
|
struct static_route *chain; /* Next for the same neighbor */
|
2015-11-12 01:03:59 +00:00
|
|
|
net_addr *net; /* Network we route */
|
1998-12-06 18:21:23 +00:00
|
|
|
int dest; /* Destination type (RTD_*) */
|
1998-12-06 23:13:31 +00:00
|
|
|
ip_addr via; /* Destination router */
|
2012-01-01 11:02:20 +00:00
|
|
|
struct iface *via_if; /* Destination iface, for link-local vias */
|
1998-12-06 18:21:23 +00:00
|
|
|
struct neighbor *neigh;
|
1998-12-06 23:13:31 +00:00
|
|
|
byte *if_name; /* Name for RTD_DEVICE routes */
|
2010-12-07 22:34:36 +00:00
|
|
|
struct static_route *mp_next; /* Nexthops for RTD_MULTIPATH routes */
|
2015-07-20 09:12:02 +00:00
|
|
|
struct f_inst *cmds; /* List of commands for setting attributes */
|
2014-02-26 12:25:39 +00:00
|
|
|
int installed; /* Installed in rt table, -1 for reinstall */
|
2015-07-24 16:02:07 +00:00
|
|
|
int use_bfd; /* Configured to use BFD */
|
2015-11-12 01:03:59 +00:00
|
|
|
int weight; /* Multipath next hop weight */
|
2015-07-24 16:02:07 +00:00
|
|
|
struct bfd_request *bfd_req; /* BFD request, if BFD is used */
|
1998-12-06 18:21:23 +00:00
|
|
|
};
|
|
|
|
|
2010-12-07 22:34:36 +00:00
|
|
|
/* Dummy nodes (parts of multipath route) abuses masklen field for weight
|
|
|
|
and if_name field for a ptr to the master (RTD_MULTIPATH) node. */
|
|
|
|
|
2011-09-24 00:21:52 +00:00
|
|
|
|
|
|
|
#define RTDX_RECURSIVE 0x7f /* Phony dest value for recursive routes */
|
|
|
|
|
1999-12-03 11:41:23 +00:00
|
|
|
void static_show(struct proto *);
|
|
|
|
|
1998-12-06 18:21:23 +00:00
|
|
|
#endif
|