diff options
| author | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-11-13 18:22:20 +0100 |
|---|---|---|
| committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-12-18 15:22:37 +0100 |
| commit | 933536e3ab6b0f78c80f5a2420f149c7f600b356 (patch) | |
| tree | 52ff4a54ff08935248df0bc89dbfa1eadf284156 /isisd/isis_cli.c | |
| parent | e0df3206f187155b8899db9012ebd733304b0ee0 (diff) | |
isisd: retrofit the 'area-password' and 'domain-password' cmds
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd/isis_cli.c')
| -rw-r--r-- | isisd/isis_cli.c | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 7f8b3d54f2..f1f5bbfec8 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -490,6 +490,95 @@ void cli_show_isis_metric_style(struct vty *vty, struct lyd_node *dnode, } } +/* + * XPath: /frr-isisd:isis/instance/area-password + */ +DEFPY(area_passwd, area_passwd_cmd, + "area-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]", + "Configure the authentication password for an area\n" + "Clear-text authentication type\n" + "MD5 authentication type\n" + "Level-wide password\n" + "Authentication\n" + "SNP PDUs\n" + "Send but do not check PDUs on receiving\n" + "Send and check PDUs on receiving\n") +{ + nb_cli_enqueue_change(vty, "./area-password", NB_OP_CREATE, NULL); + nb_cli_enqueue_change(vty, "./area-password/password", NB_OP_MODIFY, + pwd); + nb_cli_enqueue_change(vty, "./area-password/password-type", + NB_OP_MODIFY, pwd_type); + nb_cli_enqueue_change(vty, "./area-password/authenticate-snp", + NB_OP_MODIFY, snp ? snp : "none"); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_isis_area_pwd(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + const char *snp; + + vty_out(vty, " area-password %s %s", + yang_dnode_get_string(dnode, "./password-type"), + yang_dnode_get_string(dnode, "./password")); + snp = yang_dnode_get_string(dnode, "./authenticate-snp"); + if (!strmatch("none", snp)) + vty_out(vty, " authenticate snp %s", snp); + vty_out(vty, "\n"); +} + +/* + * XPath: /frr-isisd:isis/instance/domain-password + */ +DEFPY(domain_passwd, domain_passwd_cmd, + "domain-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]", + "Set the authentication password for a routing domain\n" + "Clear-text authentication type\n" + "MD5 authentication type\n" + "Level-wide password\n" + "Authentication\n" + "SNP PDUs\n" + "Send but do not check PDUs on receiving\n" + "Send and check PDUs on receiving\n") +{ + nb_cli_enqueue_change(vty, "./domain-password", NB_OP_CREATE, NULL); + nb_cli_enqueue_change(vty, "./domain-password/password", NB_OP_MODIFY, + pwd); + nb_cli_enqueue_change(vty, "./domain-password/password-type", + NB_OP_MODIFY, pwd_type); + nb_cli_enqueue_change(vty, "./domain-password/authenticate-snp", + NB_OP_MODIFY, snp ? snp : "none"); + + return nb_cli_apply_changes(vty, NULL); +} + +DEFPY(no_area_passwd, no_area_passwd_cmd, + "no <area-password|domain-password>$cmd", + NO_STR + "Configure the authentication password for an area\n" + "Set the authentication password for a routing domain\n") +{ + nb_cli_enqueue_change(vty, ".", NB_OP_DELETE, NULL); + + return nb_cli_apply_changes(vty, "./%s", cmd); +} + +void cli_show_isis_domain_pwd(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + const char *snp; + + vty_out(vty, " domain-password %s %s", + yang_dnode_get_string(dnode, "./password-type"), + yang_dnode_get_string(dnode, "./password")); + snp = yang_dnode_get_string(dnode, "./authenticate-snp"); + if (!strmatch("none", snp)) + vty_out(vty, " authenticate snp %s", snp); + vty_out(vty, "\n"); +} + void isis_cli_init(void) { install_element(CONFIG_NODE, &router_isis_cmd); @@ -511,6 +600,10 @@ void isis_cli_init(void) install_element(ISIS_NODE, &metric_style_cmd); install_element(ISIS_NODE, &no_metric_style_cmd); + + install_element(ISIS_NODE, &area_passwd_cmd); + install_element(ISIS_NODE, &domain_passwd_cmd); + install_element(ISIS_NODE, &no_area_passwd_cmd); } #endif /* ifndef FABRICD */ |
