move messaging functions into libctdb
[sahlberg/ctdb.git] / client / ctdb_client.c
index 1afa66a353a4bc78252bddf957795947d4fd603b..f8e98b54fc66d9856212cfcd445e0e615bc189f8 100644 (file)
@@ -95,49 +95,6 @@ int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call)
 }
 
 
-/*
-  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;
-}
-