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