FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
cli.h File Reference
+ Include dependency graph for cli.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  vlib_cli_parse_position_t
 
struct  vlib_cli_sub_command_t
 
struct  vlib_cli_sub_rule_t
 
struct  vlib_cli_parse_rule_t
 
struct  vlib_cli_command_t
 
struct  vlib_cli_main_t
 

Macros

#define VLIB_CLI_COMMAND(x, ...)
 
#define VLIB_CLI_PARSE_RULE(x)   vlib_cli_parse_rule_t x
 

Typedefs

typedef clib_error_t *() vlib_cli_command_function_t(struct vlib_main_t *vm, unformat_input_t *input, struct vlib_cli_command_t *cmd)
 
typedef struct vlib_cli_command_t vlib_cli_command_t
 
typedef void() vlib_cli_output_function_t(uword arg, u8 *buffer, uword buffer_bytes)
 
typedef struct vlib_cli_main_t vlib_cli_main_t
 

Functions

void vlib_cli_output (struct vlib_main_t *vm, char *fmt,...)
 
int vlib_cli_input (struct vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)
 
clib_error_tvlib_cli_register (struct vlib_main_t *vm, vlib_cli_command_t *c)
 
clib_error_tvlib_cli_register_parse_rule (struct vlib_main_t *vm, vlib_cli_parse_rule_t *c)
 
uword unformat_vlib_cli_sub_input (unformat_input_t *i, va_list *args)
 
u8 ** vlib_cli_get_possible_completions (u8 *input_str)
 

Macro Definition Documentation

◆ VLIB_CLI_COMMAND

#define VLIB_CLI_COMMAND (   x,
  ... 
)
Value:
__VA_ARGS__ vlib_cli_command_t x; \
static void __vlib_cli_command_registration_##x (void) \
__attribute__ ((__constructor__)); \
static void __vlib_cli_command_registration_##x (void) \
{ \
vlib_global_main_t *vgm = vlib_get_global_main (); \
vlib_cli_main_t *cm = &vgm->cli_main; \
x.next_cli_command = cm->cli_command_registrations; \
cm->cli_command_registrations = &x; \
} \
static void __vlib_cli_command_unregistration_##x (void) \
__attribute__ ((__destructor__)); \
static void __vlib_cli_command_unregistration_##x (void) \
{ \
vlib_global_main_t *vgm = vlib_get_global_main (); \
vlib_cli_main_t *cm = &vgm->cli_main; \
VLIB_REMOVE_FROM_LINKED_LIST (cm->cli_command_registrations, &x, \
next_cli_command); \
} \
__VA_ARGS__ vlib_cli_command_t x

Definition at line 163 of file cli.h.

◆ VLIB_CLI_PARSE_RULE

#define VLIB_CLI_PARSE_RULE (   x)    vlib_cli_parse_rule_t x

Definition at line 191 of file cli.h.

Typedef Documentation

◆ vlib_cli_command_function_t

typedef clib_error_t*() vlib_cli_command_function_t(struct vlib_main_t *vm, unformat_input_t *input, struct vlib_cli_command_t *cmd)

Definition at line 89 of file cli.h.

◆ vlib_cli_command_t

◆ vlib_cli_main_t

◆ vlib_cli_output_function_t

typedef void() vlib_cli_output_function_t(uword arg, u8 *buffer, uword buffer_bytes)

Definition at line 134 of file cli.h.

Function Documentation

◆ unformat_vlib_cli_sub_input()

uword unformat_vlib_cli_sub_input ( unformat_input_t i,
va_list *  args 
)

Definition at line 163 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_get_possible_completions()

u8** vlib_cli_get_possible_completions ( u8 input_str)

Definition at line 238 of file cli.c.

+ Here is the call graph for this function:

◆ vlib_cli_input()

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

Definition at line 675 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_output()

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

Definition at line 716 of file cli.c.

+ Here is the call graph for this function:

◆ vlib_cli_register()

clib_error_t* vlib_cli_register ( struct vlib_main_t vm,
vlib_cli_command_t c 
)

Definition at line 1357 of file cli.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vlib_cli_register_parse_rule()

clib_error_t* vlib_cli_register_parse_rule ( struct vlib_main_t vm,
vlib_cli_parse_rule_t c 
)
vlib_get_global_main
static vlib_global_main_t * vlib_get_global_main(void)
Definition: global_funcs.h:50
cm
vnet_feature_config_main_t * cm
Definition: nat44_ei_hairpinning.c:594
vlib_cli_command_t
Definition: cli.h:92