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. */
43 /** @{ \name Domain Browser */
45 /** A domain browser object */
46 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
48 /** The function prototype for the callback of an AvahiDomainBrowser */
49 typedef void (*AvahiDomainBrowserCallback) (
50 AvahiDomainBrowser *b,
51 AvahiIfIndex interface,
52 AvahiProtocol protocol,
53 AvahiBrowserEvent event,
55 AvahiLookupResultFlags flags,
58 /** Browse for domains on the local network */
59 AvahiDomainBrowser* avahi_domain_browser_new (
61 AvahiIfIndex interface,
62 AvahiProtocol protocol,
64 AvahiDomainBrowserType btype,
65 AvahiLookupFlags flags,
66 AvahiDomainBrowserCallback callback,
69 /** Get the parent client of an AvahiDomainBrowser object */
70 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
72 /** Cleans up and frees an AvahiDomainBrowser object */
73 int avahi_domain_browser_free (AvahiDomainBrowser *);
77 /** @{ \name Service Browser */
79 /** A service browser object */
80 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
82 /** The function prototype for the callback of an AvahiServiceBrowser */
83 typedef void (*AvahiServiceBrowserCallback) (
84 AvahiServiceBrowser *b,
85 AvahiIfIndex interface,
86 AvahiProtocol protocol,
87 AvahiBrowserEvent event,
91 AvahiLookupResultFlags flags,
94 /** Browse for services of a type on the local network */
95 AvahiServiceBrowser* avahi_service_browser_new (
97 AvahiIfIndex interface,
98 AvahiProtocol protocol,
101 AvahiLookupFlags flags,
102 AvahiServiceBrowserCallback callback,
105 /** Get the parent client of an AvahiServiceBrowser object */
106 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
108 /** Cleans up and frees an AvahiServiceBrowser object */
109 int avahi_service_browser_free (AvahiServiceBrowser *);
113 /** \cond fulldocs */
114 /** A service type browser object */
115 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
117 /** The function prototype for the callback of an AvahiServiceTypeBrowser */
118 typedef void (*AvahiServiceTypeBrowserCallback) (
119 AvahiServiceTypeBrowser *b,
120 AvahiIfIndex interface,
121 AvahiProtocol protocol,
122 AvahiBrowserEvent event,
125 AvahiLookupResultFlags flags,
128 /** Browse for service types on the local network */
129 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
131 AvahiIfIndex interface,
132 AvahiProtocol protocol,
134 AvahiLookupFlags flags,
135 AvahiServiceTypeBrowserCallback callback,
138 /** Get the parent client of an AvahiServiceTypeBrowser object */
139 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
141 /** Cleans up and frees an AvahiServiceTypeBrowser object */
142 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
146 /** @{ \name Service Resolver */
148 /** A service resolver object */
149 typedef struct AvahiServiceResolver AvahiServiceResolver;
151 /** The function prototype for the callback of an AvahiServiceResolver */
152 typedef void (*AvahiServiceResolverCallback) (
153 AvahiServiceResolver *r,
154 AvahiIfIndex interface,
155 AvahiProtocol protocol,
156 AvahiResolverEvent event,
160 const char *host_name,
161 const AvahiAddress *a,
163 AvahiStringList *txt,
164 AvahiLookupResultFlags flags,
167 /** Create a new service resolver object. Please make sure to pass all
168 * the service data you received via avahi_service_browser_new()'s
169 * callback function, especially interface and protocol. */
170 AvahiServiceResolver * avahi_service_resolver_new(
172 AvahiIfIndex interface,
173 AvahiProtocol protocol,
177 AvahiProtocol aprotocol,
178 AvahiLookupFlags flags,
179 AvahiServiceResolverCallback callback,
182 /** Get the parent client of an AvahiServiceResolver object */
183 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
185 /** Free a service resolver object */
186 int avahi_service_resolver_free(AvahiServiceResolver *r);
190 /** \cond fulldocs */
191 /** A service resolver object */
192 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
194 /** The function prototype for the callback of an AvahiHostNameResolver */
195 typedef void (*AvahiHostNameResolverCallback) (
196 AvahiHostNameResolver *r,
197 AvahiIfIndex interface,
198 AvahiProtocol protocol,
199 AvahiResolverEvent event,
201 const AvahiAddress *a,
202 AvahiLookupResultFlags flags,
205 /** Create a new hostname resolver object */
206 AvahiHostNameResolver * avahi_host_name_resolver_new(
208 AvahiIfIndex interface,
209 AvahiProtocol protocol,
211 AvahiProtocol aprotocol,
212 AvahiLookupFlags flags,
213 AvahiHostNameResolverCallback callback,
216 /** Get the parent client of an AvahiHostNameResolver object */
217 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
219 /** Free a hostname resolver object */
220 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
222 /** An address resolver object */
223 typedef struct AvahiAddressResolver AvahiAddressResolver;
225 /** The function prototype for the callback of an AvahiAddressResolver */
226 typedef void (*AvahiAddressResolverCallback) (
227 AvahiAddressResolver *r,
228 AvahiIfIndex interface,
229 AvahiProtocol protocol,
230 AvahiResolverEvent event,
231 const AvahiAddress *a,
233 AvahiLookupResultFlags flags,
236 /** Create a new address resolver object from an AvahiAddress object */
237 AvahiAddressResolver* avahi_address_resolver_new(
239 AvahiIfIndex interface,
240 AvahiProtocol protocol,
241 const AvahiAddress *a,
242 AvahiLookupFlags flags,
243 AvahiAddressResolverCallback callback,
246 /** Get the parent client of an AvahiAddressResolver object */
247 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
249 /** Free a AvahiAddressResolver resolver object */
250 int avahi_address_resolver_free(AvahiAddressResolver *r);
254 /** @{ \name Record Browser */
256 /** A record browser object */
257 typedef struct AvahiRecordBrowser AvahiRecordBrowser;
259 /** The function prototype for the callback of an AvahiRecordBrowser */
260 typedef void (*AvahiRecordBrowserCallback) (
261 AvahiRecordBrowser *b,
262 AvahiIfIndex interface,
263 AvahiProtocol protocol,
264 AvahiBrowserEvent event,
270 AvahiLookupResultFlags flags,
273 /** Browse for records of a type on the local network */
274 AvahiRecordBrowser* avahi_record_browser_new(
276 AvahiIfIndex interface,
277 AvahiProtocol protocol,
281 AvahiLookupFlags flags,
282 AvahiRecordBrowserCallback callback,
285 /** Get the parent client of an AvahiRecordBrowser object */
286 AvahiClient* avahi_record_browser_get_client(AvahiRecordBrowser *);
288 /** Cleans up and frees an AvahiRecordBrowser object */
289 int avahi_record_browser_free(AvahiRecordBrowser *);