]>
Commit | Line | Data |
---|---|---|
e821075a LP |
1 | #pragma once |
2 | ||
3 | /*** | |
4 | This file is part of systemd. | |
5 | ||
6 | Copyright 2013 Lennart Poettering | |
7 | ||
8 | systemd is free software; you can redistribute it and/or modify it | |
9 | under the terms of the GNU Lesser General Public License as published by | |
10 | the Free Software Foundation; either version 2.1 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | systemd is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | Lesser General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU Lesser General Public License | |
19 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
20 | ***/ | |
21 | ||
22 | typedef struct BusName BusName; | |
54d76c92 | 23 | typedef struct BusNamePolicy BusNamePolicy; |
e821075a | 24 | |
07630cea LP |
25 | #include "unit.h" |
26 | ||
e821075a LP |
27 | typedef enum BusNameResult { |
28 | BUSNAME_SUCCESS, | |
29 | BUSNAME_FAILURE_RESOURCES, | |
a4152e3f LP |
30 | BUSNAME_FAILURE_TIMEOUT, |
31 | BUSNAME_FAILURE_EXIT_CODE, | |
32 | BUSNAME_FAILURE_SIGNAL, | |
33 | BUSNAME_FAILURE_CORE_DUMP, | |
e821075a LP |
34 | BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT, |
35 | _BUSNAME_RESULT_MAX, | |
36 | _BUSNAME_RESULT_INVALID = -1 | |
37 | } BusNameResult; | |
38 | ||
a4152e3f LP |
39 | struct BusName { |
40 | Unit meta; | |
41 | ||
42 | char *name; | |
43 | int starter_fd; | |
44 | ||
45 | bool activating; | |
46 | bool accept_fd; | |
47 | ||
48 | UnitRef service; | |
49 | ||
50 | BusNameState state, deserialized_state; | |
51 | BusNameResult result; | |
52 | ||
53 | usec_t timeout_usec; | |
54 | ||
55 | sd_event_source *starter_event_source; | |
56 | sd_event_source *timer_event_source; | |
57 | ||
58 | pid_t control_pid; | |
59 | ||
60 | LIST_HEAD(BusNamePolicy, policy); | |
5369c77d | 61 | BusPolicyAccess policy_world; |
a4152e3f LP |
62 | }; |
63 | ||
e821075a LP |
64 | extern const UnitVTable busname_vtable; |
65 | ||
e821075a LP |
66 | const char* busname_result_to_string(BusNameResult i) _const_; |
67 | BusNameResult busname_result_from_string(const char *s) _pure_; |