aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/camel/packet-camel-template.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/asn1/camel/packet-camel-template.c')
-rw-r--r--epan/dissectors/asn1/camel/packet-camel-template.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/epan/dissectors/asn1/camel/packet-camel-template.c b/epan/dissectors/asn1/camel/packet-camel-template.c
index 78df8f9bc3..bc463d59e7 100644
--- a/epan/dissectors/asn1/camel/packet-camel-template.c
+++ b/epan/dissectors/asn1/camel/packet-camel-template.c
@@ -165,7 +165,7 @@ const char *camel_obj_id = NULL;
gboolean is_ExtensionField =FALSE;
/* Global hash tables*/
-static GHashTable *srt_calls = NULL;
+static wmem_map_t *srt_calls = NULL;
static guint32 camelsrt_global_SessionId=1;
static int camel_opcode_type;
@@ -441,7 +441,7 @@ static struct camelsrt_call_t *
find_camelsrt_call(struct camelsrt_call_info_key_t *p_camelsrt_call_key)
{
struct camelsrt_call_t *p_camelsrt_call = NULL;
- p_camelsrt_call = (struct camelsrt_call_t *)g_hash_table_lookup(srt_calls, p_camelsrt_call_key);
+ p_camelsrt_call = (struct camelsrt_call_t *)wmem_map_lookup(srt_calls, p_camelsrt_call_key);
#ifdef DEBUG_CAMELSRT
if(p_camelsrt_call) {
@@ -486,7 +486,7 @@ new_camelsrt_call(struct camelsrt_call_info_key_t *p_camelsrt_call_key)
dbg(10,"D%d ", p_new_camelsrt_call->session_id);
#endif
/* store it */
- g_hash_table_insert(srt_calls, p_new_camelsrt_call_key, p_new_camelsrt_call);
+ wmem_map_insert(srt_calls, p_new_camelsrt_call_key, p_new_camelsrt_call);
return p_new_camelsrt_call;
}
@@ -497,8 +497,6 @@ new_camelsrt_call(struct camelsrt_call_info_key_t *p_camelsrt_call_key)
static void
camelsrt_init_routine(void)
{
- /* create new hash-table for SRT */
- srt_calls = g_hash_table_new(camelsrt_call_hash, camelsrt_call_equal);
/* Reset the session counter */
camelsrt_global_SessionId=1;
@@ -509,13 +507,6 @@ camelsrt_init_routine(void)
gcamel_DisplaySRT=gcamel_PersistentSRT || gcamel_HandleSRT&gcamel_StatSRT;
}
-static void
-camelsrt_cleanup_routine(void)
-{
- /* free hash-table for SRT */
- g_hash_table_destroy(srt_calls);
-}
-
/*
* Update a record with the data of the Request
@@ -566,7 +557,7 @@ camelsrt_close_call_matching(packet_info *pinfo,
p_camelsrt_info->msginfo[CAMELSRT_SESSION].req_time = p_camelsrt_call->category[CAMELSRT_SESSION].req_time;
if ( !gcamel_PersistentSRT ) {
- g_hash_table_remove(srt_calls, &camelsrt_call_key);
+ wmem_map_remove(srt_calls, &camelsrt_call_key);
#ifdef DEBUG_CAMELSRT
dbg(20,"remove hash ");
#endif
@@ -629,7 +620,7 @@ camelsrt_begin_call_matching(packet_info *pinfo,
dbg(10,"\n Session begin #%u\n", pinfo->num);
dbg(11,"Search key %lu ",camelsrt_call_key.SessionIdKey);
#endif
- p_camelsrt_call = (struct camelsrt_call_t *)g_hash_table_lookup(srt_calls, &camelsrt_call_key);
+ p_camelsrt_call = (struct camelsrt_call_t *)wmem_map_lookup(srt_calls, &camelsrt_call_key);
if (p_camelsrt_call) {
/* We have seen this request before -> do nothing */
#ifdef DEBUG_CAMELSRT
@@ -1598,7 +1589,10 @@ void proto_register_camel(void) {
/* Routine for statistic */
register_init_routine(&camelsrt_init_routine);
- register_cleanup_routine(&camelsrt_cleanup_routine);
+
+ /* create new hash-table for SRT */
+ srt_calls = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), camelsrt_call_hash, camelsrt_call_equal);
+
camel_tap=register_tap(PSNAME);
register_srt_table(proto_camel, PSNAME, 1, camelstat_packet, camelstat_init, NULL);