re-enable config file handling of vty layer
diff --git a/openbsc/src/vty/command.c b/openbsc/src/vty/command.c
index e9b3652..4d445ae 100644
--- a/openbsc/src/vty/command.c
+++ b/openbsc/src/vty/command.c
@@ -34,6 +34,7 @@
#include <ctype.h>
#include <time.h>
#include <sys/time.h>
+#include <sys/stat.h>
//#include "memory.h"
//#include "log.h"
@@ -2216,7 +2217,6 @@
return (*matched_element->func) (matched_element, vty, argc, argv);
}
-#if 0
/* Configration make from file. */
int config_from_file(struct vty *vty, FILE * fp)
{
@@ -2248,7 +2248,6 @@
}
return CMD_SUCCESS;
}
-#endif
/* Configration from terminal */
DEFUN(config_terminal,
@@ -2445,7 +2444,6 @@
return CMD_SUCCESS;
}
-#if 0
/* Write current configuration into file. */
DEFUN(config_write_file,
config_write_file_cmd,
@@ -2549,7 +2547,7 @@
if (chmod(config_file, CONFIGFILE_MASK) != 0) {
vty_out(vty, "Can't chmod configuration file %s: %s (%d).%s",
- config_file, safe_strerror(errno), errno, VTY_NEWLINE);
+ config_file, strerror(errno), errno, VTY_NEWLINE);
return CMD_WARNING;
}
@@ -2640,7 +2638,6 @@
return CMD_SUCCESS;
}
-#endif
/* Hostname configuration */
DEFUN(config_hostname,
@@ -3329,13 +3326,11 @@
install_element(node, &config_help_cmd);
install_element(node, &config_list_cmd);
-#if 0
install_element(node, &config_write_terminal_cmd);
install_element(node, &config_write_file_cmd);
install_element(node, &config_write_memory_cmd);
install_element(node, &config_write_cmd);
install_element(node, &show_running_config_cmd);
-#endif
}
/* Initialize command interface. Install basic nodes and commands. */
@@ -3379,9 +3374,9 @@
install_default(ENABLE_NODE);
install_element(ENABLE_NODE, &config_disable_cmd);
install_element(ENABLE_NODE, &config_terminal_cmd);
- //install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd);
+ install_element (ENABLE_NODE, ©_runningconfig_startupconfig_cmd);
}
- //install_element (ENABLE_NODE, &show_startup_config_cmd);
+ install_element (ENABLE_NODE, &show_startup_config_cmd);
install_element(ENABLE_NODE, &show_version_cmd);
if (terminal) {