| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
typedef enum ExecDirectoryFlags { |
| 7 |
EXEC_DIRECTORY_READ_ONLY = 1 << 0, /* Public API via DBUS, do not change */ |
| 8 |
EXEC_DIRECTORY_ONLY_CREATE = 1 << 1, /* Only the private directory will be created, not the symlink to it */ |
| 9 |
_EXEC_DIRECTORY_FLAGS_MAX, |
| 10 |
_EXEC_DIRECTORY_FLAGS_PUBLIC = EXEC_DIRECTORY_READ_ONLY, |
| 11 |
_EXEC_DIRECTORY_FLAGS_INVALID = -EINVAL, |
| 12 |
} ExecDirectoryFlags; |
| 13 |
|
| 14 |
DECLARE_STRING_TABLE_LOOKUP_FROM_STRING(exec_directory_flags, ExecDirectoryFlags); |
| 15 |
|
| 16 |
typedef struct UnitInfo { |
| 17 |
const char *machine; |
| 18 |
const char *id; |
| 19 |
const char *description; |
| 20 |
const char *load_state; |
| 21 |
const char *active_state; |
| 22 |
const char *sub_state; |
| 23 |
const char *following; |
| 24 |
const char *unit_path; |
| 25 |
uint32_t job_id; |
| 26 |
const char *job_type; |
| 27 |
const char *job_path; |
| 28 |
} UnitInfo; |
| 29 |
|
| 30 |
int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u); |
| 31 |
|
| 32 |
int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const char *assignment); |
| 33 |
int bus_append_unit_property_assignment_many(sd_bus_message *m, UnitType t, char * const *l); |
| 34 |
|
| 35 |
int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref, bool allow_pidfd); |
| 36 |
|
| 37 |
int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet); |
| 38 |
|
| 39 |
int unit_load_state(sd_bus *bus, const char *name, char **ret); |
| 40 |
|
| 41 |
int unit_info_compare(const UnitInfo *a, const UnitInfo *b); |
| 42 |
|
| 43 |
int bus_service_manager_reload(sd_bus *bus); |
| 44 |
|
| 45 |
typedef struct UnitFreezer UnitFreezer; |
| 46 |
|
| 47 |
UnitFreezer* unit_freezer_free(UnitFreezer *f); |
| 48 |
DEFINE_TRIVIAL_CLEANUP_FUNC(UnitFreezer*, unit_freezer_free); |
| 49 |
|
| 50 |
int unit_freezer_new(const char *name, UnitFreezer **ret); |
| 51 |
|
| 52 |
int unit_freezer_freeze(UnitFreezer *f); |
| 53 |
int unit_freezer_thaw(UnitFreezer *f); |
| 54 |
|
| 55 |
void bus_dump_transient_settings(UnitType t); |