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