summaryrefslogtreecommitdiffstats
path: root/dns-test.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-04-24 20:23:07 +0000
committerLennart Poettering <lennart@poettering.net>2005-04-24 20:23:07 +0000
commit4e2d82b18f7e099cbce933b383c45efa40306161 (patch)
tree59f6dac0e0a77bee42af778df254f379aec6f369 /dns-test.c
parent4ccd2cdd5ae567dc2cb6c05ca5e5a9537a9dc1c4 (diff)
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
Diffstat (limited to 'dns-test.c')
-rw-r--r--dns-test.c29
1 files changed, 29 insertions, 0 deletions
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;
+}