aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-04-28 23:21:05 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-29 10:23:32 +0000
commitb2af5b066ab265af79a94da8367b1aa66b7972be (patch)
tree9ec48bba721a3bc7f769e05163e7ee8ae6a9d4ee /epan/dissectors
parent8f2e234add60686a4a82d9fc3f1b7036b36d90f0 (diff)
Convert a few dissectors with simple request/response tracking from red/black tree to hash map
Update the readme file accordingly Change-Id: I056d1ab1f77df641b83fa9b3618b6c25d66e1a83 Reviewed-on: https://code.wireshark.org/review/1420 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-adwin.c10
-rw-r--r--epan/dissectors/packet-cops.c10
-rw-r--r--epan/dissectors/packet-diameter.c8
-rw-r--r--epan/dissectors/packet-dns.c10
-rw-r--r--epan/dissectors/packet-fcp.c10
-rw-r--r--epan/dissectors/packet-gvcp.c12
-rw-r--r--epan/dissectors/packet-iscsi.c18
-rw-r--r--epan/dissectors/packet-ndmp.c26
-rw-r--r--epan/dissectors/packet-pana.c10
9 files changed, 57 insertions, 57 deletions
diff --git a/epan/dissectors/packet-adwin.c b/epan/dissectors/packet-adwin.c
index e4911200d5..194d8eb44b 100644
--- a/epan/dissectors/packet-adwin.c
+++ b/epan/dissectors/packet-adwin.c
@@ -508,7 +508,7 @@ typedef struct _adwin_transaction_t {
/* response/request tracking */
typedef struct _adwin_conv_info_t {
- wmem_tree_t *pdus;
+ wmem_map_t *pdus;
} adwin_conv_info_t;
typedef enum { ADWIN_REQUEST,
@@ -538,7 +538,7 @@ adwin_request_response_handling(tvbuff_t *tvb, packet_info *pinfo,
* it to the list of information structures.
*/
adwin_info = wmem_new(wmem_file_scope(), adwin_conv_info_t);
- adwin_info->pdus = wmem_tree_new(wmem_file_scope());
+ adwin_info->pdus = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_adwin, adwin_info);
}
@@ -549,15 +549,15 @@ adwin_request_response_handling(tvbuff_t *tvb, packet_info *pinfo,
adwin_trans->req_frame = pinfo->fd->num;
adwin_trans->rep_frame = 0;
adwin_trans->req_time = pinfo->fd->abs_ts;
- wmem_tree_insert32(adwin_info->pdus, seq_num, (void *)adwin_trans);
+ wmem_map_insert(adwin_info->pdus, GUINT_TO_POINTER(seq_num), (void *)adwin_trans);
} else {
- adwin_trans = (adwin_transaction_t *)wmem_tree_lookup32(adwin_info->pdus, seq_num);
+ adwin_trans = (adwin_transaction_t *)wmem_map_lookup(adwin_info->pdus, GUINT_TO_POINTER(seq_num));
if (adwin_trans) {
adwin_trans->rep_frame = pinfo->fd->num;
}
}
} else {
- adwin_trans = (adwin_transaction_t *)wmem_tree_lookup32(adwin_info->pdus, seq_num);
+ adwin_trans = (adwin_transaction_t *)wmem_map_lookup(adwin_info->pdus, GUINT_TO_POINTER(seq_num));
}
if (!adwin_trans) {
/* create a "fake" adwin_trans structure */
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index b908abac29..99c6127199 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -797,7 +797,7 @@ static gint ett_docsis_request_transmission_policy = -1;
/* For request/response matching */
typedef struct _cops_conv_info_t {
- wmem_tree_t *pdus_tree;
+ wmem_map_t *pdus_tree;
} cops_conv_info_t;
typedef struct _cops_call_t
@@ -1035,17 +1035,17 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
if (!cops_conv_info) {
cops_conv_info = (cops_conv_info_t *)wmem_alloc(wmem_file_scope(), sizeof(cops_conv_info_t));
- cops_conv_info->pdus_tree = wmem_tree_new(wmem_file_scope());
+ cops_conv_info->pdus_tree = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_cops, cops_conv_info);
}
if ( is_request ||
(op_code == COPS_MSG_DEC && is_solicited) ) { /* DEC as response for REQ is considered as request, because it expects RPT|DRQ */
- pdus_array = (GPtrArray *)wmem_tree_lookup32(cops_conv_info->pdus_tree, handle_value);
+ pdus_array = (GPtrArray *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
if (pdus_array == NULL) { /* This is the first request we've seen with this handle_value */
pdus_array = g_ptr_array_new();
- wmem_tree_insert32(cops_conv_info->pdus_tree, handle_value, pdus_array);
+ wmem_map_insert(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value), pdus_array);
}
if (!pinfo->fd->flags.visited) {
@@ -1071,7 +1071,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
if (is_response) {
- pdus_array = (GPtrArray *)wmem_tree_lookup32(cops_conv_info->pdus_tree, handle_value);
+ pdus_array = (GPtrArray *)wmem_map_lookup(cops_conv_info->pdus_tree, GUINT_TO_POINTER(handle_value));
if (pdus_array == NULL) /* There's no request with this handle value */
return offset;
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 921b7766e5..2254d987dc 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -107,7 +107,7 @@ static gint exported_pdu_tap = -1;
/* Conversation Info */
typedef struct _diameter_conv_info_t {
- wmem_tree_t *pdus_tree;
+ wmem_map_t *pdus_tree;
} diameter_conv_info_t;
typedef struct _diam_ctx_t {
@@ -1123,18 +1123,18 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
diameter_conv_info = (diameter_conv_info_t *)conversation_get_proto_data(conversation, proto_diameter);
if (!diameter_conv_info) {
diameter_conv_info = wmem_new(wmem_file_scope(), diameter_conv_info_t);
- diameter_conv_info->pdus_tree = wmem_tree_new(wmem_file_scope());
+ diameter_conv_info->pdus_tree = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_diameter, diameter_conv_info);
}
/* pdus_tree is an wmem_tree keyed by frame number (in order to handle hop-by-hop collisions */
- pdus_tree = (wmem_tree_t *)wmem_tree_lookup32(diameter_conv_info->pdus_tree, hop_by_hop_id);
+ pdus_tree = (wmem_tree_t *)wmem_map_lookup(diameter_conv_info->pdus_tree, GUINT_TO_POINTER(hop_by_hop_id));
if (pdus_tree == NULL && (flags_bits & DIAM_FLAGS_R)) {
/* This is the first request we've seen with this hop-by-hop id */
pdus_tree = wmem_tree_new(wmem_file_scope());
- wmem_tree_insert32(diameter_conv_info->pdus_tree, hop_by_hop_id, pdus_tree);
+ wmem_map_insert(diameter_conv_info->pdus_tree, GUINT_TO_POINTER(hop_by_hop_id), pdus_tree);
}
if (pdus_tree) {
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c
index 542ce9fd35..89c263dfd1 100644
--- a/epan/dissectors/packet-dns.c
+++ b/epan/dissectors/packet-dns.c
@@ -376,7 +376,7 @@ typedef struct _dns_transaction_t {
/* Structure containing conversation specific information */
typedef struct _dns_conv_info_t {
- wmem_tree_t *pdus;
+ wmem_map_t *pdus;
} dns_conv_info_t;
/* DNS structs and definitions */
@@ -3596,7 +3596,7 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* it to the list of information structures.
*/
dns_info = wmem_new(wmem_file_scope(), dns_conv_info_t);
- dns_info->pdus=wmem_tree_new(wmem_file_scope());
+ dns_info->pdus=wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_dns, dns_info);
}
if (!pinfo->fd->flags.visited) {
@@ -3606,15 +3606,15 @@ dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dns_trans->req_frame=pinfo->fd->num;
dns_trans->rep_frame=0;
dns_trans->req_time=pinfo->fd->abs_ts;
- wmem_tree_insert32(dns_info->pdus, id, (void *)dns_trans);
+ wmem_map_insert(dns_info->pdus, GUINT_TO_POINTER(id), (void *)dns_trans);
} else {
- dns_trans=(dns_transaction_t *)wmem_tree_lookup32(dns_info->pdus, id);
+ dns_trans=(dns_transaction_t *)wmem_map_lookup(dns_info->pdus, GUINT_TO_POINTER(id));
if (dns_trans) {
dns_trans->rep_frame=pinfo->fd->num;
}
}
} else {
- dns_trans=(dns_transaction_t *)wmem_tree_lookup32(dns_info->pdus, id);
+ dns_trans=(dns_transaction_t *)wmem_map_lookup(dns_info->pdus, GUINT_TO_POINTER(id));
}
if (!dns_trans) {
/* create a "fake" pana_trans structure */
diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c
index a9b0e6557d..08b2d5af67 100644
--- a/epan/dissectors/packet-fcp.c
+++ b/epan/dissectors/packet-fcp.c
@@ -92,7 +92,7 @@ static gint ett_fcp_taskmgmt = -1;
static gint ett_fcp_rsp_flags = -1;
typedef struct _fcp_conv_data_t {
- wmem_tree_t *luns;
+ wmem_map_t *luns;
} fcp_conv_data_t;
typedef struct fcp_request_data {
@@ -425,7 +425,7 @@ dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, pro
p_add_proto_data(wmem_file_scope(), pinfo, proto_fcp, 0, proto_data);
}
- request_data = (fcp_request_data_t*)wmem_tree_lookup32(fcp_conv_data->luns, lun);
+ request_data = (fcp_request_data_t*)wmem_map_lookup(fcp_conv_data->luns, GUINT_TO_POINTER(lun));
if (!request_data) {
request_data = wmem_new(wmem_file_scope(), fcp_request_data_t);
request_data->request_frame = pinfo->fd->num;
@@ -445,7 +445,7 @@ dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, pro
request_data->itlq->alloc_len=0;
request_data->itlq->extra_data=NULL;
- wmem_tree_insert32(fcp_conv_data->luns, lun, request_data);
+ wmem_map_insert(fcp_conv_data->luns, GUINT_TO_POINTER(lun), request_data);
}
/* populate the exchange struct */
@@ -758,7 +758,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
if (!fcp_conv_data) {
fcp_conv_data = wmem_new(wmem_file_scope(), fcp_conv_data_t);
- fcp_conv_data->luns = wmem_tree_new(wmem_file_scope());
+ fcp_conv_data->luns = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(fc_conv, proto_fcp, fcp_conv_data);
}
@@ -774,7 +774,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
if ((r_ctl != FCP_IU_CMD) && (r_ctl != FCP_IU_UNSOL_CTL)) {
- request_data = (fcp_request_data_t *)wmem_tree_lookup32(fcp_conv_data->luns, proto_data->lun);
+ request_data = (fcp_request_data_t *)wmem_map_lookup(fcp_conv_data->luns, GUINT_TO_POINTER(proto_data->lun));
}
/* put a request_in in all frames except the command frame */
diff --git a/epan/dissectors/packet-gvcp.c b/epan/dissectors/packet-gvcp.c
index 6d029bfec1..b2760149d4 100644
--- a/epan/dissectors/packet-gvcp.c
+++ b/epan/dissectors/packet-gvcp.c
@@ -56,7 +56,7 @@ wmem_array_t* gvcp_trans_array;
structure to hold persistent info for each conversation
*/
typedef struct _gvcp_conv_info_t {
- wmem_tree_t *pdus;
+ wmem_map_t *pdus;
} gvcp_conv_info_t;
/*
@@ -2271,7 +2271,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
if (!gvcp_info)
{
gvcp_info = (gvcp_conv_info_t*)wmem_alloc(wmem_file_scope(), sizeof(gvcp_conv_info_t));
- gvcp_info->pdus = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
+ gvcp_info->pdus = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_gvcp, gvcp_info);
}
@@ -2292,7 +2292,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
/* this is a response, so update trans info with ack's frame number */
/* get list of transactions for given request id */
- gvcp_trans_array = (wmem_array_t*)wmem_tree_lookup32(gvcp_info->pdus, request_id);
+ gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
if (gvcp_trans_array)
{
gint i;
@@ -2323,7 +2323,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
else
{
gvcp_trans = 0;
- gvcp_trans_array = (wmem_array_t*)wmem_tree_lookup32(gvcp_info->pdus, request_id);
+ gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
if (gvcp_trans_array)
{
@@ -2414,7 +2414,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
if (key_code == 0x42)
{
- gvcp_trans_array = (wmem_array_t*)wmem_tree_lookup32(gvcp_info->pdus, request_id);
+ gvcp_trans_array = (wmem_array_t*)wmem_map_lookup(gvcp_info->pdus, GUINT_TO_POINTER(request_id));
if(gvcp_trans_array)
{
@@ -2424,7 +2424,7 @@ static int dissect_gvcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
gvcp_trans_array = wmem_array_new(wmem_file_scope(), sizeof(gvcp_transaction_t));
wmem_array_append_one(gvcp_trans_array, *gvcp_trans);
- wmem_tree_insert32(gvcp_info->pdus, request_id, (void *)gvcp_trans_array);
+ wmem_map_insert(gvcp_info->pdus, GUINT_TO_POINTER(request_id), (void *)gvcp_trans_array);
}
}
}
diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c
index 0cd56ded19..d57b9905f8 100644
--- a/epan/dissectors/packet-iscsi.c
+++ b/epan/dissectors/packet-iscsi.c
@@ -219,8 +219,8 @@ static gint ett_iscsi_ISID = -1;
/* this structure contains session wide state for a specific tcp conversation */
typedef struct _iscsi_session_t {
guint32 header_digest;
- wmem_tree_t *itlq; /* indexed by ITT */
- wmem_tree_t *itl; /* indexed by LUN */
+ wmem_map_t *itlq; /* indexed by ITT */
+ wmem_map_t *itl; /* indexed by LUN */
} iscsi_session_t;
@@ -746,7 +746,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
col_set_str(pinfo->cinfo, COL_PROTOCOL, "iSCSI");
/* XXX we need a way to handle replayed iscsi itt here */
- cdata=(iscsi_conv_data_t *)wmem_tree_lookup32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16));
+ cdata=(iscsi_conv_data_t *)wmem_map_lookup(iscsi_session->itlq, GUINT_TO_POINTER(tvb_get_ntohl(tvb, offset+16)));
if(!cdata){
cdata = wmem_new(wmem_file_scope(), iscsi_conv_data_t);
cdata->itlq.lun=0xffff;
@@ -763,7 +763,7 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
cdata->data_in_frame=0;
cdata->data_out_frame=0;
- wmem_tree_insert32(iscsi_session->itlq, tvb_get_ntohl(tvb, offset+16), cdata);
+ wmem_map_insert(iscsi_session->itlq, GUINT_TO_POINTER(tvb_get_ntohl(tvb, offset+16)), cdata);
}
if (opcode == ISCSI_OPCODE_SCSI_RESPONSE ||
@@ -816,18 +816,18 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
cdata->itlq.lun=lun;
cdata->itlq.first_exchange_frame=pinfo->fd->num;
- itl=(itl_nexus_t *)wmem_tree_lookup32(iscsi_session->itl, lun);
+ itl=(itl_nexus_t *)wmem_map_lookup(iscsi_session->itl, GUINT_TO_POINTER(lun));
if(!itl){
itl=wmem_new(wmem_file_scope(), itl_nexus_t);
itl->cmdset=0xff;
itl->conversation=conversation;
- wmem_tree_insert32(iscsi_session->itl, lun, itl);
+ wmem_map_insert(iscsi_session->itl, GUINT_TO_POINTER(lun), itl);
}
}
if(!itl){
- itl=(itl_nexus_t *)wmem_tree_lookup32(iscsi_session->itl, cdata->itlq.lun);
+ itl=(itl_nexus_t *)wmem_map_lookup(iscsi_session->itl, GUINT_TO_POINTER(cdata->itlq.lun));
}
@@ -2349,8 +2349,8 @@ dissect_iscsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean chec
if(!iscsi_session){
iscsi_session = wmem_new(wmem_file_scope(), iscsi_session_t);
iscsi_session->header_digest = ISCSI_HEADER_DIGEST_AUTO;
- iscsi_session->itlq = wmem_tree_new(wmem_file_scope());
- iscsi_session->itl = wmem_tree_new(wmem_file_scope());
+ iscsi_session->itlq = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
+ iscsi_session->itl = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_iscsi, iscsi_session);
/* DataOut PDUs are often mistaken by DCERPC heuristics to be
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index 99e2fe486e..dd20555d79 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -315,10 +315,10 @@ typedef struct _ndmp_task_data_t {
typedef struct _ndmp_conv_data_t {
guint8 version;
- wmem_tree_t *tasks; /* indexed by Sequence# */
+ wmem_map_t *tasks; /* indexed by Sequence# */
wmem_tree_t *itl; /* indexed by packet# */
- wmem_tree_t *fragsA; /* indexed by Sequence# */
- wmem_tree_t *fragsB;
+ wmem_map_t *fragsA; /* indexed by Sequence# */
+ wmem_map_t *fragsB;
ndmp_task_data_t *task;
conversation_t *conversation;
} ndmp_conv_data_t;
@@ -3094,7 +3094,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
proto_tree *ndmp_tree = NULL;
proto_item *hdr_item = NULL;
proto_tree *hdr_tree = NULL;
- wmem_tree_t *frags;
+ wmem_map_t *frags;
conversation_t *conversation;
proto_item *vers_item;
gboolean save_fragmented, save_writable;
@@ -3118,11 +3118,11 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
if(!ndmp_conv_data){
ndmp_conv_data=wmem_new(wmem_file_scope(), ndmp_conv_data_t);
ndmp_conv_data->version = NDMP_PROTOCOL_UNKNOWN;
- ndmp_conv_data->tasks = wmem_tree_new(wmem_file_scope());
+ ndmp_conv_data->tasks = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
ndmp_conv_data->itl = wmem_tree_new(wmem_file_scope());
ndmp_conv_data->conversation = conversation;
- ndmp_conv_data->fragsA = wmem_tree_new(wmem_file_scope());
- ndmp_conv_data->fragsB = wmem_tree_new(wmem_file_scope());
+ ndmp_conv_data->fragsA = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
+ ndmp_conv_data->fragsB = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_ndmp, ndmp_conv_data);
@@ -3178,7 +3178,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
*/
tcpinfo->seq = nxt;
- nfi = (ndmp_frag_info *)wmem_tree_lookup32(frags, seq);
+ nfi = (ndmp_frag_info *)wmem_map_lookup(frags, GUINT_TO_POINTER(seq));
if (!nfi)
{
@@ -3197,7 +3197,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
nfi=wmem_new(wmem_file_scope(), ndmp_frag_info);
nfi->first_seq = seq;
nfi->offset = 1;
- wmem_tree_insert32(frags, nxt, (void *)nfi);
+ wmem_map_insert(frags, GUINT_TO_POINTER(nxt), (void *)nfi);
}
}
/*
@@ -3230,7 +3230,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
nfi=wmem_new(wmem_file_scope(), ndmp_frag_info);
nfi->first_seq = seq;
nfi->offset = frag_num+1;
- wmem_tree_insert32(frags, nxt, (void *)nfi);
+ wmem_map_insert(frags, GUINT_TO_POINTER(nxt), (void *)nfi);
}
}
}
@@ -3348,9 +3348,9 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
ndmp_conv_data->task->response_frame=0;
ndmp_conv_data->task->ndmp_time=pinfo->fd->abs_ts;
ndmp_conv_data->task->itlq=NULL;
- wmem_tree_insert32(ndmp_conv_data->tasks, nh.seq, ndmp_conv_data->task);
+ wmem_map_insert(ndmp_conv_data->tasks, GUINT_TO_POINTER(nh.seq), ndmp_conv_data->task);
} else {
- ndmp_conv_data->task=(ndmp_task_data_t *)wmem_tree_lookup32(ndmp_conv_data->tasks, nh.seq);
+ ndmp_conv_data->task=(ndmp_task_data_t *)wmem_map_lookup(ndmp_conv_data->tasks, GUINT_TO_POINTER(nh.seq));
}
if(ndmp_conv_data->task && ndmp_conv_data->task->response_frame){
proto_item *it;
@@ -3360,7 +3360,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
break;
case NDMP_MESSAGE_REPLY:
- ndmp_conv_data->task=(ndmp_task_data_t *)wmem_tree_lookup32(ndmp_conv_data->tasks, nh.rep_seq);
+ ndmp_conv_data->task=(ndmp_task_data_t *)wmem_map_lookup(ndmp_conv_data->tasks, GUINT_TO_POINTER(nh.rep_seq));
if(ndmp_conv_data->task && !pinfo->fd->flags.visited){
ndmp_conv_data->task->response_frame=pinfo->fd->num;
diff --git a/epan/dissectors/packet-pana.c b/epan/dissectors/packet-pana.c
index e3ebf49c4e..54b199f6e9 100644
--- a/epan/dissectors/packet-pana.c
+++ b/epan/dissectors/packet-pana.c
@@ -212,7 +212,7 @@ typedef struct _pana_transaction_t {
} pana_transaction_t;
typedef struct _pana_conv_info_t {
- wmem_tree_t *pdus;
+ wmem_map_t *pdus;
} pana_conv_info_t;
static void
@@ -552,7 +552,7 @@ dissect_pana_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* it to the list of information structures.
*/
pana_info = wmem_new(wmem_file_scope(), pana_conv_info_t);
- pana_info->pdus=wmem_tree_new(wmem_file_scope());
+ pana_info->pdus=wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal);
conversation_add_proto_data(conversation, proto_pana, pana_info);
}
@@ -564,15 +564,15 @@ dissect_pana_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pana_trans->req_frame=pinfo->fd->num;
pana_trans->rep_frame=0;
pana_trans->req_time=pinfo->fd->abs_ts;
- wmem_tree_insert32(pana_info->pdus, seq_num, (void *)pana_trans);
+ wmem_map_insert(pana_info->pdus, GUINT_TO_POINTER(seq_num), (void *)pana_trans);
} else {
- pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num);
+ pana_trans=(pana_transaction_t *)wmem_map_lookup(pana_info->pdus, GUINT_TO_POINTER(seq_num));
if(pana_trans){
pana_trans->rep_frame=pinfo->fd->num;
}
}
} else {
- pana_trans=(pana_transaction_t *)wmem_tree_lookup32(pana_info->pdus, seq_num);
+ pana_trans=(pana_transaction_t *)wmem_map_lookup(pana_info->pdus, GUINT_TO_POINTER(seq_num));
}
if(!pana_trans){