summaryrefslogtreecommitdiff
path: root/src/dbus.h
diff options
context:
space:
mode:
authorAndrey Borzenkov <arvidjaar@gmail.com>2011-03-06 19:17:02 +0300
committerLennart Poettering <lennart@poettering.net>2011-03-07 02:17:31 +0100
commitc826cda421f0272275342173e16250adcdf6fbd4 (patch)
treed9b8ad25728a1958b6615738e083768bf764e15e /src/dbus.h
parentb4353094e5097c0cb149b5adcffe2a6ba9240283 (diff)
add org.freedesktop.DBus.Properies.Set method
The patch adds framework for processing Set requests on properties and as first consumers allows setting of LogTarget and LogLevel on interface org.freedesktop.systemd1.Manager of org.freedesktop.systemd1. The code should be generic enough to allow processing of any property on other objects and interfaces as well. No systemctl visible interface is added so far. The LogTarget and LogLevel are meant for debugging in the first place; user interface can be added if other usage emerge. Set on systemwide systemd is restricted to root; I am not sure how session level access is controlled.
Diffstat (limited to 'src/dbus.h')
-rw-r--r--src/dbus.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dbus.h b/src/dbus.h
index d0a9e8e30f..255b653376 100644
--- a/src/dbus.h
+++ b/src/dbus.h
@@ -27,6 +27,7 @@
#include "manager.h"
typedef int (*BusPropertyCallback)(Manager *m, DBusMessageIter *iter, const char *property, void *data);
+typedef int (*BusPropertySetCallback)(Manager *m, DBusMessageIter *iter, const char *property);
typedef struct BusProperty {
const char *interface; /* interface of the property */
@@ -34,6 +35,7 @@ typedef struct BusProperty {
BusPropertyCallback append; /* Function that is called to serialize this property */
const char *signature;
const void *data; /* The data of this property */
+ BusPropertySetCallback set; /* Function that is called to set this property */
} BusProperty;
#define BUS_PROPERTIES_INTERFACE \
@@ -47,6 +49,11 @@ typedef struct BusProperty {
" <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
" <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
" </method>\n" \
+ " <method name=\"Set\">\n" \
+ " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
+ " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
+ " <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \
+ " </method>\n" \
" <signal name=\"PropertiesChanged\">\n" \
" <arg type=\"s\" name=\"interface\"/>\n" \
" <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \