diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-03-18 16:48:19 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-03-18 16:48:19 +0000 |
commit | f0f4bb0c37eeed71934e3191cffa5afb1cfdca0d (patch) | |
tree | 154a6321b51c1af31f8633d61dde98968263f280 /iface.c | |
parent | 7bb43bd370e70385a4ccde06f3f4554f488aa6b3 (diff) |
some more inomcplete work
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@12 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'iface.c')
-rw-r--r-- | iface.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -370,3 +370,40 @@ void flx_interface_send_query(flxInterface *i, guchar protocol, flxKey *k) { flx_dns_packet_free(p); } + +void flx_interface_send_response(flxinterface *i, guchar protocol, flxRecord *rr) { + flxDnsPacket+p; + + g_assert(i); + g_assert(rr); + + p = flx_dns_packet_new(); + flx_dns_packet_set_field(p, DNS_FIELD_FLAGS, DNS_FLAGS(1, 0, 0, 0, 0, 0, 0, 0, 0, 0)); + + flx_dns_packet_append_name(p, rr->key->name); + flx_dns_packet_append_uint16(p, rr->key->type); + flx_dns_packet_append_uint16(p, rr->key->class); + flx_dns_packet_append_uint16 +} + + + +void flx_dump_caches(flxServer *s, FILE *f) { + flxInterface *i; + g_assert(s); + + for (i = flx_interface_monitor_get_first(s->monitor); i; i = i->interface_next) { + if (!flx_interface_is_relevant(i)) + continue; + + if (i->n_ipv4_addrs > 0) { + fprintf(f, ";;; INTERFACE %s; IPv4 ;;;\n", i->name); + flx_cache_dump(i->ipv4_cache, f); + } + + if (i->n_ipv6_addrs > 0) { + fprintf(f, ";;; INTERFACE %s; IPv6 ;;;\n", i->name); + flx_cache_dump(i->ipv6_cache, f); + } + } +} |