avahi-client/lookup.h File Reference

Lookup Client API. More...

#include <inttypes.h>
#include <avahi-common/cdecl.h>
#include <avahi-common/address.h>
#include <avahi-common/strlst.h>
#include <avahi-common/defs.h>
#include <avahi-common/watch.h>
#include <avahi-common/gccmacro.h>
#include <avahi-client/client.h>

Go to the source code of this file.


Detailed Description

Lookup Client API.

Definition in file lookup.h.


Typedef Documentation

A domain browser object.

Definition at line 46 of file lookup.h.

typedef 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 at line 49 of file lookup.h.

A record browser object.

Definition at line 278 of file lookup.h.

typedef 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 at line 281 of file lookup.h.

A service browser object.

Examples:
client-browse-services.c.

Definition at line 80 of file lookup.h.

typedef 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 at line 83 of file lookup.h.

A service resolver object.

Examples:
client-browse-services.c.

Definition at line 159 of file lookup.h.

typedef 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 at line 162 of file lookup.h.


Function Documentation

int avahi_domain_browser_free ( AvahiDomainBrowser  ) 

Cleans up and frees an AvahiDomainBrowser object.

AvahiClient* avahi_domain_browser_get_client ( AvahiDomainBrowser  ) 

Get the parent client of an AvahiDomainBrowser 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.

int avahi_record_browser_free ( AvahiRecordBrowser  ) 

Cleans up and frees an AvahiRecordBrowser object.

AvahiClient* avahi_record_browser_get_client ( AvahiRecordBrowser  ) 

Get the parent client of an AvahiRecordBrowser object.

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.

int avahi_service_browser_free ( AvahiServiceBrowser  ) 

Cleans up and frees an AvahiServiceBrowser object.

Examples:
client-browse-services.c.

AvahiClient* avahi_service_browser_get_client ( AvahiServiceBrowser  ) 

Get the parent client of an AvahiServiceBrowser object.

Examples:
client-browse-services.c.

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.

In most cases you probably want to pass AVAHI_IF_UNSPEC and AVAHI_PROTO_UNSPED in interface, resp. protocol to browse on all local networks. The specified callback will be called whenever a new service appears or is removed from the network. Please note that events may be collapsed to minimize traffic (i.e. a REMOVED followed by a NEW for the same service data is dropped because redundant). If you want to subscribe to service data changes, you should use avahi_service_resolver_new() and keep it open, in which case you will be notified via AVAHI_RESOLVE_FOUND everytime the service data changes.

Parameters:
interface  In most cases pass AVAHI_IF_UNSPEC here
protocol  In most cases pass AVAHI_PROTO_UNSPEC here
type  A service type such as "_http._tcp"
domain  A domain to browse in. In most cases you want to pass NULL here for the default domain (usually ".local")
Examples:
client-browse-services.c.

int avahi_service_resolver_free ( AvahiServiceResolver r  ) 

Free a service resolver object.

Examples:
client-browse-services.c.

AvahiClient* avahi_service_resolver_get_client ( AvahiServiceResolver  ) 

Get the parent client of an AvahiServiceResolver object.

Examples:
client-browse-services.c.

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.

Please make sure to pass all the service data you received via avahi_service_browser_new()'s callback function, especially interface and protocol. The protocol argument specifies the protocol (IPv4 or IPv6) to use as transport for the queries which are sent out by this resolver. The aprotocol argument specifies the adress family (IPv4 or IPv6) of the address of the service we are looking for. Generally, on "protocol" you should only pass what was supplied to you as parameter to your AvahiServiceBrowserCallback. In "aprotocol" you should pass what your application code can deal with when connecting to the service. Or, more technically speaking: protocol specifies if the mDNS queries should be sent as UDP/IPv4 resp. UDP/IPv6 packets. aprotocol specifies whether the query is for a A resp. AAAA resource record.

Parameters:
interface  Pass the interface argument you recieved in AvahiServiceBrowserCallback here.
protocol  Pass the protocol argument you recieved in AvahiServiceBrowserCallback here.
name  Pass the name argument you recieved in AvahiServiceBrowserCallback here.
type  Pass the type argument you recieved in AvahiServiceBrowserCallback here.
domain  Pass the domain argument you recieved in AvahiServiceBrowserCallback here.
aprotocol  The desired address family of the service address to resolve. AVAHI_PROTO_UNSPEC if your application can deal with both IPv4 and IPv6
Examples:
client-browse-services.c.


Generated on Fri Dec 12 22:23:40 2008 for avahi by  doxygen 1.5.7.1