diff options
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 1 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.h | 1 | ||||
-rw-r--r-- | ui/qt/wlan_statistics_dialog.cpp | 43 |
3 files changed, 34 insertions, 11 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index bc928cf219..ce1b3e32af 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -12896,6 +12896,7 @@ dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, guint32 option_flags, if( IS_RETRY(flags) ) { expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry); + wlan_stats.fc_retry = 1; } } proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA); diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h index 4e4acb43f2..a8128378f5 100644 --- a/epan/dissectors/packet-ieee80211.h +++ b/epan/dissectors/packet-ieee80211.h @@ -242,6 +242,7 @@ typedef struct _wlan_stats { guint8 ssid_len; guchar ssid[MAX_SSID_LEN]; gchar protection[MAX_PROTECT_LEN]; + gboolean fc_retry; } wlan_stats_t; typedef struct _wlan_hdr { 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_); } } |