]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/automount.h
use #pragma once instead of foo*foo #define guards
[thirdparty/systemd.git] / src / core / automount.h
CommitLineData
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
24typedef struct Automount Automount;
25
87f0e418 26#include "unit.h"
5cb5a6ff
LP
27
28typedef 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
37typedef enum AutomountResult {
38 AUTOMOUNT_SUCCESS,
39 AUTOMOUNT_FAILURE_RESOURCES,
40 _AUTOMOUNT_RESULT_MAX,
41 _AUTOMOUNT_RESULT_INVALID = -1
42} AutomountResult;
43
5cb5a6ff 44struct Automount {
ac155bb8 45 Unit meta;
5cb5a6ff 46
a16e1123 47 AutomountState state, deserialized_state;
5cb5a6ff 48
8d567588
LP
49 char *where;
50
57020a3a 51 UnitRef mount;
8d567588
LP
52
53 int pipe_fd;
7fab9d01 54 mode_t directory_mode;
8d567588
LP
55 Watch pipe_watch;
56 dev_t dev_id;
57
58 Set *tokens;
59
81a5c6d0 60 AutomountResult result;
5cb5a6ff
LP
61};
62
87f0e418 63extern const UnitVTable automount_vtable;
5cb5a6ff 64
8d567588
LP
65int automount_send_ready(Automount *a, int status);
66
6e2ef85b
LP
67int automount_add_one_mount_link(Automount *a, Mount *m);
68
a16e1123
LP
69const char* automount_state_to_string(AutomountState i);
70AutomountState automount_state_from_string(const char *s);
71
81a5c6d0
LP
72const char* automount_result_to_string(AutomountResult i);
73AutomountResult automount_result_from_string(const char *s);