mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-25 23:48:15 +00:00
isisd: retrofit the 'isis hello-padding' command
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
5f2ce4466f
commit
7b6b75e542
@ -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 */
|
||||
|
||||
@ -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_ */
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user