summaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
Diffstat (limited to 'agent')
-rw-r--r--agent/address.c10
-rw-r--r--agent/address.h15
2 files changed, 24 insertions, 1 deletions
diff --git a/agent/address.c b/agent/address.c
index e1cc442..81795ae 100644
--- a/agent/address.c
+++ b/agent/address.c
@@ -261,6 +261,16 @@ nice_address_to_string (const NiceAddress *addr, gchar *dst)
}
}
+NICEAPI_EXPORT gchar *
+nice_address_dup_string (const NiceAddress *addr)
+{
+ char dst[MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN)] = "";
+
+ nice_address_to_string (addr, dst);
+
+ return g_strdup (dst);
+}
+
NICEAPI_EXPORT gboolean
nice_address_equal (const NiceAddress *a, const NiceAddress *b)
diff --git a/agent/address.h b/agent/address.h
index b0f5a52..f47b9aa 100644
--- a/agent/address.h
+++ b/agent/address.h
@@ -260,7 +260,7 @@ gboolean
nice_address_equal_no_port (const NiceAddress *a, const NiceAddress *b);
/**
- * nice_address_to_string:
+ * nice_address_to_string: (skip)
* @addr: The #NiceAddress to query
* @dst: The string to fill
*
@@ -271,6 +271,19 @@ void
nice_address_to_string (const NiceAddress *addr, gchar *dst);
/**
+ * nice_address_dup_string:
+ * @addr: The #NiceAddress to query
+ *
+ * Transforms the address @addr into a newly allocated human readable string
+ *
+ * Returns: (transfer full): the address string
+ *
+ * Since: 0.1.20
+ */
+gchar *
+nice_address_dup_string (const NiceAddress *addr);
+
+/**
* nice_address_is_private:
* @addr: The #NiceAddress to query
*