+static void avahi_service_type_browser_callback (
+ AvahiServiceTypeBrowser *b,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiBrowserEvent event,
+ const char *type,
+ const char *domain,
+ AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
+ void *userdata) {
+
+ printf ("SERVICE-TYPE-BROWSER: Callback on %p, interface (%d), protocol (%d), event (%d), type (%s), domain (%s), data (%s)\n", (void*) b, interface, protocol, event, type ? type : "NULL", domain ? domain : "NULL", (char*)userdata);
+}
+
+static void avahi_address_resolver_callback (
+ AVAHI_GCC_UNUSED AvahiAddressResolver *r,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event,
+ const AvahiAddress *address,
+ const char *name,
+ AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
+ void *userdata) {
+
+ char addr[64];
+ if (event == AVAHI_RESOLVER_FAILURE) {
+ printf ("ADDRESS-RESOLVER: Callback on AddressResolver, timed out.\n");
+ return;
+ }
+ avahi_address_snprint (addr, sizeof (addr), address);
+ printf ("ADDRESS-RESOLVER: Callback on AddressResolver, interface (%d), protocol (%d), even (%d), address (%s), name (%s), data(%s)\n", interface, protocol, event, addr, name, (char*) userdata);
+}
+
+static void avahi_host_name_resolver_callback (
+ AvahiHostNameResolver *r,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event,
+ const char *name,
+ const AvahiAddress *a,
+ AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
+ void *userdata) {
+
+ AvahiClient *client;
+ AvahiAddressResolver *ar;
+ char addr[64];
+
+ if (event == AVAHI_RESOLVER_FAILURE) {
+ printf ("HOST-NAME-RESOLVER: Callback on HostNameResolver, timed out.\n");
+ return;
+ }
+ client = avahi_host_name_resolver_get_client (r);
+ar = avahi_address_resolver_new(client, interface, protocol, a, 0, avahi_address_resolver_callback, (char*) "omghai6u");
+ if (ar)
+ {
+ printf ("Succesfully created address resolver object\n");
+ } else {
+ printf ("Failed to create AddressResolver\n");
+ }
+ avahi_address_snprint (addr, sizeof (addr), a);
+ printf ("HOST-NAME-RESOLVER: Callback on HostNameResolver, interface (%d), protocol (%d), event (%d), name (%s), address (%s), data (%s)\n", interface, protocol, event, name, addr, (char*)userdata);
+}
+static void test_free_domain_browser(AVAHI_GCC_UNUSED AvahiTimeout *timeout, void* userdata)