diff options
author | imarom <imarom@cisco.com> | 2016-11-03 16:33:52 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-11-03 16:33:52 +0200 |
commit | 234779fd32e747f4ac918f3c39e59618dde0f2d7 (patch) | |
tree | 2ba641354b6d6c751f94de44f9453dcbec0e19aa /src/stateless/messaging | |
parent | 0ed685e077e8533ffe6d96f5d1fefcdd42626763 (diff) |
moved RX filter feature to port attr
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless/messaging')
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.cpp | 19 | ||||
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.h | 27 |
2 files changed, 34 insertions, 12 deletions
diff --git a/src/stateless/messaging/trex_stateless_messaging.cpp b/src/stateless/messaging/trex_stateless_messaging.cpp index 10b4355b..6e7bfee5 100644 --- a/src/stateless/messaging/trex_stateless_messaging.cpp +++ b/src/stateless/messaging/trex_stateless_messaging.cpp @@ -241,13 +241,13 @@ TrexDpPortEventMsg::handle() { } /************************* messages from CP to RX **********************/ -bool TrexStatelessRxStartMsg::handle (CRxCoreStateless *rx_core) { - rx_core->work(); +bool TrexStatelessRxEnableLatency::handle (CRxCoreStateless *rx_core) { + rx_core->enable_latency(); return true; } -bool TrexStatelessRxStopMsg::handle (CRxCoreStateless *rx_core) { - rx_core->idle(); +bool TrexStatelessRxDisableLatency::handle (CRxCoreStateless *rx_core) { + rx_core->disable_latency(); return true; } @@ -263,8 +263,15 @@ TrexStatelessRxSwGetPkts::TrexStatelessRxSwGetPkts(uint8_t port_id, TrexStateles bool -TrexStatelessRxSetFilterMode::handle(CRxCoreStateless *rx_core) { - rx_core->set_rx_filter_mode(m_port_id, m_filter_mode); +TrexStatelessRxStartCapture::handle(CRxCoreStateless *rx_core) { + rx_core->start_capture(m_port_id, m_pcap_filename, m_limit); + + return true; +} + +bool +TrexStatelessRxStopCapture::handle(CRxCoreStateless *rx_core) { + rx_core->stop_capture(m_port_id); return true; } diff --git a/src/stateless/messaging/trex_stateless_messaging.h b/src/stateless/messaging/trex_stateless_messaging.h index 42a422b0..e96e83d6 100644 --- a/src/stateless/messaging/trex_stateless_messaging.h +++ b/src/stateless/messaging/trex_stateless_messaging.h @@ -408,11 +408,11 @@ public: }; -class TrexStatelessRxStartMsg : public TrexStatelessCpToRxMsgBase { +class TrexStatelessRxEnableLatency : public TrexStatelessCpToRxMsgBase { bool handle (CRxCoreStateless *rx_core); }; -class TrexStatelessRxStopMsg : public TrexStatelessCpToRxMsgBase { +class TrexStatelessRxDisableLatency : public TrexStatelessCpToRxMsgBase { bool handle (CRxCoreStateless *rx_core); }; @@ -421,17 +421,32 @@ class TrexStatelessRxQuit : public TrexStatelessCpToRxMsgBase { }; -class TrexStatelessRxSetFilterMode : public TrexStatelessCpToRxMsgBase { +class TrexStatelessRxStartCapture : public TrexStatelessCpToRxMsgBase { public: - TrexStatelessRxSetFilterMode(uint8_t port_id, rx_filter_mode_e filter_mode) { + TrexStatelessRxStartCapture(uint8_t port_id, const std::string &pcap_filename, uint64_t limit) : m_pcap_filename(pcap_filename) { m_port_id = port_id; - m_filter_mode = filter_mode; + m_limit = limit; } + + virtual bool handle(CRxCoreStateless *rx_core); + +private: + uint8_t m_port_id; + std::string m_pcap_filename; + uint64_t m_limit; +}; + + +class TrexStatelessRxStopCapture : public TrexStatelessCpToRxMsgBase { +public: + TrexStatelessRxStopCapture(uint8_t port_id) { + m_port_id = port_id; + } + virtual bool handle(CRxCoreStateless *rx_core); private: uint8_t m_port_id; - rx_filter_mode_e m_filter_mode; }; |