+static gint check_record_conflict(AvahiServer *s, gint interface, guchar protocol, AvahiRecord *r, AvahiEntryFlags flags) {
+ AvahiEntry *e;
+
+ g_assert(s);
+ g_assert(r);
+
+ for (e = g_hash_table_lookup(s->entries_by_key, r->key); e; e = e->by_key_next) {
+ if (e->dead)
+ continue;
+
+ if (!(flags & AVAHI_ENTRY_UNIQUE) && !(e->flags & AVAHI_ENTRY_UNIQUE))
+ continue;
+
+ if ((flags & AVAHI_ENTRY_ALLOWMUTIPLE) && (e->flags & AVAHI_ENTRY_ALLOWMUTIPLE) )
+ continue;
+
+ if (interface <= 0 ||
+ e->interface <= 0 ||
+ e->interface == interface ||
+ protocol == AF_UNSPEC ||
+ e->protocol == AF_UNSPEC ||
+ e->protocol == protocol)
+
+ return -1;
+
+ }
+
+ return 0;
+}
+