#include <glib.h>
#include <epan/packet.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/conversation.h>
#include <epan/prefs.h>
#include <epan/etypes.h>
} enip_request_key_t;
typedef struct enip_request_val {
- emem_tree_t *frames;
+ wmem_tree_t *frames;
} enip_request_val_t;
/*
{
if ( request_val == NULL )
{
- new_request_key = (enip_request_key_t *)se_memdup(prequest_key, sizeof(enip_request_key_t));
+ new_request_key = (enip_request_key_t *)wmem_memdup(wmem_file_scope(), prequest_key, sizeof(enip_request_key_t));
- request_val = se_new(enip_request_val_t);
- request_val->frames = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "enip_frames");
+ request_val = wmem_new(wmem_file_scope(), enip_request_val_t);
+ request_val->frames = wmem_tree_new(wmem_file_scope());
g_hash_table_insert(enip_request_hashtable, new_request_key, request_val );
}
- request_info = se_new(enip_request_info_t);
+ request_info = wmem_new(wmem_file_scope(), enip_request_info_t);
request_info->req_num = pinfo->fd->num;
request_info->rep_num = 0;
request_info->req_time = pinfo->fd->abs_ts;
request_info->cip_info = NULL;
- se_tree_insert32(request_val->frames, pinfo->fd->num, (void *)request_info);
+ wmem_tree_insert32(request_val->frames, pinfo->fd->num, (void *)request_info);
}
if( request_val && prequest_key && prequest_key->requesttype == ENIP_RESPONSE_PACKET )
{
- request_info = (enip_request_info_t*)se_tree_lookup32_le( request_val->frames, pinfo->fd->num );
+ request_info = (enip_request_info_t*)wmem_tree_lookup32_le( request_val->frames, pinfo->fd->num );
if ( request_info )
{
request_info->rep_num = pinfo->fd->num;
else
{
if ( request_val )
- request_info = (enip_request_info_t*)se_tree_lookup32_le( request_val->frames, pinfo->fd->num );
+ request_info = (enip_request_info_t*)wmem_tree_lookup32_le( request_val->frames, pinfo->fd->num );
}
if ( tree && request_info )
} enip_conn_val_t;
typedef struct _enip_conv_info_t {
- emem_tree_t *O2TConnIDs;
- emem_tree_t *T2OConnIDs;
+ wmem_tree_t *O2TConnIDs;
+ wmem_tree_t *T2OConnIDs;
} enip_conv_info_t;
static GHashTable *enip_conn_hashtable = NULL;
if (pinfo->fd->flags.visited)
return;
- conn_key = se_new(enip_conn_key_t);
+ conn_key = wmem_new(wmem_file_scope(), enip_conn_key_t);
conn_key->ConnSerialNumber = connInfo->ConnSerialNumber;
conn_key->VendorID = connInfo->VendorID;
conn_key->DeviceSerialNumber = connInfo->DeviceSerialNumber;
conn_val = (enip_conn_val_t *)g_hash_table_lookup( enip_conn_hashtable, conn_key );
if ( conn_val == NULL )
{
- conn_val = se_new(enip_conn_val_t);
+ conn_val = wmem_new(wmem_file_scope(), enip_conn_val_t);
conn_val->ConnSerialNumber = connInfo->ConnSerialNumber;
conn_val->VendorID = connInfo->VendorID;
enip_info = (enip_conv_info_t *)conversation_get_proto_data(conversation, proto_enip);
if (enip_info == NULL)
{
- enip_info = se_new(enip_conv_info_t);
- enip_info->O2TConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_O2T");
- enip_info->T2OConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_T2O");
+ enip_info = wmem_new(wmem_file_scope(), enip_conv_info_t);
+ enip_info->O2TConnIDs = wmem_tree_new(wmem_file_scope());
+ enip_info->T2OConnIDs = wmem_tree_new(wmem_file_scope());
conversation_add_proto_data(conversation, proto_enip, enip_info);
}
- se_tree_insert32(enip_info->O2TConnIDs, connInfo->O2T.connID, (void *)conn_val);
+ wmem_tree_insert32(enip_info->O2TConnIDs, connInfo->O2T.connID, (void *)conn_val);
/* Check if separate T->O conversation is necessary. If either side is multicast
or ports aren't equal, a separate conversation must be generated */
enip_info = (enip_conv_info_t *)conversation_get_proto_data(conversationTO, proto_enip);
if (enip_info == NULL)
{
- enip_info = se_new(enip_conv_info_t);
- enip_info->O2TConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_O2T");
- enip_info->T2OConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_T2O");
+ enip_info = wmem_new(wmem_file_scope(), enip_conv_info_t);
+ enip_info->O2TConnIDs = wmem_tree_new(wmem_file_scope());
+ enip_info->T2OConnIDs = wmem_tree_new(wmem_file_scope());
conversation_add_proto_data(conversationTO, proto_enip, enip_info);
}
- se_tree_insert32(enip_info->T2OConnIDs, connInfo->T2O.connID, (void *)conn_val);
+ wmem_tree_insert32(enip_info->T2OConnIDs, connInfo->T2O.connID, (void *)conn_val);
}
else
{
* No. Attach that information to the conversation, and add
* it to the list of information structures.
*/
- enip_info = se_new(enip_conv_info_t);
- enip_info->O2TConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_O2T");
- enip_info->T2OConnIDs = se_tree_create_non_persistent(
- EMEM_TREE_TYPE_RED_BLACK, "enip_T2O");
+ enip_info = wmem_new(wmem_file_scope(), enip_conv_info_t);
+ enip_info->O2TConnIDs = wmem_tree_new(wmem_file_scope());
+ enip_info->T2OConnIDs = wmem_tree_new(wmem_file_scope());
conversation_add_proto_data(conversation, proto_enip, enip_info);
}
- se_tree_insert32(enip_info->O2TConnIDs, connInfo->O2T.connID, (void *)conn_val);
- se_tree_insert32(enip_info->T2OConnIDs, connInfo->T2O.connID, (void *)conn_val);
+ wmem_tree_insert32(enip_info->O2TConnIDs, connInfo->O2T.connID, (void *)conn_val);
+ wmem_tree_insert32(enip_info->T2OConnIDs, connInfo->T2O.connID, (void *)conn_val);
}
}
}
switch ( prequest_key->requesttype )
{
case ENIP_REQUEST_PACKET:
- conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->O2TConnIDs, connid );
+ conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->O2TConnIDs, connid );
if ( conn_val == NULL )
- conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->T2OConnIDs, connid );
+ conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->T2OConnIDs, connid );
break;
case ENIP_RESPONSE_PACKET:
- conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->T2OConnIDs, connid );
+ conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->T2OConnIDs, connid );
if ( conn_val == NULL )
- conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->O2TConnIDs, connid );
+ conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->O2TConnIDs, connid );
break;
case ENIP_CANNOT_CLASSIFY:
/* ignore */
return NULL;
if (enip_info->O2TConnIDs != NULL)
- conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->O2TConnIDs, connid );
+ conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->O2TConnIDs, connid );
if ( conn_val == NULL )
{
if (enip_info->T2OConnIDs != NULL)
{
- if ((conn_val = (enip_conn_val_t *)se_tree_lookup32( enip_info->T2OConnIDs, connid)) != NULL)
+ if ((conn_val = (enip_conn_val_t *)wmem_tree_lookup32( enip_info->T2OConnIDs, connid)) != NULL)
*pconnid_type = ECIDT_T2O;
}
}
if (conn_info->safety.safety_seg == TRUE)
{
/* Add any possible safety related data */
- cip_safety = se_new(cip_safety_info_t);
+ cip_safety = wmem_new(wmem_file_scope(), cip_safety_info_t);
cip_safety->conn_type = connid_type;
cip_safety->server_dir = (conn_info->TransportClass_trigger & CI_PRODUCTION_DIR_MASK) ? TRUE : FALSE;
cip_safety->format = conn_info->safety.format;
{
request_info->cip_info->connInfo->O2T.port = tvb_get_ntohs(tvb, offset+8);
request_info->cip_info->connInfo->O2T.ipaddress.type = AT_IPv4;
- request_info->cip_info->connInfo->O2T.ipaddress.data = se_alloc(sizeof(guint32));
+ request_info->cip_info->connInfo->O2T.ipaddress.data = wmem_alloc(wmem_file_scope(), sizeof(guint32));
*((guint32*)request_info->cip_info->connInfo->O2T.ipaddress.data) = tvb_get_ipv4(tvb, offset+10);
}
else
{
request_info->cip_info->connInfo->T2O.port = tvb_get_ntohs(tvb, offset+8);
request_info->cip_info->connInfo->T2O.ipaddress.type = AT_IPv4;
- request_info->cip_info->connInfo->T2O.ipaddress.data = se_alloc(sizeof(guint32));
+ request_info->cip_info->connInfo->T2O.ipaddress.data = wmem_alloc(wmem_file_scope(), sizeof(guint32));
*((guint32*)request_info->cip_info->connInfo->T2O.ipaddress.data) = tvb_get_ipv4(tvb, offset+10);
}
}
#include <epan/conversation.h>
#include <prefs.h>
#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/uat.h>
#include <epan/expert.h>
#include <epan/strutil.h>
extern int proto_sscop;
extern int proto_fp;
-static emem_tree_t* port_handles = NULL;
+static wmem_tree_t* port_handles = NULL;
static uat_t* k12_uat = NULL;
static k12_handles_t* k12_handles = NULL;
static guint nk12_handles = 0;
break;
case K12_PORT_ATMPVC:
{
- gchar* circuit_str = ep_strdup_printf("%u:%u:%u",
+ gchar* circuit_str = wmem_strdup_printf(wmem_packet_scope(), "%u:%u:%u",
(guint)pinfo->pseudo_header->k12.input_info.atm.vp,
(guint)pinfo->pseudo_header->k12.input_info.atm.vc,
(guint)pinfo->pseudo_header->k12.input_info.atm.cid);
break;
}
- handles = (dissector_handle_t *)se_tree_lookup32(port_handles, pinfo->pseudo_header->k12.input);
+ handles = (dissector_handle_t *)wmem_tree_lookup32(port_handles, pinfo->pseudo_header->k12.input);
if (! handles ) {
for (i=0 ; i < nk12_handles; i++) {
handles = data_handles;
}
- se_tree_insert32(port_handles, pinfo->pseudo_header->k12.input, handles);
+ wmem_tree_insert32(port_handles, pinfo->pseudo_header->k12.input, handles);
}
if (handles[i] == sscop_handle) {
sscop_payload_info *p_sscop_info = (sscop_payload_info *)p_get_proto_data(pinfo->fd, proto_sscop, 0);
if (!p_sscop_info) {
- p_sscop_info = se_new0(sscop_payload_info);
+ p_sscop_info = wmem_new0(wmem_file_scope(), sscop_payload_info);
p_add_proto_data(pinfo->fd, proto_sscop, 0, p_sscop_info);
p_sscop_info->subdissector = handles[i+1];
}
if (sub_handle == fp_handle) {
fp_info *p_fp_info = (fp_info *)p_get_proto_data(pinfo->fd, proto_fp, 0);
if (!p_fp_info) {
- p_fp_info = se_new0(fp_info);
+ p_fp_info = wmem_new0(wmem_file_scope(), fp_info);
p_add_proto_data(pinfo->fd, proto_fp, 0, p_fp_info);
fill_fp_info(p_fp_info,
"A table of matches vs stack filenames and relative protocols",
k12_uat);
- port_handles = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "k12_port_handles");
+ port_handles = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
}
#include <epan/rtp_pt.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/conversation.h>
#include <epan/expert.h>
#include <epan/reassemble.h>
* individual pid's, this is only used when packets are
* processed sequencially.
*/
- emem_tree_t *pid_table;
+ wmem_tree_t *pid_table;
/* When detecting a CC drop, store that information for the
* given frame. This info is needed, when clicking around in
* used to tell the difference.
*
*/
- emem_tree_t *frame_table;
+ wmem_tree_t *frame_table;
/* Total counters per conversation / multicast stream */
guint32 total_skips;
typedef struct packet_analysis_data {
/* Contain information for each MPEG2-TS packet in the current big packet */
- emem_tree_t *subpacket_table;
+ wmem_tree_t *subpacket_table;
} packed_analysis_data_t;
/* Analysis TS frame info needed during sequential processing */
/* As each frame has several pid's, thus need a pid data
* structure per TS frame.
*/
- emem_tree_t *ts_table;
+ wmem_tree_t *ts_table;
} frame_analysis_data_t;
{
mp2t_analysis_data_t *mp2t_data = NULL;
- mp2t_data = se_new0(struct mp2t_analysis_data);
+ mp2t_data = wmem_new0(wmem_file_scope(), struct mp2t_analysis_data);
- mp2t_data->pid_table =
- se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
- "mp2t_pid_table");
- mp2t_data->frame_table =
- se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
- "mp2t_frame_table");
+ mp2t_data->pid_table = wmem_tree_new(wmem_file_scope());
+
+ mp2t_data->frame_table = wmem_tree_new(wmem_file_scope());
mp2t_data->total_skips = 0;
mp2t_data->total_discontinuity = 0;
{
frame_analysis_data_t *frame_analysis_data_p = NULL;
- frame_analysis_data_p = se_new0(struct frame_analysis_data);
- frame_analysis_data_p->ts_table =
- se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK,
- "mp2t_frame_pid_table");
+ frame_analysis_data_p = wmem_new0(wmem_file_scope(), struct frame_analysis_data);
+ frame_analysis_data_p->ts_table = wmem_tree_new(wmem_file_scope());
/* Insert into mp2t tree */
- se_tree_insert32(mp2t_data->frame_table, pinfo->fd->num,
+ wmem_tree_insert32(mp2t_data->frame_table, pinfo->fd->num,
(void *)frame_analysis_data_p);
return frame_analysis_data_p;
get_frame_analysis_data(mp2t_analysis_data_t *mp2t_data, packet_info *pinfo)
{
frame_analysis_data_t *frame_analysis_data_p = NULL;
- frame_analysis_data_p = (frame_analysis_data_t *)se_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num);
+ frame_analysis_data_p = (frame_analysis_data_t *)wmem_tree_lookup32(mp2t_data->frame_table, pinfo->fd->num);
return frame_analysis_data_p;
}
mp2t_data = get_mp2t_conversation_data(conv);
- pid_data = (pid_analysis_data_t *)se_tree_lookup32(mp2t_data->pid_table, pid);
+ pid_data = (pid_analysis_data_t *)wmem_tree_lookup32(mp2t_data->pid_table, pid);
if (!pid_data) {
- pid_data = se_new0(struct pid_analysis_data);
+ pid_data = wmem_new0(wmem_file_scope(), struct pid_analysis_data);
pid_data->cc_prev = -1;
pid_data->pid = pid;
pid_data->frag_id = (pid << (32 - 13)) | 0x1;
- se_tree_insert32(mp2t_data->pid_table, pid, (void *)pid_data);
+ wmem_tree_insert32(mp2t_data->pid_table, pid, (void *)pid_data);
}
return pid_data;
}
frag_id = pid_analysis->frag_id;
pdata = (packed_analysis_data_t *)p_get_proto_data(pinfo->fd, proto_mp2t, 0);
if (!pdata) {
- pdata = se_new0(packed_analysis_data_t);
- pdata->subpacket_table = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "mp2t_frame_table");
+ pdata = wmem_new0(wmem_file_scope(), packed_analysis_data_t);
+ pdata->subpacket_table = wmem_tree_new(wmem_file_scope());
p_add_proto_data(pinfo->fd, proto_mp2t, 0, pdata);
} else {
- spdata = (subpacket_analysis_data_t *)se_tree_lookup32(pdata->subpacket_table, offset);
+ spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset);
}
if (!spdata) {
- spdata = se_new0(subpacket_analysis_data_t);
+ spdata = wmem_new0(wmem_file_scope(), subpacket_analysis_data_t);
/* Save the info into pdata from pid_analysis */
spdata->frag_cur_pos = frag_cur_pos;
spdata->frag_tot_len = frag_tot_len;
spdata->fragmentation = fragmentation;
spdata->frag_id = frag_id;
- se_tree_insert32(pdata->subpacket_table, offset, (void *)spdata);
+ wmem_tree_insert32(pdata->subpacket_table, offset, (void *)spdata);
}
return;
}
- spdata = (subpacket_analysis_data_t *)se_tree_lookup32(pdata->subpacket_table, offset);
+ spdata = (subpacket_analysis_data_t *)wmem_tree_lookup32(pdata->subpacket_table, offset);
if (!spdata) {
/* Occurs for the first sub packets in the capture which cannot be reassembled */
return;
/* Create and store a new TS frame pid_data object.
This indicate that we have a drop
*/
- ts_data = se_new0(struct ts_analysis_data);
+ ts_data = wmem_new0(wmem_file_scope(), struct ts_analysis_data);
ts_data->cc_prev = cc_prev;
ts_data->pid = pid;
ts_data->skips = skips;
- se_tree_insert32(frame_analysis_data_p->ts_table, KEY(pid, cc_curr),
+ wmem_tree_insert32(frame_analysis_data_p->ts_table, KEY(pid, cc_curr),
(void *)ts_data);
}
if (!frame_analysis_data_p)
return 0; /* No stored frame data -> no drops*/
else {
- ts_data = (struct ts_analysis_data *)se_tree_lookup32(frame_analysis_data_p->ts_table,
+ ts_data = (struct ts_analysis_data *)wmem_tree_lookup32(frame_analysis_data_p->ts_table,
KEY(pid, cc_curr));
if (ts_data) {
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/conversation.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include "packet-tcp.h"
static gint proto_nbd = -1;
guint8 type;
} nbd_transaction_t;
typedef struct _nbd_conv_info_t {
- emem_tree_t *unacked_pdus; /* indexed by handle, whichs wraps quite frequently */
- emem_tree_t *acked_pdus; /* indexed by packet# and handle */
+ wmem_tree_t *unacked_pdus; /* indexed by handle, whichs wraps quite frequently */
+ wmem_tree_t *acked_pdus; /* indexed by packet# and handle */
} nbd_conv_info_t;
conversation_t *conversation;
nbd_conv_info_t *nbd_info;
nbd_transaction_t *nbd_trans=NULL;
- emem_tree_key_t hkey[3];
+ wmem_tree_key_t hkey[3];
guint32 handle[2];
magic=tvb_get_ntohl(tvb, offset);
hkey[0].length=2;
hkey[0].key=handle;
hkey[1].length=0;
- nbd_trans=(nbd_transaction_t *)se_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
+ nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
if(!nbd_trans){
/* No, so just return the rest of the current packet */
return tvb_length(tvb);
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
- nbd_trans=(nbd_transaction_t *)se_tree_lookup32_array(nbd_info->acked_pdus, hkey);
+ nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->acked_pdus, hkey);
if(!nbd_trans){
/* No, so just return the rest of the current packet */
return tvb_length(tvb);
conversation_t *conversation;
nbd_conv_info_t *nbd_info;
nbd_transaction_t *nbd_trans=NULL;
- emem_tree_key_t hkey[3];
+ wmem_tree_key_t hkey[3];
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NBD");
/* No. Attach that information to the conversation, and add
* it to the list of information structures.
*/
- nbd_info = se_new(nbd_conv_info_t);
- nbd_info->unacked_pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "nbd_unacked_pdus");
- nbd_info->acked_pdus=se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "nbd_acked_pdus");
+ nbd_info = wmem_new(wmem_file_scope(), nbd_conv_info_t);
+ nbd_info->unacked_pdus = wmem_tree_new(wmem_file_scope());
+ nbd_info->acked_pdus = wmem_tree_new(wmem_file_scope());
conversation_add_proto_data(conversation, proto_nbd, nbd_info);
}
if(!pinfo->fd->flags.visited){
if(magic==NBD_REQUEST_MAGIC){
/* This is a request */
- nbd_trans=se_new(nbd_transaction_t);
+ nbd_trans=wmem_new(wmem_file_scope(), nbd_transaction_t);
nbd_trans->req_frame=pinfo->fd->num;
nbd_trans->rep_frame=0;
nbd_trans->req_time=pinfo->fd->abs_ts;
hkey[0].key=handle;
hkey[1].length=0;
- se_tree_insert32_array(nbd_info->unacked_pdus, hkey, (void *)nbd_trans);
+ wmem_tree_insert32_array(nbd_info->unacked_pdus, hkey, (void *)nbd_trans);
} else if(magic==NBD_RESPONSE_MAGIC){
hkey[0].length=2;
hkey[0].key=handle;
hkey[1].length=0;
- nbd_trans=(nbd_transaction_t *)se_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
+ nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
if(nbd_trans){
nbd_trans->rep_frame=pinfo->fd->num;
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
- se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
+ wmem_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
hkey[0].length=1;
hkey[0].key=&nbd_trans->req_frame;
hkey[1].length=2;
hkey[1].key=handle;
hkey[2].length=0;
- se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
+ wmem_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
}
}
} else {
hkey[1].key=handle;
hkey[2].length=0;
- nbd_trans=(nbd_transaction_t *)se_tree_lookup32_array(nbd_info->acked_pdus, hkey);
+ nbd_trans=(nbd_transaction_t *)wmem_tree_lookup32_array(nbd_info->acked_pdus, hkey);
}
/* The bloody handles are reused !!! eventhough they are 64 bits.
* So we must verify we got the "correct" one
if(!nbd_trans){
/* create a "fake" nbd_trans structure */
- nbd_trans=ep_new(nbd_transaction_t);
+ nbd_trans=wmem_new(wmem_packet_scope(), nbd_transaction_t);
nbd_trans->req_frame=0;
nbd_trans->rep_frame=0;
nbd_trans->req_time=pinfo->fd->abs_ts;
#include <epan/packet.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/conversation.h>
#include <epan/strutil.h>
#include <epan/prefs.h>
guint32 src; /* bytes 8-11 */
guint8 cmd; /* byte 7 */
- emem_tree_t *packets;
+ wmem_tree_t *packets;
} rtmpt_id_t;
/* Historical view of a whole TCP connection
*/
typedef struct rtmpt_conv {
- emem_tree_t *seqs[2];
- emem_tree_t *frags[2];
- emem_tree_t *ids[2];
- emem_tree_t *packets[2];
- emem_tree_t *chunksize[2];
- emem_tree_t *txids[2];
+ wmem_tree_t *seqs[2];
+ wmem_tree_t *frags[2];
+ wmem_tree_t *ids[2];
+ wmem_tree_t *packets[2];
+ wmem_tree_t *chunksize[2];
+ wmem_tree_t *txids[2];
} rtmpt_conv_t;
#ifdef DEBUG_RTMPT
tp->cmd==RTMPT_TYPE_ACKNOWLEDGEMENT || tp->cmd==RTMPT_TYPE_WINDOW) {
if (tp->len>=4 && remain>=4) {
*deschasopcode = TRUE;
- return ep_strdup_printf("%s %d",
+ return wmem_strdup_printf(wmem_packet_scope(), "%s %d",
val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"),
tvb_get_ntohl(tvb, offset));
}
} else if (tp->cmd==RTMPT_TYPE_PEER_BANDWIDTH) {
if (tp->len>=5 && remain>=5) {
*deschasopcode = TRUE;
- return ep_strdup_printf("%s %d,%s",
+ return wmem_strdup_printf(wmem_packet_scope(), "%s %d,%s",
val_to_str(tp->cmd, rtmpt_opcode_vals, "Unknown (0x%01x)"),
tvb_get_ntohl(tvb, offset),
val_to_str(tvb_get_guint8(tvb, offset+4), rtmpt_limit_vals, "Unknown (%d)"));
sFunc = try_val_to_str(iUCM, rtmpt_ucm_vals);
if (sFunc==NULL) {
*deschasopcode = TRUE;
- sFunc = ep_strdup_printf("User Control Message 0x%01x", iUCM);
+ sFunc = wmem_strdup_printf(wmem_packet_scope(), "User Control Message 0x%01x", iUCM);
}
if (iUCM==RTMPT_UCM_STREAM_BEGIN || iUCM==RTMPT_UCM_STREAM_EOF ||
iUCM==RTMPT_UCM_STREAM_DRY || iUCM==RTMPT_UCM_STREAM_ISRECORDED) {
if (tp->len>=6 && remain>=6) {
- sParam = ep_strdup_printf(" %d", tvb_get_ntohl(tvb, offset+2));
+ sParam = wmem_strdup_printf(wmem_packet_scope(), " %d", tvb_get_ntohl(tvb, offset+2));
}
} else if (iUCM==RTMPT_UCM_SET_BUFFER) {
if (tp->len>=10 && remain>=10) {
- sParam = ep_strdup_printf(" %d,%dms",
+ sParam = wmem_strdup_printf(wmem_packet_scope(), " %d,%dms",
tvb_get_ntohl(tvb, offset+2),
tvb_get_ntohl(tvb, offset+6));
}
}
- return ep_strdup_printf("%s%s", sFunc, sParam);
+ return wmem_strdup_printf(wmem_packet_scope(), "%s%s", sFunc, sParam);
} else if (tp->cmd==RTMPT_TYPE_COMMAND_AMF0 || tp->cmd==RTMPT_TYPE_COMMAND_AMF3 ||
tp->cmd==RTMPT_TYPE_DATA_AMF0 || tp->cmd==RTMPT_TYPE_DATA_AMF3) {
}
if (tp->txid!=0 && tp->otherframe==0) {
- tp->otherframe = GPOINTER_TO_INT(se_tree_lookup32(rconv->txids[cdir^1], tp->txid));
+ tp->otherframe = GPOINTER_TO_INT(wmem_tree_lookup32(rconv->txids[cdir^1], tp->txid));
if (tp->otherframe) {
RTMPT_DEBUG("got otherframe=%d\n", tp->otherframe);
}
if (sFunc) {
if (sParam) {
- return ep_strdup_printf("%s('%s')", sFunc, sParam);
+ return wmem_strdup_printf(wmem_packet_scope(), "%s('%s')", sFunc, sParam);
} else {
- return ep_strdup_printf("%s()", sFunc);
+ return wmem_strdup_printf(wmem_packet_scope(), "%s()", sFunc);
}
}
}
if (tp->cmd==RTMPT_TYPE_CHUNK_SIZE && tp->len>=4 && iBodyRemain>=4) {
guint32 newchunksize = tvb_get_ntohl(tvb, iBodyOffset);
if (newchunksize<rtmpt_max_packet_size) {
- se_tree_insert32(rconv->chunksize[cdir], tp->lastseq, GINT_TO_POINTER(newchunksize));
+ wmem_tree_insert32(rconv->chunksize[cdir], tp->lastseq, GINT_TO_POINTER(newchunksize));
}
}
tp->txid = rtmpt_get_amf_txid(tvb, iBodyOffset+soff);
if (tp->txid!=0) {
RTMPT_DEBUG("got txid=%d\n", tp->txid);
- se_tree_insert32(rconv->txids[cdir], tp->txid, GINT_TO_POINTER(pinfo->fd->num));
+ wmem_tree_insert32(rconv->txids[cdir], tp->txid, GINT_TO_POINTER(pinfo->fd->num));
}
}
}
if (pinfo->fd->flags.visited) {
/* Already done the work, so just dump the existing state */
- ep_stack_t packets;
+ wmem_stack_t *packets;
/* List all RTMP packets terminating in this TCP segment, from end to beginning */
- packets = ep_stack_new();
- ep_stack_push(packets, 0);
+ packets = wmem_stack_new(wmem_packet_scope());
+ wmem_stack_push(packets, 0);
- tp = (rtmpt_packet_t *)se_tree_lookup32_le(rconv->packets[cdir], seq+remain-1);
+ tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(rconv->packets[cdir], seq+remain-1);
while (tp && tp->lastseq>=seq) {
- ep_stack_push(packets, tp);
- tp = (rtmpt_packet_t *)se_tree_lookup32_le(rconv->packets[cdir], tp->lastseq-1);
+ wmem_stack_push(packets, tp);
+ tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(rconv->packets[cdir], tp->lastseq-1);
}
/* Dissect the generated list in reverse order (beginning to end) */
- while ((tp=(rtmpt_packet_t *)ep_stack_pop(packets))!=NULL) {
+ while ((tp=(rtmpt_packet_t *)wmem_stack_pop(packets))!=NULL) {
if (tp->resident) {
pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have);
add_new_data_source(pinfo, pktbuf, "Unchunked RTMP");
/* Check for outstanding fragmented headers/chunks first */
if (offset==0) {
- tf = (rtmpt_frag_t *)se_tree_lookup32_le(rconv->frags[cdir], seq+offset-1);
+ tf = (rtmpt_frag_t *)wmem_tree_lookup32_le(rconv->frags[cdir], seq+offset-1);
if (tf) {
/* May need to reassemble cross-TCP-segment fragments */
if (tf->have>=tf->len || seq+offset<tf->seq || seq+offset>tf->lastseq+tf->len-tf->have) {
tf = NULL;
} else if (!tf->ishdr) {
- ti = (rtmpt_id_t *)se_tree_lookup32(rconv->ids[cdir], tf->saved.id);
- if (ti) tp = (rtmpt_packet_t *)se_tree_lookup32_le(ti->packets, seq+offset-1);
+ ti = (rtmpt_id_t *)wmem_tree_lookup32(rconv->ids[cdir], tf->saved.id);
+ if (ti) tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(ti->packets, seq+offset-1);
if (tp && tp->chunkwant) {
goto unchunk;
}
if (remain<basic_hlen+message_hlen) {
/* Ran out of packet mid-header, save and try again next time */
- tf = se_new(rtmpt_frag_t);
+ tf = wmem_new(wmem_file_scope(), rtmpt_frag_t);
tf->ishdr = 1;
tf->seq = seq + offset;
tf->lastseq = tf->seq + remain - 1;
tf->len = basic_hlen + message_hlen;
tvb_memcpy(tvb, tf->saved.d, offset, remain);
tf->have = remain;
- se_tree_insert32(rconv->frags[cdir], seq+offset, tf);
+ wmem_tree_insert32(rconv->frags[cdir], seq+offset, tf);
return;
}
/* Calculate header values, defaulting from previous packets with same id */
- if (id<=RTMPT_ID_MAX) ti = (rtmpt_id_t *)se_tree_lookup32(rconv->ids[cdir], id);
- if (ti) tp = (rtmpt_packet_t *)se_tree_lookup32_le(ti->packets, seq+offset-1);
+ if (id<=RTMPT_ID_MAX) ti = (rtmpt_id_t *)wmem_tree_lookup32(rconv->ids[cdir], id);
+ if (ti) tp = (rtmpt_packet_t *)wmem_tree_lookup32_le(ti->packets, seq+offset-1);
if (header_type==0) src = tf ? pntohl(tf->saved.d+basic_hlen+7) : tvb_get_ntohl(tvb, offset+basic_hlen+7);
else if (ti) src = ti->src;
else if (id==RTMPT_TYPE_HANDSHAKE_2) chunk_size = body_len = 3072;
else /* if (id==RTMPT_TYPE_HANDSHAKE_3) */ chunk_size = body_len = 1536;
} else {
- chunk_size = GPOINTER_TO_INT(se_tree_lookup32_le(rconv->chunksize[cdir], seq+offset-1));
+ chunk_size = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->chunksize[cdir], seq+offset-1));
if (!chunk_size) chunk_size = RTMPT_DEFAULT_CHUNK_SIZE;
if (header_type<2) body_len = tf ? pntoh24(tf->saved.d+basic_hlen+3) : tvb_get_ntoh24(tvb, offset+basic_hlen+3);
ti, tp, header_type, basic_hlen+message_hlen, id, tp?tp->have:0, tp?tp->want:0, body_len, chunk_size);
if (!ti) {
- ti = se_new(rtmpt_id_t);
- ti->packets = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_packets");
+ ti = wmem_new(wmem_file_scope(), rtmpt_id_t);
+ ti->packets = wmem_tree_new(wmem_file_scope());
ti->ts = 0;
ti->tsd = 0;
- se_tree_insert32(rconv->ids[cdir], id, ti);
+ wmem_tree_insert32(rconv->ids[cdir], id, ti);
}
if (header_type==0) {
}
/* create a new packet structure */
- tp = se_new(rtmpt_packet_t);
+ tp = wmem_new(wmem_file_scope(), rtmpt_packet_t);
tp->seq = tp->lastseq = tf ? tf->seq : seq+offset;
tp->have = 0;
tp->want = basic_hlen + message_hlen + body_len;
ti->src = src;
/* store against the id only until unchunking is complete */
- se_tree_insert32(ti->packets, tp->seq, tp);
+ wmem_tree_insert32(ti->packets, tp->seq, tp);
if (!tf && body_len<=chunk_size && tp->want<=remain) {
/* The easy case - a whole packet contiguous and fully within this segment */
tp->lastseq = seq+offset+tp->want-1;
tp->have = tp->want;
- se_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
+ wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
pktbuf = tvb_new_subset(tvb, tp->data.offset, tp->have, tp->have);
dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp);
} else {
/* Some more reassembly required */
tp->resident = TRUE;
- tp->data.p = (guint8 *)se_alloc(tp->bhlen+tp->mhlen+tp->len);
+ tp->data.p = (guint8 *)wmem_alloc(wmem_file_scope(), tp->bhlen+tp->mhlen+tp->len);
if (tf && tf->ishdr) {
memcpy(tp->data.p, tf->saved.d, tf->len);
tp->have = basic_hlen + message_hlen;
if (tp->have==tp->want) {
- se_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
+ wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have);
add_new_data_source(pinfo, pktbuf, "Unchunked RTMP");
if (tp->have==tp->want) {
/* Whole packet is complete */
- se_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
+ wmem_tree_insert32(rconv->packets[cdir], tp->lastseq, tp);
pktbuf = tvb_new_child_real_data(tvb, tp->data.p, tp->have, tp->have);
add_new_data_source(pinfo, pktbuf, "Unchunked RTMP");
dissect_rtmpt(pktbuf, pinfo, tree, rconv, cdir, tp);
} else if (tp->chunkhave<tp->chunkwant) {
/* Chunk is split across segment boundary */
- rtmpt_frag_t *tf2 = se_new(rtmpt_frag_t);
+ rtmpt_frag_t *tf2 = wmem_new(wmem_file_scope(), rtmpt_frag_t);
tf2->ishdr = 0;
tf2->seq = seq + offset - want;
tf2->lastseq = tf2->seq + remain - 1 + want;
tf2->len = tp->chunkwant;
tf2->saved.id = tp->id;
RTMPT_DEBUG(" inserting tf @ %d\n", seq+offset-want-1);
- se_tree_insert32(rconv->frags[cdir], seq+offset-want-1, tf2);
+ wmem_tree_insert32(rconv->frags[cdir], seq+offset-want-1, tf2);
}
}
}
static rtmpt_conv_t*
rtmpt_init_rconv(conversation_t *conv)
{
- rtmpt_conv_t *rconv = se_new(rtmpt_conv_t);
+ rtmpt_conv_t *rconv = wmem_new(wmem_file_scope(), rtmpt_conv_t);
conversation_add_proto_data(conv, proto_rtmpt, rconv);
- rconv->seqs[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_seqs0");
- rconv->seqs[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_seqs1");
- rconv->frags[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_frags0");
- rconv->frags[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_frags1");
- rconv->ids[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_ids0");
- rconv->ids[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_ids1");
- rconv->packets[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_packets0");
- rconv->packets[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_packets1");
- rconv->chunksize[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_chunksize0");
- rconv->chunksize[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_chunksize1");
- rconv->txids[0] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_txids0");
- rconv->txids[1] = se_tree_create_non_persistent(EMEM_TREE_TYPE_RED_BLACK, "rtmpt_txids1");
+ rconv->seqs[0] = wmem_tree_new(wmem_file_scope());
+ rconv->seqs[1] = wmem_tree_new(wmem_file_scope());
+ rconv->frags[0] = wmem_tree_new(wmem_file_scope());
+ rconv->frags[1] = wmem_tree_new(wmem_file_scope());
+ rconv->ids[0] = wmem_tree_new(wmem_file_scope());
+ rconv->ids[1] = wmem_tree_new(wmem_file_scope());
+ rconv->packets[0] = wmem_tree_new(wmem_file_scope());
+ rconv->packets[1] = wmem_tree_new(wmem_file_scope());
+ rconv->chunksize[0] = wmem_tree_new(wmem_file_scope());
+ rconv->chunksize[1] = wmem_tree_new(wmem_file_scope());
+ rconv->txids[0] = wmem_tree_new(wmem_file_scope());
+ rconv->txids[1] = wmem_tree_new(wmem_file_scope());
return rconv;
}
* plus one. If there is no previous frame then we must be at seq=1!
* (This is per-conversation and per-direction, of course.) */
- lastackseq = GPOINTER_TO_INT(se_tree_lookup32_le(rconv->seqs[cdir ^ 1], pinfo->fd->num))+1;
+ lastackseq = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->seqs[cdir ^ 1], pinfo->fd->num))+1;
if (cdir==1 && lastackseq<2 && remain==17) {
/* Session startup: the client makes an /open/ request and
remain--;
}
- seq = GPOINTER_TO_INT(se_tree_lookup32(rconv->seqs[cdir], pinfo->fd->num));
+ seq = GPOINTER_TO_INT(wmem_tree_lookup32(rconv->seqs[cdir], pinfo->fd->num));
if (seq==0) {
- seq = GPOINTER_TO_INT(se_tree_lookup32_le(rconv->seqs[cdir], pinfo->fd->num));
+ seq = GPOINTER_TO_INT(wmem_tree_lookup32_le(rconv->seqs[cdir], pinfo->fd->num));
seq += remain;
- se_tree_insert32(rconv->seqs[cdir], pinfo->fd->num, GINT_TO_POINTER(seq));
+ wmem_tree_insert32(rconv->seqs[cdir], pinfo->fd->num, GINT_TO_POINTER(seq));
}
seq -= remain-1;
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/reassemble.h>
#include <epan/asn1.h>
#include <epan/uat.h>
static dissector_table_t sccp_ssn_dissector_table;
-static emem_tree_t *assocs = NULL;
+static wmem_tree_t *assocs = NULL;
static sccp_assoc_info_t *assoc;
static sccp_msg_info_t *sccp_msg;
static sccp_assoc_info_t no_assoc = {0,0,0,0,0,FALSE,FALSE,NULL,NULL,SCCP_PLOAD_NONE,NULL,NULL,NULL,0};
static sccp_assoc_info_t *
new_assoc(guint32 calling, guint32 called)
{
- sccp_assoc_info_t *a = se_new0(sccp_assoc_info_t);
+ sccp_assoc_info_t *a = wmem_new0(wmem_file_scope(), sccp_assoc_info_t);
a->id = next_assoc_id++;
a->calling_dpc = calling;
case SCCP_MSG_TYPE_CR:
{
/* CR contains the opc,dpc,dlr key of backward messages swapped as dpc,opc,slr */
- emem_tree_key_t bw_key[] = {
+ wmem_tree_key_t bw_key[] = {
{1, &dpck},
{1, &opck},
{1, &src_lr},
{0, NULL}
};
- if (! ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) && ! PINFO_FD_VISITED(pinfo) ) {
+ if (! ( assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) && ! PINFO_FD_VISITED(pinfo) ) {
assoc = new_assoc(opck, dpck);
- se_tree_insert32_array(assocs, bw_key, assoc);
+ wmem_tree_insert32_array(assocs, bw_key, assoc);
assoc->has_bw_key = TRUE;
}
}
case SCCP_MSG_TYPE_CC:
{
- emem_tree_key_t fw_key[] = {
+ wmem_tree_key_t fw_key[] = {
{1, &dpck}, {1, &opck}, {1, &src_lr}, {0, NULL}
};
- emem_tree_key_t bw_key[] = {
+ wmem_tree_key_t bw_key[] = {
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
- if ( ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) ) {
+ if ( ( assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) ) {
goto got_assoc;
}
- if ( (assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, fw_key) ) ) {
+ if ( (assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, fw_key) ) ) {
goto got_assoc;
}
pinfo->p2p_dir = P2P_DIR_RECV;
if ( ! PINFO_FD_VISITED(pinfo) && ! assoc->has_bw_key ) {
- se_tree_insert32_array(assocs, bw_key, assoc);
+ wmem_tree_insert32_array(assocs, bw_key, assoc);
assoc->has_bw_key = TRUE;
}
if ( ! PINFO_FD_VISITED(pinfo) && ! assoc->has_fw_key ) {
- se_tree_insert32_array(assocs, fw_key, assoc);
+ wmem_tree_insert32_array(assocs, fw_key, assoc);
assoc->has_fw_key = TRUE;
}
}
case SCCP_MSG_TYPE_RLC:
{
- emem_tree_key_t bw_key[] = {
+ wmem_tree_key_t bw_key[] = {
{1, &dpck}, {1, &opck}, {1, &src_lr}, {0, NULL}
};
- emem_tree_key_t fw_key[] = {
+ wmem_tree_key_t fw_key[] = {
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
- if ( ( assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, bw_key) ) ) {
+ if ( ( assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, bw_key) ) ) {
goto got_assoc_rlc;
}
- if ( (assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, fw_key) ) ) {
+ if ( (assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, fw_key) ) ) {
goto got_assoc_rlc;
}
pinfo->p2p_dir = P2P_DIR_SENT;
if ( ! PINFO_FD_VISITED(pinfo) && ! assoc->has_bw_key ) {
- se_tree_insert32_array(assocs, bw_key, assoc);
+ wmem_tree_insert32_array(assocs, bw_key, assoc);
assoc->has_bw_key = TRUE;
}
if ( ! PINFO_FD_VISITED(pinfo) && ! assoc->has_fw_key ) {
- se_tree_insert32_array(assocs, fw_key, assoc);
+ wmem_tree_insert32_array(assocs, fw_key, assoc);
assoc->has_fw_key = TRUE;
}
break;
}
default:
{
- emem_tree_key_t key[] = {
+ wmem_tree_key_t key[] = {
{1, &opck}, {1, &dpck}, {1, &dst_lr}, {0, NULL}
};
- assoc = (sccp_assoc_info_t *)se_tree_lookup32_array(assocs, key);
+ assoc = (sccp_assoc_info_t *)wmem_tree_lookup32_array(assocs, key);
if (assoc) {
if (assoc->calling_dpc == dpck) {
if (assoc && trace_sccp) {
if ( ! PINFO_FD_VISITED(pinfo)) {
- sccp_msg_info_t *msg = se_new0(sccp_msg_info_t);
+ sccp_msg_info_t *msg = wmem_new0(wmem_file_scope(), sccp_msg_info_t);
msg->framenum = framenum;
msg->offset = offset;
msg->data.co.next = NULL;
proto_tree *digits_tree;
char *gt_digits;
- gt_digits = (char *)ep_alloc0(GT_MAX_SIGNALS+1);
+ gt_digits = (char *)wmem_alloc0(wmem_packet_scope(), GT_MAX_SIGNALS+1);
while (offset < length) {
odd_signal = tvb_get_guint8(tvb, offset) & GT_ODD_SIGNAL_MASK;
if (is_connectionless(message_type) && sccp_msg) {
guint8 **gt_ptr = called ? &(sccp_msg->data.ud.called_gt) : &(sccp_msg->data.ud.calling_gt);
- *gt_ptr = (guint8 *)ep_strdup(gt_digits);
+ *gt_ptr = (guint8 *)wmem_strdup(wmem_packet_scope(), gt_digits);
}
digits_item = proto_tree_add_string(tree, called ? hf_sccp_called_gt_digits
static sccp_msg_info_t *
new_ud_msg(packet_info *pinfo, guint32 msg_type _U_)
{
- sccp_msg_info_t *m = ep_new0(sccp_msg_info_t);
+ sccp_msg_info_t *m = wmem_new0(wmem_packet_scope(), sccp_msg_info_t);
m->framenum = PINFO_FD_NUM(pinfo);
m->data.ud.calling_gt = NULL;
m->data.ud.called_gt = NULL;
register_init_routine(&init_sccp);
- assocs = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "sccp_associations");
+ assocs = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
sccp_tap = register_tap("sccp");