diff options
author | David Lamparter <equinox@diac24.net> | 2010-02-05 04:31:56 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-05 04:39:55 +0100 |
commit | cf245afd5dd1f8c7c80089465e610acaaa1e2f24 (patch) | |
tree | 6065436c819b730b20a5bd30ae281e272bdfeeb1 /zebra/rib.h | |
parent | ada3758d3977726fa3140a27a0e503787a83ab71 (diff) | |
download | quagga-cf245afd5dd1f8c7c80089465e610acaaa1e2f24.tar.bz2 quagga-cf245afd5dd1f8c7c80089465e610acaaa1e2f24.tar.xz |
zebra: cleanup blackhole support
blackhole support was horribly broken. cleanup by removing blackhole
stuff from ZEBRA_FLAG_*, instead add a "zflags" field inside struct rib.
introduces support for "prohibit" routes (Linux/netlink only)
also clean up blackhole options on "ip route" vty commands.
Diffstat (limited to 'zebra/rib.h')
-rw-r--r-- | zebra/rib.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 887ed3c2..72d1de0c 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -73,6 +73,15 @@ struct rib */ u_char flags; + /* flags internal to zebra, not sent to clients */ + unsigned zflags; + /* blackhole route zflags, for static routes: */ +#define RIB_ZF_REJECT 1 +#define RIB_ZF_PROHIBIT 2 +#define RIB_ZF_BLACKHOLE 3 + +#define RIB_ZF_BLACKHOLE_FLAGS(zflags) ((zflags) & RIB_ZF_BLACKHOLE) + /* RIB internal status */ u_char status; #define RIB_ENTRY_REMOVED (1 << 0) @@ -120,12 +129,8 @@ struct static_ipv4 char *ifname; } gate; - /* bit flags */ - u_char flags; -/* - see ZEBRA_FLAG_REJECT - ZEBRA_FLAG_BLACKHOLE - */ + /* zflags for rib */ + unsigned zflags; }; #ifdef HAVE_IPV6 @@ -144,17 +149,14 @@ struct static_ipv6 #define STATIC_IPV6_GATEWAY 1 #define STATIC_IPV6_GATEWAY_IFNAME 2 #define STATIC_IPV6_IFNAME 3 +#define STATIC_IPV6_BLACKHOLE 4 /* Nexthop value. */ struct in6_addr ipv6; char *ifname; - /* bit flags */ - u_char flags; -/* - see ZEBRA_FLAG_REJECT - ZEBRA_FLAG_BLACKHOLE - */ + /* zflags for rib */ + unsigned zflags; }; #endif /* HAVE_IPV6 */ @@ -269,7 +271,7 @@ extern void rib_init (void); extern int static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname, - u_char flags, u_char distance, u_int32_t vrf_id); + unsigned zflags, u_char distance, u_int32_t vrf_id); extern int static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname, @@ -293,7 +295,7 @@ extern struct route_table *rib_table_ipv6; extern int static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate, - const char *ifname, u_char flags, u_char distance, + const char *ifname, unsigned zflags, u_char distance, u_int32_t vrf_id); extern int |