ctdb-daemon: Rename struct ctdb_dbid_map to ctdb_dbid_map_old
[obnox/samba/samba-obnox.git] / ctdb / include / ctdb_protocol.h
index 8b113c3a0ed243c29789adf970a7aa1fc9410457..6505873d5d8267f07678b30d934229519216fc1f 100644 (file)
@@ -20,8 +20,7 @@
 #ifndef _CTDB_PROTOCOL_H
 #define _CTDB_PROTOCOL_H
 
-/* location of daemon socket */
-#define CTDB_PATH      "/tmp/ctdb.socket"
+#include <sys/socket.h>
 
 /* default ctdb port number */
 #define CTDB_PORT 4379
@@ -109,12 +108,24 @@ struct ctdb_call_info {
  */
 #define CTDB_SRVID_VACUUM_FETCH 0xF700000000000000LL
 
+/*
+ * a message to tell recovery daemon to detach a database
+ */
+#define CTDB_SRVID_DETACH_DATABASE 0xF701000000000000LL
 /*
   a message to tell the recovery daemon to write a talloc memdump
   to the log
  */
 #define CTDB_SRVID_MEM_DUMP 0xF800000000000000LL
 
+/* A message id used to ask the recover daemon to send logs
+*/
+#define CTDB_SRVID_GETLOG  0xF801000000000000LL
+
+/* A message id used to ask the recover daemon to send logs
+*/
+#define CTDB_SRVID_CLEARLOG  0xF802000000000000LL
+
 /*
    a message ID to get the recovery daemon to push the node flags out
  */
@@ -135,6 +146,12 @@ struct ctdb_call_info {
 */
 #define CTDB_SRVID_REBALANCE_NODE 0xFB01000000000000LL
 
+/* A message handler ID to stop takeover runs from occurring */
+#define CTDB_SRVID_DISABLE_TAKEOVER_RUNS 0xFB03000000000000LL
+
+/* A message handler ID to stop recoveries from occurring */
+#define CTDB_SRVID_DISABLE_RECOVERIES 0xFB04000000000000LL
+
 /* A message id to ask the recovery daemon to temporarily disable the
    public ip checks
 */
@@ -201,7 +218,7 @@ struct ctdb_call_info {
 
 #define MAX_SCRIPT_NAME 31
 #define MAX_SCRIPT_OUTPUT 511
-struct ctdb_script_wire {
+struct ctdb_script {
        char name[MAX_SCRIPT_NAME+1];
        struct timeval start;
        struct timeval finished;
@@ -209,13 +226,13 @@ struct ctdb_script_wire {
        char output[MAX_SCRIPT_OUTPUT+1];
 };
 
-struct ctdb_scripts_wire {
+struct ctdb_script_list_old {
        uint32_t num_scripts;
-       struct ctdb_script_wire scripts[1];
+       struct ctdb_script scripts[1];
 };
 
 /* different calls to event scripts. */
-enum ctdb_eventscript_call {
+enum ctdb_event {
        CTDB_EVENT_INIT,                /* CTDB starting up: no args */
        CTDB_EVENT_SETUP,               /* CTDB starting up after transport is readdy: no args. */
        CTDB_EVENT_STARTUP,             /* CTDB starting up after initial recovery: no args. */
@@ -223,11 +240,11 @@ enum ctdb_eventscript_call {
        CTDB_EVENT_RECOVERED,           /* CTDB recovery finished: no args. */
        CTDB_EVENT_TAKE_IP,             /* IP taken: interface, IP address, netmask bits. */
        CTDB_EVENT_RELEASE_IP,          /* IP released: interface, IP address, netmask bits. */
-       CTDB_EVENT_STOPPED,             /* This node is stopped: no args. */
+       CTDB_EVENT_STOPPED,             /* Deprecated, do not use. */
        CTDB_EVENT_MONITOR,             /* Please check if service is healthy: no args. */
-       CTDB_EVENT_STATUS,              /* Report service status: no args. */
+       CTDB_EVENT_STATUS,              /* Deprecated, do not use. */
        CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
-       CTDB_EVENT_RELOAD,              /* magic */
+       CTDB_EVENT_RELOAD,              /* Deprecated, do not use */
        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
@@ -253,7 +270,7 @@ enum ctdb_operation {
 };
 
 #define CTDB_MAGIC 0x43544442 /* CTDB */
-#define CTDB_VERSION 1
+#define CTDB_PROTOCOL 1
 
 enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_STATISTICS              = 1,
@@ -266,7 +283,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_SET_DEBUG               = 8,
                    CTDB_CONTROL_GET_DBMAP               = 9,
                    CTDB_CONTROL_GET_NODEMAPv4           = 10, /* obsolete */
-                   CTDB_CONTROL_SET_DMASTER             = 11,
+                   CTDB_CONTROL_SET_DMASTER             = 11, /* obsolete */
                    /* #12 removed */
                    CTDB_CONTROL_PULL_DB                 = 13,
                    CTDB_CONTROL_PUSH_DB                 = 14,
@@ -274,7 +291,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_SET_RECMODE             = 16,
                    CTDB_CONTROL_STATISTICS_RESET        = 17,
                    CTDB_CONTROL_DB_ATTACH               = 18,
-                   CTDB_CONTROL_SET_CALL                = 19,
+                   CTDB_CONTROL_SET_CALL                = 19, /* obsolete */
                    CTDB_CONTROL_TRAVERSE_START          = 20,
                    CTDB_CONTROL_TRAVERSE_ALL            = 21,
                    CTDB_CONTROL_TRAVERSE_DATA           = 22,
@@ -317,7 +334,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_CHECK_SERVER_ID         = 59,
                    CTDB_CONTROL_GET_SERVER_ID_LIST      = 60,
                    CTDB_CONTROL_DB_ATTACH_PERSISTENT    = 61,
-                   CTDB_CONTROL_PERSISTENT_STORE        = 62,
+                   CTDB_CONTROL_PERSISTENT_STORE        = 62, /* obsolete */
                    CTDB_CONTROL_UPDATE_RECORD           = 63,
                    CTDB_CONTROL_SEND_GRATIOUS_ARP       = 64,
                    CTDB_CONTROL_TRANSACTION_START       = 65,
@@ -338,10 +355,10 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_GET_CAPABILITIES        = 80,
                    CTDB_CONTROL_START_PERSISTENT_UPDATE = 81,
                    CTDB_CONTROL_CANCEL_PERSISTENT_UPDATE= 82,
-                   CTDB_CONTROL_TRANS2_COMMIT           = 83,
-                   CTDB_CONTROL_TRANS2_FINISHED         = 84,
-                   CTDB_CONTROL_TRANS2_ERROR            = 85,
-                   CTDB_CONTROL_TRANS2_COMMIT_RETRY     = 86,
+                   CTDB_CONTROL_TRANS2_COMMIT           = 83, /* obsolete */
+                   CTDB_CONTROL_TRANS2_FINISHED         = 84, /* obsolete */
+                   CTDB_CONTROL_TRANS2_ERROR            = 85, /* obsolete */
+                   CTDB_CONTROL_TRANS2_COMMIT_RETRY     = 86, /* obsolete */
                    CTDB_CONTROL_RECD_PING               = 87,
                    CTDB_CONTROL_RELEASE_IP              = 88,
                    CTDB_CONTROL_TAKEOVER_IP             = 89,
@@ -366,9 +383,9 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_TRANSACTION_CANCEL      = 113,
                    CTDB_CONTROL_REGISTER_NOTIFY         = 114,
                    CTDB_CONTROL_DEREGISTER_NOTIFY       = 115,
-                   CTDB_CONTROL_TRANS2_ACTIVE           = 116,
-                   CTDB_CONTROL_GET_LOG                 = 117,
-                   CTDB_CONTROL_CLEAR_LOG               = 118,
+                   CTDB_CONTROL_TRANS2_ACTIVE           = 116, /* obsolete */
+                   CTDB_CONTROL_GET_LOG                 = 117, /* obsolete */
+                   CTDB_CONTROL_CLEAR_LOG               = 118, /* obsolete */
                    CTDB_CONTROL_TRANS3_COMMIT           = 119,
                    CTDB_CONTROL_GET_DB_SEQNUM           = 120,
                    CTDB_CONTROL_DB_SET_HEALTHY          = 121,
@@ -383,6 +400,19 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
                    CTDB_CONTROL_CHECK_SRVIDS            = 130,
                    CTDB_CONTROL_TRAVERSE_START_EXT      = 131,
                    CTDB_CONTROL_GET_DB_STATISTICS       = 132,
+                   CTDB_CONTROL_SET_DB_STICKY           = 133,
+                   CTDB_CONTROL_RELOAD_PUBLIC_IPS       = 134,
+                   CTDB_CONTROL_TRAVERSE_ALL_EXT        = 135,
+                   CTDB_CONTROL_RECEIVE_RECORDS         = 136,
+                   CTDB_CONTROL_IPREALLOCATED           = 137,
+                   CTDB_CONTROL_GET_RUNSTATE            = 138,
+                   CTDB_CONTROL_DB_DETACH               = 139,
+                   CTDB_CONTROL_GET_NODES_FILE          = 140,
+                   CTDB_CONTROL_DB_FREEZE               = 141,
+                   CTDB_CONTROL_DB_THAW                 = 142,
+                   CTDB_CONTROL_DB_TRANSACTION_START    = 143,
+                   CTDB_CONTROL_DB_TRANSACTION_COMMIT   = 144,
+                   CTDB_CONTROL_DB_TRANSACTION_CANCEL   = 145,
 };
 
 /*
@@ -399,7 +429,7 @@ struct ctdb_req_header {
        uint32_t reqid;
 };
 
-struct ctdb_req_call {
+struct ctdb_req_call_old {
        struct ctdb_req_header hdr;
        uint32_t flags;
        uint32_t db_id;
@@ -410,21 +440,21 @@ struct ctdb_req_call {
        uint8_t data[1]; /* key[] followed by calldata[] */
 };
 
-struct ctdb_reply_call {
+struct ctdb_reply_call_old {
        struct ctdb_req_header hdr;
        uint32_t status;
        uint32_t datalen;
        uint8_t  data[1];
 };
 
-struct ctdb_reply_error {
+struct ctdb_reply_error_old {
        struct ctdb_req_header hdr;
        uint32_t status;
        uint32_t msglen;
        uint8_t  msg[1];
 };
 
-struct ctdb_req_dmaster {
+struct ctdb_req_dmaster_old {
        struct ctdb_req_header hdr;
        uint32_t db_id;
        uint64_t rsn;
@@ -434,7 +464,7 @@ struct ctdb_req_dmaster {
        uint8_t  data[1];
 };
 
-struct ctdb_reply_dmaster {
+struct ctdb_reply_dmaster_old {
        struct ctdb_req_header hdr;
        uint32_t db_id;
        uint64_t rsn;
@@ -443,25 +473,14 @@ struct ctdb_reply_dmaster {
        uint8_t  data[1];
 };
 
-struct ctdb_req_message {
+struct ctdb_req_message_old {
        struct ctdb_req_header hdr;
        uint64_t srvid;
        uint32_t datalen;
        uint8_t data[1];
 };
 
-struct ctdb_req_getdbpath {
-       struct ctdb_req_header hdr;
-       uint32_t db_id;
-};
-
-struct ctdb_reply_getdbpath {
-       struct ctdb_req_header hdr;
-       uint32_t datalen;
-       uint8_t data[1];
-};
-
-struct ctdb_req_control {
+struct ctdb_req_control_old {
        struct ctdb_req_header hdr;
        uint32_t opcode;
        uint32_t pad;
@@ -474,7 +493,7 @@ struct ctdb_req_control {
        uint8_t data[1];
 };
 
-struct ctdb_reply_control {
+struct ctdb_reply_control_old {
        struct ctdb_req_header hdr;
        int32_t  status;
        uint32_t datalen;
@@ -482,27 +501,18 @@ struct ctdb_reply_control {
        uint8_t data[1];
 };
 
-struct ctdb_req_keepalive {
+struct ctdb_req_keepalive_old {
        struct ctdb_req_header hdr;
 };
 
 
-/* types of failures possible from TRANS2_COMMIT */
-enum ctdb_trans2_commit_error {
-       CTDB_TRANS2_COMMIT_SUCCESS=0, /* all nodes committed successfully */
-       CTDB_TRANS2_COMMIT_TIMEOUT=1, /* at least one node timed out */
-       CTDB_TRANS2_COMMIT_ALLFAIL=2, /* all nodes failed the commit */
-       CTDB_TRANS2_COMMIT_SOMEFAIL=3 /* some nodes failed the commit, some allowed it */
-};
-
 /*
   the extended header for records in the ltdb
 */
 struct ctdb_ltdb_header {
        uint64_t rsn;
        uint32_t dmaster;
-       uint16_t laccessor;
-       uint16_t lacount;
+       uint32_t reserved1;
 #define CTDB_REC_FLAG_DEFAULT                  0x00000000
 #define CTDB_REC_FLAG_MIGRATED_WITH_DATA       0x00010000
 #define CTDB_REC_FLAG_VACUUM_MIGRATED          0x00020000
@@ -511,6 +521,10 @@ struct ctdb_ltdb_header {
 #define CTDB_REC_RO_HAVE_READONLY              0x02000000
 #define CTDB_REC_RO_REVOKING_READONLY          0x04000000
 #define CTDB_REC_RO_REVOKE_COMPLETE            0x08000000
+#define CTDB_REC_RO_FLAGS                      (CTDB_REC_RO_HAVE_DELEGATIONS|\
+                                                CTDB_REC_RO_HAVE_READONLY|\
+                                                CTDB_REC_RO_REVOKING_READONLY|\
+                                                CTDB_REC_RO_REVOKE_COMPLETE)
        uint32_t flags;
 };
 
@@ -518,12 +532,10 @@ struct ctdb_ltdb_header {
 /*
   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;
+       struct sockaddr_in ip;
+       struct sockaddr_in6 ip6;
 } ctdb_sock_addr;
 
 /*
@@ -541,7 +553,7 @@ struct ctdb_node_and_flags {
    The nodemap is the structure containing a list of all nodes
    known to the cluster and their associated flags.
 */
-struct ctdb_node_map {
+struct ctdb_node_map_old {
        uint32_t num;
        struct ctdb_node_and_flags nodes[1];
 };
@@ -558,19 +570,39 @@ struct ctdb_node_map {
 #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)
 
+/*
+ * Node capabilities
+ */
+#define CTDB_CAP_RECMASTER             0x00000001
+#define CTDB_CAP_LMASTER               0x00000002
+/* This capability is set if CTDB_LVS_PUBLIC_IP is set */
+#define CTDB_CAP_LVS                   0x00000004
+/* This capability is set if NATGW is enabled */
+#define CTDB_CAP_NATGW                 0x00000008
+
+/*
+ * Node features
+ */
+#define CTDB_CAP_PARALLEL_RECOVERY     0x00010000
+
+#define CTDB_CAP_FEATURES              (CTDB_CAP_PARALLEL_RECOVERY)
+
+#define CTDB_CAP_DEFAULT               (CTDB_CAP_RECMASTER | \
+                                        CTDB_CAP_LMASTER   | \
+                                        CTDB_CAP_FEATURES)
 
 struct ctdb_public_ip {
        uint32_t pnn;
        ctdb_sock_addr addr;
 };
 
-struct ctdb_all_public_ips {
+struct ctdb_public_ip_list_old {
        uint32_t num;
        struct ctdb_public_ip ips[1];
 };
 
 
-struct latency_counter {
+struct ctdb_latency_counter {
        int num;
        double min;
        double max;
@@ -580,7 +612,7 @@ struct latency_counter {
 /*
   structure used to pass record data between the child and parent
  */
-struct ctdb_rec_data {
+struct ctdb_rec_data_old {
        uint32_t length;
        uint32_t reqid;
        uint32_t keylen;
@@ -605,6 +637,7 @@ struct ctdb_traverse_start_ext {
   ctdb statistics information
  */
 #define MAX_COUNT_BUCKETS 16
+#define MAX_HOT_KEYS      10
 
 struct ctdb_statistics {
        uint32_t num_clients;
@@ -637,22 +670,27 @@ struct ctdb_statistics {
                uint32_t traverse;
        } timeouts;
        struct {
-               struct latency_counter ctdbd;
-               struct latency_counter recd;
+               struct ctdb_latency_counter ctdbd;
+               struct ctdb_latency_counter recd;
        } reclock;
+       struct {
+               uint32_t num_calls;
+               uint32_t num_current;
+               uint32_t num_pending;
+               uint32_t num_failed;
+               struct ctdb_latency_counter latency;
+               uint32_t buckets[MAX_COUNT_BUCKETS];
+       } locks;
        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;
        uint32_t hop_count_bucket[MAX_COUNT_BUCKETS];
-       struct latency_counter call_latency;
-       struct latency_counter lockwait_latency;
-       struct latency_counter childwrite_latency;
+       struct ctdb_latency_counter call_latency;
+       struct ctdb_latency_counter childwrite_latency;
        uint32_t num_recoveries;
        struct timeval statistics_start_time;
        struct timeval statistics_current_time;
@@ -663,7 +701,7 @@ struct ctdb_statistics {
 /*
  * wire format for statistics history
  */
-struct ctdb_statistics_wire {
+struct ctdb_statistics_list_old {
        uint32_t num;
        struct ctdb_statistics stats[1];
 };
@@ -671,10 +709,27 @@ struct ctdb_statistics_wire {
 /*
  * db statistics
  */
-struct ctdb_db_statistics {
+struct ctdb_db_statistics_old {
+       struct {
+               uint32_t num_calls;
+               uint32_t num_current;
+               uint32_t num_pending;
+               uint32_t num_failed;
+               struct ctdb_latency_counter latency;
+               uint32_t buckets[MAX_COUNT_BUCKETS];
+       } locks;
+       struct {
+               struct ctdb_latency_counter latency;
+       } vacuum;
        uint32_t db_ro_delegations;
        uint32_t db_ro_revokes;
        uint32_t hop_count_bucket[MAX_COUNT_BUCKETS];
+       uint32_t num_hot_keys;
+       struct {
+               uint32_t count;
+               TDB_DATA key;
+       } hot_keys[MAX_HOT_KEYS];
+       char hot_keys_wire[1];
 };
 
 /*
@@ -686,17 +741,6 @@ struct ctdb_db_statistics {
 #define CTDB_IFACE_SIZE 16
 #endif
 
-struct ctdb_iface_info {
-       char name[CTDB_IFACE_SIZE+2];
-       uint16_t link_state;
-       uint32_t references;
-};
-
-struct ctdb_ifaces_list {
-       uint32_t num;
-       struct ctdb_iface_info ifaces[1];
-};
-
 #define INVALID_GENERATION 1
 /* table that contains the mapping between a hash value and lmaster
  */
@@ -715,4 +759,286 @@ struct ctdb_vnn_map_wire {
        uint32_t map[1];
 };
 
+struct ctdb_notify_data_old {
+       uint64_t srvid;
+       uint32_t len;
+       uint8_t notify_data[1];
+};
+
+/* table that contains a list of all dbids on a node
+ */
+
+struct ctdb_dbid {
+       uint32_t db_id;
+#define CTDB_DB_FLAGS_PERSISTENT       0x01
+#define CTDB_DB_FLAGS_READONLY         0x02
+#define CTDB_DB_FLAGS_STICKY           0x04
+       uint8_t flags;
+};
+
+struct ctdb_dbid_map_old {
+       uint32_t num;
+       struct ctdb_dbid dbs[1];
+};
+
+#define CTDB_RECOVERY_NORMAL           0
+#define CTDB_RECOVERY_ACTIVE           1
+
+enum ctdb_server_id_type {
+       SERVER_TYPE_SAMBA=1,
+       SERVER_TYPE_NFSD=2,
+       SERVER_TYPE_ISCSID=3
+};
+
+struct ctdb_server_id {
+       enum ctdb_server_id_type type;
+       uint32_t pnn;
+       uint32_t server_id;
+};
+
+struct ctdb_server_id_list {
+       uint32_t num;
+       struct ctdb_server_id server_ids[1];
+};
+
+struct ctdb_uptime {
+       struct timeval current_time;
+       struct timeval ctdbd_start_time;
+       struct timeval last_recovery_started;
+       struct timeval last_recovery_finished;
+};
+
+struct ctdb_control_tcp_addr {
+       ctdb_sock_addr src;
+       ctdb_sock_addr dest;
+};
+
+struct ctdb_ban_time {
+       uint32_t pnn;
+       uint32_t time;
+};
+
+struct ctdb_db_priority {
+       uint32_t db_id;
+       uint32_t priority;
+};
+
+/*
+ * Structures to support SRVID requests and replies
+ */
+struct srvid_request {
+       uint32_t pnn;
+       uint64_t srvid;
+};
+
+struct srvid_request_data {
+       uint32_t pnn;
+       uint64_t srvid;
+       uint32_t data;
+};
+
+/*
+  a tcp connection description
+  also used by tcp_add and tcp_remove controls
+ */
+struct ctdb_tcp_connection {
+       ctdb_sock_addr src_addr;
+       ctdb_sock_addr dst_addr;
+};
+
+/* the wire representation for a tcp tickle array */
+struct ctdb_tcp_wire_array {
+       uint32_t num;
+       struct ctdb_tcp_connection connections[1];
+};
+
+/* the list of tcp tickles used by get/set tcp tickle list */
+struct ctdb_control_tcp_tickle_list {
+       ctdb_sock_addr addr;
+       struct ctdb_tcp_wire_array tickles;
+};
+
+/* all tunable variables go in here */
+struct ctdb_tunable {
+       uint32_t max_redirect_count;
+       uint32_t seqnum_interval; /* unit is ms */
+       uint32_t control_timeout;
+       uint32_t traverse_timeout;
+       uint32_t keepalive_interval;
+       uint32_t keepalive_limit;
+       uint32_t recover_timeout;
+       uint32_t recover_interval;
+       uint32_t election_timeout;
+       uint32_t takeover_timeout;
+       uint32_t monitor_interval;
+       uint32_t tickle_update_interval;
+       uint32_t script_timeout;
+       uint32_t script_timeout_count; /* allow dodgy scripts to hang this many times in a row before we mark the node unhealthy */
+       uint32_t script_unhealthy_on_timeout; /* obsolete */
+       uint32_t recovery_grace_period;
+       uint32_t recovery_ban_period;
+       uint32_t database_hash_size;
+       uint32_t database_max_dead;
+       uint32_t rerecovery_timeout;
+       uint32_t enable_bans;
+       uint32_t deterministic_public_ips;
+       uint32_t reclock_ping_period;
+       uint32_t no_ip_failback;
+       uint32_t disable_ip_failover;
+       uint32_t verbose_memory_names;
+       uint32_t recd_ping_timeout;
+       uint32_t recd_ping_failcount;
+       uint32_t log_latency_ms;
+       uint32_t reclock_latency_ms;
+       uint32_t recovery_drop_all_ips;
+       uint32_t verify_recovery_lock;
+       uint32_t vacuum_interval;
+       uint32_t vacuum_max_run_time;
+       uint32_t repack_limit;
+       uint32_t vacuum_limit;
+       uint32_t max_queue_depth_drop_msg;
+       uint32_t allow_unhealthy_db_read;
+       uint32_t stat_history_interval;
+       uint32_t deferred_attach_timeout;
+       uint32_t vacuum_fast_path_count;
+       uint32_t lcp2_public_ip_assignment;
+       uint32_t allow_client_db_attach;
+       uint32_t recover_pdb_by_seqnum;
+       uint32_t deferred_rebalance_on_node_add;
+       uint32_t fetch_collapse;
+       uint32_t hopcount_make_sticky;
+       uint32_t sticky_duration;
+       uint32_t sticky_pindown;
+       uint32_t no_ip_takeover;
+       uint32_t db_record_count_warn;
+       uint32_t db_record_size_warn;
+       uint32_t db_size_warn;
+       uint32_t pulldb_preallocation_size;
+       uint32_t no_ip_host_on_all_disabled;
+       uint32_t samba3_hack;
+       uint32_t mutex_enabled;
+       uint32_t lock_processes_per_db;
+};
+
+enum ctdb_runstate {
+       CTDB_RUNSTATE_UNKNOWN,
+       CTDB_RUNSTATE_INIT,
+       CTDB_RUNSTATE_SETUP,
+       CTDB_RUNSTATE_FIRST_RECOVERY,
+       CTDB_RUNSTATE_STARTUP,
+       CTDB_RUNSTATE_RUNNING,
+       CTDB_RUNSTATE_SHUTDOWN,
+};
+
+#define CTDB_MONITORING_ACTIVE         0
+#define CTDB_MONITORING_DISABLED       1
+
+/*
+  struct holding a ctdb_sock_addr and an interface name,
+  used to add/remove public addresses
+ */
+struct ctdb_control_ip_iface {
+       ctdb_sock_addr addr;
+       uint32_t mask;
+       uint32_t len;
+       char iface[1];
+};
+
+/*
+  struct holding a ctdb_sock_addr and an interface name,
+  used for send_gratious_arp
+ */
+struct ctdb_control_gratious_arp {
+       ctdb_sock_addr addr;
+       uint32_t mask;
+       uint32_t len;
+       char iface[1];
+};
+
+/*
+  structure used for CTDB_SRVID_NODE_FLAGS_CHANGED
+ */
+struct ctdb_node_flag_change {
+       uint32_t pnn;
+       uint32_t new_flags;
+       uint32_t old_flags;
+};
+
+#define CTDB_LMASTER_ANY       0xffffffff
+
+/* structure used for pulldb control */
+struct ctdb_control_pulldb {
+       uint32_t db_id;
+       uint32_t lmaster;
+};
+
+/* structure used for sending lists of records */
+struct ctdb_marshall_buffer {
+       uint32_t db_id;
+       uint32_t count;
+       uint8_t data[1];
+};
+
+/*
+  structure for setting a tunable
+ */
+struct ctdb_control_set_tunable {
+       uint32_t value;
+       uint32_t length;
+       uint8_t  name[1];
+};
+
+/*
+  structure for getting a tunable
+ */
+struct ctdb_control_get_tunable {
+       uint32_t length;
+       uint8_t  name[1];
+};
+
+/*
+  structure for listing tunables
+ */
+struct ctdb_control_list_tunable {
+       uint32_t length;
+       /* returns a : separated list of tunable names */
+       uint8_t  data[1];
+};
+
+
+struct ctdb_control_transdb {
+       uint32_t db_id;
+       uint32_t transaction_id;
+};
+
+#define CTDB_PUBLIC_IP_FLAGS_ONLY_AVAILABLE 0x00010000
+
+struct ctdb_control_iface_info {
+       char name[CTDB_IFACE_SIZE+2];
+       uint16_t link_state;
+       uint32_t references;
+};
+
+struct ctdb_control_public_ip_info {
+       struct ctdb_public_ip ip;
+       uint32_t active_idx;
+       uint32_t num;
+       struct ctdb_control_iface_info ifaces[1];
+};
+
+struct ctdb_control_get_ifaces {
+       uint32_t num;
+       struct ctdb_control_iface_info ifaces[1];
+};
+
+/**
+ * structure to pass to a schedule_for_deletion_control
+ */
+struct ctdb_control_schedule_for_deletion {
+       uint32_t db_id;
+       struct ctdb_ltdb_header hdr;
+       uint32_t keylen;
+       uint8_t key[1]; /* key[] */
+};
+
 #endif