strlst.c strlst.h \
alternative.c alternative.h \
rr.c rr.h \
- util.c util.h
+ util.c util.h \
+ error.c error.h
libavahi_common_la_CFLAGS = $(AM_CFLAGS)
libavahi_common_la_LIBADD = $(AM_LDADD)
/** States of an entry group object */
typedef enum {
- AVAHI_ENTRY_GROUP_UNCOMMITED = -1, /**< The group has not yet been commited, the user must still call avahi_entry_group_commit() */
- AVAHI_ENTRY_GROUP_REGISTERING = 0, /**< 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 */
+ 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 */
} AvahiEntryGroupState;
/** The type of domain to browse for */
/** Type of callback event when browsing */
typedef enum {
- AVAHI_BROWSER_NEW = 0, /**< The object is new on the network */
- AVAHI_BROWSER_REMOVE = -1 /**< The object has been removed from the network */
+ AVAHI_BROWSER_NEW, /**< The object is new on the network */
+ AVAHI_BROWSER_REMOVE /**< The object has been removed from the network */
} AvahiBrowserEvent;
/** Type of callback event when resolving */
typedef enum {
- AVAHI_RESOLVER_FOUND = 0, /**< RR found, resolving successful */
- AVAHI_RESOLVER_TIMEOUT = -1 /**< Noone responded within the timeout, resolving failed */
+ AVAHI_RESOLVER_FOUND, /**< RR found, resolving successful */
+ AVAHI_RESOLVER_TIMEOUT /**< Noone responded within the timeout, resolving failed */
} AvahiResolverEvent;
/** States of a server object */
typedef enum {
- AVAHI_SERVER_INVALID = -1, /**< Invalid state (initial) */
- AVAHI_SERVER_REGISTERING = 0, /**< Host RRs are being registered */
+ 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() */
} AvahiServerState;
#include <avahi-common/address.h>
#include <avahi-common/rr.h>
#include <avahi-common/alternative.h>
+#include <avahi-common/error.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
AVAHI_C_DECL_BEGIN
#endif
-/** Error codes used by avahi */
-enum {
- AVAHI_OK = 0, /**< OK */
- AVAHI_ERR_FAILURE = -1, /**< Generic error code */
- AVAHI_ERR_BAD_STATE = -2, /**< Object was in a bad state */
- AVAHI_ERR_INVALID_HOST_NAME = -3, /**< Invalid host name */
- AVAHI_ERR_INVALID_DOMAIN_NAME = -4, /**< Invalid domain name */
- AVAHI_ERR_NO_NETWORK = -5, /**< No suitable network protocol available */
- AVAHI_ERR_INVALID_TTL = -6, /**< Invalid DNS TTL */
- AVAHI_ERR_IS_PATTERN = -7, /**< RR key is pattern */
- AVAHI_ERR_LOCAL_COLLISION = -8, /**< Local name collision */
- AVAHI_ERR_INVALID_RECORD = -9, /**< Invalid RR */
- AVAHI_ERR_INVALID_SERVICE_NAME = -10, /**< Invalid service name */
- AVAHI_ERR_INVALID_SERVICE_TYPE = -11, /**< Invalid service type */
- AVAHI_ERR_INVALID_PORT = -12, /**< Invalid port number */
- AVAHI_ERR_INVALID_KEY = -13, /**< Invalid key */
- AVAHI_ERR_INVALID_ADDRESS = -14, /**< Invalid address */
- AVAHI_ERR_TIMEOUT = -15, /**< Timeout reached */
- AVAHI_ERR_TOO_MANY_CLIENTS = -16, /**< Too many clients */
- AVAHI_ERR_TOO_MANY_OBJECTS = -17, /**< Too many objects */
- AVAHI_ERR_TOO_MANY_ENTRIES = -18, /**< Too many entries */
- AVAHI_ERR_OS = -19, /**< OS error */
- AVAHI_ERR_ACCESS_DENIED = -20, /**< Access denied */
- AVAHI_ERR_INVALID_OPERATION = -21, /**< Invalid operation */
- AVAHI_ERR_MAX = -22
-};
-
/** Flags for server entries */
typedef enum {
AVAHI_ENTRY_NULL = 0, /**< No special flags */
/** Free an AvahiDNSServerBrowser object */
void avahi_dns_server_browser_free(AvahiDNSServerBrowser *b);
-/** Return a human readable error string for the specified error code */
-const gchar *avahi_strerror(gint error);
-
/** Return the last error code */
gint avahi_server_errno(AvahiServer *s);
return ret;
}
-const gchar *avahi_strerror(gint error) {
- g_assert(-error >= 0 && -error < -AVAHI_ERR_MAX);
-
- const gchar * const msg[- AVAHI_ERR_MAX] = {
- "OK",
- "Operation failed",
- "Bad state",
- "Invalid host name",
- "Invalid domain name",
- "No suitable network protocol available",
- "Invalid DNS TTL",
- "Resource record key is pattern",
- "Local name collision",
- "Invalid record",
- "Invalid service name",
- "Invalid service type",
- "Invalid port number",
- "Invalid record key",
- "Invalid address",
- "Timeout reached",
- "Too many clients",
- "Too many objects",
- "Too many entries",
- "OS Error",
- "Access denied",
- "Invalid operation"
- };
-
- return msg[-error];
-}
-
gint avahi_server_errno(AvahiServer *s) {
g_assert(s);
# Some definitions matching those in core.h
import socket, dbus
-SERVER_INVALID, SERVER_REGISTERING, SERVER_RUNNING, SERVER_COLLISION = range(-1, 3)
+SERVER_INVALID, SERVER_REGISTERING, SERVER_RUNNING, SERVER_COLLISION = range(0, 4)
-ENTRY_GROUP_UNCOMMITED, ENTRY_GROUP_REGISTERING, ENTRY_GROUP_ESTABLISHED, ENTRY_GROUP_COLLISION = range(-1, 3)
+ENTRY_GROUP_UNCOMMITED, ENTRY_GROUP_REGISTERING, ENTRY_GROUP_ESTABLISHED, ENTRY_GROUP_COLLISION = range(0, 4)
DOMAIN_BROWSER_REGISTER, DOMAIN_BROWSER_REGISTER_DEFAULT, DOMAIN_BROWSER_BROWSE, DOMAIN_BROWSER_BROWSE_DEFAULT, DOMAIN_BROWSER_BROWSE_LEGACY = range(0, 5)
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
-INPUT = $(SRCDIR)/avahi-common/cdecl.h $(SRCDIR)/avahi-core/core.h $(SRCDIR)/avahi-common/address.h $(SRCDIR)/avahi-common/rr.h $(SRCDIR)/avahi-common/strlst.h $(SRCDIR)/avahi-common/alternative.h $(SRCDIR)/avahi-core/log.h $(SRCDIR)/avahi-common/defs.h $(SRCDIR)/avahi-client/client.h
+INPUT = $(SRCDIR)/avahi-common/cdecl.h $(SRCDIR)/avahi-core/core.h $(SRCDIR)/avahi-common/address.h $(SRCDIR)/avahi-common/rr.h $(SRCDIR)/avahi-common/strlst.h $(SRCDIR)/avahi-common/alternative.h $(SRCDIR)/avahi-core/log.h $(SRCDIR)/avahi-common/defs.h $(SRCDIR)/avahi-client/client.h $(SRCDIR)/avahi-common/error.h
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =