]> git.meshlink.io Git - catta/blob - avahi-client/lookup.h
Doxygen documentation cleanups:
[catta] / avahi-client / lookup.h
1 #ifndef fooclientlookuphfoo
2 #define fooclientlookuphfoo
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 #include <inttypes.h>
26
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>
33
34 #include <avahi-client/client.h>
35
36 /** \file avahi-client/lookup.h Lookup Client API */
37
38 /** \example client-browse-services.c Example how to browse for DNS-SD
39  * services using the client interface to avahi-daemon. */
40
41 AVAHI_C_DECL_BEGIN
42
43 /** @{ \name Domain Browser */
44
45 /** A domain browser object */
46 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
47
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,
54     const char *domain,
55     AvahiLookupResultFlags flags,
56     void *userdata);
57
58 /** Browse for domains on the local network */
59 AvahiDomainBrowser* avahi_domain_browser_new (
60     AvahiClient *client,
61     AvahiIfIndex interface,
62     AvahiProtocol protocol,
63     const char *domain,
64     AvahiDomainBrowserType btype,
65     AvahiLookupFlags flags,
66     AvahiDomainBrowserCallback callback,
67     void *userdata);
68
69 /** Get the parent client of an AvahiDomainBrowser object */
70 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
71
72 /** Cleans up and frees an AvahiDomainBrowser object */
73 int avahi_domain_browser_free (AvahiDomainBrowser *);
74
75 /** @} */
76
77 /** @{ \name Service Browser */
78
79 /** A service browser object */
80 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
81
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,
88     const char *name,
89     const char *type,
90     const char *domain,
91     AvahiLookupResultFlags flags,
92     void *userdata);
93
94 /** Browse for services of a type on the local network */
95 AvahiServiceBrowser* avahi_service_browser_new (
96     AvahiClient *client,
97     AvahiIfIndex interface,
98     AvahiProtocol protocol,
99     const char *type,
100     const char *domain,
101     AvahiLookupFlags flags,
102     AvahiServiceBrowserCallback callback,
103     void *userdata);
104
105 /** Get the parent client of an AvahiServiceBrowser object */
106 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
107
108 /** Cleans up and frees an AvahiServiceBrowser object */
109 int avahi_service_browser_free (AvahiServiceBrowser *);
110
111 /** @} */
112
113 /** \cond fulldocs */
114 /** A service type browser object */
115 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
116
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,
123     const char *type,
124     const char *domain,
125     AvahiLookupResultFlags flags,
126     void *userdata);
127
128 /** Browse for service types on the local network */
129 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
130     AvahiClient *client,
131     AvahiIfIndex interface,
132     AvahiProtocol protocol,
133     const char *domain,
134     AvahiLookupFlags flags,
135     AvahiServiceTypeBrowserCallback callback,
136     void *userdata);
137
138 /** Get the parent client of an AvahiServiceTypeBrowser object */
139 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
140
141 /** Cleans up and frees an AvahiServiceTypeBrowser object */
142 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
143
144 /** \endcond */
145
146 /** @{ \name Service Resolver */
147
148 /** A service resolver object */
149 typedef struct AvahiServiceResolver AvahiServiceResolver;
150
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,
157     const char *name,
158     const char *type,
159     const char *domain,
160     const char *host_name,
161     const AvahiAddress *a,
162     uint16_t port,
163     AvahiStringList *txt,
164     AvahiLookupResultFlags flags, 
165     void *userdata);
166
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(
171     AvahiClient *client,
172     AvahiIfIndex interface,
173     AvahiProtocol protocol,
174     const char *name,
175     const char *type,
176     const char *domain,
177     AvahiProtocol aprotocol,
178     AvahiLookupFlags flags,
179     AvahiServiceResolverCallback callback,
180     void *userdata);
181
182 /** Get the parent client of an AvahiServiceResolver object */
183 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
184
185 /** Free a service resolver object */
186 int avahi_service_resolver_free(AvahiServiceResolver *r);
187
188 /** @} */
189
190 /** \cond fulldocs */
191 /** A service resolver object */
192 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
193
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,
200     const char *name,
201     const AvahiAddress *a,
202     AvahiLookupResultFlags flags, 
203     void *userdata);
204
205 /** Create a new hostname resolver object */
206 AvahiHostNameResolver * avahi_host_name_resolver_new(
207     AvahiClient *client,
208     AvahiIfIndex interface,
209     AvahiProtocol protocol,
210     const char *name,
211     AvahiProtocol aprotocol,
212     AvahiLookupFlags flags,
213     AvahiHostNameResolverCallback callback,
214     void *userdata);
215
216 /** Get the parent client of an AvahiHostNameResolver object */
217 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
218
219 /** Free a hostname resolver object */
220 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
221
222 /** An address resolver object */
223 typedef struct AvahiAddressResolver AvahiAddressResolver;
224
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,
232     const char *name,
233     AvahiLookupResultFlags flags, 
234     void *userdata);
235
236 /** Create a new address resolver object from an AvahiAddress object */
237 AvahiAddressResolver* avahi_address_resolver_new(
238     AvahiClient *client,
239     AvahiIfIndex interface,
240     AvahiProtocol protocol,
241     const AvahiAddress *a,
242     AvahiLookupFlags flags,
243     AvahiAddressResolverCallback callback,
244     void *userdata);
245
246 /** Get the parent client of an AvahiAddressResolver object */
247 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
248
249 /** Free a AvahiAddressResolver resolver object */
250 int avahi_address_resolver_free(AvahiAddressResolver *r);
251
252 /** \endcond */
253
254 /** @{ \name Record Browser */
255
256 /** A record browser object */
257 typedef struct AvahiRecordBrowser AvahiRecordBrowser;
258
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,
265     const char *name,
266     uint16_t clazz,
267     uint16_t type,
268     const void *rdata,
269     size_t size,
270     AvahiLookupResultFlags flags,
271     void *userdata);
272
273 /** Browse for records of a type on the local network */
274 AvahiRecordBrowser* avahi_record_browser_new(
275     AvahiClient *client,
276     AvahiIfIndex interface,
277     AvahiProtocol protocol,
278     const char *name,
279     uint16_t clazz,
280     uint16_t type,
281     AvahiLookupFlags flags,
282     AvahiRecordBrowserCallback callback,
283     void *userdata);
284
285 /** Get the parent client of an AvahiRecordBrowser object */
286 AvahiClient* avahi_record_browser_get_client(AvahiRecordBrowser *);
287
288 /** Cleans up and frees an AvahiRecordBrowser object */
289 int avahi_record_browser_free(AvahiRecordBrowser *);
290
291 /** @} */
292
293 AVAHI_C_DECL_END
294
295 #endif