}
-/*
- 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;
-}
-