aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-11-23 22:17:27 +0000
committerEvan Huus <eapache@gmail.com>2013-11-23 22:17:27 +0000
commitd97c9e2ff4b28835e3485e643a93ef53f778370f (patch)
tree765d426cd6fc5cb4e622c7446c24267147f2f647 /epan
parentdf1aec4a6b01f9d600288b518fece5f035c27f9f (diff)
Implement address_to_str which is like ep_address_to_str and se_address_to_str
except it takes a wmem scope instead. Add the two emem equivalents to checkAPI as (weakly) deprecated. svn path=/trunk/; revision=53528
Diffstat (limited to 'epan')
-rw-r--r--epan/address_to_str.c11
-rw-r--r--epan/to_str.h4
2 files changed, 14 insertions, 1 deletions
diff --git a/epan/address_to_str.c b/epan/address_to_str.c
index 5fefbcd80c..b0da2f4e57 100644
--- a/epan/address_to_str.c
+++ b/epan/address_to_str.c
@@ -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
@@ -506,6 +507,16 @@ get_ax25_name(const guint8 *ad)
/* 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)
{
gchar *str;
diff --git a/epan/to_str.h b/epan/to_str.h
index 7e41394337..f195976ffc 100644
--- a/epan/to_str.h
+++ b/epan/to_str.h
@@ -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 *);