]>
Commit | Line | Data |
---|---|---|
03467c88 | 1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
5cb5a6ff | 2 | |
c2f1db8f | 3 | #pragma once |
5cb5a6ff | 4 | |
a7334b09 LP |
5 | /*** |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2010 Lennart Poettering | |
9 | ||
10 | systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
11 | under the terms of the GNU Lesser General Public License as published by |
12 | the Free Software Foundation; either version 2.1 of the License, or | |
a7334b09 LP |
13 | (at your option) any later version. |
14 | ||
15 | systemd is distributed in the hope that it will be useful, but | |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 18 | Lesser General Public License for more details. |
a7334b09 | 19 | |
5430f7f2 | 20 | You should have received a copy of the GNU Lesser General Public License |
a7334b09 LP |
21 | along with systemd; If not, see <http://www.gnu.org/licenses/>. |
22 | ***/ | |
23 | ||
5cb5a6ff LP |
24 | typedef struct Automount Automount; |
25 | ||
87f0e418 | 26 | #include "unit.h" |
5cb5a6ff LP |
27 | |
28 | typedef enum AutomountState { | |
29 | AUTOMOUNT_DEAD, | |
5cb5a6ff LP |
30 | AUTOMOUNT_WAITING, |
31 | AUTOMOUNT_RUNNING, | |
74ac3cbd | 32 | AUTOMOUNT_FAILED, |
e537352b LP |
33 | _AUTOMOUNT_STATE_MAX, |
34 | _AUTOMOUNT_STATE_INVALID = -1 | |
5cb5a6ff LP |
35 | } AutomountState; |
36 | ||
81a5c6d0 LP |
37 | typedef enum AutomountResult { |
38 | AUTOMOUNT_SUCCESS, | |
39 | AUTOMOUNT_FAILURE_RESOURCES, | |
40 | _AUTOMOUNT_RESULT_MAX, | |
41 | _AUTOMOUNT_RESULT_INVALID = -1 | |
42 | } AutomountResult; | |
43 | ||
5cb5a6ff | 44 | struct Automount { |
ac155bb8 | 45 | Unit meta; |
5cb5a6ff | 46 | |
a16e1123 | 47 | AutomountState state, deserialized_state; |
5cb5a6ff | 48 | |
8d567588 LP |
49 | char *where; |
50 | ||
8d567588 | 51 | int pipe_fd; |
718db961 | 52 | sd_event_source *pipe_event_source; |
7fab9d01 | 53 | mode_t directory_mode; |
8d567588 LP |
54 | dev_t dev_id; |
55 | ||
56 | Set *tokens; | |
57 | ||
81a5c6d0 | 58 | AutomountResult result; |
5cb5a6ff LP |
59 | }; |
60 | ||
87f0e418 | 61 | extern const UnitVTable automount_vtable; |
5cb5a6ff | 62 | |
8d567588 LP |
63 | int automount_send_ready(Automount *a, int status); |
64 | ||
44a6b1b6 ZJS |
65 | const char* automount_state_to_string(AutomountState i) _const_; |
66 | AutomountState automount_state_from_string(const char *s) _pure_; | |
a16e1123 | 67 | |
44a6b1b6 ZJS |
68 | const char* automount_result_to_string(AutomountResult i) _const_; |
69 | AutomountResult automount_result_from_string(const char *s) _pure_; |