| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "sd-id128.h" |
| 5 |
|
| 6 |
#include "runtime-scope.h" |
| 7 |
#include "shared-forward.h" |
| 8 |
|
| 9 |
typedef struct MachineRegistration { |
| 10 |
const char *name; |
| 11 |
sd_id128_t id; |
| 12 |
const char *service; |
| 13 |
const char *class; |
| 14 |
const PidRef *pidref; |
| 15 |
const char *root_directory; |
| 16 |
unsigned vsock_cid; |
| 17 |
int local_ifindex; |
| 18 |
const char *ssh_address; |
| 19 |
const char *ssh_private_key_path; |
| 20 |
const char *control_address; |
| 21 |
bool allocate_unit; |
| 22 |
} MachineRegistration; |
| 23 |
|
| 24 |
typedef struct MachineRegistrationContext { |
| 25 |
RuntimeScope scope; |
| 26 |
sd_bus *system_bus; |
| 27 |
sd_bus *user_bus; |
| 28 |
bool registered_system; |
| 29 |
bool registered_user; |
| 30 |
} MachineRegistrationContext; |
| 31 |
|
| 32 |
int register_machine( |
| 33 |
sd_bus *bus, |
| 34 |
const MachineRegistration *reg, |
| 35 |
RuntimeScope scope); |
| 36 |
int register_machine_with_fallback_and_log( |
| 37 |
MachineRegistrationContext *ctx, |
| 38 |
const MachineRegistration *reg, |
| 39 |
bool graceful); |
| 40 |
|
| 41 |
int unregister_machine(sd_bus *bus, const char *machine_name, RuntimeScope scope); |
| 42 |
void unregister_machine_with_fallback_and_log( |
| 43 |
const MachineRegistrationContext *ctx, |
| 44 |
const char *machine_name); |