]> git.meshlink.io Git - catta/blob - flx.h
8f8b0bac4c1ddcde36d486ea30862215d07dc90a
[catta] / flx.h
1 #ifndef fooflxhfoo
2 #define fooflxhfoo
3
4 #include <stdio.h>
5 #include <glib.h>
6
7 typedef struct _flxServer flxServer;
8
9 #include "address.h"
10 #include "rr.h"
11
12 flxServer *flx_server_new(GMainContext *c);
13 void flx_server_free(flxServer* s);
14
15 gint flx_server_get_next_id(flxServer *s);
16
17 void flx_server_add(
18     flxServer *s,
19     gint id,
20     gint interface,
21     guchar protocol,
22     gboolean unique,
23     flxRecord *r);
24
25 void flx_server_add_ptr(
26     flxServer *s,
27     gint id,
28     gint interface,
29     guchar protocol,
30     gboolean unique,
31     const gchar *name,
32     const gchar *dest);
33
34 void flx_server_add_address(
35     flxServer *s,
36     gint id,
37     gint interface,
38     guchar protocol,
39     gboolean unique,
40     const gchar *name,
41     flxAddress *a);
42
43 void flx_server_add_text(
44     flxServer *s,
45     gint id,
46     gint interface,
47     guchar protocol,
48     gboolean unique,
49     const gchar *name,
50     ... /* text records, terminated by NULL */);
51
52 void flx_server_add_text_va(
53     flxServer *s,
54     gint id,
55     gint interface,
56     guchar protocol,
57     gboolean unique,
58     const gchar *name,
59     va_list va);
60
61 void flx_server_add_service(
62     flxServer *s,
63     gint id,
64     gint interface,
65     guchar protocol,
66     const gchar *type,
67     const gchar *name,
68     const gchar *domain,
69     const gchar *host,
70     guint16 port,
71     ...  /* text records, terminated by NULL */);
72
73 void flx_server_add_service_va(
74     flxServer *s,
75     gint id,
76     gint interface,
77     guchar protocol,
78     const gchar *type,
79     const gchar *name,
80     const gchar *domain,
81     const gchar *host,
82     guint16 port,
83     va_list va);
84
85
86 void flx_server_remove(flxServer *s, gint id);
87
88 void flx_server_post_query(flxServer *s, gint interface, guchar protocol, flxKey *key);
89 void flx_server_post_response(flxServer *s, gint interface, guchar protocol, flxRecord *record);
90
91 const flxRecord *flx_server_iterate(flxServer *s, gint id, void **state);
92
93 void flx_server_dump(flxServer *s, FILE *f);
94
95 #endif