diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-10-12 17:05:51 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-10-18 16:35:11 +0200 |
commit | 7526a1820ed47a959cb5f65d3ebef3cf2b903258 (patch) | |
tree | 7d40da2870f2961bbe0676281e7006f3db644420 /vtysh/vtysh_config.c | |
parent | bgpd, lib: memory cleanups for valgrind, plus debug changes (diff) | |
download | frr-7526a1820ed47a959cb5f65d3ebef3cf2b903258.tar.xz frr-7526a1820ed47a959cb5f65d3ebef3cf2b903258.zip |
vtysh: refactor vtysh_client_{config,execute}
Triggered by a bugreport / patch by Gautam Kumar <gauta@amazon.com>,
this is a full rewrite vtysh_client_{config,execute}. (The patch didn't
quite apply anymore.)
vtysh_client_run() now has a buffering implementation that can be read
without losing one's sanity and/or requiring alcoholic beverages.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh/vtysh_config.c')
-rw-r--r-- | vtysh/vtysh_config.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c index 4b0a39084..67fc0d77b 100644 --- a/vtysh/vtysh_config.c +++ b/vtysh/vtysh_config.c @@ -144,7 +144,7 @@ config_add_line_uniq (struct list *config, const char *line) listnode_add_sort (config, XSTRDUP (MTYPE_VTYSH_CONFIG_LINE, line)); } -static void +void vtysh_config_parse_line (const char *line) { char c; @@ -300,29 +300,6 @@ vtysh_config_parse_line (const char *line) } } -void -vtysh_config_parse (char *line) -{ - char *begin; - char *pnt; - - begin = pnt = line; - - while (*pnt != '\0') - { - if (*pnt == '\n') - { - *pnt++ = '\0'; - vtysh_config_parse_line (begin); - begin = pnt; - } - else - { - pnt++; - } - } -} - /* Macro to check delimiter is needed between each configuration line * or not. */ #define NO_DELIMITER(I) \ |