| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "core-forward.h" |
| 5 |
#include "unit.h" |
| 6 |
|
| 7 |
typedef enum AutomountResult { |
| 8 |
AUTOMOUNT_SUCCESS, |
| 9 |
AUTOMOUNT_FAILURE_RESOURCES, |
| 10 |
AUTOMOUNT_FAILURE_UNMOUNTED, |
| 11 |
AUTOMOUNT_FAILURE_START_LIMIT_HIT, |
| 12 |
AUTOMOUNT_FAILURE_MOUNT_START_LIMIT_HIT, |
| 13 |
_AUTOMOUNT_RESULT_MAX, |
| 14 |
_AUTOMOUNT_RESULT_INVALID = -EINVAL, |
| 15 |
} AutomountResult; |
| 16 |
|
| 17 |
typedef struct Automount { |
| 18 |
Unit meta; |
| 19 |
|
| 20 |
AutomountState state, deserialized_state; |
| 21 |
|
| 22 |
char *where; |
| 23 |
char *extra_options; |
| 24 |
usec_t timeout_idle_usec; |
| 25 |
|
| 26 |
int pipe_fd; |
| 27 |
sd_event_source *pipe_event_source; |
| 28 |
mode_t directory_mode; |
| 29 |
dev_t dev_id; |
| 30 |
|
| 31 |
Set *tokens; |
| 32 |
Set *expire_tokens; |
| 33 |
|
| 34 |
sd_event_source *expire_event_source; |
| 35 |
|
| 36 |
AutomountResult result; |
| 37 |
} Automount; |
| 38 |
|
| 39 |
extern const UnitVTable automount_vtable; |
| 40 |
|
| 41 |
DECLARE_STRING_TABLE_LOOKUP(automount_result, AutomountResult); |
| 42 |
|
| 43 |
DEFINE_CAST(AUTOMOUNT, Automount); |