chiark / gitweb /
device: allow easy identification of network interfaces without their full sysfs...
[elogind.git] / dbus-mount.c
1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
2
3 /***
4   This file is part of systemd.
5
6   Copyright 2010 Lennart Poettering
7
8   systemd is free software; you can redistribute it and/or modify it
9   under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2 of the License, or
11   (at your option) any later version.
12
13   systemd is distributed in the hope that it will be useful, but
14   WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16   General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 #include "dbus-unit.h"
23 #include "dbus-mount.h"
24 #include "dbus-execute.h"
25
26 static const char introspection[] =
27         DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
28         "<node>"
29         BUS_UNIT_INTERFACE
30         BUS_PROPERTIES_INTERFACE
31         " <interface name=\"org.freedesktop.systemd1.Mount\">"
32         "  <property name=\"Where\" type=\"s\" access=\"read\"/>"
33         "  <property name=\"TimeoutUSec\" type=\"t\" access=\"read\"/>"
34         BUS_EXEC_CONTEXT_INTERFACE
35         "  <property name=\"KillMode\" type=\"s\" access=\"read\"/>"
36         "  <property name=\"ControlPID\" type=\"u\" access=\"read\"/>"
37         " </interface>"
38         BUS_INTROSPECTABLE_INTERFACE
39         "</node>";
40
41 DBusHandlerResult bus_mount_message_handler(Unit *u, DBusMessage *message) {
42         const BusProperty properties[] = {
43                 BUS_UNIT_PROPERTIES,
44                 { "org.freedesktop.systemd1.Mount", "Where",       bus_property_append_string, "s", u->mount.where         },
45                 /* Where, Options, fstype */
46                 { "org.freedesktop.systemd1.Mount", "TimeoutUSec", bus_property_append_usec,   "t", &u->mount.timeout_usec },
47                 /* ExecCommand */
48                 BUS_EXEC_CONTEXT_PROPERTIES("org.freedesktop.systemd1.Mount", u->mount.exec_context),
49                 { "org.freedesktop.systemd1.Mount", "KillMode",    bus_unit_append_kill_mode,  "s", &u->mount.kill_mode    },
50                 { "org.freedesktop.systemd1.Mount", "ControlPID",  bus_property_append_pid,    "u", &u->mount.control_pid  },
51                 { NULL, NULL, NULL, NULL, NULL }
52         };
53
54         return bus_default_message_handler(u->meta.manager, message, introspection, properties);
55 }