summaryrefslogtreecommitdiffstats
path: root/avahi-common
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-12 02:37:08 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-12 02:37:08 +0000
commitbb14e0a8aa3173c8a6d80b1a9c8b300a452ee9f1 (patch)
treed29ec90346b7523aa877207ae29e461b767460c6 /avahi-common
parent7484feb19b10878042dcb8cea618d10df5440c1c (diff)
* drop AVAHI_RESOLVER_TIMEOUT, AVAHI_RESOLVER_NOT_FOUND and AVAHI_BROWSER_NOT_FOUND, use AVAHI_xxx_FAILURE instead
* set the client/server errno variable when AVAHI_xxx_FAILURE happens * update DBUS interface accordingly, pass errno value with Failure events * Pass DNS return codes to the app by wrapping them in avahi error codes git-svn-id: file:///home/lennart/svn/public/avahi/trunk@732 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common')
-rw-r--r--avahi-common/dbus.c14
-rw-r--r--avahi-common/dbus.h12
-rw-r--r--avahi-common/defs.h9
-rw-r--r--avahi-common/error.c18
-rw-r--r--avahi-common/error.h18
5 files changed, 62 insertions, 9 deletions
diff --git a/avahi-common/dbus.c b/avahi-common/dbus.c
index d658868..179b1ed 100644
--- a/avahi-common/dbus.c
+++ b/avahi-common/dbus.c
@@ -64,7 +64,19 @@ static const char * const table[- AVAHI_ERR_MAX] = {
AVAHI_DBUS_ERR_NOT_FOUND,
AVAHI_DBUS_ERR_INVALID_CONFIG,
AVAHI_DBUS_ERR_VERSION_MISMATCH,
- AVAHI_DBUS_ERR_INVALID_SERVICE_SUBTYPE
+ AVAHI_DBUS_ERR_INVALID_SERVICE_SUBTYPE,
+ AVAHI_DBUS_ERR_INVALID_PACKET,
+ AVAHI_DBUS_ERR_INVALID_DNS_ERROR,
+ AVAHI_DBUS_ERR_DNS_FORMERR,
+ AVAHI_DBUS_ERR_DNS_SERVFAIL,
+ AVAHI_DBUS_ERR_DNS_NXDOMAIN,
+ AVAHI_DBUS_ERR_DNS_NOTIMP,
+ AVAHI_DBUS_ERR_DNS_REFUSED,
+ AVAHI_DBUS_ERR_DNS_YXDOMAIN,
+ AVAHI_DBUS_ERR_DNS_YXRRSET,
+ AVAHI_DBUS_ERR_DNS_NXRRSET,
+ AVAHI_DBUS_ERR_DNS_NOTAUTH,
+ AVAHI_DBUS_ERR_DNS_NOTZONE,
};
int avahi_error_dbus_to_number(const char *s) {
diff --git a/avahi-common/dbus.h b/avahi-common/dbus.h
index cb7ba19..9806f58 100644
--- a/avahi-common/dbus.h
+++ b/avahi-common/dbus.h
@@ -75,6 +75,18 @@ AVAHI_C_DECL_BEGIN
#define AVAHI_DBUS_ERR_INVALID_CONFIG "org.freedesktop.Avahi.InvalidConfigurationError"
#define AVAHI_DBUS_ERR_VERSION_MISMATCH "org.freedesktop.Avahi.VersionMismatchError"
#define AVAHI_DBUS_ERR_INVALID_SERVICE_SUBTYPE "org.freedesktop.Avahi.InvalidServiceSubtypeError"
+#define AVAHI_DBUS_ERR_INVALID_PACKET "org.freedesktop.Avahi.InvalidPacketError"
+#define AVAHI_DBUS_ERR_INVALID_DNS_ERROR "org.freedesktop.Avahi.InvalidDNSError"
+#define AVAHI_DBUS_ERR_DNS_FORMERR "org.freedesktop.Avahi.DNSFORMERR"
+#define AVAHI_DBUS_ERR_DNS_SERVFAIL "org.freedesktop.Avahi.DNSSERVFAIL"
+#define AVAHI_DBUS_ERR_DNS_NXDOMAIN "org.freedesktop.Avahi.DNSNXDOMAIN"
+#define AVAHI_DBUS_ERR_DNS_NOTIMP "org.freedesktop.Avahi.DNSNOTIMP"
+#define AVAHI_DBUS_ERR_DNS_REFUSED "org.freedesktop.Avahi.DNSREFUSED"
+#define AVAHI_DBUS_ERR_DNS_YXDOMAIN "org.freedesktop.Avahi.DNSYXDOMAIN"
+#define AVAHI_DBUS_ERR_DNS_YXRRSET "org.freedesktop.Avahi.DNSYXRRSET"
+#define AVAHI_DBUS_ERR_DNS_NXRRSET "org.freedesktop.Avahi.DNSNXRRSET"
+#define AVAHI_DBUS_ERR_DNS_NOTAUTH "org.freedesktop.Avahi.DNSNOTAUTH"
+#define AVAHI_DBUS_ERR_DNS_NOTZONE "org.freedesktop.Avahi.DNSNOTZONE"
/** Convert a DBus error string into an Avahi error number */
int avahi_error_dbus_to_number(const char *s);
diff --git a/avahi-common/defs.h b/avahi-common/defs.h
index be8022e..4d9c40f 100644
--- a/avahi-common/defs.h
+++ b/avahi-common/defs.h
@@ -139,7 +139,7 @@ typedef enum {
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 */
+ 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 */
@@ -187,16 +187,13 @@ typedef enum {
AVAHI_BROWSER_REMOVE, /**< The object has been removed from the network */
AVAHI_BROWSER_CACHE_EXHAUSTED, /**< One-time event, to notify the user that all entries from the caches have been send */
AVAHI_BROWSER_ALL_FOR_NOW, /**< One-time event, to notify the user that more records will probably not show up in the near future, i.e. all cache entries have been read and all static servers been queried */
- AVAHI_BROWSER_NOT_FOUND, /**< Issued when using wide area DNS-SD to inform that a record is not existing */
- AVAHI_BROWSER_FAILURE /**< Issued when using wide area DNS-SD to inform about server failures */
+ AVAHI_BROWSER_FAILURE /**< Browsing failed due to some reason which can be retrieved using avahi_server_errno()/avahi_client_errno() */
} AvahiBrowserEvent;
/** Type of callback event when resolving */
typedef enum {
AVAHI_RESOLVER_FOUND, /**< RR found, resolving successful */
- AVAHI_RESOLVER_TIMEOUT, /**< Noone responded within the timeout, resolving failed */
- AVAHI_RESOLVER_NOT_FOUND, /**< Query was done using wide area DNS-SD and the server told us that the entry is nto available */
- AVAHI_RESOLVER_FAILURE /**< Query was done using wide area DNS-SD and the server failed */
+ AVAHI_RESOLVER_FAILURE /**< Resolving failed due to some reason which can be retrieved using avahi_server_errno()/avahi_client_errno() */
} AvahiResolverEvent;
/** States of a server object */
diff --git a/avahi-common/error.c b/avahi-common/error.c
index 76a05fd..af10422 100644
--- a/avahi-common/error.c
+++ b/avahi-common/error.c
@@ -38,6 +38,7 @@ const char *avahi_strerror(int error) {
"Resource record key is pattern",
"Local name collision",
"Invalid record",
+
"Invalid service name",
"Invalid service type",
"Invalid port number",
@@ -48,6 +49,7 @@ const char *avahi_strerror(int error) {
"Too many objects",
"Too many entries",
"OS Error",
+
"Access denied",
"Invalid operation",
"An unexpected DBUS error occured",
@@ -58,10 +60,24 @@ const char *avahi_strerror(int error) {
"Invalid interface index",
"Invalid protocol specification",
"Invalid flags",
+
"Not found",
"Invalid configuration",
"Version mismatch",
- "Invalid service subtype"
+ "Invalid service subtype",
+ "Invalid packet",
+ "Invalid DNS return code",
+ "DNS failure: FORMERR",
+ "DNS failure: SERVFAIL",
+ "DNS failure: NXDOMAIN",
+ "DNS failure: NOTIMP",
+
+ "DNS failure: REFUSED",
+ "DNS failure: YXDOMAIN",
+ "DNS failure: YXRRSET",
+ "DNS failure: NXRRSET",
+ "DNS failure: NOTAUTH",
+ "DNS failure: NOTZONE"
};
if (-error < 0 || -error >= -AVAHI_ERR_MAX)
diff --git a/avahi-common/error.h b/avahi-common/error.h
index 623620a..55c388b 100644
--- a/avahi-common/error.h
+++ b/avahi-common/error.h
@@ -42,6 +42,7 @@ enum {
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 */
@@ -52,6 +53,7 @@ enum {
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_DBUS_ERROR = -22, /**< An unexpected DBUS error occured */
@@ -62,11 +64,25 @@ enum {
AVAHI_ERR_INVALID_INTERFACE = -27, /**< Invalid interface */
AVAHI_ERR_INVALID_PROTOCOL = -28, /**< Invalid protocol */
AVAHI_ERR_INVALID_FLAGS = -29, /**< Invalid flags */
+
AVAHI_ERR_NOT_FOUND = -30, /**< Not found */
AVAHI_ERR_INVALID_CONFIG = -31, /**< Configuration error */
AVAHI_ERR_VERSION_MISMATCH = -32, /**< Verson mismatch */
AVAHI_ERR_INVALID_SERVICE_SUBTYPE = -33, /**< Invalid service subtype */
+ AVAHI_ERR_INVALID_PACKET = -34, /**< Invalid packet */
+ AVAHI_ERR_INVALID_DNS_ERROR = -35, /**< Invlaid DNS return code */
+ AVAHI_ERR_DNS_FORMERR = -36,
+ AVAHI_ERR_DNS_SERVFAIL = -37,
+ AVAHI_ERR_DNS_NXDOMAIN = -38,
+ AVAHI_ERR_DNS_NOTIMP = -39,
+ AVAHI_ERR_DNS_REFUSED = -40,
+ AVAHI_ERR_DNS_YXDOMAIN = -41,
+ AVAHI_ERR_DNS_YXRRSET = -42,
+ AVAHI_ERR_DNS_NXRRSET = -43,
+ AVAHI_ERR_DNS_NOTAUTH = -44,
+ AVAHI_ERR_DNS_NOTZONE = -45,
+
/****
**** IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD
**** IT TO THE STRING ARRAY IN avahi_strerror() IN error.c AND
@@ -75,7 +91,7 @@ enum {
**** Also remember to update the MAX value below.
****/
- AVAHI_ERR_MAX = -34
+ AVAHI_ERR_MAX = -46
};
/** Return a human readable error string for the specified error code */