aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee802154.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-10-26 08:31:16 +0000
committerGuy Harris <guy@alum.mit.edu>2010-10-26 08:31:16 +0000
commit0f96301a3e574b5453df2540b9d8b9e3ef2af8f8 (patch)
treee2673fec6aada376e7845a0a9df5391ae357b5af /epan/dissectors/packet-ieee802154.c
parenta3eff92edc45da4da5c15b40af8fbbb82aa4ce2c (diff)
You may not use g_int64_hash() or g_int64_equal(), as they are not
present in the minimum version of GLib that we support. Create a ieee802154_long_addr structure for long addresses, create hash routines for those addresses, and use them. svn path=/trunk/; revision=34651
Diffstat (limited to 'epan/dissectors/packet-ieee802154.c')
-rw-r--r--epan/dissectors/packet-ieee802154.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c
index 1f10f91ac5..463b17f1d8 100644
--- a/epan/dissectors/packet-ieee802154.c
+++ b/epan/dissectors/packet-ieee802154.c
@@ -2226,6 +2226,18 @@ gboolean ieee802154_short_addr_equal(gconstpointer a, gconstpointer b)
(((ieee802154_short_addr *)a)->addr == ((ieee802154_short_addr *)b)->addr);
}
+/* Key hash function. */
+guint ieee802154_long_addr_hash(gconstpointer key)
+{
+ return (((ieee802154_long_addr *)key)->addr) & 0xFFFFFFFF;
+}
+
+/* Key equal function. */
+gboolean ieee802154_long_addr_equal(gconstpointer a, gconstpointer b)
+{
+ return (((ieee802154_long_addr *)a)->addr == ((ieee802154_long_addr *)b)->addr);
+}
+
/*FUNCTION:------------------------------------------------------
* NAME
* ieee802154_addr_update
@@ -2821,9 +2833,7 @@ proto_init_ieee802154(void)
/* Create the hash tables. */
ieee802154_addr.short_table = g_hash_table_new(ieee802154_short_addr_hash, ieee802154_short_addr_equal);
-#if GLIB_CHECK_VERSION(2,22,0)
- ieee802154_addr.long_table = g_hash_table_new(g_int64_hash, g_int64_equal);
-#endif
+ ieee802154_addr.long_table = g_hash_table_new(ieee802154_long_addr_hash, ieee802154_long_addr_equal);
/* Re-load the hash table from the static address UAT. */
for (i=0; (i<num_static_addrs) && (static_addrs); i++) {
ieee802154_addr_update(&ieee802154_addr,(guint16)static_addrs[i].addr16, (guint16)static_addrs[i].pan,