]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
6c12b52e LP |
2 | #pragma once |
3 | ||
4 | /*** | |
6c12b52e | 5 | Copyright 2013 Lennart Poettering |
6c12b52e LP |
6 | ***/ |
7 | ||
8 | typedef struct Scope Scope; | |
9 | ||
9ce93478 | 10 | #include "cgroup.h" |
6c12b52e | 11 | #include "kill.h" |
9ce93478 | 12 | #include "unit.h" |
6c12b52e | 13 | |
6c12b52e LP |
14 | typedef enum ScopeResult { |
15 | SCOPE_SUCCESS, | |
16 | SCOPE_FAILURE_RESOURCES, | |
17 | SCOPE_FAILURE_TIMEOUT, | |
18 | _SCOPE_RESULT_MAX, | |
19 | _SCOPE_RESULT_INVALID = -1 | |
20 | } ScopeResult; | |
21 | ||
22 | struct Scope { | |
23 | Unit meta; | |
24 | ||
25 | CGroupContext cgroup_context; | |
26 | KillContext kill_context; | |
27 | ||
28 | ScopeState state, deserialized_state; | |
29 | ScopeResult result; | |
30 | ||
31 | usec_t timeout_stop_usec; | |
32 | ||
2d4a39e7 | 33 | char *controller; |
371c0b79 LP |
34 | sd_bus_track *controller_track; |
35 | ||
3862e809 | 36 | bool was_abandoned; |
2d4a39e7 | 37 | |
718db961 | 38 | sd_event_source *timer_event_source; |
6c12b52e LP |
39 | }; |
40 | ||
41 | extern const UnitVTable scope_vtable; | |
42 | ||
a911bb9a LP |
43 | int scope_abandon(Scope *s); |
44 | ||
6c12b52e LP |
45 | const char* scope_result_to_string(ScopeResult i) _const_; |
46 | ScopeResult scope_result_from_string(const char *s) _pure_; | |
57b7a260 FS |
47 | |
48 | DEFINE_CAST(SCOPE, Scope); |