diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-23 17:18:41 +0200 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2024-01-28 23:28:39 +0200 |
| commit | 966fcb6c0fc714ba84c2fd63c536dd6d3aba2be6 (patch) | |
| tree | 96c797615c12d622c2b2ce038b7b620acfa1caab /zebra/rtadv.c | |
| parent | b829d5fca2cd94a3409f3354e98be676ace7e04f (diff) | |
zebra: convert interface ipv6 nd mtu command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'zebra/rtadv.c')
| -rw-r--r-- | zebra/rtadv.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index fed6db4ddf..6bc1d5aded 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -2090,34 +2090,24 @@ DEFUN (no_ipv6_nd_router_preference, 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) @@ -2798,7 +2788,6 @@ void rtadv_cmd_init(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); |
