2 * Copyright (c) 2015 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 * cli.c: command line interface
18 * Copyright (c) 2008 Eliot Dresselhaus
20 * Permission is hereby granted, free of charge, to any person obtaining
21 * a copy of this software and associated documentation files (the
22 * "Software"), to deal in the Software without restriction, including
23 * without limitation the rights to use, copy, modify, merge, publish,
24 * distribute, sublicense, and/or sell copies of the Software, and to
25 * permit persons to whom the Software is furnished to do so, subject to
26 * the following conditions:
28 * The above copyright notice and this permission notice shall be
29 * included in all copies or substantial portions of the Software.
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 #include <vlib/vlib.h>
42 /* Root of all show commands. */
43 VLIB_CLI_COMMAND (vlib_cli_show_command, static) = {
45 .short_help = "Show commands",
48 /* Root of all clear commands. */
49 VLIB_CLI_COMMAND (vlib_cli_clear_command, static) = {
51 .short_help = "Clear commands",
54 /* Root of all set commands. */
55 VLIB_CLI_COMMAND (vlib_cli_set_command, static) = {
57 .short_help = "Set commands",
60 /* Root of all test commands. */
61 VLIB_CLI_COMMAND (vlib_cli_test_command, static) = {
63 .short_help = "Test commands",
66 /* Returns bitmap of commands which match key. */
68 vlib_cli_sub_command_match (vlib_cli_command_t * c, unformat_input_t * input)
72 vlib_cli_parse_position_t * p;
74 unformat_skip_white_space (input);
80 k = unformat_get_input (input);
89 case ' ': case '\t': case '\r': case '\n':
90 case UNFORMAT_END_OF_INPUT:
91 /* White space or end of input removes any non-white
92 matches that were before possible. */
93 if (i < vec_len (c->sub_command_positions)
94 && clib_bitmap_count_set_bits (match) > 1)
96 p = vec_elt_at_index (c->sub_command_positions, i);
97 for (n = 0; n < vec_len (p->bitmaps); n++)
98 match = clib_bitmap_andnot (match, p->bitmaps[n]);
103 unformat_put_input (input);
107 if (i >= vec_len (c->sub_command_positions))
110 clib_bitmap_free (match);
114 p = vec_elt_at_index (c->sub_command_positions, i);
115 if (vec_len (p->bitmaps) == 0)
119 if (n < 0 || n >= vec_len (p->bitmaps))
123 match = clib_bitmap_dup (p->bitmaps[n]);
125 match = clib_bitmap_and (match, p->bitmaps[n]);
127 if (clib_bitmap_is_zero (match))
135 /* Looks for string based sub-input formatted { SUB-INPUT }. */
136 static uword unformat_vlib_cli_sub_input (unformat_input_t * i, va_list * args)
138 unformat_input_t * sub_input = va_arg (*args, unformat_input_t *);
144 c = unformat_get_input (i);
148 case '\n': case '\r':
154 /* Put back paren. */
155 if (c != UNFORMAT_END_OF_INPUT)
156 unformat_put_input (i);
158 if (c == '{' && unformat (i, "%v", &s))
160 unformat_init_vector (sub_input, s);
169 static vlib_cli_command_t *
170 get_sub_command (vlib_cli_main_t * cm, vlib_cli_command_t * parent, u32 si)
172 vlib_cli_sub_command_t * s = vec_elt_at_index (parent->sub_commands, si);
173 return vec_elt_at_index (cm->commands, s->index);
176 static uword unformat_vlib_cli_sub_command (unformat_input_t * i, va_list * args)
178 vlib_main_t * vm = va_arg (*args, vlib_main_t *);
179 vlib_cli_command_t * c = va_arg (*args, vlib_cli_command_t *);
180 vlib_cli_command_t ** result = va_arg (*args, vlib_cli_command_t **);
181 vlib_cli_main_t * cm = &vm->cli_main;
182 uword * match_bitmap, is_unique, index;
185 vlib_cli_sub_rule_t * sr;
186 vlib_cli_parse_rule_t * r;
187 vec_foreach (sr, c->sub_rules)
190 r = vec_elt_at_index (cm->parse_rules, sr->rule_index);
191 vec_add2 (cm->parse_rule_data, d, 1);
192 vec_reset_length (d[0]);
194 d[0] = _vec_resize (d[0],
195 /* length increment */ 1,
197 /* header_bytes */ 0,
198 /* data align */ sizeof (uword));
199 if (unformat_user (i, r->unformat_function, vm, d[0]))
201 *result = vec_elt_at_index (cm->commands, sr->command_index);
207 match_bitmap = vlib_cli_sub_command_match (c, i);
208 is_unique = clib_bitmap_count_set_bits (match_bitmap) == 1;
212 index = clib_bitmap_first_set (match_bitmap);
213 *result = get_sub_command (cm, c, index);
215 clib_bitmap_free (match_bitmap);
220 static u8 * format_vlib_cli_command_help (u8 * s, va_list * args)
222 vlib_cli_command_t * c = va_arg (*args, vlib_cli_command_t *);
223 int is_long = va_arg (*args, int);
224 if (is_long && c->long_help)
225 s = format (s, "%s", c->long_help);
226 else if (c->short_help)
227 s = format (s, "%s", c->short_help);
229 s = format (s, "%v commands", c->path);
233 static u8 * format_vlib_cli_parse_rule_name (u8 * s, va_list * args)
235 vlib_cli_parse_rule_t * r = va_arg (*args, vlib_cli_parse_rule_t *);
236 return format (s, "<%U>", format_c_identifier, r->name);
239 static u8 * format_vlib_cli_path (u8 * s, va_list * args)
241 u8 * path = va_arg (*args, u8 *);
244 for (i = 0; i < vec_len (path); i++)
250 vec_add1 (s, '<'); /* start of <RULE> */
254 /* _ -> space in rules. */
255 vec_add1 (s, in_rule ? ' ' : '_');
261 vec_add1 (s, '>'); /* end of <RULE> */
268 vec_add1 (s, path[i]);
274 vec_add1 (s, '>'); /* terminate <RULE> */
279 static vlib_cli_command_t *
280 all_subs (vlib_cli_main_t * cm,
281 vlib_cli_command_t * subs,
284 vlib_cli_command_t * c = vec_elt_at_index (cm->commands, command_index);
285 vlib_cli_sub_command_t * sc;
286 vlib_cli_sub_rule_t * sr;
289 vec_add1 (subs, c[0]);
291 vec_foreach (sr, c->sub_rules)
292 subs = all_subs (cm, subs, sr->command_index);
293 vec_foreach (sc, c->sub_commands)
294 subs = all_subs (cm, subs, sc->index);
299 static clib_error_t *
300 vlib_cli_dispatch_sub_commands (vlib_main_t * vm,
301 vlib_cli_main_t * cm,
302 unformat_input_t * input,
303 uword parent_command_index)
305 vlib_cli_command_t * parent, * c;
306 clib_error_t * error = 0;
307 unformat_input_t sub_input;
309 uword is_main_dispatch = cm == &vm->cli_main;
311 parent = vec_elt_at_index (cm->commands, parent_command_index);
312 if (is_main_dispatch && unformat (input, "help"))
314 uword help_at_end_of_line, i;
316 help_at_end_of_line = unformat_check_input (input) == UNFORMAT_END_OF_INPUT;
320 if (unformat_user (input, unformat_vlib_cli_sub_command, vm, c, &parent))
323 else if (! unformat_check_input (input) == UNFORMAT_END_OF_INPUT)
330 /* help SUB-COMMAND => long format help.
331 "help" at end of line: show all commands. */
332 if (! help_at_end_of_line)
333 vlib_cli_output (vm, "%U", format_vlib_cli_command_help, c, /* is_long */ 1);
335 else if (vec_len (c->sub_commands) + vec_len (c->sub_rules) == 0)
336 vlib_cli_output (vm, "%v: no sub-commands", c->path);
340 vlib_cli_sub_command_t * sc;
341 vlib_cli_sub_rule_t * sr, * subs;
343 subs = vec_dup (c->sub_rules);
345 /* Add in rules if any. */
346 vec_foreach (sc, c->sub_commands)
348 vec_add2 (subs, sr, 1);
350 sr->command_index = sc->index;
354 vec_sort (subs, c1, c2, vec_cmp (c1->name, c2->name));
356 for (i = 0; i < vec_len (subs); i++)
358 vlib_cli_command_t * d;
359 vlib_cli_parse_rule_t * r;
361 d = vec_elt_at_index (cm->commands, subs[i].command_index);
362 r = subs[i].rule_index != ~0 ? vec_elt_at_index (cm->parse_rules, subs[i].rule_index) : 0;
367 format_vlib_cli_parse_rule_name, r,
368 format_vlib_cli_command_help, d, /* is_long */ 0);
373 format_vlib_cli_command_help, d, /* is_long */ 0);
380 else if (is_main_dispatch && (unformat (input, "choices") || unformat (input, "?")))
382 vlib_cli_command_t * sub, * subs;
384 subs = all_subs (cm, 0, parent_command_index);
385 vec_sort (subs, c1, c2, vec_cmp (c1->path, c2->path));
386 vec_foreach (sub, subs)
387 vlib_cli_output (vm, " %-40U %U",
388 format_vlib_cli_path, sub->path,
389 format_vlib_cli_command_help, sub, /* is_long */ 0);
393 else if (unformat (input, "comment %v", &string))
398 else if (unformat (input, "uncomment %U",
399 unformat_vlib_cli_sub_input, &sub_input))
401 error = vlib_cli_dispatch_sub_commands (vm, cm, &sub_input, parent_command_index);
402 unformat_free (&sub_input);
405 else if (unformat_user (input, unformat_vlib_cli_sub_command, vm, parent, &c))
407 unformat_input_t * si;
408 uword has_sub_commands = vec_len (c->sub_commands) + vec_len (c->sub_rules) > 0;
411 if (unformat_user (input, unformat_vlib_cli_sub_input, &sub_input))
414 if (has_sub_commands)
415 error = vlib_cli_dispatch_sub_commands (vm, cm, si, c - cm->commands);
417 if (has_sub_commands && ! error)
418 /* Found valid sub-command. */;
420 else if (c->function)
422 clib_error_t * c_error;
424 /* Skip white space for benefit of called function. */
425 unformat_skip_white_space (si);
427 if (unformat (si, "?"))
429 vlib_cli_output (vm, " %-40U %U",
430 format_vlib_cli_path, c->path,
431 format_vlib_cli_command_help, c, /* is_long */ 0);
436 vlib_worker_thread_barrier_sync(vm);
438 c_error = c->function (vm, si, c);
441 vlib_worker_thread_barrier_release(vm);
445 error = clib_error_return (0, "%v: %v", c->path, c_error->what);
446 clib_error_free (c_error);
447 /* Free sub input. */
455 /* Free any previous error. */
456 clib_error_free (error);
460 error = clib_error_return (0, "%v: no sub-commands", c->path);
462 /* Free sub input. */
474 return clib_error_return (0, "%v: unknown input `%U'", parent->path, format_unformat_error, input);
476 return clib_error_return (0, "unknown input `%U'", format_unformat_error, input);
480 void vlib_unix_error_report (vlib_main_t *, clib_error_t *)
481 __attribute__ ((weak));
483 void vlib_unix_error_report (vlib_main_t * vm, clib_error_t * error) { }
485 /* Process CLI input. */
486 void vlib_cli_input (vlib_main_t * vm,
487 unformat_input_t * input,
488 vlib_cli_output_function_t * function,
491 vlib_cli_main_t * cm = &vm->cli_main;
492 clib_error_t * error;
493 vlib_cli_output_function_t * save_function;
494 uword save_function_arg;
496 save_function = cm->output_function;
497 save_function_arg = cm->output_function_arg;
499 cm->output_function = function;
500 cm->output_function_arg = function_arg;
503 vec_reset_length (cm->parse_rule_data);
504 error = vlib_cli_dispatch_sub_commands (vm, &vm->cli_main, input, /* parent */ 0);
505 } while (! error && ! unformat (input, "%U", unformat_eof));
509 vlib_cli_output (vm, "%v", error->what);
510 vlib_unix_error_report (vm, error);
511 clib_error_free (error);
514 cm->output_function = save_function;
515 cm->output_function_arg = save_function_arg;
518 /* Output to current CLI connection. */
519 void vlib_cli_output (vlib_main_t * vm, char * fmt, ...)
521 vlib_cli_main_t * cm = &vm->cli_main;
526 s = va_format (0, fmt, &va);
529 /* Terminate with \n if not present. */
530 if (vec_len (s) > 0 && s[vec_len (s)-1] != '\n')
533 if (! cm->output_function)
534 fformat (stdout, "%v", s);
536 cm->output_function (cm->output_function_arg, s, vec_len (s));
541 static clib_error_t *
542 show_memory_usage (vlib_main_t * vm,
543 unformat_input_t * input,
544 vlib_cli_command_t * cmd)
547 clib_error_t * error;
550 while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT)
552 if (unformat (input, "verbose"))
555 error = clib_error_return (0, "unknown input `%U'",
556 format_unformat_error, input);
563 vlib_cli_output (vm, "Thread %d %v\n", index, vlib_worker_threads[index].name);
564 vlib_cli_output (vm, "%U\n", format_mheap, clib_per_cpu_mheaps[index], verbose);
570 VLIB_CLI_COMMAND (show_memory_usage_command, static) = {
571 .path = "show memory",
572 .short_help = "Show current memory usage",
573 .function = show_memory_usage,
576 static clib_error_t *
577 enable_disable_memory_trace (vlib_main_t * vm,
578 unformat_input_t * input,
579 vlib_cli_command_t * cmd)
581 clib_error_t * error = 0;
584 if (! unformat_user (input, unformat_vlib_enable_disable, &enable))
586 error = clib_error_return (0, "expecting enable/on or disable/off");
590 clib_mem_trace (enable);
596 VLIB_CLI_COMMAND (enable_disable_memory_trace_command, static) = {
597 .path = "memory-trace",
598 .short_help = "Enable/disable memory allocation trace",
599 .function = enable_disable_memory_trace,
603 static clib_error_t *
604 test_heap_validate (vlib_main_t * vm, unformat_input_t * input,
605 vlib_cli_command_t * cmd)
607 clib_error_t * error = 0;
611 if (unformat(input, "on")) {
613 heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index];
614 mheap = mheap_header(heap);
615 mheap->flags |= MHEAP_FLAG_VALIDATE;
616 // Turn off small object cache because it delays detection of errors
617 mheap->flags &= ~MHEAP_FLAG_SMALL_OBJECT_CACHE;
620 } else if (unformat(input, "off")) {
622 heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index];
623 mheap = mheap_header(heap);
624 mheap->flags &= ~MHEAP_FLAG_VALIDATE;
625 mheap->flags |= MHEAP_FLAG_SMALL_OBJECT_CACHE;
628 } else if (unformat(input, "now")) {
630 heap = clib_per_cpu_mheaps[this_vlib_main->cpu_index];
631 mheap = mheap_header(heap);
632 mheap_validate(heap);
634 vlib_cli_output(vm, "heap validation complete");
637 return clib_error_return(0, "unknown input `%U'",
638 format_unformat_error, input);
644 VLIB_CLI_COMMAND (cmd_test_heap_validate,static) = {
645 .path = "test heap-validate",
646 .short_help = "<on/off/now> validate heap on future allocs/frees or right now",
647 .function = test_heap_validate,
651 static uword vlib_cli_normalize_path (char * input, char ** result)
656 uword index_of_last_space = ~0;
661 /* Multiple white space -> single space. */
668 if (l > 0 && s[l-1] != ' ')
676 if (l > 0 && s[l-1] == ' ')
677 index_of_last_space = vec_len (s);
684 /* Remove any extra space at end. */
685 if (l > 0 && s[l-1] == ' ')
689 return index_of_last_space;
693 parent_path_len (char * path)
696 for (i = vec_len (path) - 1; i >= 0; i--)
704 static void add_sub_command (vlib_cli_main_t * cm,
708 vlib_cli_command_t * p, * c;
709 vlib_cli_sub_command_t * sub_c;
713 p = vec_elt_at_index (cm->commands, parent_index);
714 c = vec_elt_at_index (cm->commands, child_index);
716 l = parent_path_len (c->path);
718 sub_name = vec_dup ((u8 *) c->path);
721 ASSERT (l + 1 < vec_len (c->path));
723 vec_add (sub_name, c->path + l + 1, vec_len (c->path) - (l + 1));
726 if (sub_name[0] == '%')
729 vlib_cli_sub_rule_t * sr;
732 vec_delete (sub_name, 1, 0);
734 if (! p->sub_rule_index_by_name)
735 p->sub_rule_index_by_name
736 = hash_create_vec (/* initial length */ 32,
737 sizeof (sub_name[0]),
739 q = hash_get_mem (p->sub_rule_index_by_name, sub_name);
742 sr = vec_elt_at_index (p->sub_rules, q[0]);
743 ASSERT (sr->command_index == child_index);
747 q = hash_get_mem (cm->parse_rule_index_by_name, sub_name);
749 clib_error ("reference to unknown rule `%%%v' in path `%v'",
752 hash_set_mem (p->sub_rule_index_by_name, sub_name, vec_len (p->sub_rules));
753 vec_add2 (p->sub_rules, sr, 1);
755 sr->rule_index = q[0];
756 sr->command_index = child_index;
760 if (! p->sub_command_index_by_name)
761 p->sub_command_index_by_name
762 = hash_create_vec (/* initial length */ 32,
766 /* Check if sub-command has already been created. */
767 if (hash_get_mem (p->sub_command_index_by_name, sub_name))
773 vec_add2 (p->sub_commands, sub_c, 1);
774 sub_c->index = child_index;
775 sub_c->name = sub_name;
776 hash_set_mem (p->sub_command_index_by_name, sub_c->name, sub_c - p->sub_commands);
778 vec_validate (p->sub_command_positions, vec_len (sub_c->name) - 1);
779 for (i = 0; i < vec_len (sub_c->name); i++)
782 vlib_cli_parse_position_t * pos;
784 pos = vec_elt_at_index (p->sub_command_positions, i);
787 pos->min_char = sub_c->name[i];
789 n = sub_c->name[i] - pos->min_char;
792 pos->min_char = sub_c->name[i];
793 vec_insert (pos->bitmaps, -n, 0);
797 vec_validate (pos->bitmaps, n);
798 pos->bitmaps[n] = clib_bitmap_ori (pos->bitmaps[n], sub_c - p->sub_commands);
803 vlib_cli_make_parent (vlib_cli_main_t * cm, uword ci)
805 uword p_len, pi, * p;
807 vlib_cli_command_t * c, * parent;
809 /* Root command (index 0) should have already been added. */
810 ASSERT (vec_len (cm->commands) > 0);
812 c = vec_elt_at_index (cm->commands, ci);
813 p_len = parent_path_len (c->path);
815 /* No space? Parent is root command. */
818 add_sub_command (cm, 0, ci);
823 vec_add (p_path, c->path, p_len);
825 p = hash_get_mem (cm->command_index_by_path, p_path);
830 /* Parent does not exist; create it. */
831 vec_add2 (cm->commands, parent, 1);
832 parent->path = p_path;
833 hash_set_mem (cm->command_index_by_path, parent->path, parent - cm->commands);
834 pi = parent - cm->commands;
842 add_sub_command (cm, pi, ci);
844 /* Create parent's parent. */
846 vlib_cli_make_parent (cm, pi);
850 vlib_cli_command_is_empty (vlib_cli_command_t * c)
852 return (c->long_help == 0
853 && c->short_help == 0
854 && c->function == 0);
857 clib_error_t * vlib_cli_register (vlib_main_t * vm, vlib_cli_command_t * c)
859 vlib_cli_main_t * cm = &vm->cli_main;
860 clib_error_t * error = 0;
862 char * normalized_path;
864 if ((error = vlib_call_init_function (vm, vlib_cli_init)))
867 (void) vlib_cli_normalize_path (c->path, &normalized_path);
869 if (! cm->command_index_by_path)
870 cm->command_index_by_path = hash_create_vec (/* initial length */ 32,
874 /* See if command already exists with given path. */
875 p = hash_get_mem (cm->command_index_by_path, normalized_path);
878 vlib_cli_command_t * d;
881 d = vec_elt_at_index (cm->commands, ci);
883 /* If existing command was created via vlib_cli_make_parent
884 replaced it with callers data. */
885 if (vlib_cli_command_is_empty (d))
887 vlib_cli_command_t save = d[0];
889 ASSERT (! vlib_cli_command_is_empty (c));
891 /* Copy callers fields. */
894 /* Save internal fields. */
896 d->sub_commands = save.sub_commands;
897 d->sub_command_index_by_name = save.sub_command_index_by_name;
898 d->sub_command_positions = save.sub_command_positions;
899 d->sub_rules = save.sub_rules;
902 error = clib_error_return (0, "duplicate command name with path %v", normalized_path);
904 vec_free (normalized_path);
910 /* Command does not exist: create it. */
912 /* Add root command (index 0). */
913 if (vec_len (cm->commands) == 0)
915 /* Create command with index 0; path is empty string. */
916 vec_resize (cm->commands, 1);
919 ci = vec_len (cm->commands);
920 hash_set_mem (cm->command_index_by_path, normalized_path, ci);
921 vec_add1 (cm->commands, c[0]);
923 c = vec_elt_at_index (cm->commands, ci);
924 c->path = normalized_path;
926 /* Don't inherit from registration. */
928 c->sub_command_index_by_name = 0;
929 c->sub_command_positions = 0;
932 vlib_cli_make_parent (cm, ci);
937 vlib_cli_register_parse_rule (vlib_main_t * vm, vlib_cli_parse_rule_t * r_reg)
939 vlib_cli_main_t * cm = &vm->cli_main;
940 vlib_cli_parse_rule_t * r;
941 clib_error_t * error = 0;
945 if (! cm->parse_rule_index_by_name)
946 cm->parse_rule_index_by_name = hash_create_vec (/* initial length */ 32,
950 /* Make vector copy of name. */
951 r_name = format (0, "%s", r_reg->name);
953 if ((p = hash_get_mem (cm->parse_rule_index_by_name, r_name)))
956 return clib_error_return (0, "duplicate parse rule name `%s'", r_reg->name);
959 vec_add2 (cm->parse_rules, r, 1);
961 r->name = (char *) r_name;
962 hash_set_mem (cm->parse_rule_index_by_name, r->name, r - cm->parse_rules);
968 /* $$$ turn back on again someday, maybe */
969 static clib_error_t *
970 vlib_cli_register_parse_rules (vlib_main_t * vm,
971 vlib_cli_parse_rule_t * lo,
972 vlib_cli_parse_rule_t * hi)
974 __attribute__((unused))
976 clib_error_t * error = 0;
977 vlib_cli_parse_rule_t * r;
979 for (r = lo; r < hi; r = clib_elf_section_data_next (r, 0))
981 if (! r->name || strlen (r->name) == 0)
983 error = clib_error_return (0, "parse rule with no name");
987 error = vlib_cli_register_parse_rule (vm, r);
997 static clib_error_t * vlib_cli_init (vlib_main_t * vm)
999 vlib_cli_main_t * cm = &vm->cli_main;
1000 clib_error_t * error = 0;
1001 vlib_cli_command_t * cmd;
1003 cmd = cm->cli_command_registrations;
1007 error = vlib_cli_register (vm, cmd);
1010 cmd = cmd->next_cli_command;
1015 VLIB_INIT_FUNCTION (vlib_cli_init);