}
-/*
- tell the daemon what messaging srvid we will use, and register the message
- handler function in the client
-*/
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
- ctdb_message_fn_t handler,
- void *private_data)
-
-{
- int res;
- int32_t status;
-
- res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_REGISTER_SRVID, 0,
- tdb_null, NULL, NULL, &status, NULL, NULL);
- if (res != 0 || status != 0) {
- DEBUG(DEBUG_ERR,("Failed to register srvid %llu\n", (unsigned long long)srvid));
- return -1;
- }
-
- /* also need to register the handler with our own ctdb structure */
- return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private_data);
-}
-
-/*
- tell the daemon we no longer want a srvid
-*/
-int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
-{
- int res;
- int32_t status;
-
- res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_DEREGISTER_SRVID, 0,
- tdb_null, NULL, NULL, &status, NULL, NULL);
- if (res != 0 || status != 0) {
- DEBUG(DEBUG_ERR,("Failed to deregister srvid %llu\n", (unsigned long long)srvid));
- return -1;
- }
-
- /* also need to register the handler with our own ctdb structure */
- ctdb_deregister_message_handler(ctdb, srvid, private_data);
- return 0;
-}
-
int ctdb_cancel(ctdb_handle *);
+
+/*
+ * messaging functions
+ */
+typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint64_t srvid, TDB_DATA data, void *);
+
+int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, ctdb_message_fn_t handler, void *private_data);
+
+int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data);
+
+int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn, uint64_t srvid, TDB_DATA data);
+
+
+
+
/*
* functions to read the recovery master of a node
*/
*/
uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb);
-/* setup a handler for ctdb messages */
-typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint64_t srvid,
- TDB_DATA data, void *);
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid,
- ctdb_message_fn_t handler,
- void *private_data);
-
int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call);
-/* send a ctdb message */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
- uint64_t srvid, TDB_DATA data);
-
/*
Fetch a ctdb record from a remote node