diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-09-27 14:24:32 +0300 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-10-05 10:45:29 +0300 |
commit | efb8873783d59ae2e5a870a99f05e40ebf661c16 (patch) | |
tree | d1ad7c06f55a532ae1b1349a24bb0aa067def4a8 /src/pre_test.h | |
parent | 2223955b8eb3b378c1ab79e3735ed340852b04b9 (diff) |
pre test: Code review fixes
Diffstat (limited to 'src/pre_test.h')
-rw-r--r-- | src/pre_test.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/pre_test.h b/src/pre_test.h index 7bbeb40d..ad7608a6 100644 --- a/src/pre_test.h +++ b/src/pre_test.h @@ -27,6 +27,18 @@ #include "bp_sim.h" #include "trex_defs.h" +class CPreTestStats { + public: + uint32_t m_rx_arp; // how many ARP packets we received + uint32_t m_tx_arp; // how many ARP packets we sent + + public: + void clear() { + m_rx_arp = 0; + m_tx_arp = 0; + } +}; + class CPretestPortInfo { friend class CPretest; @@ -41,6 +53,7 @@ class CPretestPortInfo { CPretestPortInfo() { m_state = INIT_NEEDED; m_is_loopback = false; + m_stats.clear(); } void dump(FILE *fd); uint8_t *create_arp_req(uint16_t &pkt_size, uint8_t port, bool is_grat); @@ -55,6 +68,7 @@ class CPretestPortInfo { uint8_t m_dst_mac[6]; enum CPretestPortInfoStates m_state; bool m_is_loopback; + CPreTestStats m_stats; }; @@ -64,6 +78,7 @@ class CPretest { m_max_ports = max_ports; } bool get_mac(uint16_t port, uint32_t ip, uint8_t *mac); + CPreTestStats get_stats(uint16_t port_id); bool is_loopback(uint16_t port); void set_port_params(uint16_t port_id, const CPerPortIPCfg &port_cfg, const uint8_t *src_mac, bool resolve_needed); bool resolve_all(); |