X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fcore.h;h=abc30c00635a9c45e0ae08b656b06a7d5276845a;hb=5867849876e19996fd05a0d4917cb739904519c1;hp=1f2dda951c627ef33538673ecd41304cec0261fb;hpb=8b5cd6ffd9137b14b7ed678f10a551e3911e4a40;p=catta diff --git a/avahi-core/core.h b/avahi-core/core.h index 1f2dda9..abc30c0 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -24,11 +24,11 @@ /** \file core.h The Avahi Multicast DNS and DNS Service Discovery implmentation. */ -/** \example publish-service.c Example how to register a DNS-SD +/** \example core-publish-service.c Example how to register a DNS-SD * service using an embedded mDNS stack. It behaves like a network * printer registering both an IPP and a BSD LPR service. */ -/** \example browse-services.c Example how to browse for DNS-SD +/** \example core-browse-services.c Example how to browse for DNS-SD * services using an embedded mDNS stack. */ #include @@ -49,8 +49,6 @@ AVAHI_C_DECL_END #include #include -#include -#include #include #include @@ -87,11 +85,12 @@ typedef struct AvahiServerConfig { int use_iff_running; /**< Require IFF_RUNNING on local network interfaces. This is the official way to check for link beat. Unfortunately this doesn't work with all drivers. So bettere leave this off. */ int enable_reflector; /**< Reflect incoming mDNS traffic to all local networks. This allows mDNS based network browsing beyond ethernet borders */ int reflect_ipv; /**< if enable_reflector is 1, enable/disable reflecting between IPv4 and IPv6 */ + int add_service_cookie; /**< Add magic service cookie to all locally generated records implicitly */ } AvahiServerConfig; /** Allocate a new mDNS responder object. */ AvahiServer *avahi_server_new( - AvahiPoll *api, /**< The main loop adapter */ + const AvahiPoll *api, /**< The main loop adapter */ const AvahiServerConfig *sc, /**< If non-NULL a pointer to a configuration structure for the server. The server makes an internal deep copy of this structure, so you may free it using avahi_server_config_done() immediately after calling this function. */ AvahiServerCallback callback, /**< A callback which is called whenever the state of the server changes */ void* userdata, /**< An opaque pointer which is passed to the callback function */ @@ -228,7 +227,7 @@ int avahi_server_add_txt( AvahiEntryFlags flags, uint32_t ttl, /**< DNS TTL for this record */ const char *name, /**< TXT record name */ - ... /**< Text record data, terminated by NULL */); + ... /**< Text record data, terminated by NULL */) AVAHI_GCC_SENTINEL; /** Add a PTR RR to the server. Mostly identical to * avahi_server_add_text but takes a va_list instead of a variable @@ -288,7 +287,7 @@ int avahi_server_add_service( const char *domain, const char *host, /**< Host name where this servcie resides, or NULL if on the local host */ uint16_t port, /**< Port number of the service */ - ... /**< Text records, terminated by NULL */); + ... /**< Text records, terminated by NULL */) AVAHI_GCC_SENTINEL; /** Mostly identical to avahi_server_add_service(), but takes an va_list for the TXT records. */ int avahi_server_add_service_va( @@ -508,7 +507,7 @@ typedef void (*AvahiSServiceResolverCallback)( AvahiSServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, - AvahiResolverEvent event, + AvahiResolverEvent event, /**< Is AVAHI_RESOLVER_FOUND when the service was resolved successfully, and everytime it changes. Is AVAHI_RESOLVER_TIMOUT when the service failed to resolve or disappeared. */ const char *name, /**< Service name */ const char *type, /**< Service Type */ const char *domain, @@ -518,7 +517,7 @@ typedef void (*AvahiSServiceResolverCallback)( AvahiStringList *txt, /**< TXT record data */ void* userdata); -/** Create a new AvahiSServiceResolver object */ +/** Create a new AvahiSServiceResolver object. The specified callback function will be called with the resolved service data. */ AvahiSServiceResolver *avahi_s_service_resolver_new( AvahiServer *server, AvahiIfIndex interface, @@ -566,6 +565,12 @@ void avahi_s_dns_server_browser_free(AvahiSDNSServerBrowser *b); /** Return the last error code */ int avahi_server_errno(AvahiServer *s); +/** Return the local service cookie */ +uint32_t avahi_server_get_local_service_cookie(AvahiServer *s); + +/** Return 1 if there is a local service with the specified credentials registeresd. Return 0 if not, negative on failure */ +int avahi_server_is_service_local(AvahiServer *s, AvahiIfIndex, AvahiProtocol protocol, const char *name, const char *type, const char*domain); + #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END #endif