]> git.meshlink.io Git - catta/blob - avahi-client/lookup.h
* split client.h into client.h, lookup.h and publish.h just like we did on the server...
[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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
42 AVAHI_C_DECL_BEGIN
43 #endif
44
45 /** A domain browser object */
46 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
47
48 /** A service browser object */
49 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
50
51 /** A service type browser object */
52 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
53
54 /** A service resolver object */
55 typedef struct AvahiServiceResolver AvahiServiceResolver;
56
57 /** A service resolver object */
58 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
59
60 /** An address resolver object */
61 typedef struct AvahiAddressResolver AvahiAddressResolver;
62
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);
65
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);
68
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);
71
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,
78     const char *name,
79     const char *type,
80     const char *domain,
81     const char *host_name,
82     const AvahiAddress *a,
83     uint16_t port,
84     AvahiStringList *txt,
85     AvahiLookupResultFlags flags, 
86     void *userdata);
87
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,
94     const char *name,
95     const AvahiAddress *a,
96     AvahiLookupResultFlags flags, 
97     void *userdata);
98
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,
107     const char *name,
108     AvahiLookupResultFlags flags, 
109     void *userdata);
110
111
112 /** Browse for domains on the local network */
113 AvahiDomainBrowser* avahi_domain_browser_new (
114     AvahiClient *client,
115     AvahiIfIndex interface,
116     AvahiProtocol protocol,
117     const char *domain,
118     AvahiDomainBrowserType btype,
119     AvahiLookupFlags flags,
120     AvahiDomainBrowserCallback callback,
121     void *userdata);
122
123 /** Get the parent client of an AvahiDomainBrowser object */
124 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
125
126 /** Cleans up and frees an AvahiDomainBrowser object */
127 int avahi_domain_browser_free (AvahiDomainBrowser *);
128
129 /** Browse for service types on the local network */
130 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
131     AvahiClient *client,
132     AvahiIfIndex interface,
133     AvahiProtocol protocol,
134     const char *domain,
135     AvahiLookupFlags flags,
136     AvahiServiceTypeBrowserCallback callback,
137     void *userdata);
138
139 /** Get the parent client of an AvahiServiceTypeBrowser object */
140 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
141
142 /** Cleans up and frees an AvahiServiceTypeBrowser object */
143 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
144
145 /** Browse for services of a type on the local network */
146 AvahiServiceBrowser* avahi_service_browser_new (
147     AvahiClient *client,
148     AvahiIfIndex interface,
149     AvahiProtocol protocol,
150     const char *type,
151     const char *domain,
152     AvahiLookupFlags flags,
153     AvahiServiceBrowserCallback callback,
154     void *userdata);
155
156 /** Get the parent client of an AvahiServiceBrowser object */
157 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
158
159 /* Cleans up and frees an AvahiServiceBrowser object */
160 int avahi_service_browser_free (AvahiServiceBrowser *);
161
162 /** Create a new service resolver object */
163 AvahiServiceResolver * avahi_service_resolver_new(
164     AvahiClient *client,
165     AvahiIfIndex interface,
166     AvahiProtocol protocol,
167     const char *name,
168     const char *type,
169     const char *domain,
170     AvahiProtocol aprotocol,
171     AvahiLookupFlags flags,
172     AvahiServiceResolverCallback callback,
173     void *userdata);
174
175 /** Get the parent client of an AvahiServiceResolver object */
176 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
177
178 /** Free a service resolver object */
179 int avahi_service_resolver_free(AvahiServiceResolver *r);
180
181 /** Create a new hostname resolver object */
182 AvahiHostNameResolver * avahi_host_name_resolver_new(
183     AvahiClient *client,
184     AvahiIfIndex interface,
185     AvahiProtocol protocol,
186     const char *name,
187     AvahiProtocol aprotocol,
188     AvahiLookupFlags flags,
189     AvahiHostNameResolverCallback callback,
190     void *userdata);
191
192 /** Get the parent client of an AvahiHostNameResolver object */
193 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
194
195 /** Free a hostname resolver object */
196 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
197
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(
200     AvahiClient *client,
201     AvahiIfIndex interface,
202     AvahiProtocol protocol,
203     const char *address,
204     AvahiLookupFlags flags,
205     AvahiAddressResolverCallback callback,
206     void *userdata);
207
208 /** Create a new address resolver object from an AvahiAddress object */
209 AvahiAddressResolver* avahi_address_resolver_new_a(
210     AvahiClient *client,
211     AvahiIfIndex interface,
212     AvahiProtocol protocol,
213     const AvahiAddress *a,
214     AvahiLookupFlags flags,
215     AvahiAddressResolverCallback callback,
216     void *userdata);
217
218 /** Get the parent client of an AvahiAddressResolver object */
219 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
220
221 /** Free a AvahiAddressResolver resolver object */
222 int avahi_address_resolver_free(AvahiAddressResolver *r);
223
224 #ifndef DOXYGEN_SHOULD_SKIP_THIS
225 AVAHI_C_DECL_END
226 #endif
227
228
229 #endif