diff options
author | Michael Mann <mmann78@netscape.net> | 2016-07-19 16:11:55 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-07-20 06:00:35 +0000 |
commit | 9c9fd67d8b8476176046838c3f36e7defcbaff33 (patch) | |
tree | caa05c738fa2b19fb6d64ec260baf0dc9fbe6bdb /epan/dissectors/asn1/nbap/packet-nbap-template.c | |
parent | 29a98d1c7f09cba3a1e20ae6bfce76cf13e134fe (diff) |
packet-nbap.c: Convert some g_ APIs to wmem.
Change-Id: I480dd5c533b53cc90e483f42e974c5f3e660e305
Reviewed-on: https://code.wireshark.org/review/16548
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/nbap/packet-nbap-template.c')
-rw-r--r-- | epan/dissectors/asn1/nbap/packet-nbap-template.c | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/epan/dissectors/asn1/nbap/packet-nbap-template.c b/epan/dissectors/asn1/nbap/packet-nbap-template.c index 41ade24a36..acf2310209 100644 --- a/epan/dissectors/asn1/nbap/packet-nbap-template.c +++ b/epan/dissectors/asn1/nbap/packet-nbap-template.c @@ -183,7 +183,7 @@ gint hrnti; guint node_b_com_context_id; -static GTree * edch_flow_port_map = NULL; +static wmem_tree_t* edch_flow_port_map = NULL; /*Stuff for mapping NodeB-Comuncation Context ID to CRNC Communication Context ID*/ typedef struct com_ctxt_{ @@ -193,7 +193,7 @@ typedef struct com_ctxt_{ }nbap_com_context_id_t; gboolean crcn_context_present = FALSE; -static GTree * com_context_map; +static wmem_tree_t* com_context_map; struct _nbap_msg_info_for_fp g_nbap_msg_info_for_fp; @@ -421,43 +421,20 @@ static void add_hsdsch_bind(packet_info *pinfo){ } } -static gint nbap_key_cmp(gconstpointer a_ptr, gconstpointer b_ptr, gpointer ignore _U_){ - if( GPOINTER_TO_INT(a_ptr) > GPOINTER_TO_INT(b_ptr) ){ - return -1; - } - return GPOINTER_TO_INT(a_ptr) < GPOINTER_TO_INT(b_ptr); -} -/*static void nbap_free_key(gpointer key ){ - g_free(key); - - }*/ static void nbap_init(void){ guint8 i; /*Initialize*/ - com_context_map = g_tree_new_full(nbap_key_cmp, - NULL, /* data pointer, optional */ - NULL, /* function to free the memory allocated for the key used when removing the entry */ - g_free); + com_context_map = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); - - /*Initialize structure for muxed flow indication*/ - edch_flow_port_map = g_tree_new_full(nbap_key_cmp, - NULL, /* data pointer, optional */ - NULL, /* function to free the memory allocated for the key used when removing the entry */ - g_free); + /*Initialize structure for muxed flow indication*/ + edch_flow_port_map = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); for (i = 0; i < 15; i++) { lchId_type_table[i+1] = lch_contents[i]; } } -static void nbap_cleanup(void){ - /*Cleanup*/ - g_tree_destroy(com_context_map); - g_tree_destroy(edch_flow_port_map); -} - static int dissect_nbap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { @@ -546,7 +523,6 @@ void proto_register_nbap(void) nbap_proc_uout_dissector_table = register_dissector_table("nbap.proc.uout", "NBAP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_nbap, FT_STRING, BASE_NONE, DISSECTOR_TABLE_ALLOW_DUPLICATE); register_init_routine(nbap_init); - register_cleanup_routine(nbap_cleanup); } /* |