diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-15 21:36:37 +0000 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2013-09-15 21:36:37 +0000 |
commit | da8240ef608746f9f47526c315c0dca8fcc0ab15 (patch) | |
tree | 874489efe62bd5f22680aadd4df3ad834421975e | |
parent | da27bad13bfddec18c18a8e95a994b7c676a6f05 (diff) |
emem -> wmem (except uat or init routines)
svn path=/trunk/; revision=52087
-rw-r--r-- | epan/dissectors/packet-rmt-fec.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-rmt-norm.c | 5 | ||||
-rw-r--r-- | epan/dissectors/packet-rpcap.c | 3 | ||||
-rw-r--r-- | epan/dissectors/packet-rsh.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-rsync.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-rtps.c | 41 | ||||
-rw-r--r-- | epan/dissectors/packet-smb-sidsnooping.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-smb2.c | 55 | ||||
-rw-r--r-- | epan/dissectors/packet-snmp.c | 29 | ||||
-rw-r--r-- | epan/dissectors/packet-ssl.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-tpncp.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-ua3g.c | 36 | ||||
-rw-r--r-- | epan/dissectors/packet-vxi11.c | 26 | ||||
-rw-r--r-- | epan/dissectors/packet-zbee-aps.c | 5 |
14 files changed, 116 insertions, 107 deletions
diff --git a/epan/dissectors/packet-rmt-fec.c b/epan/dissectors/packet-rmt-fec.c index cd3d39a4c7..f50abda540 100644 --- a/epan/dissectors/packet-rmt-fec.c +++ b/epan/dissectors/packet-rmt-fec.c @@ -45,6 +45,7 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> +#include <epan/wmem/wmem.h> #include "packet-rmt-common.h" @@ -119,7 +120,7 @@ void fec_decode_ext_fti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int instance_id = (guint8) tvb_get_ntohs(tvb, offset+8); /* Decode FEC Instance ID */ - fec_data = se_new0(fec_packet_data_t); + fec_data = wmem_new0(wmem_file_scope(), fec_packet_data_t); fec_data->instance_id = instance_id; p_add_proto_data(pinfo->fd, proto_rmt_fec, 0, fec_data); diff --git a/epan/dissectors/packet-rmt-norm.c b/epan/dissectors/packet-rmt-norm.c index 23a044a646..b16958d6ef 100644 --- a/epan/dissectors/packet-rmt-norm.c +++ b/epan/dissectors/packet-rmt-norm.c @@ -47,6 +47,7 @@ #include <epan/packet.h> #include <epan/prefs.h> #include <epan/expert.h> +#include <epan/wmem/wmem.h> #include "packet-rmt-common.h" @@ -251,7 +252,7 @@ static guint dissect_feccode(proto_tree *tree, guint8 encoding_id = tvb_get_guint8(tvb, offset); /* Save encoding ID */ - norm_data = se_new0(norm_packet_data_t); + norm_data = wmem_new0(wmem_file_scope(), norm_packet_data_t); norm_data->encoding_id = encoding_id; p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data); @@ -385,7 +386,7 @@ static void dissect_norm_info(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv offset++; /* Save encoding ID */ - norm_data = se_new0(norm_packet_data_t); + norm_data = wmem_new0(wmem_file_scope(), norm_packet_data_t); norm_data->encoding_id = tvb_get_guint8(tvb, offset); p_add_proto_data(pinfo->fd, proto_rmt_norm, 0, norm_data); diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c index 0dab4dc948..35c8131fc8 100644 --- a/epan/dissectors/packet-rpcap.c +++ b/epan/dissectors/packet-rpcap.c @@ -43,6 +43,7 @@ #include <epan/prefs.h> #include <epan/to_str.h> #include <epan/expert.h> +#include <epan/wmem/wmem.h> #include <wiretap/wtap.h> @@ -736,7 +737,7 @@ dissect_rpcap_startcap_request (tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item (field_tree, hf_flags_outbound, tvb, offset, 2, ENC_BIG_ENDIAN); if (flags & 0x1F) { - gchar *flagstr = ep_strdup_printf ("%s%s%s%s%s", + gchar *flagstr = wmem_strdup_printf (wmem_packet_scope(), "%s%s%s%s%s", (flags & FLAG_PROMISC) ? ", Promiscuous" : "", (flags & FLAG_DGRAM) ? ", Datagram" : "", (flags & FLAG_SERVEROPEN) ? ", ServerOpen" : "", diff --git a/epan/dissectors/packet-rsh.c b/epan/dissectors/packet-rsh.c index 64914388ef..7cf5ad8255 100644 --- a/epan/dissectors/packet-rsh.c +++ b/epan/dissectors/packet-rsh.c @@ -328,7 +328,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) * info column of the entire conversation */ if(!hash_info->command){ - hash_info->command=se_strdup((gchar*)field_stringz); + hash_info->command=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz); } } else { diff --git a/epan/dissectors/packet-rsync.c b/epan/dissectors/packet-rsync.c index 1fa8b9b40f..8602aea563 100644 --- a/epan/dissectors/packet-rsync.c +++ b/epan/dissectors/packet-rsync.c @@ -33,7 +33,7 @@ #include <epan/packet.h> #include <epan/strutil.h> #include <epan/conversation.h> - +#include <epan/wmem/wmem.h> #include <epan/prefs.h> #define RSYNCD_MAGIC_HEADER "@RSYNCD:" @@ -135,7 +135,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, conversation_data = (struct rsync_conversation_data *)conversation_get_proto_data(conversation, proto_rsync); if (conversation_data == NULL) { /* new conversation */ - conversation_data = se_new(struct rsync_conversation_data); + conversation_data = wmem_new(wmem_file_scope(), struct rsync_conversation_data); conversation_data->client_state = RSYNC_INIT; conversation_data->server_state = RSYNC_SERV_INIT; conversation_add_proto_data(conversation, proto_rsync, conversation_data); @@ -150,7 +150,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, rsync_frame_data_p = (struct rsync_frame_data *)p_get_proto_data(pinfo->fd, proto_rsync, 0); if (!rsync_frame_data_p) { /* then we haven't seen this frame before */ - rsync_frame_data_p = se_new(struct rsync_frame_data); + rsync_frame_data_p = wmem_new(wmem_file_scope(), struct rsync_frame_data); rsync_frame_data_p->state = (me == SERVER) ? conversation_data->server_state : conversation_data->client_state; p_add_proto_data(pinfo->fd, proto_rsync, 0, rsync_frame_data_p); } diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c index 7a2624f710..21c09ee68f 100644 --- a/epan/dissectors/packet-rtps.c +++ b/epan/dissectors/packet-rtps.c @@ -57,6 +57,7 @@ #include <epan/expert.h> #include <epan/prefs.h> #include <epan/addr_resolv.h> +#include <epan/wmem/wmem.h> #include "packet-rtps.h" @@ -1687,7 +1688,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset */ /* Calc indent string */ - indent_string = (char *)ep_alloc((indent_level*2)+1); + indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1); memset(indent_string, ' ', indent_level*2); indent_string[indent_level*2] = '\0'; @@ -2179,10 +2180,10 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset /* Array print */ if (arr_dimension != NULL) { /* Printing an array */ - emem_strbuf_t *dim_str = ep_strbuf_new_label(NULL); + wmem_strbuf_t *dim_str = wmem_strbuf_new_label(wmem_packet_scope()); for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) { if (arr_dimension[i] != 0) { - ep_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]); + wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]); } else { break; } @@ -2190,7 +2191,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t * tvb, gint offset proto_tree_add_text(tree, tvb, offset_begin, (offset-offset_begin), "%s%s %s%s;%s", indent_string, type_name, name ? name : "", - dim_str->str, is_key ? KEY_COMMENT : ""); + wmem_strbuf_get_str(dim_str), is_key ? KEY_COMMENT : ""); return retVal; } @@ -2256,7 +2257,7 @@ static int rtps_util_add_bitmap(proto_tree *tree, const char *label _U_) { gint32 num_bits; guint32 data; - emem_strbuf_t *temp_buff = ep_strbuf_new_label(NULL); + wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope()); int i, j, idx; gchar *last_one; proto_item * ti; @@ -2283,27 +2284,27 @@ static int rtps_util_add_bitmap(proto_tree *tree, offset += 4; for (j = 0; j < 32; ++j) { datamask = (1 << (31-j)); - ep_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); + wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); ++idx; - if (idx >= num_bits || temp_buff->len >= ITEM_LABEL_LENGTH - 1) { + if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) { break; } } } /* removes all the ending '0' */ - last_one = strrchr(temp_buff->str, '1'); + last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1'); if (last_one) { - ep_strbuf_truncate(temp_buff, (gsize) (last_one - temp_buff->str)); + wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff))); } - if (temp_buff->len > 0) { + if (wmem_strbuf_get_len(temp_buff) > 0) { proto_tree_add_text(bitmap_tree, tvb, original_offset + 12, offset - original_offset - 12, "bitmap: %s", - temp_buff->str); + wmem_strbuf_get_str(temp_buff)); } proto_item_set_len(ti, offset-original_offset); @@ -2325,7 +2326,7 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf guint64 base; gint32 num_bits; guint32 data; - emem_strbuf_t *temp_buff = ep_strbuf_new_label(NULL); + wmem_strbuf_t *temp_buff = wmem_strbuf_new_label(wmem_packet_scope()); gchar *last_one; int i, j, idx; proto_item * ti; @@ -2373,18 +2374,18 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf offset += 4; for (j = 0; j < 32; ++j) { datamask = (1 << (31-j)); - ep_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); + wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0'); ++idx; - if (idx >= num_bits || temp_buff->len >= ITEM_LABEL_LENGTH - 1) { + if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) { break; } } } /* removes all the ending '0' */ - last_one = strrchr(temp_buff->str, '1'); + last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1'); if (last_one) { - ep_strbuf_truncate(temp_buff, (gsize) (last_one - temp_buff->str)); + wmem_strbuf_truncate(temp_buff, (gsize) (last_one - wmem_strbuf_get_str(temp_buff))); } bitmap_tree = proto_item_add_subtree(ti, ett_rtps_bitmap); @@ -2398,11 +2399,11 @@ static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinf } proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits); - if (temp_buff->len > 0) { + if (wmem_strbuf_get_len(temp_buff) > 0) { proto_tree_add_text(bitmap_tree, tvb, original_offset + base_size + 4, offset - original_offset - base_size - 4, - "bitmap: %s", temp_buff->str); + "bitmap: %s", wmem_strbuf_get_str(temp_buff)); } proto_item_set_len(ti, offset-original_offset); @@ -5733,8 +5734,8 @@ static void dissect_RTPS_DATA_BATCH(tvbuff_t *tvb, packet_info *pinfo, gint offs if (rtps_max_batch_samples_dissected == 0) { sample_info_max = 1024; /* Max size of sampleInfo shown */ } - sample_info_flags = (guint16 *)ep_alloc(sizeof(guint16) * sample_info_max); - sample_info_length = (guint32 *)ep_alloc(sizeof(guint32) * sample_info_max); + sample_info_flags = (guint16 *)wmem_alloc(wmem_packet_scope(), sizeof(guint16) * sample_info_max); + sample_info_length = (guint32 *)wmem_alloc(wmem_packet_scope(), sizeof(guint32) * sample_info_max); /* Sample Info List: start decoding the sample info list until the offset * is greater or equal than 'sampleListOffset' */ diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c index d9c3b458a1..5a8963e592 100644 --- a/epan/dissectors/packet-smb-sidsnooping.c +++ b/epan/dissectors/packet-smb-sidsnooping.c @@ -88,7 +88,7 @@ add_sid_name_mapping(char *sid, char *name) return; } - sn=se_new(sid_name); + sn=wmem_new(wmem_file_scope(), sid_name); sn->sid=g_strdup(sid); sn->name=g_strdup(name); g_hash_table_insert(sid_name_table, sn, sn); @@ -148,7 +148,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co g_hash_table_remove(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num)); } if(!old_ctx){ - old_ctx=se_memdup(fi->value.value.bytes->data, 20); + old_ctx=wmem_memdup(wmem_file_scope(), fi->value.value.bytes->data, 20); } g_hash_table_insert(ctx_handle_table, GINT_TO_POINTER(pinfo->fd->num), old_ctx); diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index aa91a17e46..5df8c8a026 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -35,7 +35,6 @@ #include <epan/packet.h> #include <epan/conversation.h> #include <epan/tap.h> -#include <epan/emem.h> #include <epan/wmem/wmem.h> #include <epan/aftypes.h> @@ -673,7 +672,7 @@ static void smb2_key_derivation(const guint8 *KI _U_, guint32 KI_len _U_, /* for export-object-smb2 */ static gchar *policy_hnd_to_file_id(const e_ctx_hnd *hnd) { gchar *file_id; - file_id = ep_strdup_printf( + file_id = wmem_strdup_printf(wmem_packet_scope(), "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", hnd->uuid.Data1, hnd->uuid.Data2, @@ -725,7 +724,7 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff /* Create a new tvb to point to the payload data */ data_tvb = tvb_new_subset(tvb, dataoffset, length, length); /* Create the eo_info to pass to the listener */ - eo_info = ep_new(smb_eo_t); + eo_info = wmem_new(wmem_packet_scope(), smb_eo_t); /* Fill in eo_info */ eo_info->smbversion=2; /* cmd == opcode */ @@ -741,17 +740,17 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff /* Remove "File: " from filename */ if (g_str_has_prefix(auxstring, "File: ")) { aux_string_v = g_strsplit(auxstring, "File: ", -1); - eo_info->filename = ep_strdup_printf("\\%s",aux_string_v[g_strv_length(aux_string_v)-1]); + eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\%s",aux_string_v[g_strv_length(aux_string_v)-1]); g_strfreev(aux_string_v); } else { if (g_str_has_prefix(auxstring, "\\")) { - eo_info->filename = ep_strdup(auxstring); + eo_info->filename = wmem_strdup(wmem_packet_scope(), auxstring); } else { - eo_info->filename = ep_strdup_printf("\\%s",auxstring); + eo_info->filename = wmem_strdup_printf(wmem_packet_scope(), "\\%s",auxstring); } } } else { - auxstring=ep_strdup_printf("File_Id_%s", file_id); + auxstring=wmem_strdup_printf(wmem_packet_scope(), "File_Id_%s", file_id); eo_info->filename=auxstring; } @@ -767,13 +766,13 @@ feed_eo_smb2(tvbuff_t * tvb,packet_info *pinfo,smb2_info_t * si, guint16 dataoff if (si->tree) { eo_info->tid=si->tree->tid; if (strlen(si->tree->name)>0 && strlen(si->tree->name)<=256) { - eo_info->hostname = ep_strdup(si->tree->name); + eo_info->hostname = wmem_strdup(wmem_packet_scope(), si->tree->name); } else { - eo_info->hostname = ep_strdup_printf("\\\\%s\\TREEID_%i",tree_ip_str(pinfo,si->opcode),si->tree->tid); + eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_%i",tree_ip_str(pinfo,si->opcode),si->tree->tid); } } else { eo_info->tid=0; - eo_info->hostname = ep_strdup_printf("\\\\%s\\TREEID_UNKNOWN",tree_ip_str(pinfo,si->opcode)); + eo_info->hostname = wmem_strdup_printf(wmem_packet_scope(), "\\\\%s\\TREEID_UNKNOWN",tree_ip_str(pinfo,si->opcode)); } /* packet number */ @@ -1384,9 +1383,9 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset offset = dissect_nt_guid_hnd(tvb, offset, pinfo, tree, drep, hf_smb2_fid, &policy_hnd, &hnd_item, TRUE, FALSE); if (!pinfo->fd->flags.visited) { if (si->saved && si->saved->extra_info_type == SMB2_EI_FILENAME) { - fid_name = se_strdup_printf("File: %s", (char *)si->saved->extra_info); + fid_name = wmem_strdup_printf(wmem_file_scope(), "File: %s", (char *)si->saved->extra_info); } else { - fid_name = se_strdup_printf("File: "); + fid_name = wmem_strdup_printf(wmem_file_scope(), "File: "); } dcerpc_store_polhnd_name(&policy_hnd, pinfo, fid_name); @@ -1397,8 +1396,8 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset if (si->conv) { eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&policy_hnd); if (!eo_file_info) { - eo_file_info = se_new(smb2_eo_file_info_t); - policy_hnd_hashtablekey = se_new(e_ctx_hnd); + eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t); + policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd); memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd)); eo_file_info->end_of_file=0; g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); @@ -1437,8 +1436,8 @@ dissect_smb2_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset if (eo_file_info) { si->eo_file_info=eo_file_info; } else { /* XXX This should never happen */ - eo_file_info = se_new(smb2_eo_file_info_t); - policy_hnd_hashtablekey = se_new(e_ctx_hnd); + eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t); + policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd); memcpy(policy_hnd_hashtablekey, &policy_hnd, sizeof(e_ctx_hnd)); eo_file_info->end_of_file=0; g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); @@ -2476,11 +2475,11 @@ dissect_smb2_session_setup_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree while ((ntlmssph = (const ntlmssp_header_t *)fetch_tapped_data(ntlmssp_tap_id, idx++)) != NULL) { if (ntlmssph && ntlmssph->type == NTLMSSP_AUTH) { smb2_sesid_info_t *sesid; - sesid = se_new(smb2_sesid_info_t); + sesid = wmem_new(wmem_file_scope(), smb2_sesid_info_t); sesid->sesid = si->sesid; - sesid->acct_name = se_strdup(ntlmssph->acct_name); - sesid->domain_name = se_strdup(ntlmssph->domain_name); - sesid->host_name = se_strdup(ntlmssph->host_name); + sesid->acct_name = wmem_strdup(wmem_file_scope(), ntlmssph->acct_name); + sesid->domain_name = wmem_strdup(wmem_file_scope(), ntlmssph->domain_name); + sesid->host_name = wmem_strdup(wmem_file_scope(), ntlmssph->host_name); if (memcmp(ntlmssph->session_key, zeros, NTLMSSP_KEY_LEN) != 0) { smb2_key_derivation(ntlmssph->session_key, NTLMSSP_KEY_LEN, @@ -2588,7 +2587,7 @@ dissect_smb2_tree_connect_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree */ if (!pinfo->fd->flags.visited && si->saved && buf && olb.len) { si->saved->extra_info_type = SMB2_EI_TREENAME; - si->saved->extra_info = se_alloc(olb.len+1); + si->saved->extra_info = wmem_alloc(wmem_file_scope(), olb.len+1); g_snprintf((char *)si->saved->extra_info,olb.len+1,"%s",buf); } @@ -2623,7 +2622,7 @@ dissect_smb2_tree_connect_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree if (tid) { g_hash_table_remove(si->session->tids, &tid_key); } - tid = se_new(smb2_tid_info_t); + tid = wmem_new(wmem_file_scope(), smb2_tid_info_t); tid->tid = si->tid; tid->name = (char *)si->saved->extra_info; tid->connect_frame = pinfo->fd->num; @@ -6723,7 +6722,7 @@ dissect_smb2_tid_sesid(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, * a tree connect, we create a dummy sessison, so we can hang the * tree data on it */ - si->session = se_new(smb2_sesid_info_t); + si->session = wmem_new(wmem_file_scope(), smb2_sesid_info_t); si->session->sesid = si->sesid; si->session->acct_name = NULL; si->session->domain_name = NULL; @@ -6795,8 +6794,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea smb2_eo_file_info_t *eo_file_info; e_ctx_hnd *policy_hnd_hashtablekey; - sti = ep_new(smb2_transform_info_t); - si = ep_new(smb2_info_t); + sti = wmem_new(wmem_packet_scope(), smb2_transform_info_t); + si = wmem_new(wmem_packet_scope(), smb2_info_t); si->eo_file_info = NULL; si->conv = NULL; si->saved = NULL; @@ -6971,7 +6970,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea /* no we couldnt find it, so just add it then * if was a request we are decoding */ - ssi = se_new0(smb2_saved_info_t); + ssi = wmem_new0(wmem_file_scope(), smb2_saved_info_t); ssi->msg_id = ssi_key.msg_id; ssi->frame_req = pinfo->fd->num; ssi->req_time = pinfo->fd->abs_ts; @@ -7006,8 +7005,8 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea eo_file_info = (smb2_eo_file_info_t *)g_hash_table_lookup(si->conv->files,&ssi->policy_hnd); if (!eo_file_info) { /* XXX This should never happen */ /* assert(1==0); */ - eo_file_info = se_new(smb2_eo_file_info_t); - policy_hnd_hashtablekey = se_new(e_ctx_hnd); + eo_file_info = wmem_new(wmem_file_scope(), smb2_eo_file_info_t); + policy_hnd_hashtablekey = wmem_new(wmem_file_scope(), e_ctx_hnd); memcpy(policy_hnd_hashtablekey, &ssi->policy_hnd, sizeof(e_ctx_hnd)); eo_file_info->end_of_file=0; g_hash_table_insert(si->conv->files,policy_hnd_hashtablekey,eo_file_info); diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c index b8867663dd..52f5ee23a8 100644 --- a/epan/dissectors/packet-snmp.c +++ b/epan/dissectors/packet-snmp.c @@ -71,6 +71,7 @@ #include <epan/prefs.h> #include <epan/sminmpec.h> #include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/next_tvb.h> #include <epan/uat.h> #include <epan/asn1.h> @@ -309,7 +310,7 @@ static int hf_snmp_priority = -1; /* INTEGER_M1_2147483647 */ static int hf_snmp_operation = -1; /* T_operation */ /*--- End of included file: packet-snmp-hf.c ---*/ -#line 235 "../../asn1/snmp/packet-snmp-template.c" +#line 236 "../../asn1/snmp/packet-snmp-template.c" static int hf_smux_version = -1; static int hf_smux_pdutype = -1; @@ -352,7 +353,7 @@ static gint ett_snmp_SimpleOpen_U = -1; static gint ett_snmp_RReqPDU_U = -1; /*--- End of included file: packet-snmp-ett.c ---*/ -#line 254 "../../asn1/snmp/packet-snmp-template.c" +#line 255 "../../asn1/snmp/packet-snmp-template.c" static expert_field ei_snmp_failed_decrypted_data_pdu = EI_INIT; static expert_field ei_snmp_decrypted_data_bad_formatted = EI_INIT; @@ -522,7 +523,8 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in hour_from_utc = tvb_get_guint8(tvb,offset+9); min_from_utc = tvb_get_guint8(tvb,offset+10); - str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u", + str = wmem_strdup_printf(wmem_packet_scope(), + "%u-%u-%u, %u:%u:%u.%u UTC %s%u:%u", year, month, day, @@ -534,7 +536,8 @@ dissect_snmp_variable_date_and_time(proto_tree *tree,int hfid, tvbuff_t *tvb, in hour_from_utc, min_from_utc); }else{ - str = ep_strdup_printf("%u-%u-%u, %u:%u:%u.%u", + str = wmem_strdup_printf(wmem_packet_scope(), + "%u-%u-%u, %u:%u:%u.%u", year, month, day, @@ -909,7 +912,7 @@ show_oid_index: goto indexing_done; } - buf = (guint8*)ep_alloc(buf_len+1); + buf = (guint8*)wmem_alloc(wmem_packet_scope(), buf_len+1); for (i = 0; i < buf_len; i++) buf[i] = (guint8)suboid[i]; buf[i] = '\0'; @@ -1138,21 +1141,21 @@ set_label: if (oid_info && oid_info->name) { if (oid_left >= 1) { - repr = ep_strdup_printf("%s.%s (%s)", oid_info->name, + repr = wmem_strdup_printf(wmem_packet_scope(), "%s.%s (%s)", oid_info->name, oid_subid2string(&(subids[oid_matched]),oid_left), oid_subid2string(subids,oid_matched+oid_left)); - info_oid = ep_strdup_printf("%s.%s", oid_info->name, + info_oid = wmem_strdup_printf(wmem_packet_scope(), "%s.%s", oid_info->name, oid_subid2string(&(subids[oid_matched]),oid_left)); } else { - repr = ep_strdup_printf("%s (%s)", oid_info->name, + repr = wmem_strdup_printf(wmem_packet_scope(), "%s (%s)", oid_info->name, oid_subid2string(subids,oid_matched)); info_oid = oid_info->name; } } else if (oid_string) { - repr = ep_strdup(oid_string); + repr = wmem_strdup(wmem_packet_scope(), oid_string); info_oid = oid_string; } else { - repr = ep_strdup("[Bad OID]"); + repr = wmem_strdup(wmem_packet_scope(), "[Bad OID]"); } valstr = strstr(label,": "); @@ -2980,7 +2983,7 @@ static void dissect_SMUX_PDUs_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro /*--- End of included file: packet-snmp-fn.c ---*/ -#line 1769 "../../asn1/snmp/packet-snmp-template.c" +#line 1772 "../../asn1/snmp/packet-snmp-template.c" guint @@ -3906,7 +3909,7 @@ void proto_register_snmp(void) { NULL, HFILL }}, /*--- End of included file: packet-snmp-hfarr.c ---*/ -#line 2430 "../../asn1/snmp/packet-snmp-template.c" +#line 2433 "../../asn1/snmp/packet-snmp-template.c" }; /* List of subtrees */ @@ -3946,7 +3949,7 @@ void proto_register_snmp(void) { &ett_snmp_RReqPDU_U, /*--- End of included file: packet-snmp-ettarr.c ---*/ -#line 2446 "../../asn1/snmp/packet-snmp-template.c" +#line 2449 "../../asn1/snmp/packet-snmp-template.c" }; static ei_register_info ei[] = { { &ei_snmp_failed_decrypted_data_pdu, { "snmp.failed_decrypted_data_pdu", PI_MALFORMED, PI_WARN, "Failed to decrypt encryptedPDU", EXPFILL }}, diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index b1ab50b26c..e4e2ec424c 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -2161,7 +2161,7 @@ dissect_ssl3_handshake(tvbuff_t *tvb, packet_info *pinfo, } /* convert hex string into char*/ - out = (unsigned char*) ep_alloc(size > 0 ? size / 2 : 0); + out = (unsigned char*) wmem_alloc(wmem_packet_scope(), size > 0 ? size / 2 : 0); for (i = 0; i < size; i+=2) { diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c index 9248cf285e..c355ef1ad9 100644 --- a/epan/dissectors/packet-tpncp.c +++ b/epan/dissectors/packet-tpncp.c @@ -295,7 +295,8 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_int(tpncp_tree, hf_tpncp_cid, tvb, 12, 4, cid); offset += 16; if (tpncp_events_info_db[id].tpncp_data_field_size) { - tpncp_header = ep_strdup_printf("TPNCP Event: %s (%d)", val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id); + tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Event: %s (%d)", + val_to_str_const(id, tpncp_events_id_vals, "Unknown"), id); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); dissect_tpncp_event(id, tvb, tpncp_item, &offset); } @@ -306,7 +307,8 @@ static void dissect_tpncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_uint(tpncp_tree, hf_tpncp_command_id, tvb, 8, 4, id); offset += 12; if (tpncp_commands_info_db[id].tpncp_data_field_size) { - tpncp_header = ep_strdup_printf("TPNCP Command: %s (%d)", val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id); + tpncp_header = wmem_strdup_printf(wmem_packet_scope(), "TPNCP Command: %s (%d)", + val_to_str_const(id, tpncp_commands_id_vals, "Unknown"), id); tpncp_item = proto_tree_add_text(tree, tvb, offset, -1, "%s", tpncp_header); dissect_tpncp_command(id, tvb, tpncp_item, &offset); } diff --git a/epan/dissectors/packet-ua3g.c b/epan/dissectors/packet-ua3g.c index f0629539d2..ad5d6a15b4 100644 --- a/epan/dissectors/packet-ua3g.c +++ b/epan/dissectors/packet-ua3g.c @@ -30,7 +30,7 @@ #include <glib.h> #include "epan/packet.h" -#include "epan/emem.h" +#include "epan/wmem/wmem.h" #include "packet-uaudp.h" @@ -1643,7 +1643,7 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, const gchar* command_str; proto_tree *ua3g_body_tree = tree, *ua3g_param_tree, *ua3g_option_tree; proto_item *ua3g_param_item, *ua3g_option_item; - emem_strbuf_t *strbuf; + wmem_strbuf_t *strbuf; command = tvb_get_guint8(tvb, offset) & 0x03; column_n = tvb_get_guint8(tvb, offset + 1); @@ -1655,13 +1655,13 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, if (!ua3g_body_tree) return; - strbuf = ep_strbuf_new_label("\""); + strbuf = wmem_strbuf_new_label(wmem_packet_scope()); - ep_strbuf_append_printf(strbuf, "%s\"", tvb_format_text(tvb, offset + 2, length - 2)); + wmem_strbuf_append_printf(strbuf, "\"%s\"", tvb_format_text(tvb, offset + 2, length - 2)); ua3g_param_item = proto_tree_add_text(ua3g_body_tree, tvb, offset, length, "%s %d: %s", - command_str, column_n, strbuf->str); + command_str, column_n, wmem_strbuf_get_str(strbuf)); ua3g_param_tree = proto_item_add_subtree(ua3g_param_item, ett_ua3g_param); proto_tree_add_item(ua3g_body_tree, hf_ua3g_command_lcd_line, tvb, offset, 1, ENC_NA); @@ -1685,7 +1685,7 @@ decode_lcd_line_cmd(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, offset++; length--; - proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", strbuf->str); + proto_tree_add_text(ua3g_param_tree, tvb, offset, length, "ASCII Char: %s", wmem_strbuf_get_str(strbuf)); } @@ -2134,20 +2134,20 @@ decode_beep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, case 0x04: /* Start Beep */ { guint8 beep_dest; - emem_strbuf_t *strbuf; + wmem_strbuf_t *strbuf; int i; beep_dest = tvb_get_guint8(tvb, offset); - strbuf = ep_strbuf_new_label(NULL); + strbuf = wmem_strbuf_new_label(wmem_packet_scope()); for (i = 0; i < 5; i++) { - ep_strbuf_append(strbuf, + wmem_strbuf_append(strbuf, val_to_str_const(beep_dest & (0x01 << i), str_start_beep_destination, "")); } proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, - "Destination: %s", strbuf->str); + "Destination: %s", wmem_strbuf_get_str(strbuf)); offset++; proto_tree_add_item(ua3g_body_tree, hf_ua3g_beep_beep_number, tvb, offset, 1, ENC_NA); @@ -2488,33 +2488,33 @@ decode_audio_config(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, " Bluetooth Link", " USB Link" }; - emem_strbuf_t *strbuf; + wmem_strbuf_t *strbuf; guint8 device_values; int j; int device_index = 0; - strbuf = ep_strbuf_new_label(NULL); + strbuf = wmem_strbuf_new_label(wmem_packet_scope()); while (length > 0) { device_values = tvb_get_guint8(tvb, offset); - ep_strbuf_truncate(strbuf, 0); + wmem_strbuf_truncate(strbuf, 0); if (device_values != 0) { for (j = 0; j < 5; j++) { if (device_values & (0x01 << j)) { - ep_strbuf_append(strbuf, str_device_values[j]); + wmem_strbuf_append(strbuf, str_device_values[j]); } } } else { - ep_strbuf_append(strbuf, " None"); + wmem_strbuf_append(strbuf, " None"); } proto_tree_add_text(ua3g_body_tree, tvb, offset, 1, "%s:%s", val_to_str_const(device_index, str_device_configuration, "Unknown"), - strbuf->str); + wmem_strbuf_get_str(strbuf)); offset++; length--; device_index++; @@ -3180,7 +3180,7 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, tvb, offset, 8, ENC_BIG_ENDIAN); - /* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ + /* XXX - add as expert info wmem_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ } break; case 0x10: /* VAD */ @@ -3194,7 +3194,7 @@ decode_cs_ip_device_routing(proto_tree *tree _U_, tvbuff_t *tvb, proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, parameter_length, ENC_BIG_ENDIAN); } else { proto_tree_add_item(ua3g_param_tree, hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, tvb, offset, 8, ENC_BIG_ENDIAN); - /* XXX - add as expert info ep_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ + /* XXX - add as expert info wmem_strbuf_append(strbuf, "Parameter Value Too Long (more than 64 bits)"); */ } break; case 0x1B: /* Delay Distribution */ diff --git a/epan/dissectors/packet-vxi11.c b/epan/dissectors/packet-vxi11.c index 0f9648a5e2..14ddf34938 100644 --- a/epan/dissectors/packet-vxi11.c +++ b/epan/dissectors/packet-vxi11.c @@ -29,7 +29,7 @@ #include "config.h" #include "packet-rpc.h" -#include <epan/emem.h> +#include <epan/wmem/wmem.h> /* * For the protocol specifications, see @@ -243,23 +243,23 @@ dissect_flags(tvbuff_t *tvb, int offset, proto_tree *tree) if (flags != 0) { - emem_strbuf_t *strbuf = ep_strbuf_new_label(NULL); + wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope()); if (flags & VXI11_CORE_FLAG_WAITLOCK) { - ep_strbuf_append(strbuf, "WAIT_LOCK, "); + wmem_strbuf_append(strbuf, "WAIT_LOCK, "); } if (flags & VXI11_CORE_FLAG_END) { - ep_strbuf_append(strbuf, "END, "); + wmem_strbuf_append(strbuf, "END, "); } if (flags & VXI11_CORE_FLAG_TERMCHRSET) { - ep_strbuf_append(strbuf, "TERM_CHR_SET, "); + wmem_strbuf_append(strbuf, "TERM_CHR_SET, "); } - ep_strbuf_truncate(strbuf, strbuf->len - 2); - proto_item_append_text(flags_item, " (%s)", strbuf->str); + wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2); + proto_item_append_text(flags_item, " (%s)", wmem_strbuf_get_str(strbuf)); } } } @@ -288,23 +288,23 @@ dissect_reason(tvbuff_t *tvb, int offset, proto_tree *tree) if (reason != 0) { - emem_strbuf_t *strbuf = ep_strbuf_new_label(NULL); + wmem_strbuf_t *strbuf = wmem_strbuf_new_label(wmem_packet_scope()); if (reason & VXI11_CORE_REASON_REQCNT) { - ep_strbuf_append(strbuf, "REQ_CNT, "); + wmem_strbuf_append(strbuf, "REQ_CNT, "); } if (reason & VXI11_CORE_REASON_CHR) { - ep_strbuf_append(strbuf, "CHR, "); + wmem_strbuf_append(strbuf, "CHR, "); } if (reason & VXI11_CORE_REASON_END) { - ep_strbuf_append(strbuf, "END, "); + wmem_strbuf_append(strbuf, "END, "); } - ep_strbuf_truncate(strbuf, strbuf->len - 2); - proto_item_append_text(reason_item, " (%s)", strbuf->str); + wmem_strbuf_truncate(strbuf, wmem_strbuf_get_len(strbuf) - 2); + proto_item_append_text(reason_item, " (%s)", wmem_strbuf_get_str(strbuf)); } } } diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c index dea1f1e402..e31418a458 100644 --- a/epan/dissectors/packet-zbee-aps.c +++ b/epan/dissectors/packet-zbee-aps.c @@ -32,7 +32,7 @@ #include <epan/packet.h> #include <epan/prefs.h> /* req'd for packet-zbee-security.h */ #include <epan/expert.h> -#include <epan/emem.h> +#include <epan/wmem/wmem.h> #include <epan/reassemble.h> #include "packet-zbee.h" @@ -1235,7 +1235,8 @@ dissect_zbee_aps_transport_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree key_record.frame_num = pinfo->fd->num; key_record.label = NULL; memcpy(&key_record.key, &key, ZBEE_APS_CMD_KEY_LENGTH); - *nwk_keyring = g_slist_prepend(*nwk_keyring, se_memdup(&key_record, sizeof(key_record_t))); + *nwk_keyring = g_slist_prepend(*nwk_keyring, wmem_memdup(wmem_file_scope(), + &key_record, sizeof(key_record_t))); } } } |