]> git.meshlink.io Git - catta/blob - flx.h
add support for dots and backslashes in domain names (required for DNS-SD)
[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 typedef enum {
13     FLX_SERVER_ENTRY_NULL = 0,
14     FLX_SERVER_ENTRY_UNIQUE = 1,
15     FLX_SERVER_ENTRY_NOPROBE = 2,
16     FLX_SERVER_ENTRY_NOANNOUNCE = 4
17 } flxServerEntryFlags;
18
19 flxServer *flx_server_new(GMainContext *c);
20 void flx_server_free(flxServer* s);
21
22 gint flx_server_get_next_id(flxServer *s);
23
24 void flx_server_add(
25     flxServer *s,
26     gint id,
27     gint interface,
28     guchar protocol,
29     flxServerEntryFlags flags,
30     flxRecord *r);
31
32 void flx_server_add_ptr(
33     flxServer *s,
34     gint id,
35     gint interface,
36     guchar protocol,
37     flxServerEntryFlags flags,
38     const gchar *name,
39     const gchar *dest);
40
41 void flx_server_add_address(
42     flxServer *s,
43     gint id,
44     gint interface,
45     guchar protocol,
46     flxServerEntryFlags flags,
47     const gchar *name,
48     flxAddress *a);
49
50 void flx_server_add_text(
51     flxServer *s,
52     gint id,
53     gint interface,
54     guchar protocol,
55     flxServerEntryFlags flags,
56     const gchar *name,
57     ... /* text records, terminated by NULL */);
58
59 void flx_server_add_text_va(
60     flxServer *s,
61     gint id,
62     gint interface,
63     guchar protocol,
64     flxServerEntryFlags flags,
65     const gchar *name,
66     va_list va);
67
68 void flx_server_add_service(
69     flxServer *s,
70     gint id,
71     gint interface,
72     guchar protocol,
73     const gchar *type,
74     const gchar *name,
75     const gchar *domain,
76     const gchar *host,
77     guint16 port,
78     ...  /* text records, terminated by NULL */);
79
80 void flx_server_add_service_va(
81     flxServer *s,
82     gint id,
83     gint interface,
84     guchar protocol,
85     const gchar *type,
86     const gchar *name,
87     const gchar *domain,
88     const gchar *host,
89     guint16 port,
90     va_list va);
91
92
93 void flx_server_remove(flxServer *s, gint id);
94
95 void flx_server_post_query(flxServer *s, gint interface, guchar protocol, flxKey *key);
96 void flx_server_post_response(flxServer *s, gint interface, guchar protocol, flxRecord *record, gboolean flush_cache);
97
98 const flxRecord *flx_server_iterate(flxServer *s, gint id, void **state);
99
100 void flx_server_dump(flxServer *s, FILE *f);
101
102 #endif