1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2013 Lennart Poettering
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.
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.
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/>.
24 typedef struct BusName BusName;
25 typedef struct BusNamePolicy BusNamePolicy;
29 typedef enum BusNameState {
39 _BUSNAME_STATE_INVALID = -1
42 typedef enum BusNameResult {
44 BUSNAME_FAILURE_RESOURCES,
45 BUSNAME_FAILURE_TIMEOUT,
46 BUSNAME_FAILURE_EXIT_CODE,
47 BUSNAME_FAILURE_SIGNAL,
48 BUSNAME_FAILURE_CORE_DUMP,
49 BUSNAME_FAILURE_SERVICE_FAILED_PERMANENT,
51 _BUSNAME_RESULT_INVALID = -1
54 typedef enum BusNamePolicyType {
55 BUSNAME_POLICY_TYPE_USER,
56 BUSNAME_POLICY_TYPE_GROUP,
57 _BUSNAME_POLICY_TYPE_MAX,
58 _BUSNAME_POLICY_TYPE_INVALID = -1
61 typedef enum BusNamePolicyAccess {
62 BUSNAME_POLICY_ACCESS_SEE,
63 BUSNAME_POLICY_ACCESS_TALK,
64 BUSNAME_POLICY_ACCESS_OWN,
65 _BUSNAME_POLICY_ACCESS_MAX,
66 _BUSNAME_POLICY_ACCESS_INVALID = -1
67 } BusNamePolicyAccess;
69 struct BusNamePolicy {
70 BusNamePolicyType type;
71 BusNamePolicyAccess access;
75 LIST_FIELDS(BusNamePolicy, policy);
89 BusNameState state, deserialized_state;
94 sd_event_source *starter_event_source;
95 sd_event_source *timer_event_source;
99 LIST_HEAD(BusNamePolicy, policy);
100 BusNamePolicyAccess policy_world;
103 extern const UnitVTable busname_vtable;
105 const char* busname_state_to_string(BusNameState i) _const_;
106 BusNameState busname_state_from_string(const char *s) _pure_;
108 const char* busname_result_to_string(BusNameResult i) _const_;
109 BusNameResult busname_result_from_string(const char *s) _pure_;
111 const char* busname_policy_access_to_string(BusNamePolicyAccess i) _const_;
112 BusNamePolicyAccess busname_policy_access_from_string(const char *s) _pure_;