change Christinas previous patch to only perform the check/logging
[sahlberg/ctdb.git] / include / ctdb_protocol.h
index 8c90675ede843827fe6c6f1d25fca902dce7f520..b6b753c3c7ed3488b2b1365deb67c6e6ee2d6450 100644 (file)
@@ -84,6 +84,11 @@ struct ctdb_call_info {
  */
 #define CTDB_SRVID_RELEASE_IP 0xF300000000000000LL
 
+/*
+   a message handler ID meaning that an IP address has been taken
+ */
+#define CTDB_SRVID_TAKE_IP 0xF301000000000000LL
+
 /*
    a message ID to set the node flags in the recovery daemon
  */
@@ -131,9 +136,33 @@ struct ctdb_call_info {
 */
 #define CTDB_SRVID_TAKEOVER_RUN_RESPONSE  0xFD00000000000000LL
 
-/* A port reserved for samba (top 32 bits)
+/* A range of ports reserved for samba (top 32 bits)
+ * All ports matching the 32 top bits are reserved for exclusive use by
+ * CIFS server
  */
 #define CTDB_SRVID_SAMBA_NOTIFY  0xFE00000000000000LL
+#define CTDB_SRVID_SAMBA_RANGE   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
+
+/* A range of ports reserved for testing (top 32 bits)
+ * All ports matching the 32 top bits are reserved for exclusive use by
+ * test applications
+ */
+#define CTDB_SRVID_TEST_RANGE  0xFE03000000000000LL
+
+/* Range of ports reserved for traversals */
+#define CTDB_SRVID_TRAVERSE_RANGE  0xFE04000000000000LL
 
 /* used on the domain socket, send a pdu to the local daemon */
 #define CTDB_CURRENT_NODE     0xF0000001
@@ -331,6 +360,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_GET_IFACES              = 124,
                    CTDB_CONTROL_SET_IFACE_LINK_STATE    = 125,
                    CTDB_CONTROL_TCP_ADD_DELAYED_UPDATE  = 126,
+                   CTDB_CONTROL_GET_STAT_HISTORY        = 127,
 };
 
 /*
@@ -449,8 +479,10 @@ enum ctdb_trans2_commit_error {
 struct ctdb_ltdb_header {
        uint64_t rsn;
        uint32_t dmaster;
-       uint32_t laccessor;
-       uint32_t lacount;
+       uint32_t reserved1;
+#define CTDB_REC_FLAG_DEFAULT                  0x00000000
+#define CTDB_REC_FLAG_MIGRATED_WITH_DATA       0x00010000
+       uint32_t flags;
 };
 
 
@@ -498,4 +530,102 @@ struct ctdb_node_map {
 #define NODE_FLAGS_INACTIVE            (NODE_FLAGS_DELETED|NODE_FLAGS_DISCONNECTED|NODE_FLAGS_BANNED|NODE_FLAGS_STOPPED)
 
 
+struct ctdb_public_ip {
+       uint32_t pnn;
+       ctdb_sock_addr addr;
+};
+
+struct ctdb_all_public_ips {
+       uint32_t num;
+       struct ctdb_public_ip ips[1];
+};
+
+
+struct latency_counter {
+       int num;
+       double min;
+       double max;
+       double total;
+};
+
+/*
+  structure used to pass record data between the child and parent
+ */
+struct ctdb_rec_data {
+       uint32_t length;
+       uint32_t reqid;
+       uint32_t keylen;
+       uint32_t datalen;
+       uint8_t  data[1];
+};
+
+struct ctdb_traverse_start {
+       uint32_t db_id;
+       uint32_t reqid;
+       uint64_t srvid;
+};
+
+/*
+  ctdb statistics information
+ */
+struct ctdb_statistics {
+       uint32_t num_clients;
+       uint32_t frozen;
+       uint32_t recovering;
+       uint32_t client_packets_sent;
+       uint32_t client_packets_recv;
+       uint32_t node_packets_sent;
+       uint32_t node_packets_recv;
+       uint32_t keepalive_packets_sent;
+       uint32_t keepalive_packets_recv;
+       struct {
+               uint32_t req_call;
+               uint32_t reply_call;
+               uint32_t req_dmaster;
+               uint32_t reply_dmaster;
+               uint32_t reply_error;
+               uint32_t req_message;
+               uint32_t req_control;
+               uint32_t reply_control;
+       } node;
+       struct {
+               uint32_t req_call;
+               uint32_t req_message;
+               uint32_t req_control;
+       } client;
+       struct {
+               uint32_t call;
+               uint32_t control;
+               uint32_t traverse;
+       } timeouts;
+       struct {
+               struct latency_counter ctdbd;
+               struct latency_counter recd;
+       } reclock;
+       uint32_t total_calls;
+       uint32_t pending_calls;
+       uint32_t lockwait_calls;
+       uint32_t pending_lockwait_calls;
+       uint32_t childwrite_calls;
+       uint32_t pending_childwrite_calls;
+       uint32_t memory_used;
+       uint32_t __last_counter; /* hack for control_statistics_all */
+       uint32_t max_hop_count;
+       struct latency_counter call_latency;
+       struct latency_counter lockwait_latency;
+       struct latency_counter childwrite_latency;
+       uint32_t num_recoveries;
+       struct timeval statistics_start_time;
+       struct timeval statistics_current_time;
+};
+
+/*
+ * wire format for statistics history
+ */
+struct ctdb_statistics_wire {
+       uint32_t num;
+       struct ctdb_statistics stats[1];
+};
+
+
 #endif