]> git.meshlink.io Git - catta/blob - avahi-client/lookup.h
in order to reduce our API size, dropping avahi_entry_group_add_service_va(), avahi_e...
[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     const AvahiAddress *a,
106     const char *name,
107     AvahiLookupResultFlags flags, 
108     void *userdata);
109
110 /** Browse for domains on the local network */
111 AvahiDomainBrowser* avahi_domain_browser_new (
112     AvahiClient *client,
113     AvahiIfIndex interface,
114     AvahiProtocol protocol,
115     const char *domain,
116     AvahiDomainBrowserType btype,
117     AvahiLookupFlags flags,
118     AvahiDomainBrowserCallback callback,
119     void *userdata);
120
121 /** Get the parent client of an AvahiDomainBrowser object */
122 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
123
124 /** Cleans up and frees an AvahiDomainBrowser object */
125 int avahi_domain_browser_free (AvahiDomainBrowser *);
126
127 /** Browse for service types on the local network */
128 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
129     AvahiClient *client,
130     AvahiIfIndex interface,
131     AvahiProtocol protocol,
132     const char *domain,
133     AvahiLookupFlags flags,
134     AvahiServiceTypeBrowserCallback callback,
135     void *userdata);
136
137 /** Get the parent client of an AvahiServiceTypeBrowser object */
138 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
139
140 /** Cleans up and frees an AvahiServiceTypeBrowser object */
141 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
142
143 /** Browse for services of a type on the local network */
144 AvahiServiceBrowser* avahi_service_browser_new (
145     AvahiClient *client,
146     AvahiIfIndex interface,
147     AvahiProtocol protocol,
148     const char *type,
149     const char *domain,
150     AvahiLookupFlags flags,
151     AvahiServiceBrowserCallback callback,
152     void *userdata);
153
154 /** Get the parent client of an AvahiServiceBrowser object */
155 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
156
157 /* Cleans up and frees an AvahiServiceBrowser object */
158 int avahi_service_browser_free (AvahiServiceBrowser *);
159
160 /** Create a new service resolver object */
161 AvahiServiceResolver * avahi_service_resolver_new(
162     AvahiClient *client,
163     AvahiIfIndex interface,
164     AvahiProtocol protocol,
165     const char *name,
166     const char *type,
167     const char *domain,
168     AvahiProtocol aprotocol,
169     AvahiLookupFlags flags,
170     AvahiServiceResolverCallback callback,
171     void *userdata);
172
173 /** Get the parent client of an AvahiServiceResolver object */
174 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
175
176 /** Free a service resolver object */
177 int avahi_service_resolver_free(AvahiServiceResolver *r);
178
179 /** Create a new hostname resolver object */
180 AvahiHostNameResolver * avahi_host_name_resolver_new(
181     AvahiClient *client,
182     AvahiIfIndex interface,
183     AvahiProtocol protocol,
184     const char *name,
185     AvahiProtocol aprotocol,
186     AvahiLookupFlags flags,
187     AvahiHostNameResolverCallback callback,
188     void *userdata);
189
190 /** Get the parent client of an AvahiHostNameResolver object */
191 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
192
193 /** Free a hostname resolver object */
194 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
195
196 /** Create a new address resolver object from an AvahiAddress object */
197 AvahiAddressResolver* avahi_address_resolver_new(
198     AvahiClient *client,
199     AvahiIfIndex interface,
200     AvahiProtocol protocol,
201     const AvahiAddress *a,
202     AvahiLookupFlags flags,
203     AvahiAddressResolverCallback callback,
204     void *userdata);
205
206 /** Get the parent client of an AvahiAddressResolver object */
207 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
208
209 /** Free a AvahiAddressResolver resolver object */
210 int avahi_address_resolver_free(AvahiAddressResolver *r);
211
212 #ifndef DOXYGEN_SHOULD_SKIP_THIS
213 AVAHI_C_DECL_END
214 #endif
215
216
217 #endif