]>
Commit | Line | Data |
---|---|---|
c2f1db8f | 1 | #pragma once |
5cb5a6ff | 2 | |
a7334b09 LP |
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 | |
5430f7f2 LP |
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 | |
a7334b09 LP |
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 | |
5430f7f2 | 16 | Lesser General Public License for more details. |
a7334b09 | 17 | |
5430f7f2 | 18 | You should have received a copy of the GNU Lesser General Public License |
a7334b09 LP |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
20 | ***/ | |
21 | ||
5cb5a6ff LP |
22 | typedef struct Device Device; |
23 | ||
628c89cc LP |
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 | ||
5cb5a6ff | 31 | struct Device { |
ac155bb8 | 32 | Unit meta; |
5cb5a6ff | 33 | |
25ac040b | 34 | char *sysfs; |
628c89cc | 35 | DeviceFound found; |
8fe914ec | 36 | |
35b8ca3a | 37 | /* In order to be able to distinguish dependencies on |
8fe914ec LP |
38 | different device nodes we might end up creating multiple |
39 | devices for the same sysfs path. We chain them up here. */ | |
8fe914ec | 40 | LIST_FIELDS(struct Device, same_sysfs); |
7fab9d01 | 41 | |
f6200941 | 42 | DeviceState state, deserialized_state; |
5cb5a6ff LP |
43 | }; |
44 | ||
87f0e418 | 45 | extern const UnitVTable device_vtable; |
5cb5a6ff | 46 | |
628c89cc | 47 | int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now); |