X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=vnet%2Fvnet%2Fpg%2Fpg.h;h=54c270ff0a83bff5bfed17174dec34897eadb575;hb=9e6ed6e2e1b8af46a317f9448da2bca8d8c5395d;hp=63bfb18abca8cec132334d674182750504c9cc5a;hpb=cb9cadad578297ffd78fa8a33670bdf1ab669e7e;p=vpp.git diff --git a/vnet/vnet/pg/pg.h b/vnet/vnet/pg/pg.h index 63bfb18abca..54c270ff0a8 100644 --- a/vnet/vnet/pg/pg.h +++ b/vnet/vnet/pg/pg.h @@ -43,6 +43,10 @@ #include /* for VLIB_N_RX_TX */ #include #include /* for buffer_fifo */ +#include +#include + +extern vnet_device_class_t pg_dev_class; struct pg_main_t; struct pg_stream_t; @@ -140,6 +144,8 @@ typedef struct pg_stream_t { /* Output next index to reach output node from stream input node. */ u32 next_index; + u32 if_id; + /* Number of packets currently generated. */ u64 n_packets_generated; @@ -281,7 +287,10 @@ typedef struct { u32 hw_if_index, sw_if_index; /* Identifies stream for this interface. */ - u32 stream_index; + u32 id; + + pcap_main_t pcap_main; + u8 * pcap_file_name; } pg_interface_t; /* Per VLIB node data. */ @@ -303,13 +312,12 @@ typedef struct pg_main_t { /* Hash mapping name -> stream index. */ uword * stream_index_by_name; - /* Vector of interfaces. */ + /* Pool of interfaces. */ pg_interface_t * interfaces; + uword * if_index_by_if_id; /* Per VLIB node information. */ pg_node_t * nodes; - - u32 * free_interfaces; } pg_main_t; /* Global main structure. */ @@ -329,7 +337,7 @@ void pg_stream_add (pg_main_t * pg, pg_stream_t * s_init); void pg_stream_enable_disable (pg_main_t * pg, pg_stream_t * s, int is_enable); /* Find/create free packet-generator interface index. */ -u32 pg_interface_find_free (pg_main_t * pg, uword stream_index); +u32 pg_interface_add_or_get (pg_main_t * pg, uword stream_index); always_inline pg_node_t * pg_get_node (uword node_index) @@ -344,4 +352,16 @@ void pg_edit_group_get_fixed_packet_data (pg_stream_t * s, void * fixed_packet_data, void * fixed_packet_data_mask); +void pg_enable_disable (u32 stream_index, int is_enable); + +typedef struct { + u32 hw_if_index; + u32 dev_instance; + u8 is_enabled; + u8 * pcap_file_name; + u32 count; +} pg_capture_args_t; + +clib_error_t * pg_capture (pg_capture_args_t *a); + #endif /* included_vlib_pg_h */