]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: move CLI node names to cmd_node->name
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 8 Sep 2018 22:15:50 +0000 (00:15 +0200)
committerDavid Lamparter <equinox@diac24.net>
Thu, 16 Apr 2020 10:53:59 +0000 (12:53 +0200)
And again for the name.  Why on earth would we centralize this, just so
people can forget to update it?

Signed-off-by: David Lamparter <equinox@diac24.net>
55 files changed:
babeld/babel_interface.c
babeld/babeld.c
bfdd/bfdd_vty.c
bgpd/bgp_bmp.c
bgpd/bgp_debug.c
bgpd/bgp_dump.c
bgpd/bgp_filter.c
bgpd/bgp_rpki.c
bgpd/bgp_vty.c
bgpd/rfapi/bgp_rfapi_cfg.c
bgpd/rfapi/vnc_debug.c
eigrpd/eigrp_cli.c
eigrpd/eigrp_dump.c
isisd/isis_circuit.c
isisd/isisd.c
ldpd/ldp_debug.c
ldpd/ldp_vty_conf.c
lib/agentx.c
lib/command.c
lib/command.h
lib/filter.c
lib/grammar_sandbox.c
lib/keychain.c
lib/nexthop_group.c
lib/northbound_cli.c
lib/plist.c
lib/resolver.c
lib/routemap.c
lib/routemap_cli.c
lib/vrf.c
lib/vty.c
nhrpd/nhrp_vty.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_top.c
ospf6d/ospf6d.c
ospfd/ospf_dump.c
ospfd/ospf_vty.c
pbrd/pbr_vty.c
pimd/pim_cmd.c
ripd/rip_debug.c
ripd/rip_interface.c
ripd/ripd.c
ripngd/ripng_debug.c
ripngd/ripng_interface.c
ripngd/ripngd.c
staticd/static_vty.c
tests/lib/cli/test_commands.c
vrrpd/vrrp_vty.c
vtysh/vtysh.c
zebra/debug.c
zebra/interface.c
zebra/zebra_fpm.c
zebra/zebra_mpls_vty.c
zebra/zebra_pw.c
zebra/zebra_vty.c

index 072ad7060a9ccea24354f10306df11a542fb0257..21fb48163125ac70ee3903e0b20a500322b85bc3 100644 (file)
@@ -60,6 +60,7 @@ static void babel_interface_free (babel_interface_nfo *bi);
 static vector babel_enable_if;                 /* enable interfaces (by cmd). */
 static int interface_config_write(struct vty *vty);
 static struct cmd_node babel_interface_node = {
+    .name = "interface",
     .node = INTERFACE_NODE,
     .parent_node = CONFIG_NODE,
     .prompt = "%s(config-if)# ",
index 6a83fa102ec1a010f43089edbec878990a8267e5..906f48564d500c20bdbe38e82e4c188e4aafb74a 100644 (file)
@@ -72,6 +72,7 @@ static time_t source_expiry_time;
 static int babel_config_write (struct vty *vty);
 static struct cmd_node cmd_babel_node =
 {
+    .name = "babel",
     .node   = BABEL_NODE,
     .parent_node = CONFIG_NODE,
     .prompt = "%s(config-router)# ",
index 5a4ce22b220f709f027c7873422b539e43bfd655..71d0a49f6d885ff5b6b080d400f5006833d4f81d 100644 (file)
@@ -887,6 +887,7 @@ DEFUN_NOSH(show_debugging_bfd,
 
 static int bfdd_write_config(struct vty *vty);
 struct cmd_node bfd_node = {
+       .name = "bfd",
        .node = BFD_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-bfd)# ",
@@ -894,6 +895,7 @@ struct cmd_node bfd_node = {
 };
 
 struct cmd_node bfd_peer_node = {
+       .name = "bfd peer",
        .node = BFD_PEER_NODE,
        .parent_node = BFD_NODE,
        .prompt = "%s(config-bfd-peer)# ",
index 0a0271dd199a622bbfd188f3a90d82e0bd1d78d3..8902a8789aad39d9fd10c486a3519c2113395e70 100644 (file)
@@ -1773,6 +1773,7 @@ static void bmp_active_setup(struct bmp_active *ba)
 }
 
 static struct cmd_node bmp_node = {
+       .name = "bmp",
        .node = BMP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-bgp-bmp)# "
index a20015bbce33aad86f6939a9ef61ea0cf7f68077..f503c1b18e39f85177c5f70c6d2d72fc4efb7824 100644 (file)
@@ -2284,6 +2284,7 @@ static int bgp_config_write_debug(struct vty *vty)
 
 static int bgp_config_write_debug(struct vty *vty);
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = bgp_config_write_debug,
index 36efcd5380741717697807938e93253564ae011d..a79c5e0da05eb54b25a2d09d6ab0da8d649a6fab 100644 (file)
@@ -780,6 +780,7 @@ DEFUN (no_dump_bgp_all,
 static int config_write_bgp_dump(struct vty *vty);
 /* BGP node structure. */
 static struct cmd_node bgp_dump_node = {
+       .name = "dump",
        .node = DUMP_NODE,
        .prompt = "",
        .config_write = config_write_bgp_dump,
index 0f70e6e5ae63216cfe4c943c5931bdcf081c93b5..3e26263df1dcbdbb1f56372d46db2c0b03fe3505 100644 (file)
@@ -669,6 +669,7 @@ static int config_write_as_list(struct vty *vty)
 
 static int config_write_as_list(struct vty *vty);
 static struct cmd_node as_list_node = {
+       .name = "as list",
        .node = AS_LIST_NODE,
        .prompt = "",
        .config_write = config_write_as_list,
index 2d11718b5837c236af673025c88c59bac4e074ae..11ef8563c42753f4c17d313110d38fe8fd5b1d7a 100644 (file)
@@ -144,6 +144,7 @@ static int rpki_sync_socket_rtr;
 static int rpki_sync_socket_bgpd;
 
 static struct cmd_node rpki_node = {
+       .name = "rpki",
        .node = RPKI_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-rpki)# ",
index e44f5151874ee9c1c2d8c2665fd37c894636fd45..873edf66cf0a03882f2105351c47060620c4dd77 100644 (file)
@@ -15335,6 +15335,7 @@ int bgp_config_write(struct vty *vty)
 
 /* BGP node structure. */
 static struct cmd_node bgp_node = {
+       .name = "bgp",
        .node = BGP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
@@ -15342,72 +15343,84 @@ static struct cmd_node bgp_node = {
 };
 
 static struct cmd_node bgp_ipv4_unicast_node = {
+       .name = "bgp ipv4 unicast",
        .node = BGP_IPV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4_multicast_node = {
+       .name = "bgp ipv4 multicast",
        .node = BGP_IPV4M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4_labeled_unicast_node = {
+       .name = "bgp ipv4 labeled unicast",
        .node = BGP_IPV4L_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6_unicast_node = {
+       .name = "bgp ipv6",
        .node = BGP_IPV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6_multicast_node = {
+       .name = "bgp ipv6 multicast",
        .node = BGP_IPV6M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6_labeled_unicast_node = {
+       .name = "bgp ipv6 labeled unicast",
        .node = BGP_IPV6L_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_vpnv4_node = {
+       .name = "bgp vpnv4",
        .node = BGP_VPNV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_vpnv6_node = {
+       .name = "bgp vpnv6",
        .node = BGP_VPNV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af-vpnv6)# ",
 };
 
 static struct cmd_node bgp_evpn_node = {
+       .name = "bgp evpn",
        .node = BGP_EVPN_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-evpn)# ",
 };
 
 static struct cmd_node bgp_evpn_vni_node = {
+       .name = "bgp evpn vni",
        .node = BGP_EVPN_VNI_NODE,
        .parent_node = BGP_EVPN_NODE,
        .prompt = "%s(config-router-af-vni)# ",
 };
 
 static struct cmd_node bgp_flowspecv4_node = {
+       .name = "bgp ipv4 flowspec",
        .node = BGP_FLOWSPECV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_flowspecv6_node = {
+       .name = "bgp ipv6 flowspec",
        .node = BGP_FLOWSPECV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af-vpnv6)# ",
@@ -17893,6 +17906,7 @@ static int community_list_config_write(struct vty *vty)
 
 static int community_list_config_write(struct vty *vty);
 static struct cmd_node community_list_node = {
+       .name = "community list",
        .node = COMMUNITY_LIST_NODE,
        .prompt = "",
        .config_write = community_list_config_write,
index 929165aa66e5aa0e230ff0e8d7a1863a0456d099..dd21a839132f26899bfbe4082f7e8970e859b9e5 100644 (file)
@@ -2965,12 +2965,14 @@ DEFUN_NOSH (exit_vnc,
 }
 
 static struct cmd_node bgp_vnc_defaults_node = {
+       .name = "bgp vnc defaults",
        .node = BGP_VNC_DEFAULTS_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-defaults)# ",
 };
 
 static struct cmd_node bgp_vnc_nve_group_node = {
+       .name = "bgp vnc nve",
        .node = BGP_VNC_NVE_GROUP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-nve-group)# ",
@@ -3394,6 +3396,7 @@ DEFUN_NOSH (exit_vrf_policy,
 }
 
 static struct cmd_node bgp_vrf_policy_node = {
+       .name = "bgp vrf policy",
        .node = BGP_VRF_POLICY_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vrf-policy)# ",
@@ -3633,6 +3636,7 @@ DEFUN (vnc_l2_group_rt,
 
 
 static struct cmd_node bgp_vnc_l2_group_node = {
+       .name = "bgp vnc l2",
        .node = BGP_VNC_L2_GROUP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-l2-group)# ",
index 5839d96f4c9a2c741c1ef6f7be9cb5b497b155c4..5c627efbee1c4aa21ed3eeed65e15c24d74e4533 100644 (file)
@@ -175,6 +175,7 @@ static int bgp_vnc_config_write_debug(struct vty *vty)
 
 static int bgp_vnc_config_write_debug(struct vty *vty);
 static struct cmd_node debug_node = {
+       .name = "vnc debug",
        .node = DEBUG_VNC_NODE,
        .prompt = "",
        .config_write = bgp_vnc_config_write_debug,
index 502d29ebf92d3c5cc044816625bc3bb1e0bf9816..c76e067685194bcfa5f2e4a116c0d8efb28ee5f6 100644 (file)
@@ -840,6 +840,7 @@ void eigrp_cli_show_keychain(struct vty *vty, struct lyd_node *dnode,
  */
 static int eigrp_config_write(struct vty *vty);
 static struct cmd_node eigrp_node = {
+       .name = "eigrp",
        .node = EIGRP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
@@ -862,6 +863,7 @@ static int eigrp_config_write(struct vty *vty)
 
 static int eigrp_write_interface(struct vty *vty);
 static struct cmd_node eigrp_interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index 05a25a433fa8c3374369f80f50d734606256eff4..a3d6eb2e9e97ea2c90318b14282ed68ba7049fb1 100644 (file)
@@ -557,6 +557,7 @@ DEFUN (no_debug_eigrp_packets,
 /* Debug node. */
 static int config_write_debug(struct vty *vty);
 static struct cmd_node eigrp_debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
index 47e91ac1077a46ff018154e9972804c83f372c92..4add1e6bfd41bb31cc0286f7f70b08a6a87a88af 100644 (file)
@@ -1335,6 +1335,7 @@ ferr_r isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit,
 }
 
 struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index a776e2da0a61f98b9177112952954166c6dd13aa..2bb028f5ff5bff6e83059bf03c9a5d5dc975daa0 100644 (file)
@@ -786,6 +786,7 @@ DEFUN_NOSH (show_debugging,
 static int config_write_debug(struct vty *vty);
 /* Debug node. */
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
@@ -2128,6 +2129,13 @@ static int isis_config_write(struct vty *vty)
        return write;
 }
 
+struct cmd_node router_node = {
+       .name = "openfabric",
+       .node = OPENFABRIC_NODE,
+       .parent_node = CONFIG_NODE,
+       .prompt = "%s(config-router)# ",
+       .config_write = isis_config_write,
+};
 #else
 /* IS-IS configuration write function */
 static int isis_config_write(struct vty *vty)
@@ -2143,14 +2151,15 @@ static int isis_config_write(struct vty *vty)
 
        return write;
 }
-#endif /* ifdef FABRICD */
 
 struct cmd_node router_node = {
-       .node = ROUTER_NODE,
+       .name = "isis",
+       .node = ISIS_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
        .config_write = isis_config_write,
 };
+#endif /* ifdef FABRICD */
 
 void isis_init(void)
 {
index 59d8676ec2035413de42d1234b6d4d45bd2601ca..b9ef60ff9430e4d6b62fe05eda14e9ee5f4b6225 100644 (file)
@@ -33,6 +33,7 @@ static int    ldp_debug_config_write(struct vty *);
 
 /* Debug node. */
 struct cmd_node ldp_debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = ldp_debug_config_write,
index ca82263b7dae6b724fb54bc45ecd195a7797bd76..3abd0817a80aec6472dad1a1e0c6ee2895f5239d 100644 (file)
@@ -40,6 +40,7 @@ static int     ldp_vty_get_af(struct vty *);
 static int      ldp_iface_is_configured(struct ldpd_conf *, const char *);
 
 struct cmd_node ldp_node = {
+       .name = "ldp",
        .node = LDP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-ldp)# ",
@@ -47,30 +48,35 @@ struct cmd_node ldp_node = {
 };
 
 struct cmd_node ldp_ipv4_node = {
+       .name = "ldp ipv4",
        .node = LDP_IPV4_NODE,
        .parent_node = LDP_NODE,
        .prompt = "%s(config-ldp-af)# ",
 };
 
 struct cmd_node ldp_ipv6_node = {
+       .name = "ldp ipv6",
        .node = LDP_IPV6_NODE,
        .parent_node = LDP_NODE,
        .prompt = "%s(config-ldp-af)# ",
 };
 
 struct cmd_node ldp_ipv4_iface_node = {
+       .name = "ldp ipv4 interface",
        .node = LDP_IPV4_IFACE_NODE,
        .parent_node = LDP_IPV4_NODE,
        .prompt = "%s(config-ldp-af-if)# ",
 };
 
 struct cmd_node ldp_ipv6_iface_node = {
+       .name = "ldp ipv6 interface",
        .node = LDP_IPV6_IFACE_NODE,
        .parent_node = LDP_IPV6_NODE,
        .prompt = "%s(config-ldp-af-if)# ",
 };
 
 struct cmd_node ldp_l2vpn_node = {
+       .name = "ldp l2vpn",
        .node = LDP_L2VPN_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-l2vpn)# ",
@@ -78,6 +84,7 @@ struct cmd_node ldp_l2vpn_node = {
 };
 
 struct cmd_node ldp_pseudowire_node = {
+       .name = "ldp",
        .node = LDP_PSEUDOWIRE_NODE,
        .parent_node = LDP_L2VPN_NODE,
        .prompt = "%s(config-l2vpn-pw)# ",
index 42c843bbb1810c08765af25497866dfa3cf84596..7c4bdcbe27d02f565c9390b975d56831ce012d34 100644 (file)
@@ -160,6 +160,7 @@ static void agentx_events_update(void)
 /* AgentX node. */
 static int config_write_agentx(struct vty *vty);
 static struct cmd_node agentx_node = {
+       .name = "smux",
        .node = SMUX_NODE,
        .prompt = "",
        .config_write = config_write_agentx,
index dad35bfbf86fffb5e705154a84fd514292b6df54..8ec93c1b336fdf137184976cd986a9abd52248ef 100644 (file)
@@ -73,86 +73,6 @@ const struct message tokennames[] = {
        item(END_TKN),
        {0},
 };
-
-const char *const node_names[] = {
-       "auth",                     // AUTH_NODE,
-       "view",                     // VIEW_NODE,
-       "auth enable",              // AUTH_ENABLE_NODE,
-       "enable",                   // ENABLE_NODE,
-       "config",                   // CONFIG_NODE,
-       "debug",                    // DEBUG_NODE,
-       "vrf debug",                // VRF_DEBUG_NODE,
-       "northbound debug",         // NORTHBOUND_DEBUG_NODE,
-       "vnc debug",                // DEBUG_VNC_NODE,
-       "route-map debug",          /* RMAP_DEBUG_NODE */
-       "resolver debug",           /* RESOLVER_DEBUG_NODE */
-       "aaa",                      // AAA_NODE,
-       "keychain",                 // KEYCHAIN_NODE,
-       "keychain key",             // KEYCHAIN_KEY_NODE,
-       "static ip",                // IP_NODE,
-       "vrf",                      // VRF_NODE,
-       "interface",                // INTERFACE_NODE,
-       "nexthop-group",            // NH_GROUP_NODE,
-       "zebra",                    // ZEBRA_NODE,
-       "table",                    // TABLE_NODE,
-       "rip",                      // RIP_NODE,
-       "ripng",                    // RIPNG_NODE,
-       "babel",                    // BABEL_NODE,
-       "eigrp",                    // EIGRP_NODE,
-       "bgp",                      // BGP_NODE,
-       "bgp vpnv4",                // BGP_VPNV4_NODE,
-       "bgp vpnv6",                // BGP_VPNV6_NODE,
-       "bgp ipv4 unicast",      // BGP_IPV4_NODE,
-       "bgp ipv4 multicast",       // BGP_IPV4M_NODE,
-       "bgp ipv4 labeled unicast", // BGP_IPV4L_NODE,
-       "bgp ipv6",                 // BGP_IPV6_NODE,
-       "bgp ipv6 multicast",       // BGP_IPV6M_NODE,
-       "bgp ipv6 labeled unicast", // BGP_IPV6L_NODE,
-       "bgp vrf policy",          // BGP_VRF_POLICY_NODE,
-       "bgp vnc defaults",      // BGP_VNC_DEFAULTS_NODE,
-       "bgp vnc nve",              // BGP_VNC_NVE_GROUP_NODE,
-       "bgp vnc l2",               // BGP_VNC_L2_GROUP_NODE,
-       "rfp defaults",             // RFP_DEFAULTS_NODE,
-       "bgp evpn",                 // BGP_EVPN_NODE,
-       "ospf",                     // OSPF_NODE,
-       "ospf6",                    // OSPF6_NODE,
-       "ldp",                      // LDP_NODE,
-       "ldp ipv4",                 // LDP_IPV4_NODE,
-       "ldp ipv6",                 // LDP_IPV6_NODE,
-       "ldp ipv4 interface",       // LDP_IPV4_IFACE_NODE,
-       "ldp ipv6 interface",       // LDP_IPV6_IFACE_NODE,
-       "ldp l2vpn",                // LDP_L2VPN_NODE,
-       "ldp",                      // LDP_PSEUDOWIRE_NODE,
-       "isis",                     // ISIS_NODE,
-       "ipv4 access list",      // ACCESS_NODE,
-       "ipv4 prefix list",      // PREFIX_NODE,
-       "ipv6 access list",      // ACCESS_IPV6_NODE,
-       "MAC access list",        // ACCESS_MAC_NODE,
-       "ipv6 prefix list",      // PREFIX_IPV6_NODE,
-       "as list",                  // AS_LIST_NODE,
-       "community list",          // COMMUNITY_LIST_NODE,
-       "routemap",                 // RMAP_NODE,
-       "pbr-map",                  // PBRMAP_NODE,
-       "smux",                     // SMUX_NODE,
-       "dump",                     // DUMP_NODE,
-       "forwarding",               // FORWARDING_NODE,
-       "protocol",                 // PROTOCOL_NODE,
-       "mpls",                     // MPLS_NODE,
-       "pw",                       // PW_NODE,
-       "vty",                      // VTY_NODE,
-       "link-params",              // LINK_PARAMS_NODE,
-       "bgp evpn vni",             // BGP_EVPN_VNI_NODE,
-       "rpki",                     // RPKI_NODE
-       "bgp ipv4 flowspec",        /* BGP_FLOWSPECV4_NODE
-                                    */
-       "bgp ipv6 flowspec",        /* BGP_FLOWSPECV6_NODE
-                                    */
-       "bfd",                   /* BFD_NODE */
-       "bfd peer",              /* BFD_PEER_NODE */
-       "openfabric",               // OPENFABRIC_NODE
-       "vrrp",                     /* VRRP_NODE */
-       "bmp",                   /* BMP_NODE */
-};
 /* clang-format on */
 
 /* Command vector which includes some level of command lists. Normally
@@ -181,27 +101,32 @@ const char *cmd_domainname_get(void)
 
 /* Standard command node structures. */
 static struct cmd_node auth_node = {
+       .name = "auth",
        .node = AUTH_NODE,
        .prompt = "Password: ",
 };
 
 static struct cmd_node view_node = {
+       .name = "view",
        .node = VIEW_NODE,
        .prompt = "%s> ",
 };
 
 static struct cmd_node auth_enable_node = {
+       .name = "auth enable",
        .node = AUTH_ENABLE_NODE,
        .prompt = "Password: ",
 };
 
 static struct cmd_node enable_node = {
+       .name = "enable",
        .node = ENABLE_NODE,
        .prompt = "%s# ",
 };
 
 static int config_write_host(struct vty *vty);
 static struct cmd_node config_node = {
+       .name = "config",
        .node = CONFIG_NODE,
        .parent_node = ENABLE_NODE,
        .prompt = "%s(config)# ",
@@ -395,9 +320,9 @@ void install_element(enum node_type ntype, const struct cmd_element *cmd)
        if (cnode == NULL) {
                fprintf(stderr,
                        "%s[%s]:\n"
-                       "\tnode %d (%s) does not exist.\n"
+                       "\tnode %d does not exist.\n"
                        "\tplease call install_node() before install_element()\n",
-                       cmd->name, cmd->string, ntype, node_names[ntype]);
+                       cmd->name, cmd->string, ntype);
                exit(EXIT_FAILURE);
        }
 
@@ -406,7 +331,7 @@ void install_element(enum node_type ntype, const struct cmd_element *cmd)
                        "%s[%s]:\n"
                        "\tnode %d (%s) already has this command installed.\n"
                        "\tduplicate install_element call?\n",
-                       cmd->name, cmd->string, ntype, node_names[ntype]);
+                       cmd->name, cmd->string, ntype, cnode->name);
                return;
        }
 
@@ -444,9 +369,9 @@ void uninstall_element(enum node_type ntype, const struct cmd_element *cmd)
        if (cnode == NULL) {
                fprintf(stderr,
                        "%s[%s]:\n"
-                       "\tnode %d (%s) does not exist.\n"
+                       "\tnode %d does not exist.\n"
                        "\tplease call install_node() before uninstall_element()\n",
-                       cmd->name, cmd->string, ntype, node_names[ntype]);
+                       cmd->name, cmd->string, ntype);
                exit(EXIT_FAILURE);
        }
 
@@ -455,7 +380,7 @@ void uninstall_element(enum node_type ntype, const struct cmd_element *cmd)
                        "%s[%s]:\n"
                        "\tnode %d (%s) does not have this command installed.\n"
                        "\tduplicate uninstall_element call?\n",
-                       cmd->name, cmd->string, ntype, node_names[ntype]);
+                       cmd->name, cmd->string, ntype, cnode->name);
                return;
        }
 
@@ -2745,7 +2670,7 @@ DEFUN(find,
 
                        if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
                                vty_out(vty, "  (%s)  %s\n",
-                                       node_names[node->node], cli->string);
+                                       node->name, cli->string);
                }
        }
 
@@ -2793,9 +2718,6 @@ void cmd_init(int terminal)
 {
        struct utsname names;
 
-       if (array_size(node_names) != NODE_TYPE_MAX)
-               assert(!"Update the CLI node description array!");
-
        uname(&names);
        qobj_init();
 
index c1de67e10fd2c471527479f6d9eaa2f635576a9b..6ab8497fe6e9880f00b23feef2df7096a74711b8 100644 (file)
@@ -165,11 +165,12 @@ enum node_type {
 
 extern vector cmdvec;
 extern const struct message tokennames[];
-extern const char *const node_names[];
 
 /* Node which has some commands and prompt string and configuration
    function pointer . */
 struct cmd_node {
+       const char *name;
+
        /* Node index. */
        enum node_type node;
        enum node_type parent_node;
index c6cc16d7d95299185c7595dab046d6ea6c7b658c..71c9b8095a73a76ad9b521455e573f13c87965a8 100644 (file)
@@ -2814,6 +2814,7 @@ static int config_write_access(struct vty *vty, afi_t afi)
 
 static int config_write_access_mac(struct vty *vty);
 static struct cmd_node access_mac_node = {
+       .name = "MAC access list",
        .node = ACCESS_MAC_NODE,
        .prompt = "",
        .config_write = config_write_access_mac,
@@ -2868,6 +2869,7 @@ static void access_list_init_mac(void)
 /* Access-list node. */
 static int config_write_access_ipv4(struct vty *vty);
 static struct cmd_node access_node = {
+       .name = "ipv4 access list",
        .node = ACCESS_NODE,
        .prompt = "",
        .config_write = config_write_access_ipv4,
@@ -2956,6 +2958,7 @@ static void access_list_init_ipv4(void)
 
 static int config_write_access_ipv6(struct vty *vty);
 static struct cmd_node access_ipv6_node = {
+       .name = "ipv6 access list",
        .node = ACCESS_IPV6_NODE,
        .prompt = "",
        .config_write = config_write_access_ipv6,
index 8ccdbfcbc12532aacf01b17e2790415467452ed9..a40b815caa74329dae7df28453ee3a4aed74945d 100644 (file)
@@ -399,7 +399,7 @@ DEFUN (grammar_findambig,
                        if (!nodegraph)
                                continue;
                        vty_out(vty, "scanning node %d (%s)\n", scannode - 1,
-                               node_names[scannode - 1]);
+                               cnode->name);
                }
 
                commands = cmd_graph_permutations(nodegraph);
index bfeaa7fec237d7b1284757bed86a592b9d68b09e..251211734bd766cc75903ee957e47bdb146ecc80 100644 (file)
@@ -961,6 +961,7 @@ DEFUN (no_send_lifetime,
 
 static int keychain_config_write(struct vty *vty);
 static struct cmd_node keychain_node = {
+       .name = "keychain",
        .node = KEYCHAIN_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-keychain)# ",
@@ -968,6 +969,7 @@ static struct cmd_node keychain_node = {
 };
 
 static struct cmd_node keychain_key_node = {
+       .name = "keychain key",
        .node = KEYCHAIN_KEY_NODE,
        .parent_node = KEYCHAIN_NODE,
        .prompt = "%s(config-keychain-key)# ",
index 5544605290377963dd555a8f79a2dcdc850e7e04..c23c57d2e19b7ee612e51377098d4dc966ad9f23 100644 (file)
@@ -935,6 +935,7 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
 
 static int nexthop_group_write(struct vty *vty);
 static struct cmd_node nexthop_group_node = {
+       .name = "nexthop-group",
        .node = NH_GROUP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-nh-group)# ",
index d0e05990a8815b51140018f5a2b1e7e9bfac6f27..d4467facafe713ce9ba8b303d847d7421b41775e 100644 (file)
@@ -1675,6 +1675,7 @@ static int nb_debug_config_write(struct vty *vty)
 
 static struct debug_callbacks nb_dbg_cbs = {.debug_set_all = nb_debug_set_all};
 static struct cmd_node nb_debug_node = {
+       .name = "northbound debug",
        .node = NORTHBOUND_DEBUG_NODE,
        .prompt = "",
        .config_write = nb_debug_config_write,
index acc4491a008c607fc025d0c0fb23ab817c673006..8d43b9bd8920b08fa0a9d58bedcab57a6719da1c 100644 (file)
@@ -2047,6 +2047,7 @@ static void prefix_list_reset_afi(afi_t afi, int orf)
 static int config_write_prefix_ipv4(struct vty *vty);
 /* Prefix-list node. */
 static struct cmd_node prefix_node = {
+       .name = "ipv4 prefix list",
        .node = PREFIX_NODE,
        .prompt = "",
        .config_write = config_write_prefix_ipv4,
@@ -2113,6 +2114,7 @@ static void prefix_list_init_ipv4(void)
 static int config_write_prefix_ipv6(struct vty *vty);
 /* Prefix-list node. */
 static struct cmd_node prefix_ipv6_node = {
+       .name = "ipv6 prefix list",
        .node = PREFIX_IPV6_NODE,
        .prompt = "",
        .config_write = config_write_prefix_ipv6,
index 56b2d6cd66fee9bae3f7bfec89078eee5b587416..e5caadb2d04eac6ed0b737ea43b9fac25dd2081f 100644 (file)
@@ -247,6 +247,7 @@ DEFUN(debug_resolver,
 
 static int resolver_config_write_debug(struct vty *vty);
 static struct cmd_node resolver_debug_node = {
+       .name = "resolver debug",
        .node = RESOLVER_DEBUG_NODE,
        .prompt = "",
        .config_write = resolver_config_write_debug,
index 2208a69f94d45e0fc9d6c5db53a803d9348fc123..210512212dea9f7d3b0c507f45363bce0c00edd0 100644 (file)
@@ -3017,6 +3017,7 @@ DEFUN (no_debug_rmap,
 /* Debug node. */
 static int rmap_config_write_debug(struct vty *vty);
 static struct cmd_node rmap_debug_node = {
+       .name = "route-map debug",
        .node = RMAP_DEBUG_NODE,
        .prompt = "",
        .config_write = rmap_config_write_debug,
index 16ecd119418d584c3c301925c0f6f6b9aeb8f529..2c45f09751899780044e8e98f03edc4dee28c710 100644 (file)
@@ -1066,6 +1066,7 @@ static int route_map_config_write(struct vty *vty)
 /* Route map node structure. */
 static int route_map_config_write(struct vty *vty);
 static struct cmd_node rmap_node = {
+       .name = "routemap",
        .node = RMAP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-route-map)# ",
index 1fadf5c0c82f680eadd2947db11738f25f9dd143..0f57c602b10ce421332a3ca4f5912c3d96f0f1c5 100644 (file)
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -759,6 +759,7 @@ DEFUN (no_vrf,
 
 
 static struct cmd_node vrf_node = {
+       .name = "vrf",
        .node = VRF_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-vrf)# ",
@@ -854,6 +855,7 @@ static int vrf_write_host(struct vty *vty)
 
 static int vrf_write_host(struct vty *vty);
 static struct cmd_node vrf_debug_node = {
+       .name = "vrf debug",
        .node = VRF_DEBUG_NODE,
        .prompt = "",
        .config_write = vrf_write_host,
index 24cdfeda42a24876a9bc989cb7e4cd422736128a..683c39f893bc973356a08df7a77b76e24020794c 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -3009,6 +3009,7 @@ static int vty_config_write(struct vty *vty)
 
 static int vty_config_write(struct vty *vty);
 struct cmd_node vty_node = {
+       .name = "vty",
        .node = VTY_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-line)# ",
index bf29d021818c4e1fdb59d00fcd9b4aa5d1e28189..fe681b405248e79e527e3181f94262afd884d2b0 100644 (file)
@@ -19,6 +19,7 @@
 
 static int nhrp_config_write(struct vty *vty);
 static struct cmd_node zebra_node = {
+       .name = "zebra",
        .node = ZEBRA_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
@@ -27,6 +28,7 @@ static struct cmd_node zebra_node = {
 
 static int interface_config_write(struct vty *vty);
 static struct cmd_node nhrp_interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index 8ed9c67974095def304779b9bc9f869ca7fe34be..1209997514747b1de3a36042d8d5ccf75302fb7b 100644 (file)
@@ -1945,6 +1945,7 @@ static int config_write_ospf6_interface(struct vty *vty)
 
 static int config_write_ospf6_interface(struct vty *vty);
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index 75c0460ecac58fd5d89c4dcf0c201d97e3fdc90b..dd672dd1c5e79b38190aac0889380ca97032761d 100644 (file)
@@ -1115,6 +1115,7 @@ static int config_write_ospf6(struct vty *vty)
 static int config_write_ospf6(struct vty *vty);
 /* OSPF6 node structure. */
 static struct cmd_node ospf6_node = {
+       .name = "ospf6",
        .node = OSPF6_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-ospf6)# ",
index efbb332b6ed5011bfb321093cd62b13c79834b30..17e33902d9a18d9f06dbfc73a899e54b99756f67 100644 (file)
@@ -71,6 +71,7 @@ struct route_node *route_prev(struct route_node *node)
 
 static int config_write_ospf6_debug(struct vty *vty);
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_ospf6_debug,
index e012326ea918c7919e811a7d3c75ce109aa09bfd..f0740349a09fd2e34ed1d4ea725751940ada1e36 100644 (file)
@@ -1643,6 +1643,7 @@ DEFUN_NOSH (show_debugging_ospf_instance,
 static int config_write_debug(struct vty *vty);
 /* Debug node. */
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
index 25bd41001513da53a28b5cbfc6dd83dea6aaa8c7..a3a02a0f959352fe9d1c6601580d95f858ab7cd1 100644 (file)
@@ -10558,6 +10558,7 @@ void ospf_vty_show_init(void)
 static int config_write_interface(struct vty *vty);
 /* ospfd's interface node. */
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
@@ -10676,6 +10677,7 @@ static void ospf_vty_zebra_init(void)
 
 static int ospf_config_write(struct vty *vty);
 static struct cmd_node ospf_node = {
+       .name = "ospf",
        .node = OSPF_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
index 35dbb24d1903e0fffeea128113bd4cee88890f49..a52c2d1e30b529ad1d1891d41d92ffeb9b572572 100644 (file)
@@ -678,6 +678,7 @@ DEFPY (show_pbr_interface,
 /* PBR debugging CLI ------------------------------------------------------- */
 
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = pbr_debug_config_write,
@@ -731,6 +732,7 @@ DEFUN_NOSH(show_debugging_pbr,
 
 static int pbr_interface_config_write(struct vty *vty);
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
@@ -765,6 +767,7 @@ static int pbr_interface_config_write(struct vty *vty)
 static int pbr_vty_map_config_write(struct vty *vty);
 /* PBR map node structure. */
 static struct cmd_node pbr_map_node = {
+       .name = "pbr-map",
        .node = PBRMAP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-pbr-map)# ",
index 895072a892957eaa7f801d18bcb503fd09ede7c7..f99888b3afadcae021fe50545b050ccd3e8308ba 100644 (file)
@@ -70,6 +70,7 @@
 #endif
 
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
@@ -77,6 +78,7 @@ static struct cmd_node interface_node = {
 };
 
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = pim_debug_config_write,
index 676fc0cca4174d667983a698e7911db6c847392b..871ee8e87ef4e0e3b3b3fc84e8f1139e501147de 100644 (file)
@@ -175,6 +175,7 @@ DEFUN (no_debug_rip_zebra,
 static int config_write_debug(struct vty *vty);
 /* Debug node. */
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
index 924eb8334b081034ef8128ebe0747bdcc5e7a77a..177f53db4547ef22fbadb776c061663adb3402ca 100644 (file)
@@ -1195,6 +1195,7 @@ int rip_show_network_config(struct vty *vty, struct rip *rip)
 
 static int rip_interface_config_write(struct vty *vty);
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index b6bbfb253d350362e510568fd84b5f6f2cd5e2e2..fee700583b4061868f60effbaa18e945930f48fb 100644 (file)
@@ -3330,6 +3330,7 @@ static int config_write_rip(struct vty *vty)
 static int config_write_rip(struct vty *vty);
 /* RIP node structure. */
 static struct cmd_node rip_node = {
+       .name = "rip",
        .node = RIP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
index 117148a3a1fb93f875c43b66f7fd0b7a9b3f3581..54edb17eccc2246682939a396d20e4fccb73c27b 100644 (file)
@@ -177,6 +177,7 @@ DEFUN (no_debug_ripng_zebra,
 static int config_write_debug(struct vty *vty);
 /* Debug node. */
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
index e45bbbe2146c6abbfac08a3b89c4a0e78d4b3864..e8c907227e496f3cc29c264cdace1d3e1933561f 100644 (file)
@@ -957,6 +957,7 @@ static int interface_config_write(struct vty *vty)
 static int interface_config_write(struct vty *vty);
 /* ripngd's interface node. */
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
index 47083f9471484f61eaf0af84f5b28a4ca039c5f8..d26e103866ca020114cf4342f9b8f4236fd76046 100644 (file)
@@ -2437,6 +2437,7 @@ static int ripng_config_write(struct vty *vty)
 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)# ",
index 733578f86c2c4d1c23d5a440a79a8c6f3bf59864..16cd64bcb65027dfd8967ec9dfb2916a844fce87 100644 (file)
@@ -1471,6 +1471,7 @@ DEFUN_NOSH (show_debugging_static,
 }
 
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = static_config_write_debug,
index 54417f495407cb4e7f5860730f3b1bb0a3b70054..2b345c91e879a60ad4ede8066440cb2988bf2859 100644 (file)
@@ -49,96 +49,112 @@ static vector test_cmds;
 static char test_buf[32768];
 
 static struct cmd_node bgp_node = {
+       .name = "bgp",
        .node = BGP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node rip_node = {
+       .name = "rip",
        .node = RIP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node isis_node = {
+       .name = "isis",
        .node = ISIS_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
 };
 
 static struct cmd_node rmap_node = {
+       .name = "routemap",
        .node = RMAP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-route-map)# ",
 };
 
 static struct cmd_node zebra_node = {
+       .name = "zebra",
        .node = ZEBRA_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node bgp_vpnv4_node = {
+       .name = "bgp vpnv4",
        .node = BGP_VPNV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4_node = {
+       .name = "bgp ipv4 unicast",
        .node = BGP_IPV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4m_node = {
+       .name = "bgp ipv4 multicast",
        .node = BGP_IPV4M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6_node = {
+       .name = "bgp ipv6",
        .node = BGP_IPV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6m_node = {
+       .name = "bgp ipv6 multicast",
        .node = BGP_IPV6M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node ospf_node = {
+       .name = "ospf",
        .node = OSPF_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node ripng_node = {
+       .name = "ripng",
        .node = RIPNG_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node ospf6_node = {
+       .name = "ospf6",
        .node = OSPF6_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-ospf6)# ",
 };
 
 static struct cmd_node keychain_node = {
+       .name = "keychain",
        .node = KEYCHAIN_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-keychain)# ",
 };
 
 static struct cmd_node keychain_key_node = {
+       .name = "keychain key",
        .node = KEYCHAIN_KEY_NODE,
        .parent_node = KEYCHAIN_NODE,
        .prompt = "%s(config-keychain-key)# ",
index f2048db984346ef9035c13784d0ce187bb20ed32..b6388cc5ba7d143e712fc972024a8468decd085b 100644 (file)
@@ -745,6 +745,7 @@ static int vrrp_config_write_interface(struct vty *vty)
 }
 
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
@@ -752,12 +753,14 @@ static struct cmd_node interface_node = {
 };
 
 static struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = vrrp_config_write_debug,
 };
 
 static struct cmd_node vrrp_node = {
+       .name = "vrrp",
        .node = VRRP_NODE,
        .prompt = "",
        .config_write = vrrp_config_write_global,
index ddb40a572f4891bd6a846d74f947614bc64c2c66..a21deb4a0e1e50a60c060a548f6b76a63fd87bd8 100644 (file)
@@ -1173,264 +1173,308 @@ static char **new_completion(const char *text, int start, int end)
 
 /* Vty node structures. */
 static struct cmd_node bgp_node = {
+       .name = "bgp",
        .node = BGP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node rip_node = {
+       .name = "rip",
        .node = RIP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node isis_node = {
+       .name = "isis",
        .node = ISIS_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node openfabric_node = {
+       .name = "openfabric",
        .node = OPENFABRIC_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
 };
 
 static struct cmd_node pw_node = {
+       .name = "pw",
        .node = PW_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-pw)# ",
 };
 
 static struct cmd_node vrf_node = {
+       .name = "vrf",
        .node = VRF_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-vrf)# ",
 };
 
 static struct cmd_node nh_group_node = {
+       .name = "nexthop-group",
        .node = NH_GROUP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-nh-group)# ",
 };
 
 static struct cmd_node rmap_node = {
+       .name = "routemap",
        .node = RMAP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-route-map)# ",
 };
 
 static struct cmd_node pbr_map_node = {
+       .name = "pbr-map",
        .node = PBRMAP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-pbr-map)# ",
 };
 
 static struct cmd_node zebra_node = {
+       .name = "zebra",
        .node = ZEBRA_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node bgp_vpnv4_node = {
+       .name = "bgp vpnv4",
        .node = BGP_VPNV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_vpnv6_node = {
+       .name = "bgp vpnv6",
        .node = BGP_VPNV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_flowspecv4_node = {
+       .name = "bgp ipv4 flowspec",
        .node = BGP_FLOWSPECV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_flowspecv6_node = {
+       .name = "bgp ipv6 flowspec",
        .node = BGP_FLOWSPECV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4_node = {
+       .name = "bgp ipv4 unicast",
        .node = BGP_IPV4_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4m_node = {
+       .name = "bgp ipv4 multicast",
        .node = BGP_IPV4M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv4l_node = {
+       .name = "bgp ipv4 labeled unicast",
        .node = BGP_IPV4L_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6_node = {
+       .name = "bgp ipv6",
        .node = BGP_IPV6_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_ipv6m_node = {
+       .name = "bgp ipv6 multicast",
        .node = BGP_IPV6M_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_evpn_node = {
+       .name = "bgp evpn",
        .node = BGP_EVPN_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_evpn_vni_node = {
+       .name = "bgp evpn vni",
        .node = BGP_EVPN_VNI_NODE,
        .parent_node = BGP_EVPN_NODE,
        .prompt = "%s(config-router-af-vni)# ",
 };
 
 static struct cmd_node bgp_ipv6l_node = {
+       .name = "bgp ipv6 labeled unicast",
        .node = BGP_IPV6L_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-af)# ",
 };
 
 static struct cmd_node bgp_vnc_defaults_node = {
+       .name = "bgp vnc defaults",
        .node = BGP_VNC_DEFAULTS_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-defaults)# ",
 };
 
 static struct cmd_node bgp_vnc_nve_group_node = {
+       .name = "bgp vnc nve",
        .node = BGP_VNC_NVE_GROUP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-nve-group)# ",
 };
 
 static struct cmd_node bgp_vrf_policy_node = {
+       .name = "bgp vrf policy",
        .node = BGP_VRF_POLICY_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vrf-policy)# ",
 };
 
 static struct cmd_node bgp_vnc_l2_group_node = {
+       .name = "bgp vnc l2",
        .node = BGP_VNC_L2_GROUP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-router-vnc-l2-group)# ",
 };
 
 static struct cmd_node bmp_node = {
+       .name = "bmp",
        .node = BMP_NODE,
        .parent_node = BGP_NODE,
        .prompt = "%s(config-bgp-bmp)# "
 };
 
 static struct cmd_node ospf_node = {
+       .name = "ospf",
        .node = OSPF_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node eigrp_node = {
+       .name = "eigrp",
        .node = EIGRP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node babel_node = {
+       .name = "babel",
        .node = BABEL_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node ripng_node = {
+       .name = "ripng",
        .node = RIPNG_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-router)# ",
 };
 
 static struct cmd_node ospf6_node = {
+       .name = "ospf6",
        .node = OSPF6_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-ospf6)# ",
 };
 
 static struct cmd_node ldp_node = {
+       .name = "ldp",
        .node = LDP_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-ldp)# ",
 };
 
 static struct cmd_node ldp_ipv4_node = {
+       .name = "ldp ipv4",
        .node = LDP_IPV4_NODE,
        .parent_node = LDP_NODE,
        .prompt = "%s(config-ldp-af)# ",
 };
 
 static struct cmd_node ldp_ipv6_node = {
+       .name = "ldp ipv6",
        .node = LDP_IPV6_NODE,
        .parent_node = LDP_NODE,
        .prompt = "%s(config-ldp-af)# ",
 };
 
 static struct cmd_node ldp_ipv4_iface_node = {
+       .name = "ldp ipv4 interface",
        .node = LDP_IPV4_IFACE_NODE,
        .parent_node = LDP_IPV4_NODE,
        .prompt = "%s(config-ldp-af-if)# ",
 };
 
 static struct cmd_node ldp_ipv6_iface_node = {
+       .name = "ldp ipv6 interface",
        .node = LDP_IPV6_IFACE_NODE,
        .parent_node = LDP_IPV6_NODE,
        .prompt = "%s(config-ldp-af-if)# ",
 };
 
 static struct cmd_node ldp_l2vpn_node = {
+       .name = "ldp l2vpn",
        .node = LDP_L2VPN_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-l2vpn)# ",
 };
 
 static struct cmd_node ldp_pseudowire_node = {
+       .name = "ldp",
        .node = LDP_PSEUDOWIRE_NODE,
        .parent_node = LDP_L2VPN_NODE,
        .prompt = "%s(config-l2vpn-pw)# ",
 };
 
 static struct cmd_node keychain_node = {
+       .name = "keychain",
        .node = KEYCHAIN_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-keychain)# ",
 };
 
 static struct cmd_node keychain_key_node = {
+       .name = "keychain key",
        .node = KEYCHAIN_KEY_NODE,
        .parent_node = KEYCHAIN_NODE,
        .prompt = "%s(config-keychain-key)# ",
 };
 
 struct cmd_node link_params_node = {
+       .name = "link-params",
        .node = LINK_PARAMS_NODE,
        .parent_node = INTERFACE_NODE,
        .prompt = "%s(config-link-params)# ",
 };
 
 static struct cmd_node rpki_node = {
+       .name = "rpki",
        .node = RPKI_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-rpki)# ",
@@ -1438,12 +1482,14 @@ static struct cmd_node rpki_node = {
 
 #if HAVE_BFDD > 0
 static struct cmd_node bfd_node = {
+       .name = "bfd",
        .node = BFD_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-bfd)# ",
 };
 
 static struct cmd_node bfd_peer_node = {
+       .name = "bfd peer",
        .node = BFD_PEER_NODE,
        .parent_node = BFD_NODE,
        .prompt = "%s(config-bfd-peer)# ",
@@ -3568,7 +3614,7 @@ DEFUN(find,
 
                        if (regexec(&exp, cli->string, 0, NULL, 0) == 0)
                                vty_out(vty, "  (%s)  %s\n",
-                                       node_names[node->node], cli->string);
+                                       node->name, cli->string);
                }
        }
 
index a77693d94d860529e08b46897a28ad0b26e6da78..c920fca5ff46a7c4a03126de7fa26e2ca532fced 100644 (file)
@@ -473,6 +473,7 @@ DEFPY (debug_zebra_nexthop,
 /* Debug node. */
 static int config_write_debug(struct vty *vty);
 struct cmd_node debug_node = {
+       .name = "debug",
        .node = DEBUG_NODE,
        .prompt = "",
        .config_write = config_write_debug,
index f4b330d8a8adce0e953c4d5223cf13f3d0cab403..cad382ff08ede50b5ee4580c32ba16616e131e40 100644 (file)
@@ -1666,6 +1666,7 @@ static void interface_update_stats(void)
 
 static int if_config_write(struct vty *vty);
 struct cmd_node interface_node = {
+       .name = "interface",
        .node = INTERFACE_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-if)# ",
@@ -2080,6 +2081,7 @@ DEFUN (no_bandwidth_if,
 
 
 struct cmd_node link_params_node = {
+       .name = "link-params",
        .node = LINK_PARAMS_NODE,
        .parent_node = INTERFACE_NODE,
        .prompt = "%s(config-link-params)# ",
index 462a75b551d630b334cca3c675403414765b7696..41d73f3c97888716880ef3fbf9cd856e9cb571be 100644 (file)
@@ -1941,6 +1941,7 @@ static int fpm_remote_srv_write(struct vty *vty)
 static int fpm_remote_srv_write(struct vty *vty);
 /* Zebra node  */
 static struct cmd_node zebra_node = {
+       .name = "zebra",
        .node = ZEBRA_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "",
index 148b9c46db2db2467fa2df93fc44bb0eefde1f45..d789f200715462412b11a25050672092b6705dc1 100644 (file)
@@ -452,6 +452,7 @@ DEFUN (no_mpls_label_global_block,
 static int zebra_mpls_config(struct vty *vty);
 /* MPLS node for MPLS LSP. */
 static struct cmd_node mpls_node = {
+       .name = "mpls",
        .node = MPLS_NODE,
        .prompt = "",
        .config_write = zebra_mpls_config,
index 1885401287bae6395ad729e089a9ea67ce11cf52..7a14f6304f9c86527db1ba77b5aa0c8e195504cf 100644 (file)
@@ -549,6 +549,7 @@ static int zebra_pw_config(struct vty *vty)
 
 static int zebra_pw_config(struct vty *vty);
 static struct cmd_node pw_node = {
+       .name = "pw",
        .node = PW_NODE,
        .parent_node = CONFIG_NODE,
        .prompt = "%s(config-pw)# ",
index bb8d0c774448dc6f0c4995cbfd5b3dffce7b43da..8042264ca87b841094be81aaf891f8db0029610e 100644 (file)
@@ -3480,12 +3480,14 @@ DEFUN_HIDDEN (show_frr,
 /* IP node for static routes. */
 static int zebra_ip_config(struct vty *vty);
 static struct cmd_node ip_node = {
+       .name = "static ip",
        .node = IP_NODE,
        .prompt = "",
        .config_write = zebra_ip_config,
 };
 static int config_write_protocol(struct vty *vty);
 static struct cmd_node protocol_node = {
+       .name = "protocol",
        .node = PROTOCOL_NODE,
        .prompt = "",
        .config_write = config_write_protocol,
@@ -3493,12 +3495,14 @@ static struct cmd_node protocol_node = {
 /* table node for routing tables. */
 static int config_write_table(struct vty *vty);
 static struct cmd_node table_node = {
+       .name = "table",
        .node = TABLE_NODE,
        .prompt = "",
        .config_write = config_write_table,
 };
 static int config_write_forwarding(struct vty *vty);
 static struct cmd_node forwarding_node = {
+       .name = "forwarding",
        .node = FORWARDING_NODE,
        .prompt = "",
        .config_write = config_write_forwarding,