diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-10-17 22:23:16 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-10-17 22:23:16 +0000 |
commit | 263515cd1d7b52ce2ad3dc55a93b9d6f730133f1 (patch) | |
tree | 89ac4314dea5cb976fdbffcd8eefce1d7e0222ea /avahi-core/dns-srv-rr.h | |
parent | 55f7dcb690bcbdf6bca6568e0d9aacb2456811a5 (diff) |
* move unicast DNS server registration/browsing routines to their own header dns-srv-rr.h
* remove some unused functions
* unexport some functions
* other cleanups
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@803 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/dns-srv-rr.h')
-rw-r--r-- | avahi-core/dns-srv-rr.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/avahi-core/dns-srv-rr.h b/avahi-core/dns-srv-rr.h new file mode 100644 index 0000000..6111ff6 --- /dev/null +++ b/avahi-core/dns-srv-rr.h @@ -0,0 +1,107 @@ +#ifndef foodnssrvhfoo +#define foodnssrvhfoo + +/* $Id$ */ + +/*** + This file is part of avahi. + + avahi is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + avahi is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with avahi; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. +***/ + +/** \file avahi-core/dns-srv-rr.h Functions for announcing and browsing for unicast DNS servers via mDNS */ + +/** A domain service browser object. Use this to browse for + * conventional unicast DNS servers which may be used to resolve + * conventional domain names */ +typedef struct AvahiSDNSServerBrowser AvahiSDNSServerBrowser; + +#include <avahi-common/cdecl.h> +#include <avahi-common/defs.h> +#include <avahi-core/core.h> +#include <avahi-core/publish.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +AVAHI_C_DECL_BEGIN +#endif + +/** 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( + 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( + AvahiServer *s, + AvahiSEntryGroup *g, + AvahiIfIndex interface, + AvahiProtocol protocol, + AvahiPublishFlags flags, + const char *domain, + AvahiDNSServerType type, + const char *name, + uint16_t port /** should be 53 */); + +/** Callback prototype for AvahiSDNSServerBrowser events */ +typedef void (*AvahiSDNSServerBrowserCallback)( + AvahiSDNSServerBrowser *b, + AvahiIfIndex interface, + AvahiProtocol protocol, + AvahiBrowserEvent event, + const char *host_name, /**< Host name of the DNS server, probably useless */ + const AvahiAddress *a, /**< Address of the DNS server */ + uint16_t port, /**< Port number of the DNS servers, probably 53 */ + AvahiLookupResultFlags flags, /**< Lookup flags */ + void* userdata); + +/** Create a new AvahiSDNSServerBrowser object */ +AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new( + AvahiServer *server, + AvahiIfIndex interface, + AvahiProtocol protocol, + const char *domain, + AvahiDNSServerType type, + AvahiProtocol aprotocol, /**< Address protocol for the DNS server */ + AvahiLookupFlags flags, /**< Lookup flags. */ + AvahiSDNSServerBrowserCallback callback, + void* userdata); + +/** Free an AvahiSDNSServerBrowser object */ +void avahi_s_dns_server_browser_free(AvahiSDNSServerBrowser *b); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +AVAHI_C_DECL_END +#endif + +#endif |