1 /* GNIO - GLib Network Layer of GIO
3 * Copyright (C) 2008 Christian Kellner
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Author: Christian Kellner <gicmo@gnome.org>
26 #include "ginet4address.h"
29 G_DEFINE_TYPE (GInet4Address, g_inet4_address, G_TYPE_INET_ADDRESS);
31 struct _GInet4AddressPrivate {
41 g_inet4_address_finalize (GObject *object)
43 GInet4Address *address;
45 address = G_INET4_ADDRESS (object);
47 if (G_OBJECT_CLASS (g_inet4_address_parent_class)->finalize)
48 (*G_OBJECT_CLASS (g_inet4_address_parent_class)->finalize) (object);
52 g_inet4_address_dispose (GObject *object)
54 GInet4Address *address;
56 address = G_INET4_ADDRESS (object);
58 if (G_OBJECT_CLASS (g_inet4_address_parent_class)->dispose)
59 (*G_OBJECT_CLASS (g_inet4_address_parent_class)->dispose) (object);
64 g_inet4_address_class_init (GInet4AddressClass *klass)
66 GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
68 g_type_class_add_private (klass, sizeof (GInet4AddressPrivate));
70 gobject_class->finalize = g_inet4_address_finalize;
71 gobject_class->dispose = g_inet4_address_dispose;
76 g_inet4_address_init (GInet4Address *address)
78 address->priv = G_TYPE_INSTANCE_GET_PRIVATE (address,
80 GInet4AddressPrivate);
83 /* ************************************************************************* */
84 /* Public Functions */
87 g_inet4_address_from_string (const char *string)
93 g_inet4_address_to_string (GInet4Address *address)
99 g_inet4_address_from_bytes (guint8 bytes[])
105 g_inet4_address_to_bytes (GInet4Address *address)
111 g_inet4address_new_loopback (void)
117 g_inet4address_new_any (void)