40 #ifndef included_vlib_cli_h 41 #define included_vlib_cli_h 150 #define VLIB_CLI_COMMAND(x,...) \ 151 __VA_ARGS__ vlib_cli_command_t x; \ 152 static void __vlib_cli_command_registration_##x (void) \ 153 __attribute__((__constructor__)) ; \ 154 static void __vlib_cli_command_registration_##x (void) \ 156 vlib_main_t * vm = vlib_get_main(); \ 157 vlib_cli_main_t *cm = &vm->cli_main; \ 158 x.next_cli_command = cm->cli_command_registrations; \ 159 cm->cli_command_registrations = &x; \ 161 __VA_ARGS__ vlib_cli_command_t x 164 #define VLIB_CLI_PARSE_RULE(x) \ 165 vlib_cli_parse_rule_t x unformat_function_t * unformat_function
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
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)
uword * command_index_by_path
vlib_cli_parse_rule_t * parse_rules
vlib_cli_sub_rule_t * sub_rules
vlib_cli_sub_command_t * sub_commands
clib_error_t * vlib_cli_register(struct vlib_main_t *vm, vlib_cli_command_t *c)
clib_error_t *( vlib_cli_command_function_t)(struct vlib_main_t *vm, unformat_input_t *input, struct vlib_cli_command_t *cmd)
uword * parse_rule_index_by_name
void( vlib_cli_output_function_t)(uword arg, u8 *buffer, uword buffer_bytes)
uword * sub_command_index_by_name
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_input(struct vlib_main_t *vm, unformat_input_t *input, vlib_cli_output_function_t *function, uword function_arg)