summaryrefslogtreecommitdiffstats
path: root/rr.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-04-12 03:09:56 +0000
committerLennart Poettering <lennart@poettering.net>2005-04-12 03:09:56 +0000
commita20c01bd12216d409e0dfc5d3bbacc940352bfce (patch)
treee91508f26882306be164889a6bacc3be3517814d /rr.h
parentb1d2a6b958d8d7a8ecf79765bb93aa57583d93bd (diff)
assorted work:
* new rr implementation: resource data is stored in parsed form now. * make TXT and SRV functions variadic * many other things git-svn-id: file:///home/lennart/svn/public/avahi/trunk@23 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'rr.h')
-rw-r--r--rr.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/rr.h b/rr.h
index 65abb1d..1ba6d95 100644
--- a/rr.h
+++ b/rr.h
@@ -3,6 +3,9 @@
#include <glib.h>
+#include "strlst.h"
+#include "address.h"
+
enum {
FLX_DNS_TYPE_A = 0x01,
FLX_DNS_TYPE_NS = 0x02,
@@ -34,9 +37,44 @@ typedef struct {
guint ref;
flxKey *key;
- gpointer data;
- guint16 size;
guint32 ttl;
+
+ union {
+ struct {
+ gpointer data;
+ guint16 size;
+ } generic;
+
+ struct {
+ guint16 priority;
+ guint16 weight;
+ guint16 port;
+ gchar *name;
+ } srv;
+
+ struct {
+ gchar *name;
+ } ptr; /* and cname */
+
+ struct {
+ gchar *cpu;
+ gchar *os;
+ } hinfo;
+
+ struct {
+ flxStringList *string_list;
+ } txt;
+
+ struct {
+ flxIPv4Address address;
+ } a;
+
+ struct {
+ flxIPv6Address address;
+ } aaaa;
+
+ } data;
+
} flxRecord;
flxKey *flx_key_new(const gchar *name, guint16 class, guint16 type);
@@ -50,17 +88,19 @@ gboolean flx_key_is_pattern(const flxKey *k);
guint flx_key_hash(const flxKey *k);
-flxRecord *flx_record_new(flxKey *k, gconstpointer data, guint16 size, guint32 ttl);
-flxRecord *flx_record_new_full(const gchar *name, guint16 class, guint16 type, gconstpointer data, guint16 size, guint32 ttl);
+flxRecord *flx_record_new(flxKey *k);
+flxRecord *flx_record_new_full(const gchar *name, guint16 class, guint16 type);
flxRecord *flx_record_ref(flxRecord *r);
void flx_record_unref(flxRecord *r);
const gchar *flx_dns_class_to_string(guint16 class);
const gchar *flx_dns_type_to_string(guint16 type);
-gchar *flx_key_to_string(flxKey *k); /* g_free() the result! */
-gchar *flx_record_to_string(flxRecord *r); /* g_free() the result! */
+gchar *flx_key_to_string(const flxKey *k); /* g_free() the result! */
+gchar *flx_record_to_string(const flxRecord *r); /* g_free() the result! */
gboolean flx_record_equal_no_ttl(const flxRecord *a, const flxRecord *b);
+flxRecord *flx_record_copy(flxRecord *r);
+
#endif