Implement address_to_str which is like ep_address_to_str and se_address_to_str
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Nov 2013 22:17:27 +0000 (22:17 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 23 Nov 2013 22:17:27 +0000 (22:17 +0000)
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI
as (weakly) deprecated.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@53528 f5534014-38df-0310-8fa8-9805f1628bb7

epan/address_to_str.c
epan/to_str.h
tools/checkAPIs.pl

index 5fefbcd80c6c6f314ccb3de2374cb17b53da1a79..b0da2f4e57c8deb24249818b8b3a5cb0270e7ea1 100644 (file)
@@ -62,6 +62,7 @@
 #include <epan/dissectors/packet-mtp3.h>
 #include <stdio.h>
 #include "emem.h"
+#include "wmem/wmem.h"
 
 /*
  * If a user _does_ pass in a too-small buffer, this is probably
@@ -505,6 +506,16 @@ get_ax25_name(const guint8 *ad)
    address types */
 /* convert an address struct into a printable string */
 
+gchar*
+address_to_str(wmem_allocator_t *scope, const address *addr)
+{
+    gchar *str;
+
+    str=(gchar *)wmem_alloc(scope, MAX_ADDR_STR_LEN);
+    address_to_str_buf(addr, str, MAX_ADDR_STR_LEN);
+    return str;
+}
+
 gchar*
 ep_address_to_str(const address *addr)
 {
index 7e41394337b8f9a4780dbd1d5bba4eb748af7e95..f195976ffc20cd10a213b3787cb1401249ac9c45 100644 (file)
@@ -31,6 +31,7 @@
 #include "time_fmt.h"
 #include <epan/packet_info.h>
 #include "ws_symbol_export.h"
+#include "wmem/wmem.h"
 
 #define GUID_STR_LEN 37
 #define MAX_IP_STR_LEN 16
@@ -50,7 +51,8 @@ extern "C" {
 
 struct     e_in6_addr;
 
-WS_DLL_PUBLIC gchar*   ep_address_to_str(const address *);
+WS_DLL_PUBLIC gchar* address_to_str(wmem_allocator_t *scope, const address *addr);
+WS_DLL_PUBLIC gchar* ep_address_to_str(const address *);
 extern gchar*  se_address_to_str(const address *);
 WS_DLL_PUBLIC void     address_to_str_buf(const address *addr, gchar *buf, int buf_len);
 WS_DLL_PUBLIC const gchar*     ether_to_str(const guint8 *);
index 7abea4b808a4b3a16acd3ed3d44bbdd6df4b631f..65a95b5015ec85e73795b46790a9439c5767a7e7 100755 (executable)
@@ -128,7 +128,7 @@ my %APIs = (
 
         ### Deprecated emem functions (use wmem instead!)
         # These will become errors once they've been removed from all the
-        # existing dissectors
+        # existing code
         'emem' => { 'count_errors' => 0, 'functions' => [
                 'ep_alloc',
                 'ep_new',
@@ -147,6 +147,7 @@ my %APIs = (
                 'ep_stack_push',
                 'ep_stack_pop',
                 'ep_stack_peek',
+                'ep_address_to_str',
                 'se_alloc',
                 'se_new',
                 'se_alloc0',
@@ -157,6 +158,7 @@ my %APIs = (
                 'se_strdup_vprintf',
                 'se_strdup_printf',
                 'se_alloc_array',
+                'se_address_to_str',
                 'se_tree_create',
                 'se_tree_insert32',
                 'se_tree_lookup32',