Initial commit
[cascardo/gnio.git] / gnio / ginet4address.c
1 /* GNIO - GLib Network Layer of GIO
2  * 
3  * Copyright (C) 2008 Christian Kellner 
4  *
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.
9  *
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.
14  *
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.
19  *
20  * Author: Christian Kellner <gicmo@gnome.org>
21  */
22
23 #include <config.h>
24 #include <glib.h>
25
26 #include "ginet4address.h"
27
28
29 G_DEFINE_TYPE (GInet4Address, g_inet4_address, G_TYPE_INET_ADDRESS);
30
31 struct _GInet4AddressPrivate {
32
33     union {
34         guint32 u4_addr8[4];
35         guint8  u4_addr32;
36     } addr;
37 };
38
39
40 static void
41 g_inet4_address_finalize (GObject *object)
42 {
43   GInet4Address *address;
44
45   address = G_INET4_ADDRESS (object);
46   
47   if (G_OBJECT_CLASS (g_inet4_address_parent_class)->finalize)
48     (*G_OBJECT_CLASS (g_inet4_address_parent_class)->finalize) (object);
49 }
50
51 static void
52 g_inet4_address_dispose (GObject *object)
53 {
54   GInet4Address *address;
55
56   address = G_INET4_ADDRESS (object);
57   
58   if (G_OBJECT_CLASS (g_inet4_address_parent_class)->dispose)
59     (*G_OBJECT_CLASS (g_inet4_address_parent_class)->dispose) (object);
60 }
61
62
63 static void
64 g_inet4_address_class_init (GInet4AddressClass *klass)
65 {
66   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
67   
68   g_type_class_add_private (klass, sizeof (GInet4AddressPrivate));
69   
70   gobject_class->finalize = g_inet4_address_finalize;
71   gobject_class->dispose = g_inet4_address_dispose;
72
73 }
74
75 static void
76 g_inet4_address_init (GInet4Address *address)
77 {
78   address->priv = G_TYPE_INSTANCE_GET_PRIVATE (address,
79                                                G_TYPE_INET4_ADDRESS,
80                                                GInet4AddressPrivate);
81 }
82
83 /* ************************************************************************* */
84 /* Public Functions */
85
86 GInet4Address *
87 g_inet4_address_from_string (const char *string)
88 {
89     return NULL;
90 }
91
92 char *
93 g_inet4_address_to_string (GInet4Address *address)
94 {
95   return NULL;
96 }
97
98 GInet4Address *
99 g_inet4_address_from_bytes (guint8 bytes[])
100 {
101   return NULL;
102 }
103
104 const guint8 *
105 g_inet4_address_to_bytes (GInet4Address *address)
106 {
107   return NULL;
108 }
109
110 GInetAddress  *
111 g_inet4address_new_loopback (void)
112 {
113   return NULL;
114 }
115
116 GInetAddress  *
117 g_inet4address_new_any (void)
118 {
119   return NULL; 
120 }
121