]> git.meshlink.io Git - catta/blobdiff - flx.h
* improve dns.c testing program
[catta] / flx.h
diff --git a/flx.h b/flx.h
index ea616472f4e7a3d29f9b1deae184a8b76deb2eb9..d60dede029c39b6c4d67ade7f8ebe22520ce8265 100644 (file)
--- a/flx.h
+++ b/flx.h
@@ -4,12 +4,18 @@
 #include <stdio.h>
 #include <glib.h>
 
-struct _flxServer;
 typedef struct _flxServer flxServer;
 
 #include "address.h"
 #include "rr.h"
 
+typedef enum {
+    FLX_SERVER_ENTRY_NULL = 0,
+    FLX_SERVER_ENTRY_UNIQUE = 1,
+    FLX_SERVER_ENTRY_NOPROBE = 2,
+    FLX_SERVER_ENTRY_NOANNOUNCE = 4
+} flxServerEntryFlags;
+
 flxServer *flx_server_new(GMainContext *c);
 void flx_server_free(flxServer* s);
 
@@ -20,28 +26,24 @@ void flx_server_add(
     gint id,
     gint interface,
     guchar protocol,
-    gboolean unique,
+    flxServerEntryFlags flags,
     flxRecord *r);
 
-void flx_server_add_full(
+void flx_server_add_ptr(
     flxServer *s,
     gint id,
     gint interface,
     guchar protocol,
-    gboolean unique,
+    flxServerEntryFlags flags,
     const gchar *name,
-    guint16 class,
-    guint16 type,
-    gconstpointer data,
-    guint size,
-    guint32 ttl);
+    const gchar *dest);
 
 void flx_server_add_address(
     flxServer *s,
     gint id,
     gint interface,
     guchar protocol,
-    gboolean unique,
+    flxServerEntryFlags flags,
     const gchar *name,
     flxAddress *a);
 
@@ -50,13 +52,48 @@ void flx_server_add_text(
     gint id,
     gint interface,
     guchar protocol,
-    gboolean unique,
+    flxServerEntryFlags flags,
+    const gchar *name,
+    ... /* text records, terminated by NULL */);
+
+void flx_server_add_text_va(
+    flxServer *s,
+    gint id,
+    gint interface,
+    guchar protocol,
+    flxServerEntryFlags flags,
+    const gchar *name,
+    va_list va);
+
+void flx_server_add_service(
+    flxServer *s,
+    gint id,
+    gint interface,
+    guchar protocol,
+    const gchar *type,
+    const gchar *name,
+    const gchar *domain,
+    const gchar *host,
+    guint16 port,
+    ...  /* text records, terminated by NULL */);
+
+void flx_server_add_service_va(
+    flxServer *s,
+    gint id,
+    gint interface,
+    guchar protocol,
+    const gchar *type,
     const gchar *name,
-    const gchar *text);
+    const gchar *domain,
+    const gchar *host,
+    guint16 port,
+    va_list va);
+
 
 void flx_server_remove(flxServer *s, gint id);
 
-void flx_server_post_query(flxServer *s, gint interface, guchar protocol, flxKey *k);
+void flx_server_post_query(flxServer *s, gint interface, guchar protocol, flxKey *key);
+void flx_server_post_response(flxServer *s, gint interface, guchar protocol, flxRecord *record, gboolean flush_cache);
 
 const flxRecord *flx_server_iterate(flxServer *s, gint id, void **state);