mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 16:26:10 +00:00
*: remove second parameter on install_node()
There is really no reason to not put this in the cmd_node. And while we're add it, rename from pointless ".func" to ".config_write". [v2: fix forgotten ldpd config_write] Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
parent
249a771b63
commit
612c2c15d8
@ -58,9 +58,11 @@ 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 = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = interface_config_write,
|
||||
};
|
||||
|
||||
|
||||
@ -1245,7 +1247,7 @@ babel_if_init(void)
|
||||
babel_enable_if = vector_init (1);
|
||||
|
||||
/* install interface node and commands */
|
||||
install_node (&babel_interface_node, interface_config_write);
|
||||
install_node(&babel_interface_node);
|
||||
if_cmd_init();
|
||||
|
||||
install_element(BABEL_NODE, &babel_network_cmd);
|
||||
|
@ -69,10 +69,12 @@ static time_t expiry_time;
|
||||
static time_t source_expiry_time;
|
||||
|
||||
/* Babel node structure. */
|
||||
static int babel_config_write (struct vty *vty);
|
||||
static struct cmd_node cmd_babel_node =
|
||||
{
|
||||
.node = BABEL_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = babel_config_write,
|
||||
};
|
||||
|
||||
/* print current babel configuration on vty */
|
||||
@ -718,7 +720,7 @@ void
|
||||
babeld_quagga_init(void)
|
||||
{
|
||||
|
||||
install_node(&cmd_babel_node, &babel_config_write);
|
||||
install_node(&cmd_babel_node);
|
||||
|
||||
install_element(CONFIG_NODE, &router_babel_cmd);
|
||||
install_element(CONFIG_NODE, &no_router_babel_cmd);
|
||||
|
@ -885,9 +885,11 @@ DEFUN_NOSH(show_debugging_bfd,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int bfdd_write_config(struct vty *vty);
|
||||
struct cmd_node bfd_node = {
|
||||
.node = BFD_NODE,
|
||||
.prompt = "%s(config-bfd)# ",
|
||||
.config_write = bfdd_write_config,
|
||||
};
|
||||
|
||||
struct cmd_node bfd_peer_node = {
|
||||
@ -943,11 +945,11 @@ void bfdd_vty_init(void)
|
||||
install_element(CONFIG_NODE, &bfd_debug_network_cmd);
|
||||
|
||||
/* Install BFD node and commands. */
|
||||
install_node(&bfd_node, bfdd_write_config);
|
||||
install_node(&bfd_node);
|
||||
install_default(BFD_NODE);
|
||||
|
||||
/* Install BFD peer node. */
|
||||
install_node(&bfd_peer_node, NULL);
|
||||
install_node(&bfd_peer_node);
|
||||
install_default(BFD_PEER_NODE);
|
||||
|
||||
bfdd_cli_init();
|
||||
|
@ -2269,7 +2269,7 @@ static int bmp_config_write(struct bgp *bgp, struct vty *vty)
|
||||
|
||||
static int bgp_bmp_init(struct thread_master *tm)
|
||||
{
|
||||
install_node(&bmp_node, NULL);
|
||||
install_node(&bmp_node);
|
||||
install_default(BMP_NODE);
|
||||
install_element(BGP_NODE, &bmp_targets_cmd);
|
||||
install_element(BGP_NODE, &no_bmp_targets_cmd);
|
||||
|
@ -2282,14 +2282,16 @@ static int bgp_config_write_debug(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int bgp_config_write_debug(struct vty *vty);
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = bgp_config_write_debug,
|
||||
};
|
||||
|
||||
void bgp_debug_init(void)
|
||||
{
|
||||
install_node(&debug_node, bgp_config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_debugging_bgp_cmd);
|
||||
|
||||
|
@ -777,10 +777,12 @@ DEFUN (no_dump_bgp_all,
|
||||
return bgp_dump_unset(bgp_dump_struct);
|
||||
}
|
||||
|
||||
static int config_write_bgp_dump(struct vty *vty);
|
||||
/* BGP node structure. */
|
||||
static struct cmd_node bgp_dump_node = {
|
||||
.node = DUMP_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_bgp_dump,
|
||||
};
|
||||
|
||||
#if 0
|
||||
@ -860,7 +862,7 @@ void bgp_dump_init(void)
|
||||
stream_new((BGP_MAX_PACKET_SIZE << 1) + BGP_DUMP_MSG_HEADER
|
||||
+ BGP_DUMP_HEADER_SIZE);
|
||||
|
||||
install_node(&bgp_dump_node, config_write_bgp_dump);
|
||||
install_node(&bgp_dump_node);
|
||||
|
||||
install_element(CONFIG_NODE, &dump_bgp_all_cmd);
|
||||
install_element(CONFIG_NODE, &no_dump_bgp_all_cmd);
|
||||
|
@ -667,15 +667,17 @@ static int config_write_as_list(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int config_write_as_list(struct vty *vty);
|
||||
static struct cmd_node as_list_node = {
|
||||
.node = AS_LIST_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_as_list,
|
||||
};
|
||||
|
||||
/* Register functions. */
|
||||
void bgp_filter_init(void)
|
||||
{
|
||||
install_node(&as_list_node, config_write_as_list);
|
||||
install_node(&as_list_node);
|
||||
|
||||
install_element(CONFIG_NODE, &bgp_as_path_cmd);
|
||||
install_element(CONFIG_NODE, &no_bgp_as_path_cmd);
|
||||
|
@ -146,6 +146,7 @@ static int rpki_sync_socket_bgpd;
|
||||
static struct cmd_node rpki_node = {
|
||||
.node = RPKI_NODE,
|
||||
.prompt = "%s(config-rpki)# ",
|
||||
.config_write = config_write,
|
||||
};
|
||||
static const struct route_map_rule_cmd route_match_rpki_cmd = {
|
||||
"rpki", route_match, route_match_compile, route_match_free};
|
||||
@ -1542,7 +1543,7 @@ static void overwrite_exit_commands(void)
|
||||
static void install_cli_commands(void)
|
||||
{
|
||||
// TODO: make config write work
|
||||
install_node(&rpki_node, &config_write);
|
||||
install_node(&rpki_node);
|
||||
install_default(RPKI_NODE);
|
||||
overwrite_exit_commands();
|
||||
install_element(CONFIG_NODE, &rpki_cmd);
|
||||
|
@ -15337,6 +15337,7 @@ int bgp_config_write(struct vty *vty)
|
||||
static struct cmd_node bgp_node = {
|
||||
.node = BGP_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = bgp_config_write,
|
||||
};
|
||||
|
||||
static struct cmd_node bgp_ipv4_unicast_node = {
|
||||
@ -15460,19 +15461,19 @@ void bgp_vty_init(void)
|
||||
cmd_variable_handler_register(bgp_var_peergroup);
|
||||
|
||||
/* Install bgp top node. */
|
||||
install_node(&bgp_node, bgp_config_write);
|
||||
install_node(&bgp_ipv4_unicast_node, NULL);
|
||||
install_node(&bgp_ipv4_multicast_node, NULL);
|
||||
install_node(&bgp_ipv4_labeled_unicast_node, NULL);
|
||||
install_node(&bgp_ipv6_unicast_node, NULL);
|
||||
install_node(&bgp_ipv6_multicast_node, NULL);
|
||||
install_node(&bgp_ipv6_labeled_unicast_node, NULL);
|
||||
install_node(&bgp_vpnv4_node, NULL);
|
||||
install_node(&bgp_vpnv6_node, NULL);
|
||||
install_node(&bgp_evpn_node, NULL);
|
||||
install_node(&bgp_evpn_vni_node, NULL);
|
||||
install_node(&bgp_flowspecv4_node, NULL);
|
||||
install_node(&bgp_flowspecv6_node, NULL);
|
||||
install_node(&bgp_node);
|
||||
install_node(&bgp_ipv4_unicast_node);
|
||||
install_node(&bgp_ipv4_multicast_node);
|
||||
install_node(&bgp_ipv4_labeled_unicast_node);
|
||||
install_node(&bgp_ipv6_unicast_node);
|
||||
install_node(&bgp_ipv6_multicast_node);
|
||||
install_node(&bgp_ipv6_labeled_unicast_node);
|
||||
install_node(&bgp_vpnv4_node);
|
||||
install_node(&bgp_vpnv6_node);
|
||||
install_node(&bgp_evpn_node);
|
||||
install_node(&bgp_evpn_vni_node);
|
||||
install_node(&bgp_flowspecv4_node);
|
||||
install_node(&bgp_flowspecv6_node);
|
||||
|
||||
/* Install default VTY commands to new nodes. */
|
||||
install_default(BGP_NODE);
|
||||
@ -17877,14 +17878,16 @@ static int community_list_config_write(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int community_list_config_write(struct vty *vty);
|
||||
static struct cmd_node community_list_node = {
|
||||
.node = COMMUNITY_LIST_NODE,
|
||||
.prompt = "",
|
||||
.config_write = community_list_config_write,
|
||||
};
|
||||
|
||||
static void community_list_vty(void)
|
||||
{
|
||||
install_node(&community_list_node, community_list_config_write);
|
||||
install_node(&community_list_node);
|
||||
|
||||
/* Community-list. */
|
||||
install_element(CONFIG_NODE, &bgp_community_list_standard_cmd);
|
||||
|
@ -3689,10 +3689,10 @@ bgp_rfapi_get_ecommunity_by_lni_label(struct bgp *bgp, uint32_t is_import,
|
||||
|
||||
void bgp_rfapi_cfg_init(void)
|
||||
{
|
||||
install_node(&bgp_vnc_defaults_node, NULL);
|
||||
install_node(&bgp_vnc_nve_group_node, NULL);
|
||||
install_node(&bgp_vrf_policy_node, NULL);
|
||||
install_node(&bgp_vnc_l2_group_node, NULL);
|
||||
install_node(&bgp_vnc_defaults_node);
|
||||
install_node(&bgp_vnc_nve_group_node);
|
||||
install_node(&bgp_vrf_policy_node);
|
||||
install_node(&bgp_vnc_l2_group_node);
|
||||
install_default(BGP_VRF_POLICY_NODE);
|
||||
install_default(BGP_VNC_DEFAULTS_NODE);
|
||||
install_default(BGP_VNC_NVE_GROUP_NODE);
|
||||
|
@ -173,14 +173,16 @@ static int bgp_vnc_config_write_debug(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int bgp_vnc_config_write_debug(struct vty *vty);
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_VNC_NODE,
|
||||
.prompt = "",
|
||||
.config_write = bgp_vnc_config_write_debug,
|
||||
};
|
||||
|
||||
void vnc_debug_init(void)
|
||||
{
|
||||
install_node(&debug_node, bgp_vnc_config_write_debug);
|
||||
install_node(&debug_node);
|
||||
install_element(ENABLE_NODE, &show_debugging_bgp_vnc_cmd);
|
||||
|
||||
install_element(ENABLE_NODE, &debug_bgp_vnc_cmd);
|
||||
|
@ -838,9 +838,11 @@ void eigrp_cli_show_keychain(struct vty *vty, struct lyd_node *dnode,
|
||||
/*
|
||||
* CLI installation procedures.
|
||||
*/
|
||||
static int eigrp_config_write(struct vty *vty);
|
||||
static struct cmd_node eigrp_node = {
|
||||
.node = EIGRP_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = eigrp_config_write,
|
||||
};
|
||||
|
||||
static int eigrp_config_write(struct vty *vty)
|
||||
@ -857,9 +859,11 @@ static int eigrp_config_write(struct vty *vty)
|
||||
return written;
|
||||
}
|
||||
|
||||
static int eigrp_write_interface(struct vty *vty);
|
||||
static struct cmd_node eigrp_interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = eigrp_write_interface,
|
||||
};
|
||||
|
||||
|
||||
@ -893,7 +897,7 @@ eigrp_cli_init(void)
|
||||
install_element(CONFIG_NODE, &router_eigrp_cmd);
|
||||
install_element(CONFIG_NODE, &no_router_eigrp_cmd);
|
||||
|
||||
install_node(&eigrp_node, eigrp_config_write);
|
||||
install_node(&eigrp_node);
|
||||
install_default(EIGRP_NODE);
|
||||
|
||||
install_element(EIGRP_NODE, &eigrp_router_id_cmd);
|
||||
@ -911,7 +915,7 @@ eigrp_cli_init(void)
|
||||
install_element(EIGRP_NODE, &eigrp_neighbor_cmd);
|
||||
install_element(EIGRP_NODE, &eigrp_redistribute_source_metric_cmd);
|
||||
|
||||
install_node(&eigrp_interface_node, eigrp_write_interface);
|
||||
install_node(&eigrp_interface_node);
|
||||
if_cmd_init();
|
||||
|
||||
install_element(INTERFACE_NODE, &eigrp_if_delay_cmd);
|
||||
|
@ -555,15 +555,17 @@ DEFUN (no_debug_eigrp_packets,
|
||||
}
|
||||
|
||||
/* Debug node. */
|
||||
static int config_write_debug(struct vty *vty);
|
||||
static struct cmd_node eigrp_debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
/* Initialize debug commands. */
|
||||
void eigrp_debug_init(void)
|
||||
{
|
||||
install_node(&eigrp_debug_node, config_write_debug);
|
||||
install_node(&eigrp_debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_debugging_eigrp_cmd);
|
||||
install_element(ENABLE_NODE, &debug_eigrp_packets_all_cmd);
|
||||
|
@ -67,7 +67,6 @@ DEFINE_HOOK(isis_if_new_hook, (struct interface *ifp), (ifp))
|
||||
/*
|
||||
* Prototypes.
|
||||
*/
|
||||
int isis_interface_config_write(struct vty *);
|
||||
int isis_if_new_hook(struct interface *);
|
||||
int isis_if_delete_hook(struct interface *);
|
||||
|
||||
@ -969,7 +968,7 @@ DEFINE_HOOK(isis_circuit_config_write,
|
||||
(circuit, vty))
|
||||
|
||||
#ifdef FABRICD
|
||||
int isis_interface_config_write(struct vty *vty)
|
||||
static int isis_interface_config_write(struct vty *vty)
|
||||
{
|
||||
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
|
||||
int write = 0;
|
||||
@ -1192,7 +1191,7 @@ int isis_interface_config_write(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
#else
|
||||
int isis_interface_config_write(struct vty *vty)
|
||||
static int isis_interface_config_write(struct vty *vty)
|
||||
{
|
||||
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
|
||||
int write = 0;
|
||||
@ -1338,6 +1337,7 @@ ferr_r isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit,
|
||||
struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = isis_interface_config_write,
|
||||
};
|
||||
|
||||
void isis_circuit_circ_type_set(struct isis_circuit *circuit, int circ_type)
|
||||
@ -1442,7 +1442,7 @@ void isis_circuit_init(void)
|
||||
hook_register_prio(if_del, 0, isis_if_delete_hook);
|
||||
|
||||
/* Install interface node */
|
||||
install_node(&interface_node, isis_interface_config_write);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
if_zapi_callbacks(isis_ifp_create, isis_ifp_up,
|
||||
isis_ifp_down, isis_ifp_destroy);
|
||||
|
@ -73,7 +73,6 @@ int area_clear_net_title(struct vty *, const char *);
|
||||
int show_isis_interface_common(struct vty *, const char *ifname, char);
|
||||
int show_isis_neighbor_common(struct vty *, const char *id, char);
|
||||
int clear_isis_neighbor_common(struct vty *, const char *id);
|
||||
int isis_config_write(struct vty *);
|
||||
|
||||
|
||||
void isis_new(unsigned long process_id, vrf_id_t vrf_id)
|
||||
@ -784,10 +783,12 @@ DEFUN_NOSH (show_debugging,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int config_write_debug(struct vty *vty);
|
||||
/* Debug node. */
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
@ -1855,7 +1856,7 @@ DEFUN (no_log_adj_changes,
|
||||
#endif /* ifdef FABRICD */
|
||||
#ifdef FABRICD
|
||||
/* IS-IS configuration write function */
|
||||
int isis_config_write(struct vty *vty)
|
||||
static int isis_config_write(struct vty *vty)
|
||||
{
|
||||
int write = 0;
|
||||
|
||||
@ -2129,7 +2130,7 @@ int isis_config_write(struct vty *vty)
|
||||
|
||||
#else
|
||||
/* IS-IS configuration write function */
|
||||
int isis_config_write(struct vty *vty)
|
||||
static int isis_config_write(struct vty *vty)
|
||||
{
|
||||
int write = 0;
|
||||
struct lyd_node *dnode;
|
||||
@ -2147,12 +2148,13 @@ int isis_config_write(struct vty *vty)
|
||||
struct cmd_node router_node = {
|
||||
.node = ROUTER_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = isis_config_write,
|
||||
};
|
||||
|
||||
void isis_init(void)
|
||||
{
|
||||
/* Install IS-IS top node */
|
||||
install_node(&router_node, isis_config_write);
|
||||
install_node(&router_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_isis_summary_cmd);
|
||||
|
||||
@ -2173,7 +2175,7 @@ void isis_init(void)
|
||||
|
||||
install_element(ENABLE_NODE, &show_debugging_isis_cmd);
|
||||
|
||||
install_node(&debug_node, config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &debug_isis_adj_cmd);
|
||||
install_element(ENABLE_NODE, &no_debug_isis_adj_cmd);
|
||||
|
@ -29,10 +29,13 @@
|
||||
struct ldp_debug conf_ldp_debug;
|
||||
struct ldp_debug ldp_debug;
|
||||
|
||||
static int ldp_debug_config_write(struct vty *);
|
||||
|
||||
/* Debug node. */
|
||||
struct cmd_node ldp_debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = ldp_debug_config_write,
|
||||
};
|
||||
|
||||
int
|
||||
@ -140,7 +143,7 @@ ldp_vty_show_debugging(struct vty *vty)
|
||||
return (CMD_SUCCESS);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ldp_debug_config_write(struct vty *vty)
|
||||
{
|
||||
int write = 0;
|
||||
|
@ -33,9 +33,6 @@ extern struct cmd_node ldp_debug_node;
|
||||
|
||||
union ldpd_addr;
|
||||
int ldp_get_address(const char *, int *, union ldpd_addr *);
|
||||
int ldp_config_write(struct vty *);
|
||||
int ldp_l2vpn_config_write(struct vty *);
|
||||
int ldp_debug_config_write(struct vty *);
|
||||
int ldp_vty_mpls_ldp (struct vty *, const char *);
|
||||
int ldp_vty_address_family (struct vty *, const char *, const char *);
|
||||
int ldp_vty_disc_holdtime(struct vty *, const char *, enum hello_type, long);
|
||||
|
@ -779,14 +779,14 @@ ldp_vty_init (void)
|
||||
{
|
||||
cmd_variable_handler_register(l2vpn_var_handlers);
|
||||
|
||||
install_node(&ldp_node, ldp_config_write);
|
||||
install_node(&ldp_ipv4_node, NULL);
|
||||
install_node(&ldp_ipv6_node, NULL);
|
||||
install_node(&ldp_ipv4_iface_node, NULL);
|
||||
install_node(&ldp_ipv6_iface_node, NULL);
|
||||
install_node(&ldp_l2vpn_node, ldp_l2vpn_config_write);
|
||||
install_node(&ldp_pseudowire_node, NULL);
|
||||
install_node(&ldp_debug_node, ldp_debug_config_write);
|
||||
install_node(&ldp_node);
|
||||
install_node(&ldp_ipv4_node);
|
||||
install_node(&ldp_ipv6_node);
|
||||
install_node(&ldp_ipv4_iface_node);
|
||||
install_node(&ldp_ipv6_iface_node);
|
||||
install_node(&ldp_l2vpn_node);
|
||||
install_node(&ldp_pseudowire_node);
|
||||
install_node(&ldp_debug_node);
|
||||
install_default(LDP_NODE);
|
||||
install_default(LDP_IPV4_NODE);
|
||||
install_default(LDP_IPV6_NODE);
|
||||
|
@ -30,9 +30,11 @@
|
||||
#include "vty.h"
|
||||
#include "ldp_vty.h"
|
||||
|
||||
static int ldp_config_write(struct vty *);
|
||||
static void ldp_af_iface_config_write(struct vty *, int);
|
||||
static void ldp_af_config_write(struct vty *, int, struct ldpd_conf *,
|
||||
struct ldpd_af_conf *);
|
||||
static int ldp_l2vpn_config_write(struct vty *);
|
||||
static void ldp_l2vpn_pw_config_write(struct vty *, struct l2vpn_pw *);
|
||||
static int ldp_vty_get_af(struct vty *);
|
||||
static int ldp_iface_is_configured(struct ldpd_conf *, const char *);
|
||||
@ -40,6 +42,7 @@ static int ldp_iface_is_configured(struct ldpd_conf *, const char *);
|
||||
struct cmd_node ldp_node = {
|
||||
.node = LDP_NODE,
|
||||
.prompt = "%s(config-ldp)# ",
|
||||
.config_write = ldp_config_write,
|
||||
};
|
||||
|
||||
struct cmd_node ldp_ipv4_node = {
|
||||
@ -65,6 +68,7 @@ struct cmd_node ldp_ipv6_iface_node = {
|
||||
struct cmd_node ldp_l2vpn_node = {
|
||||
.node = LDP_L2VPN_NODE,
|
||||
.prompt = "%s(config-l2vpn)# ",
|
||||
.config_write = ldp_l2vpn_config_write,
|
||||
};
|
||||
|
||||
struct cmd_node ldp_pseudowire_node = {
|
||||
@ -226,7 +230,7 @@ ldp_af_config_write(struct vty *vty, int af, struct ldpd_conf *conf,
|
||||
vty_out(vty, " exit-address-family\n");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ldp_config_write(struct vty *vty)
|
||||
{
|
||||
struct nbr_params *nbrp;
|
||||
@ -331,7 +335,7 @@ ldp_l2vpn_pw_config_write(struct vty *vty, struct l2vpn_pw *pw)
|
||||
vty_out (vty," ! Incomplete config, specify a pw-id\n");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
ldp_l2vpn_config_write(struct vty *vty)
|
||||
{
|
||||
struct l2vpn *l2vpn;
|
||||
|
@ -158,9 +158,11 @@ static void agentx_events_update(void)
|
||||
}
|
||||
|
||||
/* AgentX node. */
|
||||
static int config_write_agentx(struct vty *vty);
|
||||
static struct cmd_node agentx_node = {
|
||||
.node = SMUX_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_agentx,
|
||||
};
|
||||
|
||||
/* Logging NetSNMP messages */
|
||||
@ -247,7 +249,7 @@ void smux_init(struct thread_master *tm)
|
||||
agentx_log_callback, NULL);
|
||||
init_agent(FRR_SMUX_NAME);
|
||||
|
||||
install_node(&agentx_node, config_write_agentx);
|
||||
install_node(&agentx_node);
|
||||
install_element(CONFIG_NODE, &agentx_enable_cmd);
|
||||
install_element(CONFIG_NODE, &no_agentx_cmd);
|
||||
}
|
||||
|
@ -200,9 +200,11 @@ static struct cmd_node enable_node = {
|
||||
.prompt = "%s# ",
|
||||
};
|
||||
|
||||
static int config_write_host(struct vty *vty);
|
||||
static struct cmd_node config_node = {
|
||||
.node = CONFIG_NODE,
|
||||
.prompt = "%s(config)# ",
|
||||
.config_write = config_write_host,
|
||||
};
|
||||
|
||||
static const struct facility_map {
|
||||
@ -352,10 +354,9 @@ static bool cmd_hash_cmp(const void *a, const void *b)
|
||||
}
|
||||
|
||||
/* Install top node of command vector. */
|
||||
void install_node(struct cmd_node *node, int (*func)(struct vty *))
|
||||
void install_node(struct cmd_node *node)
|
||||
{
|
||||
vector_set_index(cmdvec, node->node, node);
|
||||
node->func = func;
|
||||
node->cmdgraph = graph_new();
|
||||
node->cmd_vector = vector_init(VECTOR_MIN_SIZE);
|
||||
// add start node
|
||||
@ -1723,8 +1724,8 @@ static int vty_write_config(struct vty *vty)
|
||||
vty_out(vty, "!\n");
|
||||
|
||||
for (i = 0; i < vector_active(cmdvec); i++)
|
||||
if ((node = vector_slot(cmdvec, i)) && node->func) {
|
||||
if ((*node->func)(vty))
|
||||
if ((node = vector_slot(cmdvec, i)) && node->config_write) {
|
||||
if ((*node->config_write)(vty))
|
||||
vty_out(vty, "!\n");
|
||||
}
|
||||
|
||||
@ -2889,11 +2890,11 @@ void cmd_init(int terminal)
|
||||
host.motdfile = NULL;
|
||||
|
||||
/* Install top nodes. */
|
||||
install_node(&view_node, NULL);
|
||||
install_node(&enable_node, NULL);
|
||||
install_node(&auth_node, NULL);
|
||||
install_node(&auth_enable_node, NULL);
|
||||
install_node(&config_node, config_write_host);
|
||||
install_node(&view_node);
|
||||
install_node(&enable_node);
|
||||
install_node(&auth_node);
|
||||
install_node(&auth_enable_node);
|
||||
install_node(&config_node);
|
||||
|
||||
/* Each node's basic commands. */
|
||||
install_element(VIEW_NODE, &show_version_cmd);
|
||||
|
@ -177,7 +177,7 @@ struct cmd_node {
|
||||
const char *prompt;
|
||||
|
||||
/* Node's configuration write function */
|
||||
int (*func)(struct vty *);
|
||||
int (*config_write)(struct vty *);
|
||||
|
||||
/* Node's command graph */
|
||||
struct graph *cmdgraph;
|
||||
@ -431,7 +431,7 @@ struct cmd_node {
|
||||
#define NO_GR_NEIGHBOR_HELPER_CMD "Undo Graceful Restart Helper command for a neighbor\n"
|
||||
|
||||
/* Prototypes. */
|
||||
extern void install_node(struct cmd_node *node, int (*)(struct vty *));
|
||||
extern void install_node(struct cmd_node *node);
|
||||
extern void install_default(enum node_type);
|
||||
extern void install_element(enum node_type, const struct cmd_element *);
|
||||
|
||||
|
12
lib/filter.c
12
lib/filter.c
@ -2812,9 +2812,11 @@ static int config_write_access(struct vty *vty, afi_t afi)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int config_write_access_mac(struct vty *vty);
|
||||
static struct cmd_node access_mac_node = {
|
||||
.node = ACCESS_MAC_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_access_mac,
|
||||
};
|
||||
|
||||
static int config_write_access_mac(struct vty *vty)
|
||||
@ -2851,7 +2853,7 @@ static void access_list_reset_mac(void)
|
||||
/* Install vty related command. */
|
||||
static void access_list_init_mac(void)
|
||||
{
|
||||
install_node(&access_mac_node, config_write_access_mac);
|
||||
install_node(&access_mac_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_mac_access_list_cmd);
|
||||
install_element(ENABLE_NODE, &show_mac_access_list_name_cmd);
|
||||
@ -2864,9 +2866,11 @@ 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 = {
|
||||
.node = ACCESS_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_access_ipv4,
|
||||
};
|
||||
|
||||
static int config_write_access_ipv4(struct vty *vty)
|
||||
@ -2903,7 +2907,7 @@ static void access_list_reset_ipv4(void)
|
||||
/* Install vty related command. */
|
||||
static void access_list_init_ipv4(void)
|
||||
{
|
||||
install_node(&access_node, config_write_access_ipv4);
|
||||
install_node(&access_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_ip_access_list_cmd);
|
||||
install_element(ENABLE_NODE, &show_ip_access_list_name_cmd);
|
||||
@ -2950,9 +2954,11 @@ static void access_list_init_ipv4(void)
|
||||
install_element(CONFIG_NODE, &no_access_list_remark_comment_cmd);
|
||||
}
|
||||
|
||||
static int config_write_access_ipv6(struct vty *vty);
|
||||
static struct cmd_node access_ipv6_node = {
|
||||
.node = ACCESS_IPV6_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_access_ipv6,
|
||||
};
|
||||
|
||||
static int config_write_access_ipv6(struct vty *vty)
|
||||
@ -2988,7 +2994,7 @@ static void access_list_reset_ipv6(void)
|
||||
|
||||
static void access_list_init_ipv6(void)
|
||||
{
|
||||
install_node(&access_ipv6_node, config_write_access_ipv6);
|
||||
install_node(&access_ipv6_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_ipv6_access_list_cmd);
|
||||
install_element(ENABLE_NODE, &show_ipv6_access_list_name_cmd);
|
||||
|
@ -959,9 +959,11 @@ DEFUN (no_send_lifetime,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int keychain_config_write(struct vty *vty);
|
||||
static struct cmd_node keychain_node = {
|
||||
.node = KEYCHAIN_NODE,
|
||||
.prompt = "%s(config-keychain)# ",
|
||||
.config_write = keychain_config_write,
|
||||
};
|
||||
|
||||
static struct cmd_node keychain_key_node = {
|
||||
@ -1046,8 +1048,8 @@ void keychain_init(void)
|
||||
{
|
||||
keychain_list = list_new();
|
||||
|
||||
install_node(&keychain_node, keychain_config_write);
|
||||
install_node(&keychain_key_node, NULL);
|
||||
install_node(&keychain_node);
|
||||
install_node(&keychain_key_node);
|
||||
|
||||
install_default(KEYCHAIN_NODE);
|
||||
install_default(KEYCHAIN_KEY_NODE);
|
||||
|
@ -933,9 +933,11 @@ DEFPY(ecmp_nexthops, ecmp_nexthops_cmd,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int nexthop_group_write(struct vty *vty);
|
||||
static struct cmd_node nexthop_group_node = {
|
||||
.node = NH_GROUP_NODE,
|
||||
.prompt = "%s(config-nh-group)# ",
|
||||
.config_write = nexthop_group_write,
|
||||
};
|
||||
|
||||
void nexthop_group_write_nexthop(struct vty *vty, struct nexthop *nh)
|
||||
@ -1209,7 +1211,7 @@ void nexthop_group_init(void (*new)(const char *name),
|
||||
|
||||
cmd_variable_handler_register(nhg_name_handlers);
|
||||
|
||||
install_node(&nexthop_group_node, nexthop_group_write);
|
||||
install_node(&nexthop_group_node);
|
||||
install_element(CONFIG_NODE, &nexthop_group_cmd);
|
||||
install_element(CONFIG_NODE, &no_nexthop_group_cmd);
|
||||
|
||||
|
@ -1677,6 +1677,7 @@ static struct debug_callbacks nb_dbg_cbs = {.debug_set_all = nb_debug_set_all};
|
||||
static struct cmd_node nb_debug_node = {
|
||||
.node = NORTHBOUND_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = nb_debug_config_write,
|
||||
};
|
||||
|
||||
void nb_cli_install_default(int node)
|
||||
@ -1741,7 +1742,7 @@ void nb_cli_init(struct thread_master *tm)
|
||||
|
||||
debug_init(&nb_dbg_cbs);
|
||||
|
||||
install_node(&nb_debug_node, nb_debug_config_write);
|
||||
install_node(&nb_debug_node);
|
||||
install_element(ENABLE_NODE, &debug_nb_cmd);
|
||||
install_element(CONFIG_NODE, &debug_nb_cmd);
|
||||
|
||||
|
@ -2044,10 +2044,12 @@ 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 = {
|
||||
.node = PREFIX_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_prefix_ipv4,
|
||||
};
|
||||
|
||||
static int config_write_prefix_ipv4(struct vty *vty)
|
||||
@ -2086,7 +2088,7 @@ static const struct cmd_variable_handler plist_var_handlers[] = {
|
||||
|
||||
static void prefix_list_init_ipv4(void)
|
||||
{
|
||||
install_node(&prefix_node, config_write_prefix_ipv4);
|
||||
install_node(&prefix_node);
|
||||
|
||||
install_element(CONFIG_NODE, &ip_prefix_list_cmd);
|
||||
install_element(CONFIG_NODE, &no_ip_prefix_list_cmd);
|
||||
@ -2108,10 +2110,12 @@ static void prefix_list_init_ipv4(void)
|
||||
install_element(ENABLE_NODE, &clear_ip_prefix_list_cmd);
|
||||
}
|
||||
|
||||
static int config_write_prefix_ipv6(struct vty *vty);
|
||||
/* Prefix-list node. */
|
||||
static struct cmd_node prefix_ipv6_node = {
|
||||
.node = PREFIX_IPV6_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_prefix_ipv6,
|
||||
};
|
||||
|
||||
static int config_write_prefix_ipv6(struct vty *vty)
|
||||
@ -2121,7 +2125,7 @@ static int config_write_prefix_ipv6(struct vty *vty)
|
||||
|
||||
static void prefix_list_init_ipv6(void)
|
||||
{
|
||||
install_node(&prefix_ipv6_node, config_write_prefix_ipv6);
|
||||
install_node(&prefix_ipv6_node);
|
||||
|
||||
install_element(CONFIG_NODE, &ipv6_prefix_list_cmd);
|
||||
install_element(CONFIG_NODE, &no_ipv6_prefix_list_cmd);
|
||||
|
@ -245,9 +245,11 @@ DEFUN(debug_resolver,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int resolver_config_write_debug(struct vty *vty);
|
||||
static struct cmd_node resolver_debug_node = {
|
||||
.node = RESOLVER_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = resolver_config_write_debug,
|
||||
};
|
||||
|
||||
static int resolver_config_write_debug(struct vty *vty)
|
||||
@ -277,7 +279,7 @@ void resolver_init(struct thread_master *tm)
|
||||
ARES_OPT_SOCK_STATE_CB | ARES_OPT_TIMEOUT
|
||||
| ARES_OPT_TRIES);
|
||||
|
||||
install_node(&resolver_debug_node, resolver_config_write_debug);
|
||||
install_node(&resolver_debug_node);
|
||||
install_element(CONFIG_NODE, &debug_resolver_cmd);
|
||||
install_element(ENABLE_NODE, &debug_resolver_cmd);
|
||||
}
|
||||
|
@ -3015,9 +3015,11 @@ DEFUN (no_debug_rmap,
|
||||
}
|
||||
|
||||
/* Debug node. */
|
||||
static int rmap_config_write_debug(struct vty *vty);
|
||||
static struct cmd_node rmap_debug_node = {
|
||||
.node = RMAP_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = rmap_config_write_debug,
|
||||
};
|
||||
|
||||
/* Configuration write function. */
|
||||
@ -3245,7 +3247,7 @@ void route_map_init(void)
|
||||
route_map_cli_init();
|
||||
|
||||
/* Install route map top node. */
|
||||
install_node(&rmap_debug_node, rmap_config_write_debug);
|
||||
install_node(&rmap_debug_node);
|
||||
|
||||
/* Install route map commands. */
|
||||
install_element(CONFIG_NODE, &debug_rmap_cmd);
|
||||
|
@ -1064,9 +1064,11 @@ 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 = {
|
||||
.node = RMAP_NODE,
|
||||
.prompt = "%s(config-route-map)# ",
|
||||
.config_write = route_map_config_write,
|
||||
};
|
||||
|
||||
static void rmap_autocomplete(vector comps, struct cmd_token *token)
|
||||
@ -1090,7 +1092,7 @@ void route_map_cli_init(void)
|
||||
cmd_variable_handler_register(rmap_var_handlers);
|
||||
|
||||
/* CLI commands. */
|
||||
install_node(&rmap_node, route_map_config_write);
|
||||
install_node(&rmap_node);
|
||||
install_default(RMAP_NODE);
|
||||
install_element(CONFIG_NODE, &route_map_cmd);
|
||||
install_element(CONFIG_NODE, &no_route_map_cmd);
|
||||
|
@ -851,14 +851,16 @@ static int vrf_write_host(struct vty *vty)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int vrf_write_host(struct vty *vty);
|
||||
static struct cmd_node vrf_debug_node = {
|
||||
.node = VRF_DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = vrf_write_host,
|
||||
};
|
||||
|
||||
void vrf_install_commands(void)
|
||||
{
|
||||
install_node(&vrf_debug_node, vrf_write_host);
|
||||
install_node(&vrf_debug_node);
|
||||
|
||||
install_element(CONFIG_NODE, &vrf_debug_cmd);
|
||||
install_element(ENABLE_NODE, &vrf_debug_cmd);
|
||||
@ -871,7 +873,8 @@ void vrf_cmd_init(int (*writefunc)(struct vty *vty),
|
||||
{
|
||||
install_element(CONFIG_NODE, &vrf_cmd);
|
||||
install_element(CONFIG_NODE, &no_vrf_cmd);
|
||||
install_node(&vrf_node, writefunc);
|
||||
vrf_node.config_write = writefunc;
|
||||
install_node(&vrf_node);
|
||||
install_default(VRF_NODE);
|
||||
install_element(VRF_NODE, &vrf_exit_cmd);
|
||||
if (vrf_is_backend_netns() && ns_have_netns()) {
|
||||
|
@ -2989,9 +2989,11 @@ static int vty_config_write(struct vty *vty)
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int vty_config_write(struct vty *vty);
|
||||
struct cmd_node vty_node = {
|
||||
.node = VTY_NODE,
|
||||
.prompt = "%s(config-line)# ",
|
||||
.config_write = vty_config_write,
|
||||
};
|
||||
|
||||
/* Reset all VTY status. */
|
||||
@ -3085,7 +3087,7 @@ void vty_init(struct thread_master *master_thread, bool do_command_logging)
|
||||
Vvty_serv_thread = vector_init(VECTOR_MIN_SIZE);
|
||||
|
||||
/* Install bgp top node. */
|
||||
install_node(&vty_node, vty_config_write);
|
||||
install_node(&vty_node);
|
||||
|
||||
install_element(VIEW_NODE, &config_who_cmd);
|
||||
install_element(VIEW_NODE, &show_history_cmd);
|
||||
|
@ -17,14 +17,18 @@
|
||||
#include "nhrpd.h"
|
||||
#include "netlink.h"
|
||||
|
||||
static int nhrp_config_write(struct vty *vty);
|
||||
static struct cmd_node zebra_node = {
|
||||
.node = ZEBRA_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = nhrp_config_write,
|
||||
};
|
||||
|
||||
static int interface_config_write(struct vty *vty);
|
||||
static struct cmd_node nhrp_interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = interface_config_write,
|
||||
};
|
||||
|
||||
#define NHRP_DEBUG_FLAGS_CMD "<all|common|event|interface|kernel|route|vici>"
|
||||
@ -1094,7 +1098,7 @@ static int interface_config_write(struct vty *vty)
|
||||
|
||||
void nhrp_config_init(void)
|
||||
{
|
||||
install_node(&zebra_node, nhrp_config_write);
|
||||
install_node(&zebra_node);
|
||||
install_default(ZEBRA_NODE);
|
||||
|
||||
/* access-list commands */
|
||||
@ -1118,7 +1122,7 @@ void nhrp_config_init(void)
|
||||
install_element(CONFIG_NODE, &no_nhrp_nflog_group_cmd);
|
||||
|
||||
/* interface specific commands */
|
||||
install_node(&nhrp_interface_node, interface_config_write);
|
||||
install_node(&nhrp_interface_node);
|
||||
|
||||
if_cmd_init();
|
||||
install_element(INTERFACE_NODE, &tunnel_protection_cmd);
|
||||
|
@ -1943,9 +1943,11 @@ static int config_write_ospf6_interface(struct vty *vty)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int config_write_ospf6_interface(struct vty *vty);
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = config_write_ospf6_interface,
|
||||
};
|
||||
|
||||
static int ospf6_ifp_create(struct interface *ifp)
|
||||
@ -2002,7 +2004,7 @@ static int ospf6_ifp_destroy(struct interface *ifp)
|
||||
void ospf6_interface_init(void)
|
||||
{
|
||||
/* Install interface node. */
|
||||
install_node(&interface_node, config_write_ospf6_interface);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
if_zapi_callbacks(ospf6_ifp_create, ospf6_ifp_up,
|
||||
ospf6_ifp_down, ospf6_ifp_destroy);
|
||||
|
@ -1112,17 +1112,19 @@ static int config_write_ospf6(struct vty *vty)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int config_write_ospf6(struct vty *vty);
|
||||
/* OSPF6 node structure. */
|
||||
static struct cmd_node ospf6_node = {
|
||||
.node = OSPF6_NODE,
|
||||
.prompt = "%s(config-ospf6)# ",
|
||||
.config_write = config_write_ospf6,
|
||||
};
|
||||
|
||||
/* Install ospf related commands. */
|
||||
void ospf6_top_init(void)
|
||||
{
|
||||
/* Install ospf6 top node. */
|
||||
install_node(&ospf6_node, config_write_ospf6);
|
||||
install_node(&ospf6_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_ipv6_ospf6_cmd);
|
||||
install_element(CONFIG_NODE, &router_ospf6_cmd);
|
||||
|
@ -69,9 +69,11 @@ struct route_node *route_prev(struct route_node *node)
|
||||
return prev;
|
||||
}
|
||||
|
||||
static int config_write_ospf6_debug(struct vty *vty);
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_ospf6_debug,
|
||||
};
|
||||
|
||||
static int config_write_ospf6_debug(struct vty *vty)
|
||||
@ -1217,7 +1219,7 @@ void ospf6_init(void)
|
||||
prefix_list_delete_hook(ospf6_plist_del);
|
||||
|
||||
ospf6_bfd_init();
|
||||
install_node(&debug_node, config_write_ospf6_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element_ospf6_debug_message();
|
||||
install_element_ospf6_debug_lsa();
|
||||
|
@ -1640,10 +1640,12 @@ DEFUN_NOSH (show_debugging_ospf_instance,
|
||||
return show_debugging_ospf_common(vty, ospf);
|
||||
}
|
||||
|
||||
static int config_write_debug(struct vty *vty);
|
||||
/* Debug node. */
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
@ -1784,7 +1786,7 @@ static int config_write_debug(struct vty *vty)
|
||||
/* Initialize debug commands. */
|
||||
void ospf_debug_init(void)
|
||||
{
|
||||
install_node(&debug_node, config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_debugging_ospf_cmd);
|
||||
install_element(ENABLE_NODE, &debug_ospf_ism_cmd);
|
||||
|
@ -10555,17 +10555,19 @@ void ospf_vty_show_init(void)
|
||||
}
|
||||
|
||||
|
||||
static int config_write_interface(struct vty *vty);
|
||||
/* ospfd's interface node. */
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = config_write_interface,
|
||||
};
|
||||
|
||||
/* Initialization of OSPF interface. */
|
||||
static void ospf_vty_if_init(void)
|
||||
{
|
||||
/* Install interface node. */
|
||||
install_node(&interface_node, config_write_interface);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
|
||||
/* "ip ospf authentication" commands. */
|
||||
@ -10671,9 +10673,11 @@ static void ospf_vty_zebra_init(void)
|
||||
#endif /* 0 */
|
||||
}
|
||||
|
||||
static int ospf_config_write(struct vty *vty);
|
||||
static struct cmd_node ospf_node = {
|
||||
.node = OSPF_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = ospf_config_write,
|
||||
};
|
||||
|
||||
static void ospf_interface_clear(struct interface *ifp)
|
||||
@ -10747,7 +10751,7 @@ void ospf_vty_clear_init(void)
|
||||
void ospf_vty_init(void)
|
||||
{
|
||||
/* Install ospf top node. */
|
||||
install_node(&ospf_node, ospf_config_write);
|
||||
install_node(&ospf_node);
|
||||
|
||||
/* "router ospf" commands. */
|
||||
install_element(CONFIG_NODE, &router_ospf_cmd);
|
||||
|
@ -680,6 +680,7 @@ DEFPY (show_pbr_interface,
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = pbr_debug_config_write,
|
||||
};
|
||||
|
||||
DEFPY(debug_pbr,
|
||||
@ -728,9 +729,11 @@ DEFUN_NOSH(show_debugging_pbr,
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
static int pbr_interface_config_write(struct vty *vty);
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = pbr_interface_config_write,
|
||||
};
|
||||
|
||||
static int pbr_interface_config_write(struct vty *vty)
|
||||
@ -758,10 +761,12 @@ static int pbr_interface_config_write(struct vty *vty)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int pbr_vty_map_config_write(struct vty *vty);
|
||||
/* PBR map node structure. */
|
||||
static struct cmd_node pbr_map_node = {
|
||||
.node = PBRMAP_NODE,
|
||||
.prompt = "%s(config-pbr-map)# ",
|
||||
.config_write = pbr_vty_map_config_write,
|
||||
};
|
||||
|
||||
static int pbr_vty_map_config_write_sequence(struct vty *vty,
|
||||
@ -840,15 +845,13 @@ void pbr_vty_init(void)
|
||||
{
|
||||
cmd_variable_handler_register(pbr_map_name);
|
||||
|
||||
install_node(&interface_node,
|
||||
pbr_interface_config_write);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
|
||||
install_node(&pbr_map_node,
|
||||
pbr_vty_map_config_write);
|
||||
install_node(&pbr_map_node);
|
||||
|
||||
/* debug */
|
||||
install_node(&debug_node, pbr_debug_config_write);
|
||||
install_node(&debug_node);
|
||||
install_element(VIEW_NODE, &debug_pbr_cmd);
|
||||
install_element(CONFIG_NODE, &debug_pbr_cmd);
|
||||
install_element(VIEW_NODE, &show_debugging_pbr_cmd);
|
||||
|
@ -72,11 +72,13 @@
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = pim_interface_config_write,
|
||||
};
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = pim_debug_config_write,
|
||||
};
|
||||
|
||||
static struct vrf *pim_cmd_lookup_vrf(struct vty *vty, struct cmd_token *argv[],
|
||||
@ -10831,11 +10833,10 @@ DEFUN_HIDDEN (ip_pim_mlag,
|
||||
|
||||
void pim_cmd_init(void)
|
||||
{
|
||||
install_node(&interface_node,
|
||||
pim_interface_config_write); /* INTERFACE_NODE */
|
||||
install_node(&interface_node); /* INTERFACE_NODE */
|
||||
if_cmd_init();
|
||||
|
||||
install_node(&debug_node, pim_debug_config_write);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &pim_test_sg_keepalive_cmd);
|
||||
|
||||
|
@ -172,10 +172,12 @@ DEFUN (no_debug_rip_zebra,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int config_write_debug(struct vty *vty);
|
||||
/* Debug node. */
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
@ -211,7 +213,7 @@ void rip_debug_init(void)
|
||||
rip_debug_packet = 0;
|
||||
rip_debug_zebra = 0;
|
||||
|
||||
install_node(&debug_node, config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(ENABLE_NODE, &show_debugging_rip_cmd);
|
||||
install_element(ENABLE_NODE, &debug_rip_events_cmd);
|
||||
|
@ -1193,9 +1193,11 @@ int rip_show_network_config(struct vty *vty, struct rip *rip)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rip_interface_config_write(struct vty *vty);
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = rip_interface_config_write,
|
||||
};
|
||||
|
||||
void rip_interface_sync(struct interface *ifp)
|
||||
@ -1237,7 +1239,7 @@ void rip_if_init(void)
|
||||
hook_register_prio(if_del, 0, rip_interface_delete_hook);
|
||||
|
||||
/* Install interface node. */
|
||||
install_node(&interface_node, rip_interface_config_write);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
if_zapi_callbacks(rip_ifp_create, rip_ifp_up,
|
||||
rip_ifp_down, rip_ifp_destroy);
|
||||
|
@ -3327,10 +3327,12 @@ static int config_write_rip(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int config_write_rip(struct vty *vty);
|
||||
/* RIP node structure. */
|
||||
static struct cmd_node rip_node = {
|
||||
.node = RIP_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = config_write_rip,
|
||||
};
|
||||
|
||||
/* Distribute-list update functions. */
|
||||
@ -3734,7 +3736,7 @@ void rip_vrf_terminate(void)
|
||||
void rip_init(void)
|
||||
{
|
||||
/* Install top nodes. */
|
||||
install_node(&rip_node, config_write_rip);
|
||||
install_node(&rip_node);
|
||||
|
||||
/* Install rip commands. */
|
||||
install_element(VIEW_NODE, &show_ip_rip_cmd);
|
||||
|
@ -174,10 +174,12 @@ DEFUN (no_debug_ripng_zebra,
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
static int config_write_debug(struct vty *vty);
|
||||
/* Debug node. */
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
@ -213,7 +215,7 @@ void ripng_debug_init(void)
|
||||
ripng_debug_packet = 0;
|
||||
ripng_debug_zebra = 0;
|
||||
|
||||
install_node(&debug_node, config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_debugging_ripng_cmd);
|
||||
|
||||
|
@ -954,10 +954,12 @@ static int interface_config_write(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int interface_config_write(struct vty *vty);
|
||||
/* ripngd's interface node. */
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = interface_config_write,
|
||||
};
|
||||
|
||||
/* Initialization of interface. */
|
||||
@ -968,7 +970,7 @@ void ripng_if_init(void)
|
||||
hook_register_prio(if_del, 0, ripng_if_delete_hook);
|
||||
|
||||
/* Install interface node. */
|
||||
install_node(&interface_node, interface_config_write);
|
||||
install_node(&interface_node);
|
||||
if_cmd_init();
|
||||
if_zapi_callbacks(ripng_ifp_create, ripng_ifp_up,
|
||||
ripng_ifp_down, ripng_ifp_destroy);
|
||||
|
@ -2434,10 +2434,12 @@ static int ripng_config_write(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int ripng_config_write(struct vty *vty);
|
||||
/* RIPng node structure. */
|
||||
static struct cmd_node cmd_ripng_node = {
|
||||
.node = RIPNG_NODE,
|
||||
.prompt = "%s(config-router)# ",
|
||||
.config_write = ripng_config_write,
|
||||
};
|
||||
|
||||
static void ripng_distribute_update(struct distribute_ctx *ctx,
|
||||
@ -2851,7 +2853,7 @@ void ripng_vrf_terminate(void)
|
||||
void ripng_init(void)
|
||||
{
|
||||
/* Install RIPNG_NODE. */
|
||||
install_node(&cmd_ripng_node, ripng_config_write);
|
||||
install_node(&cmd_ripng_node);
|
||||
|
||||
/* Install ripng commands. */
|
||||
install_element(VIEW_NODE, &show_ipv6_ripng_cmd);
|
||||
|
@ -1473,11 +1473,12 @@ DEFUN_NOSH (show_debugging_static,
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = static_config_write_debug,
|
||||
};
|
||||
|
||||
void static_vty_init(void)
|
||||
{
|
||||
install_node(&debug_node, static_config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(CONFIG_NODE, &ip_mroute_dist_cmd);
|
||||
|
||||
|
@ -179,23 +179,23 @@ static void test_init(void)
|
||||
yang_init(true);
|
||||
nb_init(master, NULL, 0);
|
||||
|
||||
install_node(&bgp_node, NULL);
|
||||
install_node(&rip_node, NULL);
|
||||
install_node(&interface_node, NULL);
|
||||
install_node(&rmap_node, NULL);
|
||||
install_node(&zebra_node, NULL);
|
||||
install_node(&bgp_vpnv4_node, NULL);
|
||||
install_node(&bgp_ipv4_node, NULL);
|
||||
install_node(&bgp_ipv4m_node, NULL);
|
||||
install_node(&bgp_ipv6_node, NULL);
|
||||
install_node(&bgp_ipv6m_node, NULL);
|
||||
install_node(&ospf_node, NULL);
|
||||
install_node(&ripng_node, NULL);
|
||||
install_node(&ospf6_node, NULL);
|
||||
install_node(&keychain_node, NULL);
|
||||
install_node(&keychain_key_node, NULL);
|
||||
install_node(&isis_node, NULL);
|
||||
install_node(&vty_node, NULL);
|
||||
install_node(&bgp_node);
|
||||
install_node(&rip_node);
|
||||
install_node(&interface_node);
|
||||
install_node(&rmap_node);
|
||||
install_node(&zebra_node);
|
||||
install_node(&bgp_vpnv4_node);
|
||||
install_node(&bgp_ipv4_node);
|
||||
install_node(&bgp_ipv4m_node);
|
||||
install_node(&bgp_ipv6_node);
|
||||
install_node(&bgp_ipv6m_node);
|
||||
install_node(&ospf_node);
|
||||
install_node(&ripng_node);
|
||||
install_node(&ospf6_node);
|
||||
install_node(&keychain_node);
|
||||
install_node(&keychain_key_node);
|
||||
install_node(&isis_node);
|
||||
install_node(&vty_node);
|
||||
|
||||
test_init_cmd();
|
||||
|
||||
|
@ -747,23 +747,26 @@ static int vrrp_config_write_interface(struct vty *vty)
|
||||
static struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = vrrp_config_write_interface,
|
||||
};
|
||||
|
||||
static struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = vrrp_config_write_debug,
|
||||
};
|
||||
|
||||
static struct cmd_node vrrp_node = {
|
||||
.node = VRRP_NODE,
|
||||
.prompt = "",
|
||||
.config_write = vrrp_config_write_global,
|
||||
};
|
||||
|
||||
void vrrp_vty_init(void)
|
||||
{
|
||||
install_node(&debug_node, vrrp_config_write_debug);
|
||||
install_node(&interface_node, vrrp_config_write_interface);
|
||||
install_node(&vrrp_node, vrrp_config_write_global);
|
||||
install_node(&debug_node);
|
||||
install_node(&interface_node);
|
||||
install_node(&vrrp_node);
|
||||
if_cmd_init();
|
||||
|
||||
install_element(VIEW_NODE, &vrrp_vrid_show_cmd);
|
||||
|
@ -3821,54 +3821,54 @@ void vtysh_init_vty(void)
|
||||
cmd_variable_handler_register(vtysh_var_handler);
|
||||
|
||||
/* Install nodes. */
|
||||
install_node(&bgp_node, NULL);
|
||||
install_node(&rip_node, NULL);
|
||||
install_node(&interface_node, NULL);
|
||||
install_node(&pw_node, NULL);
|
||||
install_node(&link_params_node, NULL);
|
||||
install_node(&vrf_node, NULL);
|
||||
install_node(&nh_group_node, NULL);
|
||||
install_node(&rmap_node, NULL);
|
||||
install_node(&pbr_map_node, NULL);
|
||||
install_node(&zebra_node, NULL);
|
||||
install_node(&bgp_vpnv4_node, NULL);
|
||||
install_node(&bgp_vpnv6_node, NULL);
|
||||
install_node(&bgp_flowspecv4_node, NULL);
|
||||
install_node(&bgp_flowspecv6_node, NULL);
|
||||
install_node(&bgp_ipv4_node, NULL);
|
||||
install_node(&bgp_ipv4m_node, NULL);
|
||||
install_node(&bgp_ipv4l_node, NULL);
|
||||
install_node(&bgp_ipv6_node, NULL);
|
||||
install_node(&bgp_ipv6m_node, NULL);
|
||||
install_node(&bgp_ipv6l_node, NULL);
|
||||
install_node(&bgp_vrf_policy_node, NULL);
|
||||
install_node(&bgp_evpn_node, NULL);
|
||||
install_node(&bgp_evpn_vni_node, NULL);
|
||||
install_node(&bgp_vnc_defaults_node, NULL);
|
||||
install_node(&bgp_vnc_nve_group_node, NULL);
|
||||
install_node(&bgp_vnc_l2_group_node, NULL);
|
||||
install_node(&ospf_node, NULL);
|
||||
install_node(&eigrp_node, NULL);
|
||||
install_node(&babel_node, NULL);
|
||||
install_node(&ripng_node, NULL);
|
||||
install_node(&ospf6_node, NULL);
|
||||
install_node(&ldp_node, NULL);
|
||||
install_node(&ldp_ipv4_node, NULL);
|
||||
install_node(&ldp_ipv6_node, NULL);
|
||||
install_node(&ldp_ipv4_iface_node, NULL);
|
||||
install_node(&ldp_ipv6_iface_node, NULL);
|
||||
install_node(&ldp_l2vpn_node, NULL);
|
||||
install_node(&ldp_pseudowire_node, NULL);
|
||||
install_node(&keychain_node, NULL);
|
||||
install_node(&keychain_key_node, NULL);
|
||||
install_node(&isis_node, NULL);
|
||||
install_node(&openfabric_node, NULL);
|
||||
install_node(&vty_node, NULL);
|
||||
install_node(&rpki_node, NULL);
|
||||
install_node(&bmp_node, NULL);
|
||||
install_node(&bgp_node);
|
||||
install_node(&rip_node);
|
||||
install_node(&interface_node);
|
||||
install_node(&pw_node);
|
||||
install_node(&link_params_node);
|
||||
install_node(&vrf_node);
|
||||
install_node(&nh_group_node);
|
||||
install_node(&rmap_node);
|
||||
install_node(&pbr_map_node);
|
||||
install_node(&zebra_node);
|
||||
install_node(&bgp_vpnv4_node);
|
||||
install_node(&bgp_vpnv6_node);
|
||||
install_node(&bgp_flowspecv4_node);
|
||||
install_node(&bgp_flowspecv6_node);
|
||||
install_node(&bgp_ipv4_node);
|
||||
install_node(&bgp_ipv4m_node);
|
||||
install_node(&bgp_ipv4l_node);
|
||||
install_node(&bgp_ipv6_node);
|
||||
install_node(&bgp_ipv6m_node);
|
||||
install_node(&bgp_ipv6l_node);
|
||||
install_node(&bgp_vrf_policy_node);
|
||||
install_node(&bgp_evpn_node);
|
||||
install_node(&bgp_evpn_vni_node);
|
||||
install_node(&bgp_vnc_defaults_node);
|
||||
install_node(&bgp_vnc_nve_group_node);
|
||||
install_node(&bgp_vnc_l2_group_node);
|
||||
install_node(&ospf_node);
|
||||
install_node(&eigrp_node);
|
||||
install_node(&babel_node);
|
||||
install_node(&ripng_node);
|
||||
install_node(&ospf6_node);
|
||||
install_node(&ldp_node);
|
||||
install_node(&ldp_ipv4_node);
|
||||
install_node(&ldp_ipv6_node);
|
||||
install_node(&ldp_ipv4_iface_node);
|
||||
install_node(&ldp_ipv6_iface_node);
|
||||
install_node(&ldp_l2vpn_node);
|
||||
install_node(&ldp_pseudowire_node);
|
||||
install_node(&keychain_node);
|
||||
install_node(&keychain_key_node);
|
||||
install_node(&isis_node);
|
||||
install_node(&openfabric_node);
|
||||
install_node(&vty_node);
|
||||
install_node(&rpki_node);
|
||||
install_node(&bmp_node);
|
||||
#if HAVE_BFDD > 0
|
||||
install_node(&bfd_node, NULL);
|
||||
install_node(&bfd_peer_node, NULL);
|
||||
install_node(&bfd_node);
|
||||
install_node(&bfd_peer_node);
|
||||
#endif /* HAVE_BFDD */
|
||||
|
||||
struct cmd_node *node;
|
||||
|
@ -471,9 +471,11 @@ DEFPY (debug_zebra_nexthop,
|
||||
}
|
||||
|
||||
/* Debug node. */
|
||||
static int config_write_debug(struct vty *vty);
|
||||
struct cmd_node debug_node = {
|
||||
.node = DEBUG_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_debug,
|
||||
};
|
||||
|
||||
static int config_write_debug(struct vty *vty)
|
||||
@ -589,7 +591,7 @@ void zebra_debug_init(void)
|
||||
zebra_debug_nht = 0;
|
||||
zebra_debug_nexthop = 0;
|
||||
|
||||
install_node(&debug_node, config_write_debug);
|
||||
install_node(&debug_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_debugging_zebra_cmd);
|
||||
|
||||
|
@ -368,9 +368,10 @@ static int fpm_write_config(struct vty *vty)
|
||||
return written;
|
||||
}
|
||||
|
||||
struct cmd_node fpm_node = {
|
||||
static struct cmd_node fpm_node = {
|
||||
.node = VTY_NODE,
|
||||
.prompt = "",
|
||||
.config_write = fpm_write_config,
|
||||
};
|
||||
|
||||
/*
|
||||
@ -1102,7 +1103,7 @@ static int fpm_nl_new(struct thread_master *tm)
|
||||
if (IS_ZEBRA_DEBUG_DPLANE)
|
||||
zlog_debug("%s register status: %d", prov_name, rv);
|
||||
|
||||
install_node(&fpm_node, fpm_write_config);
|
||||
install_node(&fpm_node);
|
||||
install_element(ENABLE_NODE, &fpm_show_counters_cmd);
|
||||
install_element(ENABLE_NODE, &fpm_show_counters_json_cmd);
|
||||
install_element(ENABLE_NODE, &fpm_reset_counters_cmd);
|
||||
|
@ -1664,9 +1664,11 @@ static void interface_update_stats(void)
|
||||
#endif /* HAVE_NET_RT_IFLIST */
|
||||
}
|
||||
|
||||
static int if_config_write(struct vty *vty);
|
||||
struct cmd_node interface_node = {
|
||||
.node = INTERFACE_NODE,
|
||||
.prompt = "%s(config-if)# ",
|
||||
.config_write = if_config_write,
|
||||
};
|
||||
|
||||
#ifndef VTYSH_EXTRACT_PL
|
||||
@ -3315,8 +3317,8 @@ void zebra_if_init(void)
|
||||
hook_register_prio(if_del, 0, if_zebra_delete_hook);
|
||||
|
||||
/* Install configuration write function. */
|
||||
install_node(&interface_node, if_config_write);
|
||||
install_node(&link_params_node, NULL);
|
||||
install_node(&interface_node);
|
||||
install_node(&link_params_node);
|
||||
if_cmd_init();
|
||||
/*
|
||||
* This is *intentionally* setting this to NULL, signaling
|
||||
|
@ -1938,10 +1938,12 @@ 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 = {
|
||||
.node = ZEBRA_NODE,
|
||||
.prompt = "",
|
||||
.config_write = fpm_remote_srv_write,
|
||||
};
|
||||
|
||||
|
||||
@ -1979,7 +1981,7 @@ static int zfpm_init(struct thread_master *master)
|
||||
zfpm_stats_init(&zfpm_g->last_ivl_stats);
|
||||
zfpm_stats_init(&zfpm_g->cumulative_stats);
|
||||
|
||||
install_node(&zebra_node, fpm_remote_srv_write);
|
||||
install_node(&zebra_node);
|
||||
install_element(ENABLE_NODE, &show_zebra_fpm_stats_cmd);
|
||||
install_element(ENABLE_NODE, &clear_zebra_fpm_stats_cmd);
|
||||
install_element(CONFIG_NODE, &fpm_remote_ip_cmd);
|
||||
|
@ -449,10 +449,12 @@ DEFUN (no_mpls_label_global_block,
|
||||
return zebra_mpls_global_block(vty, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
static int zebra_mpls_config(struct vty *vty);
|
||||
/* MPLS node for MPLS LSP. */
|
||||
static struct cmd_node mpls_node = {
|
||||
.node = MPLS_NODE,
|
||||
.prompt = "",
|
||||
.config_write = zebra_mpls_config,
|
||||
};
|
||||
|
||||
/* MPLS VTY. */
|
||||
@ -460,7 +462,7 @@ void zebra_mpls_vty_init(void)
|
||||
{
|
||||
install_element(VIEW_NODE, &show_mpls_status_cmd);
|
||||
|
||||
install_node(&mpls_node, zebra_mpls_config);
|
||||
install_node(&mpls_node);
|
||||
|
||||
install_element(CONFIG_NODE, &mpls_transit_lsp_cmd);
|
||||
install_element(CONFIG_NODE, &no_mpls_transit_lsp_cmd);
|
||||
|
@ -547,14 +547,16 @@ static int zebra_pw_config(struct vty *vty)
|
||||
return write;
|
||||
}
|
||||
|
||||
static int zebra_pw_config(struct vty *vty);
|
||||
static struct cmd_node pw_node = {
|
||||
.node = PW_NODE,
|
||||
.prompt = "%s(config-pw)# ",
|
||||
.config_write = zebra_pw_config,
|
||||
};
|
||||
|
||||
void zebra_pw_vty_init(void)
|
||||
{
|
||||
install_node(&pw_node, zebra_pw_config);
|
||||
install_node(&pw_node);
|
||||
install_default(PW_NODE);
|
||||
|
||||
install_element(CONFIG_NODE, &pseudowire_if_cmd);
|
||||
|
@ -3478,30 +3478,38 @@ DEFUN_HIDDEN (show_frr,
|
||||
}
|
||||
|
||||
/* IP node for static routes. */
|
||||
static int zebra_ip_config(struct vty *vty);
|
||||
static struct cmd_node ip_node = {
|
||||
.node = IP_NODE,
|
||||
.prompt = "",
|
||||
.config_write = zebra_ip_config,
|
||||
};
|
||||
static int config_write_protocol(struct vty *vty);
|
||||
static struct cmd_node protocol_node = {
|
||||
.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 = {
|
||||
.node = TABLE_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_table,
|
||||
};
|
||||
static int config_write_forwarding(struct vty *vty);
|
||||
static struct cmd_node forwarding_node = {
|
||||
.node = FORWARDING_NODE,
|
||||
.prompt = "",
|
||||
.config_write = config_write_forwarding,
|
||||
};
|
||||
|
||||
/* Route VTY. */
|
||||
void zebra_vty_init(void)
|
||||
{
|
||||
/* Install configuration write function. */
|
||||
install_node(&table_node, config_write_table);
|
||||
install_node(&forwarding_node, config_write_forwarding);
|
||||
install_node(&table_node);
|
||||
install_node(&forwarding_node);
|
||||
|
||||
install_element(VIEW_NODE, &show_ip_forwarding_cmd);
|
||||
install_element(CONFIG_NODE, &ip_forwarding_cmd);
|
||||
@ -3515,8 +3523,8 @@ void zebra_vty_init(void)
|
||||
/* Route-map */
|
||||
zebra_route_map_init();
|
||||
|
||||
install_node(&ip_node, zebra_ip_config);
|
||||
install_node(&protocol_node, config_write_protocol);
|
||||
install_node(&ip_node);
|
||||
install_node(&protocol_node);
|
||||
|
||||
install_element(CONFIG_NODE, &allow_external_route_update_cmd);
|
||||
install_element(CONFIG_NODE, &no_allow_external_route_update_cmd);
|
||||
|
Loading…
Reference in New Issue
Block a user