]> git.ipfire.org Git - thirdparty/systemd.git/blob - src/core/device.h
Merge pull request #4892 from poettering/buspolicymove
[thirdparty/systemd.git] / src / core / device.h
1 #pragma once
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 Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20 ***/
21
22 typedef struct Device Device;
23
24 typedef enum DeviceFound {
25 DEVICE_NOT_FOUND = 0,
26 DEVICE_FOUND_UDEV = 1,
27 DEVICE_FOUND_MOUNT = 2,
28 DEVICE_FOUND_SWAP = 4,
29 } DeviceFound;
30
31 struct Device {
32 Unit meta;
33
34 char *sysfs;
35 DeviceFound found;
36
37 /* In order to be able to distinguish dependencies on
38 different device nodes we might end up creating multiple
39 devices for the same sysfs path. We chain them up here. */
40 LIST_FIELDS(struct Device, same_sysfs);
41
42 DeviceState state, deserialized_state;
43
44 bool bind_mounts;
45 };
46
47 extern const UnitVTable device_vtable;
48
49 int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now);
50 bool device_shall_be_bound_by(Unit *device, Unit *u);