From d553a1c2d1cd3fcdd65ade64940b5bd3efc70675 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 31 Mar 2005 23:31:11 +0000 Subject: add client part of known answer suppresion git-svn-id: file:///home/lennart/svn/public/avahi/trunk@20 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- rr.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'rr.c') diff --git a/rr.c b/rr.c index 294d409..600e721 100644 --- a/rr.c +++ b/rr.c @@ -224,9 +224,31 @@ gboolean flx_key_equal(const flxKey *a, const flxKey *b) { /* g_message("equal: %p %p", a, b); */ - return strcmp(a->name, b->name) == 0 && a->type == b->type && a->class == b->class; + return strcmp(a->name, b->name) == 0 && + a->type == b->type && + a->class == b->class; } +gboolean flx_key_pattern_match(const flxKey *pattern, const flxKey *k) { + g_assert(pattern); + g_assert(k); + +/* g_message("equal: %p %p", a, b); */ + + g_assert(!flx_key_is_pattern(k)); + + return strcmp(pattern->name, k->name) == 0 && + (pattern->type == k->type || pattern->type == FLX_DNS_TYPE_ANY) && + pattern->class == k->class; +} + +gboolean flx_key_is_pattern(const flxKey *k) { + g_assert(k); + + return k->type == FLX_DNS_TYPE_ANY; +} + + guint flx_key_hash(const flxKey *k) { g_assert(k); -- cgit