summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/server/ctdb_server.c')
-rw-r--r--ctdb/server/ctdb_server.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index dddf90753bd..2a80798dd93 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -35,6 +35,23 @@ int ctdb_set_transport(struct ctdb_context *ctdb, const char *transport)
}
/*
+ Check whether an ip is a valid node ip
+ Returns the node id for this ip address or -1
+*/
+int ctdb_ip_to_nodeid(struct ctdb_context *ctdb, const char *nodeip)
+{
+ int nodeid;
+
+ for (nodeid=0;nodeid<ctdb->num_nodes;nodeid++) {
+ if (!strcmp(ctdb->nodes[nodeid]->address.address, nodeip)) {
+ return nodeid;
+ }
+ }
+
+ return -1;
+}
+
+/*
choose the recovery lock file
*/
int ctdb_set_recovery_lock_file(struct ctdb_context *ctdb, const char *file)