summaryrefslogtreecommitdiffstats
path: root/src/stateless/messaging
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-12-13 18:15:22 +0200
committerimarom <imarom@cisco.com>2016-12-13 18:15:22 +0200
commit0fdd81a94d62592b0ec9888022d793f670c8476f (patch)
treeec52cd0f090793e26f67bc017d402b737acd71b5 /src/stateless/messaging
parent0c45815234abbb79b147b8093eb19e274ee65f52 (diff)
Major refactor - L2 / L3 modes for ports
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless/messaging')
-rw-r--r--src/stateless/messaging/trex_stateless_messaging.cpp13
-rw-r--r--src/stateless/messaging/trex_stateless_messaging.h31
2 files changed, 37 insertions, 7 deletions
diff --git a/src/stateless/messaging/trex_stateless_messaging.cpp b/src/stateless/messaging/trex_stateless_messaging.cpp
index dc656e67..2b8e93bb 100644
--- a/src/stateless/messaging/trex_stateless_messaging.cpp
+++ b/src/stateless/messaging/trex_stateless_messaging.cpp
@@ -317,7 +317,16 @@ TrexStatelessRxFeaturesToJson::handle(CRxCoreStateless *rx_core) {
}
bool
-TrexStatelessRxUpdateSrcAddr::handle(CRxCoreStateless *rx_core) {
- rx_core->get_rx_port_mngr(m_port_id).update_src_addr(m_src_addr);
+TrexStatelessRxSetL2Mode::handle(CRxCoreStateless *rx_core) {
+ rx_core->get_rx_port_mngr(m_port_id).set_l2_mode();
+
return true;
}
+
+bool
+TrexStatelessRxSetL3Mode::handle(CRxCoreStateless *rx_core) {
+ rx_core->get_rx_port_mngr(m_port_id).set_l3_mode(m_src_addr, m_is_grat_arp_needed);
+
+ return true;
+}
+
diff --git a/src/stateless/messaging/trex_stateless_messaging.h b/src/stateless/messaging/trex_stateless_messaging.h
index 5f00c244..dbdd9b56 100644
--- a/src/stateless/messaging/trex_stateless_messaging.h
+++ b/src/stateless/messaging/trex_stateless_messaging.h
@@ -569,13 +569,33 @@ private:
};
-class TrexStatelessRxUpdateSrcAddr : public TrexStatelessCpToRxMsgBase {
+/**
+ * updates the RX core that we are in L2 mode
+ */
+class TrexStatelessRxSetL2Mode : public TrexStatelessCpToRxMsgBase {
public:
- TrexStatelessRxUpdateSrcAddr(uint8_t port_id,
- const CManyIPInfo &src_addr) {
-
+ TrexStatelessRxSetL2Mode(uint8_t port_id) {
m_port_id = port_id;
- m_src_addr = src_addr;
+ }
+
+ virtual bool handle(CRxCoreStateless *rx_core);
+
+private:
+ uint8_t m_port_id;
+};
+
+/**
+ * updates the RX core that we are in a L3 mode
+ */
+class TrexStatelessRxSetL3Mode : public TrexStatelessCpToRxMsgBase {
+public:
+ TrexStatelessRxSetL3Mode(uint8_t port_id,
+ const CManyIPInfo &src_addr,
+ bool is_grat_arp_needed) {
+
+ m_port_id = port_id;
+ m_src_addr = src_addr;
+ m_is_grat_arp_needed = is_grat_arp_needed;
}
virtual bool handle(CRxCoreStateless *rx_core);
@@ -583,6 +603,7 @@ public:
private:
uint8_t m_port_id;
CManyIPInfo m_src_addr;
+ bool m_is_grat_arp_needed;
};
/**