}
static void
-g_inet_socket_address_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+g_inet_socket_address_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GInetSocketAddress *address = G_INET_SOCKET_ADDRESS (object);
}
static void
-g_inet_socket_address_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
+g_inet_socket_address_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GInetSocketAddress *address = G_INET_SOCKET_ADDRESS (object);
}
static gboolean
-g_inet_socket_address_to_native (GSocketAddress *address, gpointer dest)
+g_inet_socket_address_to_native (GSocketAddress *address,
+ gpointer dest)
{
GInetSocketAddress *addr;
}
else if (G_IS_INET6_ADDRESS (addr->priv->address))
{
- return FALSE;
+ struct sockaddr_in6 *sock = (struct sockaddr_in6 *) dest;
+ memset (sock, 0, sizeof (sock));
+ sock->sin6_family = AF_INET6;
+ sock->sin6_port = g_htons (addr->priv->port);
+ memcpy (&(sock->sin6_addr.s6_addr), g_inet6_address_to_bytes (G_INET6_ADDRESS (addr->priv->address)), sizeof (sock->sin6_addr));
+ return TRUE;
}
else
return FALSE;
GInetSocketAddress *
-g_inet_socket_address_new (GInetAddress *address, guint16 port)
+g_inet_socket_address_new (GInetAddress *address,
+ guint16 port)
{
return G_INET_SOCKET_ADDRESS (g_object_new (G_TYPE_INET_SOCKET_ADDRESS, "address", address, "port", port, NULL));
}