]> git.meshlink.io Git - catta/commitdiff
update examples to use xxx_is_service_local()
authorLennart Poettering <lennart@poettering.net>
Sat, 10 Sep 2005 02:23:59 +0000 (02:23 +0000)
committerLennart Poettering <lennart@poettering.net>
Sat, 10 Sep 2005 02:23:59 +0000 (02:23 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@564 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

examples/client-browse-services.c
examples/core-browse-services.c

index 916b12b8e9d65f2238262d4f596cae63e379832f..75379405021c174eea40161e331e4e73d342a514 100644 (file)
@@ -64,7 +64,15 @@ static void resolve_callback(
 
         avahi_address_snprint(a, sizeof(a), address);
         t = avahi_string_list_to_string(txt);
-        fprintf(stderr, "\t%s:%u (%s) TXT=%s (cookie is %u)\n", host_name, port, a, t, avahi_string_list_get_service_cookie(txt));
+        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_client_is_service_local(avahi_service_resolver_get_client(r), interface, protocol, name, type, domain));
         avahi_free(t);
     }
 
index 8df5454f0ebd158f1cc2f5845e3656de150a9b8d..f3bf7825d2383392ba9ed0db68c28c528250e0ea 100644 (file)
@@ -45,6 +45,7 @@
 #include <avahi-common/error.h>
 
 static AvahiSimplePoll *simple_poll = NULL;
+static AvahiServer *server = NULL;
 
 static void resolve_callback(
     AvahiSServiceResolver *r,
@@ -75,7 +76,15 @@ static void resolve_callback(
 
         avahi_address_snprint(a, sizeof(a), address);
         t = avahi_string_list_to_string(txt);
-        fprintf(stderr, "\t%s:%u (%s) TXT=%s (cookie is %u)\n", host_name, port, a, t, avahi_string_list_get_service_cookie(txt));
+        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);
     }
 
@@ -116,7 +125,6 @@ static void browse_callback(
 
 int main(int argc, char*argv[]) {
     AvahiServerConfig config;
-    AvahiServer *server = NULL;
     AvahiSServiceBrowser *sb;
     int error;
     int ret = 1;