21 #include <sys/ioctl.h> 22 #include <sys/socket.h> 24 #include <sys/types.h> 26 #include <netinet/in.h> 47 u8 *host_if_name = NULL;
60 if (
unformat (line_input,
"name %s", &host_if_name))
74 if (host_if_name == NULL)
82 if (r == VNET_API_ERROR_SYSCALL_ERROR_1)
88 if (r == VNET_API_ERROR_INVALID_INTERFACE)
94 if (r == VNET_API_ERROR_SUBIF_ALREADY_EXISTS)
134 .path =
"create host-interface",
135 .short_help =
"create host-interface name <ifname> [hw-addr <mac-addr>]",
145 u8 *host_if_name = NULL;
154 if (
unformat (line_input,
"name %s", &host_if_name))
164 if (host_if_name == NULL)
191 .path =
"delete host-interface",
192 .short_help =
"delete host-interface name <ifname>",
216 else if (
unformat (line_input,
"on"))
218 else if (
unformat (line_input,
"off"))
248 .path =
"set host-interface l4-cksum-offload",
249 .short_help =
"set host-interface l4-cksum-offload <host-if-name> <on|off>",
static clib_error_t * af_packet_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * af_packet_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int af_packet_set_l4_cksum_offload(vlib_main_t *vm, u32 sw_if_index, u8 set)
vnet_main_t * vnet_get_main(void)
clib_error_t * af_packet_cli_init(vlib_main_t *vm)
static clib_error_t * af_packet_set_l4_cksum_offload_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
unformat_function_t unformat_vnet_sw_interface
format_function_t format_vnet_sw_if_index_name
#define VLIB_INIT_FUNCTION(x)
#define clib_error_return(e, args...)
#define vec_free(V)
Free vector's memory (no header).
#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,...)
int af_packet_create_if(vlib_main_t *vm, u8 *host_if_name, u8 *hw_addr_set, u32 *sw_if_index)
vl_api_interface_index_t sw_if_index
int af_packet_delete_if(vlib_main_t *vm, u8 *host_if_name)