X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-core%2Fpublish.h;h=a5b302593d9586259b8c3f847342af96eb08515f;hb=11fdf8612c684b0faf85781ef1b2766bf6ea1f0b;hp=4e632f8e333614b114a0e21679127276557fb75f;hpb=1ffedb586bd2fb6daa3970304fac7c5b415cd38f;p=catta diff --git a/avahi-core/publish.h b/avahi-core/publish.h index 4e632f8..a5b3025 100644 --- a/avahi-core/publish.h +++ b/avahi-core/publish.h @@ -22,13 +22,12 @@ 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 @@ -42,7 +41,7 @@ typedef struct AvahiSEntryGroup AvahiSEntryGroup; AVAHI_C_DECL_END #endif -#include "core.h" +#include #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_BEGIN @@ -93,57 +92,9 @@ int avahi_server_add( AvahiSEntryGroup *g, /**< An entry group object if this new record shall be attached to one, or NULL. If you plan to remove the record sometime later you a required to pass an entry group object here. */ AvahiIfIndex interface, /**< A numeric index of a network interface to attach this record to, or AVAHI_IF_UNSPEC to attach this record to all interfaces */ AvahiProtocol protocol, /**< A protocol family to attach this record to. One of the AVAHI_PROTO_xxx constants. Use AVAHI_PROTO_UNSPEC to make this record available on all protocols (wich means on both IPv4 and IPv6). */ - AvahiEntryFlags 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, - AvahiEntryFlags 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, - AvahiEntryFlags 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, - AvahiEntryFlags 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, - AvahiEntryFlags flags, - uint32_t ttl, - const char *name, - AvahiStringList *strlst /**< TXT decord data as a AvahiString. This routine makes a deep copy of this object. */ ); - + AvahiPublishFlags flags, /**< Special flags for this record */ + AvahiRecord *r /**< The record to add. This function increases the reference counter 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 @@ -156,7 +107,7 @@ int avahi_server_add_address( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, - AvahiEntryFlags flags, + AvahiPublishFlags flags, const char *name, AvahiAddress *a); @@ -171,6 +122,7 @@ int avahi_server_add_service( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, + AvahiPublishFlags flags, const char *name, /**< Service name, e.g. "Lennart's Files" */ const char *type, /**< DNS-SD type, e.g. "_http._tcp" */ const char *domain, @@ -184,6 +136,7 @@ int avahi_server_add_service_va( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, + AvahiPublishFlags flags, const char *name, const char *type, const char *domain, @@ -197,6 +150,7 @@ int avahi_server_add_service_strlst( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, + AvahiPublishFlags flags, const char *name, const char *type, const char *domain, @@ -204,10 +158,59 @@ int avahi_server_add_service_strlst( uint16_t port, AvahiStringList *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, /**< 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 */ ); + +/** 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 *name, + const char *type, + const char *domain, + AvahiStringList *strlst); + +/** Update the TXT record for a service with the NULL terminated list of strings of the va_list. */ +int avahi_server_update_service_txt_va( + AvahiServer *s, + AvahiSEntryGroup *g, + AvahiIfIndex interface, + AvahiProtocol protocol, + AvahiPublishFlags flags, + const char *name, + const char *type, + const char *domain, + va_list va); + +/** 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 *name, + const char *type, + const char *domain, + ...) AVAHI_GCC_SENTINEL; + /** 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_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 @@ -218,6 +221,7 @@ int avahi_server_add_dns_server_address( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, + AvahiPublishFlags flags, const char *domain, AvahiDNSServerType type, const AvahiAddress *address, @@ -231,6 +235,7 @@ int avahi_server_add_dns_server_name( AvahiSEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, + AvahiPublishFlags flags, const char *domain, AvahiDNSServerType type, const char *name,