From 68734c44ca4f2ff64bf9478170d2b24c9d6e1e26 Mon Sep 17 00:00:00 2001 From: Srivats P Date: Fri, 31 Mar 2023 18:21:36 +0530 Subject: [PATCH] Delete PcapTxTtagSession::debugStats debugStats() was moved to base class PcapSession earlier, but removing it from here was missed out --- server/pcaptxttagstats.cpp | 58 -------------------------------------- server/pcaptxttagstats.h | 2 -- 2 files changed, 60 deletions(-) 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,