FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
cli.c File Reference
+ Include dependency graph for cli.c:

Go to the source code of this file.

Functions

static uwordvlib_cli_sub_command_match (vlib_cli_command_t *c, unformat_input_t *input)
 
uword unformat_vlib_cli_sub_input (unformat_input_t *i, va_list *args)
 
static vlib_cli_command_tget_sub_command (vlib_cli_main_t *cm, vlib_cli_command_t *parent, u32 si)
 
static uword unformat_vlib_cli_sub_command (unformat_input_t *i, va_list *args)
 
static int vlib_cli_cmp_strings (void *a1, void *a2)
 
u8 ** vlib_cli_get_possible_completions (u8 *str)
 
static u8format_vlib_cli_command_help (u8 *s, va_list *args)
 
static u8format_vlib_cli_parse_rule_name (u8 *s, va_list *args)
 
static u8format_vlib_cli_path (u8 *s, va_list *args)
 
static vlib_cli_command_tall_subs (vlib_cli_main_t *cm, vlib_cli_command_t *subs, u32 command_index)
 
static int vlib_cli_cmp_rule (void *a1, void *a2)
 
static int vlib_cli_cmp_command (void *a1, void *a2)
 
static clib_error_tvlib_cli_dispatch_sub_commands (vlib_main_t *vm, vlib_cli_main_t *cm, unformat_input_t *input, uword parent_command_index)
 
void vlib_unix_error_report (vlib_main_t *, clib_error_t *)
 
void vlib_cli_input (vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)
 
void vlib_cli_output (vlib_main_t *vm, char *fmt,...)
 
static clib_error_tshow_memory_usage (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_cpu (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tenable_disable_memory_trace (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_ttest_heap_validate (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_trestart_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword vlib_cli_normalize_path (char *input, char **result)
 
static uword parent_path_len (char *path)
 
static void add_sub_command (vlib_cli_main_t *cm, uword parent_index, uword child_index)
 
static void vlib_cli_make_parent (vlib_cli_main_t *cm, uword ci)
 
static uword vlib_cli_command_is_empty (vlib_cli_command_t *c)
 
clib_error_tvlib_cli_register (vlib_main_t *vm, vlib_cli_command_t *c)
 
clib_error_tvlib_cli_register_parse_rule (vlib_main_t *vm, vlib_cli_parse_rule_t *r_reg)
 
static int cli_path_compare (void *a1, void *a2)
 
static clib_error_tshow_cli_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tvlib_cli_init (vlib_main_t *vm)
 

Variables

static vlib_cli_command_t vlib_cli_show_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_show_command) More...
 
static vlib_cli_command_t vlib_cli_clear_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_clear_command) More...
 
static vlib_cli_command_t vlib_cli_set_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_set_command) More...
 
static vlib_cli_command_t vlib_cli_test_command
 (constructor) VLIB_CLI_COMMAND (vlib_cli_test_command) More...
 
static vlib_cli_command_t show_memory_usage_command
 (constructor) VLIB_CLI_COMMAND (show_memory_usage_command) More...
 
static vlib_cli_command_t show_cpu_command
 (constructor) VLIB_CLI_COMMAND (show_cpu_command) More...
 
static vlib_cli_command_t enable_disable_memory_trace_command
 (constructor) VLIB_CLI_COMMAND (enable_disable_memory_trace_command) More...
 
static vlib_cli_command_t cmd_test_heap_validate
 (constructor) VLIB_CLI_COMMAND (cmd_test_heap_validate) More...
 
static vlib_cli_command_t restart_cmd
 (constructor) VLIB_CLI_COMMAND (restart_cmd) More...
 
static vlib_cli_command_t show_cli_command
 (constructor) VLIB_CLI_COMMAND (show_cli_command) More...
 

Function Documentation

static void add_sub_command ( vlib_cli_main_t cm,
uword  parent_index,
uword  child_index 
)
static

Definition at line 971 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static vlib_cli_command_t* all_subs ( vlib_cli_main_t cm,
vlib_cli_command_t subs,
u32  command_index 
)
static

Definition at line 404 of file cli.c.

+ Here is the caller graph for this function:

static int cli_path_compare ( void *  a1,
void *  a2 
)
static

Definition at line 1270 of file cli.c.

+ Here is the caller graph for this function:

static clib_error_t* enable_disable_memory_trace ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 775 of file cli.c.

+ Here is the call graph for this function:

static u8* format_vlib_cli_command_help ( u8 s,
va_list *  args 
)
static

Definition at line 342 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_vlib_cli_parse_rule_name ( u8 s,
va_list *  args 
)
static

Definition at line 356 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8* format_vlib_cli_path ( u8 s,
va_list *  args 
)
static

Definition at line 363 of file cli.c.

+ Here is the caller graph for this function:

static vlib_cli_command_t* get_sub_command ( vlib_cli_main_t cm,
vlib_cli_command_t parent,
u32  si 
)
static

Definition at line 188 of file cli.c.

+ Here is the caller graph for this function:

static uword parent_path_len ( char *  path)
inlinestatic

Definition at line 959 of file cli.c.

+ Here is the caller graph for this function:

static clib_error_t* restart_cmd_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 865 of file cli.c.

static clib_error_t* show_cli_cmd_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1288 of file cli.c.

+ Here is the call graph for this function:

static clib_error_t* show_cpu ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 742 of file cli.c.

static clib_error_t* show_memory_usage ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 703 of file cli.c.

+ Here is the call graph for this function:

static clib_error_t* test_heap_validate ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 804 of file cli.c.

+ Here is the call graph for this function:

static uword unformat_vlib_cli_sub_command ( unformat_input_t i,
va_list *  args 
)
static

Definition at line 195 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uword unformat_vlib_cli_sub_input ( unformat_input_t i,
va_list *  args 
)

Definition at line 152 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int vlib_cli_cmp_command ( void *  a1,
void *  a2 
)
static

Definition at line 430 of file cli.c.

+ Here is the caller graph for this function:

static int vlib_cli_cmp_rule ( void *  a1,
void *  a2 
)
static

Definition at line 421 of file cli.c.

+ Here is the caller graph for this function:

static int vlib_cli_cmp_strings ( void *  a1,
void *  a2 
)
static

Definition at line 240 of file cli.c.

+ Here is the caller graph for this function:

static uword vlib_cli_command_is_empty ( vlib_cli_command_t c)
inlinestatic

Definition at line 1120 of file cli.c.

+ Here is the caller graph for this function:

static clib_error_t* vlib_cli_dispatch_sub_commands ( vlib_main_t vm,
vlib_cli_main_t cm,
unformat_input_t input,
uword  parent_command_index 
)
static

Definition at line 439 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8** vlib_cli_get_possible_completions ( u8 str)

Definition at line 249 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* vlib_cli_init ( vlib_main_t vm)
static

Definition at line 1319 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_cli_input ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_output_function_t function,
uword  function_arg 
)

Definition at line 643 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vlib_cli_make_parent ( vlib_cli_main_t cm,
uword  ci 
)
static

Definition at line 1072 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword vlib_cli_normalize_path ( char *  input,
char **  result 
)
static

Definition at line 917 of file cli.c.

+ Here is the caller graph for this function:

void vlib_cli_output ( vlib_main_t vm,
char *  fmt,
  ... 
)

Definition at line 680 of file cli.c.

clib_error_t* vlib_cli_register ( vlib_main_t vm,
vlib_cli_command_t c 
)

Definition at line 1126 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* vlib_cli_register_parse_rule ( vlib_main_t vm,
vlib_cli_parse_rule_t r_reg 
)

Definition at line 1208 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword* vlib_cli_sub_command_match ( vlib_cli_command_t c,
unformat_input_t input 
)
static

Definition at line 79 of file cli.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void vlib_unix_error_report ( vlib_main_t vm,
clib_error_t error 
)

Definition at line 637 of file cli.c.

+ Here is the caller graph for this function:

Variable Documentation

vlib_cli_command_t cmd_test_heap_validate
static
Initial value:
= {
.path = "test heap-validate",
.short_help = "<on/off/now> validate heap on future allocs/frees or right now",
.function = test_heap_validate,
}
static clib_error_t * test_heap_validate(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:804

(constructor) VLIB_CLI_COMMAND (cmd_test_heap_validate)

Definition at line 857 of file cli.c.

vlib_cli_command_t enable_disable_memory_trace_command
static
Initial value:
= {
.path = "memory-trace",
.short_help = "Enable/disable memory allocation trace",
}
static clib_error_t * enable_disable_memory_trace(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:775

(constructor) VLIB_CLI_COMMAND (enable_disable_memory_trace_command)

Definition at line 795 of file cli.c.

vlib_cli_command_t restart_cmd
static
Initial value:
= {
.path = "restart",
.short_help = "restart process",
.function = restart_cmd_fn,
}
static clib_error_t * restart_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:865

(constructor) VLIB_CLI_COMMAND (restart_cmd)

Definition at line 876 of file cli.c.

vlib_cli_command_t show_cli_command
static
Initial value:
= {
.path = "show cli",
.short_help = "Show cli commands",
.function = show_cli_cmd_fn,
}
static clib_error_t * show_cli_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:1288

(constructor) VLIB_CLI_COMMAND (show_cli_command)

Definition at line 1311 of file cli.c.

vlib_cli_command_t show_cpu_command
static
Initial value:
= {
.path = "show cpu",
.short_help = "Show cpu information",
.function = show_cpu,
}
static clib_error_t * show_cpu(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:742

(constructor) VLIB_CLI_COMMAND (show_cpu_command)

Definition at line 767 of file cli.c.

vlib_cli_command_t show_memory_usage_command
static
Initial value:
= {
.path = "show memory",
.short_help = "Show current memory usage",
.function = show_memory_usage,
}
static clib_error_t * show_memory_usage(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: cli.c:703

(constructor) VLIB_CLI_COMMAND (show_memory_usage_command)

Definition at line 734 of file cli.c.

vlib_cli_command_t vlib_cli_clear_command
static
Initial value:
= {
.path = "clear",
.short_help = "Clear commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_clear_command)

Definition at line 55 of file cli.c.

vlib_cli_command_t vlib_cli_set_command
static
Initial value:
= {
.path = "set",
.short_help = "Set commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_set_command)

Definition at line 63 of file cli.c.

vlib_cli_command_t vlib_cli_show_command
static
Initial value:
= {
.path = "show",
.short_help = "Show commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_show_command)

Definition at line 47 of file cli.c.

vlib_cli_command_t vlib_cli_test_command
static
Initial value:
= {
.path = "test",
.short_help = "Test commands",
}

(constructor) VLIB_CLI_COMMAND (vlib_cli_test_command)

Definition at line 71 of file cli.c.