40 #ifndef included_vlib_cli_h 41 #define included_vlib_cli_h 134 u8 * buffer,
uword buffer_bytes);
151 #ifndef CLIB_MARCH_VARIANT 152 #define VLIB_CLI_COMMAND(x,...) \ 153 __VA_ARGS__ vlib_cli_command_t x; \ 154 static void __vlib_cli_command_registration_##x (void) \ 155 __attribute__((__constructor__)) ; \ 156 static void __vlib_cli_command_registration_##x (void) \ 158 vlib_main_t * vm = vlib_get_main(); \ 159 vlib_cli_main_t *cm = &vm->cli_main; \ 160 x.next_cli_command = cm->cli_command_registrations; \ 161 cm->cli_command_registrations = &x; \ 163 static void __vlib_cli_command_unregistration_##x (void) \ 164 __attribute__((__destructor__)) ; \ 165 static void __vlib_cli_command_unregistration_##x (void) \ 167 vlib_main_t * vm = vlib_get_main(); \ 168 vlib_cli_main_t *cm = &vm->cli_main; \ 169 VLIB_REMOVE_FROM_LINKED_LIST (cm->cli_command_registrations, &x, \ 172 __VA_ARGS__ vlib_cli_command_t x 176 #define VLIB_CLI_COMMAND(x,...) \ 177 static __clib_unused vlib_cli_command_t __clib_unused_##x 180 #define VLIB_CLI_PARSE_RULE(x) \ 181 vlib_cli_parse_rule_t x unformat_function_t * unformat_function
vlib_cli_command_t * commands
uword * sub_rule_index_by_name
clib_error_t * vlib_cli_register_parse_rule(struct vlib_main_t *vm, vlib_cli_parse_rule_t *c)
u8 ** vlib_cli_get_possible_completions(u8 *input_str)
uword * command_index_by_path
vlib_cli_sub_rule_t * sub_rules
clib_error_t *() vlib_cli_command_function_t(struct vlib_main_t *vm, unformat_input_t *input, struct vlib_cli_command_t *cmd)
vlib_cli_sub_command_t * sub_commands
sll srl srl sll sra u16x4 i
clib_error_t * vlib_cli_register(struct vlib_main_t *vm, vlib_cli_command_t *c)
uword unformat_vlib_cli_sub_input(unformat_input_t *i, va_list *args)
uword * sub_command_index_by_name
int vlib_cli_input(struct vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)
void vlib_cli_output(struct vlib_main_t *vm, char *fmt,...)
struct vlib_cli_command_t * next_cli_command
vlib_cli_command_t * cli_command_registrations
struct vlib_cli_command_t vlib_cli_command_t
vlib_cli_parse_position_t * sub_command_positions
void() vlib_cli_output_function_t(uword arg, u8 *buffer, uword buffer_bytes)