summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-09-08 22:31:43 +0200
committerDavid Lamparter <equinox@diac24.net>2020-04-16 12:53:00 +0200
commit612c2c15d86e0e5c7e35f1a9a1491f90f365b93c (patch)
tree5fd4cb67296f7748d26a420ad6357615dcd3b382 /ldpd
parent*: remove cmd_node->vtysh (diff)
downloadfrr-612c2c15d86e0e5c7e35f1a9a1491f90f365b93c.tar.xz
frr-612c2c15d86e0e5c7e35f1a9a1491f90f365b93c.zip
*: 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>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/ldp_debug.c5
-rw-r--r--ldpd/ldp_vty.h3
-rw-r--r--ldpd/ldp_vty_cmds.c16
-rw-r--r--ldpd/ldp_vty_conf.c8
4 files changed, 18 insertions, 14 deletions
diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c
index 77ec8c699..59d8676ec 100644
--- a/ldpd/ldp_debug.c
+++ b/ldpd/ldp_debug.c
@@ -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;
diff --git a/ldpd/ldp_vty.h b/ldpd/ldp_vty.h
index af5f1d561..f6ba8f8c9 100644
--- a/ldpd/ldp_vty.h
+++ b/ldpd/ldp_vty.h
@@ -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);
diff --git a/ldpd/ldp_vty_cmds.c b/ldpd/ldp_vty_cmds.c
index c10c6ae35..fc84c7f76 100644
--- a/ldpd/ldp_vty_cmds.c
+++ b/ldpd/ldp_vty_cmds.c
@@ -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);
diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c
index dcea6e892..69aa3220b 100644
--- a/ldpd/ldp_vty_conf.c
+++ b/ldpd/ldp_vty_conf.c
@@ -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;