diff options
Diffstat (limited to 'vtysh/vtysh_config.c')
-rw-r--r-- | vtysh/vtysh_config.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index 15938f43..aed3a91c 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -47,19 +47,19 @@ struct config struct list *config_top; -int -line_cmp (char *c1, char *c2) +static int +line_cmp (const char *c1, const char *c2) { return strcmp (c1, c2); } -void +static void line_del (char *line) { XFREE (MTYPE_VTYSH_CONFIG_LINE, line); } -struct config * +static struct config * config_new () { struct config *config; @@ -67,13 +67,13 @@ config_new () return config; } -int +static int config_cmp (struct config *c1, struct config *c2) { return strcmp (c1->name, c2->name); } -void +static void config_del (struct config* config) { list_delete (config->line); @@ -82,7 +82,7 @@ config_del (struct config* config) XFREE (MTYPE_VTYSH_CONFIG, config); } -struct config * +static struct config * config_get (int index, const char *line) { struct config *config; @@ -121,13 +121,13 @@ config_get (int index, const char *line) return config; } -void +static void config_add_line (struct list *config, const char *line) { listnode_add (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line)); } -void +static void config_add_line_uniq (struct list *config, const char *line) { struct listnode *node, *nnode; @@ -141,7 +141,7 @@ config_add_line_uniq (struct list *config, const char *line) listnode_add_sort (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line)); } -void +static void vtysh_config_parse_line (const char *line) { char c; @@ -285,12 +285,19 @@ vtysh_config_parse (char *line) /* Macro to check delimiter is needed between each configuration line * or not. */ -#define NO_DELIMITER(I) \ - ((I) == ACCESS_NODE || (I) == PREFIX_NODE || (I) == IP_NODE \ - || (I) == AS_LIST_NODE || (I) == COMMUNITY_LIST_NODE || \ - (I) == ACCESS_IPV6_NODE || (I) == PREFIX_IPV6_NODE \ - || (I) == SERVICE_NODE || (I) == FORWARDING_NODE || (I) == DEBUG_NODE \ - || (I) == AAA_NODE) +#define NO_DELIMITER(I) ( \ + (I) == ACCESS_NODE || \ + (I) == PREFIX_NODE || \ + (I) == IP_NODE || \ + (I) == AS_LIST_NODE || \ + (I) == COMMUNITY_LIST_NODE || \ + (I) == ACCESS_IPV6_NODE || \ + (I) == PREFIX_IPV6_NODE || \ + (I) == SERVICE_NODE || \ + (I) == FORWARDING_NODE || \ + (I) == DEBUG_NODE || \ + (I) == AAA_NODE || \ + 0 ) /* Display configuration to file pointer. */ void @@ -365,7 +372,7 @@ vtysh_read_file (FILE *confp) vtysh_execute_no_pager ("end"); vtysh_execute_no_pager ("disable"); - vty_close (vty); + vty_close_final(vty); if (ret != CMD_SUCCESS) { @@ -396,7 +403,7 @@ vtysh_read_config (char *config_default_dir) vtysh_read_file (confp); fclose (confp); - host_config_set (config_default_dir); + cmd_host_config_set (config_default_dir); return (0); } |