/* $Id$ */
+/* PLEASE NOTE *
+ * This file demonstrates how to use Avahi's core API, this is
+ * the embeddable mDNS stack for embedded applications.
+ *
+ * End user applications should *not* use this API and should use
+ * the DBUS or C APIs, please see
+ * client-browse-services.c and glib-integration.c
+ *
+ * I repeat, you probably do *not* want to use this example.
+ */
+
/***
This file is part of avahi.
#include <avahi-core/core.h>
#include <avahi-common/simple-watch.h>
#include <avahi-common/malloc.h>
+#include <avahi-common/error.h>
static AvahiSimplePoll *simple_poll = NULL;
+static AvahiServer *server = NULL;
static void resolve_callback(
AvahiSServiceResolver *r,
avahi_address_snprint(a, sizeof(a), address);
t = avahi_string_list_to_string(txt);
- fprintf(stderr, "\t%s:%u (%s) TXT=%s\n", host_name, port, a, t);
+ fprintf(stderr,
+ "\t%s:%u (%s)\n"
+ "\tTXT=%s\n"
+ "\tcookie is %u\n"
+ "\tis_local: %i\n",
+ host_name, port, a,
+ t,
+ avahi_string_list_get_service_cookie(txt),
+ avahi_server_is_service_local(server, interface, protocol, name, type, domain));
avahi_free(t);
}
int main(int argc, char*argv[]) {
AvahiServerConfig config;
- AvahiServer *server = NULL;
AvahiSServiceBrowser *sb;
int error;
int ret = 1;