* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
- * By Deepti Ragha <dlragha@ncsu.edu>
+ * By Deepti Ragha <dlragha@ncsu.edu>
* Copyright 2012 Deepti Ragha
*
* This program is free software; you can redistribute it and/or
#include <epan/strutil.h>
#include <epan/arptypes.h>
#include <epan/addr_resolv.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include "packet-arp.h"
#include <epan/etypes.h>
#include <epan/arcnet_pids.h>
/*
* I'm assuming this means it's an ASCII (IA5) string.
*/
- cur = (gchar *)ep_alloc(MAX_E164_STR_LEN+3+1);
+ cur = (gchar *)wmem_alloc(wmem_packet_scope(), MAX_E164_STR_LEN+3+1);
if (ad_len > MAX_E164_STR_LEN) {
/* Can't show it all. */
memcpy(cur, ad, MAX_E164_STR_LEN);
else
{
/* Create result and store in result table */
- duplicate_result_key *persistent_key = se_new(duplicate_result_key);
+ duplicate_result_key *persistent_key = wmem_new(wmem_file_scope(), duplicate_result_key);
memcpy(persistent_key, &result_key, sizeof(duplicate_result_key));
- result = se_new(address_hash_value);
+ result = wmem_new(wmem_file_scope(), address_hash_value);
memcpy(result, value, sizeof(address_hash_value));
g_hash_table_insert(duplicate_result_hash_table, persistent_key, result);
else
{
/* No existing entry. Prepare one */
- value = se_new(struct address_hash_value);
+ value = wmem_new(wmem_file_scope(), struct address_hash_value);
memcpy(value->mac, mac, 6);
value->frame_num = pinfo->fd->num;
value->time_of_entry = pinfo->fd->abs_ts.secs;
#include <epan/packet.h>
#include <epan/conversation.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/prefs.h>
#include <wsutil/str_util.h>
*/
hash_info = (exec_hash_entry_t *)conversation_get_proto_data(conversation, proto_exec);
if(!hash_info){
- hash_info = se_new(exec_hash_entry_t);
+ hash_info = wmem_new(wmem_file_scope(), exec_hash_entry_t);
hash_info->first_packet_number = pinfo->fd->num;
hash_info->second_packet_number = 0;
* info column of the entire conversation
*/
if(!hash_info->username){
- hash_info->username=se_strdup((gchar*)field_stringz);
+ hash_info->username=wmem_strdup(wmem_file_scope(), (gchar*)field_stringz);
}
/* Next field we need */
* 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 {
#include <glib.h>
#include <epan/packet.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#include <epan/prefs.h>
#include <epan/asn1.h>
#include <epan/dissectors/packet-x509af.h>
mikey = (mikey_t *)p_get_proto_data(pinfo->fd, proto_mikey, 0);
if (!mikey) {
- mikey = se_new0(mikey_t);
+ mikey = wmem_new0(wmem_file_scope(), mikey_t);
mikey->type = -1;
p_add_proto_data(pinfo->fd, proto_mikey, 0, mikey);
}
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/etypes.h>
-#include <epan/emem.h>
#include <epan/wmem/wmem.h>
#include <epan/expert.h>
#include <epan/reassemble.h>
if ( global_scm_udid_autoset == TRUE )
{
- tempString = (char *)ep_alloc0(128 * sizeof(char));
+ tempString = (char *)wmem_alloc0(wmem_packet_scope(), 128 * sizeof(char));
g_snprintf ( tempString, 18, "%s", tvb_bytes_to_str_punct(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 6, ':' ) );
if ( memcmp ( global_scm_udid, tempString, 17 ) != 0 )
{
- local_scm_udid = (char *)se_alloc0(18 * sizeof(char));
+ local_scm_udid = (char *)wmem_alloc0(wmem_file_scope(), 18 * sizeof(char));
g_snprintf(local_scm_udid, 18, "%s", tempString );
expert_add_info_format(pinfo, item, &ei_scmudid_autodetected, "Auto detected payload as SCM UDID [%s].", tempString);
}
if ( global_scm_udid_autoset == TRUE )
{
- tempString = (char *)ep_alloc0(18 * sizeof(char));
+ tempString = (char *)wmem_alloc0(wmem_packet_scope(), 18 * sizeof(char));
g_snprintf ( tempString, 18, "%s", tvb_bytes_to_str_punct(message_tvb, OSS_FRAME_POS_DATA + frameStart1 + 1, 6, ':' ) );
if ( memcmp ( global_scm_udid, tempString, 17 ) != 0 )
{
- local_scm_udid = (char *)se_alloc0(18 * sizeof(char));
+ local_scm_udid = (char *)wmem_alloc0(wmem_file_scope(), 18 * sizeof(char));
g_snprintf(local_scm_udid, 18, "%s", tempString );
expert_add_info_format(pinfo, item, &ei_scmudid_autodetected, "Auto detected payload as SCM UDID [%s].", tempString);
}
#include <epan/conversation.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
+#include <epan/wmem/wmem.h>
#include "packet-ssl.h"
static int proto_pop = -1;
/*
* No conversation - create one and attach it.
*/
- data_val = se_new0(struct pop_data_val);
+ data_val = wmem_new0(wmem_file_scope(), struct pop_data_val);
conversation_add_proto_data(conversation, proto_pop, data_val);
}
data_val->msg_read_len += tvb_length(tvb);
- frame_data_p = se_new(struct pop_proto_data);
+ frame_data_p = wmem_new(wmem_file_scope(), struct pop_proto_data);
frame_data_p->conversation_id = conversation->index;
frame_data_p->more_frags = data_val->msg_read_len < data_val->msg_tot_len;
#include "packet-udp.h"
#include <epan/strutil.h>
+#include <epan/wmem/wmem.h>
+
#define TCP_PORT_SOCKS 1080
state_info = (sock_state_t *)p_get_proto_data(pinfo->fd, proto_socks, 0);
if (state_info == NULL) {
- state_info = se_new(sock_state_t);
+ state_info = wmem_new(wmem_file_scope(), sock_state_t);
state_info->in_socks_dissector_flag = 0;
state_info->client = clientNoInit;
state_info->server = serverNoInit;
hash_info = (socks_hash_entry_t *)conversation_get_proto_data(conversation,proto_socks);
if (hash_info == NULL){
- hash_info = se_new0(socks_hash_entry_t);
+ hash_info = wmem_new0(wmem_file_scope(), socks_hash_entry_t);
hash_info->start_done_frame = G_MAXINT;
hash_info->clientState = clientStart;
hash_info->serverState = serverStart;
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/expert.h>
-#include <epan/emem.h>
+#include <epan/wmem/wmem.h>
#define SPICE_MAGIC 0x52454451 /* = "REDQ" */
spice_info = (spice_conversation_t*)conversation_get_proto_data(conversation, proto_spice);
if (!spice_info) {
- spice_info = se_new0(spice_conversation_t);
+ spice_info = wmem_new0(wmem_file_scope(), spice_conversation_t);
spice_info->destport = pinfo->destport;
spice_info->channel_type = SPICE_CHANNEL_NONE;
spice_info->next_state = SPICE_LINK_CLIENT;
per_packet_info = (spice_packet_t *)p_get_proto_data(pinfo->fd, proto_spice, 0);
if (!per_packet_info) {
- per_packet_info = se_new(spice_packet_t);
+ per_packet_info = wmem_new(wmem_file_scope(), spice_packet_t);
per_packet_info->state = spice_info->next_state;
p_add_proto_data(pinfo->fd, proto_spice, 0, per_packet_info);
}
#include <epan/prefs.h>
#include <epan/conversation.h>
#include <epan/expert.h>
+#include <epan/wmem/wmem.h>
#include "packet-sprt.h"
*/
if (!p_conv_data) {
/* Create conversation data */
- p_conv_data = se_new(struct _sprt_conversation_info);
+ p_conv_data = wmem_new(wmem_file_scope(), struct _sprt_conversation_info);
p_conv_data->stream_started = FALSE;
p_conv_data->seqnum[0] = 0;
p_conv_data->seqnum[1] = 0;