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. */
43 /** A domain browser object */
44 typedef struct AvahiDomainBrowser AvahiDomainBrowser;
46 /** A service browser object */
47 typedef struct AvahiServiceBrowser AvahiServiceBrowser;
49 /** A service type browser object */
50 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
52 /** A service resolver object */
53 typedef struct AvahiServiceResolver AvahiServiceResolver;
55 /** A service resolver object */
56 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
58 /** An address resolver object */
59 typedef struct AvahiAddressResolver AvahiAddressResolver;
61 /** The function prototype for the callback of an AvahiDomainBrowser */
62 typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void *userdata);
64 /** The function prototype for the callback of an AvahiServiceBrowser */
65 typedef void (*AvahiServiceBrowserCallback) (AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *userdata);
67 /** The function prototype for the callback of an AvahiServiceTypeBrowser */
68 typedef void (*AvahiServiceTypeBrowserCallback) (AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, AvahiLookupResultFlags flags, void *userdata);
70 /** The function prototype for the callback of an AvahiServiceResolver */
71 typedef void (*AvahiServiceResolverCallback) (
72 AvahiServiceResolver *r,
73 AvahiIfIndex interface,
74 AvahiProtocol protocol,
75 AvahiResolverEvent event,
79 const char *host_name,
80 const AvahiAddress *a,
83 AvahiLookupResultFlags flags,
86 /** The function prototype for the callback of an AvahiHostNameResolver */
87 typedef void (*AvahiHostNameResolverCallback) (
88 AvahiHostNameResolver *r,
89 AvahiIfIndex interface,
90 AvahiProtocol protocol,
91 AvahiResolverEvent event,
93 const AvahiAddress *a,
94 AvahiLookupResultFlags flags,
97 /** The function prototype for the callback of an AvahiAddressResolver */
98 typedef void (*AvahiAddressResolverCallback) (
99 AvahiAddressResolver *r,
100 AvahiIfIndex interface,
101 AvahiProtocol protocol,
102 AvahiResolverEvent event,
103 const AvahiAddress *a,
105 AvahiLookupResultFlags flags,
108 /** Browse for domains on the local network */
109 AvahiDomainBrowser* avahi_domain_browser_new (
111 AvahiIfIndex interface,
112 AvahiProtocol protocol,
114 AvahiDomainBrowserType btype,
115 AvahiLookupFlags flags,
116 AvahiDomainBrowserCallback callback,
119 /** Get the parent client of an AvahiDomainBrowser object */
120 AvahiClient* avahi_domain_browser_get_client (AvahiDomainBrowser *);
122 /** Cleans up and frees an AvahiDomainBrowser object */
123 int avahi_domain_browser_free (AvahiDomainBrowser *);
125 /** Browse for service types on the local network */
126 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
128 AvahiIfIndex interface,
129 AvahiProtocol protocol,
131 AvahiLookupFlags flags,
132 AvahiServiceTypeBrowserCallback callback,
135 /** Get the parent client of an AvahiServiceTypeBrowser object */
136 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
138 /** Cleans up and frees an AvahiServiceTypeBrowser object */
139 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
141 /** Browse for services of a type on the local network */
142 AvahiServiceBrowser* avahi_service_browser_new (
144 AvahiIfIndex interface,
145 AvahiProtocol protocol,
148 AvahiLookupFlags flags,
149 AvahiServiceBrowserCallback callback,
152 /** Get the parent client of an AvahiServiceBrowser object */
153 AvahiClient* avahi_service_browser_get_client (AvahiServiceBrowser *);
155 /* Cleans up and frees an AvahiServiceBrowser object */
156 int avahi_service_browser_free (AvahiServiceBrowser *);
158 /** Create a new service resolver object */
159 AvahiServiceResolver * avahi_service_resolver_new(
161 AvahiIfIndex interface,
162 AvahiProtocol protocol,
166 AvahiProtocol aprotocol,
167 AvahiLookupFlags flags,
168 AvahiServiceResolverCallback callback,
171 /** Get the parent client of an AvahiServiceResolver object */
172 AvahiClient* avahi_service_resolver_get_client (AvahiServiceResolver *);
174 /** Free a service resolver object */
175 int avahi_service_resolver_free(AvahiServiceResolver *r);
177 /** Create a new hostname resolver object */
178 AvahiHostNameResolver * avahi_host_name_resolver_new(
180 AvahiIfIndex interface,
181 AvahiProtocol protocol,
183 AvahiProtocol aprotocol,
184 AvahiLookupFlags flags,
185 AvahiHostNameResolverCallback callback,
188 /** Get the parent client of an AvahiHostNameResolver object */
189 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
191 /** Free a hostname resolver object */
192 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
194 /** Create a new address resolver object from an AvahiAddress object */
195 AvahiAddressResolver* avahi_address_resolver_new(
197 AvahiIfIndex interface,
198 AvahiProtocol protocol,
199 const AvahiAddress *a,
200 AvahiLookupFlags flags,
201 AvahiAddressResolverCallback callback,
204 /** Get the parent client of an AvahiAddressResolver object */
205 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
207 /** Free a AvahiAddressResolver resolver object */
208 int avahi_address_resolver_free(AvahiAddressResolver *r);