More wmem.
authorEvan Huus <eapache@gmail.com>
Thu, 12 Sep 2013 12:37:27 +0000 (12:37 -0000)
committerEvan Huus <eapache@gmail.com>
Thu, 12 Sep 2013 12:37:27 +0000 (12:37 -0000)
svn path=/trunk/; revision=51968

epan/dissectors/packet-arp.c
epan/dissectors/packet-exec.c
epan/dissectors/packet-mikey.c
epan/dissectors/packet-opensafety.c
epan/dissectors/packet-pop.c
epan/dissectors/packet-socks.c
epan/dissectors/packet-spice.c
epan/dissectors/packet-sprt.c

index ea36ae81e5b06889c459a157ec14f4d00c1a2b56..7f0083eea50c250ae10346e60743dc90e2bf7b45 100644 (file)
@@ -7,7 +7,7 @@
  * 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
@@ -33,7 +33,7 @@
 #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>
@@ -403,7 +403,7 @@ atmarpnum_to_str(const guint8 *ad, int ad_tl)
     /*
      * 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);
@@ -666,10 +666,10 @@ check_for_duplicate_addresses(packet_info *pinfo, proto_tree *tree,
           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);
@@ -679,7 +679,7 @@ check_for_duplicate_addresses(packet_info *pinfo, proto_tree *tree,
       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;
index 859ec85fdb525047704323a5cb2f72053a7d60f9..3c5e18c81437b1faa01e6d1c1abf06e5fd905a92 100644 (file)
@@ -31,7 +31,7 @@
 
 #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>
 
@@ -119,7 +119,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
         */
        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;
@@ -260,7 +260,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
                         * 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 */
@@ -311,7 +311,7 @@ dissect_exec(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 {
index f62327da1f085b13ee4d5fb839da484b1ae3d5d2..ea611ae1a8895e05d3a7e222aeef810ec1c070b2 100644 (file)
@@ -42,7 +42,7 @@
 #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>
@@ -1356,7 +1356,7 @@ dissect_mikey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
        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);
        }
index c05692ab45e27a0de3d649dece9a2cb77f8928c2..4cee573cc7e39945edded139d464fa9db55a025f 100644 (file)
@@ -44,7 +44,6 @@
 #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>
@@ -1502,11 +1501,11 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
 
             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);
                 }
@@ -1533,11 +1532,11 @@ dissect_opensafety_snmt_message(tvbuff_t *message_tvb, packet_info *pinfo , prot
 
             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);
                 }
index 249cc28237c3fb14d56055a1d37f1b0c099a814a..f0b74a4033c02228b882e669de62a03e560373cc 100644 (file)
@@ -37,6 +37,7 @@
 #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;
@@ -151,7 +152,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
      /*
       * 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);
   }
@@ -220,7 +221,7 @@ dissect_pop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
         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;
index dbc37c0b4b0c2b7ed492245313d75d730affdcf9..5ff360e09a885acdd77c456422dfb0c24211b71a 100644 (file)
@@ -70,6 +70,8 @@
 #include "packet-udp.h"
 #include <epan/strutil.h>
 
+#include <epan/wmem/wmem.h>
+
 #define TCP_PORT_SOCKS 1080
 
 
@@ -993,7 +995,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
 
        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;
@@ -1020,7 +1022,7 @@ dissect_socks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
 
        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;
index 0518d858c677deb6b807089877f809bb6449d186..3968f75cac5f3cc7448f430d57ac2e2ea82fb3ba 100644 (file)
@@ -34,7 +34,7 @@
 #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" */
 
@@ -3115,7 +3115,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
 
     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;
@@ -3130,7 +3130,7 @@ dissect_spice(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
 
     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);
     }
index 1a8502ceb3441fad5c668483c2e1efb7a2818a23..8f0083dd55f265f7cdcdc883f54f3b1fffeacc0c 100644 (file)
@@ -41,6 +41,7 @@
 #include <epan/prefs.h>
 #include <epan/conversation.h>
 #include <epan/expert.h>
+#include <epan/wmem/wmem.h>
 
 #include "packet-sprt.h"
 
@@ -816,7 +817,7 @@ void sprt_add_address(packet_info *pinfo,
      */
     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;