diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-04-27 01:12:48 -0400 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-05-01 18:08:45 +0000 |
commit | 073d74d0ba9a6110ed73a38df668c47ceb3ca776 (patch) | |
tree | ce8fb63da2672e4dbeb8307f06c8b3ea6910adfe /src/vnet/devices/tap/tapv2_api.c | |
parent | e891ac2f198e7c00dceb2f2c6510f9bdf1cb91d1 (diff) |
tap: implement sw_interface_tap_v2_dump filtering by sw_if_index
Type: feature
Change-Id: I6f607f383dc77a71e8712124f7613b38b4ac065a
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vnet/devices/tap/tapv2_api.c')
-rw-r--r-- | src/vnet/devices/tap/tapv2_api.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/devices/tap/tapv2_api.c b/src/vnet/devices/tap/tapv2_api.c index 9e09459c9ab..05679377d2a 100644 --- a/src/vnet/devices/tap/tapv2_api.c +++ b/src/vnet/devices/tap/tapv2_api.c @@ -232,8 +232,8 @@ vl_api_sw_interface_tap_v2_dump_t_handler (vl_api_sw_interface_tap_v2_dump_t * return; filter_sw_if_index = htonl (mp->sw_if_index); - if (filter_sw_if_index != ~0) - return; /* UNIMPLEMENTED */ + if (mp->sw_if_index != ~0) + VALIDATE_SW_IF_INDEX (mp); rv = tap_dump_ifs (&tapifs); if (rv) @@ -241,9 +241,11 @@ vl_api_sw_interface_tap_v2_dump_t_handler (vl_api_sw_interface_tap_v2_dump_t * vec_foreach (tap_if, tapifs) { - tap_send_sw_interface_details (am, reg, tap_if, mp->context); + if ((filter_sw_if_index == ~0) + || (tap_if->sw_if_index == filter_sw_if_index)) + tap_send_sw_interface_details (am, reg, tap_if, mp->context); } - + BAD_SW_IF_INDEX_LABEL; vec_free (tapifs); } |