summaryrefslogtreecommitdiff
path: root/source4/cluster/ctdb/common/ctdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-08 02:57:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:49 -0500
commitaa40cc408b7b50f265913b5107932e237ce032a6 (patch)
tree8e40f4c3c68083b1477a5984d0e819fe81b2fcd1 /source4/cluster/ctdb/common/ctdb.c
parent07478016d7354274cd53ff2b4ec1dda3f0f439d1 (diff)
downloadsamba-aa40cc408b7b50f265913b5107932e237ce032a6.tar.gz
samba-aa40cc408b7b50f265913b5107932e237ce032a6.tar.bz2
samba-aa40cc408b7b50f265913b5107932e237ce032a6.zip
r21232: added a raw ctdb messaging api - allowing ctdb applications to take
advantage of the ctdb messaging layer for their own data (This used to be commit b288ba05e5dc2aa5c8cd26eaee1c41b12e4996da)
Diffstat (limited to 'source4/cluster/ctdb/common/ctdb.c')
-rw-r--r--source4/cluster/ctdb/common/ctdb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/cluster/ctdb/common/ctdb.c b/source4/cluster/ctdb/common/ctdb.c
index ecef14bca4..9e92059b95 100644
--- a/source4/cluster/ctdb/common/ctdb.c
+++ b/source4/cluster/ctdb/common/ctdb.c
@@ -212,6 +212,10 @@ static void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t len
ctdb_reply_dmaster(ctdb, hdr);
break;
+ case CTDB_REQ_MESSAGE:
+ ctdb_request_message(ctdb, hdr);
+ break;
+
default:
printf("Packet with unknown operation %d\n", hdr->operation);
talloc_free(hdr);
@@ -267,6 +271,20 @@ void ctdb_wait_loop(struct ctdb_context *ctdb)
}
}
+
+/*
+ queue a packet or die
+*/
+void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
+{
+ struct ctdb_node *node;
+ node = ctdb->nodes[hdr->destnode];
+ if (ctdb->methods->queue_pkt(node, (uint8_t *)hdr, hdr->length) != 0) {
+ ctdb_fatal(ctdb, "Unable to queue packet\n");
+ }
+}
+
+
static const struct ctdb_upcalls ctdb_upcalls = {
.recv_pkt = ctdb_recv_pkt,
.node_dead = ctdb_node_dead,