diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-09 02:37:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-09 02:40:07 +0200 |
commit | 29ddb38fea134c6132e4f2dd608e9da3871eaebe (patch) | |
tree | a3683f3d8064f37efe6d7bb9b454d8a8c81f38d5 /src/systemd/sd-bus-protocol.h | |
parent | 8d1a28020409ee4afea6ef8c1c4d3522a209284e (diff) |
libsystemd-bus: add lightweight object vtable implementation for exposing objects on the bus
This adds a lightweight scheme how to define interfaces in static fixed
arrays which then can be easily registered on a bus connection. This
makes it much easier to write bus services.
This automatically handles implementation of the Properties,
ObjectManager, and Introspection bus interfaces.
Diffstat (limited to 'src/systemd/sd-bus-protocol.h')
-rw-r--r-- | src/systemd/sd-bus-protocol.h | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/systemd/sd-bus-protocol.h b/src/systemd/sd-bus-protocol.h index a26d27c31a..568005b3bd 100644 --- a/src/systemd/sd-bus-protocol.h +++ b/src/systemd/sd-bus-protocol.h @@ -108,6 +108,21 @@ enum { "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \ "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n" +#define SD_BUS_INTROSPECT_INTERFACE_PEER \ + " <interface name=\"org.freedesktop.DBus.Peer\">\n" \ + " <method name=\"Ping\"/>\n" \ + " <method name=\"GetMachineId\">\n" \ + " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \ + " </method>\n" \ + " </interface>\n" + +#define SD_BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \ + " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \ + " <method name=\"Introspect\">\n" \ + " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \ + " </method>\n" \ + " </interface>\n" + #define SD_BUS_INTROSPECT_INTERFACE_PROPERTIES \ " <interface name=\"org.freedesktop.DBus.Properties\">\n" \ " <method name=\"Get\">\n" \ @@ -131,21 +146,21 @@ enum { " </signal>\n" \ " </interface>\n" -#define SD_BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \ - " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \ - " <method name=\"Introspect\">\n" \ - " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \ +#define SD_BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER \ + " <interface name=\"org.freedesktop.DBus.ObjectManager\">\n" \ + " <method name=\"GetManagedObjects\">\n" \ + " <arg type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\" direction=\"out\"/>\n" \ " </method>\n" \ + " <signal name=\"InterfacesAdded\">\n" \ + " <arg type=\"o\" name=\"object_path\"/>\n" \ + " <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n" \ + " </signal>\n" \ + " <signal name=\"InterfacesRemoved\">\n" \ + " <arg type=\"o\" name=\"object_path\"/>\n" \ + " <arg type=\"as\" name=\"interfaces\"/>\n" \ + " </signal>\n" \ " </interface>\n" -#define SD_BUS_INTROSPECT_INTERFACE_PEER \ - "<interface name=\"org.freedesktop.DBus.Peer\">\n" \ - " <method name=\"Ping\"/>\n" \ - " <method name=\"GetMachineId\">\n" \ - " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \ - " </method>\n" \ - "</interface>\n" - #ifdef __cplusplus } #endif |