return 0;
}
-
+/*
+ get vnn of a node, or -1
+ */
+int ctdb_ctrl_getvnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode)
+{
+ int ret;
+ int32_t res;
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_GET_VNN, 0, tdb_null,
+ NULL, NULL, &res, &timeout, NULL);
+ if (ret != 0) {
+ DEBUG(0,(__location__ " ctdb_control for getvnn failed\n"));
+ return -1;
+ }
+
+ return res;
+}
++
+ /*
+ set the monitoring mode of a remote node
+ */
+ int ctdb_ctrl_setmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t monmode)
+ {
+ int ret;
+ TDB_DATA data, outdata;
+ int32_t res;
+
+ data.dsize = sizeof(uint32_t);
+ data.dptr = (unsigned char *)&monmode;
+
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_SET_MONMODE, 0, data,
+ ctdb, &outdata, &res, &timeout, NULL);
+ if (ret != 0 || res != 0) {
+ DEBUG(0,(__location__ " ctdb_control for setmonmode failed\n"));
+ return -1;
+ }
+
+ return 0;
+ }
+
+ /*
+ get the monitoring mode of a remote node
+ */
+ int ctdb_ctrl_getmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *monmode)
+ {
+ int ret;
+ TDB_DATA data, outdata;
+ int32_t res;
+
+ ZERO_STRUCT(data);
+ ret = ctdb_control(ctdb, destnode, 0,
+ CTDB_CONTROL_GET_MONMODE, 0, data,
+ ctdb, &outdata, &res, &timeout, NULL);
+ if (ret != 0) {
+ DEBUG(0,(__location__ " ctdb_control for getrecmode failed\n"));
+ return -1;
+ }
+
+ *monmode = res;
+
+ return 0;
+ }
-