diff options
author | Benoît Ganne <bganne@cisco.com> | 2019-01-21 17:41:25 +0100 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-01-31 22:08:54 +0000 |
commit | 362456a9bdc5ffc440bf776c3685ba81b8513f6e (patch) | |
tree | db06209bef7bd0fbf5dceb94c2126a782f369040 /src/vlib/main.c | |
parent | 35467f112acb21fe1ea287c7d8794b0859f149c0 (diff) |
Add 'show vlib graphviz' command
Add a new command to dump vlib graph as graphviz/dot file
Change-Id: I43fc072cff8153ac500e5fbc6641a3705c2e995e
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r-- | src/vlib/main.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c index c0ab8e129b9..c5153abc0cc 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -2126,7 +2126,9 @@ pcap_dispatch_trace_command_internal (vlib_main_t * vm, } pm->n_packets_to_capture = max; } - else if (unformat (line_input, "file %s", &filename)) + else + if (unformat + (line_input, "file %U", unformat_vlib_tmpfile, &filename)) { if (vm->dispatch_pcap_enable) { @@ -2135,21 +2137,6 @@ pcap_dispatch_trace_command_internal (vlib_main_t * vm, errorFlag = 1; break; } - - /* Brain-police user path input */ - if (strstr ((char *) filename, "..") - || index ((char *) filename, '/')) - { - vlib_cli_output (vm, "illegal characters in filename '%s'", - filename); - vlib_cli_output (vm, "Hint: .. and / are not allowed."); - vec_free (filename); - errorFlag = 1; - break; - } - - chroot_filename = format (0, "/tmp/%s%c", filename, 0); - vec_free (filename); } else if (unformat (line_input, "status")) { |