From 4743c6236a42978862fa6cf3fa95e40c04fcbd5e Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Fri, 26 Aug 2005 19:16:10 +0000 Subject: * Implement AddressResolver in the avahi-client C api * Small fix to the HostNameResolver git-svn-id: file:///home/lennart/svn/public/avahi/trunk@450 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/client.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'avahi-client/client.h') diff --git a/avahi-client/client.h b/avahi-client/client.h index 4db2aef..c544c44 100644 --- a/avahi-client/client.h +++ b/avahi-client/client.h @@ -69,6 +69,9 @@ typedef struct AvahiServiceResolver AvahiServiceResolver; /** A service resolver object */ typedef struct AvahiHostNameResolver AvahiHostNameResolver; +/** An address resolver object */ +typedef struct AvahiAddressResolver AvahiAddressResolver; + /** States of a client object, a superset of AvahiServerState */ typedef enum { AVAHI_CLIENT_S_INVALID = AVAHI_SERVER_INVALID, @@ -118,6 +121,17 @@ typedef void (*AvahiHostNameResolverCallback) ( const AvahiAddress *a, void *userdata); +/** The function prototype for the callback of an AvahiAddressResolver */ +typedef void (*AvahiAddressResolverCallback) ( + AvahiAddressResolver *r, + AvahiIfIndex interface, + AvahiProtocol protocol, + AvahiResolverEvent event, + AvahiProtocol aprotocol, + const AvahiAddress *a, + const char *name, + void *userdata); + /** Creates a new client instance */ AvahiClient* avahi_client_new (const AvahiPoll *poll_api, AvahiClientCallback callback, void *userdata, int *error); @@ -297,6 +311,32 @@ int avahi_host_name_resolver_free(AvahiHostNameResolver *r); /** Block until the resolving is complete */ int avahi_host_name_resolver_block(AvahiHostNameResolver *r); +/** Create a new address resolver object from an address string. Set protocol to AF_UNSPEC for protocol detection. */ +AvahiAddressResolver * avahi_address_resolver_new( + AvahiClient *client, + AvahiIfIndex interface, + AvahiProtocol protocol, + const char *address, + AvahiAddressResolverCallback callback, + void *userdata); + +/** Create a new address resolver object from an AvahiAddress object */ +AvahiAddressResolver* avahi_address_resolver_new_a( + AvahiClient *client, + AvahiIfIndex interface, + const AvahiAddress *a, + AvahiAddressResolverCallback callback, + void *userdata); + +/** Get the parent client of an AvahiAddressResolver object */ +AvahiClient* avahi_address_resolver_get_client (AvahiAddressResolver *); + +/** Free a AvahiAddressResolver resolver object */ +int avahi_address_resolver_free(AvahiAddressResolver *r); + +/** Block until the resolving is complete */ +int avahi_address_resolver_block(AvahiAddressResolver *r); + #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END #endif -- cgit