X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-client%2Fclient.h;h=de6f207207bb56af868126ab6154e061921fe17a;hb=519c8939aa6d436c8ed48bb0f390e9971676928f;hp=4e0676231536c9be14e57ea1b49a7184101796c3;hpb=fde1c3d1a0156f0e06a819cc0958ec077a88c8c6;p=catta diff --git a/avahi-client/client.h b/avahi-client/client.h index 4e06762..de6f207 100644 --- a/avahi-client/client.h +++ b/avahi-client/client.h @@ -22,10 +22,13 @@ USA. ***/ +#include + #include #include #include #include +#include /** \file client.h Definitions and functions for the client API over D-Bus */ @@ -39,6 +42,10 @@ typedef struct _AvahiEntryGroup AvahiEntryGroup; typedef struct _AvahiDomainBrowser AvahiDomainBrowser; +typedef struct _AvahiServiceBrowser AvahiServiceBrowser; + +typedef struct _AvahiServiceTypeBrowser AvahiServiceTypeBrowser; + /** States of a client object, note that AvahiServerStates are also emitted */ typedef enum { AVAHI_CLIENT_DISCONNECTED = 100, /**< Lost DBUS connection to the Avahi daemon */ @@ -52,10 +59,16 @@ typedef void (*AvahiClientCallback) (AvahiClient *s, AvahiClientState state, voi typedef void (*AvahiEntryGroupCallback) (AvahiEntryGroup *g, AvahiEntryGroupState state, void* userdata); /** The function prototype for the callback of an AvahiDomainBrowser */ -typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, char *domain, void *user_data); +typedef void (*AvahiDomainBrowserCallback) (AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *domain, void *user_data); + +/** The function prototype for the callback of an AvahiServiceBrowser */ +typedef void (*AvahiServiceBrowserCallback) (AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *name, const char *type, const char *domain, void *user_data); + +/** The function prototype for the callback of an AvahiServiceTypeBrowser */ +typedef void (*AvahiServiceTypeBrowserCallback) (AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char *type, const char *domain, void *user_data); /** Creates a new client instance */ -AvahiClient* avahi_client_new (AvahiClientCallback callback, void *user_data); +AvahiClient* avahi_client_new (const AvahiPoll *poll_api, AvahiClientCallback callback, void *user_data); /** Get the version of the server */ char* avahi_client_get_version_string (AvahiClient*); @@ -72,6 +85,9 @@ char* avahi_client_get_host_name_fqdn (AvahiClient*); /** Create a new AvahiEntryGroup object */ AvahiEntryGroup* avahi_entry_group_new (AvahiClient*, AvahiEntryGroupCallback callback, void *user_data); +/** Clean up and free an AvahiEntryGroup object */ +int avahi_entry_group_free (AvahiEntryGroup *); + /** Commit an AvahiEntryGroup */ int avahi_entry_group_commit (AvahiEntryGroup*); @@ -79,7 +95,7 @@ int avahi_entry_group_commit (AvahiEntryGroup*); int avahi_entry_group_reset (AvahiEntryGroup*); /** Get an AvahiEntryGroup's state */ -int avahi_entry_group_state (AvahiEntryGroup*); +int avahi_entry_group_get_state (AvahiEntryGroup*); /** Check if an AvahiEntryGroup is empty */ int avahi_entry_group_is_empty (AvahiEntryGroup*); @@ -99,24 +115,58 @@ avahi_entry_group_add_service (AvahiEntryGroup *group, const char *type, const char *domain, const char *host, - int port, + uint16_t port, AvahiStringList *txt); /** Get the D-Bus path of an AvahiEntryGroup object, for debugging purposes only. */ -char* avahi_entry_group_path (AvahiEntryGroup *); - -/** Get the D-Bus path of an AvahiDomainBrowser object, for debugging purposes only. */ -char* avahi_domain_browser_path (AvahiDomainBrowser *); +const char* avahi_entry_group_path (AvahiEntryGroup *); /** Browse for domains on the local network */ AvahiDomainBrowser* avahi_domain_browser_new (AvahiClient *client, AvahiIfIndex interface, AvahiProtocol protocol, - char *domain, + const char *domain, AvahiDomainBrowserType btype, AvahiDomainBrowserCallback callback, void *user_data); +/** Get the D-Bus path of an AvahiDomainBrowser object, for debugging purposes only. */ +const char* avahi_domain_browser_path (AvahiDomainBrowser *); + +/** Cleans up and frees an AvahiDomainBrowser object */ +int avahi_domain_browser_free (AvahiDomainBrowser *); + +/** Browse for service types on the local network */ +AvahiServiceTypeBrowser* avahi_service_type_browser_new ( + AvahiClient *client, + AvahiIfIndex interface, + AvahiProtocol protocol, + const char *domain, + AvahiServiceTypeBrowserCallback callback, + void *user_data); + +/** Get the D-Bus path of an AvahiServiceTypeBrowser object, for debugging purposes only. */ +const char* avahi_service_type_browser_path (AvahiServiceTypeBrowser *); + +/** Cleans up and frees an AvahiServiceTypeBrowser object */ +int avahi_service_type_browser_free (AvahiServiceTypeBrowser *); + +/** Browse for services of a type on the local network */ +AvahiServiceBrowser* avahi_service_browser_new ( + AvahiClient *client, + AvahiIfIndex interface, + AvahiProtocol protocol, + const char *type, + const char *domain, + AvahiServiceBrowserCallback callback, + void *user_data); + +/** Get the D-Bus path of an AvahiServiceBrowser object, for debugging purposes only. */ +const char* avahi_service_browser_path (AvahiServiceBrowser *); + +/* Cleans up and frees an AvahiServiceBrowser object */ +int avahi_service_browser_free (AvahiServiceBrowser *); + #ifndef DOXYGEN_SHOULD_SKIP_THIS AVAHI_C_DECL_END #endif