aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c')
-rw-r--r--epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c b/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c
index 09947f8c31..67f43eae93 100644
--- a/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c
+++ b/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c
@@ -387,20 +387,7 @@ static void dissect_ansi_map_win_trigger_list(tvbuff_t *tvb, packet_info *pinfo
/* Transaction table */
-static GHashTable *TransactionId_table=NULL;
-
-static void
-ansi_map_init(void)
-{
- TransactionId_table = g_hash_table_new(g_str_hash, g_str_equal);
-}
-
-static void
-ansi_map_cleanup(void)
-{
- /* Destroy any existing memory chunks / hashes. */
- g_hash_table_destroy(TransactionId_table);
-}
+static wmem_map_t *TransactionId_table=NULL;
/* Store Invoke information needed for the corresponding reply */
static void
@@ -432,7 +419,7 @@ update_saved_invokedata(packet_info *pinfo, struct ansi_tcap_private_t *p_privat
break;
}
/* If the entry allready exists don't owervrite it */
- ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf);
+ ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)wmem_map_lookup(TransactionId_table,buf);
if(ansi_map_saved_invokedata)
return;
@@ -440,7 +427,7 @@ update_saved_invokedata(packet_info *pinfo, struct ansi_tcap_private_t *p_privat
ansi_map_saved_invokedata->opcode = p_private_tcap->d.OperationCode_private;
ansi_map_saved_invokedata->ServiceIndicator = ServiceIndicator;
- g_hash_table_insert(TransactionId_table,
+ wmem_map_insert(TransactionId_table,
wmem_strdup(wmem_file_scope(), buf),
ansi_map_saved_invokedata);
@@ -4363,7 +4350,7 @@ find_saved_invokedata(asn1_ctx_t *actx, struct ansi_tcap_private_t *p_private_tc
}
/*g_warning("Find Hash string %s pkt: %u",buf,actx->pinfo->num);*/
- ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf);
+ ansi_map_saved_invokedata = (struct ansi_map_invokedata_t *)wmem_map_lookup(TransactionId_table, buf);
if(ansi_map_saved_invokedata){
OperationCode = ansi_map_saved_invokedata->opcode & 0xff;
ServiceIndicator = ansi_map_saved_invokedata->ServiceIndicator;
@@ -5499,8 +5486,7 @@ void proto_register_ansi_map(void) {
"Type of matching invoke/response, risk of mismatch if loose matching chosen",
&ansi_map_response_matching_type, ansi_map_response_matching_type_values, FALSE);
- register_init_routine(&ansi_map_init);
- register_cleanup_routine(&ansi_map_cleanup);
+ TransactionId_table = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), wmem_str_hash, g_str_equal);
register_stat_tap_table_ui(&stat_table);
}