babeld: justify "running-config" meaning in CLI
The primary focus of this commit is to make "show running-config"
command display more current configuration, including some of the bits
previously seen in the output of "show babel running-config". Besides
that, the following commands were renamed for consistency with the
syntax of other components:
"debug *" to "debug babel *" (and moved to top level)
"show babel running-config" to "show babel parameters"
* babel_interface.c
* show_babel_running_config(): rename to show_babel_parameters(),
update syntax pattern, don't call show_babeld_configuration()
* babel_if_init(): update respectively
* babel_enable_if_config_write(): new VTY helper for static
babel_enable_if
* babel_interface.h: add extern declaration
* babel_main.c: unset all debug options by default
* show_babel_main_configuration(): remove debug options decoder
* babel_zebra.c
* babel_debug(): rename to debug_babel(), update syntax pattern
* no_babel_debug(): rename to no_debug_babel(), update syntax pattern
* babelz_zebra_init(): update respectively
* debug_babel_config_write() new VTY helper for static debug_type
* babel_zebra.h: add extern declaration
* babeld.c
* babel_config_write(): add the code to output "debug babel *",
"router babel", "redistribute *" and "network *" statements
* show_babeld_configuration(): dismiss
* babeld.h: remove extern declaration
* babeld.texi: update for renamed commands
* babeld.conf.sample: idem, add debug statements block
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c
index 588fea7..404be7a 100644
--- a/babeld/babel_interface.c
+++ b/babeld/babel_interface.c
@@ -877,9 +877,9 @@
return CMD_SUCCESS;
}
-DEFUN (show_babel_running_config,
- show_babel_running_config_cmd,
- "show babel running-config",
+DEFUN (show_babel_parameters,
+ show_babel_parameters_cmd,
+ "show babel parameters",
SHOW_STR
IP_STR
"Babel information\n"
@@ -888,7 +888,6 @@
{
vty_out(vty, " -- Babel running configuration --%s", VTY_NEWLINE);
show_babel_main_configuration(vty);
- show_babeld_configuration(vty);
vty_out(vty, " -- distribution lists --%s", VTY_NEWLINE);
config_show_distribute(vty);
@@ -931,8 +930,8 @@
install_element(ENABLE_NODE, &show_babel_neighbour_cmd);
install_element(VIEW_NODE, &show_babel_database_cmd);
install_element(ENABLE_NODE, &show_babel_database_cmd);
- install_element(VIEW_NODE, &show_babel_running_config_cmd);
- install_element(ENABLE_NODE, &show_babel_running_config_cmd);
+ install_element(VIEW_NODE, &show_babel_parameters_cmd);
+ install_element(ENABLE_NODE, &show_babel_parameters_cmd);
}
/* hooks: functions called respectively when struct interface is
@@ -980,6 +979,22 @@
return write;
}
+/* Output a "network" statement line for each of the enabled interfaces. */
+int
+babel_enable_if_config_write (struct vty * vty)
+{
+ unsigned int i, lines = 0;
+ char *str;
+
+ for (i = 0; i < vector_active (babel_enable_if); i++)
+ if ((str = vector_slot (babel_enable_if, i)) != NULL)
+ {
+ vty_out (vty, " network %s%s", str, VTY_NEWLINE);
+ lines++;
+ }
+ return lines;
+}
+
/* functions to allocate or free memory for a babel_interface_nfo, filling
needed fields */
static babel_interface_nfo *