19 #include <sys/ioctl.h> 48 if (
unformat (line_input,
"name %s", &host_if_name))
54 else if (
unformat (line_input,
"pipe"))
56 else if (
unformat (line_input,
"master"))
58 else if (
unformat (line_input,
"slave"))
68 if (host_if_name ==
NULL)
78 if (r == VNET_API_ERROR_SYSCALL_ERROR_1)
84 if (r == VNET_API_ERROR_INVALID_INTERFACE)
90 if (r == VNET_API_ERROR_SUBIF_ALREADY_EXISTS)
153 .path =
"create netmap",
154 .short_help =
"create netmap name <ifname>|valeXXX:YYY " 155 "[hw-addr <mac-addr>] [pipe] [master|slave]",
174 if (
unformat (line_input,
"name %s", &host_if_name))
184 if (host_if_name ==
NULL)
216 .path =
"delete netmap",
217 .short_help =
"delete netmap name <ifname>|valeXXX:YYY",
clib_error_t * netmap_cli_init(vlib_main_t *vm)
vnet_main_t * vnet_get_main(void)
format_function_t format_vnet_sw_if_index_name
vl_api_interface_index_t sw_if_index
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
static clib_error_t * netmap_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int netmap_create_if(vlib_main_t *vm, u8 *if_name, u8 *hw_addr_set, u8 is_pipe, u8 is_master, u32 *sw_if_index)
#define VLIB_CLI_COMMAND(x,...)
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * netmap_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int netmap_delete_if(vlib_main_t *vm, u8 *host_if_name)