summaryrefslogtreecommitdiffstats
path: root/src/stateless
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-12-19 08:52:08 +0200
committerimarom <imarom@cisco.com>2016-12-19 08:52:37 +0200
commitf51c210af7b067a36e6750d94b48ae366a48dd5c (patch)
tree4d72169f38e0dc4a91dda8a678aa67ca1cf112c9 /src/stateless
parent3859a48b255bf4254f7897b5525a330a856bfad4 (diff)
verify L2/L3 configuration cannot be done under traffic
also ping and arp Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/stateless')
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp
index e41cc88c..3a4db196 100644
--- a/src/stateless/cp/trex_stateless_port.cpp
+++ b/src/stateless/cp/trex_stateless_port.cpp
@@ -1004,6 +1004,9 @@ TrexStatelessPort::get_rx_queue_pkts() {
void
TrexStatelessPort::set_l2_mode(const uint8_t *dest_mac) {
+ /* not valid under traffic */
+ verify_state(PORT_STATE_IDLE | PORT_STATE_STREAMS, "set_l2_mode");
+
/* no IPv4 src */
getPortAttrObj()->set_src_ipv4(0);
@@ -1020,6 +1023,9 @@ TrexStatelessPort::set_l2_mode(const uint8_t *dest_mac) {
void
TrexStatelessPort::set_l3_mode(uint32_t src_ipv4, uint32_t dest_ipv4) {
+ /* not valid under traffic */
+ verify_state(PORT_STATE_IDLE | PORT_STATE_STREAMS, "set_l3_mode");
+
/* set src IPv4 */
getPortAttrObj()->set_src_ipv4(src_ipv4);
@@ -1041,6 +1047,8 @@ TrexStatelessPort::set_l3_mode(uint32_t src_ipv4, uint32_t dest_ipv4) {
void
TrexStatelessPort::set_l3_mode(uint32_t src_ipv4, uint32_t dest_ipv4, const uint8_t *resolved_mac) {
+ verify_state(PORT_STATE_IDLE | PORT_STATE_STREAMS, "set_l3_mode");
+
/* set src IPv4 */
getPortAttrObj()->set_src_ipv4(src_ipv4);