diff options
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/nest/config.Y b/nest/config.Y index 594ab3fc..62b28072 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -612,6 +612,8 @@ bfd_item: | MULTIPLIER expr { this_bfd_opts->multiplier = $2; } | PASSIVE bool { this_bfd_opts->passive = $2; this_bfd_opts->passive_set = 1; } | GRACEFUL { this_bfd_opts->mode = BGP_BFD_GRACEFUL; } + | AUTHENTICATION bfd_auth_type { this_bfd_opts->auth_type = $2; } + | password_list {} ; bfd_items: @@ -619,10 +621,34 @@ bfd_items: | bfd_items bfd_item ';' ; +bfd_opts_start: +{ reset_passwords(); } ; + +bfd_opts_end: +{ + this_bfd_opts->passwords = get_passwords(); + + if (!this_bfd_opts->auth_type != !this_bfd_opts->passwords) + cf_warn("Authentication and password options should be used together"); + + if (this_bfd_opts->passwords) + { + struct password_item *pass; + WALK_LIST(pass, *this_bfd_opts->passwords) + { + if (pass->alg) + cf_error("Password algorithm option not available in BFD protocol"); + + pass->alg = bfd_auth_type_to_hash_alg[this_bfd_opts->auth_type]; + } + } +}; + bfd_opts: - '{' bfd_items '}' + bfd_opts_start '{' bfd_items '}' bfd_opts_end ; + /* Core commands */ CF_CLI_HELP(SHOW, ..., [[Show status information]]) |