diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-10-25 22:20:37 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-10-25 22:20:37 +0000 |
commit | c3575017e2137ef664e4735bd6f9ff1209653ef3 (patch) | |
tree | 975af5275fbba0ef9344671adf941f2a60f1968e /avahi-core/avahi-test.c | |
parent | d2d2f82263bd1007b847324ec27236097bde1609 (diff) |
* replace AF_UNSPEC by AVAHI_PROTO_UNSPEC in client-test.c
* remove some functions from the public API in avahi-common/{domain,address}.[ch] and move them into avahi-core/{domain-util,add-util}.[ch]
* properly generate CNAME responses
* add some more comments to server.c
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@871 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/avahi-test.c')
-rw-r--r-- | avahi-core/avahi-test.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/avahi-core/avahi-test.c b/avahi-core/avahi-test.c index 754988c..51a3a03 100644 --- a/avahi-core/avahi-test.c +++ b/avahi-core/avahi-test.c @@ -149,6 +149,7 @@ static void remove_entries(void) { static void create_entries(int new_name) { AvahiAddress a; + AvahiRecord *r; remove_entries(); @@ -185,6 +186,14 @@ static void create_entries(int new_name) { goto fail; } + r = avahi_record_new_full("cname.local", AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_CNAME, AVAHI_DEFAULT_TTL); + r->data.cname.name = avahi_strdup("cocaine.local"); + + if (avahi_server_add(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, r) < 0) { + avahi_log_error("Failed to add CNAME record"); + goto fail; + } + avahi_s_entry_group_commit(group); return; @@ -345,7 +354,7 @@ int main(int argc, char *argv[]) { r = avahi_s_record_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, k, 0, record_browser_callback, NULL); avahi_key_unref(k); - hnr = avahi_s_host_name_resolver_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "cocaine.local", AVAHI_PROTO_UNSPEC, 0, hnr_callback, NULL); + hnr = avahi_s_host_name_resolver_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "cname.local", AVAHI_PROTO_UNSPEC, 0, hnr_callback, NULL); ar = avahi_s_address_resolver_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, avahi_address_parse("192.168.50.1", AVAHI_PROTO_INET, &a), 0, ar_callback, NULL); |