]> git.meshlink.io Git - catta/blob - dns-test.c
add support for dots and backslashes in domain names (required for DNS-SD)
[catta] / dns-test.c
1 #include "dns.h"
2 #include "util.h"
3
4 int main(int argc, char *argv[]) {
5     gchar t[256];
6     flxDnsPacket *p;
7
8     p = flx_dns_packet_new(8000);
9
10     flx_dns_packet_append_name(p, "hello.hello.hello.de.");
11     flx_dns_packet_append_name(p, "this is a test.hello.de."); 
12     flx_dns_packet_append_name(p, "this\\.is\\.a\\.test\\.with\\.dots.hello.de."); 
13     flx_dns_packet_append_name(p, "this\\\\is another\\ \\test.hello.de."); 
14
15     flx_hexdump(FLX_DNS_PACKET_DATA(p), p->size);
16
17     flx_dns_packet_consume_name(p, t, sizeof(t));
18     g_message(">%s<", t);
19     flx_dns_packet_consume_name(p, t, sizeof(t));
20     g_message(">%s<", t);
21     flx_dns_packet_consume_name(p, t, sizeof(t));
22     g_message(">%s<", t);
23     flx_dns_packet_consume_name(p, t, sizeof(t));
24     g_message(">%s<", t);
25     
26     
27     flx_dns_packet_free(p);
28     return 0;
29 }