g_inet_address_new_any
g_inet_address_new_loopback
g_inet_address_to_bytes
+g_inet_address_get_native_size
g_inet_address_to_string
g_inet_address_get_family
g_inet_address_get_is_any
* Gets the raw binary address data from @address.
*
* Returns: a pointer to an internal array of the bytes in @address,
- * which should not be modified, stored, or freed.
+ * which should not be modified, stored, or freed. The size of this
+ * array can be gotten with g_inet_address_get_native_size().
*
* Since: 2.22
*/
}
/**
+ * g_inet_address_get_native_size:
+ * @address: a #GInetAddress
+ *
+ * Gets the size of the native raw binary address for @address. This
+ * is the size of the data that you get from g_inet_address_to_bytes().
+ *
+ * Returns: the number of bytes used for the native version of @address.
+ *
+ * Since: 2.22
+ */
+gsize
+g_inet_address_get_native_size (GInetAddress *address)
+{
+ if (address->priv->family == AF_INET)
+ return sizeof (address->priv->addr.ipv4);
+ return sizeof (address->priv->addr.ipv6);
+}
+
+/**
* g_inet_address_get_family:
* @address: a #GInetAddress
*
const guint8 * g_inet_address_to_bytes (GInetAddress *address);
+gsize g_inet_address_get_native_size (GInetAddress *address);
+
GSocketFamily g_inet_address_get_family (GInetAddress *address);
gboolean g_inet_address_get_is_any (GInetAddress *address);
g_inet_address_get_is_multicast
g_inet_address_get_is_site_local
g_inet_address_to_bytes
+g_inet_address_get_native_size
g_inet_address_to_string
#endif
#endif