aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/pg/cli.c')
-rw-r--r--src/vnet/pg/cli.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index 4526986d1ff..9c42d70a383 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -109,19 +109,26 @@ static clib_error_t *
enable_disable_stream (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ unformat_input_t _line_input, *line_input = &_line_input;
pg_main_t *pg = &pg_main;
int is_enable = cmd->function_arg != 0;
u32 stream_index = ~0;
- if (unformat (input, "%U", unformat_eof))
- ;
- else if (unformat (input, "%U", unformat_hash_vec_string,
- pg->stream_index_by_name, &stream_index))
- ;
- else
- return clib_error_create ("unknown input `%U'",
- format_unformat_error, input);
+ if (!unformat_user (input, unformat_line_input, line_input))
+ goto doit;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (line_input, "%U", unformat_hash_vec_string,
+ pg->stream_index_by_name, &stream_index))
+ ;
+ else
+ return clib_error_create ("unknown input `%U'",
+ format_unformat_error, line_input);
+ }
+ unformat_free (line_input);
+doit:
pg_enable_disable (stream_index, is_enable);
return 0;
@@ -374,6 +381,10 @@ new_stream (vlib_main_t * vm,
unformat_vnet_sw_interface, vnm,
&s.sw_if_index[VLIB_RX]))
;
+ else if (unformat (input, "tx-interface %U",
+ unformat_vnet_sw_interface, vnm,
+ &s.sw_if_index[VLIB_TX]))
+ ;
else if (unformat (input, "pcap %s", &pcap_file_name))
;