1 #ifndef fooclientlookuphfoo
2 #define fooclientlookuphfoo
7 This file is part of avahi.
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.
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.
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
27 #include <avahi-common/cdecl.h>
28 #include <avahi-common/address.h>
29 #include <avahi-common/strlst.h>
30 #include <avahi-common/defs.h>
31 #include <avahi-common/watch.h>
32 #include <avahi-common/gccmacro.h>
34 #include <avahi-client/client.h>
36 /** \file avahi-client/lookup.h Lookup Client API */
38 /** \example client-browse-services.c Example how to browse for DNS-SD
39 * services using the client interface to avahi-daemon. */
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 /** A domain browser object */
46 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
48 /** A service browser object */
49 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
51 /** A service type browser object */
52 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
54 /** A service resolver object */
55 typedef struct AvahiServiceResolver AvahiServiceResolver;
57 /** A service resolver object */
58 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
60 /** An address resolver object */
61 typedef struct AvahiAddressResolver AvahiAddressResolver;
63 /** The function prototype for the callback of an AvahiDomainBrowser */
64 typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void *userdata);
66 /** The function prototype for the callback of an AvahiServiceBrowser */
67 typedef void (*AvahiServiceBrowserCallback) (AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *userdata);
69 /** The function prototype for the callback of an AvahiServiceTypeBrowser */
70 typedef void (*AvahiServiceTypeBrowserCallback) (AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, AvahiLookupResultFlags flags, void *userdata);
72 /** The function prototype for the callback of an AvahiServiceResolver */
73 typedef void (*AvahiServiceResolverCallback) (
74 AvahiServiceResolver *r,
75 AvahiIfIndex interface,
76 AvahiProtocol protocol,
77 AvahiResolverEvent event,
81 const char *host_name,
82 const AvahiAddress *a,
85 AvahiLookupResultFlags flags,
88 /** The function prototype for the callback of an AvahiHostNameResolver */
89 typedef void (*AvahiHostNameResolverCallback) (
90 AvahiHostNameResolver *r,
91 AvahiIfIndex interface,
92 AvahiProtocol protocol,
93 AvahiResolverEvent event,
95 const AvahiAddress *a,
96 AvahiLookupResultFlags flags,
99 /** The function prototype for the callback of an AvahiAddressResolver */
100 typedef void (*AvahiAddressResolverCallback) (
101 AvahiAddressResolver *r,
102 AvahiIfIndex interface,
103 AvahiProtocol protocol,
104 AvahiResolverEvent event,
105 AvahiProtocol aprotocol,
106 const AvahiAddress *a,
108 AvahiLookupResultFlags flags,
112 /** Browse for domains on the local network */
113 AvahiDomainBrowser* avahi_domain_browser_new (
115 AvahiIfIndex interface,
116 AvahiProtocol protocol,
118 AvahiDomainBrowserType btype,
119 AvahiLookupFlags flags,
120 AvahiDomainBrowserCallback callback,
123 /** Get the parent client of an AvahiDomainBrowser object */
124 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
126 /** Cleans up and frees an AvahiDomainBrowser object */
127 int avahi_domain_browser_free (AvahiDomainBrowser *);
129 /** Browse for service types on the local network */
130 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
132 AvahiIfIndex interface,
133 AvahiProtocol protocol,
135 AvahiLookupFlags flags,
136 AvahiServiceTypeBrowserCallback callback,
139 /** Get the parent client of an AvahiServiceTypeBrowser object */
140 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
142 /** Cleans up and frees an AvahiServiceTypeBrowser object */
143 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
145 /** Browse for services of a type on the local network */
146 AvahiServiceBrowser* avahi_service_browser_new (
148 AvahiIfIndex interface,
149 AvahiProtocol protocol,
152 AvahiLookupFlags flags,
153 AvahiServiceBrowserCallback callback,
156 /** Get the parent client of an AvahiServiceBrowser object */
157 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
159 /* Cleans up and frees an AvahiServiceBrowser object */
160 int avahi_service_browser_free (AvahiServiceBrowser *);
162 /** Create a new service resolver object */
163 AvahiServiceResolver * avahi_service_resolver_new(
165 AvahiIfIndex interface,
166 AvahiProtocol protocol,
170 AvahiProtocol aprotocol,
171 AvahiLookupFlags flags,
172 AvahiServiceResolverCallback callback,
175 /** Get the parent client of an AvahiServiceResolver object */
176 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
178 /** Free a service resolver object */
179 int avahi_service_resolver_free(AvahiServiceResolver *r);
181 /** Create a new hostname resolver object */
182 AvahiHostNameResolver * avahi_host_name_resolver_new(
184 AvahiIfIndex interface,
185 AvahiProtocol protocol,
187 AvahiProtocol aprotocol,
188 AvahiLookupFlags flags,
189 AvahiHostNameResolverCallback callback,
192 /** Get the parent client of an AvahiHostNameResolver object */
193 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
195 /** Free a hostname resolver object */
196 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
198 /** Create a new address resolver object from an address string. Set aprotocol to AF_UNSPEC for protocol detection. */
199 AvahiAddressResolver * avahi_address_resolver_new(
201 AvahiIfIndex interface,
202 AvahiProtocol protocol,
204 AvahiLookupFlags flags,
205 AvahiAddressResolverCallback callback,
208 /** Create a new address resolver object from an AvahiAddress object */
209 AvahiAddressResolver* avahi_address_resolver_new_a(
211 AvahiIfIndex interface,
212 AvahiProtocol protocol,
213 const AvahiAddress *a,
214 AvahiLookupFlags flags,
215 AvahiAddressResolverCallback callback,
218 /** Get the parent client of an AvahiAddressResolver object */
219 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
221 /** Free a AvahiAddressResolver resolver object */
222 int avahi_address_resolver_free(AvahiAddressResolver *r);
224 #ifndef DOXYGEN_SHOULD_SKIP_THIS