]>
git.proxmox.com Git - mirror_lxc.git/blob - src/lxc/commands_utils.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
3 #ifndef __LXC_COMMANDS_UTILS_H
4 #define __LXC_COMMANDS_UTILS_H
11 __hidden
extern int lxc_make_abstract_socket_name(char *path
, size_t pathlen
, const char *lxcname
,
12 const char *lxcpath
, const char *hashed_sock_name
,
15 /* lxc_cmd_sock_get_state Register a new state client fd in the container's
16 * in-memory handler and retrieve the requested
19 * @param[in] name Name of container to connect to.
20 * @param[in] lxcpath The lxcpath in which the container is running.
21 * @param[in] states The states to wait for.
22 * @return Return < 0 on error
23 * < MAX_STATE current container state
25 __hidden
extern int lxc_cmd_sock_get_state(const char *name
, const char *lxcpath
,
26 lxc_state_t states
[MAX_STATE
], int timeout
);
28 /* lxc_cmd_sock_rcv_state Retrieve the requested state from a state client
29 * fd registerd in the container's in-memory
32 * @param[int] state_client_fd The state client fd from which the state can be
34 * @return Return < 0 on error
35 * < MAX_STATE current container state
37 __hidden
extern int lxc_cmd_sock_rcv_state(int state_client_fd
, int timeout
);
39 /* lxc_add_state_client Add a new state client to the container's
42 * @param[int] state_client_fd The state client fd to add.
43 * @param[int] handler The container's in-memory handler.
44 * @param[in] states The states to wait for.
46 * @return Return < 0 on error
49 __hidden
extern int lxc_add_state_client(int state_client_fd
, struct lxc_handler
*handler
,
50 lxc_state_t states
[MAX_STATE
]);
52 /* lxc_cmd_connect Connect to the container's command socket.
54 * @param[in] name Name of container to connect to.
55 * @param[in] lxcpath The lxcpath in which the container is running.
56 * @param[in] hashed_sock_name The hashed name of the socket (optional). Can be
59 * @return Return < 0 on error
62 __hidden
extern int lxc_cmd_connect(const char *name
, const char *lxcpath
,
63 const char *hashed_sock_name
, const char *suffix
);
65 #endif /* __LXC_COMMANDS_UTILS_H */