Commit 0f063ce1 authored by Olivier Crête's avatar Olivier Crête
Browse files

Add nice_address_is_valid function

parent e9444e9b
......@@ -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;
}
}
......@@ -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 */
......
......@@ -4,6 +4,7 @@ nice_address_equal
nice_address_free
nice_address_get_port
nice_address_is_private
nice_address_is_valid
nice_address_new
nice_address_set_from_sockaddr
nice_address_set_from_string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment