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