define and reserve a range of ctdb message ports for use by nfs and iscsi servers
[metze/ctdb/wip.git] / include / ctdb_protocol.h
index 99765d40937855ab26670646ff9898fef306195c..ab6e9f29046ddc9866ea8accf75032e00502758a 100644 (file)
@@ -135,6 +135,18 @@ struct ctdb_call_info {
  */
 #define CTDB_SRVID_SAMBA_NOTIFY  0xFE00000000000000LL
 
+/* A range of ports reserved for a CTDB NFS server (top 32 bits)
+ * All ports matching the 32 top bits are reserved for exclusive use by
+ * NFS server
+ */
+#define CTDB_SRVID_NFSD_RANGE  0xFE01000000000000LL
+
+/* A range of ports reserved for a CTDB ISCSI server (top 32 bits)
+ * All ports matching the 32 top bits are reserved for exclusive use by
+ * ISCSI server
+ */
+#define CTDB_SRVID_ISCSID_RANGE  0xFE02000000000000LL
+
 /* used on the domain socket, send a pdu to the local daemon */
 #define CTDB_CURRENT_NODE     0xF0000001
 /* send a broadcast to all nodes in the cluster, active or not */
@@ -183,6 +195,7 @@ enum ctdb_eventscript_call {
        CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
        CTDB_EVENT_RELOAD,              /* magic */
        CTDB_EVENT_UPDATE_IP,           /* IP updating: old interface, new interface, IP address, netmask bits. */
+       CTDB_EVENT_IPREALLOCATED,       /* when a takeover_run() completes */
        CTDB_EVENT_MAX
 };
 
@@ -451,4 +464,50 @@ struct ctdb_ltdb_header {
        uint32_t laccessor;
        uint32_t lacount;
 };
+
+
+/*
+  definitions for different socket structures
+ */
+typedef struct sockaddr_in ctdb_addr_in;
+typedef struct sockaddr_in6 ctdb_addr_in6;
+typedef union {
+       struct sockaddr sa;
+       ctdb_addr_in    ip;
+       ctdb_addr_in6   ip6;
+} ctdb_sock_addr;
+
+/*
+   A structure describing a single node, its flags and its address
+*/
+struct ctdb_node_and_flags {
+       uint32_t pnn;
+       uint32_t flags;
+       ctdb_sock_addr addr;
+};
+
+
+/*
+   Structure used for a nodemap. 
+   The nodemap is the structure containing a list of all nodes
+   known to the cluster and their associated flags.
+*/
+struct ctdb_node_map {
+       uint32_t num;
+       struct ctdb_node_and_flags nodes[1];
+};
+
+/*
+ * Node flags
+ */
+#define NODE_FLAGS_DISCONNECTED                0x00000001 /* node isn't connected */
+#define NODE_FLAGS_UNHEALTHY           0x00000002 /* monitoring says node is unhealthy */
+#define NODE_FLAGS_PERMANENTLY_DISABLED        0x00000004 /* administrator has disabled node */
+#define NODE_FLAGS_BANNED              0x00000008 /* recovery daemon has banned the node */
+#define NODE_FLAGS_DELETED             0x00000010 /* this node has been deleted */
+#define NODE_FLAGS_STOPPED             0x00000020 /* this node has been stopped */
+#define NODE_FLAGS_DISABLED            (NODE_FLAGS_UNHEALTHY|NODE_FLAGS_PERMANENTLY_DISABLED)
+#define NODE_FLAGS_INACTIVE            (NODE_FLAGS_DELETED|NODE_FLAGS_DISCONNECTED|NODE_FLAGS_BANNED|NODE_FLAGS_STOPPED)
+
+
 #endif