create macros that define that all server ids for messaging where
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 18 May 2010 02:41:13 +0000 (12:41 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 18 May 2010 02:41:13 +0000 (12:41 +1000)
the top 32 bits are all zero are reserved for samba

allocate the prefix 0x00000001 for test purposes

include/ctdb_protocol.h

index 8eda5d44d628b2336ebf4f800e829c0da316e880..58be9e78cebdb8aeddfdd3d76f7395c10e75b1de 100644 (file)
@@ -50,6 +50,25 @@ struct ctdb_call_info {
 */
 #define CTDB_FLAG_TORTURE      (1<<1)
 
+/*
+   The top 32 bits of the server id represents the owner of
+   this part of the srvid space
+*/
+#define CTDB_SRVID_MASK        0xFFFFFFFF00000000LL
+
+
+/*
+   Samba owns all message handler IDs where the top 32 bits are all zero
+*/
+#define CTDB_SRVID_SAMBA       0x0000000000000000
+#define CTDB_IS_SAMBA_SRVID    ((srvid & CTDB_SRVID_MASK) == CTDB_SRVID_SAMBA)
+
+/*
+   Server ids reserved for testing 
+*/
+#define CTDB_SRVID_TEST                0x0000000100000000
+#define CTDB_IS_TEST_SRVID     ((srvid & CTDB_SRVID_MASK) == CTDB_SRVID_TEST)
+
 /* 
    a message handler ID meaning "give me all messages"
  */