5 This file is part of catta.
7 catta is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of the
10 License, or (at your option) any later version.
12 catta is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15 Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with catta; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 /** \file catta/dns-srv-rr.h Functions for announcing and browsing for unicast DNS servers via mDNS */
25 /** A domain service browser object. Use this to browse for
26 * conventional unicast DNS servers which may be used to resolve
27 * conventional domain names */
28 typedef struct CattaSDNSServerBrowser CattaSDNSServerBrowser;
30 #include <catta/cdecl.h>
31 #include <catta/defs.h>
32 #include <catta/core.h>
33 #include <catta/publish.h>
37 /** The type of DNS server */
39 CATTA_DNS_SERVER_RESOLVE, /**< Unicast DNS servers for normal resolves (_domain._udp)*/
40 CATTA_DNS_SERVER_UPDATE, /**< Unicast DNS servers for updates (_dns-update._udp)*/
44 /** Publish the specified unicast DNS server address via mDNS. You may
45 * browse for records create this way wit
46 * catta_s_dns_server_browser_new(). */
47 int catta_server_add_dns_server_address(
51 CattaProtocol protocol,
52 CattaPublishFlags flags,
54 CattaDNSServerType type,
55 const CattaAddress *address,
56 uint16_t port /** should be 53 */);
58 /** Callback prototype for CattaSDNSServerBrowser events */
59 typedef void (*CattaSDNSServerBrowserCallback)(
60 CattaSDNSServerBrowser *b,
62 CattaProtocol protocol,
63 CattaBrowserEvent event,
64 const char *host_name, /**< Host name of the DNS server, probably useless */
65 const CattaAddress *a, /**< Address of the DNS server */
66 uint16_t port, /**< Port number of the DNS servers, probably 53 */
67 CattaLookupResultFlags flags, /**< Lookup flags */
70 /** Create a new CattaSDNSServerBrowser object */
71 CattaSDNSServerBrowser *catta_s_dns_server_browser_new(
74 CattaProtocol protocol,
76 CattaDNSServerType type,
77 CattaProtocol aprotocol, /**< Address protocol for the DNS server */
78 CattaLookupFlags flags, /**< Lookup flags. */
79 CattaSDNSServerBrowserCallback callback,
82 /** Free an CattaSDNSServerBrowser object */
83 void catta_s_dns_server_browser_free(CattaSDNSServerBrowser *b);