1SD_MACHINE_GET_CLASS(3)      sd_machine_get_class      SD_MACHINE_GET_CLASS(3)
2
3
4

NAME

6       sd_machine_get_class, sd_machine_get_ifindices - Determine the class
7       and network interface indices of a locally running virtual machine or
8       container.
9

SYNOPSIS

11       #include <systemd/sd-login.h>
12
13       int sd_machine_get_class(const char* machine, char **class);
14
15       int sd_machine_get_ifindices(const char* machine, int **ifindices);
16

DESCRIPTION

18       sd_machine_get_class() may be used to determine the class of a locally
19       running virtual machine or container that is registered with systemd-
20       machined.service(8). The string returned is either "vm" or "container".
21       The returned string needs to be freed with the libc free(3) call after
22       use.
23
24       sd_machine_get_ifindices() may be used to determine the numeric indices
25       of the network interfaces on the host that are pointing towards the
26       specified locally running virtual machine or container that is
27       registered with systemd-machined.service(8). The returned array needs
28       to be freed with the libc free(3) call after use.
29

RETURN VALUE

31       On success, these calls return 0 or a positive integer. On failure,
32       these calls return a negative errno-style error code.
33

ERRORS

35       Returned errors may indicate the following problems:
36
37       -ENXIO
38           The specified machine does not exist or is currently not running.
39
40       -EINVAL
41           An input parameter was invalid (out of range, or NULL, where that
42           is not accepted).
43
44       -ENOMEM
45           Memory allocation failed.
46

NOTES

48       These APIs are implemented as a shared library, which can be compiled
49       and linked to with the libsystemd pkg-config(1) file.
50

SEE ALSO

52       systemd(1), sd-login(3), systemd-machined.service(8),
53       sd_pid_get_machine_name(3)
54
55
56
57systemd 239                                            SD_MACHINE_GET_CLASS(3)
Impressum