diff options
author | Martin Schwenke <martin@meltin.net> | 2012-07-18 14:24:08 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-09-28 17:05:34 +1000 |
commit | e05fc0e7b0cb78ad6e6b0ce5119d93f418886662 (patch) | |
tree | 0e1906dead0e00e4c924bd8f70f37f21dd9b775a /ctdb/include/ctdb.h | |
parent | 110cb67e2ae5efc6324663e50de080097c5cdda7 (diff) | |
download | samba-e05fc0e7b0cb78ad6e6b0ce5119d93f418886662.tar.gz samba-e05fc0e7b0cb78ad6e6b0ce5119d93f418886662.tar.xz samba-e05fc0e7b0cb78ad6e6b0ce5119d93f418886662.zip |
libctdb: add ctdb_getcapabilities()
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 140fafef23050d40d66f5b5558c7efcb78f80cd2)
Diffstat (limited to 'ctdb/include/ctdb.h')
-rw-r--r-- | ctdb/include/ctdb.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h index 93224cbdaa..c3da06897c 100644 --- a/ctdb/include/ctdb.h +++ b/ctdb/include/ctdb.h @@ -585,6 +585,35 @@ ctdb_check_message_handlers_recv(struct ctdb_connection *ctdb, /** + * ctdb_getcapabilities_send - read the capabilities of 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_getcapabilities_send(struct ctdb_connection *ctdb, + uint32_t destnode, + ctdb_callback_t callback, void *cbdata); + +/** + * ctdb_getcapabilities_recv - read an ctdb_getcapabilities reply from ctdbd + * @ctdb: the ctdb_connection from ctdb_connect. + * @req: the completed request. + * @capabilities: a pointer to the capabilities to fill in + * + * This returns false if something went wrong, or otherwise fills in + * capabilities. + */ +bool ctdb_getcapabilities_recv(struct ctdb_connection *ctdb, + struct ctdb_request *handle, + uint32_t *capabilities); + +/** * ctdb_getdbseqnum_send - read the sequence number off a db * @ctdb: the ctdb_connection from ctdb_connect. * @destnode: the destination node (see below) @@ -950,6 +979,23 @@ ctdb_check_message_handlers(struct ctdb_connection *ctdb, uint8_t *result); /** + * ctdb_getcapabilities - read the capabilities of a node (synchronous) + * @ctdb: the ctdb_connection from ctdb_connect. + * @destnode: the destination node (see below) + * @capabilities: a pointer to the capabilities 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 *capabilities on success. + */ +bool ctdb_getcapabilities(struct ctdb_connection *ctdb, + uint32_t destnode, + uint32_t *capabilities); + + +/** * ctdb_getdbseqnum - read the seqnum of a database * @ctdb: the ctdb_connection from ctdb_connect. * @destnode: the destination node (see below) @@ -1145,6 +1191,10 @@ void ctdb_free_vnnmap(struct ctdb_vnn_map *vnnmap); ctdb_getpnn_send((ctdb), (destnode), \ ctdb_sendcb((cb), (cbdata)), (cbdata)) +#define ctdb_getcapabilities_send(ctdb, destnode, cb, cbdata) \ + ctdb_getcapabilities_send((ctdb), (destnode), \ + ctdb_sendcb((cb), (cbdata)), (cbdata)) + #define ctdb_getdbstat_send(ctdb, destnode, db_id, cb, cbdata) \ ctdb_getdbstat_send((ctdb), (destnode), (db_id), \ ctdb_sendcb((cb), (cbdata)), (cbdata)) |