From 4e2d82b18f7e099cbce933b383c45efa40306161 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 24 Apr 2005 20:23:07 +0000 Subject: add support for dots and backslashes in domain names (required for DNS-SD) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@28 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- dns-test.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dns-test.c (limited to 'dns-test.c') diff --git a/dns-test.c b/dns-test.c new file mode 100644 index 0000000..5d09b4a --- /dev/null +++ b/dns-test.c @@ -0,0 +1,29 @@ +#include "dns.h" +#include "util.h" + +int main(int argc, char *argv[]) { + gchar t[256]; + flxDnsPacket *p; + + p = flx_dns_packet_new(8000); + + flx_dns_packet_append_name(p, "hello.hello.hello.de."); + flx_dns_packet_append_name(p, "this is a test.hello.de."); + flx_dns_packet_append_name(p, "this\\.is\\.a\\.test\\.with\\.dots.hello.de."); + flx_dns_packet_append_name(p, "this\\\\is another\\ \\test.hello.de."); + + flx_hexdump(FLX_DNS_PACKET_DATA(p), p->size); + + flx_dns_packet_consume_name(p, t, sizeof(t)); + g_message(">%s<", t); + flx_dns_packet_consume_name(p, t, sizeof(t)); + g_message(">%s<", t); + flx_dns_packet_consume_name(p, t, sizeof(t)); + g_message(">%s<", t); + flx_dns_packet_consume_name(p, t, sizeof(t)); + g_message(">%s<", t); + + + flx_dns_packet_free(p); + return 0; +} -- cgit