Add support for capturing packets on packet generator interfaces
This patch introduces following changes:
- 4 predefined pg/stream[0-3] interfaces are removed
- Interface naming is changed form pg/streamX to pgX where X can be
any u32 value
- one pgX interface can handle multiple streams
- keyword "source pgX" is added to "packet-generator add" command, X is 0
by default
- new cli "packet-generator capture" is introduced
- new cli "create packet-generator interface pgX"
Change-Id: I768d075b9d4a34f0b5073debdc5dd4a0880c682c
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/vnet/vnet/cop/cop.c b/vnet/vnet/cop/cop.c
index a352b37..465d6c9 100644
--- a/vnet/vnet/cop/cop.c
+++ b/vnet/vnet/cop/cop.c
@@ -22,6 +22,7 @@
cop_main_t * cm = &cop_main;
cop_config_data_t _data, *data = &_data;
vlib_main_t * vm = cm->vlib_main;
+ vnet_hw_interface_t * hi = vnet_get_sup_hw_interface (vnm, sw_if_index);;
cop_config_main_t * ccm;
int address_family;
u32 ci, default_next;
@@ -32,7 +33,7 @@
* Ignore local interface, pg interfaces. $$$ need a #define for the
* first "real" interface. The answer is 5 at the moment.
*/
- if (sw_if_index < 5)
+ if (hi->dev_class_index == vnet_local_interface_device_class.index)
return 0;
for (address_family = VNET_COP_IP4; address_family < VNET_N_COPS;