summaryrefslogtreecommitdiff
path: root/address
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-05-01 22:48:10 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.co.uk>2008-05-01 22:48:10 -0400
commit0f063ce191a30979fa472ad6b686a7f86a25e5c5 (patch)
treed77b17d25125b28f9fe86756e4e7d191a9a60cad /address
parente9444e9b220c7cc4c12b36b090e521b059f0e215 (diff)
downloadlibnice-0f063ce191a30979fa472ad6b686a7f86a25e5c5.tar.gz
Add nice_address_is_valid function
Diffstat (limited to 'address')
-rw-r--r--address/address.c13
-rw-r--r--address/address.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/address/address.c b/address/address.c
index 0a00b49..1301792 100644
--- a/address/address.c
+++ b/address/address.c
@@ -299,3 +299,16 @@ nice_address_is_private (const NiceAddress *a)
g_assert_not_reached ();
}
+
+NICEAPI_EXPORT gboolean
+nice_address_is_valid (const NiceAddress *a)
+{
+ switch (a->s.addr.sa_family)
+ {
+ case AF_INET:
+ case AF_INET6:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
diff --git a/address/address.h b/address/address.h
index 10fd721..50cfceb 100644
--- a/address/address.h
+++ b/address/address.h
@@ -107,6 +107,10 @@ nice_address_to_string (const NiceAddress *addr, gchar *dst);
gboolean
nice_address_is_private (const NiceAddress *a);
+G_GNUC_WARN_UNUSED_RESULT
+gboolean
+nice_address_is_valid (const NiceAddress *a);
+
G_END_DECLS
#endif /* _ADDRESS_H */