diff --git a/server/pcaptxttagstats.cpp b/server/pcaptxttagstats.cpp index fc5c990..2a4c905 100644 --- a/server/pcaptxttagstats.cpp +++ b/server/pcaptxttagstats.cpp @@ -182,61 +182,3 @@ bool PcapTxTtagStats::isDirectional() { return isDirectional_; } - -// FIXME: moved to PcapSession, remove from here -// XXX: Implemented as reset on read -QString PcapTxTtagStats::debugStats() -{ - QString dbgStats; - - if (!handle_) - return QString(); - -#ifdef Q_OS_WIN32 - static_assert(sizeof(struct pcap_stat) == 6*sizeof(uint), - "pcap_stat has less or more than 6 values"); - int size; - struct pcap_stat incPcapStats; - struct pcap_stat *pcapStats = pcap_stats_ex(handle_, &size); - if (pcapStats && (uint(size) >= 6*sizeof(uint))) { - incPcapStats.ps_recv = pcapStats->ps_recv - lastPcapStats_.ps_recv; - incPcapStats.ps_drop = pcapStats->ps_drop - lastPcapStats_.ps_drop; - incPcapStats.ps_ifdrop = pcapStats->ps_ifdrop - lastPcapStats_.ps_ifdrop; - incPcapStats.ps_capt = pcapStats->ps_capt - lastPcapStats_.ps_capt; - incPcapStats.ps_sent = pcapStats->ps_sent - lastPcapStats_.ps_sent; - incPcapStats.ps_netdrop = pcapStats->ps_netdrop - lastPcapStats_.ps_netdrop; - dbgStats = QString("recv: %1 drop: %2 ifdrop: %3 " - "capt: %4 sent: %5 netdrop: %6") - .arg(incPcapStats.ps_recv) - .arg(incPcapStats.ps_drop) - .arg(incPcapStats.ps_ifdrop) - .arg(incPcapStats.ps_capt) - .arg(incPcapStats.ps_sent) - .arg(incPcapStats.ps_netdrop); - lastPcapStats_ = *pcapStats; - } else { - dbgStats = QString("error reading pcap stats: %1") - .arg(pcap_geterr(handle_)); - } -#else - struct pcap_stat pcapStats; - struct pcap_stat incPcapStats; - - int ret = pcap_stats(handle_, &pcapStats); - if (ret == 0) { - incPcapStats.ps_recv = pcapStats.ps_recv - lastPcapStats_.ps_recv; - incPcapStats.ps_drop = pcapStats.ps_drop - lastPcapStats_.ps_drop; - incPcapStats.ps_ifdrop = pcapStats.ps_ifdrop - lastPcapStats_.ps_ifdrop; - dbgStats = QString("recv: %1 drop: %2 ifdrop: %3") - .arg(incPcapStats.ps_recv) - .arg(incPcapStats.ps_drop) - .arg(incPcapStats.ps_ifdrop); - lastPcapStats_ = pcapStats; - } else { - dbgStats = QString("error reading pcap stats: %1") - .arg(pcap_geterr(handle_)); - } -#endif - - return dbgStats; -} diff --git a/server/pcaptxttagstats.h b/server/pcaptxttagstats.h index 3905da9..5f36539 100644 --- a/server/pcaptxttagstats.h +++ b/server/pcaptxttagstats.h @@ -35,8 +35,6 @@ public: bool isRunning(); bool isDirectional(); - QString debugStats(); - private: enum State { kNotStarted,