Main Page | Data Structures | Directories | File List | Data Fields | Globals | Examples

core.h File Reference


Detailed Description

The Avahi Multicast DNS and DNS Service Discovery implmentation.

Definition in file core.h.

#include <glib.h>
#include <avahi-common/cdecl.h>
#include <avahi-common/address.h>
#include <avahi-common/rr.h>
#include <avahi-common/alternative.h>

Go to the source code of this file.

Data Structures

struct  AvahiServerConfig
 Stores configuration options for a server instance. More...

Typedefs

typedef AvahiServer AvahiServer
 An mDNS responder object.
typedef AvahiEntry AvahiEntry
 A locally registered DNS resource record.
typedef AvahiEntryGroup AvahiEntryGroup
 A group of locally registered DNS RRs.
typedef void(* AvahiServerCallback )(AvahiServer *s, AvahiServerState state, gpointer userdata)
 Prototype for callback functions which are called whenever the state of an AvahiServer object changes.
typedef void(* AvahiEntryGroupCallback )(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryGroupState state, gpointer userdata)
 Prototype for callback functions which are called whenever the state of an AvahiEntryGroup object changes.
typedef AvahiServerConfig AvahiServerConfig
 Stores configuration options for a server instance.
typedef void(* AvahiDumpCallback )(const gchar *text, gpointer userdata)
 Callback prototype for avahi_server_dump().
typedef AvahiRecordBrowser AvahiRecordBrowser
 A browsing object for arbitrary RRs.
typedef void(* AvahiRecordBrowserCallback )(AvahiRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, AvahiRecord *record, gpointer userdata)
 Callback prototype for AvahiRecordBrowser events.
typedef AvahiHostNameResolver AvahiHostNameResolver
 A host name to IP adddress resolver object.
typedef void(* AvahiHostNameResolverCallback )(AvahiHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const gchar *host_name, const AvahiAddress *a, gpointer userdata)
 Callback prototype for AvahiHostNameResolver events.
typedef AvahiAddressResolver AvahiAddressResolver
 An IP address to host name resolver object ("reverse lookup").
typedef void(* AvahiAddressResolverCallback )(AvahiAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *a, const gchar *host_name, gpointer userdata)
 Callback prototype for AvahiAddressResolver events.
typedef AvahiDomainBrowser AvahiDomainBrowser
 A local domain browsing object.
typedef void(* AvahiDomainBrowserCallback )(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *domain, gpointer userdata)
 Callback prototype for AvahiDomainBrowser events.
typedef AvahiServiceTypeBrowser AvahiServiceTypeBrowser
 A DNS-SD service type browsing object.
typedef void(* AvahiServiceTypeBrowserCallback )(AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *type, const gchar *domain, gpointer userdata)
 Callback prototype for AvahiServiceTypeBrowser events.
typedef AvahiServiceBrowser AvahiServiceBrowser
 A DNS-SD service browser.
typedef void(* AvahiServiceBrowserCallback )(AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *name, const gchar *type, const gchar *domain, gpointer userdata)
 Callback prototype for AvahiServiceBrowser events.
typedef AvahiServiceResolver AvahiServiceResolver
 A DNS-SD service resolver.
typedef void(* AvahiServiceResolverCallback )(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const gchar *name, const gchar *type, const gchar *domain, const gchar *host_name, const AvahiAddress *a, guint16 port, AvahiStringList *txt, gpointer userdata)
 Callback prototype for AvahiServiceResolver events.
typedef AvahiDNSServerBrowser AvahiDNSServerBrowser
 A domain service browser object.
typedef void(* AvahiDNSServerBrowserCallback )(AvahiDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *host_name, const AvahiAddress *a, guint16 port, gpointer userdata)
 Callback prototype for AvahiDNSServerBrowser events.

Enumerations

enum  {
  AVAHI_OK = 0, AVAHI_ERR_FAILURE = -1, AVAHI_ERR_BAD_STATE = -2, AVAHI_ERR_INVALID_HOST_NAME = -3,
  AVAHI_ERR_INVALID_DOMAIN_NAME = -4, AVAHI_ERR_NO_NETWORK = -5, AVAHI_ERR_INVALID_TTL = -6, AVAHI_ERR_IS_PATTERN = -7,
  AVAHI_ERR_LOCAL_COLLISION = -8, AVAHI_ERR_INVALID_RECORD = -9, AVAHI_ERR_INVALID_SERVICE_NAME = -10, AVAHI_ERR_INVALID_SERVICE_TYPE = -11,
  AVAHI_ERR_INVALID_PORT = -12, AVAHI_ERR_INVALID_KEY = -13, AVAHI_ERR_INVALID_ADDRESS = -14, AVAHI_ERR_TIMEOUT = -15,
  AVAHI_ERR_TOO_MANY_CLIENTS = -16, AVAHI_ERR_TOO_MANY_OBJECTS = -17, AVAHI_ERR_TOO_MANY_ENTRIES = -18, AVAHI_ERR_OS = -19,
  AVAHI_ERR_ACCESS_DENIED = -20, AVAHI_ERR_INVALID_OPERATION = -21, AVAHI_ERR_MAX = -22
}
 Error codes used by avahi. More...
enum  AvahiServerState { AVAHI_SERVER_INVALID = -1, AVAHI_SERVER_REGISTERING = 0, AVAHI_SERVER_RUNNING, AVAHI_SERVER_COLLISION }
 States of a server object. More...
enum  AvahiEntryFlags {
  AVAHI_ENTRY_NULL = 0, AVAHI_ENTRY_UNIQUE = 1, AVAHI_ENTRY_NOPROBE = 2, AVAHI_ENTRY_NOANNOUNCE = 4,
  AVAHI_ENTRY_ALLOWMUTIPLE = 8
}
 Flags for server entries. More...
enum  AvahiEntryGroupState { AVAHI_ENTRY_GROUP_UNCOMMITED = -1, AVAHI_ENTRY_GROUP_REGISTERING = 0, AVAHI_ENTRY_GROUP_ESTABLISHED, AVAHI_ENTRY_GROUP_COLLISION }
 States of an entry group object. More...
enum  AvahiDNSServerType { AVAHI_DNS_SERVER_RESOLVE, AVAHI_DNS_SERVER_UPDATE }
 The type of DNS server. More...
enum  AvahiBrowserEvent { AVAHI_BROWSER_NEW = 0, AVAHI_BROWSER_REMOVE = -1 }
 Type of callback event when browsing. More...
enum  AvahiResolverEvent { AVAHI_RESOLVER_FOUND = 0, AVAHI_RESOLVER_TIMEOUT = -1 }
 Type of callback event when resolving. More...
enum  AvahiDomainBrowserType {
  AVAHI_DOMAIN_BROWSER_REGISTER, AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT, AVAHI_DOMAIN_BROWSER_BROWSE, AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT,
  AVAHI_DOMAIN_BROWSER_BROWSE_LEGACY, AVAHI_DOMAIN_BROWSER_MAX
}
 The type of domain to browse for. More...

Functions

AvahiServeravahi_server_new (GMainContext *c, const AvahiServerConfig *sc, AvahiServerCallback callback, gpointer userdata, gint *error)
 Allocate a new mDNS responder object.
void avahi_server_free (AvahiServer *s)
 Free an mDNS responder object.
AvahiServerConfigavahi_server_config_init (AvahiServerConfig *c)
 Fill in default values for a server configuration structure.
AvahiServerConfigavahi_server_config_copy (AvahiServerConfig *ret, const AvahiServerConfig *c)
 Make a deep copy of the configuration structure *c to *ret.
void avahi_server_config_free (AvahiServerConfig *c)
 Free the data in a server configuration structure.
const gchar * avahi_server_get_domain_name (AvahiServer *s)
 Return the currently chosen domain name of the server object.
const gchar * avahi_server_get_host_name (AvahiServer *s)
 Return the currently chosen host name.
const gchar * avahi_server_get_host_name_fqdn (AvahiServer *s)
 Return the currently chosen host name as a FQDN ("fully qualified domain name", i.e.
gint avahi_server_set_host_name (AvahiServer *s, const gchar *host_name)
 Change the host name of a running mDNS responder.
gint avahi_server_set_domain_name (AvahiServer *s, const gchar *domain_name)
 Change the domain name of a running mDNS responder.
gpointer avahi_server_get_data (AvahiServer *s)
 Return the opaque user data pointer attached to a server object.
void avahi_server_set_data (AvahiServer *s, gpointer userdata)
 Change the opaque user data pointer attached to a server object.
AvahiServerState avahi_server_get_state (AvahiServer *s)
 Return the current state of the server object.
const AvahiRecordavahi_server_iterate (AvahiServer *s, AvahiEntryGroup *g, void **state)
 Iterate through all local entries of the server.
void avahi_server_dump (AvahiServer *s, AvahiDumpCallback callback, gpointer userdata)
 Dump the current server status by calling "callback" for each line.
AvahiEntryGroupavahi_entry_group_new (AvahiServer *s, AvahiEntryGroupCallback callback, gpointer userdata)
 Create a new entry group.
void avahi_entry_group_free (AvahiEntryGroup *g)
 Free an entry group.
gint avahi_entry_group_commit (AvahiEntryGroup *g)
 Commit an entry group.
void avahi_entry_group_reset (AvahiEntryGroup *g)
 Remove all entries from the entry group and reset the state to AVAHI_ENTRY_GROUP_UNCOMMITED.
gboolean avahi_entry_group_is_empty (AvahiEntryGroup *g)
 Return TRUE if the entry group is empty, i.e.
AvahiEntryGroupState avahi_entry_group_get_state (AvahiEntryGroup *g)
 Return the current state of the specified entry group.
void avahi_entry_group_set_data (AvahiEntryGroup *g, gpointer userdata)
 Change the opaque user data pointer attached to an entry group object.
gpointer avahi_entry_group_get_data (AvahiEntryGroup *g)
 Return the opaque user data pointer currently set for the entry group object.
gint avahi_server_add (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, AvahiRecord *r)
 Add a new resource record to the server.
gint avahi_server_add_ptr (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, guint32 ttl, const gchar *name, const gchar *dest)
 Add a PTR RR to the server.
gint avahi_server_add_txt (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, guint32 ttl, const gchar *name,...)
 Add a PTR RR to the server.
gint avahi_server_add_txt_va (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, guint32 ttl, const gchar *name, va_list va)
 Add a PTR RR to the server.
gint avahi_server_add_txt_strlst (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, guint32 ttl, const gchar *name, AvahiStringList *strlst)
 Add a PTR RR to the server.
gint avahi_server_add_address (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, AvahiEntryFlags flags, const gchar *name, AvahiAddress *a)
 Add an IP address mapping to the server.
gint avahi_server_add_service (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *name, const gchar *type, const gchar *domain, const gchar *host, guint16 port,...)
 Add an DNS-SD service to the Server.
gint avahi_server_add_service_va (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *name, const gchar *type, const gchar *domain, const gchar *host, guint16 port, va_list va)
 Mostly identical to avahi_server_add_service(), but takes an va_list for the TXT records.
gint avahi_server_add_service_strlst (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *name, const gchar *type, const gchar *domain, const gchar *host, guint16 port, AvahiStringList *strlst)
 Mostly identical to avahi_server_add_service(), but takes an AvahiStringList object for the TXT records.
gint avahi_server_add_dns_server_address (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *domain, AvahiDNSServerType type, const AvahiAddress *address, guint16 port)
 Publish the specified unicast DNS server address via mDNS.
gint avahi_server_add_dns_server_name (AvahiServer *s, AvahiEntryGroup *g, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *domain, AvahiDNSServerType type, const gchar *name, guint16 port)
 Similar to avahi_server_add_dns_server_address(), but specify a host name instead of an address.
AvahiRecordBrowseravahi_record_browser_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, AvahiKey *key, AvahiRecordBrowserCallback callback, gpointer userdata)
 Create a new browsing object for arbitrary RRs.
void avahi_record_browser_free (AvahiRecordBrowser *b)
 Free an AvahiRecordBrowser object.
AvahiHostNameResolveravahi_host_name_resolver_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *host_name, AvahiProtocol aprotocol, AvahiHostNameResolverCallback calback, gpointer userdata)
 Create an AvahiHostNameResolver object for resolving a host name to an adddress.
void avahi_host_name_resolver_free (AvahiHostNameResolver *r)
 Free a AvahiHostNameResolver object.
AvahiAddressResolveravahi_address_resolver_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const AvahiAddress *address, AvahiAddressResolverCallback calback, gpointer userdata)
 Create an AvahiAddressResolver object.
void avahi_address_resolver_free (AvahiAddressResolver *r)
 Free an AvahiAddressResolver object.
AvahiDomainBrowseravahi_domain_browser_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *domain, AvahiDomainBrowserType type, AvahiDomainBrowserCallback callback, gpointer userdata)
 Create a new AvahiDomainBrowser object.
void avahi_domain_browser_free (AvahiDomainBrowser *b)
 Free an AvahiDomainBrowser object.
AvahiServiceTypeBrowseravahi_service_type_browser_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *domain, AvahiServiceTypeBrowserCallback callback, gpointer userdata)
 Create a new AvahiServiceTypeBrowser object.
void avahi_service_type_browser_free (AvahiServiceTypeBrowser *b)
 Free an AvahiServiceTypeBrowser object.
AvahiServiceBrowseravahi_service_browser_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *service_type, const gchar *domain, AvahiServiceBrowserCallback callback, gpointer userdata)
 Create a new AvahiServiceBrowser object.
void avahi_service_browser_free (AvahiServiceBrowser *b)
 Free an AvahiServiceBrowser object.
AvahiServiceResolveravahi_service_resolver_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *name, const gchar *type, const gchar *domain, AvahiProtocol aprotocol, AvahiServiceResolverCallback calback, gpointer userdata)
 Create a new AvahiServiceResolver object.
void avahi_service_resolver_free (AvahiServiceResolver *r)
 Free an AvahiServiceResolver object.
AvahiDNSServerBrowseravahi_dns_server_browser_new (AvahiServer *server, AvahiIfIndex interface, AvahiProtocol protocol, const gchar *domain, AvahiDNSServerType type, AvahiProtocol aprotocol, AvahiDNSServerBrowserCallback callback, gpointer userdata)
 Create a new AvahiDNSServerBrowser object.
void avahi_dns_server_browser_free (AvahiDNSServerBrowser *b)
 Free an AvahiDNSServerBrowser object.
const gchar * avahi_strerror (gint error)
 Return a human readable error string for the specified error code.
gint avahi_server_errno (AvahiServer *s)
 Return the last error code.


Typedef Documentation

typedef struct AvahiAddressResolver AvahiAddressResolver
 

An IP address to host name resolver object ("reverse lookup").

Definition at line 459 of file core.h.

typedef void(* AvahiAddressResolverCallback)(AvahiAddressResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const AvahiAddress *a, const gchar *host_name,gpointer userdata)
 

Callback prototype for AvahiAddressResolver events.

Definition at line 462 of file core.h.

typedef struct AvahiDNSServerBrowser AvahiDNSServerBrowser
 

A domain service browser object.

Use this to browse for conventional unicast DNS servers which may be used to resolve conventional domain names

Definition at line 606 of file core.h.

typedef void(* AvahiDNSServerBrowserCallback)(AvahiDNSServerBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *host_name,const AvahiAddress *a,guint16 port,gpointer userdata)
 

Callback prototype for AvahiDNSServerBrowser events.

Definition at line 609 of file core.h.

typedef struct AvahiDomainBrowser AvahiDomainBrowser
 

A local domain browsing object.

May be used to enumerate domains used on the local LAN

Definition at line 494 of file core.h.

typedef void(* AvahiDomainBrowserCallback)(AvahiDomainBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *domain, gpointer userdata)
 

Callback prototype for AvahiDomainBrowser events.

Definition at line 497 of file core.h.

typedef void(* AvahiDumpCallback)(const gchar *text, gpointer userdata)
 

Callback prototype for avahi_server_dump().

Definition at line 214 of file core.h.

typedef struct AvahiEntry AvahiEntry
 

A locally registered DNS resource record.

Definition at line 46 of file core.h.

typedef struct AvahiEntryGroup AvahiEntryGroup
 

A group of locally registered DNS RRs.

Examples:
publish-service.c.

Definition at line 49 of file core.h.

typedef void(* AvahiEntryGroupCallback)(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryGroupState state, gpointer userdata)
 

Prototype for callback functions which are called whenever the state of an AvahiEntryGroup object changes.

Definition at line 119 of file core.h.

typedef struct AvahiHostNameResolver AvahiHostNameResolver
 

A host name to IP adddress resolver object.

Definition at line 433 of file core.h.

typedef void(* AvahiHostNameResolverCallback)(AvahiHostNameResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event,const gchar *host_name,const AvahiAddress *a,gpointer userdata)
 

Callback prototype for AvahiHostNameResolver events.

Definition at line 436 of file core.h.

typedef struct AvahiRecordBrowser AvahiRecordBrowser
 

A browsing object for arbitrary RRs.

Definition at line 409 of file core.h.

typedef void(* AvahiRecordBrowserCallback)(AvahiRecordBrowser *b,AvahiIfIndex interface,AvahiProtocol protocol,AvahiBrowserEvent event,AvahiRecord *record,gpointer userdata)
 

Callback prototype for AvahiRecordBrowser events.

Definition at line 412 of file core.h.

typedef struct AvahiServer AvahiServer
 

An mDNS responder object.

Examples:
browse-services.c, and publish-service.c.

Definition at line 43 of file core.h.

typedef void(* AvahiServerCallback)(AvahiServer *s, AvahiServerState state, gpointer userdata)
 

Prototype for callback functions which are called whenever the state of an AvahiServer object changes.

Definition at line 116 of file core.h.

typedef struct AvahiServerConfig AvahiServerConfig
 

Stores configuration options for a server instance.

typedef struct AvahiServiceBrowser AvahiServiceBrowser
 

A DNS-SD service browser.

Use this to enumerate available services of a certain kind on the local LAN. Use AvahiServiceResolver to get specific service data like address and port for a service.

Examples:
browse-services.c.

Definition at line 544 of file core.h.

typedef void(* AvahiServiceBrowserCallback)(AvahiServiceBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *name, const gchar *type, const gchar *domain, gpointer userdata)
 

Callback prototype for AvahiServiceBrowser events.

Definition at line 547 of file core.h.

typedef struct AvahiServiceResolver AvahiServiceResolver
 

A DNS-SD service resolver.

Use this to retrieve addres, port and TXT data for a DNS-SD service

Examples:
browse-services.c.

Definition at line 571 of file core.h.

typedef void(* AvahiServiceResolverCallback)(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const gchar *name,const gchar *type,const gchar *domain, const gchar *host_name,const AvahiAddress *a,guint16 port,AvahiStringList *txt,gpointer userdata)
 

Callback prototype for AvahiServiceResolver events.

Definition at line 574 of file core.h.

typedef struct AvahiServiceTypeBrowser AvahiServiceTypeBrowser
 

A DNS-SD service type browsing object.

May be used to enumerate the service types of all available services on the local LAN

Definition at line 519 of file core.h.

typedef void(* AvahiServiceTypeBrowserCallback)(AvahiServiceTypeBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const gchar *type, const gchar *domain, gpointer userdata)
 

Callback prototype for AvahiServiceTypeBrowser events.

Definition at line 522 of file core.h.


Enumeration Type Documentation

anonymous enum
 

Error codes used by avahi.

Enumerator:
AVAHI_OK  OK.
AVAHI_ERR_FAILURE  Generic error code.
AVAHI_ERR_BAD_STATE  Object was in a bad state.
AVAHI_ERR_INVALID_HOST_NAME  Invalid host name.
AVAHI_ERR_INVALID_DOMAIN_NAME  Invalid domain name.
AVAHI_ERR_NO_NETWORK  No suitable network protocol available.
AVAHI_ERR_INVALID_TTL  Invalid DNS TTL.
AVAHI_ERR_IS_PATTERN  RR key is pattern.
AVAHI_ERR_LOCAL_COLLISION  Local name collision.
AVAHI_ERR_INVALID_RECORD  Invalid RR.
AVAHI_ERR_INVALID_SERVICE_NAME  Invalid service name.
AVAHI_ERR_INVALID_SERVICE_TYPE  Invalid service type.
AVAHI_ERR_INVALID_PORT  Invalid port number.
AVAHI_ERR_INVALID_KEY  Invalid key.
AVAHI_ERR_INVALID_ADDRESS  Invalid address.
AVAHI_ERR_TIMEOUT  Timeout reached.
AVAHI_ERR_TOO_MANY_CLIENTS  Too many clients.
AVAHI_ERR_TOO_MANY_OBJECTS  Too many objects.
AVAHI_ERR_TOO_MANY_ENTRIES  Too many entries.
AVAHI_ERR_OS  OS error.
AVAHI_ERR_ACCESS_DENIED  Access denied.
AVAHI_ERR_INVALID_OPERATION  Invalid operation.
AVAHI_ERR_MAX 

Definition at line 64 of file core.h.

enum AvahiBrowserEvent
 

Type of callback event when browsing.

Enumerator:
AVAHI_BROWSER_NEW  The object is new on the network.
AVAHI_BROWSER_REMOVE  The object has been removed from the network.

Definition at line 397 of file core.h.

enum AvahiDNSServerType
 

The type of DNS server.

Enumerator:
AVAHI_DNS_SERVER_RESOLVE  Unicast DNS servers for normal resolves (_domain._udp).
AVAHI_DNS_SERVER_UPDATE  Unicast DNS servers for updates (_dns-update._udp).

Definition at line 365 of file core.h.

enum AvahiDomainBrowserType
 

The type of domain to browse for.

Enumerator:
AVAHI_DOMAIN_BROWSER_REGISTER  Browse for a list of available registering domains.
AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT  Browse for the default registering domain.
AVAHI_DOMAIN_BROWSER_BROWSE  Browse for a list of available browsing domains.
AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT  Browse for the default browsing domain.
AVAHI_DOMAIN_BROWSER_BROWSE_LEGACY  Legacy browse domain - see DNS-SD spec for more information.
AVAHI_DOMAIN_BROWSER_MAX 

Definition at line 484 of file core.h.

enum AvahiEntryFlags
 

Flags for server entries.

Enumerator:
AVAHI_ENTRY_NULL  No special flags.
AVAHI_ENTRY_UNIQUE  The RRset is intended to be unique.
AVAHI_ENTRY_NOPROBE  Though the RRset is intended to be unique no probes shall be sent.
AVAHI_ENTRY_NOANNOUNCE  Do not announce this RR to other hosts.
AVAHI_ENTRY_ALLOWMUTIPLE  Allow multiple local records of this type, even if they are intended to be unique.

Definition at line 99 of file core.h.

enum AvahiEntryGroupState
 

States of an entry group object.

Enumerator:
AVAHI_ENTRY_GROUP_UNCOMMITED  The group has not yet been commited, the user must still call avahi_entry_group_commit().
AVAHI_ENTRY_GROUP_REGISTERING  The entries of the group are currently being registered.
AVAHI_ENTRY_GROUP_ESTABLISHED  The entries have successfully been established.
AVAHI_ENTRY_GROUP_COLLISION  A name collision for one of the entries in the group has been detected, the entries have been withdrawn.

Definition at line 108 of file core.h.

enum AvahiResolverEvent
 

Type of callback event when resolving.

Enumerator:
AVAHI_RESOLVER_FOUND  RR found, resolving successful.
AVAHI_RESOLVER_TIMEOUT  Noone responded within the timeout, resolving failed.

Definition at line 403 of file core.h.

enum AvahiServerState
 

States of a server object.

Enumerator:
AVAHI_SERVER_INVALID  Invalid state (initial).
AVAHI_SERVER_REGISTERING  Host RRs are being registered.
AVAHI_SERVER_RUNNING  All host RRs have been established.
AVAHI_SERVER_COLLISION  There is a collision with a host RR.

All host RRs have been withdrawn, the user should set a new host name via avahi_server_set_host_name()

Definition at line 91 of file core.h.


Function Documentation

void avahi_address_resolver_free AvahiAddressResolver r  ) 
 

Free an AvahiAddressResolver object.

AvahiAddressResolver* avahi_address_resolver_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const AvahiAddress address,
AvahiAddressResolverCallback  calback,
gpointer  userdata
 

Create an AvahiAddressResolver object.

See AvahiRecordBrowser for more info on the paramters.

void avahi_dns_server_browser_free AvahiDNSServerBrowser b  ) 
 

Free an AvahiDNSServerBrowser object.

AvahiDNSServerBrowser* avahi_dns_server_browser_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  domain,
AvahiDNSServerType  type,
AvahiProtocol  aprotocol,
AvahiDNSServerBrowserCallback  callback,
gpointer  userdata
 

Create a new AvahiDNSServerBrowser object.

Parameters:
aprotocol  Address protocol for the DNS server

void avahi_domain_browser_free AvahiDomainBrowser b  ) 
 

Free an AvahiDomainBrowser object.

AvahiDomainBrowser* avahi_domain_browser_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  domain,
AvahiDomainBrowserType  type,
AvahiDomainBrowserCallback  callback,
gpointer  userdata
 

Create a new AvahiDomainBrowser object.

gint avahi_entry_group_commit AvahiEntryGroup g  ) 
 

Commit an entry group.

This starts the probing and registration process for all RRs in the group

Examples:
publish-service.c.

void avahi_entry_group_free AvahiEntryGroup g  ) 
 

Free an entry group.

All RRs assigned to the group are removed from the server

Examples:
publish-service.c.

gpointer avahi_entry_group_get_data AvahiEntryGroup g  ) 
 

Return the opaque user data pointer currently set for the entry group object.

AvahiEntryGroupState avahi_entry_group_get_state AvahiEntryGroup g  ) 
 

Return the current state of the specified entry group.

gboolean avahi_entry_group_is_empty AvahiEntryGroup g  ) 
 

Return TRUE if the entry group is empty, i.e.

has no records attached.

AvahiEntryGroup* avahi_entry_group_new AvahiServer s,
AvahiEntryGroupCallback  callback,
gpointer  userdata
 

Create a new entry group.

The specified callback function is called whenever the state of the group changes. Use entry group objects to keep track of you RRs. Add new RRs to a group using avahi_server_add_xxx(). Make sure to call avahi_entry_group_commit() to start the registration process for your RRs

Examples:
publish-service.c.

void avahi_entry_group_reset AvahiEntryGroup g  ) 
 

Remove all entries from the entry group and reset the state to AVAHI_ENTRY_GROUP_UNCOMMITED.

Examples:
publish-service.c.

void avahi_entry_group_set_data AvahiEntryGroup g,
gpointer  userdata
 

Change the opaque user data pointer attached to an entry group object.

void avahi_host_name_resolver_free AvahiHostNameResolver r  ) 
 

Free a AvahiHostNameResolver object.

AvahiHostNameResolver* avahi_host_name_resolver_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  host_name,
AvahiProtocol  aprotocol,
AvahiHostNameResolverCallback  calback,
gpointer  userdata
 

Create an AvahiHostNameResolver object for resolving a host name to an adddress.

See AvahiRecordBrowser for more info on the paramters.

Parameters:
host_name  The host name to look for
aprotocol  The address family of the desired address or AVAHI_PROTO_UNSPEC if doesn't matter.

void avahi_record_browser_free AvahiRecordBrowser b  ) 
 

Free an AvahiRecordBrowser object.

AvahiRecordBrowser* avahi_record_browser_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiKey key,
AvahiRecordBrowserCallback  callback,
gpointer  userdata
 

Create a new browsing object for arbitrary RRs.

Parameters:
server  The server object to which attach this query
interface  Logical OS interface number where to look for the records, or AVAHI_IF_UNSPEC to look on interfaces
protocol  Protocol number to use when looking for the record, or AVAHI_PROTO_UNSPEC to look on all protocols
key  The search key
callback  The callback to call on browsing events
userdata  Arbitrary use suppliable data which is passed to the callback

gint avahi_server_add AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
AvahiRecord r
 

Add a new resource record to the server.

Returns 0 on success, negative otherwise.

Parameters:
s  The server object to add this record to
g  An entry group object if this new record shall be attached to one, or NULL. If you plan to remove the record sometime later you a required to pass an entry group object here.
interface  A numeric index of a network interface to attach this record to, or AVAHI_IF_UNSPEC to attach this record to all interfaces
protocol  A protocol family to attach this record to. One of the AVAHI_PROTO_xxx constants. Use AVAHI_PROTO_UNSPEC to make this record available on all protocols (wich means on both IPv4 and IPv6).
flags  Special flags for this record
r  The record to add. This function increases the reference counter of this object.

gint avahi_server_add_address AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
const gchar *  name,
AvahiAddress a
 

Add an IP address mapping to the server.

This will add both the host-name-to-address and the reverse mapping to the server. See avahi_server_add() for more information. If adding one of the RRs fails, the function returns with an error, but it is not defined if the other RR is deleted from the server or not. Therefore, you have to free the AvahiEntryGroup and create a new one before proceeding.

gint avahi_server_add_dns_server_address AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  domain,
AvahiDNSServerType  type,
const AvahiAddress address,
guint16  port
 

Publish the specified unicast DNS server address via mDNS.

You may browse for records create this way wit avahi_dns_server_browser_new().

Parameters:
port  should be 53

gint avahi_server_add_dns_server_name AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  domain,
AvahiDNSServerType  type,
const gchar *  name,
guint16  port
 

Similar to avahi_server_add_dns_server_address(), but specify a host name instead of an address.

The specified host name should be resolvable via mDNS

Parameters:
port  should be 53

gint avahi_server_add_ptr AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
guint32  ttl,
const gchar *  name,
const gchar *  dest
 

Add a PTR RR to the server.

See avahi_server_add() for more information.

Parameters:
ttl  DNS TTL for this record
name  PTR record name
dest  pointer destination

gint avahi_server_add_service AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  name,
const gchar *  type,
const gchar *  domain,
const gchar *  host,
guint16  port,
  ...
 

Add an DNS-SD service to the Server.

This will add all required RRs to the server. See avahi_server_add() for more information. If adding one of the RRs fails, the function returns with an error, but it is not defined if the other RR is deleted from the server or not. Therefore, you have to free the AvahiEntryGroup and create a new one before proceeding.

Parameters:
name  Service name, e.g. "Lennart's Files"
type  DNS-SD type, e.g. "_http._tcp"
host  Host name where this servcie resides, or NULL if on the local host
port  Port number of the service
Examples:
publish-service.c.

gint avahi_server_add_service_strlst AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  name,
const gchar *  type,
const gchar *  domain,
const gchar *  host,
guint16  port,
AvahiStringList strlst
 

Mostly identical to avahi_server_add_service(), but takes an AvahiStringList object for the TXT records.

The AvahiStringList object is copied.

gint avahi_server_add_service_va AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  name,
const gchar *  type,
const gchar *  domain,
const gchar *  host,
guint16  port,
va_list  va
 

Mostly identical to avahi_server_add_service(), but takes an va_list for the TXT records.

gint avahi_server_add_txt AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
guint32  ttl,
const gchar *  name,
  ...
 

Add a PTR RR to the server.

See avahi_server_add() for more information.

Parameters:
ttl  DNS TTL for this record
name  TXT record name

gint avahi_server_add_txt_strlst AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
guint32  ttl,
const gchar *  name,
AvahiStringList strlst
 

Add a PTR RR to the server.

Mostly identical to avahi_server_add_text but takes an AvahiStringList record instead of a variable number of arguments.

Parameters:
strlst  TXT decord data as a AvahiString. This routine makes a deep copy of this object.

gint avahi_server_add_txt_va AvahiServer s,
AvahiEntryGroup g,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
AvahiEntryFlags  flags,
guint32  ttl,
const gchar *  name,
va_list  va
 

Add a PTR RR to the server.

Mostly identical to avahi_server_add_text but takes a va_list instead of a variable number of arguments

AvahiServerConfig* avahi_server_config_copy AvahiServerConfig ret,
const AvahiServerConfig c
 

Make a deep copy of the configuration structure *c to *ret.

Parameters:
ret  destination
c  source

void avahi_server_config_free AvahiServerConfig c  ) 
 

Free the data in a server configuration structure.

Examples:
browse-services.c, and publish-service.c.

AvahiServerConfig* avahi_server_config_init AvahiServerConfig c  ) 
 

Fill in default values for a server configuration structure.

If you make use of an AvahiServerConfig structure be sure to initialize it with this function for the sake of upwards library compatibility. This call may allocate strings on the heap. To release this memory make sure to call avahi_server_config_done(). If you want to replace any strings in the structure be sure to free the strings filled in by this function with g_free() first and allocate the replacements with g_malloc() (or g_strdup()).

Parameters:
c  A structure which shall be filled in
Examples:
browse-services.c, and publish-service.c.

void avahi_server_dump AvahiServer s,
AvahiDumpCallback  callback,
gpointer  userdata
 

Dump the current server status by calling "callback" for each line.

gint avahi_server_errno AvahiServer s  ) 
 

Return the last error code.

Examples:
browse-services.c, and publish-service.c.

void avahi_server_free AvahiServer s  ) 
 

Free an mDNS responder object.

Examples:
browse-services.c, and publish-service.c.

gpointer avahi_server_get_data AvahiServer s  ) 
 

Return the opaque user data pointer attached to a server object.

const gchar* avahi_server_get_domain_name AvahiServer s  ) 
 

Return the currently chosen domain name of the server object.

The return value points to an internally allocated string. Be sure to make a copy of the string before calling any other library functions.

const gchar* avahi_server_get_host_name AvahiServer s  ) 
 

Return the currently chosen host name.

The return value points to a internally allocated string.

Examples:
publish-service.c.

const gchar* avahi_server_get_host_name_fqdn AvahiServer s  ) 
 

Return the currently chosen host name as a FQDN ("fully qualified domain name", i.e.

the concatenation of the host and domain name). The return value points to a internally allocated string.

AvahiServerState avahi_server_get_state AvahiServer s  ) 
 

Return the current state of the server object.

const AvahiRecord* avahi_server_iterate AvahiServer s,
AvahiEntryGroup g,
void **  state
 

Iterate through all local entries of the server.

(when g is NULL) or of a specified entry group. At the first call state should point to a NULL initialized void pointer, That pointer is used to track the current iteration. It is not safe to call any other avahi_server_xxx() function during the iteration. If the last entry has been read, NULL is returned.

AvahiServer* avahi_server_new GMainContext *  c,
const AvahiServerConfig sc,
AvahiServerCallback  callback,
gpointer  userdata,
gint *  error
 

Allocate a new mDNS responder object.

Parameters:
c  The GLIB main loop context to attach to
sc  If non-NULL a pointer to a configuration structure for the server. The server makes an internal deep copy of this structure, so you may free it using avahi_server_config_done() immediately after calling this function.
callback  A callback which is called whenever the state of the server changes
userdata  An opaque pointer which is passed to the callback function
Examples:
browse-services.c, and publish-service.c.

void avahi_server_set_data AvahiServer s,
gpointer  userdata
 

Change the opaque user data pointer attached to a server object.

gint avahi_server_set_domain_name AvahiServer s,
const gchar *  domain_name
 

Change the domain name of a running mDNS responder.

The same rules as with avahi_server_set_host_name() apply.

gint avahi_server_set_host_name AvahiServer s,
const gchar *  host_name
 

Change the host name of a running mDNS responder.

This will drop all automicatilly generated RRs and readd them with the new name. Since the responder has to probe for the new RRs this function takes some time to take effect altough it returns immediately. This function is intended to be called when a host name conflict is reported using AvahiServerCallback. The caller should readd all user defined RRs too since they otherwise continue to point to the outdated host name..

Examples:
publish-service.c.

void avahi_service_browser_free AvahiServiceBrowser b  ) 
 

Free an AvahiServiceBrowser object.

Examples:
browse-services.c.

AvahiServiceBrowser* avahi_service_browser_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  service_type,
const gchar *  domain,
AvahiServiceBrowserCallback  callback,
gpointer  userdata
 

Create a new AvahiServiceBrowser object.

Parameters:
service_type  DNS-SD service type, e.g. "_http._tcp"
Examples:
browse-services.c.

void avahi_service_resolver_free AvahiServiceResolver r  ) 
 

Free an AvahiServiceResolver object.

Examples:
browse-services.c.

AvahiServiceResolver* avahi_service_resolver_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  name,
const gchar *  type,
const gchar *  domain,
AvahiProtocol  aprotocol,
AvahiServiceResolverCallback  calback,
gpointer  userdata
 

Create a new AvahiServiceResolver object.

Parameters:
aprotocol  Address family of the desired service address. Use AVAHI_PROTO_UNSPEC if you don't care
Examples:
browse-services.c.

void avahi_service_type_browser_free AvahiServiceTypeBrowser b  ) 
 

Free an AvahiServiceTypeBrowser object.

AvahiServiceTypeBrowser* avahi_service_type_browser_new AvahiServer server,
AvahiIfIndex  interface,
AvahiProtocol  protocol,
const gchar *  domain,
AvahiServiceTypeBrowserCallback  callback,
gpointer  userdata
 

Create a new AvahiServiceTypeBrowser object.

const gchar* avahi_strerror gint  error  ) 
 

Return a human readable error string for the specified error code.

Examples:
browse-services.c, and publish-service.c.


Generated on Fri Aug 5 21:41:52 2005 for avahi by  doxygen 1.4.3-20050530