Typedefs | Enumerations
client.h File Reference
#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 dependency graph for client.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef
typedefAVAHI_C_DECL_BEGIN
struct AvahiClient 
AvahiClient
typedef void(* AvahiClientCallback )(AvahiClient *s, AvahiClientState state, void *userdata)

Enumerations

enum  AvahiClientFlags { AVAHI_CLIENT_IGNORE_USER_CONFIG = 1, AVAHI_CLIENT_NO_FAIL = 2 }
enum  AvahiClientState {
  AVAHI_CLIENT_S_REGISTERING = AVAHI_SERVER_REGISTERING, AVAHI_CLIENT_S_RUNNING = AVAHI_SERVER_RUNNING, AVAHI_CLIENT_S_COLLISION = AVAHI_SERVER_COLLISION, AVAHI_CLIENT_FAILURE = 100,
  AVAHI_CLIENT_CONNECTING = 101
}

Functions

Construction and destruction
AvahiClientavahi_client_new (const AvahiPoll *poll_api, AvahiClientFlags flags, AvahiClientCallback callback, void *userdata, int *error)
void avahi_client_free (AvahiClient *client)
Properties
const char * avahi_client_get_version_string (AvahiClient *)
const char * avahi_client_get_host_name (AvahiClient *)
int avahi_client_set_host_name (AvahiClient *, const char *name)
const char * avahi_client_get_domain_name (AvahiClient *)
const char * avahi_client_get_host_name_fqdn (AvahiClient *)
AvahiClientState avahi_client_get_state (AvahiClient *client)
Error Handling
int avahi_client_errno (AvahiClient *)
Libc NSS Support
int avahi_nss_support (void)

Detailed Description

Definitions and functions for the client API over D-Bus

Definition in file client.h.


Typedef Documentation

typedef typedefAVAHI_C_DECL_BEGIN struct AvahiClient AvahiClient

A connection context

Definition at line 39 of file client.h.

typedef void(* AvahiClientCallback)(AvahiClient *s, AvahiClientState state, void *userdata)

The function prototype for the callback of an AvahiClient

Definition at line 56 of file client.h.


Enumeration Type Documentation

Enumerator:
AVAHI_CLIENT_IGNORE_USER_CONFIG 

Don't read user configuration

AVAHI_CLIENT_NO_FAIL 

Don't fail if the daemon is not available when avahi_client_new() is called, instead enter AVAHI_CLIENT_CONNECTING state and wait for the daemon to appear

Definition at line 50 of file client.h.

States of a client object, a superset of AvahiServerState

Enumerator:
AVAHI_CLIENT_S_REGISTERING 

Server state: REGISTERING

AVAHI_CLIENT_S_RUNNING 

Server state: RUNNING

AVAHI_CLIENT_S_COLLISION 

Server state: COLLISION

AVAHI_CLIENT_FAILURE 

Some kind of error happened on the client side

AVAHI_CLIENT_CONNECTING 

We're still connecting. This state is only entered when AVAHI_CLIENT_NO_FAIL has been passed to avahi_client_new() and the daemon is not yet available.

Definition at line 42 of file client.h.


Function Documentation

Get the last error number. See avahi_strerror() for converting this error code into a human readable string.

Free a client instance. This will automatically free all associated browser, resolve and entry group objects. All pointers to such objects become invalid!

Get domain name

Get host name

Get FQDN domain name

Get state

Get the version of the server

AvahiClient* avahi_client_new ( const AvahiPoll poll_api,
AvahiClientFlags  flags,
AvahiClientCallback  callback,
void userdata,
int *  error 
)

Creates a new client instance

Parameters:
poll_apiThe abstract event loop API to use
flagsSome flags to modify the behaviour of the client library
callbackA callback that is called whenever the state of the client changes. This may be NULL. Please note that this function is called for the first time from within the avahi_client_new() context! Thus, in the callback you should not make use of global variables that are initialized only after your call to avahi_client_new(). A common mistake is to store the AvahiClient pointer returned by avahi_client_new() in a global variable and assume that this global variable already contains the valid pointer when the callback is called for the first time. A work-around for this is to always use the AvahiClient pointer passed to the callback function instead of the global pointer.
userdataSome arbitrary user data pointer that will be passed to the callback function
errorIf creation of the client fails, this integer will contain the error cause. May be NULL if you aren't interested in the reason why avahi_client_new() failed.
int avahi_client_set_host_name ( AvahiClient ,
const char *  name 
)

Set host name.

Since:
0.6.13

Return 1 if gethostbyname() supports mDNS lookups, 0 otherwise.

Since:
0.6.5


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:21