]>
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 int lxc_make_abstract_socket_name(char *path
, size_t pathlen
,
14 const char *hashed_sock_name
,
17 /* lxc_cmd_sock_get_state Register a new state client fd in the container's
18 * in-memory handler and retrieve the requested
21 * @param[in] name Name of container to connect to.
22 * @param[in] lxcpath The lxcpath in which the container is running.
23 * @param[in] states The states to wait for.
24 * @return Return < 0 on error
25 * < MAX_STATE current container state
27 extern int lxc_cmd_sock_get_state(const char *name
, const char *lxcpath
,
28 lxc_state_t states
[MAX_STATE
], int timeout
);
30 /* lxc_cmd_sock_rcv_state Retrieve the requested state from a state client
31 * fd registerd in the container's in-memory
34 * @param[int] state_client_fd The state client fd from which the state can be
36 * @return Return < 0 on error
37 * < MAX_STATE current container state
39 extern int lxc_cmd_sock_rcv_state(int state_client_fd
, int timeout
);
41 /* lxc_add_state_client Add a new state client to the container's
44 * @param[int] state_client_fd The state client fd to add.
45 * @param[int] handler The container's in-memory handler.
46 * @param[in] states The states to wait for.
48 * @return Return < 0 on error
51 extern int lxc_add_state_client(int state_client_fd
,
52 struct lxc_handler
*handler
,
53 lxc_state_t states
[MAX_STATE
]);
55 /* lxc_cmd_connect Connect to the container's command socket.
57 * @param[in] name Name of container to connect to.
58 * @param[in] lxcpath The lxcpath in which the container is running.
59 * @param[in] hashed_sock_name The hashed name of the socket (optional). Can be
62 * @return Return < 0 on error
65 extern int lxc_cmd_connect(const char *name
, const char *lxcpath
,
66 const char *hashed_sock_name
, const char *suffix
);
68 #endif /* __LXC_COMMANDS_UTILS_H */