avahi  0.7
lookup.h
Go to the documentation of this file.
1 #ifndef fooclientlookuphfoo
2 #define fooclientlookuphfoo
3 
4 /***
5  This file is part of avahi.
6 
7  avahi is free software; you can redistribute it and/or modify it
8  under the terms of the GNU Lesser General Public License as
9  published by the Free Software Foundation; either version 2.1 of the
10  License, or (at your option) any later version.
11 
12  avahi is distributed in the hope that it will be useful, but WITHOUT
13  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15  Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with avahi; if not, write to the Free Software
19  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  USA.
21 ***/
22 
23 #include <inttypes.h>
24 
25 #include <avahi-common/cdecl.h>
26 #include <avahi-common/address.h>
27 #include <avahi-common/strlst.h>
28 #include <avahi-common/defs.h>
29 #include <avahi-common/watch.h>
30 #include <avahi-common/gccmacro.h>
31 
32 #include <avahi-client/client.h>
33 
39 AVAHI_C_DECL_BEGIN
40 
45 
47 typedef void (*AvahiDomainBrowserCallback) (
49  AvahiIfIndex interface,
50  AvahiProtocol protocol,
51  AvahiBrowserEvent event,
52  const char *domain,
54  void *userdata);
55 
58  AvahiClient *client,
59  AvahiIfIndex interface,
60  AvahiProtocol protocol,
61  const char *domain,
63  AvahiLookupFlags flags,
65  void *userdata);
66 
69 
72 
79 
81 typedef void (*AvahiServiceBrowserCallback) (
83  AvahiIfIndex interface,
84  AvahiProtocol protocol,
85  AvahiBrowserEvent event,
86  const char *name,
87  const char *type,
88  const char *domain,
90  void *userdata);
91 
104  AvahiClient *client,
105  AvahiIfIndex interface,
106  AvahiProtocol protocol,
107  const char *type,
108  const char *domain,
109  AvahiLookupFlags flags,
111  void *userdata);
112 
115 
118 
123 typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser;
124 
126 typedef void (*AvahiServiceTypeBrowserCallback) (
127  AvahiServiceTypeBrowser *b,
128  AvahiIfIndex interface,
129  AvahiProtocol protocol,
130  AvahiBrowserEvent event,
131  const char *type,
132  const char *domain,
134  void *userdata);
135 
137 AvahiServiceTypeBrowser* avahi_service_type_browser_new (
138  AvahiClient *client,
139  AvahiIfIndex interface,
140  AvahiProtocol protocol,
141  const char *domain,
142  AvahiLookupFlags flags,
143  AvahiServiceTypeBrowserCallback callback,
144  void *userdata);
145 
147 AvahiClient* avahi_service_type_browser_get_client (AvahiServiceTypeBrowser *);
148 
150 int avahi_service_type_browser_free (AvahiServiceTypeBrowser *);
151 
158 
162  AvahiIfIndex interface,
163  AvahiProtocol protocol,
164  AvahiResolverEvent event,
165  const char *name,
166  const char *type,
167  const char *domain,
168  const char *host_name,
169  const AvahiAddress *a,
170  uint16_t port,
171  AvahiStringList *txt,
173  void *userdata);
174 
190  AvahiClient *client,
191  AvahiIfIndex interface,
192  AvahiProtocol protocol,
193  const char *name,
194  const char *type,
195  const char *domain,
196  AvahiProtocol aprotocol,
197  AvahiLookupFlags flags,
199  void *userdata);
200 
203 
206 
211 typedef struct AvahiHostNameResolver AvahiHostNameResolver;
212 
214 typedef void (*AvahiHostNameResolverCallback) (
215  AvahiHostNameResolver *r,
216  AvahiIfIndex interface,
217  AvahiProtocol protocol,
218  AvahiResolverEvent event,
219  const char *name,
220  const AvahiAddress *a,
222  void *userdata);
223 
225 AvahiHostNameResolver * avahi_host_name_resolver_new(
226  AvahiClient *client,
227  AvahiIfIndex interface,
228  AvahiProtocol protocol,
229  const char *name,
230  AvahiProtocol aprotocol,
231  AvahiLookupFlags flags,
232  AvahiHostNameResolverCallback callback,
233  void *userdata);
234 
236 AvahiClient* avahi_host_name_resolver_get_client (AvahiHostNameResolver *);
237 
239 int avahi_host_name_resolver_free(AvahiHostNameResolver *r);
240 
242 typedef struct AvahiAddressResolver AvahiAddressResolver;
243 
245 typedef void (*AvahiAddressResolverCallback) (
246  AvahiAddressResolver *r,
247  AvahiIfIndex interface,
248  AvahiProtocol protocol,
249  AvahiResolverEvent event,
250  const AvahiAddress *a,
251  const char *name,
253  void *userdata);
254 
256 AvahiAddressResolver* avahi_address_resolver_new(
257  AvahiClient *client,
258  AvahiIfIndex interface,
259  AvahiProtocol protocol,
260  const AvahiAddress *a,
261  AvahiLookupFlags flags,
262  AvahiAddressResolverCallback callback,
263  void *userdata);
264 
266 AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *);
267 
269 int avahi_address_resolver_free(AvahiAddressResolver *r);
270 
277 
279 typedef void (*AvahiRecordBrowserCallback) (
281  AvahiIfIndex interface,
282  AvahiProtocol protocol,
283  AvahiBrowserEvent event,
284  const char *name,
285  uint16_t clazz,
286  uint16_t type,
287  const void *rdata,
288  size_t size,
290  void *userdata);
291 
294  AvahiClient *client,
295  AvahiIfIndex interface,
296  AvahiProtocol protocol,
297  const char *name,
298  uint16_t clazz,
299  uint16_t type,
300  AvahiLookupFlags flags,
302  void *userdata);
303 
306 
309 
312 AVAHI_C_DECL_END
313 
314 #endif
AvahiResolverEvent
Type of callback event when resolving.
Definition: defs.h:293
struct AvahiClient AvahiClient
A connection context.
Definition: client.h:37
AvahiServiceBrowser * avahi_service_browser_new(AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *type, const char *domain, AvahiLookupFlags flags, AvahiServiceBrowserCallback callback, void *userdata)
Browse for services of a type on the network.
AvahiDomainBrowserType
The type of domain to browse for.
Definition: defs.h:303
AvahiClient * avahi_service_browser_get_client(AvahiServiceBrowser *)
Get the parent client of an AvahiServiceBrowser object.
AvahiDomainBrowser * avahi_domain_browser_new(AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *domain, AvahiDomainBrowserType btype, AvahiLookupFlags flags, AvahiDomainBrowserCallback callback, void *userdata)
Browse for domains on the local network.
struct AvahiServiceBrowser AvahiServiceBrowser
A service browser object.
Definition: lookup.h:78
int AvahiIfIndex
Numeric network interface index.
Definition: address.h:36
Protocol (address family) independent address structure.
Definition: address.h:70
Implementation of a data type to store lists of strings.
Simplistic main loop abstraction.
void(* AvahiRecordBrowserCallback)(AvahiRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, uint16_t clazz, uint16_t type, const void *rdata, size_t size, AvahiLookupResultFlags flags, void *userdata)
The function prototype for the callback of an AvahiRecordBrowser.
Definition: lookup.h:279
int AvahiProtocol
Protocol family specification, takes the values AVAHI_PROTO_INET, AVAHI_PROTO_INET6, AVAHI_PROTO_UNSPEC.
Definition: address.h:33
Some common definitions.
AvahiRecordBrowser * avahi_record_browser_new(AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, uint16_t clazz, uint16_t type, AvahiLookupFlags flags, AvahiRecordBrowserCallback callback, void *userdata)
Browse for records of a type on the local network.
AvahiServiceResolver * avahi_service_resolver_new(AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, const char *name, const char *type, const char *domain, AvahiProtocol aprotocol, AvahiLookupFlags flags, AvahiServiceResolverCallback callback, void *userdata)
Create a new service resolver object.
void(* AvahiServiceBrowserCallback)(AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, AvahiLookupResultFlags flags, void *userdata)
The function prototype for the callback of an AvahiServiceBrowser.
Definition: lookup.h:81
AvahiClient * avahi_record_browser_get_client(AvahiRecordBrowser *)
Get the parent client of an AvahiRecordBrowser object.
AvahiClient * avahi_service_resolver_get_client(AvahiServiceResolver *)
Get the parent client of an AvahiServiceResolver object.
Definitions and functions to manipulate IP addresses.
AvahiClient * avahi_domain_browser_get_client(AvahiDomainBrowser *)
Get the parent client of an AvahiDomainBrowser object.
Linked list of strings that can contain any number of binary characters, including NUL bytes...
Definition: strlst.h:40
int avahi_service_browser_free(AvahiServiceBrowser *)
Cleans up and frees an AvahiServiceBrowser object.
AvahiLookupResultFlags
Some flags for lookup callback functions.
Definition: defs.h:270
int avahi_record_browser_free(AvahiRecordBrowser *)
Cleans up and frees an AvahiRecordBrowser object.
struct AvahiDomainBrowser AvahiDomainBrowser
A domain browser object.
Definition: lookup.h:44
int avahi_domain_browser_free(AvahiDomainBrowser *)
Cleans up and frees an AvahiDomainBrowser object.
void(* AvahiServiceResolverCallback)(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char *name, const char *type, const char *domain, const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt, AvahiLookupResultFlags flags, void *userdata)
The function prototype for the callback of an AvahiServiceResolver.
Definition: lookup.h:160
void(* AvahiDomainBrowserCallback)(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, AvahiLookupResultFlags flags, void *userdata)
The function prototype for the callback of an AvahiDomainBrowser.
Definition: lookup.h:47
struct AvahiRecordBrowser AvahiRecordBrowser
A record browser object.
Definition: lookup.h:276
Definitions and functions for the client API over D-Bus.
AvahiBrowserEvent
Type of callback event when browsing.
Definition: defs.h:284
int avahi_service_resolver_free(AvahiServiceResolver *r)
Free a service resolver object.
AvahiLookupFlags
Some flags for lookup functions.
Definition: defs.h:260
struct AvahiServiceResolver AvahiServiceResolver
A service resolver object.
Definition: lookup.h:157