diff options
author | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-11-14 12:51:45 +0100 |
---|---|---|
committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2018-12-18 15:23:49 +0100 |
commit | 3e20c83affb657cb9cc792ac86843df75343ca47 (patch) | |
tree | 57a698765616eea1e81f27aea99d5361b5a47336 /isisd/isis_vty_fabricd.c | |
parent | isisd: retrofit the 'isis passive' command (diff) | |
download | frr-3e20c83affb657cb9cc792ac86843df75343ca47.tar.xz frr-3e20c83affb657cb9cc792ac86843df75343ca47.zip |
isisd: retrofit the 'isis password' command
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'isisd/isis_vty_fabricd.c')
-rw-r--r-- | isisd/isis_vty_fabricd.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/isisd/isis_vty_fabricd.c b/isisd/isis_vty_fabricd.c index f7deea3d8..0dcf12aa0 100644 --- a/isisd/isis_vty_fabricd.c +++ b/isisd/isis_vty_fabricd.c @@ -723,6 +723,53 @@ DEFUN (no_isis_passive, return CMD_SUCCESS; } +DEFUN (isis_passwd, + isis_passwd_cmd, + PROTO_NAME " password <md5|clear> WORD", + PROTO_HELP + "Configure the authentication password for a circuit\n" + "HMAC-MD5 authentication\n" + "Cleartext password\n" + "Circuit password\n") +{ + int idx_encryption = 2; + int idx_word = 3; + struct isis_circuit *circuit = isis_circuit_lookup(vty); + ferr_r rv; + + if (!circuit) + return CMD_ERR_NO_MATCH; + + if (argv[idx_encryption]->arg[0] == 'm') + rv = isis_circuit_passwd_hmac_md5_set(circuit, + argv[idx_word]->arg); + else + rv = isis_circuit_passwd_cleartext_set(circuit, + argv[idx_word]->arg); + + CMD_FERR_RETURN(rv, "Failed to set circuit password: $ERR"); + return CMD_SUCCESS; +} + +DEFUN (no_isis_passwd, + no_isis_passwd_cmd, + "no " PROTO_NAME " password [<md5|clear> WORD]", + NO_STR + PROTO_HELP + "Configure the authentication password for a circuit\n" + "HMAC-MD5 authentication\n" + "Cleartext password\n" + "Circuit password\n") +{ + struct isis_circuit *circuit = isis_circuit_lookup(vty); + if (!circuit) + return CMD_ERR_NO_MATCH; + + CMD_FERR_RETURN(isis_circuit_passwd_unset(circuit), + "Failed to unset circuit password: $ERR"); + return CMD_SUCCESS; +} + void isis_vty_daemon_init(void) { install_element(ROUTER_NODE, &fabric_tier_cmd); @@ -764,4 +811,7 @@ void isis_vty_daemon_init(void) install_element(INTERFACE_NODE, &isis_passive_cmd); install_element(INTERFACE_NODE, &no_isis_passive_cmd); + + install_element(INTERFACE_NODE, &isis_passwd_cmd); + install_element(INTERFACE_NODE, &no_isis_passwd_cmd); } |