mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:33:56 +00:00
zebra: convert interface ipv6 nd home-agent-lifetime command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
8a1fdff198
commit
a003ecda71
@ -2458,6 +2458,15 @@ module frr-zebra {
|
|||||||
reference
|
reference
|
||||||
"RFC 6275: Mobility Support in IPv6";
|
"RFC 6275: Mobility Support in IPv6";
|
||||||
}
|
}
|
||||||
|
leaf home-agent-lifetime {
|
||||||
|
type uint16;
|
||||||
|
description
|
||||||
|
"The value to be placed in the Home Agent Lifetime
|
||||||
|
field in the Router Advertisement messages sent by the
|
||||||
|
router.";
|
||||||
|
reference
|
||||||
|
"RFC 6275: Mobility Support in IPv6";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
container state {
|
container state {
|
||||||
config false;
|
config false;
|
||||||
|
@ -1698,36 +1698,24 @@ DEFPY_YANG (ipv6_nd_homeagent_preference,
|
|||||||
return nb_cli_apply_changes(vty, NULL);
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFUN (ipv6_nd_homeagent_lifetime,
|
DEFPY_YANG (ipv6_nd_homeagent_lifetime,
|
||||||
ipv6_nd_homeagent_lifetime_cmd,
|
ipv6_nd_homeagent_lifetime_cmd,
|
||||||
"ipv6 nd home-agent-lifetime (0-65520)",
|
"[no] ipv6 nd home-agent-lifetime ![(1-65520)$lifetime]",
|
||||||
"Interface IPv6 config commands\n"
|
|
||||||
"Neighbor discovery\n"
|
|
||||||
"Home Agent lifetime\n"
|
|
||||||
"Home Agent lifetime in seconds (0 to track ra-lifetime)\n")
|
|
||||||
{
|
|
||||||
int idx_number = 3;
|
|
||||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
|
||||||
struct zebra_if *zif = ifp->info;
|
|
||||||
zif->rtadv.HomeAgentLifetime = strtoul(argv[idx_number]->arg, NULL, 10);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_ipv6_nd_homeagent_lifetime,
|
|
||||||
no_ipv6_nd_homeagent_lifetime_cmd,
|
|
||||||
"no ipv6 nd home-agent-lifetime [(0-65520)]",
|
|
||||||
NO_STR
|
NO_STR
|
||||||
"Interface IPv6 config commands\n"
|
"Interface IPv6 config commands\n"
|
||||||
"Neighbor discovery\n"
|
"Neighbor discovery\n"
|
||||||
"Home Agent lifetime\n"
|
"Home Agent lifetime\n"
|
||||||
"Home Agent lifetime in seconds (0 to track ra-lifetime)\n")
|
"Home Agent lifetime in seconds\n")
|
||||||
{
|
{
|
||||||
VTY_DECLVAR_CONTEXT(interface, ifp);
|
if (!no)
|
||||||
struct zebra_if *zif = ifp->info;
|
nb_cli_enqueue_change(vty,
|
||||||
|
"./frr-zebra:zebra/ipv6-router-advertisements/home-agent-lifetime",
|
||||||
zif->rtadv.HomeAgentLifetime = -1;
|
NB_OP_MODIFY, lifetime_str);
|
||||||
|
else
|
||||||
return CMD_SUCCESS;
|
nb_cli_enqueue_change(vty,
|
||||||
|
"./frr-zebra:zebra/ipv6-router-advertisements/home-agent-lifetime",
|
||||||
|
NB_OP_DESTROY, NULL);
|
||||||
|
return nb_cli_apply_changes(vty, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFPY_YANG (ipv6_nd_managed_config_flag,
|
DEFPY_YANG (ipv6_nd_managed_config_flag,
|
||||||
@ -2662,7 +2650,6 @@ void rtadv_cmd_init(void)
|
|||||||
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_config_flag_cmd);
|
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_config_flag_cmd);
|
||||||
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_preference_cmd);
|
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_preference_cmd);
|
||||||
install_element(INTERFACE_NODE, &ipv6_nd_homeagent_lifetime_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, &ipv6_nd_adv_interval_config_option_cmd);
|
||||||
install_element(INTERFACE_NODE, &ipv6_nd_prefix_cmd);
|
install_element(INTERFACE_NODE, &ipv6_nd_prefix_cmd);
|
||||||
install_element(INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
|
install_element(INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
|
||||||
|
@ -627,6 +627,13 @@ const struct frr_yang_module_info frr_zebra_info = {
|
|||||||
.destroy = lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_destroy,
|
.destroy = lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_destroy,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/home-agent-lifetime",
|
||||||
|
.cbs = {
|
||||||
|
.modify = lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_modify,
|
||||||
|
.destroy = lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_destroy,
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/state/up-count",
|
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/state/up-count",
|
||||||
.cbs = {
|
.cbs = {
|
||||||
|
@ -213,6 +213,10 @@ int lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_modify(
|
|||||||
struct nb_cb_modify_args *args);
|
struct nb_cb_modify_args *args);
|
||||||
int lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_destroy(
|
int lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_destroy(
|
||||||
struct nb_cb_destroy_args *args);
|
struct nb_cb_destroy_args *args);
|
||||||
|
int lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_modify(
|
||||||
|
struct nb_cb_modify_args *args);
|
||||||
|
int lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_destroy(
|
||||||
|
struct nb_cb_destroy_args *args);
|
||||||
struct yang_data *
|
struct yang_data *
|
||||||
lib_interface_zebra_state_up_count_get_elem(struct nb_cb_get_elem_args *args);
|
lib_interface_zebra_state_up_count_get_elem(struct nb_cb_get_elem_args *args);
|
||||||
struct yang_data *
|
struct yang_data *
|
||||||
|
@ -2806,6 +2806,46 @@ int lib_interface_zebra_ipv6_router_advertisements_home_agent_preference_destroy
|
|||||||
return NB_OK;
|
return NB_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/home-agent-lifetime
|
||||||
|
*/
|
||||||
|
int lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_modify(
|
||||||
|
struct nb_cb_modify_args *args)
|
||||||
|
{
|
||||||
|
struct interface *ifp;
|
||||||
|
struct zebra_if *zif;
|
||||||
|
uint16_t lifetime;
|
||||||
|
|
||||||
|
if (args->event != NB_EV_APPLY)
|
||||||
|
return NB_OK;
|
||||||
|
|
||||||
|
ifp = nb_running_get_entry(args->dnode, NULL, true);
|
||||||
|
zif = ifp->info;
|
||||||
|
|
||||||
|
lifetime = yang_dnode_get_uint16(args->dnode, NULL);
|
||||||
|
|
||||||
|
zif->rtadv.HomeAgentLifetime = lifetime;
|
||||||
|
|
||||||
|
return NB_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lib_interface_zebra_ipv6_router_advertisements_home_agent_lifetime_destroy(
|
||||||
|
struct nb_cb_destroy_args *args)
|
||||||
|
{
|
||||||
|
struct interface *ifp;
|
||||||
|
struct zebra_if *zif;
|
||||||
|
|
||||||
|
if (args->event != NB_EV_APPLY)
|
||||||
|
return NB_OK;
|
||||||
|
|
||||||
|
ifp = nb_running_get_entry(args->dnode, NULL, true);
|
||||||
|
zif = ifp->info;
|
||||||
|
|
||||||
|
zif->rtadv.HomeAgentLifetime = -1;
|
||||||
|
|
||||||
|
return NB_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
|
* XPath: /frr-vrf:lib/vrf/frr-zebra:zebra/l3vni-id
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user