summaryrefslogtreecommitdiff
path: root/ui/qt/wlan_statistics_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-08-21 09:45:48 -0700
committerGerald Combs <gerald@wireshark.org>2015-08-21 17:13:11 +0000
commitdd2a2d432a0c1e7ca5b0fe56da8624619f23e35d (patch)
tree289d91d093096c38e06337c2145fc17032a164d3 /ui/qt/wlan_statistics_dialog.cpp
parent69ec4a553050e56cc97ad48a512b3f41453ffa53 (diff)
downloadwireshark-dd2a2d432a0c1e7ca5b0fe56da8624619f23e35d.tar.gz
Multicast and wireless lan statistics fixups.
Make sure "-z multicast,stat[,filter]" and "-z wlan,stat[,filter]" work. Add some missing "-z" items to the man page. Try to fix some MSVC++ warnings. Change-Id: Ie18e5355d595e351f000f14d82781dcdf33141c3 Reviewed-on: https://code.wireshark.org/review/10184 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/wlan_statistics_dialog.cpp')
-rw-r--r--ui/qt/wlan_statistics_dialog.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp
index 5331b6c335..3855de86fe 100644
--- a/ui/qt/wlan_statistics_dialog.cpp
+++ b/ui/qt/wlan_statistics_dialog.cpp
@@ -77,10 +77,10 @@ public:
setText(col_bssid_, address_to_qstring(&addr_));
}
bool isMatch(address *addr) {
- return (addresses_equal(&addr_, addr)) == TRUE;
+ return addresses_equal(&addr_, addr);
}
void update(wlan_hdr_t *wlan_hdr) {
- bool is_sender = addresses_equal(&addr_, &wlan_hdr->src) == TRUE;
+ bool is_sender = addresses_equal(&addr_, &wlan_hdr->src);
// XXX Should we count received probes and auths? This is what the
// GTK+ UI does, but it seems odd.
@@ -448,7 +448,7 @@ private:
void updateBssid(wlan_hdr_t *wlan_hdr) {
copy_address(&bssid_, &wlan_hdr->bssid);
- is_broadcast_ = is_broadcast_bssid(&bssid_) == TRUE;
+ is_broadcast_ = is_broadcast_bssid(&bssid_);
setText(col_bssid_, address_to_qstring(&bssid_));
}
};
@@ -463,7 +463,7 @@ static const QString node_col_4_title_ = QObject::tr("Pkts Sent");
static const QString node_col_5_title_ = QObject::tr("Pkts Received");
static const QString node_col_11_title_ = QObject::tr("Comment");
-WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *) :
+WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, const char *filter) :
TapParameterDialog(parent, cf, HELP_STATS_WLAN_TRAFFIC_DIALOG)
{
setWindowSubtitle(tr("Wireless LAN Statistics"));
@@ -504,6 +504,10 @@ WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, con
addFilterActions();
+ if (filter) {
+ setDisplayFilter(filter);
+ }
+
connect(statsTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
this, SLOT(updateHeaderLabels()));
}
@@ -644,8 +648,13 @@ void WlanStatisticsDialog::captureFileClosing()
// Stat command + args
static void
-wlan_statistics_init(const char *, void*) {
- wsApp->emitStatCommandSignal("WlanStatistics", NULL, NULL);
+wlan_statistics_init(const char *args, void*) {
+ QStringList args_l = QString(args).split(',');
+ QByteArray filter;
+ if (args_l.length() > 2) {
+ filter = QStringList(args_l.mid(2)).join(",").toUtf8();
+ }
+ wsApp->emitStatCommandSignal("WlanStatistics", filter.constData(), NULL);
}
static stat_tap_ui wlan_statistics_ui = {