#include "rpc_server/common/common.h"
#include "lib/witness/witness.h"
#include "param/param.h"
+#include "system/network.h"
+#include <ctdb_protocol.h>
+#include <ctdb_client.h>
+#include "messages.h"
+#include "ctdbd_conn.h"
+#include "lib/messages_ctdb.h"
+#include "libcli/util/error.h"
/* FIXME */
#define ADD_TO_ARRAY(mem_ctx, type, elem, array, num) \
return NT_STATUS_FOOBAR;
}
+ if (lpcfg_clustering(dce_call->conn->dce_ctx->lp_ctx)) {
+
+ struct ctdbd_connection *conn;
+ int ret;
+
+ conn = messaging_ctdb_connection();
+ if (conn == NULL) {
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ ret = register_with_ctdbd(conn,
+ CTDB_SRVID_RECONFIGURE,
+ witnessd_ctdb_reconfigured,
+ dce_call->msg_ctx);
+ if (ret != 0) {
+ DEBUG(1,("%s: failed to register for event\n", __location__));
+ return map_nt_error_from_unix_common(ret);
+ }
+
+ ret = register_with_ctdbd(conn,
+ CTDB_SRVID_RELEASE_IP,
+ witnessd_ctdb_reconfigured,
+ dce_call->msg_ctx);
+ if (ret != 0) {
+ DEBUG(1,("%s: failed to register for event\n", __location__));
+ return map_nt_error_from_unix_common(ret);
+ }
+
+ ret = register_with_ctdbd(conn,
+ CTDB_SRVID_TAKE_IP,
+ witnessd_ctdb_reconfigured,
+ dce_call->msg_ctx);
+ if (ret != 0) {
+ DEBUG(1,("%s: failed to register for event\n", __location__));
+ return map_nt_error_from_unix_common(ret);
+ }
+ DEBUG(1,("%s: registered for three events\n", __location__));
+ }
+
return NT_STATUS_OK;
}