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 /** A domain browser object */
44 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
46 /** A service browser object */
47 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
49 /** A service type browser object */
50 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
52 /** A service resolver object */
53 typedef struct AvahiServiceResolver AvahiServiceResolver;
55 /** A service resolver object */
56 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
58 /** An address resolver object */
59 typedef struct AvahiAddressResolver AvahiAddressResolver;
61 /** A record browser object */
62 typedef struct AvahiRecordBrowser AvahiRecordBrowser;
64 /** The function prototype for the callback of an AvahiDomainBrowser */
65 typedef void (*AvahiDomainBrowserCallback) (
66 AvahiDomainBrowser *b,
67 AvahiIfIndex interface,
68 AvahiProtocol protocol,
69 AvahiBrowserEvent event,
71 AvahiLookupResultFlags flags,
74 /** The function prototype for the callback of an AvahiServiceBrowser */
75 typedef void (*AvahiServiceBrowserCallback) (
76 AvahiServiceBrowser *b,
77 AvahiIfIndex interface,
78 AvahiProtocol protocol,
79 AvahiBrowserEvent event,
83 AvahiLookupResultFlags flags,
86 /** The function prototype for the callback of an AvahiServiceTypeBrowser */
87 typedef void (*AvahiServiceTypeBrowserCallback) (
88 AvahiServiceTypeBrowser *b,
89 AvahiIfIndex interface,
90 AvahiProtocol protocol,
91 AvahiBrowserEvent event,
94 AvahiLookupResultFlags flags,
97 /** The function prototype for the callback of an AvahiServiceResolver */
98 typedef void (*AvahiServiceResolverCallback) (
99 AvahiServiceResolver *r,
100 AvahiIfIndex interface,
101 AvahiProtocol protocol,
102 AvahiResolverEvent event,
106 const char *host_name,
107 const AvahiAddress *a,
109 AvahiStringList *txt,
110 AvahiLookupResultFlags flags,
113 /** The function prototype for the callback of an AvahiHostNameResolver */
114 typedef void (*AvahiHostNameResolverCallback) (
115 AvahiHostNameResolver *r,
116 AvahiIfIndex interface,
117 AvahiProtocol protocol,
118 AvahiResolverEvent event,
120 const AvahiAddress *a,
121 AvahiLookupResultFlags flags,
124 /** The function prototype for the callback of an AvahiAddressResolver */
125 typedef void (*AvahiAddressResolverCallback) (
126 AvahiAddressResolver *r,
127 AvahiIfIndex interface,
128 AvahiProtocol protocol,
129 AvahiResolverEvent event,
130 const AvahiAddress *a,
132 AvahiLookupResultFlags flags,
135 /** The function prototype for the callback of an AvahiRecordBrowser */
136 typedef void (*AvahiRecordBrowserCallback) (
137 AvahiRecordBrowser *b,
138 AvahiIfIndex interface,
139 AvahiProtocol protocol,
140 AvahiBrowserEvent event,
146 AvahiLookupResultFlags flags,
149 /** Browse for domains on the local network */
150 AvahiDomainBrowser* avahi_domain_browser_new (
152 AvahiIfIndex interface,
153 AvahiProtocol protocol,
155 AvahiDomainBrowserType btype,
156 AvahiLookupFlags flags,
157 AvahiDomainBrowserCallback callback,
160 /** Get the parent client of an AvahiDomainBrowser object */
161 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
163 /** Cleans up and frees an AvahiDomainBrowser object */
164 int avahi_domain_browser_free (AvahiDomainBrowser *);
166 /** Browse for service types on the local network */
167 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
169 AvahiIfIndex interface,
170 AvahiProtocol protocol,
172 AvahiLookupFlags flags,
173 AvahiServiceTypeBrowserCallback callback,
176 /** Get the parent client of an AvahiServiceTypeBrowser object */
177 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
179 /** Cleans up and frees an AvahiServiceTypeBrowser object */
180 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
182 /** Browse for services of a type on the local network */
183 AvahiServiceBrowser* avahi_service_browser_new (
185 AvahiIfIndex interface,
186 AvahiProtocol protocol,
189 AvahiLookupFlags flags,
190 AvahiServiceBrowserCallback callback,
193 /** Get the parent client of an AvahiServiceBrowser object */
194 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
196 /** Cleans up and frees an AvahiServiceBrowser object */
197 int avahi_service_browser_free (AvahiServiceBrowser *);
199 /** Create a new service resolver object */
200 AvahiServiceResolver * avahi_service_resolver_new(
202 AvahiIfIndex interface,
203 AvahiProtocol protocol,
207 AvahiProtocol aprotocol,
208 AvahiLookupFlags flags,
209 AvahiServiceResolverCallback callback,
212 /** Get the parent client of an AvahiServiceResolver object */
213 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
215 /** Free a service resolver object */
216 int avahi_service_resolver_free(AvahiServiceResolver *r);
218 /** Create a new hostname resolver object */
219 AvahiHostNameResolver * avahi_host_name_resolver_new(
221 AvahiIfIndex interface,
222 AvahiProtocol protocol,
224 AvahiProtocol aprotocol,
225 AvahiLookupFlags flags,
226 AvahiHostNameResolverCallback callback,
229 /** Get the parent client of an AvahiHostNameResolver object */
230 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
232 /** Free a hostname resolver object */
233 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
235 /** Create a new address resolver object from an AvahiAddress object */
236 AvahiAddressResolver* avahi_address_resolver_new(
238 AvahiIfIndex interface,
239 AvahiProtocol protocol,
240 const AvahiAddress *a,
241 AvahiLookupFlags flags,
242 AvahiAddressResolverCallback callback,
245 /** Get the parent client of an AvahiAddressResolver object */
246 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
248 /** Free a AvahiAddressResolver resolver object */
249 int avahi_address_resolver_free(AvahiAddressResolver *r);
251 /** Browse for records of a type on the local network */
252 AvahiRecordBrowser* avahi_record_browser_new(
254 AvahiIfIndex interface,
255 AvahiProtocol protocol,
259 AvahiLookupFlags flags,
260 AvahiRecordBrowserCallback callback,
263 /** Get the parent client of an AvahiRecordBrowser object */
264 AvahiClient* avahi_record_browser_get_client(AvahiRecordBrowser *);
266 /** Cleans up and frees an AvahiRecordBrowser object */
267 int avahi_record_browser_free(AvahiRecordBrowser *);