summaryrefslogtreecommitdiffstats
path: root/avahi-daemon
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-11-24 01:30:44 +0000
committerLennart Poettering <lennart@poettering.net>2005-11-24 01:30:44 +0000
commitbe4aaeb485d31dee095b0c9c90e6b79333bc0e21 (patch)
treefebd8a5d5e834b7f5f28f3abfd544267ec1cc8b7 /avahi-daemon
parent3632da5dea3a2e961729664d17808d98bfc2b325 (diff)
Add DBUS API versioning
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1027 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-daemon')
-rw-r--r--avahi-daemon/Server.introspect5
-rw-r--r--avahi-daemon/dbus-protocol.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/avahi-daemon/Server.introspect b/avahi-daemon/Server.introspect
index ec2f042..5a3f88b 100644
--- a/avahi-daemon/Server.introspect
+++ b/avahi-daemon/Server.introspect
@@ -32,10 +32,15 @@
</interface>
<interface name="org.freedesktop.Avahi.Server">
+
<method name="GetVersionString">
<arg name="version" type="s" direction="out"/>
</method>
+ <method name="GetAPIVersion">
+ <arg name="version" type="u" direction="out"/>
+ </method>
+
<method name="GetHostName">
<arg name="name" type="s" direction="out"/>
</method>
diff --git a/avahi-daemon/dbus-protocol.c b/avahi-daemon/dbus-protocol.c
index f01837a..bd26c8c 100644
--- a/avahi-daemon/dbus-protocol.c
+++ b/avahi-daemon/dbus-protocol.c
@@ -261,6 +261,15 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
return avahi_dbus_respond_string(c, m, PACKAGE_STRING);
+ } else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetAPIVersion")) {
+
+ if (!(dbus_message_get_args(m, &error, DBUS_TYPE_INVALID))) {
+ avahi_log_warn("Error parsing Server::GetAPIVersion message");
+ goto fail;
+ }
+
+ return avahi_dbus_respond_uint32(c, m, AVAHI_DBUS_API_VERSION);
+
} else if (dbus_message_is_method_call(m, AVAHI_DBUS_INTERFACE_SERVER, "GetState")) {
AvahiServerState state;
@@ -594,7 +603,6 @@ static DBusHandlerResult msg_server_impl(DBusConnection *c, DBusMessage *m, AVAH
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_CLIENTS, NULL);
}
-
if (client->n_objects >= OBJECTS_PER_CLIENT_MAX) {
avahi_log_warn("Too many objects for client '%s', client request failed.", client->name);
return avahi_dbus_respond_error(c, m, AVAHI_ERR_TOO_MANY_OBJECTS, NULL);