]>
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
13 __hidden
extern int lxc_make_abstract_socket_name(char *path
, size_t pathlen
, const char *lxcname
,
14 const char *lxcpath
, 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 __hidden
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 __hidden
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 __hidden
extern int lxc_add_state_client(int state_client_fd
, struct lxc_handler
*handler
,
52 lxc_state_t states
[MAX_STATE
]);
54 /* lxc_cmd_connect Connect to the container's command socket.
56 * @param[in] name Name of container to connect to.
57 * @param[in] lxcpath The lxcpath in which the container is running.
58 * @param[in] hashed_sock_name The hashed name of the socket (optional). Can be
61 * @return Return < 0 on error
64 __hidden
extern int lxc_cmd_connect(const char *name
, const char *lxcpath
,
65 const char *hashed_sock_name
, const char *suffix
);
67 __hidden
extern void lxc_cmd_notify_state_listeners(const char *name
,
70 #endif /* __LXC_COMMANDS_UTILS_H */