diff options
author | Michal 'vorner' Vaner <michal.vaner@nic.cz> | 2017-08-31 15:40:23 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-10-04 16:27:02 +0200 |
commit | 2a95e63343a94243745e5d7000bb3e0cb61a4a0f (patch) | |
tree | abdb14794f5022c4d1828e8fd58dfc8efea5a6e1 /proto/radv/config.Y | |
parent | 5a8b1fb047d675badc17ab24175d0db06d7cc00c (diff) |
RAdv: Support for more specific routes (RFC 4191)
The patch implements Default Router Preferences and More-Specific Routes
(RFC 4191) for RAdv protocol, allowing to announce router preference and
more specific routes in router advertisements. Routes can be exported to
RAdv like to regular routing protocols.
Some cleanups, bugfixes and other changes done by Ondrej Zajicek.
Diffstat (limited to 'proto/radv/config.Y')
-rw-r--r-- | proto/radv/config.Y | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/proto/radv/config.Y b/proto/radv/config.Y index 0ff84aeb..2fa11ce2 100644 --- a/proto/radv/config.Y +++ b/proto/radv/config.Y @@ -30,7 +30,10 @@ CF_KEYWORDS(RADV, PREFIX, INTERFACE, MIN, MAX, RA, DELAY, INTERVAL, MANAGED, OTHER, CONFIG, LINGER, LINK, MTU, REACHABLE, TIME, RETRANS, TIMER, CURRENT, HOP, LIMIT, DEFAULT, VALID, PREFERRED, MULT, LIFETIME, SKIP, ONLINK, AUTONOMOUS, RDNSS, DNSSL, NS, DOMAIN, - LOCAL, TRIGGER, SENSITIVE, PREFERENCE, LOW, MEDIUM, HIGH) + LOCAL, TRIGGER, SENSITIVE, PREFERENCE, LOW, MEDIUM, HIGH, PROPAGATE, + ROUTE, ROUTES, RA_PREFERENCE, RA_LIFETIME) + +CF_ENUM(T_ENUM_RA_PREFERENCE, RA_PREF_, LOW, MEDIUM, HIGH) %type<i> radv_mult radv_sensitive radv_preference @@ -45,6 +48,8 @@ radv_proto_start: proto_start RADV init_list(&RADV_CFG->pref_list); init_list(&RADV_CFG->rdnss_list); init_list(&RADV_CFG->dnssl_list); + RADV_CFG->route_lifetime = DEFAULT_VALID_LIFETIME; + RADV_CFG->route_linger_time = DEFAULT_LINGER_TIME; }; radv_proto_item: @@ -58,6 +63,16 @@ radv_proto_item: RADV_CFG->trigger_pxlen = $2.len; RADV_CFG->trigger_valid = 1; } + | PROPAGATE ROUTES bool { RADV_CFG->propagate_routes = $3; } + | ROUTE LIFETIME expr radv_sensitive { + RADV_CFG->route_lifetime = $3; + if ($4 != -1) RADV_CFG->route_lifetime_sensitive = $4; + } + | ROUTE LINGER TIME expr { + RADV_CFG->route_linger_time = $4; + if (($4 < 0) || ($4 > 3600)) + cf_error("Linger time must be in range 0-3600"); + } ; radv_proto_opts: @@ -168,12 +183,10 @@ radv_prefix_item: | AUTONOMOUS bool { RADV_PREFIX->autonomous = $2; } | VALID LIFETIME expr radv_sensitive { RADV_PREFIX->valid_lifetime = $3; - if ($3 < 0) cf_error("Valid lifetime must be 0 or positive"); if ($4 != -1) RADV_PREFIX->valid_lifetime_sensitive = $4; } | PREFERRED LIFETIME expr radv_sensitive { RADV_PREFIX->preferred_lifetime = $3; - if ($3 < 0) cf_error("Preferred lifetime must be 0 or positive"); if ($4 != -1) RADV_PREFIX->preferred_lifetime_sensitive = $4; } ; @@ -303,6 +316,9 @@ radv_sensitive: | SENSITIVE bool { $$ = $2; } ; +CF_ADDTO(dynamic_attr, RA_PREFERENCE { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_ENUM_RA_PREFERENCE, EA_RA_PREFERENCE); }) +CF_ADDTO(dynamic_attr, RA_LIFETIME { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RA_LIFETIME); }) + CF_CODE CF_END |