summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gtpv2.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-gtpv2.c')
-rw-r--r--epan/dissectors/packet-gtpv2.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/epan/dissectors/packet-gtpv2.c b/epan/dissectors/packet-gtpv2.c
index dc4a820..4953729 100644
--- a/epan/dissectors/packet-gtpv2.c
+++ b/epan/dissectors/packet-gtpv2.c
@@ -1561,12 +1561,15 @@ gtpv2_sn_equal_unmatched(gconstpointer k1, gconstpointer k2)
return key1->seq_nr == key2->seq_nr;
}
-static wmem_map_t *gtpv2_stat_msg_idx_hash = NULL;
+static GHashTable *gtpv2_stat_msg_idx_hash = NULL;
static void
gtpv2_stat_init(struct register_srt* srt _U_, GArray*srt_array)
{
- gtpv2_stat_msg_idx_hash = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
+ if (gtpv2_stat_msg_idx_hash != NULL) {
+ g_hash_table_destroy(gtpv2_stat_msg_idx_hash);
+ }
+ gtpv2_stat_msg_idx_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
init_srt_table("GTPv2 Requests", NULL, srt_array, 0, NULL, NULL, NULL);
}
@@ -1596,13 +1599,13 @@ gtpv2_stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const
* (requests and responses have different message types, and we
* only use the request value.)
*/
- idx = GPOINTER_TO_UINT(wmem_map_lookup(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype)));
+ idx = GPOINTER_TO_UINT(g_hash_table_lookup(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype)));
/* Store the row value incremented by 1 to distinguish 0 from NULL */
if (idx == 0) {
- idx = wmem_map_size(gtpv2_stat_msg_idx_hash);
- wmem_map_insert(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype), GUINT_TO_POINTER(idx + 1));
- init_srt_table_row(gtpv2_srt_table, idx, val_to_str_ext(gcrp->msgtype, &gtpv2_message_type_vals_ext, "Unknown (%d)"));
+ idx = g_hash_table_size(gtpv2_stat_msg_idx_hash);
+ g_hash_table_insert(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype), GUINT_TO_POINTER(idx + 1));
+ init_srt_table_row(gtpv2_srt_table, idx, val_to_str_ext_const(gcrp->msgtype, &gtpv2_message_type_vals_ext, "Unknown"));
} else {
idx -= 1;
}
@@ -8956,6 +8959,7 @@ dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
}
static int
+// NOLINTNEXTLINE(misc-no-recursion)
dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
{
proto_tree *gtpv2_tree;
@@ -9137,7 +9141,9 @@ dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data
new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
col_append_str(pinfo->cinfo, COL_INFO, " / ");
col_set_fence(pinfo->cinfo, COL_INFO);
+ increment_dissection_depth(pinfo);
dissect_gtpv2(new_p_tvb, pinfo, tree, NULL);
+ decrement_dissection_depth(pinfo);
}
return tvb_captured_length(tvb);