1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
4 This file is part of systemd.
6 Copyright 2010 Lennart Poettering
7 Copyright 2010 Maarten Lankhorst
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 #include "dbus-unit.h"
24 #include "dbus-swap.h"
26 static const char introspection
[] =
27 DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
30 BUS_PROPERTIES_INTERFACE
31 " <interface name=\"org.freedesktop.systemd1.Swap\">"
32 " <property name=\"What\" type=\"s\" access=\"read\"/>"
33 " <property name=\"Priority\" type=\"i\" access=\"read\"/>"
35 BUS_INTROSPECTABLE_INTERFACE
38 DBusHandlerResult
bus_swap_message_handler(Unit
*u
, DBusMessage
*message
) {
39 const BusProperty properties
[] = {
41 { "org.freedesktop.systemd1.Swap", "What", bus_property_append_string
, "s", u
->swap
.what
},
42 { "org.freedesktop.systemd1.Swap", "Priority", bus_property_append_int32
, "i", &u
->swap
.priority
},
43 { NULL
, NULL
, NULL
, NULL
, NULL
}
46 return bus_default_message_handler(u
->meta
.manager
, message
, introspection
, properties
);