summaryrefslogtreecommitdiffstats
path: root/src/stateless/trex_stream_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stateless/trex_stream_api.h')
-rw-r--r--src/stateless/trex_stream_api.h67
1 files changed, 43 insertions, 24 deletions
diff --git a/src/stateless/trex_stream_api.h b/src/stateless/trex_stream_api.h
index ab7a8f26..7ae25c6e 100644
--- a/src/stateless/trex_stream_api.h
+++ b/src/stateless/trex_stream_api.h
@@ -36,38 +36,41 @@ class TrexStream {
friend class TrexStreamTable;
public:
- TrexStream();
+ TrexStream(uint8_t port_id, uint32_t stream_id);
virtual ~TrexStream() = 0;
- static const uint32_t MIN_PKT_SIZE_BYTES = 64;
+ static const uint32_t MIN_PKT_SIZE_BYTES = 1;
static const uint32_t MAX_PKT_SIZE_BYTES = 9000;
private:
- /* config */
- uint32_t stream_id;
- uint8_t port_id;
- double isg_usec;
- uint32_t next_stream_id;
- uint32_t loop_count;
+ /* basic */
+ uint8_t m_port_id;
+ uint32_t m_stream_id;
+
+
+ /* config fields */
+ double m_isg_usec;
+ uint32_t m_next_stream_id;
+ uint32_t m_loop_count;
/* indicators */
- bool enable;
- bool start;
+ bool m_enable;
+ bool m_start;
/* pkt */
- uint8_t *pkt;
- uint16_t pkt_len;
+ uint8_t *m_pkt;
+ uint16_t m_pkt_len;
/* VM */
/* RX check */
struct {
- bool enable;
- bool seq_enable;
- bool latency;
- uint32_t stream_id;
+ bool m_enable;
+ bool m_seq_enable;
+ bool m_latency;
+ uint32_t m_stream_id;
- } rx_check;
+ } m_rx_check;
};
@@ -76,8 +79,11 @@ private:
*
*/
class TrexStreamContinuous : public TrexStream {
+public:
+ TrexStreamContinuous(uint8_t port_id, uint32_t stream_id, uint32_t pps) : TrexStream(port_id, stream_id), m_pps(pps) {
+ }
protected:
- uint32_t pps;
+ uint32_t m_pps;
};
/**
@@ -85,9 +91,13 @@ protected:
*
*/
class TrexStreamSingleBurst : public TrexStream {
+public:
+ TrexStreamSingleBurst(uint8_t port_id, uint32_t stream_id, uint32_t packets, uint32_t pps) : TrexStream(port_id, stream_id), m_pps(pps), m_packets(packets) {
+ }
protected:
- uint32_t packets;
- uint32_t pps;
+ uint32_t m_pps;
+ uint32_t m_packets;
+
};
/**
@@ -95,11 +105,20 @@ protected:
*
*/
class TrexStreamMultiBurst : public TrexStream {
+public:
+ TrexStreamMultiBurst(uint8_t port_id,
+ uint32_t stream_id,
+ uint32_t pps,
+ double ibg_usec,
+ uint32_t pkts_per_burst,
+ uint32_t num_bursts) : TrexStream(port_id, stream_id), m_pps(pps), m_ibg_usec(ibg_usec), m_num_bursts(num_bursts), m_pkts_per_burst(pkts_per_burst) {
+
+ }
protected:
- uint32_t pps;
- double ibg_usec;
- uint32_t number_of_bursts;
- uint32_t pkts_per_burst;
+ uint32_t m_pps;
+ double m_ibg_usec;
+ uint32_t m_num_bursts;
+ uint32_t m_pkts_per_burst;
};
/**