int ctdb_ctrl_setrecmode(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, uint32_t recmode);
-/*
- get the recovery master of a remote node
- */
-struct ctdb_client_control_state *ctdb_ctrl_getrecmaster_send(
- struct ctdb_context *ctdb,
- TALLOC_CTX *mem_ctx,
- struct timeval timeout,
- uint32_t destnode);
-int ctdb_ctrl_getrecmaster_recv(struct ctdb_context *ctdb,
- TALLOC_CTX *mem_ctx,
- struct ctdb_client_control_state *state,
- uint32_t *recmaster);
-int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
- struct timeval timeout, uint32_t destnode,
- uint32_t *recmaster);
-
-/*
- set the recovery master of a remote node
- */
-int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout,
- uint32_t destnode, uint32_t recmaster);
-
int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, TALLOC_CTX *mem_ctx,
struct ctdb_node_map_old **nodemap);
-/*
- get the recovery master of a remote node
- */
-struct ctdb_client_control_state *
-ctdb_ctrl_getrecmaster_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
- struct timeval timeout, uint32_t destnode)
-{
- return ctdb_control_send(ctdb, destnode, 0,
- CTDB_CONTROL_GET_RECMASTER, 0, tdb_null,
- mem_ctx, &timeout, NULL);
-}
-
-int ctdb_ctrl_getrecmaster_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, uint32_t *recmaster)
-{
- int ret;
- int32_t res;
-
- ret = ctdb_control_recv(ctdb, state, mem_ctx, NULL, &res, NULL);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_ctrl_getrecmaster_recv failed\n"));
- return -1;
- }
-
- if (recmaster) {
- *recmaster = (uint32_t)res;
- }
-
- return 0;
-}
-
-int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode, uint32_t *recmaster)
-{
- struct ctdb_client_control_state *state;
-
- state = ctdb_ctrl_getrecmaster_send(ctdb, mem_ctx, timeout, destnode);
- return ctdb_ctrl_getrecmaster_recv(ctdb, mem_ctx, state, recmaster);
-}
-
-
-/*
- set the recovery master of a remote node
- */
-int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmaster)
-{
- int ret;
- TDB_DATA data;
- int32_t res;
-
- ZERO_STRUCT(data);
- data.dsize = sizeof(uint32_t);
- data.dptr = (unsigned char *)&recmaster;
-
- ret = ctdb_control(ctdb, destnode, 0,
- CTDB_CONTROL_SET_RECMASTER, 0, data,
- NULL, NULL, &res, &timeout, NULL);
- if (ret != 0 || res != 0) {
- DEBUG(DEBUG_ERR,(__location__ " ctdb_control for setrecmaster failed\n"));
- return -1;
- }
-
- return 0;
-}
-
-
/*
get a list of nodes (vnn and flags ) from a remote node
*/