summaryrefslogtreecommitdiffstats
path: root/ctdb/include/ctdb.h
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2011-12-12 16:48:10 +1100
committerMartin Schwenke <martin@meltin.net>2012-02-06 16:00:23 +1100
commited8a8ee966ee84a45832492be56cfb36f611037e (patch)
tree31249cffcb1686f20129ace85fcad36328e48470 /ctdb/include/ctdb.h
parent97863216eddc77002bf26e2e4d05f7367790137d (diff)
downloadsamba-ed8a8ee966ee84a45832492be56cfb36f611037e.tar.gz
samba-ed8a8ee966ee84a45832492be56cfb36f611037e.tar.xz
samba-ed8a8ee966ee84a45832492be56cfb36f611037e.zip
libctdb - add ctdb_getvnnmap()
Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit f6039eaece4224b866a98dd49010f278a7b3f015)
Diffstat (limited to 'ctdb/include/ctdb.h')
-rw-r--r--ctdb/include/ctdb.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h
index 795ff5c18cc..8dbdd47e1e2 100644
--- a/ctdb/include/ctdb.h
+++ b/ctdb/include/ctdb.h
@@ -744,6 +744,38 @@ bool ctdb_getrecmode_recv(struct ctdb_connection *ctdb,
uint32_t *recmode);
/**
+ * ctdb_getvnnmap_send - read the vnn map from a node.
+ * @ctdb: the ctdb_connection from ctdb_connect.
+ * @destnode: the destination node (see below)
+ * @callback: the callback when ctdb replies to our message (typesafe)
+ * @cbdata: the argument to callback()
+ *
+ * There are several special values for destnode, detailed in
+ * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
+ * local ctdbd.
+ */
+struct ctdb_request *
+ctdb_getvnnmap_send(struct ctdb_connection *ctdb,
+ uint32_t destnode,
+ ctdb_callback_t callback,
+ void *cbdata);
+/**
+ * ctdb_getvnnmap_recv - read an ctdb_getvnnmap reply from ctdbd
+ * @ctdb: the ctdb_connection from ctdb_connect.
+ * @req: the completed request.
+ * @vnnmap: the list of interfaces
+ *
+ * This returns false if something went wrong.
+ * If the command failed, it guarantees to set vnnmap to NULL.
+ * A non-NULL value for vnnmap means the command was successful.
+ *
+ * A non-NULL value of the vnnmap must be released/freed
+ * by ctdb_free_vnnmap().
+ */
+bool ctdb_getvnnmap_recv(struct ctdb_connection *ctdb,
+ struct ctdb_request *req, struct ctdb_vnn_map **vnnmap);
+
+/**
* ctdb_cancel - cancel an uncompleted request
* @ctdb: the ctdb_connection from ctdb_connect.
* @req: the uncompleted request.
@@ -989,6 +1021,29 @@ bool ctdb_getpublicips(struct ctdb_connection *ctdb,
void ctdb_free_publicips(struct ctdb_all_public_ips *ips);
+/**
+ * ctdb_getvnnmap - read the vnn map from a node (synchronous)
+ * @ctdb: the ctdb_connection from ctdb_connect.
+ * @destnode: the destination node (see below)
+ * @vnnmap: a pointer to the vnnmap to fill in
+ *
+ * There are several special values for destnode, detailed in
+ * ctdb_protocol.h, particularly CTDB_CURRENT_NODE which means the
+ * local ctdbd.
+ *
+ * Returns true and fills in *vnnmap on success.
+ * A non-NULL value of the vnnmap must be released/freed
+ * by ctdb_free_vnnmap().
+ */
+bool ctdb_getvnnmap(struct ctdb_connection *ctdb,
+ uint32_t destnode, struct ctdb_vnn_map **vnnmap);
+
+/*
+ * This function is used to release/free the vnnmap structure returned
+ * by ctdb_getvnnmap() and ctdb_getvnnmap_recv()
+ */
+void ctdb_free_vnnmap(struct ctdb_vnn_map *vnnmap);
+
/* These ugly macro wrappers make the callbacks typesafe. */
#include <ctdb_typesafe_cb.h>
#define ctdb_sendcb(cb, cbdata) \
@@ -1067,4 +1122,8 @@ void ctdb_free_publicips(struct ctdb_all_public_ips *ips);
ctdb_getifaces_send((ctdb), (destnode), \
ctdb_sendcb((cb), (cbdata)), (cbdata))
+#define ctdb_getvnnmap_send(ctdb, destnode, cb, cbdata) \
+ ctdb_getvnnmap_send((ctdb), (destnode), \
+ ctdb_sendcb((cb), (cbdata)), (cbdata))
+
#endif