summaryrefslogtreecommitdiff
path: root/agent/address.h
diff options
context:
space:
mode:
authorDafydd Harries <dafydd.harries@collabora.co.uk>2007-01-23 11:22:00 +0000
committerDafydd Harries <dafydd.harries@collabora.co.uk>2007-01-23 11:22:00 +0000
commit1117bc64b9a99e84026762e22ee3412f4d2a0d55 (patch)
tree98cd9537ba8a5a133deb35a8771b532b90f4097e /agent/address.h
parent00d15dcb033a264be1f988818e61fb2be6fcae48 (diff)
downloadlibnice-1117bc64b9a99e84026762e22ee3412f4d2a0d55.tar.gz
split address code into separate file
darcs-hash:20070123112239-c9803-4ee436dea71845eb5e857dab3d98a2180149e304.gz
Diffstat (limited to 'agent/address.h')
-rw-r--r--agent/address.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/agent/address.h b/agent/address.h
new file mode 100644
index 0000000..07c3eee
--- /dev/null
+++ b/agent/address.h
@@ -0,0 +1,42 @@
+
+#ifndef _ADDRESS_H
+#define _ADDRESS_H
+
+typedef enum address_type AddressType;
+
+enum address_type
+{
+ ADDRESS_TYPE_IPV4,
+ ADDRESS_TYPE_IPV6,
+};
+
+typedef struct _address Address;
+
+/* XXX: need access to fields to convert to sockaddr_in */
+struct _address
+{
+ AddressType type;
+ union
+ {
+ guint32 addr_ipv4;
+ guchar addr_ipv6[16];
+ };
+};
+
+Address *
+address_new (void);
+void
+address_free (Address *addr);
+Address *
+address_dup (Address *a);
+void
+address_set_ipv4 (Address *addr, guint32 addr_ipv4);
+gboolean
+address_set_ipv4_from_string (Address *addr, gchar *str);
+gboolean
+address_equal (Address *a, Address *b);
+gchar *
+address_to_string (Address *addr);
+
+#endif /* _ADDRESS_H */
+