summaryrefslogtreecommitdiffstats
path: root/avahi-core/rr.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-core/rr.c')
-rw-r--r--avahi-core/rr.c13
1 files changed, 13 insertions, 0 deletions
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);