summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-09-08 21:46:23 +0200
committerDavid Lamparter <equinox@diac24.net>2020-04-16 12:53:00 +0200
commit62b346eefa1b9e09c9372f5b6376e1bca4162015 (patch)
tree2e3bc16d1d0765ab033c7ffd24ca58b3b5d35168 /zebra
parent4c749d99dcdc7f0d811d0bbd2858b87f41e4feba (diff)
*: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.) Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/debug.c7
-rw-r--r--zebra/interface.c10
-rw-r--r--zebra/zebra_fpm.c6
-rw-r--r--zebra/zebra_mpls_vty.c6
-rw-r--r--zebra/zebra_pw.c4
-rw-r--r--zebra/zebra_vty.c28
6 files changed, 46 insertions, 15 deletions
diff --git a/zebra/debug.c b/zebra/debug.c
index 68f6b69305..6e177f8398 100644
--- a/zebra/debug.c
+++ b/zebra/debug.c
@@ -471,8 +471,11 @@ DEFPY (debug_zebra_nexthop,
}
/* Debug node. */
-struct cmd_node debug_node = {DEBUG_NODE, "", /* Debug node has no interface. */
- 1};
+struct cmd_node debug_node = {
+ .node = DEBUG_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
static int config_write_debug(struct vty *vty)
{
diff --git a/zebra/interface.c b/zebra/interface.c
index 59cbfc6854..520d6a3360 100644
--- a/zebra/interface.c
+++ b/zebra/interface.c
@@ -1664,7 +1664,11 @@ static void interface_update_stats(void)
#endif /* HAVE_NET_RT_IFLIST */
}
-struct cmd_node interface_node = {INTERFACE_NODE, "%s(config-if)# ", 1};
+struct cmd_node interface_node = {
+ .node = INTERFACE_NODE,
+ .prompt = "%s(config-if)# ",
+ .vtysh = 1,
+};
#ifndef VTYSH_EXTRACT_PL
#include "zebra/interface_clippy.c"
@@ -2074,7 +2078,9 @@ DEFUN (no_bandwidth_if,
struct cmd_node link_params_node = {
- LINK_PARAMS_NODE, "%s(config-link-params)# ", 1,
+ .node = LINK_PARAMS_NODE,
+ .prompt = "%s(config-link-params)# ",
+ .vtysh = 1,
};
static void link_param_cmd_set_uint32(struct interface *ifp, uint32_t *field,
diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c
index 10cdf49d12..d0e1933172 100644
--- a/zebra/zebra_fpm.c
+++ b/zebra/zebra_fpm.c
@@ -1939,7 +1939,11 @@ static int fpm_remote_srv_write(struct vty *vty)
/* Zebra node */
-static struct cmd_node zebra_node = {ZEBRA_NODE, "", 1};
+static struct cmd_node zebra_node = {
+ .node = ZEBRA_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
/**
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c
index 796aa3f666..78a3110eae 100644
--- a/zebra/zebra_mpls_vty.c
+++ b/zebra/zebra_mpls_vty.c
@@ -450,7 +450,11 @@ DEFUN (no_mpls_label_global_block,
}
/* MPLS node for MPLS LSP. */
-static struct cmd_node mpls_node = {MPLS_NODE, "", 1};
+static struct cmd_node mpls_node = {
+ .node = MPLS_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
/* MPLS VTY. */
void zebra_mpls_vty_init(void)
diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c
index 610a052c31..d16082c515 100644
--- a/zebra/zebra_pw.c
+++ b/zebra/zebra_pw.c
@@ -548,7 +548,9 @@ static int zebra_pw_config(struct vty *vty)
}
static struct cmd_node pw_node = {
- PW_NODE, "%s(config-pw)# ", 1,
+ .node = PW_NODE,
+ .prompt = "%s(config-pw)# ",
+ .vtysh = 1,
};
void zebra_pw_vty_init(void)
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index ef3dc9808f..d663e4c5a9 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -3478,15 +3478,27 @@ DEFUN_HIDDEN (show_frr,
}
/* IP node for static routes. */
-static struct cmd_node ip_node = {IP_NODE, "", 1};
-static struct cmd_node protocol_node = {PROTOCOL_NODE, "", 1};
+static struct cmd_node ip_node = {
+ .node = IP_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
+static struct cmd_node protocol_node = {
+ .node = PROTOCOL_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
/* table node for routing tables. */
-static struct cmd_node table_node = {TABLE_NODE,
- "", /* This node has no interface. */
- 1};
-static struct cmd_node forwarding_node = {FORWARDING_NODE,
- "", /* This node has no interface. */
- 1};
+static struct cmd_node table_node = {
+ .node = TABLE_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
+static struct cmd_node forwarding_node = {
+ .node = FORWARDING_NODE,
+ .prompt = "",
+ .vtysh = 1,
+};
/* Route VTY. */
void zebra_vty_init(void)