From fbce111b069aa1e4c701ed37ee1d9f6d6cefaac5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 6 Nov 2005 02:08:32 +0000 Subject: * add two new configuration file options: "disable-publishing" and "disable-user-service-publishing" * add two new errors: NOT_PERMITTED and NOT_SUPPORTED * add two new publishing flags: AVAHI_PUBLISH_USE_MULTICAST, AVAHI_PUBLISH_USE_WIDE_AREA * return NOT_SUPPORTED when user tries to add RRs in wide area domains - for now git-svn-id: file:///home/lennart/svn/public/avahi/trunk@930 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/dbus.c | 5 ++++- avahi-common/dbus.h | 6 ++++-- avahi-common/defs.h | 4 +++- avahi-common/error.c | 5 ++++- avahi-common/error.h | 5 ++++- 5 files changed, 19 insertions(+), 6 deletions(-) (limited to 'avahi-common') diff --git a/avahi-common/dbus.c b/avahi-common/dbus.c index cebf56d..3ea7cbd 100644 --- a/avahi-common/dbus.c +++ b/avahi-common/dbus.c @@ -83,7 +83,10 @@ static const char * const table[- AVAHI_ERR_MAX] = { AVAHI_DBUS_ERR_DNS_NOTZONE, AVAHI_DBUS_ERR_INVALID_RDATA, AVAHI_DBUS_ERR_INVALID_DNS_CLASS, - AVAHI_DBUS_ERR_INVALID_DNS_TYPE + AVAHI_DBUS_ERR_INVALID_DNS_TYPE, + AVAHI_DBUS_ERR_NOT_SUPPORTED, + + AVAHI_DBUS_ERR_NOT_PERMITTED }; int avahi_error_dbus_to_number(const char *s) { diff --git a/avahi-common/dbus.h b/avahi-common/dbus.h index 86c62f2..fb8a074 100644 --- a/avahi-common/dbus.h +++ b/avahi-common/dbus.h @@ -91,8 +91,10 @@ AVAHI_C_DECL_BEGIN #define AVAHI_DBUS_ERR_DNS_NOTAUTH "org.freedesktop.Avahi.DNSNOTAUTH" #define AVAHI_DBUS_ERR_DNS_NOTZONE "org.freedesktop.Avahi.DNSNOTZONE" #define AVAHI_DBUS_ERR_INVALID_RDATA "org.freedesktop.Avahi.InvalidRDataError" -#define AVAHI_DBUS_ERR_INVALID_DNS_CLASS "org.freedesktop.Avahi.InvalidDNSClass" -#define AVAHI_DBUS_ERR_INVALID_DNS_TYPE "org.freedesktop.Avahi.InvalidDNSType" +#define AVAHI_DBUS_ERR_INVALID_DNS_CLASS "org.freedesktop.Avahi.InvalidDNSClassError" +#define AVAHI_DBUS_ERR_INVALID_DNS_TYPE "org.freedesktop.Avahi.InvalidDNSTypeError" +#define AVAHI_DBUS_ERR_NOT_SUPPORTED "org.freedesktop.Avahi.NotSupportedError" +#define AVAHI_DBUS_ERR_NOT_PERMITTED "org.freedesktop.Avahi.NotPermittedError" /** 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 8167f34..18099c7 100644 --- a/avahi-common/defs.h +++ b/avahi-common/defs.h @@ -172,7 +172,9 @@ typedef enum { AVAHI_PUBLISH_ALLOW_MULTIPLE = 8, /**< For raw records: Allow multiple local records of this type, even if they are intended to be unique */ AVAHI_PUBLISH_NO_REVERSE = 16, /**< For address records: don't create a reverse (PTR) entry */ AVAHI_PUBLISH_NO_COOKIE = 32, /**< For service records: do not implicitly add the local service cookie to TXT data */ - AVAHI_PUBLISH_UPDATE = 64 /**< Update existing records instead of adding new ones */ + AVAHI_PUBLISH_UPDATE = 64, /**< Update existing records instead of adding new ones */ + AVAHI_PUBLISH_USE_WIDE_AREA = 128, /**< Register the record using wide area DNS (i.e. unicast DNS update) */ + AVAHI_PUBLISH_USE_MULTICAST = 256 /**< Register the record using multicast DNS */ } AvahiPublishFlags; /** Some flags for lookup functions */ diff --git a/avahi-common/error.c b/avahi-common/error.c index c997dc0..864a5bd 100644 --- a/avahi-common/error.c +++ b/avahi-common/error.c @@ -80,7 +80,10 @@ const char *avahi_strerror(int error) { "DNS failure: NOTZONE", "Invalid RDATA", "Invalid DNS type", - "Invalid DNS class" + "Invalid DNS class", + "Not supported", + + "Not permitted" }; if (-error < 0 || -error >= -AVAHI_ERR_MAX) diff --git a/avahi-common/error.h b/avahi-common/error.h index 0c3320d..91e32d7 100644 --- a/avahi-common/error.h +++ b/avahi-common/error.h @@ -83,6 +83,9 @@ enum { AVAHI_ERR_INVALID_RDATA = -46, /**< Invalid RDATA */ AVAHI_ERR_INVALID_DNS_CLASS = -47, /**< Invalid DNS class */ AVAHI_ERR_INVALID_DNS_TYPE = -48, /**< Invalid DNS type */ + AVAHI_ERR_NOT_SUPPORTED = -49, /**< Not supported */ + + AVAHI_ERR_NOT_PERMITTED = -50, /**< Operation not permitted */ /**** **** IF YOU ADD A NEW ERROR CODE HERE, PLEASE DON'T FORGET TO ADD @@ -92,7 +95,7 @@ enum { **** Also remember to update the MAX value below. ****/ - AVAHI_ERR_MAX = -49 + AVAHI_ERR_MAX = -51 }; /** Return a human readable error string for the specified error code */ -- cgit