#include <glib.h>
#include <epan/packet.h>
+#include <epan/wmem/wmem.h>
#include "packet-e212.h"
#include "expert.h"
*/
/*
- * Return MCC MNC in a ep allocated string that can be used in labels.
+ * Return MCC MNC in a packet scope allocated string that can be used in labels.
*/
gchar *
-dissect_e212_mcc_mnc_ep_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian)
+dissect_e212_mcc_mnc_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian)
{
int start_offset, mcc_mnc;
/* Prepare a string with the MCC and MNC including the country and Operator if
* known, do NOT print unknown.
*/
- mcc_mnc_str = ep_strdup_printf("MCC %u %s, MNC %03u %s",
+ mcc_mnc_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %u %s, MNC %03u %s",
mcc,
val_to_str_ext_const(mcc,&E212_codes_ext,""),
mnc,
/* Prepare a string with the MCC and MNC including the country and Operator if
* known, do NOT print unknown.
*/
- mcc_mnc_str = ep_strdup_printf("MCC %u %s, MNC %02u %s",
+ mcc_mnc_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %u %s, MNC %02u %s",
mcc,
val_to_str_ext_const(mcc,&E212_codes_ext,""),
mnc,
int
dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian)
{
- dissect_e212_mcc_mnc_ep_str(tvb, pinfo, tree, offset, little_endian);
+ dissect_e212_mcc_mnc_packet_str(tvb, pinfo, tree, offset, little_endian);
return offset +3;
}
extern value_string_ext E212_codes_ext;
-gchar* dissect_e212_mcc_mnc_ep_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian);
+gchar* dissect_e212_mcc_mnc_packet_str(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian);
WS_DLL_PUBLIC
int dissect_e212_mcc_mnc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, gboolean little_endian);
WS_DLL_PUBLIC
#include <epan/packet.h>
#include <epan/tap.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/asn1.h>
#include "packet-bssap.h"
str = try_val_to_str_idx_ext((guint32) oct, &gsm_a_bssmap_msg_strings_ext, &idx);
if (sccp_msg_p && !sccp_msg_p->data.co.label) {
- sccp_msg_p->data.co.label = se_strdup(val_to_str_ext((guint32)oct,
- &gsm_a_bssmap_msg_strings_ext,
- "BSSMAP (0x%02x)"));
+ sccp_msg_p->data.co.label = wmem_strdup(wmem_file_scope(),
+ val_to_str_ext((guint32)oct,
+ &gsm_a_bssmap_msg_strings_ext,
+ "BSSMAP (0x%02x)"));
}
/*
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/tap.h>
+#include <epan/wmem/wmem.h>
#include "packet-bssap.h"
#include "packet-sccp.h"
{
gchar *a_add_string;
- a_add_string = (gchar *)ep_alloc(1024);
+ a_add_string = (gchar *)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed =
(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2,
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed =
(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + lengt_length,
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed =
(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1 + 2,
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1, -1, a_add_string, 1024);
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, RIGHT_NIBBLE, a_add_string, 1024);
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed =
(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 1,
{
gchar *a_add_string;
- a_add_string = (gchar*)ep_alloc(1024);
+ a_add_string = (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed =
(*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset + 2,
subtree = proto_item_add_subtree(item, elem_ett[idx]);
- a_add_string= (gchar*)ep_alloc(1024);
+ a_add_string= (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
consumed = (*elem_funcs[idx])(tvb, subtree, pinfo, curr_offset, -1, a_add_string, 1024);
if (a_add_string[0] != '\0')
subtree = proto_item_add_subtree(item, elem_ett[idx]);
- a_add_string= (gchar*)ep_alloc(1024);
+ a_add_string= (gchar*)wmem_alloc(wmem_packet_scope(), 1024);
a_add_string[0] = '\0';
if (elem_funcs[idx] == NULL)
digit_str);
if (sccp_assoc && ! sccp_assoc->calling_party) {
- sccp_assoc->calling_party = se_strdup_printf(
+ sccp_assoc->calling_party = wmem_strdup_printf(wmem_file_scope(),
((oct & 0x07) == 3) ? "IMEISV: %s" : "IMSI: %s",
digit_str );
}
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/tap.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/asn1.h>
#include <epan/strutil.h>
if(addr_extr) {
if (sccp_assoc && ! sccp_assoc->called_party) {
- sccp_assoc->called_party = se_strdup(a_bigbuf);
+ sccp_assoc->called_party = wmem_strdup(wmem_file_scope(), a_bigbuf);
}
if (add_string)
dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg);
if (sccp_msg && !sccp_msg->data.co.label) {
- sccp_msg->data.co.label = se_strdup_printf("DTAP (0x%02x)",oct);
+ sccp_msg->data.co.label = wmem_strdup_printf(wmem_file_scope(), "DTAP (0x%02x)",oct);
}
dtap_tree = proto_item_add_subtree(dtap_item, ett_tree);
if (sccp_msg && !sccp_msg->data.co.label) {
- sccp_msg->data.co.label = se_strdup(msg_str);
+ sccp_msg->data.co.label = wmem_strdup(wmem_file_scope(), msg_str);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
#include <epan/prefs.h>
#include <epan/tap.h>
#include <epan/asn1.h>
+#include <epan/wmem/wmem.h>
#include "packet-bssap.h"
#include "packet-sccp.h"
{
case 0x00: str = "Subscribed maximum bit rate for uplink/reserved"; break;
case 0xff: str = "0 kbps"; break;
- default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
+ default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl, tvb,
{
case 0x00: str = "Subscribed maximum bit rate for downlink/reserved"; break;
case 0xff: str = "0 kbps"; break;
- default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
+ default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl, tvb,
temp32 = (tmp_oct - 0x10) * 50 + 200;
else
temp32 = (tmp_oct - 0x20) * 100 + 1000;
- str = ep_strdup_printf("%u ms", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u ms", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_trans_delay, tvb,
{
case 0x00: str = "Subscribed guaranteed bit rate for uplink/reserved"; break;
case 0xff: str = "0 kbps"; break;
- default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
+ default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl, tvb,
{
case 0x00: str = "Subscribed guaranteed bit rate for downlink/reserved"; break;
case 0xff: str = "0 kbps"; break;
- default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
+ default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl, tvb,
{
temp32 = qos_calc_ext_bitrate(oct);
if (temp32 % 1000 == 0)
- str = ep_strdup_printf("%u Mbps", temp32 / 1000);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000);
else
- str = ep_strdup_printf("%u kbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
{
temp32 = qos_calc_ext_bitrate(oct);
if (temp32 % 1000 == 0)
- str = ep_strdup_printf("%u Mbps", temp32 / 1000);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000);
else
- str = ep_strdup_printf("%u kbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl_ext, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
{
temp32 = qos_calc_ext_bitrate(oct);
if (temp32 % 1000 == 0)
- str = ep_strdup_printf("%u Mbps", temp32 / 1000);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000);
else
- str = ep_strdup_printf("%u kbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl_ext, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
{
temp32 = qos_calc_ext_bitrate(oct);
if (temp32 % 1000 == 0)
- str = ep_strdup_printf("%u Mbps", temp32 / 1000);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000);
else
- str = ep_strdup_printf("%u kbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl_ext, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
else
{
temp32 = qos_calc_ext2_bitrate(oct);
- str = ep_strdup_printf("%u Mbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext2, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
else
{
temp32 = qos_calc_ext2_bitrate(oct);
- str = ep_strdup_printf("%u Mbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_downl_ext2, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
else
{
temp32 = qos_calc_ext2_bitrate(oct);
- str = ep_strdup_printf("%u Mbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_upl_ext2, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
else
{
temp32 = qos_calc_ext2_bitrate(oct);
- str = ep_strdup_printf("%u Mbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_guar_bitrate_upl_ext2, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
{
case 0x00: str = "Subscribed maximum bit rate for downlink/reserved"; break;
case 0xff: str = "0 kbps"; break;
- default: str = ep_strdup_printf("%u kbps", qos_calc_bitrate(oct));
+ default: str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl, tvb,
{
temp32 = qos_calc_ext_bitrate(oct);
if (temp32 % 1000 == 0)
- str = ep_strdup_printf("%u Mbps", temp32 / 1000);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", temp32 / 1000);
else
- str = ep_strdup_printf("%u kbps", temp32);
+ str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", temp32);
}
proto_tree_add_uint_format_value(tree, hf_gsm_a_sm_qos_max_bitrate_downl_ext, tvb,
curr_offset, 1, oct, "%s (%u)", str, oct);
if(oct < 0x80)
str = "Reserved";
else if (oct < 0xff)
- str = ep_strdup_printf("NSAPI %u for Multimedia Broadcast/Multicast Service (MBMS) Multicast mode", oct);
+ str = wmem_strdup_printf(wmem_packet_scope(), "NSAPI %u for Multimedia Broadcast/Multicast Service (MBMS) Multicast mode", oct);
else
str = "Reserved for use by lower layers in the p2p radio bearer allocation message for MBMS Broadcast mode";
#include <glib.h>
#include <epan/packet.h>
#include <epan/expert.h>
+#include <epan/wmem/wmem.h>
#include "packet-csn1.h"
#include "packet-gsm_rlcmac.h"
RlcMacDownlink_t * data;
/* allocate a data structure and guess the coding scheme */
- data = ep_new(RlcMacDownlink_t);
+ data = wmem_new(wmem_packet_scope(), RlcMacDownlink_t);
if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER))
{
RlcMacUplink_t *data;
/* allocate a data structure and set the coding scheme */
- data = ep_new(RlcMacUplink_t);
+ data = wmem_new(wmem_packet_scope(), RlcMacUplink_t);
if ((pinfo->private_data != NULL) && (((RlcMacPrivateData_t *)(pinfo->private_data))->magic == GSM_RLC_MAC_MAGIC_NUMBER))
{
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
+#include <epan/wmem/wmem.h>
#include "packet-gsm_sms.h"
addrstr = gsm_sms_chars_to_utf8(addrbuf, i);
break;
default:
- addrstr = (gchar *)ep_alloc(numdigocts*2 + 1);
+ addrstr = (gchar *)wmem_alloc(wmem_packet_scope(), numdigocts*2 + 1);
for (i = 0; i < numdigocts; i++)
{
oct = tvb_get_guint8(tvb, offset + i);
}
/* Now allocate a buffer for the output string and fill it in */
- outbuf = (gchar *)ep_alloc(outlen + 1);
+ outbuf = (gchar *)wmem_alloc(wmem_packet_scope(), outlen + 1);
for (i = 0, j = 0; j < len; j++)
{
if (char_is_escape(src[j])) {
{
gchar *mcc_mnc_str;
- mcc_mnc_str = dissect_e212_mcc_mnc_ep_str(tvb, pinfo, tree, 0, TRUE);
+ mcc_mnc_str = dissect_e212_mcc_mnc_packet_str(tvb, pinfo, tree, 0, TRUE);
proto_item_append_text(item, "%s", mcc_mnc_str);
}
guint32 trace_id;
gchar *mcc_mnc_str;
- mcc_mnc_str = dissect_e212_mcc_mnc_ep_str(tvb, pinfo, tree, 0, TRUE);
+ mcc_mnc_str = dissect_e212_mcc_mnc_packet_str(tvb, pinfo, tree, 0, TRUE);
offset += 3;
trace_id = tvb_get_ntohs(tvb, offset);
{
gchar *mcc_mnc_str;
- mcc_mnc_str = dissect_e212_mcc_mnc_ep_str(tvb, pinfo, tree, 0, FALSE);
+ mcc_mnc_str = dissect_e212_mcc_mnc_packet_str(tvb, pinfo, tree, 0, FALSE);
proto_item_append_text(item, "%s", mcc_mnc_str);
}
#include <epan/prefs.h>
#include <epan/tap.h>
#include <epan/uat.h>
+#include <epan/wmem/wmem.h>
#include "packet-mac-lte.h"
#include "packet-rlc-lte.h"
GUINT_TO_POINTER((guint)p_mac_lte_info->ueid));
if (drx_config_entry != NULL) {
/* Copy config into separate struct just for this frame, and add to result table */
- drx_config_t *frame_config = se_new(drx_config_t);
+ drx_config_t *frame_config = wmem_new(wmem_file_scope(), drx_config_t);
*frame_config = *drx_config_entry;
g_hash_table_insert(mac_lte_drx_config_result, GUINT_TO_POINTER(pinfo->fd->num), frame_config);
}
p_mac_lte_info = (mac_lte_info *)p_get_proto_data(pinfo->fd, proto_mac_lte, 0);
if (p_mac_lte_info == NULL) {
/* Allocate new info struct for this frame */
- p_mac_lte_info = se_new0(struct mac_lte_info);
+ p_mac_lte_info = wmem_new0(wmem_file_scope(), struct mac_lte_info);
infoAlreadySet = FALSE;
}
else {
gint offset, mac_lte_info *p_mac_lte_info, mac_lte_tap_info *tap_info)
{
gint number_of_rars = 0; /* No of RAR bodies expected following headers */
- guint8 *rapids = (guint8 *)ep_alloc(MAX_RAR_PDUS * sizeof(guint8));
+ guint8 *rapids = (guint8 *)wmem_alloc(wmem_packet_scope(), MAX_RAR_PDUS * sizeof(guint8));
gboolean backoff_indicator_seen = FALSE;
guint8 backoff_indicator = 0;
guint8 extension;
/* Resuse or create RLC info */
p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(pinfo->fd, proto_rlc_lte, 0);
if (p_rlc_lte_info == NULL) {
- p_rlc_lte_info = se_new0(struct rlc_lte_info);
+ p_rlc_lte_info = wmem_new0(wmem_file_scope(), struct rlc_lte_info);
}
/* Fill in struct details for srb channels */
if ((total_gap >= 8) && (total_gap <= 13)) {
/* Resend detected! Store result pointing back. */
- result = se_new0(DLHARQResult);
+ result = wmem_new0(wmem_file_scope(), DLHARQResult);
result->previousSet = TRUE;
result->previousFrameNum = lastData->framenum;
result->timeSincePreviousFrame = total_gap;
/* Now make previous frame point forward to here */
original_result = (DLHARQResult *)g_hash_table_lookup(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
if (original_result == NULL) {
- original_result = se_new0(DLHARQResult);
+ original_result = wmem_new0(wmem_file_scope(), DLHARQResult);
g_hash_table_insert(mac_lte_dl_harq_result_hash, GUINT_TO_POINTER(lastData->framenum), original_result);
}
original_result->nextSet = TRUE;
}
else {
/* Allocate entry in table for this UE/RNTI */
- ueData = se_new0(DLHarqBuffers);
+ ueData = wmem_new0(wmem_file_scope(), DLHarqBuffers);
g_hash_table_insert(mac_lte_dl_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti), ueData);
}
ULHARQResult *original_result;
/* Original detected!!! Store result pointing back */
- result = se_new0(ULHARQResult);
+ result = wmem_new0(wmem_file_scope(), ULHARQResult);
result->previousSet = TRUE;
result->previousFrameNum = lastData->framenum;
result->timeSincePreviousFrame = total_gap;
/* Now make previous frame point forward to here */
original_result = (ULHARQResult *)g_hash_table_lookup(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(lastData->framenum));
if (original_result == NULL) {
- original_result = se_new0(ULHARQResult);
+ original_result = wmem_new0(wmem_file_scope(), ULHARQResult);
g_hash_table_insert(mac_lte_ul_harq_result_hash, GUINT_TO_POINTER(lastData->framenum), original_result);
}
original_result->nextSet = TRUE;
}
else {
/* Allocate entry in table for this UE/RNTI */
- ueData = se_new0(ULHarqBuffers);
+ ueData = wmem_new0(wmem_file_scope(), ULHarqBuffers);
g_hash_table_insert(mac_lte_ul_harq_hash, GUINT_TO_POINTER((guint)p_mac_lte_info->rnti), ueData);
}
result = (SRResult *)g_hash_table_lookup(mac_lte_sr_request_hash, GUINT_TO_POINTER(frameNum));
if ((result == NULL) && can_create) {
- result = se_new0(SRResult);
+ result = wmem_new0(wmem_file_scope(), SRResult);
g_hash_table_insert(mac_lte_sr_request_hash, GUINT_TO_POINTER((guint)frameNum), result);
}
return result;
state = (SRState *)g_hash_table_lookup(mac_lte_ue_sr_state, GUINT_TO_POINTER((guint)rnti));
if (state == NULL) {
/* Allocate status for this RNTI */
- state = se_new(SRState);
+ state = wmem_new(wmem_file_scope(), SRState);
state->status = None;
g_hash_table_insert(mac_lte_ue_sr_state, GUINT_TO_POINTER((guint)rnti), state);
}
}
/* Set result state for this frame */
- result = se_new(TTIInfoResult_t);
+ result = wmem_new(wmem_file_scope(), TTIInfoResult_t);
result->ues_in_tti = tti_info->ues_in_tti;
g_hash_table_insert(mac_lte_tti_info_result_hash,
GUINT_TO_POINTER(pinfo->fd->num), result);
guint msg3Key = p_mac_lte_info->rnti;
/* Allocate result and add it to the table */
- crResult = se_new(ContentionResolutionResult);
+ crResult = wmem_new(wmem_file_scope(), ContentionResolutionResult);
g_hash_table_insert(mac_lte_cr_result_hash, GUINT_TO_POINTER(pinfo->fd->num), crResult);
/* Look for Msg3 */
/* Look for previous entry for this UE */
if (data == NULL) {
/* Allocate space for data and add to table */
- data = se_new(Msg3Data);
+ data = wmem_new(wmem_file_scope(), Msg3Data);
g_hash_table_insert(mac_lte_msg3_hash, GUINT_TO_POINTER(key), data);
}
gint n;
/* Allocate and zero tap struct */
- mac_lte_tap_info *tap_info = (mac_lte_tap_info *)ep_alloc0(sizeof(mac_lte_tap_info));
+ mac_lte_tap_info *tap_info = (mac_lte_tap_info *)wmem_alloc0(wmem_packet_scope(), sizeof(mac_lte_tap_info));
/* Set protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MAC-LTE");
GUINT_TO_POINTER((guint)drb_mapping->ueid));
if (!ue_mappings) {
/* If not found, create & add to table */
- ue_mappings = se_new0(ue_dynamic_drb_mappings_t);
+ ue_mappings = wmem_new0(wmem_file_scope(), ue_dynamic_drb_mappings_t);
g_hash_table_insert(mac_lte_ue_channels_hash,
GUINT_TO_POINTER((guint)drb_mapping->ueid),
ue_mappings);
/* Find or create config struct for table entry */
drx_config_entry = (drx_config_t *)g_hash_table_lookup(mac_lte_drx_config, GUINT_TO_POINTER((guint)ueid));
if (drx_config_entry == NULL) {
- drx_config_entry = (drx_config_t *)se_new(drx_config_t);
+ drx_config_entry = (drx_config_t *)wmem_new(wmem_file_scope(), drx_config_t);
}
/* Copy in new config */
*drx_config_entry = *drx_config;
/* TODO: remember previous config (if any?) */
/* Store this snapshot into the result info table */
- result_entry = (drx_config_t *)se_new(drx_config_t);
+ result_entry = (drx_config_t *)wmem_new(wmem_file_scope(), drx_config_t);
*result_entry = *drx_config_entry;
g_hash_table_insert(mac_lte_drx_config, GUINT_TO_POINTER((guint)ueid), result_entry);
}
break;
/* 13, Serving Network */
case 13:
- mcc_mnc_str = dissect_e212_mcc_mnc_ep_str(tvb, pinfo, tree, offset, TRUE);
+ mcc_mnc_str = dissect_e212_mcc_mnc_packet_str(tvb, pinfo, tree, offset, TRUE);
proto_item_append_text(hdr_item," %s", mcc_mnc_str);
break;
/* 14, APN Restriction */
#include <epan/packet.h>
#include <epan/asn1.h>
#include <epan/prefs.h>
+#include <epan/wmem/wmem.h>
#include "packet-gsm_map.h"
#include "packet-gsm_a_common.h"
length = tvb_length(tvb);
- digit_str = (char *)ep_alloc(length*2);
+ digit_str = (char *)wmem_alloc(wmem_packet_scope(), length*2);
/* Get identity digit 1 */
octet = tvb_get_guint8(tvb,offset);
#include <epan/prefs.h>
#include <epan/expert.h>
#include <epan/addr_resolv.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include "packet-rlc-lte.h"
#include "packet-pdcp-lte.h"
/* Only allocate a struct when will be adding entry */
if (do_persist) {
- p_key = se_new(pdcp_result_hash_key);
+ p_key = wmem_new(wmem_file_scope(), pdcp_result_hash_key);
}
else {
memset(&key, 0, sizeof(pdcp_result_hash_key));
createdChannel = TRUE;
/* Allocate a new value and duplicate key contents */
- p_channel_status = se_new0(pdcp_channel_status);
+ p_channel_status = wmem_new0(wmem_file_scope(), pdcp_channel_status);
/* Add entry */
g_hash_table_insert(pdcp_sequence_analysis_channel_hash,
}
/* Create space for frame state_report */
- p_report_in_frame = se_new(pdcp_sequence_report_in_frame);
+ p_report_in_frame = wmem_new(wmem_file_scope(), pdcp_sequence_report_in_frame);
p_report_in_frame->nextFrameNum = 0;
switch (p_pdcp_lte_info->seqnum_length) {
p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(pinfo->fd, proto_pdcp_lte, 0);
if (p_pdcp_lte_info == NULL) {
/* Allocate new info struct for this frame */
- p_pdcp_lte_info = se_new0(pdcp_lte_info);
+ p_pdcp_lte_info = wmem_new0(wmem_file_scope(), pdcp_lte_info);
infoAlreadySet = FALSE;
}
else {
offset, -1, ENC_NA);
bitmap_tree = proto_item_add_subtree(bitmap_ti, ett_pdcp_report_bitmap);
- buff = (gchar *)ep_alloc(BUFF_SIZE);
+ buff = (gchar *)wmem_alloc(wmem_packet_scope(), BUFF_SIZE);
len = tvb_length_remaining(tvb, offset);
bit_offset = offset<<3;
/* For each byte... */
rohc_tvb = tvb_new_subset_remaining(tvb, rohc_offset);
/* RoHC settings */
- p_rohc_info = ep_new(rohc_info);
+ p_rohc_info = wmem_new(wmem_packet_scope(), rohc_info);
p_rohc_info->rohc_compression = p_pdcp_info->rohc_compression;
p_rohc_info->rohc_ip_version = p_pdcp_info->rohc_ip_version;
#include <epan/expert.h>
#include <epan/prefs.h>
#include <epan/tap.h>
+#include <epan/wmem/wmem.h>
#include "packet-mac-lte.h"
#include "packet-rlc-lte.h"
/* Create a new struct for reassembly */
static void reassembly_reset(channel_sequence_analysis_status *status)
{
- status->reassembly_info = se_new0(rlc_channel_reassembly_info);
+ status->reassembly_info = wmem_new0(wmem_file_scope(), rlc_channel_reassembly_info);
}
/* Hide previous one */
return;
}
- segment_data = (guint8 *)se_alloc(length);
+ segment_data = (guint8 *)wmem_alloc(wmem_file_scope(), length);
/* TODO: is there a better way to do this? */
memcpy(segment_data, tvb_get_ptr(tvb, offset, length), length);
/* Reuse or allocate struct */
p_pdcp_lte_info = (pdcp_lte_info *)p_get_proto_data(pinfo->fd, proto_pdcp_lte, 0);
if (p_pdcp_lte_info == NULL) {
- p_pdcp_lte_info = se_new0(pdcp_lte_info);
+ p_pdcp_lte_info = wmem_new0(wmem_file_scope(), pdcp_lte_info);
/* Store info in packet */
p_add_proto_data(pinfo->fd, proto_pdcp_lte, 0, p_pdcp_lte_info);
}
/* Only allocate a struct when will be adding entry */
if (do_persist) {
- p_key = se_new0(rlc_result_hash_key);
+ p_key = wmem_new0(wmem_file_scope(), rlc_result_hash_key);
}
else {
memset(&key, 0, sizeof(rlc_result_hash_key));
createdChannel = TRUE;
/* Allocate a new value and duplicate key contents */
- p_channel_status = se_new0(channel_sequence_analysis_status);
- p_channel_key = (channel_hash_key *)se_memdup(&channel_key, sizeof(channel_hash_key));
+ p_channel_status = wmem_new0(wmem_file_scope(), channel_sequence_analysis_status);
+ p_channel_key = (channel_hash_key *)wmem_memdup(wmem_file_scope(), &channel_key, sizeof(channel_hash_key));
/* Set mode */
p_channel_status->rlcMode = p_rlc_lte_info->rlcMode;
}
/* Create space for frame state_report */
- p_report_in_frame = se_new0(sequence_analysis_report);
+ p_report_in_frame = wmem_new0(wmem_file_scope(), sequence_analysis_report);
/* Deal with according to channel mode */
if (p_channel_status == NULL) {
/* Allocate a new key and value */
- p_channel_key = se_new(channel_hash_key);
- p_channel_status = se_new0(channel_repeated_nack_status);
+ p_channel_key = wmem_new(wmem_file_scope(), channel_hash_key);
+ p_channel_status = wmem_new0(wmem_file_scope(), channel_repeated_nack_status);
/* Copy key contents */
memcpy(p_channel_key, &channel_key, sizeof(channel_hash_key));
if (noOfNACKsRepeated >= 1) {
/* Create space for frame state_report */
- p_report_in_frame = se_new(channel_repeated_nack_report);
+ p_report_in_frame = wmem_new(wmem_file_scope(), channel_repeated_nack_report);
/* Copy in found duplicates */
for (n=0; n < MIN(tap_info->noOfNACKs, MAX_NACKs); n++) {
if (((1024 + p_channel_status->previousSequenceNumber+1 - ack_sn) % 1024) > 512) {
/* Set result */
- p_report_in_frame = se_new0(sequence_analysis_report);
+ p_report_in_frame = wmem_new0(wmem_file_scope(), sequence_analysis_report);
p_report_in_frame->state = ACK_Out_of_Window;
p_report_in_frame->previousFrameNum = p_channel_status->previousFrameNum;
p_report_in_frame->sequenceExpected = p_channel_status->previousSequenceNumber;
p_rlc_lte_info = (rlc_lte_info *)p_get_proto_data(pinfo->fd, proto_rlc_lte, 0);
if (p_rlc_lte_info == NULL) {
/* Allocate new info struct for this frame */
- p_rlc_lte_info = se_new0(struct rlc_lte_info);
+ p_rlc_lte_info = wmem_new0(wmem_file_scope(), struct rlc_lte_info);
infoAlreadySet = FALSE;
}
else {
struct rlc_lte_info *p_rlc_lte_info = NULL;
/* Allocate and Zero tap struct */
- rlc_lte_tap_info *tap_info = ep_new0(rlc_lte_tap_info);
+ rlc_lte_tap_info *tap_info = wmem_new0(wmem_packet_scope(), rlc_lte_tap_info);
/* Set protocol name */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RLC-LTE");
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/req_resp_hdrs.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/strutil.h>
#include <epan/tap.h>
#include <epan/exported_pdu.h>
}
/* Initialise stat info for passing to tap */
- stat_info = ep_new0(sip_info_value_t);
+ stat_info = wmem_new0(wmem_packet_scope(), sip_info_value_t);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SIP");
case POS_CALL_ID :
/* Store the Call-id */
g_strlcpy(call_id, value, MAX_CALL_ID_SIZE);
- stat_info->tap_call_id = ep_strdup(call_id);
+ stat_info->tap_call_id = wmem_strdup(wmem_packet_scope(), call_id);
/* Add 'Call-id' string item to tree */
if(hdr_tree) {
/* Need to create a new table entry */
/* Allocate a new key and value */
- p_key = se_new(sip_hash_key);
- p_val = se_new(sip_hash_value);
+ p_key = wmem_new(wmem_file_scope(), sip_hash_key);
+ p_val = wmem_new(wmem_file_scope(), sip_hash_value);
/* Fill in key and value details */
g_snprintf(p_key->call_id, MAX_CALL_ID_SIZE, "%s", call_id);
sip_frame_result = (sip_frame_result_value *)p_get_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num);
if (sip_frame_result == NULL)
{
- sip_frame_result = se_new0(sip_frame_result_value);
+ sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}
if (sip_frame_result == NULL)
{
/* Allocate and set all values to zero */
- sip_frame_result = se_new0(sip_frame_result_value);
+ sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}
if (sip_frame_result == NULL)
{
/* Allocate and set all values to zero */
- sip_frame_result = se_new0(sip_frame_result_value);
+ sip_frame_result = wmem_new0(wmem_file_scope(), sip_frame_result_value);
p_add_proto_data(pinfo->fd, proto_sip, pinfo->curr_layer_num, sip_frame_result);
}