From fe181e7c63843ad65401cc1e400ae1ac3187122f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 11 Nov 2010 12:24:27 +0100 Subject: Adds support for iface link check to static protocol. --- proto/static/config.Y | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'proto/static/config.Y') diff --git a/proto/static/config.Y b/proto/static/config.Y index a7e5016..9f4d7da 100644 --- a/proto/static/config.Y +++ b/proto/static/config.Y @@ -12,11 +12,12 @@ CF_HDR CF_DEFINES +#define STATIC_CFG ((struct static_config *) this_proto) static struct static_route *this_srt; CF_DECLS -CF_KEYWORDS(STATIC, ROUTE, VIA, DROP, REJECT, PROHIBIT, PREFERENCE) +CF_KEYWORDS(STATIC, ROUTE, VIA, DROP, REJECT, PROHIBIT, PREFERENCE, CHECK, LINK) CF_GRAMMAR @@ -31,12 +32,13 @@ static_proto_start: proto_start STATIC { static_proto: static_proto_start proto_name '{' | static_proto proto_item ';' + | static_proto CHECK LINK ';' { STATIC_CFG->check = STATIC_CHECK_LINK; } | static_proto stat_route ';' ; stat_route0: ROUTE prefix { this_srt = cfg_allocz(sizeof(struct static_route)); - add_tail(&((struct static_config *) this_proto)->other_routes, &this_srt->n); + add_tail(&STATIC_CFG->other_routes, &this_srt->n); this_srt->net = $2.addr; this_srt->masklen = $2.len; } @@ -51,7 +53,7 @@ stat_route: this_srt->dest = RTD_DEVICE; this_srt->if_name = $3; rem_node(&this_srt->n); - add_tail(&((struct static_config *) this_proto)->iface_routes, &this_srt->n); + add_tail(&STATIC_CFG->iface_routes, &this_srt->n); } | stat_route0 DROP { this_srt->dest = RTD_BLACKHOLE; } | stat_route0 REJECT { this_srt->dest = RTD_UNREACHABLE; } -- cgit v1.2.3