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 /** \file client.h Definitions and functions for the client API over D-Bus */
36 /** \example glib-integration.c Example of how to integrate
37 * avahi use with GLIB/GTK applications */
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 /** A connection context */
44 typedef struct AvahiClient AvahiClient;
46 /** States of a client object, a superset of AvahiServerState */
48 AVAHI_CLIENT_S_INVALID = AVAHI_SERVER_INVALID,
49 AVAHI_CLIENT_S_REGISTERING = AVAHI_SERVER_REGISTERING,
50 AVAHI_CLIENT_S_RUNNING = AVAHI_SERVER_RUNNING,
51 AVAHI_CLIENT_S_COLLISION = AVAHI_SERVER_COLLISION,
52 AVAHI_CLIENT_DISCONNECTED = 100 /**< Lost DBUS connection to the Avahi daemon */
55 /** The function prototype for the callback of an AvahiClient */
56 typedef void (*AvahiClientCallback) (AvahiClient *s, AvahiClientState state, void* userdata);
58 /** Creates a new client instance */
59 AvahiClient* avahi_client_new (const AvahiPoll *poll_api, AvahiClientCallback callback, void *userdata, int *error);
61 /** Free a client instance */
62 void avahi_client_free(AvahiClient *client);
64 /** Get the version of the server */
65 const char* avahi_client_get_version_string (AvahiClient*);
68 const char* avahi_client_get_host_name (AvahiClient*);
70 /** Get domain name */
71 const char* avahi_client_get_domain_name (AvahiClient*);
73 /** Get FQDN domain name */
74 const char* avahi_client_get_host_name_fqdn (AvahiClient*);
77 AvahiClientState avahi_client_get_state(AvahiClient *client);
79 /** Get the last error number */
80 int avahi_client_errno (AvahiClient*);
82 /** Return the local service cookie. returns AVAHI_SERVICE_COOKIE_INVALID on failure. */
83 uint32_t avahi_client_get_local_service_cookie(AvahiClient *client);
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS