-static void scan_cache_callback(flxInterfaceMonitor *m, flxInterface *i, gpointer userdata) {
- flxSubscription *s = userdata;
- flxCacheEntry *e;
+struct cbdata {
+ AvahiSubscription *subscription;
+ AvahiInterface *interface;
+};
+
+static gpointer scan_cache_callback(AvahiCache *c, AvahiKey *pattern, AvahiCacheEntry *e, gpointer userdata) {
+ struct cbdata *cbdata = userdata;
+
+ g_assert(c);
+ g_assert(pattern);
+ g_assert(e);
+ g_assert(cbdata);
+
+ cbdata->subscription->callback(
+ cbdata->subscription,
+ e->record,
+ cbdata->interface->hardware->index,
+ cbdata->interface->protocol,
+ AVAHI_SUBSCRIPTION_NEW,
+ cbdata->subscription->userdata);
+
+ return NULL;
+}
+
+static void scan_interface_callback(AvahiInterfaceMonitor *m, AvahiInterface *i, gpointer userdata) {
+ AvahiSubscription *s = userdata;
+ struct cbdata cbdata = { s, i };