mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-25 21:36:38 +00:00
zebra: convert interface ipv6 nd adv-interval-option command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
509eb9c297
commit
f36cdd4a00
@ -2440,6 +2440,15 @@ module frr-zebra {
|
||||
more frequently than once every 3 seconds as required by
|
||||
RFC 4861.";
|
||||
}
|
||||
leaf advertisement-interval-option {
|
||||
type boolean;
|
||||
default "false";
|
||||
description
|
||||
"Enable sending the Advertisement Interval Option in
|
||||
Router Advertisements.";
|
||||
reference
|
||||
"RFC 6275: Mobility Support in IPv6";
|
||||
}
|
||||
}
|
||||
container state {
|
||||
config false;
|
||||
|
||||
@ -1781,35 +1781,23 @@ DEFPY_YANG (ipv6_nd_homeagent_config_flag,
|
||||
return nb_cli_apply_changes(vty, NULL);
|
||||
}
|
||||
|
||||
DEFUN (ipv6_nd_adv_interval_config_option,
|
||||
DEFPY_YANG (ipv6_nd_adv_interval_config_option,
|
||||
ipv6_nd_adv_interval_config_option_cmd,
|
||||
"ipv6 nd adv-interval-option",
|
||||
"Interface IPv6 config commands\n"
|
||||
"Neighbor discovery\n"
|
||||
"Advertisement Interval Option\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct zebra_if *zif = ifp->info;
|
||||
|
||||
zif->rtadv.AdvIntervalOption = 1;
|
||||
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN (no_ipv6_nd_adv_interval_config_option,
|
||||
no_ipv6_nd_adv_interval_config_option_cmd,
|
||||
"no ipv6 nd adv-interval-option",
|
||||
"[no] ipv6 nd adv-interval-option",
|
||||
NO_STR
|
||||
"Interface IPv6 config commands\n"
|
||||
"Neighbor discovery\n"
|
||||
"Advertisement Interval Option\n")
|
||||
{
|
||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
||||
struct zebra_if *zif = ifp->info;
|
||||
|
||||
zif->rtadv.AdvIntervalOption = 0;
|
||||
|
||||
return CMD_SUCCESS;
|
||||
if (!no)
|
||||
nb_cli_enqueue_change(vty,
|
||||
"./frr-zebra:zebra/ipv6-router-advertisements/advertisement-interval-option",
|
||||
NB_OP_MODIFY, "true");
|
||||
else
|
||||
nb_cli_enqueue_change(vty,
|
||||
"./frr-zebra:zebra/ipv6-router-advertisements/advertisement-interval-option",
|
||||
NB_OP_DESTROY, NULL);
|
||||
return nb_cli_apply_changes(vty, NULL);
|
||||
}
|
||||
|
||||
DEFPY_YANG (ipv6_nd_other_config_flag,
|
||||
@ -2689,10 +2677,7 @@ void rtadv_cmd_init(void)
|
||||
install_element(INTERFACE_NODE, &no_ipv6_nd_homeagent_preference_cmd);
|
||||
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_lifetime_cmd);
|
||||
install_element(INTERFACE_NODE, &no_ipv6_nd_homeagent_lifetime_cmd);
|
||||
install_element(INTERFACE_NODE,
|
||||
&ipv6_nd_adv_interval_config_option_cmd);
|
||||
install_element(INTERFACE_NODE,
|
||||
&no_ipv6_nd_adv_interval_config_option_cmd);
|
||||
install_element(INTERFACE_NODE, &ipv6_nd_adv_interval_config_option_cmd);
|
||||
install_element(INTERFACE_NODE, &ipv6_nd_prefix_cmd);
|
||||
install_element(INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
|
||||
install_element(INTERFACE_NODE, &ipv6_nd_router_preference_cmd);
|
||||
|
||||
@ -614,6 +614,12 @@ const struct frr_yang_module_info frr_zebra_info = {
|
||||
.modify = lib_interface_zebra_ipv6_router_advertisements_fast_retransmit_modify,
|
||||
}
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/advertisement-interval-option",
|
||||
.cbs = {
|
||||
.modify = lib_interface_zebra_ipv6_router_advertisements_advertisement_interval_option_modify,
|
||||
}
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/state/up-count",
|
||||
.cbs = {
|
||||
|
||||
@ -207,6 +207,8 @@ int lib_interface_zebra_ipv6_router_advertisements_default_lifetime_destroy(
|
||||
struct nb_cb_destroy_args *args);
|
||||
int lib_interface_zebra_ipv6_router_advertisements_fast_retransmit_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
int lib_interface_zebra_ipv6_router_advertisements_advertisement_interval_option_modify(
|
||||
struct nb_cb_modify_args *args);
|
||||
struct yang_data *
|
||||
lib_interface_zebra_state_up_count_get_elem(struct nb_cb_get_elem_args *args);
|
||||
struct yang_data *
|
||||
|
||||
@ -2743,6 +2743,29 @@ int lib_interface_zebra_ipv6_router_advertisements_fast_retransmit_modify(
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/advertisement-interval-option
|
||||
*/
|
||||
int lib_interface_zebra_ipv6_router_advertisements_advertisement_interval_option_modify(
|
||||
struct nb_cb_modify_args *args)
|
||||
{
|
||||
struct interface *ifp;
|
||||
struct zebra_if *zif;
|
||||
bool option;
|
||||
|
||||
if (args->event != NB_EV_APPLY)
|
||||
return NB_OK;
|
||||
|
||||
ifp = nb_running_get_entry(args->dnode, NULL, true);
|
||||
zif = ifp->info;
|
||||
|
||||
option = yang_dnode_get_bool(args->dnode, NULL);
|
||||
|
||||
zif->rtadv.AdvIntervalOption = !!option;
|
||||
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user