summaryrefslogtreecommitdiff
path: root/ui/qt/wlan_statistics_dialog.cpp
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2016-10-18 16:13:03 +0200
committerAnders Broman <a.broman58@gmail.com>2016-10-20 04:58:34 +0000
commitf252831b43269dd06487cdf3e5e791ecc991bf3d (patch)
treece5ab7c703f26a132ac5591d71fe64bd20921227 /ui/qt/wlan_statistics_dialog.cpp
parent404c31492be8b01d1b6bf9944ea3bb71feb92dd6 (diff)
downloadwireshark-f252831b43269dd06487cdf3e5e791ecc991bf3d.tar.gz
wlan_statistics_dialog: Add number of retry
Change-Id: I27194670dcd2e6c2ec6502c562e50ee6925c4c45 Reviewed-on: https://code.wireshark.org/review/18306 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/wlan_statistics_dialog.cpp')
-rw-r--r--ui/qt/wlan_statistics_dialog.cpp43
1 files changed, 32 insertions, 11 deletions
diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp
index 8d9b640a1d..e66c154165 100644
--- a/ui/qt/wlan_statistics_dialog.cpp
+++ b/ui/qt/wlan_statistics_dialog.cpp
@@ -43,6 +43,7 @@ enum {
col_channel_,
col_ssid_,
col_pct_packets_,
+ col_retry_packets_,
col_beacons_,
col_data_packets_,
col_probe_reqs_,
@@ -64,6 +65,7 @@ public:
WlanStationTreeWidgetItem(address *addr) :
QTreeWidgetItem (wlan_station_row_type_),
packets_(0),
+ retry_(0),
sent_(0),
received_(0),
probe_req_(0),
@@ -81,6 +83,10 @@ public:
void update(wlan_hdr_t *wlan_hdr) {
bool is_sender = addresses_equal(&addr_, &wlan_hdr->src);
+ if (wlan_hdr->stats.fc_retry != 0) {
+ retry_++;
+ }
+
// XXX Should we count received probes and auths? This is what the
// GTK+ UI does, but it seems odd.
switch (wlan_hdr->type) {
@@ -123,6 +129,7 @@ public:
setData(col_pct_packets_, Qt::UserRole, QVariant::fromValue<double>(packets_ * 100.0 / num_packets));
setText(col_beacons_, QString::number(sent_));
setText(col_data_packets_, QString::number(received_));
+ setText(col_retry_packets_, QString::number(retry_));
setText(col_probe_reqs_, QString::number(probe_req_));
setText(col_probe_resps_, QString::number(probe_resp_));
setText(col_auths_, QString::number(auth_));
@@ -157,6 +164,8 @@ public:
return deauth_ < other_row->deauth_;
case col_others_:
return other_ < other_row->other_;
+ case col_retry_packets_:
+ return retry_ < other_row->retry_;
default:
break;
}
@@ -166,7 +175,7 @@ public:
QList<QVariant> rowData() {
return QList<QVariant>()
<< address_to_qstring(&addr_)
- << data(col_pct_packets_, Qt::UserRole).toDouble()
+ << data(col_pct_packets_, Qt::UserRole).toDouble() << retry_
<< sent_ << received_ << probe_req_ << probe_resp_
<< auth_ << deauth_ << other_ << text(col_protection_);
}
@@ -179,6 +188,7 @@ public:
private:
address addr_;
int packets_;
+ int retry_;
int sent_;
int received_;
int probe_req_;
@@ -186,6 +196,7 @@ private:
int auth_;
int deauth_;
int other_;
+
};
class WlanNetworkTreeWidgetItem : public QTreeWidgetItem
@@ -195,6 +206,7 @@ public:
QTreeWidgetItem (parent, wlan_network_row_type_),
beacon_(0),
data_packet_(0),
+ retry_packet_(0),
probe_req_(0),
probe_resp_(0),
auth_(0),
@@ -296,6 +308,10 @@ public:
if (text(col_protection_).isEmpty() && wlan_hdr->stats.protection[0] != 0) {
setText(col_protection_, wlan_hdr->stats.protection);
}
+ if (wlan_hdr->stats.fc_retry != 0) {
+ retry_packet_++;
+ }
+
switch (wlan_hdr->type) {
case MGT_PROBE_REQ:
probe_req_++;
@@ -351,6 +367,7 @@ public:
void draw(int num_packets) {
if (channel_ > 0) setText(col_channel_, QString::number(channel_));
setData(col_pct_packets_, Qt::UserRole, QVariant::fromValue<double>(packets_ * 100.0 / num_packets));
+ setText(col_retry_packets_, QString::number(retry_packet_));
setText(col_beacons_, QString::number(beacon_));
setText(col_data_packets_, QString::number(data_packet_));
setText(col_probe_reqs_, QString::number(probe_req_));
@@ -412,8 +429,9 @@ public:
return QList<QVariant>()
<< address_to_qstring(&bssid_) << channel_ << text(col_ssid_)
<< data(col_pct_packets_, Qt::UserRole).toDouble()
- << beacon_ << data_packet_ << probe_req_ << probe_resp_
- << auth_ << deauth_ << other_ << text(col_protection_);
+ << retry_packet_ << beacon_ << data_packet_ << probe_req_
+ << probe_resp_ << auth_ << deauth_ << other_
+ << text(col_protection_);
}
const QString filterExpression() {
@@ -434,12 +452,14 @@ private:
QByteArray ssid_;
int beacon_;
int data_packet_;
+ int retry_packet_;
int probe_req_;
int probe_resp_;
int auth_;
int deauth_;
int other_;
int packets_;
+ int retry_packets_;
// Adding items one at a time is slow. Gather up the stations in a list
// and add them all at once later.
@@ -453,9 +473,9 @@ private:
};
static const QString network_col_0_title_ = QObject::tr("BSSID");
-static const QString network_col_4_title_ = QObject::tr("Beacons");
-static const QString network_col_5_title_ = QObject::tr("Data Pkts");
-static const QString network_col_11_title_ = QObject::tr("Protection");
+static const QString network_col_5_title_ = QObject::tr("Beacons");
+static const QString network_col_6_title_ = QObject::tr("Data Pkts");
+static const QString network_col_12_title_ = QObject::tr("Protection");
static const QString node_col_0_title_ = QObject::tr("Address");
static const QString node_col_4_title_ = QObject::tr("Pkts Sent");
@@ -470,8 +490,8 @@ WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, con
loadGeometry(parent.width() * 4 / 5, parent.height() * 3 / 4, "WlanStatisticsDialog");
QStringList header_labels = QStringList()
- << "" << tr("Channel") << tr("SSID") << tr("Percent Packets") << "" << ""
- << tr("Probe Reqs") << tr("Probe Resp") << tr("Auths")
+ << "" << tr("Channel") << tr("SSID") << tr("Percent Packets") << tr("Retry Packets")
+ << "" << "" << tr("Probe Reqs") << tr("Probe Resp") << tr("Auths")
<< tr("Deauths") << tr("Other");
statsTreeWidget()->setHeaderLabels(header_labels);
updateHeaderLabels();
@@ -489,6 +509,7 @@ WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, con
statsTreeWidget()->setColumnWidth(col, one_em * 8);
break;
case col_pct_packets_:
+ case col_retry_packets_:
case col_protection_:
statsTreeWidget()->setColumnWidth(col, one_em * 6);
break;
@@ -627,9 +648,9 @@ void WlanStatisticsDialog::updateHeaderLabels()
statsTreeWidget()->headerItem()->setText(col_protection_, node_col_11_title_);
} else {
statsTreeWidget()->headerItem()->setText(col_bssid_, network_col_0_title_);
- statsTreeWidget()->headerItem()->setText(col_beacons_, network_col_4_title_);
- statsTreeWidget()->headerItem()->setText(col_data_packets_, network_col_5_title_);
- statsTreeWidget()->headerItem()->setText(col_protection_, network_col_11_title_);
+ statsTreeWidget()->headerItem()->setText(col_beacons_, network_col_5_title_);
+ statsTreeWidget()->headerItem()->setText(col_data_packets_, network_col_6_title_);
+ statsTreeWidget()->headerItem()->setText(col_protection_, network_col_12_title_);
}
}