diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-10-27 19:11:34 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-10-27 19:11:34 +0000 |
commit | f6712902a92eb82b6c8d7e7fd0980a20a716fa0d (patch) | |
tree | 039df978bd7ea226c54fdce3aa6b17ee5728d492 /avahi-core/dns-test.c | |
parent | a950fddba0cc84e64bc72eb621429ba05540e98e (diff) |
* format unknown DNS records according to RFC3597
* add some DNS class and type validity checks to avahi_server_add()
* move DNS type and class definitions to avahi-common/defs.h
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@896 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/dns-test.c')
-rw-r--r-- | avahi-core/dns-test.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/avahi-core/dns-test.c b/avahi-core/dns-test.c index 5634ca5..8a7586c 100644 --- a/avahi-core/dns-test.c +++ b/avahi-core/dns-test.c @@ -29,6 +29,7 @@ #include <arpa/inet.h> #include <avahi-common/domain.h> +#include <avahi-common/defs.h> #include <avahi-common/malloc.h> #include "dns.h" @@ -36,7 +37,7 @@ #include "util.h" int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { - char t[AVAHI_DOMAIN_NAME_MAX]; + char t[AVAHI_DOMAIN_NAME_MAX], *m; const char *a, *b, *c, *d; AvahiDnsPacket *p; AvahiRecord *r, *r2; @@ -95,6 +96,19 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { /* Free the records */ avahi_record_unref(r); avahi_record_unref(r2); + + r = avahi_record_new_full("foobar", 77, 77, AVAHI_DEFAULT_TTL); + assert(r); + + assert(r->data.generic.data = avahi_memdup("HALLO", r->data.generic.size = 5)); + + m = avahi_record_to_string(r); + assert(m); + + avahi_log_debug(">%s<", m); + + avahi_free(m); + avahi_record_unref(r); return 0; } |