]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ripngd: convert ripngd to mgmtd
authorChristian Hopps <chopps@labn.net>
Fri, 26 Jan 2024 22:40:55 +0000 (17:40 -0500)
committerChristian Hopps <chopps@labn.net>
Fri, 26 Jan 2024 22:40:55 +0000 (17:40 -0500)
- a couple small fixes for ripd conversion as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
20 files changed:
lib/vty.c
mgmtd/mgmt_be_adapter.c
mgmtd/mgmt_be_adapter.h
mgmtd/mgmt_main.c
mgmtd/mgmt_vty.c
mgmtd/subdir.am
python/xref2vtysh.py
ripd/rip_nb.h
ripd/ripd.h
ripngd/ripng_cli.c
ripngd/ripng_interface.c
ripngd/ripng_main.c
ripngd/ripng_nb.c
ripngd/ripng_nb.h
ripngd/ripng_routemap.c
ripngd/ripngd.c
ripngd/ripngd.h
ripngd/subdir.am
vtysh/vtysh.c
vtysh/vtysh.h

index f2076552c7cb2da0be752b2074a9746fe01275e5..a8d90d901be5ff9e770805bda031a840211e4662 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -127,6 +127,9 @@ char const *const mgmt_daemons[] = {
 #ifdef HAVE_RIPD
        "ripd",
 #endif
+#ifdef HAVE_RIPNGD
+       "ripngd",
+#endif
 #ifdef HAVE_STATICD
        "staticd",
 #endif
index a7f3d4390e96687609f70a37deee1cb9bdacbfe8..f92d6d8d58bd66c937f69d19a2321570fbd0e49a 100644 (file)
 
 const char *mgmt_be_client_names[MGMTD_BE_CLIENT_ID_MAX + 1] = {
        [MGMTD_BE_CLIENT_ID_ZEBRA] = "zebra",
-#ifdef HAVE_STATICD
+#ifdef HAVE_RIPD
        [MGMTD_BE_CLIENT_ID_RIPD] = "ripd",
 #endif
+#ifdef HAVE_RIPNGD
+       [MGMTD_BE_CLIENT_ID_RIPNGD] = "ripngd",
+#endif
 #ifdef HAVE_STATICD
        [MGMTD_BE_CLIENT_ID_STATICD] = "staticd",
 #endif
@@ -77,6 +80,21 @@ static const char *const ripd_oper_xpaths[] = {
 };
 #endif
 
+#if HAVE_RIPNGD
+static const char *const ripngd_config_xpaths[] = {
+       "/frr-filter:lib",
+       "/frr-interface:lib/interface",
+       "/frr-ripngd:ripngd",
+       "/frr-route-map:lib",
+       "/frr-vrf:lib",
+       NULL,
+};
+static const char *const ripngd_oper_xpaths[] = {
+       "/frr-ripd:ripd",
+       NULL,
+};
+#endif
+
 #if HAVE_STATICD
 static const char *const staticd_config_xpaths[] = {
        "/frr-vrf:lib",
@@ -90,6 +108,9 @@ static const char *const *be_client_config_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
 #ifdef HAVE_RIPD
        [MGMTD_BE_CLIENT_ID_RIPD] = ripd_config_xpaths,
 #endif
+#ifdef HAVE_RIPNGD
+       [MGMTD_BE_CLIENT_ID_RIPNGD] = ripngd_config_xpaths,
+#endif
 #ifdef HAVE_STATICD
        [MGMTD_BE_CLIENT_ID_STATICD] = staticd_config_xpaths,
 #endif
@@ -105,6 +126,9 @@ static const char *const zebra_oper_xpaths[] = {
 static const char *const *be_client_oper_xpaths[MGMTD_BE_CLIENT_ID_MAX] = {
 #ifdef HAVE_RIPD
        [MGMTD_BE_CLIENT_ID_RIPD] = ripd_oper_xpaths,
+#endif
+#ifdef HAVE_RIPNGD
+       [MGMTD_BE_CLIENT_ID_RIPNGD] = ripngd_oper_xpaths,
 #endif
        [MGMTD_BE_CLIENT_ID_ZEBRA] = zebra_oper_xpaths,
 };
index 35c8ec4c7addd2b0d3de3f37c08f5f1f218adaf2..955291b7c89b02777ed7a02beb59ccac57790d0e 100644 (file)
@@ -17,7 +17,7 @@
 
 #define MGMTD_BE_CONN_INIT_DELAY_MSEC 50
 
-#define MGMTD_FIND_ADAPTER_BY_INDEX(adapter_index)                             \
+#define MGMTD_FIND_ADAPTER_BY_INDEX(adapter_index)     \
        mgmt_adaptr_ref[adapter_index]
 
 /**
@@ -30,6 +30,9 @@ enum mgmt_be_client_id {
 #ifdef HAVE_RIPD
        MGMTD_BE_CLIENT_ID_RIPD,
 #endif
+#ifdef HAVE_RIPNGD
+       MGMTD_BE_CLIENT_ID_RIPNGD,
+#endif
 #ifdef HAVE_STATICD
        MGMTD_BE_CLIENT_ID_STATICD,
 #endif
index 6532e9b1bf7278ba1f24f0335b787d495a61a801..1bb129944420e25d31fb26f485b5824c38d8fa78 100644 (file)
@@ -15,6 +15,7 @@
 #include "mgmtd/mgmt.h"
 #include "mgmtd/mgmt_ds.h"
 #include "ripd/rip_nb.h"
+#include "ripngd/ripng_nb.h"
 #include "routing_nb.h"
 
 
@@ -188,6 +189,9 @@ static const struct frr_yang_module_info *const mgmt_yang_modules[] = {
 #ifdef HAVE_RIPD
        &frr_ripd_cli_info,
 #endif
+#ifdef HAVE_RIPNGD
+       &frr_ripngd_cli_info,
+#endif
 #ifdef HAVE_STATICD
        &frr_staticd_cli_info,
 #endif
index c88fd2f25b2444e0cd24719e7623177f0c17e9c3..194af13f1eb21bb00f54d398170afd29d2029849 100644 (file)
@@ -9,6 +9,7 @@
 #include <zebra.h>
 
 #include "command.h"
+#include "filter.h"
 #include "json.h"
 #include "network.h"
 #include "northbound_cli.h"
@@ -21,7 +22,8 @@
 #include "mgmtd/mgmt_history.h"
 
 #include "mgmtd/mgmt_vty_clippy.c"
-#include "ripd/ripd.h"
+#include "ripd/rip_nb.h"
+#include "ripngd/ripng_nb.h"
 #include "staticd/static_vty.h"
 
 extern struct frr_daemon_info *mgmt_daemon_info;
@@ -578,6 +580,9 @@ void mgmt_vty_init(void)
 #if HAVE_RIPD
        rip_cli_init();
 #endif
+#if HAVE_RIPNGD
+       ripng_cli_init();
+#endif
 #if HAVE_STATICD
        static_vty_init();
 #endif
index 244710d733f6223382dd4216d87879ae141f8913..3d1dafabd4eed4c55ca1c11758cc1ba1d4cef5f9 100644 (file)
@@ -74,6 +74,15 @@ mgmtd_libmgmt_be_nb_la_SOURCES += \
        # end
 endif
 
+if RIPNGD
+nodist_mgmtd_mgmtd_SOURCES += \
+       yang/frr-ripngd.yang.c \
+       # end
+mgmtd_libmgmt_be_nb_la_SOURCES += \
+       ripngd/ripng_cli.c \
+       # end
+endif
+
 if STATICD
 nodist_mgmtd_mgmtd_SOURCES += \
        yang/frr-staticd.yang.c \
index c52ae5b9a6fd9653d1b3d72691e5b75e046ad04d..1760588ca84e290203b613b214645ed0c0a5d64d 100644 (file)
@@ -206,10 +206,7 @@ class CommandEntry:
                 }
 
         if defun_file == "lib/if_rmap.c":
-            if v6_cmd:
-                return {"VTYSH_RIPNGD"}
-            else:
-                return {"VTYSH_MGMTD"}
+            return {"VTYSH_MGMTD"}
 
         return {}
 
index 7521e0fba92c09081bf069221981b3562d599335..d07273af8029be5d34d03cb613a38e64069966c4 100644 (file)
@@ -240,4 +240,6 @@ void cli_show_ip_rip_bfd_profile(struct vty *vty, const struct lyd_node *dnode,
 extern void ripd_notif_send_auth_type_failure(const char *ifname);
 extern void ripd_notif_send_auth_failure(const char *ifname);
 
+extern void rip_cli_init(void);
+
 #endif /* _FRR_RIP_NB_H_ */
index ac4a51f586fda4e05b1a4ad43a651cdf70c8247b..b7e79332fed4ff9dece2ef5564634d70c47ffb60 100644 (file)
@@ -526,7 +526,6 @@ extern int offset_list_cmp(struct rip_offset_list *o1,
 
 extern void rip_vrf_init(void);
 extern void rip_vrf_terminate(void);
-extern void rip_cli_init(void);
 
 extern struct zebra_privs_t ripd_privs;
 extern struct rip_instance_head rip_instances;
index ee561087c9eef250bdbf0bfe96323eaffcad7fcb..a4a0f5a2cb38b27cdec00c7695fb8a9932e320cd 100644 (file)
@@ -8,6 +8,7 @@
 #include <zebra.h>
 
 #include "if.h"
+#include "if_rmap.h"
 #include "vrf.h"
 #include "log.h"
 #include "prefix.h"
@@ -648,8 +649,20 @@ DEFPY_YANG(no_ripng_ipv6_distribute_list_prefix,
        return nb_cli_apply_changes(vty, NULL);
 }
 
+/* RIPng node structure. */
+static struct cmd_node cmd_ripng_node = {
+       .name = "ripng",
+       .node = RIPNG_NODE,
+       .parent_node = CONFIG_NODE,
+       .prompt = "%s(config-router)# ",
+};
+
 void ripng_cli_init(void)
 {
+       /* Install RIPNG_NODE. */
+       install_node(&cmd_ripng_node);
+       install_default(RIPNG_NODE);
+
        install_element(CONFIG_NODE, &router_ripng_cmd);
        install_element(CONFIG_NODE, &no_router_ripng_cmd);
 
@@ -676,4 +689,91 @@ void ripng_cli_init(void)
        install_element(INTERFACE_NODE, &ipv6_ripng_split_horizon_cmd);
 
        install_element(ENABLE_NODE, &clear_ipv6_rip_cmd);
-}
+
+       if_rmap_init(RIPNG_NODE);
+}
+
+/* clang-format off */
+const struct frr_yang_module_info frr_ripngd_cli_info = {
+       .name = "frr-ripngd",
+       .ignore_cfg_cbs = true,
+       .nodes = {
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance",
+                       .cbs.cli_show = cli_show_router_ripng,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/allow-ecmp",
+                       .cbs.cli_show = cli_show_ripng_allow_ecmp,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/default-information-originate",
+                       .cbs.cli_show = cli_show_ripng_default_information_originate,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/default-metric",
+                       .cbs.cli_show = cli_show_ripng_default_metric,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/network",
+                       .cbs.cli_show = cli_show_ripng_network_prefix,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/interface",
+                       .cbs.cli_show = cli_show_ripng_network_interface,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/offset-list",
+                       .cbs.cli_show = cli_show_ripng_offset_list,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/passive-interface",
+                       .cbs.cli_show = cli_show_ripng_passive_interface,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/distribute-list/in/access-list",
+                       .cbs.cli_show = group_distribute_list_ipv6_cli_show,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/distribute-list/out/access-list",
+                       .cbs.cli_show = group_distribute_list_ipv6_cli_show,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/distribute-list/in/prefix-list",
+                       .cbs.cli_show = group_distribute_list_ipv6_cli_show,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/distribute-list/out/prefix-list",
+                       .cbs.cli_show = group_distribute_list_ipv6_cli_show,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/redistribute",
+                       .cbs.cli_show = cli_show_ripng_redistribute,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/if-route-maps/if-route-map",
+                       .cbs.cli_show = cli_show_if_route_map,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/static-route",
+                       .cbs.cli_show = cli_show_ripng_route,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/aggregate-address",
+                       .cbs.cli_show = cli_show_ripng_aggregate_address,
+               },
+               {
+                       .xpath = "/frr-ripngd:ripngd/instance/timers",
+                       .cbs.cli_show = cli_show_ripng_timers,
+               },
+               {
+                       .xpath = "/frr-interface:lib/interface/frr-ripngd:ripng/split-horizon",
+                       .cbs = {
+                               .cli_show = cli_show_ipv6_ripng_split_horizon,
+                       },
+               },
+               {
+                       .xpath = NULL,
+               },
+       }
+};
index 35d92632a00cc183367ace45e9818e915f7c305f..9ef9f89005ec611c05cd884d67dbcff8519d3218 100644 (file)
@@ -873,7 +873,6 @@ void ripng_if_init(void)
        hook_register_prio(if_del, 0, ripng_if_delete_hook);
 
        /* Install interface node. */
-       if_cmd_init_default();
        hook_register_prio(if_real, 0, ripng_ifp_create);
        hook_register_prio(if_up, 0, ripng_ifp_up);
        hook_register_prio(if_down, 0, ripng_ifp_down);
index a799943be1703d27adeb0673cc87baf3d1e41590..80b78a150a5a28ac62e10632d423f1c8610499ff 100644 (file)
@@ -22,6 +22,7 @@
 #include "if_rmap.h"
 #include "libfrr.h"
 #include "routemap.h"
+#include "mgmt_be_client.h"
 
 #include "ripngd/ripngd.h"
 #include "ripngd/ripng_nb.h"
@@ -52,6 +53,8 @@ struct zebra_privs_t ripngd_privs = {
 /* Master of threads. */
 struct event_loop *master;
 
+struct mgmt_be_client *mgmt_be_client;
+
 static struct frr_daemon_info ripngd_di;
 
 /* SIGHUP handler. */
@@ -70,6 +73,10 @@ static void sigint(void)
 
        zlog_notice("Terminating on signal");
 
+       nb_oper_cancel_all_walks();
+       mgmt_be_client_destroy(mgmt_be_client);
+       mgmt_be_client = NULL;
+
        RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
                if (!vrf->info)
                        continue;
@@ -131,6 +138,9 @@ FRR_DAEMON_INFO(ripngd, RIPNG, .vty_port = RIPNG_VTY_PORT,
 
                .yang_modules = ripngd_yang_modules,
                .n_yang_modules = array_size(ripngd_yang_modules),
+
+               /* mgmtd will load the per-daemon config file now */
+               .flags = FRR_NO_SPLIT_CONFIG,
 );
 
 #define DEPRECATED_OPTIONS ""
@@ -172,7 +182,9 @@ int main(int argc, char **argv)
 
        /* RIPngd inits. */
        ripng_init();
-       ripng_cli_init();
+
+       mgmt_be_client = mgmt_be_client_create("ripngd", NULL, 0, master);
+
        zebra_init(master);
 
        frr_config_fork();
index 583a4d08d077576f8c1f793fa28b131eccf9e5a1..8e20541733807ffbd6ae1fab2429e863e24bdcb0 100644 (file)
@@ -20,7 +20,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance",
                        .cbs = {
-                               .cli_show = cli_show_router_ripng,
                                .create = ripngd_instance_create,
                                .destroy = ripngd_instance_destroy,
                                .get_keys = ripngd_instance_get_keys,
@@ -31,28 +30,24 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/allow-ecmp",
                        .cbs = {
-                               .cli_show = cli_show_ripng_allow_ecmp,
                                .modify = ripngd_instance_allow_ecmp_modify,
                        },
                },
                {
                        .xpath = "/frr-ripngd:ripngd/instance/default-information-originate",
                        .cbs = {
-                               .cli_show = cli_show_ripng_default_information_originate,
                                .modify = ripngd_instance_default_information_originate_modify,
                        },
                },
                {
                        .xpath = "/frr-ripngd:ripngd/instance/default-metric",
                        .cbs = {
-                               .cli_show = cli_show_ripng_default_metric,
                                .modify = ripngd_instance_default_metric_modify,
                        },
                },
                {
                        .xpath = "/frr-ripngd:ripngd/instance/network",
                        .cbs = {
-                               .cli_show = cli_show_ripng_network_prefix,
                                .create = ripngd_instance_network_create,
                                .destroy = ripngd_instance_network_destroy,
                        },
@@ -60,7 +55,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/interface",
                        .cbs = {
-                               .cli_show = cli_show_ripng_network_interface,
                                .create = ripngd_instance_interface_create,
                                .destroy = ripngd_instance_interface_destroy,
                        },
@@ -68,7 +62,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/offset-list",
                        .cbs = {
-                               .cli_show = cli_show_ripng_offset_list,
                                .create = ripngd_instance_offset_list_create,
                                .destroy = ripngd_instance_offset_list_destroy,
                        },
@@ -88,7 +81,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/passive-interface",
                        .cbs = {
-                               .cli_show = cli_show_ripng_passive_interface,
                                .create = ripngd_instance_passive_interface_create,
                                .destroy = ripngd_instance_passive_interface_destroy,
                        },
@@ -105,7 +97,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .cbs = {
                                .modify = group_distribute_list_ipv6_modify,
                                .destroy = group_distribute_list_ipv6_destroy,
-                               .cli_show = group_distribute_list_ipv6_cli_show,
                        }
                },
                {
@@ -113,7 +104,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .cbs = {
                                .modify = group_distribute_list_ipv6_modify,
                                .destroy = group_distribute_list_ipv6_destroy,
-                               .cli_show = group_distribute_list_ipv6_cli_show,
                        }
                },
                {
@@ -121,7 +111,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .cbs = {
                                .modify = group_distribute_list_ipv6_modify,
                                .destroy = group_distribute_list_ipv6_destroy,
-                               .cli_show = group_distribute_list_ipv6_cli_show,
                        }
                },
                {
@@ -129,14 +118,12 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .cbs = {
                                .modify = group_distribute_list_ipv6_modify,
                                .destroy = group_distribute_list_ipv6_destroy,
-                               .cli_show = group_distribute_list_ipv6_cli_show,
                        }
                },
                {
                        .xpath = "/frr-ripngd:ripngd/instance/redistribute",
                        .cbs = {
                                .apply_finish = ripngd_instance_redistribute_apply_finish,
-                               .cli_show = cli_show_ripng_redistribute,
                                .create = ripngd_instance_redistribute_create,
                                .destroy = ripngd_instance_redistribute_destroy,
                        },
@@ -160,7 +147,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .cbs = {
                                .create = ripngd_instance_if_route_maps_if_route_map_create,
                                .destroy = ripngd_instance_if_route_maps_if_route_map_destroy,
-                               .cli_show = cli_show_if_route_map,
                        }
                },
                {
@@ -180,7 +166,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/static-route",
                        .cbs = {
-                               .cli_show = cli_show_ripng_route,
                                .create = ripngd_instance_static_route_create,
                                .destroy = ripngd_instance_static_route_destroy,
                        },
@@ -188,7 +173,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-ripngd:ripngd/instance/aggregate-address",
                        .cbs = {
-                               .cli_show = cli_show_ripng_aggregate_address,
                                .create = ripngd_instance_aggregate_address_create,
                                .destroy = ripngd_instance_aggregate_address_destroy,
                        },
@@ -197,7 +181,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                        .xpath = "/frr-ripngd:ripngd/instance/timers",
                        .cbs = {
                                .apply_finish = ripngd_instance_timers_apply_finish,
-                               .cli_show = cli_show_ripng_timers,
                        },
                },
                {
@@ -291,7 +274,6 @@ const struct frr_yang_module_info frr_ripngd_info = {
                {
                        .xpath = "/frr-interface:lib/interface/frr-ripngd:ripng/split-horizon",
                        .cbs = {
-                               .cli_show = cli_show_ipv6_ripng_split_horizon,
                                .modify = lib_interface_ripng_split_horizon_modify,
                        },
                },
index 12d3cd51297cdf52dfe8dd9463331fbf1c3bfeb4..a6ac1fba076b60ce98489988dfdd8e0ddc2d6ff6 100644 (file)
@@ -10,6 +10,7 @@
 #include "northbound.h"
 
 extern const struct frr_yang_module_info frr_ripngd_info;
+extern const struct frr_yang_module_info frr_ripngd_cli_info;
 
 /* Mandatory callbacks. */
 int ripngd_instance_create(struct nb_cb_create_args *args);
@@ -138,4 +139,6 @@ void cli_show_ipv6_ripng_split_horizon(struct vty *vty,
                                       const struct lyd_node *dnode,
                                       bool show_defaults);
 
+extern void ripng_cli_init(void);
+
 #endif /* _FRR_RIPNG_NB_H_ */
index b5f74be3f6132151dc103c38ac595e3f0ebdf1c5..3370546d5ca68800a410cd8a2a9dcdc1ce57084f 100644 (file)
@@ -386,7 +386,7 @@ static const struct route_map_rule_cmd route_set_tag_cmd = {
 
 void ripng_route_map_init(void)
 {
-       route_map_init();
+       route_map_init_new(true);
 
        route_map_match_interface_hook(generic_match_add);
        route_map_no_match_interface_hook(generic_match_delete);
index 4c3405d7dd7e62ef0cfacded9ac8523714ec8815..f4dadf377df2a9e7e911ab8f3568ea7225d9fd01 100644 (file)
@@ -23,6 +23,7 @@
 #include "lib_errors.h"
 #include "northbound_cli.h"
 #include "network.h"
+#include "mgmt_be_client.h"
 
 #include "ripngd/ripngd.h"
 #include "ripngd/ripng_route.h"
@@ -2267,43 +2268,6 @@ void ripng_ecmp_disable(struct ripng *ripng)
                }
 }
 
-/* RIPng configuration write function. */
-static int ripng_config_write(struct vty *vty)
-{
-       struct ripng *ripng;
-       int write = 0;
-
-       RB_FOREACH(ripng, ripng_instance_head, &ripng_instances) {
-               char xpath[XPATH_MAXLEN];
-               struct lyd_node *dnode;
-
-               snprintf(xpath, sizeof(xpath),
-                        "/frr-ripngd:ripngd/instance[vrf='%s']",
-                        ripng->vrf_name);
-
-               dnode = yang_dnode_get(running_config->dnode, xpath);
-               assert(dnode);
-
-               nb_cli_show_dnode_cmds(vty, dnode, false);
-
-               vty_out(vty, "exit\n");
-
-               write = 1;
-       }
-
-       return write;
-}
-
-static int ripng_config_write(struct vty *vty);
-/* RIPng node structure. */
-static struct cmd_node cmd_ripng_node = {
-       .name = "ripng",
-       .node = RIPNG_NODE,
-       .parent_node = CONFIG_NODE,
-       .prompt = "%s(config-router)# ",
-       .config_write = ripng_config_write,
-};
-
 static void ripng_distribute_update(struct distribute_ctx *ctx,
                                    struct distribute *dist)
 {
@@ -2671,8 +2635,6 @@ void ripng_vrf_init(void)
 {
        vrf_init(ripng_vrf_new, ripng_vrf_enable, ripng_vrf_disable,
                 ripng_vrf_delete);
-
-       vrf_cmd_init(NULL);
 }
 
 void ripng_vrf_terminate(void)
@@ -2683,20 +2645,18 @@ void ripng_vrf_terminate(void)
 /* Initialize ripng structure and set commands. */
 void ripng_init(void)
 {
-       /* Install RIPNG_NODE. */
-       install_node(&cmd_ripng_node);
-
        /* Install ripng commands. */
        install_element(VIEW_NODE, &show_ipv6_ripng_cmd);
        install_element(VIEW_NODE, &show_ipv6_ripng_status_cmd);
 
-       install_default(RIPNG_NODE);
-
        ripng_if_init();
        ripng_debug_init();
 
+       /* Enable mgmt be debug */
+       mgmt_be_client_lib_vty_init();
+
        /* Access list install. */
-       access_list_init();
+       access_list_init_new(true);
        access_list_add_hook(ripng_distribute_update_all_wrapper);
        access_list_delete_hook(ripng_distribute_update_all_wrapper);
 
@@ -2710,6 +2670,4 @@ void ripng_init(void)
 
        route_map_add_hook(ripng_routemap_update);
        route_map_delete_hook(ripng_routemap_update);
-
-       if_rmap_init(RIPNG_NODE);
 }
index 3a2bc0c9d37d617d8f83a356c90787df0c97f17c..b4f7b4e52da7341e18b338a4a82db4527e616686 100644 (file)
@@ -432,7 +432,6 @@ extern void ripng_ecmp_change(struct ripng *ripng);
 
 extern void ripng_vrf_init(void);
 extern void ripng_vrf_terminate(void);
-extern void ripng_cli_init(void);
 
 extern uint32_t zebra_ecmp_count;
 
index 162426c58ca88debd0088f02b26d1f11204f74ff..83e376b55530ca7b5968dedd2427264919f64f30 100644 (file)
@@ -9,7 +9,6 @@ man8 += $(MANBUILD)/frr-ripngd.8
 endif
 
 ripngd_ripngd_SOURCES = \
-       ripngd/ripng_cli.c \
        ripngd/ripng_debug.c \
        ripngd/ripng_interface.c \
        ripngd/ripng_nexthop.c \
index 6d2600cd96829b5901d058d9ef093e2e96979a75..b1a53965cd66185e2f0f4b28cd7545720a614764 100644 (file)
@@ -2015,7 +2015,7 @@ DEFUNSH(VTYSH_MGMTD, router_rip, router_rip_cmd, "router rip [vrf NAME]",
 #endif /* HAVE_RIPD */
 
 #ifdef HAVE_RIPNGD
-DEFUNSH(VTYSH_RIPNGD, router_ripng, router_ripng_cmd, "router ripng [vrf NAME]",
+DEFUNSH(VTYSH_MGMTD, router_ripng, router_ripng_cmd, "router ripng [vrf NAME]",
        ROUTER_STR "RIPng\n" VRF_CMD_HELP_STR)
 {
        vty->node = RIPNG_NODE;
@@ -2559,13 +2559,13 @@ DEFUNSH(VTYSH_MGMTD, vtysh_quit_ripd, vtysh_quit_ripd_cmd, "quit",
 #endif /* HAVE_RIPD */
 
 #ifdef HAVE_RIPNGD
-DEFUNSH(VTYSH_RIPNGD, vtysh_exit_ripngd, vtysh_exit_ripngd_cmd, "exit",
+DEFUNSH(VTYSH_MGMTD, vtysh_exit_ripngd, vtysh_exit_ripngd_cmd, "exit",
        "Exit current mode and down to previous mode\n")
 {
        return vtysh_exit(vty);
 }
 
-DEFUNSH(VTYSH_RIPNGD, vtysh_quit_ripngd, vtysh_quit_ripngd_cmd, "quit",
+DEFUNSH(VTYSH_MGMTD, vtysh_quit_ripngd, vtysh_quit_ripngd_cmd, "quit",
        "Exit current mode and down to previous mode\n")
 {
        return vtysh_exit_ripngd(self, vty, argc, argv);
index 7671609e3a482908ad6ee0aea169df34d2bd81da..b1e914ebf7597fdb7134efb7733c0542c6e586fe 100644 (file)
@@ -53,7 +53,7 @@ extern struct event_loop *master;
        VTYSH_BFDD | VTYSH_BABELD | VTYSH_BGPD | VTYSH_EIGRPD | VTYSH_ISISD |  \
                VTYSH_FABRICD | VTYSH_LDPD | VTYSH_NHRPD | VTYSH_OSPF6D |      \
                VTYSH_OSPFD | VTYSH_PBRD | VTYSH_PIMD | VTYSH_PIM6D |          \
-               VTYSH_RIPNGD | VTYSH_VRRPD | VTYSH_ZEBRA | VTYSH_MGMTD
+               VTYSH_VRRPD | VTYSH_ZEBRA | VTYSH_MGMTD
 #define VTYSH_ACL_SHOW                                                         \
        VTYSH_BFDD | VTYSH_BABELD | VTYSH_BGPD | VTYSH_EIGRPD | VTYSH_ISISD |  \
                VTYSH_FABRICD | VTYSH_LDPD | VTYSH_NHRPD | VTYSH_OSPF6D |      \
@@ -62,15 +62,14 @@ extern struct event_loop *master;
 
 #define VTYSH_AFFMAP VTYSH_ZEBRA | VTYSH_ISISD
 #define VTYSH_RMAP_CONFIG                                                      \
-       VTYSH_ZEBRA | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D | VTYSH_BGPD | \
-               VTYSH_ISISD | VTYSH_PIMD | VTYSH_EIGRPD | VTYSH_FABRICD |      \
-               VTYSH_MGMTD
+       VTYSH_ZEBRA | VTYSH_OSPFD | VTYSH_OSPF6D | VTYSH_BGPD | VTYSH_ISISD |  \
+               VTYSH_PIMD | VTYSH_EIGRPD | VTYSH_FABRICD | VTYSH_MGMTD
 #define VTYSH_RMAP_SHOW                                                        \
        VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D | \
                VTYSH_BGPD | VTYSH_ISISD | VTYSH_PIMD | VTYSH_EIGRPD |         \
                VTYSH_FABRICD
 #define VTYSH_INTERFACE_SUBSET                                                 \
-       VTYSH_ZEBRA | VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D | \
+       VTYSH_ZEBRA | VTYSH_OSPFD | VTYSH_OSPF6D | \
                VTYSH_ISISD | VTYSH_PIMD | VTYSH_PIM6D | VTYSH_NHRPD |         \
                VTYSH_EIGRPD | VTYSH_BABELD | VTYSH_PBRD | VTYSH_FABRICD |     \
                VTYSH_VRRPD | VTYSH_MGMTD
@@ -81,7 +80,8 @@ extern struct event_loop *master;
 #define VTYSH_NH_GROUP    VTYSH_PBRD|VTYSH_SHARPD
 #define VTYSH_SR          VTYSH_ZEBRA|VTYSH_PATHD
 #define VTYSH_DPDK VTYSH_ZEBRA
-#define VTYSH_MGMT_BACKEND  VTYSH_RIPD | VTYSH_STATICD | VTYSH_ZEBRA
+#define VTYSH_MGMT_BACKEND                                                     \
+       VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_STATICD | VTYSH_ZEBRA
 #define VTYSH_MGMT_FRONTEND VTYSH_MGMTD
 
 enum vtysh_write_integrated {