1 #include <sys/socket.h>
2 #include <netinet/in.h>
8 static GMainLoop *loop = NULL;
10 static gboolean timeout(gpointer data) {
11 g_main_loop_quit(loop);
15 int main(int argc, char *argv[]) {
17 flxLocalAddrSource *l;
22 flx = flx_server_new(NULL);
24 l = flx_local_addr_source_new(flx);
26 flx_address_parse("127.0.0.1", AF_INET, &a);
27 flx_server_add_address(flx, 0, 0, AF_UNSPEC, "localhost", &a);
29 flx_address_parse("::1", AF_INET6, &a);
30 flx_server_add_address(flx, 0, 0, AF_UNSPEC, "ip6-localhost", &a);
32 q.name = "campari.local.";
33 q.class = FLX_DNS_CLASS_IN;
34 q.type = FLX_DNS_TYPE_A;
35 flx_server_post_query_job(flx, 0, AF_UNSPEC, NULL, &q);
37 g_timeout_add(5000, timeout, NULL);
39 loop = g_main_loop_new(NULL, FALSE);
40 g_main_loop_run(loop);
41 g_main_loop_unref(loop);
43 flx_server_dump(flx, stdout);
45 flx_local_addr_source_free(l);