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. */
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 /** A domain browser object */
46 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
48 /** A service browser object */
49 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
51 /** A service type browser object */
52 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
54 /** A service resolver object */
55 typedef struct AvahiServiceResolver AvahiServiceResolver;
57 /** A service resolver object */
58 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
60 /** An address resolver object */
61 typedef struct AvahiAddressResolver AvahiAddressResolver;
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);
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);
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);
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,
81 const char *host_name,
82 const AvahiAddress *a,
85 AvahiLookupResultFlags flags,
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,
95 const AvahiAddress *a,
96 AvahiLookupResultFlags flags,
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,
107 AvahiLookupResultFlags flags,
110 /** Browse for domains on the local network */
111 AvahiDomainBrowser* avahi_domain_browser_new (
113 AvahiIfIndex interface,
114 AvahiProtocol protocol,
116 AvahiDomainBrowserType btype,
117 AvahiLookupFlags flags,
118 AvahiDomainBrowserCallback callback,
121 /** Get the parent client of an AvahiDomainBrowser object */
122 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
124 /** Cleans up and frees an AvahiDomainBrowser object */
125 int avahi_domain_browser_free (AvahiDomainBrowser *);
127 /** Browse for service types on the local network */
128 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
130 AvahiIfIndex interface,
131 AvahiProtocol protocol,
133 AvahiLookupFlags flags,
134 AvahiServiceTypeBrowserCallback callback,
137 /** Get the parent client of an AvahiServiceTypeBrowser object */
138 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
140 /** Cleans up and frees an AvahiServiceTypeBrowser object */
141 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
143 /** Browse for services of a type on the local network */
144 AvahiServiceBrowser* avahi_service_browser_new (
146 AvahiIfIndex interface,
147 AvahiProtocol protocol,
150 AvahiLookupFlags flags,
151 AvahiServiceBrowserCallback callback,
154 /** Get the parent client of an AvahiServiceBrowser object */
155 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
157 /* Cleans up and frees an AvahiServiceBrowser object */
158 int avahi_service_browser_free (AvahiServiceBrowser *);
160 /** Create a new service resolver object */
161 AvahiServiceResolver * avahi_service_resolver_new(
163 AvahiIfIndex interface,
164 AvahiProtocol protocol,
168 AvahiProtocol aprotocol,
169 AvahiLookupFlags flags,
170 AvahiServiceResolverCallback callback,
173 /** Get the parent client of an AvahiServiceResolver object */
174 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
176 /** Free a service resolver object */
177 int avahi_service_resolver_free(AvahiServiceResolver *r);
179 /** Create a new hostname resolver object */
180 AvahiHostNameResolver * avahi_host_name_resolver_new(
182 AvahiIfIndex interface,
183 AvahiProtocol protocol,
185 AvahiProtocol aprotocol,
186 AvahiLookupFlags flags,
187 AvahiHostNameResolverCallback callback,
190 /** Get the parent client of an AvahiHostNameResolver object */
191 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
193 /** Free a hostname resolver object */
194 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
196 /** Create a new address resolver object from an AvahiAddress object */
197 AvahiAddressResolver* avahi_address_resolver_new(
199 AvahiIfIndex interface,
200 AvahiProtocol protocol,
201 const AvahiAddress *a,
202 AvahiLookupFlags flags,
203 AvahiAddressResolverCallback callback,
206 /** Get the parent client of an AvahiAddressResolver object */
207 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
209 /** Free a AvahiAddressResolver resolver object */
210 int avahi_address_resolver_free(AvahiAddressResolver *r);
212 #ifndef DOXYGEN_SHOULD_SKIP_THIS