summaryrefslogtreecommitdiffstats
path: root/avahi-common/rr.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-06-24 19:02:51 +0000
committerLennart Poettering <lennart@poettering.net>2005-06-24 19:02:51 +0000
commit9962a048634c590db23a00db1d01daada779844c (patch)
tree521108bad5026135c129396d3c317738ec151818 /avahi-common/rr.c
parent9f9f4f6ea2405edc642d322c19f6f13e31920046 (diff)
* implement new source address check mechanisms
* introduce new types AvahiIfIndex and AvahiProtocol to abstract underlying OS structures a bit * document string list, address and other stuff * implement qclass = ANY queries * don't make use of UTF8 collation as RFC mandates git-svn-id: file:///home/lennart/svn/public/avahi/trunk@144 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common/rr.c')
-rw-r--r--avahi-common/rr.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/avahi-common/rr.c b/avahi-common/rr.c
index 7e974c4..13160fc 100644
--- a/avahi-common/rr.c
+++ b/avahi-common/rr.c
@@ -148,11 +148,15 @@ void avahi_record_unref(AvahiRecord *r) {
const gchar *avahi_dns_class_to_string(guint16 class) {
if (class & AVAHI_DNS_CACHE_FLUSH)
return "FLUSH";
-
- if (class == AVAHI_DNS_CLASS_IN)
- return "IN";
- return NULL;
+ switch (class) {
+ case AVAHI_DNS_CLASS_IN:
+ return "IN";
+ case AVAHI_DNS_CLASS_ANY:
+ return "ANY";
+ default:
+ return NULL;
+ }
}
const gchar *avahi_dns_type_to_string(guint16 type) {
@@ -266,16 +270,17 @@ gboolean avahi_key_pattern_match(const AvahiKey *pattern, const AvahiKey *k) {
return avahi_domain_equal(pattern->name, k->name) &&
(pattern->type == k->type || pattern->type == AVAHI_DNS_TYPE_ANY) &&
- pattern->class == k->class;
+ (pattern->class == k->class || pattern->type == AVAHI_DNS_CLASS_ANY);
}
gboolean avahi_key_is_pattern(const AvahiKey *k) {
g_assert(k);
- return k->type == AVAHI_DNS_TYPE_ANY;
+ return
+ k->type == AVAHI_DNS_TYPE_ANY ||
+ k->class == AVAHI_DNS_CLASS_ANY;
}
-
guint avahi_key_hash(const AvahiKey *k) {
g_assert(k);
@@ -313,8 +318,8 @@ static gboolean rdata_equal(const AvahiRecord *a, const AvahiRecord *b) {
case AVAHI_DNS_TYPE_HINFO:
return
- !g_utf8_collate(a->data.hinfo.cpu, b->data.hinfo.cpu) &&
- !g_utf8_collate(a->data.hinfo.os, b->data.hinfo.os);
+ !strcmp(a->data.hinfo.cpu, b->data.hinfo.cpu) &&
+ !strcmp(a->data.hinfo.os, b->data.hinfo.os);
case AVAHI_DNS_TYPE_TXT:
return avahi_string_list_equal(a->data.txt.string_list, b->data.txt.string_list);