aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-08-18 11:46:12 -0700
committerGerald Combs <gerald@wireshark.org>2015-08-20 23:12:37 +0000
commit2ed3d91b45332a2cbb4114b61f18c80fb28a6840 (patch)
tree1c37bec81ce931d54d8e0a3f59812dcdfe9c505f /epan/address.h
parent0f9bbbc6f7146747841760102a74efb96161ad99 (diff)
Add the WLAN statistics dialog.
Instead of splitting the stats into two lists as with the GTK+ UI, add everything to an expandable tree. This allows viewing nodes on more than one network. Rename the top-level Bluetooth menu item to Wireless and put the WLAN stats dialog there. The Qt UI matches SSIDs (WlanNetworkTreeWidgetItem::isMatch) a bit differently than the GTK+ UI. Try to make the logic as plain as possible since we'll likely have to update it in the future. The addition of a custom BSSID address types means that we can't assume that everything is AT_ETHER. Add routines for checking for broadcast BSSIDs and comparing only the data portions of addresses. Move PercentBarDelegate into its own module. Use it in WlanStatisticsDialog. Change-Id: Ie4214eb00671a890871380c4a07213ebfb7585c6 Reviewed-on: https://code.wireshark.org/review/10171 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/address.h')
-rw-r--r--epan/address.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/address.h b/epan/address.h
index c48cc7020d..5855d22641 100644
--- a/epan/address.h
+++ b/epan/address.h
@@ -143,6 +143,25 @@ addresses_equal(const address *addr1, const address *addr2) {
}
#define ADDRESSES_EQUAL(addr1, addr2) addresses_equal((addr1), (addr2))
+/** Check the data of two addresses for equality.
+ *
+ * Given two addresses, return "true" if they have the same length and,
+ * their data is equal, "false" otherwise.
+ * The address types are ignored. This can be used to compare custom
+ * address types defined with address_type_dissector_register.
+ *
+ * @param addr1 [in] The first address to compare.
+ * @param addr2 [in] The second address to compare.
+ * @return TRUE if the adresses are equal, FALSE otherwise.
+ */
+static inline gboolean
+addresses_data_equal(const address *addr1, const address *addr2) {
+ if ( addr1->len == addr2->len
+ && memcmp(addr1->data, addr2->data, addr1->len) == 0
+ ) return TRUE;
+ return FALSE;
+}
+
/** Copy an address, allocating a new buffer for the address data.
*
* @param to [in,out] The destination address.