Commit 4288f619 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

dbus: automatically generate and install introspection files

parent 6d526de2
org.freedesktop.systemd1.*.xml
test-ns
test-loopback
systemd-cgroups-agent
......
......@@ -23,6 +23,7 @@ udevrulesdir=@udevrulesdir@
pkgsysconfdir=$(sysconfdir)/systemd
systemunitdir=$(pkgdatadir)/system
sessionunitdir=$(pkgdatadir)/session
interfacedir=$(datadir)/dbus-1/interfaces
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
......@@ -64,6 +65,19 @@ dist_dbuspolicy_DATA = \
dist_udevrules_DATA = \
src/99-systemd.rules
interface_DATA = \
org.freedesktop.systemd1.Manager.xml \
org.freedesktop.systemd1.Job.xml \
org.freedesktop.systemd1.Unit.xml \
org.freedesktop.systemd1.Service.xml \
org.freedesktop.systemd1.Socket.xml \
org.freedesktop.systemd1.Target.xml \
org.freedesktop.systemd1.Device.xml \
org.freedesktop.systemd1.Mount.xml \
org.freedesktop.systemd1.Automount.xml \
org.freedesktop.systemd1.Snapshot.xml \
org.freedesktop.systemd1.Swap.xml
dist_systemunit_DATA = \
units/emergency.service \
units/getty.target \
......@@ -426,6 +440,11 @@ CLEANFILES += \
man/systemd.special.html.in
endif
org.freedesktop.systemd1.%.xml: systemd
$(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
CLEANFILES += $(interface_DATA)
install-data-hook:
$(MKDIR_P) -m 0755 \
$(DESTDIR)$(systemunitdir) \
......
......@@ -64,6 +64,8 @@
* tcpwrap
* introduce exit.target for session instances
Regularly:
* look for close() vs. close_nointr() vs. close_nointr_nofail()
......
......@@ -22,16 +22,21 @@
#include "dbus-unit.h"
#include "dbus-automount.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Automount\">"
" <property name=\"Where\" type=\"s\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_AUTOMOUNT_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Automount\">\n" \
" <property name=\"Where\" type=\"s\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_AUTOMOUNT_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_automount_interface[] = BUS_AUTOMOUNT_INTERFACE;
DBusHandlerResult bus_automount_message_handler(Unit *u, DBusMessage *message) {
const BusProperty properties[] = {
......@@ -40,5 +45,5 @@ DBusHandlerResult bus_automount_message_handler(Unit *u, DBusMessage *message) {
{ NULL, NULL, NULL, NULL, NULL }
};
return bus_default_message_handler(u->meta.manager, message, introspection, properties);
return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
}
......@@ -28,4 +28,6 @@
DBusHandlerResult bus_automount_message_handler(Unit *u, DBusMessage *message);
extern const char bus_automount_interface[];
#endif
......@@ -22,16 +22,21 @@
#include "dbus-unit.h"
#include "dbus-device.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Device\">"
" <property name=\"SysFSPath\" type=\"s\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_DEVICE_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Device\">\n" \
" <property name=\"SysFSPath\" type=\"s\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_DEVICE_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_device_interface[] = BUS_DEVICE_INTERFACE;
DBusHandlerResult bus_device_message_handler(Unit *u, DBusMessage *message) {
const BusProperty properties[] = {
......@@ -40,5 +45,5 @@ DBusHandlerResult bus_device_message_handler(Unit *u, DBusMessage *message) {
{ NULL, NULL, NULL, NULL, NULL }
};
return bus_default_message_handler(u->meta.manager, message, introspection, properties);
return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
}
......@@ -28,4 +28,6 @@
DBusHandlerResult bus_device_message_handler(Unit *u, DBusMessage *message);
extern const char bus_device_interface[];
#endif
......@@ -27,23 +27,23 @@
#include "manager.h"
#define BUS_EXEC_CONTEXT_INTERFACE \
" <property name=\"Environment\" type=\"as\" access=\"read\"/>" \
" <property name=\"UMask\" type=\"u\" access=\"read\"/>" \
" <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/>" \
" <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>" \
" <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>" \
" <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>" \
" <property name=\"StandardInput\" type=\"s\" access=\"read\"/>" \
" <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>" \
" <property name=\"StandardError\" type=\"s\" access=\"read\"/>" \
" <property name=\"TTYPath\" type=\"s\" access=\"read\"/>" \
" <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>" \
" <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>" \
" <property name=\"SecureBits\" type=\"i\" access=\"read\"/>" \
" <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>" \
" <property name=\"User\" type=\"s\" access=\"read\"/>" \
" <property name=\"Group\" type=\"s\" access=\"read\"/>" \
" <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>"
" <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
" <property name=\"UMask\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"WorkingDirectory\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"RootDirectory\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"CPUSchedulingResetOnFork\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"NonBlocking\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"StandardInput\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SecureBits\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"CapabilityBoundingSetDrop\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"User\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"Group\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SupplementaryGroups\" type=\"as\" access=\"read\"/>\n"
#define BUS_EXEC_CONTEXT_PROPERTIES(interface, context) \
{ interface, "Environment", bus_property_append_strv, "as", (context).environment }, \
......
......@@ -25,20 +25,25 @@
#include "log.h"
#include "dbus-job.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
" <interface name=\"org.freedesktop.systemd1.Job\">"
" <method name=\"Cancel\"/>"
" <signal name=\"Changed\"/>"
" <property name=\"Id\" type=\"u\" access=\"read\"/>"
" <property name=\"Unit\" type=\"(so)\" access=\"read\"/>"
" <property name=\"JobType\" type=\"s\" access=\"read\"/>"
" <property name=\"State\" type=\"s\" access=\"read\"/>"
" </interface>"
BUS_PROPERTIES_INTERFACE
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_JOB_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Job\">\n" \
" <method name=\"Cancel\"/>\n" \
" <signal name=\"Changed\"/>\n" \
" <property name=\"Id\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"Unit\" type=\"(so)\" access=\"read\"/>\n" \
" <property name=\"JobType\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"State\" type=\"s\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_JOB_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_job_interface[] = BUS_JOB_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_job_append_state, job_state, JobState);
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_job_append_type, job_type, JobType);
......@@ -92,7 +97,7 @@ static DBusHandlerResult bus_job_message_dispatch(Job *j, DBusMessage *message)
job_free(j);
} else
return bus_default_message_handler(j->manager, message, introspection, properties);
return bus_default_message_handler(j->manager, message, INTROSPECTION, properties);
if (reply) {
if (!dbus_connection_send(m->api_bus, reply, NULL))
......
......@@ -29,4 +29,6 @@ void bus_job_send_removed_signal(Job *j, bool success);
extern const DBusObjectPathVTable bus_job_vtable;
extern const char bus_job_interface[];
#endif
......@@ -26,77 +26,82 @@
#include "dbus-manager.h"
#include "strv.h"
#define BUS_MANAGER_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Manager\">\n" \
" <method name=\"GetUnit\">\n" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"LoadUnit\">\n" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"GetJob\">\n" \
" <arg name=\"id\" type=\"u\" direction=\"in\"/>\n" \
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"ClearJobs\"/>\n" \
" <method name=\"ListUnits\">\n" \
" <arg name=\"units\" type=\"a(sssssouso)\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"ListJobs\">\n" \
" <arg name=\"jobs\" type=\"a(usssoo)\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"Subscribe\"/>\n" \
" <method name=\"Unsubscribe\"/>\n" \
" <method name=\"Dump\"/>\n" \
" <method name=\"CreateSnapshot\">\n" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
" <arg nane=\"cleanup\" type=\"b\" direction=\"in\"/>\n" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"Reload\"/>\n" \
" <method name=\"Reexecute\"/>\n" \
" <method name=\"Exit\"/>\n" \
" <method name=\"SetEnvironment\">\n" \
" <arg name=\"names\" type=\"as\" direction=\"in\"/>\n" \
" </method>\n" \
" <method name=\"UnsetEnvironment\">\n" \
" <arg name=\"names\" type=\"as\" direction=\"in\"/>\n" \
" </method>\n" \
" <signal name=\"UnitNew\">\n" \
" <arg name=\"id\" type=\"s\"/>\n" \
" <arg name=\"unit\" type=\"o\"/>\n" \
" </signal>\n" \
" <signal name=\"UnitRemoved\">\n" \
" <arg name=\"id\" type=\"s\"/>\n" \
" <arg name=\"unit\" type=\"o\"/>\n" \
" </signal>\n" \
" <signal name=\"JobNew\">\n" \
" <arg name=\"id\" type=\"u\"/>\n" \
" <arg name=\"job\" type=\"o\"/>\n" \
" </signal>\n" \
" <signal name=\"JobRemoved\">\n" \
" <arg name=\"id\" type=\"u\"/>\n" \
" <arg name=\"job\" type=\"o\"/>\n" \
" <arg name=\"success\" type=\"b\"/>\n" \
" </signal>" \
" <property name=\"Version\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"RunningAs\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"BootTimestamp\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"LogLevel\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"LogTarget\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"NNames\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"NJobs\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"Environment\" type=\"as\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION_BEGIN \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>" \
" <interface name=\"org.freedesktop.systemd1.Manager\">" \
" <method name=\"GetUnit\">" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>" \
" </method>" \
" <method name=\"LoadUnit\">" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>" \
" </method>" \
" <method name=\"GetJob\">" \
" <arg name=\"id\" type=\"u\" direction=\"in\"/>" \
" <arg name=\"job\" type=\"o\" direction=\"out\"/>" \
" </method>" \
" <method name=\"ClearJobs\"/>" \
" <method name=\"ListUnits\">" \
" <arg name=\"units\" type=\"a(sssssouso)\" direction=\"out\"/>" \
" </method>" \
" <method name=\"ListJobs\">" \
" <arg name=\"jobs\" type=\"a(usssoo)\" direction=\"out\"/>" \
" </method>" \
" <method name=\"Subscribe\"/>" \
" <method name=\"Unsubscribe\"/>" \
" <method name=\"Dump\"/>" \
" <method name=\"CreateSnapshot\">" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>" \
" <arg nane=\"cleanup\" type=\"b\" direction=\"in\"/>" \
" <arg name=\"unit\" type=\"o\" direction=\"out\"/>" \
" </method>" \
" <method name=\"Reload\"/>" \
" <method name=\"Reexecute\"/>" \
" <method name=\"Exit\"/>" \
" <method name=\"SetEnvironment\">" \
" <arg name=\"names\" type=\"as\" direction=\"in\"/>" \
" </method>" \
" <method name=\"UnsetEnvironment\">" \
" <arg name=\"names\" type=\"as\" direction=\"in\"/>" \
" </method>" \
" <signal name=\"UnitNew\">" \
" <arg name=\"id\" type=\"s\"/>" \
" <arg name=\"unit\" type=\"o\"/>" \
" </signal>" \
" <signal name=\"UnitRemoved\">" \
" <arg name=\"id\" type=\"s\"/>" \
" <arg name=\"unit\" type=\"o\"/>" \
" </signal>" \
" <signal name=\"JobNew\">" \
" <arg name=\"id\" type=\"u\"/>" \
" <arg name=\"job\" type=\"o\"/>" \
" </signal>" \
" <signal name=\"JobRemoved\">" \
" <arg name=\"id\" type=\"u\"/>" \
" <arg name=\"job\" type=\"o\"/>" \
" <arg name=\"success\" type=\"b\"/>" \
" </signal>" \
" <property name=\"Version\" type=\"s\" access=\"read\"/>" \
" <property name=\"RunningAs\" type=\"s\" access=\"read\"/>" \
" <property name=\"BootTimestamp\" type=\"t\" access=\"read\"/>" \
" <property name=\"LogLevel\" type=\"s\" access=\"read\"/>" \
" <property name=\"LogTarget\" type=\"s\" access=\"read\"/>" \
" <property name=\"NNames\" type=\"u\" access=\"read\"/>" \
" <property name=\"NJobs\" type=\"u\" access=\"read\"/>" \
" <property name=\"Environment\" type=\"as\" access=\"read\"/>" \
" </interface>" \
"<node>\n" \
BUS_MANAGER_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE
#define INTROSPECTION_END \
"</node>"
"</node>\n"
const char bus_manager_interface[] = BUS_MANAGER_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_manager_append_running_as, manager_running_as, ManagerRunningAs);
......
......@@ -26,4 +26,6 @@
extern const DBusObjectPathVTable bus_manager_vtable;
extern const char bus_manager_interface[];
#endif
......@@ -25,23 +25,28 @@
#include "dbus-mount.h"
#include "dbus-execute.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Mount\">"
" <property name=\"Where\" type=\"s\" access=\"read\"/>"
" <property name=\"What\" type=\"s\" access=\"read\"/>"
" <property name=\"Options\" type=\"s\" access=\"read\"/>"
" <property name=\"Type\" type=\"s\" access=\"read\"/>"
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>"
BUS_EXEC_CONTEXT_INTERFACE
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>"
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_MOUNT_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Mount\">\n" \
" <property name=\"Where\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"What\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"Options\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"Type\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
BUS_EXEC_CONTEXT_INTERFACE \
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_MOUNT_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_mount_interface[] = BUS_MOUNT_INTERFACE;
static int bus_mount_append_what(Manager *n, DBusMessageIter *i, const char *property, void *data) {
Mount *m = data;
......@@ -130,5 +135,5 @@ DBusHandlerResult bus_mount_message_handler(Unit *u, DBusMessage *message) {
{ NULL, NULL, NULL, NULL, NULL }
};
return bus_default_message_handler(u->meta.manager, message, introspection, properties);
return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
}
......@@ -28,4 +28,6 @@
DBusHandlerResult bus_mount_message_handler(Unit *u, DBusMessage *message);
extern const char bus_mount_interface[];
#endif
......@@ -25,29 +25,34 @@
#include "dbus-execute.h"
#include "dbus-service.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Service\">"
" <property name=\"Type\" type=\"s\" access=\"read\"/>"
" <property name=\"Restart\" type=\"s\" access=\"read\"/>"
" <property name=\"PIDFile\" type=\"s\" access=\"read\"/>"
" <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>"
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>"
BUS_EXEC_CONTEXT_INTERFACE
" <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>"
" <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>"
" <property name=\"ValidNoProcess\" type=\"b\" access=\"read\"/>"
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>"
" <property name=\"MainPID\" type=\"u\" access=\"read\"/>"
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>"
" <property name=\"SysVPath\" type=\"s\" access=\"read\"/>"
" <property name=\"BusName\" type=\"s\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_SERVICE_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Service\">\n" \
" <property name=\"Type\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"Restart\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"PIDFile\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"RestartUSec\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
BUS_EXEC_CONTEXT_INTERFACE \
" <property name=\"PermissionsStartOnly\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"RootDirectoryStartOnly\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"ValidNoProcess\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"MainPID\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"SysVPath\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"BusName\" type=\"s\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_SERVICE_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_service_interface[] = BUS_SERVICE_INTERFACE;
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_type, service_type, ServiceType);
static DEFINE_BUS_PROPERTY_APPEND_ENUM(bus_service_append_restart, service_restart, ServiceRestart);
......@@ -74,5 +79,5 @@ DBusHandlerResult bus_service_message_handler(Unit *u, DBusMessage *message) {
{ NULL, NULL, NULL, NULL, NULL }
};
return bus_default_message_handler(u->meta.manager, message, introspection, properties);
return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
}
......@@ -28,4 +28,6 @@
DBusHandlerResult bus_service_message_handler(Unit *u, DBusMessage *message);
extern const char bus_service_interface[];
#endif
......@@ -22,17 +22,22 @@
#include "dbus-unit.h"
#include "dbus-snapshot.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Snapshot\">"
" <method name=\"Remove\"/>"
" <property name=\"Cleanup\" type=\"b\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_SNAPSHOT_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Snapshot\">\n" \
" <method name=\"Remove\"/>\n" \
" <property name=\"Cleanup\" type=\"b\" access=\"read\"/>\n" \
" </interface>\n"
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_SNAPSHOT_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"
const char bus_snapshot_interface[] = BUS_SNAPSHOT_INTERFACE;
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusMessage *message) {
const BusProperty properties[] = {
......@@ -54,7 +59,7 @@ DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusMessage *message) {
goto oom;
} else
return bus_default_message_handler(u->meta.manager, message, introspection, properties);
return bus_default_message_handler(u->meta.manager, message, INTROSPECTION, properties);
if (reply) {
if (!dbus_connection_send(u->meta.manager->api_bus, reply, NULL))
......
......@@ -28,4 +28,6 @@
DBusHandlerResult bus_snapshot_message_handler(Unit *u, DBusMessage *message);
extern const char bus_snapshot_interface[];
#endif
......@@ -25,25 +25,30 @@
#include "dbus-socket.h"
#include "dbus-execute.h"
static const char introspection[] =
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
"<node>"
BUS_UNIT_INTERFACE
BUS_PROPERTIES_INTERFACE
" <interface name=\"org.freedesktop.systemd1.Socket\">"
" <property name=\"BindIPv6Only\" type=\"b\" access=\"read\"/>"
" <property name=\"Backlog\" type=\"u\" access=\"read\"/>"
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>"
BUS_EXEC_CONTEXT_INTERFACE
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>"
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>"
" <property name=\"BindToDevice\" type=\"s\" access=\"read\"/>"
" <property name=\"DirectoryMode\" type=\"u\" access=\"read\"/>"
" <property name=\"SocketMode\" type=\"u\" access=\"read\"/>"
" <property name=\"Accept\" type=\"b\" access=\"read\"/>"
" </interface>"
BUS_INTROSPECTABLE_INTERFACE
"</node>";
#define BUS_SOCKET_INTERFACE \
" <interface name=\"org.freedesktop.systemd1.Socket\">\n" \
" <property name=\"BindIPv6Only\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"Backlog\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>\n" \
BUS_EXEC_CONTEXT_INTERFACE \
" <property name=\"KillMode\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"ControlPID\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"BindToDevice\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"DirectoryMode\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"SocketMode\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"Accept\" type=\"b\" access=\"read\"/>\n" \
" </interface>\n" \
#define INTROSPECTION \
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE \
"<node>\n" \
BUS_UNIT_INTERFACE \
BUS_SOCKET_INTERFACE \
BUS_PROPERTIES_INTERFACE \
BUS_INTROSPECTABLE_INTERFACE \
"</node>\n"