]> git.meshlink.io Git - catta/blobdiff - avahi-core/rr.c
* Implement DNSServiceConstructFullName()
[catta] / avahi-core / rr.c
index 704f5beb43b520d77d22e276064843807e2fde33..90c62360605ef47e737871a2b0cd7040c6d809f5 100644 (file)
@@ -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);