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)# ",
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)# ",
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)# ",
};
struct cmd_node bfd_peer_node = {
+ .name = "bfd peer",
.node = BFD_PEER_NODE,
.parent_node = BFD_NODE,
.prompt = "%s(config-bfd-peer)# ",
}
static struct cmd_node bmp_node = {
+ .name = "bmp",
.node = BMP_NODE,
.parent_node = BGP_NODE,
.prompt = "%s(config-bgp-bmp)# "
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,
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,
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,
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)# ",
/* BGP node structure. */
static struct cmd_node bgp_node = {
+ .name = "bgp",
.node = BGP_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-router)# ",
};
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)# ",
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,
}
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 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,
*/
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)# ",
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)# ",
/* 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,
}
struct cmd_node interface_node = {
+ .name = "interface",
.node = INTERFACE_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-if)# ",
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,
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)
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)
{
/* Debug node. */
struct cmd_node ldp_debug_node = {
+ .name = "debug",
.node = DEBUG_NODE,
.prompt = "",
.config_write = ldp_debug_config_write,
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)# ",
};
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)# ",
};
struct cmd_node ldp_pseudowire_node = {
+ .name = "ldp",
.node = LDP_PSEUDOWIRE_NODE,
.parent_node = LDP_L2VPN_NODE,
.prompt = "%s(config-l2vpn-pw)# ",
/* 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,
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
/* 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)# ",
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);
}
"%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;
}
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);
}
"%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;
}
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);
}
}
{
struct utsname names;
- if (array_size(node_names) != NODE_TYPE_MAX)
- assert(!"Update the CLI node description array!");
-
uname(&names);
qobj_init();
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;
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,
/* 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,
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,
if (!nodegraph)
continue;
vty_out(vty, "scanning node %d (%s)\n", scannode - 1,
- node_names[scannode - 1]);
+ cnode->name);
}
commands = cmd_graph_permutations(nodegraph);
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)# ",
};
static struct cmd_node keychain_key_node = {
+ .name = "keychain key",
.node = KEYCHAIN_KEY_NODE,
.parent_node = KEYCHAIN_NODE,
.prompt = "%s(config-keychain-key)# ",
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)# ",
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,
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,
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,
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,
/* 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,
/* 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)# ",
static struct cmd_node vrf_node = {
+ .name = "vrf",
.node = VRF_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-vrf)# ",
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,
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)# ",
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)# ",
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)# ",
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)# ",
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)# ",
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,
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,
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)# ",
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)# ",
/* PBR debugging CLI ------------------------------------------------------- */
static struct cmd_node debug_node = {
+ .name = "debug",
.node = DEBUG_NODE,
.prompt = "",
.config_write = pbr_debug_config_write,
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)# ",
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)# ",
#endif
static struct cmd_node interface_node = {
+ .name = "interface",
.node = INTERFACE_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-if)# ",
};
static struct cmd_node debug_node = {
+ .name = "debug",
.node = DEBUG_NODE,
.prompt = "",
.config_write = pim_debug_config_write,
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,
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)# ",
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)# ",
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,
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)# ",
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)# ",
}
static struct cmd_node debug_node = {
+ .name = "debug",
.node = DEBUG_NODE,
.prompt = "",
.config_write = static_config_write_debug,
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)# ",
}
static struct cmd_node interface_node = {
+ .name = "interface",
.node = INTERFACE_NODE,
.parent_node = CONFIG_NODE,
.prompt = "%s(config-if)# ",
};
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,
/* 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)# ",
#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)# ",
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);
}
}
/* 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,
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)# ",
struct cmd_node link_params_node = {
+ .name = "link-params",
.node = LINK_PARAMS_NODE,
.parent_node = INTERFACE_NODE,
.prompt = "%s(config-link-params)# ",
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 = "",
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,
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)# ",
/* 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,
/* 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,