1998-12-07 02:21:23 +08:00
|
|
|
/*
|
|
|
|
* BIRD -- Static Route Generator
|
|
|
|
*
|
2000-01-17 19:52:50 +08:00
|
|
|
* (c) 1998--2000 Martin Mares <mj@ucw.cz>
|
1998-12-07 02:21:23 +08:00
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _BIRD_STATIC_H_
|
|
|
|
#define _BIRD_STATIC_H_
|
|
|
|
|
2015-07-25 00:02:07 +08:00
|
|
|
#include "nest/route.h"
|
|
|
|
#include "nest/bfd.h"
|
|
|
|
|
1999-02-06 05:38:22 +08:00
|
|
|
struct static_config {
|
|
|
|
struct proto_config c;
|
2010-11-11 19:24:27 +08:00
|
|
|
list iface_routes; /* Routes to search on interface events */
|
2016-06-13 21:49:53 +08:00
|
|
|
list neigh_routes; /* Routes to search on neighbor events */
|
|
|
|
list other_routes; /* Non-nexthop routes */
|
2011-09-24 08:21:52 +08:00
|
|
|
int check_link; /* Whether iface link state is used */
|
|
|
|
struct rtable_config *igp_table; /* Table used for recursive next hop lookups */
|
1998-12-07 02:21:23 +08:00
|
|
|
};
|
|
|
|
|
2010-11-11 19:24:27 +08:00
|
|
|
|
1999-02-06 05:38:22 +08:00
|
|
|
void static_init_config(struct static_config *);
|
1998-12-07 02:21:23 +08:00
|
|
|
|
|
|
|
struct static_route {
|
|
|
|
node n;
|
1998-12-09 02:31:31 +08:00
|
|
|
struct static_route *chain; /* Next for the same neighbor */
|
2015-11-12 09:03:59 +08:00
|
|
|
net_addr *net; /* Network we route */
|
1998-12-07 02:21:23 +08:00
|
|
|
int dest; /* Destination type (RTD_*) */
|
1998-12-07 07:13:31 +08:00
|
|
|
ip_addr via; /* Destination router */
|
2016-06-13 21:49:53 +08:00
|
|
|
struct iface *iface; /* Destination iface, for link-local vias or device routes */
|
1998-12-07 02:21:23 +08:00
|
|
|
struct neighbor *neigh;
|
2016-06-13 21:49:53 +08:00
|
|
|
byte *if_name; /* Name for device routes */
|
2016-05-06 21:48:35 +08:00
|
|
|
struct static_route *mp_next; /* Nexthops for multipath routes */
|
2016-06-13 21:49:53 +08:00
|
|
|
struct static_route *mp_head; /* First nexthop of this route */
|
2015-07-20 17:12:02 +08:00
|
|
|
struct f_inst *cmds; /* List of commands for setting attributes */
|
2016-05-06 21:48:35 +08:00
|
|
|
u32 state; /* Current state: STS_* */
|
2015-11-12 09:03:59 +08:00
|
|
|
int weight; /* Multipath next hop weight */
|
2016-06-13 21:49:53 +08:00
|
|
|
byte use_bfd; /* Configured to use BFD */
|
|
|
|
byte label_count; /* Number of labels in stack */
|
2015-07-25 00:02:07 +08:00
|
|
|
struct bfd_request *bfd_req; /* BFD request, if BFD is used */
|
2016-06-13 21:49:53 +08:00
|
|
|
u32 *label_stack; /* Label stack if label_count > 0 */
|
1998-12-07 02:21:23 +08:00
|
|
|
};
|
|
|
|
|
2016-05-06 21:48:35 +08:00
|
|
|
#define STS_INSTALLED 0x1
|
2016-06-13 21:49:53 +08:00
|
|
|
#define STS_WANT 0x2
|
|
|
|
#define STS_FORCE 0x4
|
2016-05-06 21:48:35 +08:00
|
|
|
|
2010-12-08 06:34:36 +08: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 08:21:52 +08:00
|
|
|
|
|
|
|
#define RTDX_RECURSIVE 0x7f /* Phony dest value for recursive routes */
|
|
|
|
|
1999-12-03 19:41:23 +08:00
|
|
|
void static_show(struct proto *);
|
|
|
|
|
1998-12-07 02:21:23 +08:00
|
|
|
#endif
|