return CMD_SUCCESS;
}
-DEFUN (ipv6_nd_mtu,
+DEFPY_YANG (ipv6_nd_mtu,
ipv6_nd_mtu_cmd,
- "ipv6 nd mtu (1-65535)",
- "Interface IPv6 config commands\n"
- "Neighbor discovery\n"
- "Advertised MTU\n"
- "MTU in bytes\n")
-{
- int idx_number = 3;
- VTY_DECLVAR_CONTEXT(interface, ifp);
- struct zebra_if *zif = ifp->info;
- zif->rtadv.AdvLinkMTU = strtoul(argv[idx_number]->arg, NULL, 10);
- return CMD_SUCCESS;
-}
-
-DEFUN (no_ipv6_nd_mtu,
- no_ipv6_nd_mtu_cmd,
- "no ipv6 nd mtu [(1-65535)]",
+ "[no] ipv6 nd mtu ![(1-65535)]",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Advertised MTU\n"
"MTU in bytes\n")
{
- VTY_DECLVAR_CONTEXT(interface, ifp);
- struct zebra_if *zif = ifp->info;
- zif->rtadv.AdvLinkMTU = 0;
- return CMD_SUCCESS;
+ if (!no)
+ nb_cli_enqueue_change(vty,
+ "./frr-zebra:zebra/ipv6-router-advertisements/link-mtu",
+ NB_OP_MODIFY, mtu_str);
+ else
+ nb_cli_enqueue_change(vty,
+ "./frr-zebra:zebra/ipv6-router-advertisements/link-mtu",
+ NB_OP_DESTROY, NULL);
+ return nb_cli_apply_changes(vty, NULL);
}
static struct rtadv_rdnss *rtadv_rdnss_new(void)
install_element(INTERFACE_NODE, &ipv6_nd_router_preference_cmd);
install_element(INTERFACE_NODE, &no_ipv6_nd_router_preference_cmd);
install_element(INTERFACE_NODE, &ipv6_nd_mtu_cmd);
- install_element(INTERFACE_NODE, &no_ipv6_nd_mtu_cmd);
install_element(INTERFACE_NODE, &ipv6_nd_rdnss_cmd);
install_element(INTERFACE_NODE, &no_ipv6_nd_rdnss_cmd);
install_element(INTERFACE_NODE, &ipv6_nd_dnssl_cmd);
.modify = lib_interface_zebra_ipv6_router_advertisements_other_config_flag_modify,
}
},
+ {
+ .xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/link-mtu",
+ .cbs = {
+ .modify = lib_interface_zebra_ipv6_router_advertisements_link_mtu_modify,
+ }
+ },
{
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/reachable-time",
.cbs = {
struct nb_cb_modify_args *args);
int lib_interface_zebra_ipv6_router_advertisements_other_config_flag_modify(
struct nb_cb_modify_args *args);
+int lib_interface_zebra_ipv6_router_advertisements_link_mtu_modify(
+ struct nb_cb_modify_args *args);
int lib_interface_zebra_ipv6_router_advertisements_reachable_time_modify(
struct nb_cb_modify_args *args);
int lib_interface_zebra_ipv6_router_advertisements_default_lifetime_modify(
return NB_OK;
}
+/*
+ * XPath: /frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/link-mtu
+ */
+int lib_interface_zebra_ipv6_router_advertisements_link_mtu_modify(
+ struct nb_cb_modify_args *args)
+{
+ struct interface *ifp;
+ struct zebra_if *zif;
+ uint32_t mtu;
+
+ if (args->event != NB_EV_APPLY)
+ return NB_OK;
+
+ ifp = nb_running_get_entry(args->dnode, NULL, true);
+ zif = ifp->info;
+
+ mtu = yang_dnode_get_uint32(args->dnode, NULL);
+
+ zif->rtadv.AdvLinkMTU = mtu;
+
+ return NB_OK;
+}
+
/*
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/reachable-time
*/