From 31f2069d61dba59e0720054dedec2bd5806b2e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Tvrd=C3=ADk?= Date: Tue, 22 Dec 2015 16:49:28 +0100 Subject: [PATCH] RPKI: add ability to configurate intervals Adds an ability to configure retry, refresh and expire intervals for cache connection. --- proto/rpki/config.Y | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/proto/rpki/config.Y b/proto/rpki/config.Y index 41590ca5..730a9c2e 100644 --- a/proto/rpki/config.Y +++ b/proto/rpki/config.Y @@ -19,6 +19,7 @@ static struct rpki_cache_cfg *this_rpki_cache_cfg; CF_DECLS CF_KEYWORDS(RPKI, CACHE, LIST, PREFERENCE, BIRD, PRIVATE, PUBLIC, KEY, SSH, ENCRYPTION, USER) +CF_KEYWORDS(RETRY, REFRESH, EXPIRE) CF_GRAMMAR @@ -93,22 +94,25 @@ rpki_optional_cache_opts: ; rpki_cache_opts: -/* empty */ -| rpki_cache_opts rpki_cache_opts_item ';' -; + /* empty */ + | rpki_cache_opts rpki_cache_opts_item ';' + ; rpki_cache_opts_item: -PORT expr { + PORT expr { check_u16($2); this_rpki_cache_cfg->port = $2; -} -| PREFERENCE expr { - if ($2 < 1 || $2 > 0xFF) - cf_error("Value %d is out of range (1-255)", $2); - this_rpki_cache_cfg->preference = $2; -} -| SSH ENCRYPTION rpki_transport_ssh_init '{' rpki_transport_ssh_opts '}' rpki_transport_ssh_finish -; + } + | PREFERENCE expr { + if ($2 < 1 || $2 > 0xFF) + cf_error("Value %d is out of range (1-255)", $2); + this_rpki_cache_cfg->preference = $2; + } + | REFRESH expr { this_rpki_cache_cfg->refresh_interval = $2; } + | RETRY expr { this_rpki_cache_cfg->retry_interval = $2; } + | EXPIRE expr { this_rpki_cache_cfg->expire_interval = $2; } + | SSH ENCRYPTION rpki_transport_ssh_init '{' rpki_transport_ssh_opts '}' rpki_transport_ssh_finish + ; rpki_transport_ssh_init: {