diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-09-10 07:54:05 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-09-10 07:54:05 +0300 |
commit | a360a1734c459d62bd4c204a6005214ce8944f85 (patch) | |
tree | e06cad6cf63a52701aff303c19024cde1d541ebd /src/stateless/trex_stream_api.h | |
parent | 15b4f7cd7c3e9176c1f24fc632791e833cb588b8 (diff) | |
parent | e33befcf222fd2108d589dede11069d4256bb21a (diff) |
Merge branch 'master' of csi-sceasr-b45:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-core
Conflicts:
linux/ws_main.py
Diffstat (limited to 'src/stateless/trex_stream_api.h')
-rw-r--r-- | src/stateless/trex_stream_api.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/stateless/trex_stream_api.h b/src/stateless/trex_stream_api.h index f57b7aae..26999751 100644 --- a/src/stateless/trex_stream_api.h +++ b/src/stateless/trex_stream_api.h @@ -22,7 +22,11 @@ limitations under the License. #define __TREX_STREAM_API_H__ #include <unordered_map> +#include <vector> #include <stdint.h> +#include <string> + +#include <trex_stream_vm.h> class TrexRpcCmdAddStream; @@ -33,6 +37,7 @@ class TrexRpcCmdAddStream; class TrexStream { /* provide the RPC parser a way to access private fields */ friend class TrexRpcCmdAddStream; + friend class TrexRpcCmdGetStream; friend class TrexStreamTable; public: @@ -51,17 +56,21 @@ private: /* config fields */ double m_isg_usec; - uint32_t m_next_stream_id; + int m_next_stream_id; /* indicators */ bool m_enabled; bool m_self_start; /* pkt */ - uint8_t *m_pkt; - uint16_t m_pkt_len; + struct { + uint8_t *binary; + uint16_t len; + std::string meta; + } m_pkt; /* VM */ + StreamVm m_vm; /* RX check */ struct { @@ -72,6 +81,7 @@ private: } m_rx_check; + }; /** @@ -82,6 +92,11 @@ 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) { } + + uint32_t get_pps() { + return m_pps; + } + protected: uint32_t m_pps; }; @@ -157,6 +172,21 @@ public: */ TrexStream * get_stream_by_id(uint32_t stream_id); + /** + * populate a list with all the stream IDs + * + * @author imarom (06-Sep-15) + * + * @param stream_list + */ + void get_stream_list(std::vector<uint32_t> &stream_list); + + /** + * get the table size + * + */ + int size(); + private: /** * holds all the stream in a hash table by stream id |