summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/cli.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-10-08 15:10:49 +0000
committerBeno�t Ganne <bganne@cisco.com>2021-10-22 12:37:36 +0000
commitcae84fa96856406c93c37e0a38f67d4c6ee7f48a (patch)
tree617e05be28146aff824d47ed71a28ab72bcf8cde /src/vnet/devices/af_packet/cli.c
parent0ad060851b4989a1cd300ad711e8498435f65f9a (diff)
devices: add support for l3 af_packet interface
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia6b9d4ac55be2216887bfdb99be4021f6a96f166
Diffstat (limited to 'src/vnet/devices/af_packet/cli.c')
-rw-r--r--src/vnet/devices/af_packet/cli.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vnet/devices/af_packet/cli.c b/src/vnet/devices/af_packet/cli.c
index bae4f6181b0..3dd3c8ee848 100644
--- a/src/vnet/devices/af_packet/cli.c
+++ b/src/vnet/devices/af_packet/cli.c
@@ -51,6 +51,9 @@ af_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
clib_memset (arg, 0, sizeof (*arg));
+ // Default mode
+ arg->mode = AF_PACKET_IF_MODE_ETHERNET;
+
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
return 0;
@@ -69,6 +72,8 @@ af_packet_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
else if (unformat (line_input, "tx-per-block %u",
&arg->tx_frames_per_block))
;
+ else if (unformat (line_input, "mode ip"))
+ arg->mode = AF_PACKET_IF_MODE_IP;
else if (unformat (line_input, "hw-addr %U", unformat_ethernet_address,
hwaddr))
arg->hw_addr = hwaddr;
@@ -140,7 +145,8 @@ done:
?*/
VLIB_CLI_COMMAND (af_packet_create_command, static) = {
.path = "create host-interface",
- .short_help = "create host-interface name <ifname> [hw-addr <mac-addr>]",
+ .short_help =
+ "create host-interface name <ifname> [hw-addr <mac-addr>] [mode ip]",
.function = af_packet_create_command_fn,
};