X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Frr.c;h=90c62360605ef47e737871a2b0cd7040c6d809f5;hb=7df29f3e6c12a937e7cf7e476c428da57b6a5d16;hp=704f5beb43b520d77d22e276064843807e2fde33;hpb=4f0a5e7572a4257894b4bfede42c26d65152609e;p=catta diff --git a/avahi-core/rr.c b/avahi-core/rr.c index 704f5be..90c6236 100644 --- a/avahi-core/rr.c +++ b/avahi-core/rr.c @@ -60,6 +60,19 @@ AvahiKey *avahi_key_new(const char *name, uint16_t class, uint16_t type) { return k; } +AvahiKey *avahi_key_new_cname(AvahiKey *key) { + assert(key); + + if (key->clazz != AVAHI_DNS_CLASS_IN) + return NULL; + + if (key->type == AVAHI_DNS_TYPE_CNAME) + return NULL; + + return avahi_key_new(key->name, key->clazz, AVAHI_DNS_TYPE_CNAME); +} + + AvahiKey *avahi_key_ref(AvahiKey *k) { assert(k); assert(k->ref >= 1);