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