FD.io VPP  v21.01.1
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_main_t * vm = vlib_get_main(); \
vlib_cli_main_t *cm = &vm->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_main_t * vm = vlib_get_main(); \
vlib_cli_main_t *cm = &vm->cli_main; \
VLIB_REMOVE_FROM_LINKED_LIST (cm->cli_command_registrations, &x, \
next_cli_command); \
} \
__VA_ARGS__ vlib_cli_command_t x
vlib_main_t * vm
Definition: in2out_ed.c:1580
vnet_crypto_main_t * cm
Definition: quic_crypto.c:53
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:23

Definition at line 158 of file cli.h.

◆ VLIB_CLI_PARSE_RULE

#define VLIB_CLI_PARSE_RULE (   x)    vlib_cli_parse_rule_t x

Definition at line 186 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 88 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 133 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 237 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 656 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 696 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 1336 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 
)
+ Here is the caller graph for this function: