]> git.meshlink.io Git - catta/blob - avahi-core/dns-srv-rr.h
b93619593a0950e03072d4f3c926145d5dc6874f
[catta] / avahi-core / dns-srv-rr.h
1 #ifndef foodnssrvhfoo
2 #define foodnssrvhfoo
3
4 /* $Id$ */
5
6 /***
7   This file is part of avahi.
8
9   avahi is free software; you can redistribute it and/or modify it
10   under the terms of the GNU Lesser General Public License as
11   published by the Free Software Foundation; either version 2.1 of the
12   License, or (at your option) any later version.
13
14   avahi is distributed in the hope that it will be useful, but WITHOUT
15   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16   or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
17   Public License for more details.
18
19   You should have received a copy of the GNU Lesser General Public
20   License along with avahi; if not, write to the Free Software
21   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22   USA.
23 ***/
24
25 /** \file avahi-core/dns-srv-rr.h Functions for announcing and browsing for unicast DNS servers via mDNS */
26
27 /** A domain service browser object. Use this to browse for
28  * conventional unicast DNS servers which may be used to resolve
29  * conventional domain names */
30 typedef struct AvahiSDNSServerBrowser AvahiSDNSServerBrowser;
31
32 #include <avahi-common/cdecl.h>
33 #include <avahi-common/defs.h>
34 #include <avahi-core/core.h>
35 #include <avahi-core/publish.h>
36
37 AVAHI_C_DECL_BEGIN
38
39 /** The type of DNS server */
40 typedef enum {
41     AVAHI_DNS_SERVER_RESOLVE,         /**< Unicast DNS servers for normal resolves (_domain._udp)*/
42     AVAHI_DNS_SERVER_UPDATE,           /**< Unicast DNS servers for updates (_dns-update._udp)*/
43     AVAHI_DNS_SERVER_MAX
44 } AvahiDNSServerType;
45
46 /** Publish the specified unicast DNS server address via mDNS. You may
47  * browse for records create this way wit
48  * avahi_s_dns_server_browser_new(). */
49 int avahi_server_add_dns_server_address(
50     AvahiServer *s,
51     AvahiSEntryGroup *g,
52     AvahiIfIndex interface,
53     AvahiProtocol protocol,
54     AvahiPublishFlags flags,
55     const char *domain,
56     AvahiDNSServerType type,
57     const AvahiAddress *address,
58     uint16_t port /** should be 53 */);
59
60 /** Callback prototype for AvahiSDNSServerBrowser events */
61 typedef void (*AvahiSDNSServerBrowserCallback)(
62     AvahiSDNSServerBrowser *b,
63     AvahiIfIndex interface,
64     AvahiProtocol protocol,
65     AvahiBrowserEvent event,
66     const char *host_name,       /**< Host name of the DNS server, probably useless */
67     const AvahiAddress *a,        /**< Address of the DNS server */
68     uint16_t port,                 /**< Port number of the DNS servers, probably 53 */
69     AvahiLookupResultFlags flags,  /**< Lookup flags */
70     void* userdata);
71
72 /** Create a new AvahiSDNSServerBrowser object */
73 AvahiSDNSServerBrowser *avahi_s_dns_server_browser_new(
74     AvahiServer *server,
75     AvahiIfIndex interface,
76     AvahiProtocol protocol,
77     const char *domain,
78     AvahiDNSServerType type,
79     AvahiProtocol aprotocol,  /**< Address protocol for the DNS server */
80     AvahiLookupFlags flags,                 /**< Lookup flags. */
81     AvahiSDNSServerBrowserCallback callback,
82     void* userdata);
83
84 /** Free an AvahiSDNSServerBrowser object */
85 void avahi_s_dns_server_browser_free(AvahiSDNSServerBrowser *b);
86
87 AVAHI_C_DECL_END
88
89 #endif