diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2018-10-26 18:41:00 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-12-06 15:13:32 +0100 | 
| commit | ac4adef44127e5e6659abd735827ce699c469718 (patch) | |
| tree | 90b11e8366ef14802186f756636232c4e3774305 /lib/command.c | |
| parent | 96673e067d0c4d89cb3e6df44978853a6bda99ac (diff) | |
lib: new defaults logic
Since we've been writing out "frr version" and "frr defaults" for about
a year and a half now, we can now actually use them to manage defaults.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/command.c')
| -rw-r--r-- | lib/command.c | 17 | 
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/command.c b/lib/command.c index 9238ae412a..d2145d9f5a 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1575,18 +1575,6 @@ DEFUN (show_version,  	return CMD_SUCCESS;  } -/* "Set" version ... ignore version tags */ -DEFUN (frr_version_defaults, -       frr_version_defaults_cmd, -       "frr <version|defaults> LINE...", -       "FRRouting global parameters\n" -       "version configuration was written by\n" -       "set of configuration defaults used\n" -       "version string\n") -{ -	return CMD_SUCCESS; -} -  /* Help display function for all node. */  DEFUN (config_help,         config_help_cmd, @@ -1721,8 +1709,10 @@ static int vty_write_config(struct vty *vty)  		vty_out(vty, "!\n");  	} +	if (strcmp(frr_defaults_version(), FRR_VER_SHORT)) +		vty_out(vty, "! loaded from %s\n", frr_defaults_version());  	vty_out(vty, "frr version %s\n", FRR_VER_SHORT); -	vty_out(vty, "frr defaults %s\n", DFLT_NAME); +	vty_out(vty, "frr defaults %s\n", frr_defaults_profile());  	vty_out(vty, "!\n");  	for (i = 0; i < vector_active(cmdvec); i++) @@ -2941,7 +2931,6 @@ void cmd_init(int terminal)  	install_element(CONFIG_NODE, &no_hostname_cmd);  	install_element(CONFIG_NODE, &domainname_cmd);  	install_element(CONFIG_NODE, &no_domainname_cmd); -	install_element(CONFIG_NODE, &frr_version_defaults_cmd);  	if (terminal > 0) {  		install_element(CONFIG_NODE, &debug_memstats_cmd);  | 
