summaryrefslogtreecommitdiff
path: root/source3/include/messages.h
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-06-10 17:02:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:14 -0500
commitde565785f5e1f097bd75f57331425c4185185f80 (patch)
treeaf24bb44388f9ffa2077435cc3fea134557c186b /source3/include/messages.h
parentb05c7b97830f6029c264fc44831c2f5eae4f0c83 (diff)
downloadsamba-de565785f5e1f097bd75f57331425c4185185f80.tar.gz
samba-de565785f5e1f097bd75f57331425c4185185f80.tar.bz2
samba-de565785f5e1f097bd75f57331425c4185185f80.zip
r23410: Merge the core of the cluster code.
I'm 100% certain I've forgotten to merge something, but the main code should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and messages_ctdbd.c. There should be no changes to the non-cluster case, it does survive make test on my laptop. It survives some very basic tests with ctdbd enables, I did not do the full test suite for clusters yet. Phew... Volker (This used to be commit 15553d6327a3aecdd2b0b94a3656d04bf4106323)
Diffstat (limited to 'source3/include/messages.h')
-rw-r--r--source3/include/messages.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 5ba2f45bd2..bf5f49b872 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -119,10 +119,35 @@
#define FLAG_MSG_PRINT_NOTIFY 0x0008
#define FLAG_MSG_PRINT_GENERAL 0x0010
+
+/*
+ * Virtual Node Numbers are identifying a node within a cluster. Ctdbd sets
+ * this, we retrieve our vnn from it.
+ */
+
+#define NONCLUSTER_VNN (0xFFFFFFFF)
+
+/*
+ * ctdb gives us 64-bit server ids for messaging_send. This is done to avoid
+ * pid clashes and to be able to register for special messages like "all
+ * smbds".
+ *
+ * Normal individual server id's have the upper 32 bits to 0, I picked "1" for
+ * Samba, other subsystems might use something else.
+ */
+
+#define MSG_SRVID_SAMBA 0x0000000100000000LL
+
+
struct server_id {
pid_t pid;
+#ifdef CLUSTER_SUPPORT
+ uint32 vnn;
+#endif
};
+
+
struct messaging_context;
struct messaging_rec;
struct data_blob;
@@ -139,6 +164,7 @@ struct messaging_context {
struct messaging_callback *callbacks;
struct messaging_backend *local;
+ struct messaging_backend *remote;
};
struct messaging_backend {
@@ -154,6 +180,10 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
struct messaging_backend **presult);
void message_dispatch(struct messaging_context *msg_ctx);
+NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
+ TALLOC_CTX *mem_ctx,
+ struct messaging_backend **presult);
+struct ctdbd_connection *messaging_ctdbd_connection(void);
BOOL message_send_all(struct messaging_context *msg_ctx,
int msg_type,
@@ -163,6 +193,12 @@ struct event_context *messaging_event_context(struct messaging_context *msg_ctx)
struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx,
struct server_id server_id,
struct event_context *ev);
+
+/*
+ * re-init after a fork
+ */
+NTSTATUS messaging_reinit(struct messaging_context *msg_ctx);
+
NTSTATUS messaging_register(struct messaging_context *msg_ctx,
void *private_data,
uint32_t msg_type,