X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fpublish.h;h=77c49afc95b3bda423792898dac73b83bce5059e;hb=bd08c7fb439987cf18386e7e6f9a3eeba855ed00;hp=4143bb35e4689fce7d1bca91f4a1e3abbe7b599e;hpb=d1dd07145bb3db5c6fd77c55aea762eb79ab3b5c;p=catta diff --git a/avahi-core/publish.h b/avahi-core/publish.h index 4143bb3..77c49af 100644 --- a/avahi-core/publish.h +++ b/avahi-core/publish.h @@ -22,31 +22,19 @@ USA. ***/ -/** \file publish.h Functions for publising local services and RRs */ +/** \file core/publish.h Functions for publising local services and RRs */ /** \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. */ - -#include - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -AVAHI_C_DECL_BEGIN -#endif - /** A group of locally registered DNS RRs */ typedef struct AvahiSEntryGroup AvahiSEntryGroup; -#ifndef DOXYGEN_SHOULD_SKIP_THIS -AVAHI_C_DECL_END -#endif - -#include "core.h" +#include +#include -#ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_BEGIN -#endif /** Prototype for callback functions which are called whenever the state of an AvahiSEntryGroup object changes */ typedef void (*AvahiSEntryGroupCallback) (AvahiServer *s, AvahiSEntryGroup *g, AvahiEntryGroupState state, void* userdata); @@ -96,55 +84,6 @@ int avahi_server_add( AvahiPublishFlags flags, /**< Special flags for this record */ AvahiRecord *r /**< The record to add. This function increases the reference counter of this object. */); - -/** Add a PTR RR to the server. See avahi_server_add() for more information. */ -int avahi_server_add_ptr( - AvahiServer *s, - AvahiSEntryGroup *g, - AvahiIfIndex interface, - AvahiProtocol protocol, - AvahiPublishFlags flags, - uint32_t ttl, /**< DNS TTL for this record */ - const char *name, /**< PTR record name */ - const char *dest /**< pointer destination */ ); - -/** Add a PTR RR to the server. See avahi_server_add() for more information. */ -int avahi_server_add_txt( - AvahiServer *s, - AvahiSEntryGroup *g, - AvahiIfIndex interface, - AvahiProtocol protocol, - AvahiPublishFlags flags, - uint32_t ttl, /**< DNS TTL for this record */ - const char *name, /**< TXT record name */ - ... /**< 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 - * number of arguments */ -int avahi_server_add_txt_va( - AvahiServer *s, - AvahiSEntryGroup *g, - AvahiIfIndex interface, - AvahiProtocol protocol, - AvahiPublishFlags flags, - uint32_t ttl, - const char *name, - va_list va); - -/** Add a PTR RR to the server. Mostly identical to - * avahi_server_add_text but takes an AvahiStringList record instead of a variable - * number of arguments. */ -int avahi_server_add_txt_strlst( - AvahiServer *s, - AvahiSEntryGroup *g, - AvahiIfIndex interface, - AvahiProtocol protocol, - AvahiPublishFlags flags, - uint32_t ttl, - const char *name, - AvahiStringList *strlst /**< TXT decord data as a AvahiString. This routine makes a deep copy of this object. */ ); - /** Add an IP address mapping to the server. This will add both the * host-name-to-address and the reverse mapping to the server. See * avahi_server_add() for more information. If adding one of the RRs @@ -180,8 +119,8 @@ int avahi_server_add_service( uint16_t port, /**< Port number of the service */ ... /**< 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( +/** Mostly identical to avahi_server_add_service(), but takes an AvahiStringList object for the TXT records. The AvahiStringList object is copied. */ +int avahi_server_add_service_strlst( AvahiServer *s, AvahiSEntryGroup *g, AvahiIfIndex interface, @@ -192,60 +131,47 @@ int avahi_server_add_service_va( const char *domain, const char *host, uint16_t port, - va_list va); + AvahiStringList *strlst); -/** Mostly identical to avahi_server_add_service(), but takes an AvahiStringList object for the TXT records. The AvahiStringList object is copied. */ -int avahi_server_add_service_strlst( +/** Add a subtype for an already existing service */ +int avahi_server_add_service_subtype( AvahiServer *s, AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, - const char *name, - const char *type, - const char *domain, - const char *host, - uint16_t port, - AvahiStringList *strlst); + const char *name, /**< Specify the name of main service you already added here */ + const char *type, /**< Specify the main type of the service you already added here */ + const char *domain, /**< Specify the main type of the service you already added here */ + const char *subtype /**< The new subtype for the specified service */ ); -/** The type of DNS server */ -typedef enum { - AVAHI_DNS_SERVER_RESOLVE, /**< Unicast DNS servers for normal resolves (_domain._udp)*/ - AVAHI_DNS_SERVER_UPDATE, /**< Unicast DNS servers for updates (_dns-update._udp)*/ - AVAHI_DNS_SERVER_MAX -} AvahiDNSServerType; - -/** Publish the specified unicast DNS server address via mDNS. You may - * browse for records create this way wit - * avahi_s_dns_server_browser_new(). */ -int avahi_server_add_dns_server_address( +/** Update the TXT record for a service with the data from the specified string list */ +int avahi_server_update_service_txt_strlst( AvahiServer *s, AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, - const char *domain, - AvahiDNSServerType type, - const AvahiAddress *address, - uint16_t port /** should be 53 */); - -/** Similar to avahi_server_add_dns_server_address(), but specify a -host name instead of an address. The specified host name should be -resolvable via mDNS */ -int avahi_server_add_dns_server_name( + const char *name, + const char *type, + const char *domain, + AvahiStringList *strlst); + +/** Update the TXT record for a service with the NULL termonate list of strings */ +int avahi_server_update_service_txt( AvahiServer *s, AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiPublishFlags flags, - const char *domain, - AvahiDNSServerType type, - const char *name, - uint16_t port /** should be 53 */); + const char *name, + const char *type, + const char *domain, + ...) AVAHI_GCC_SENTINEL; +/** Check if there is a service locally defined and return the entry group it is attached to. Returns NULL if the service isn't local*/ +int avahi_server_get_group_of_service(AvahiServer *s, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, AvahiSEntryGroup** ret_group); -#ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END -#endif #endif