]> git.meshlink.io Git - catta/blob - avahi-client/lookup.h
89d1fb248839075a955180edb317b18507e4e3e8
[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 /** A domain browser object */
44 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
45
46 /** A service browser object */
47 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
48
49 /** A service type browser object */
50 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
51
52 /** A service resolver object */
53 typedef struct AvahiServiceResolver AvahiServiceResolver;
54
55 /** A service resolver object */
56 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
57
58 /** An address resolver object */
59 typedef struct AvahiAddressResolver AvahiAddressResolver;
60
61 /** A record browser object */
62 typedef struct AvahiRecordBrowser AvahiRecordBrowser;
63
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,
70     const char *domain,
71     AvahiLookupResultFlags flags,
72     void *userdata);
73
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,
80     const char *name,
81     const char *type,
82     const char *domain,
83     AvahiLookupResultFlags flags,
84     void *userdata);
85
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,
92     const char *type,
93     const char *domain,
94     AvahiLookupResultFlags flags,
95     void *userdata);
96
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,
103     const char *name,
104     const char *type,
105     const char *domain,
106     const char *host_name,
107     const AvahiAddress *a,
108     uint16_t port,
109     AvahiStringList *txt,
110     AvahiLookupResultFlags flags, 
111     void *userdata);
112
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,
119     const char *name,
120     const AvahiAddress *a,
121     AvahiLookupResultFlags flags, 
122     void *userdata);
123
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,
131     const char *name,
132     AvahiLookupResultFlags flags, 
133     void *userdata);
134
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,
141     const char *name,
142     uint16_t clazz,
143     uint16_t type,
144     const void *rdata,
145     size_t size,
146     AvahiLookupResultFlags flags,
147     void *userdata);
148
149 /** Browse for domains on the local network */
150 AvahiDomainBrowser* avahi_domain_browser_new (
151     AvahiClient *client,
152     AvahiIfIndex interface,
153     AvahiProtocol protocol,
154     const char *domain,
155     AvahiDomainBrowserType btype,
156     AvahiLookupFlags flags,
157     AvahiDomainBrowserCallback callback,
158     void *userdata);
159
160 /** Get the parent client of an AvahiDomainBrowser object */
161 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
162
163 /** Cleans up and frees an AvahiDomainBrowser object */
164 int avahi_domain_browser_free (AvahiDomainBrowser *);
165
166 /** Browse for service types on the local network */
167 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
168     AvahiClient *client,
169     AvahiIfIndex interface,
170     AvahiProtocol protocol,
171     const char *domain,
172     AvahiLookupFlags flags,
173     AvahiServiceTypeBrowserCallback callback,
174     void *userdata);
175
176 /** Get the parent client of an AvahiServiceTypeBrowser object */
177 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
178
179 /** Cleans up and frees an AvahiServiceTypeBrowser object */
180 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
181
182 /** Browse for services of a type on the local network */
183 AvahiServiceBrowser* avahi_service_browser_new (
184     AvahiClient *client,
185     AvahiIfIndex interface,
186     AvahiProtocol protocol,
187     const char *type,
188     const char *domain,
189     AvahiLookupFlags flags,
190     AvahiServiceBrowserCallback callback,
191     void *userdata);
192
193 /** Get the parent client of an AvahiServiceBrowser object */
194 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
195
196 /** Cleans up and frees an AvahiServiceBrowser object */
197 int avahi_service_browser_free (AvahiServiceBrowser *);
198
199 /** Create a new service resolver object */
200 AvahiServiceResolver * avahi_service_resolver_new(
201     AvahiClient *client,
202     AvahiIfIndex interface,
203     AvahiProtocol protocol,
204     const char *name,
205     const char *type,
206     const char *domain,
207     AvahiProtocol aprotocol,
208     AvahiLookupFlags flags,
209     AvahiServiceResolverCallback callback,
210     void *userdata);
211
212 /** Get the parent client of an AvahiServiceResolver object */
213 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
214
215 /** Free a service resolver object */
216 int avahi_service_resolver_free(AvahiServiceResolver *r);
217
218 /** Create a new hostname resolver object */
219 AvahiHostNameResolver * avahi_host_name_resolver_new(
220     AvahiClient *client,
221     AvahiIfIndex interface,
222     AvahiProtocol protocol,
223     const char *name,
224     AvahiProtocol aprotocol,
225     AvahiLookupFlags flags,
226     AvahiHostNameResolverCallback callback,
227     void *userdata);
228
229 /** Get the parent client of an AvahiHostNameResolver object */
230 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
231
232 /** Free a hostname resolver object */
233 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
234
235 /** Create a new address resolver object from an AvahiAddress object */
236 AvahiAddressResolver* avahi_address_resolver_new(
237     AvahiClient *client,
238     AvahiIfIndex interface,
239     AvahiProtocol protocol,
240     const AvahiAddress *a,
241     AvahiLookupFlags flags,
242     AvahiAddressResolverCallback callback,
243     void *userdata);
244
245 /** Get the parent client of an AvahiAddressResolver object */
246 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
247
248 /** Free a AvahiAddressResolver resolver object */
249 int avahi_address_resolver_free(AvahiAddressResolver *r);
250
251 /** Browse for records of a type on the local network */
252 AvahiRecordBrowser* avahi_record_browser_new(
253     AvahiClient *client,
254     AvahiIfIndex interface,
255     AvahiProtocol protocol,
256     const char *name,
257     uint16_t clazz,
258     uint16_t type,
259     AvahiLookupFlags flags,
260     AvahiRecordBrowserCallback callback,
261     void *userdata);
262
263 /** Get the parent client of an AvahiRecordBrowser object */
264 AvahiClient* avahi_record_browser_get_client(AvahiRecordBrowser *);
265
266 /** Cleans up and frees an AvahiRecordBrowser object */
267 int avahi_record_browser_free(AvahiRecordBrowser *);
268
269 AVAHI_C_DECL_END
270
271 #endif