};
static struct cmd_node enable_node = {
- ENABLE_NODE, "%s# ",
+ .name = "enable",
+ .node = ENABLE_NODE,
+ .prompt = "%s# ",
+ .node_exit = root_on_exit,
};
- static struct cmd_node config_node = {CONFIG_NODE, "%s(config)# ", 1};
+ static int config_write_host(struct vty *vty);
+ static struct cmd_node config_node = {
+ .name = "config",
+ .node = CONFIG_NODE,
+ .parent_node = ENABLE_NODE,
+ .prompt = "%s(config)# ",
+ .config_write = config_write_host,
+ .node_exit = vty_config_node_exit,
+ };
-static const struct facility_map {
- int facility;
- const char *name;
- size_t match;
-} syslog_facilities[] = {
- {LOG_KERN, "kern", 1},
- {LOG_USER, "user", 2},
- {LOG_MAIL, "mail", 1},
- {LOG_DAEMON, "daemon", 1},
- {LOG_AUTH, "auth", 1},
- {LOG_SYSLOG, "syslog", 1},
- {LOG_LPR, "lpr", 2},
- {LOG_NEWS, "news", 1},
- {LOG_UUCP, "uucp", 2},
- {LOG_CRON, "cron", 1},
-#ifdef LOG_FTP
- {LOG_FTP, "ftp", 1},
-#endif
- {LOG_LOCAL0, "local0", 6},
- {LOG_LOCAL1, "local1", 6},
- {LOG_LOCAL2, "local2", 6},
- {LOG_LOCAL3, "local3", 6},
- {LOG_LOCAL4, "local4", 6},
- {LOG_LOCAL5, "local5", 6},
- {LOG_LOCAL6, "local6", 6},
- {LOG_LOCAL7, "local7", 6},
- {0, NULL, 0},
-};
-
-static const char *facility_name(int facility)
-{
- const struct facility_map *fm;
-
- for (fm = syslog_facilities; fm->name; fm++)
- if (fm->facility == facility)
- return fm->name;
- return "";
-}
-
-static int facility_match(const char *str)
-{
- const struct facility_map *fm;
-
- for (fm = syslog_facilities; fm->name; fm++)
- if (!strncmp(str, fm->name, fm->match))
- return fm->facility;
- return -1;
-}
-
-static int level_match(const char *s)
-{
- int level;
-
- for (level = 0; zlog_priority[level] != NULL; level++)
- if (!strncmp(s, zlog_priority[level], 2))
- return level;
- return ZLOG_DISABLED;
-}
-
/* This is called from main when a daemon is invoked with -v or --version. */
void print_version(const char *progname)
{