diff options
| -rw-r--r-- | isisd/isis_cli.c | 26 | ||||
| -rw-r--r-- | isisd/isis_cli.h | 2 | ||||
| -rw-r--r-- | isisd/isis_northbound.c | 10 | ||||
| -rw-r--r-- | isisd/isis_vty_isisd.c | 36 |
4 files changed, 37 insertions, 37 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 9125acffd4..a584817507 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -1471,6 +1471,30 @@ void cli_show_ip_isis_threeway_shake(struct vty *vty, struct lyd_node *dnode, vty_out(vty, " no isis three-way-handshake\n"); } +/* + * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding + */ +DEFPY(isis_hello_padding, isis_hello_padding_cmd, "[no] isis hello padding", + NO_STR + "IS-IS routing protocol\n" + "Add padding to IS-IS hello packets\n" + "Pad hello packets\n") +{ + nb_cli_enqueue_change(vty, "./frr-isisd:isis/hello/padding", + NB_OP_MODIFY, no ? "false" : "true"); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_ip_isis_hello_padding(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + if (!yang_dnode_get_bool(dnode, NULL)) + vty_out(vty, " no"); + + vty_out(vty, " isis hello padding\n"); +} + void isis_cli_init(void) { install_element(CONFIG_NODE, &router_isis_cmd); @@ -1538,6 +1562,8 @@ void isis_cli_init(void) install_element(INTERFACE_NODE, &no_isis_hello_multiplier_cmd); install_element(INTERFACE_NODE, &isis_threeway_adj_cmd); + + install_element(INTERFACE_NODE, &isis_hello_padding_cmd); } #endif /* ifndef FABRICD */ diff --git a/isisd/isis_cli.h b/isisd/isis_cli.h index 340e3ce7a9..5162618a28 100644 --- a/isisd/isis_cli.h +++ b/isisd/isis_cli.h @@ -93,5 +93,7 @@ void cli_show_ip_isis_hello_multi(struct vty *vty, struct lyd_node *dnode, bool show_defaults); void cli_show_ip_isis_threeway_shake(struct vty *vty, struct lyd_node *dnode, bool show_defaults); +void cli_show_ip_isis_hello_padding(struct vty *vty, struct lyd_node *dnode, + bool show_defaults); #endif /* ISISD_ISIS_CLI_H_ */ diff --git a/isisd/isis_northbound.c b/isisd/isis_northbound.c index 0a93f226fd..c03ebd56eb 100644 --- a/isisd/isis_northbound.c +++ b/isisd/isis_northbound.c @@ -1896,7 +1896,14 @@ static int lib_interface_isis_hello_padding_modify(enum nb_event event, const struct lyd_node *dnode, union nb_resource *resource) { - /* TODO: implement me. */ + struct isis_circuit *circuit; + + if (event != NB_EV_APPLY) + return NB_OK; + + circuit = yang_dnode_get_entry(dnode, true); + circuit->pad_hellos = yang_dnode_get_bool(dnode, NULL); + return NB_OK; } @@ -2690,6 +2697,7 @@ const struct frr_yang_module_info frr_isisd_info = { { .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/padding", .cbs.modify = lib_interface_isis_hello_padding_modify, + .cbs.cli_show = cli_show_ip_isis_hello_padding, }, { .xpath = "/frr-interface:lib/interface/frr-isisd:isis/hello/interval", diff --git a/isisd/isis_vty_isisd.c b/isisd/isis_vty_isisd.c index 40cbb2d666..13ae164cc7 100644 --- a/isisd/isis_vty_isisd.c +++ b/isisd/isis_vty_isisd.c @@ -219,39 +219,6 @@ DEFUN (no_isis_priority_level, return CMD_SUCCESS; } -DEFUN (isis_hello_padding, - isis_hello_padding_cmd, - "isis hello padding", - "IS-IS routing protocol\n" - "Add padding to IS-IS hello packets\n" - "Pad hello packets\n") -{ - struct isis_circuit *circuit = isis_circuit_lookup(vty); - if (!circuit) - return CMD_ERR_NO_MATCH; - - circuit->pad_hellos = 1; - - return CMD_SUCCESS; -} - -DEFUN (no_isis_hello_padding, - no_isis_hello_padding_cmd, - "no isis hello padding", - NO_STR - "IS-IS routing protocol\n" - "Add padding to IS-IS hello packets\n" - "Pad hello packets\n") -{ - struct isis_circuit *circuit = isis_circuit_lookup(vty); - if (!circuit) - return CMD_ERR_NO_MATCH; - - circuit->pad_hellos = 0; - - return CMD_SUCCESS; -} - DEFUN (csnp_interval_level, csnp_interval_level_cmd, "isis csnp-interval (1-600) <level-1|level-2>", @@ -343,9 +310,6 @@ void isis_vty_daemon_init(void) install_element(INTERFACE_NODE, &isis_priority_level_cmd); install_element(INTERFACE_NODE, &no_isis_priority_level_cmd); - install_element(INTERFACE_NODE, &isis_hello_padding_cmd); - install_element(INTERFACE_NODE, &no_isis_hello_padding_cmd); - install_element(INTERFACE_NODE, &csnp_interval_level_cmd); install_element(INTERFACE_NODE, &no_csnp_interval_level_cmd); |
