ctdb-include: Move protocol structures from ctdb_client.h to ctdb_protocol.h
authorAmitay Isaacs <amitay@gmail.com>
Tue, 27 Oct 2015 04:32:12 +0000 (15:32 +1100)
committerMartin Schwenke <martins@samba.org>
Fri, 30 Oct 2015 01:00:28 +0000 (02:00 +0100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/include/ctdb_client.h
ctdb/include/ctdb_protocol.h

index c3edd19f368e0ed243dc097169b67f38515d76bb..07e360c74b58094b0c916a89932acef2b18dea7f 100644 (file)
@@ -44,16 +44,6 @@ struct ctdb_client_control_state {
        } async;
 };
 
-struct ctdb_client_notify_register {
-       uint64_t srvid;
-       uint32_t len;
-       uint8_t notify_data[1];
-};
-
-struct ctdb_client_notify_deregister {
-       uint64_t srvid;
-};
-
 struct tevent_context;
 
 /*
@@ -151,18 +141,6 @@ int ctdb_ctrl_setvnnmap(struct ctdb_context *ctdb,
                struct timeval timeout, uint32_t destnode,
                TALLOC_CTX *mem_ctx, struct ctdb_vnn_map *vnnmap);
 
-/* table that contains a list of all dbids on a node
- */
-struct ctdb_dbid_map {
-       uint32_t num;
-       struct ctdb_dbid {
-               uint32_t dbid;
-#define CTDB_DB_FLAGS_PERSISTENT       0x01
-#define CTDB_DB_FLAGS_READONLY         0x02
-#define CTDB_DB_FLAGS_STICKY           0x04
-               uint8_t flags;
-       } dbs[1];
-};
 int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb,
        struct timeval timeout, uint32_t destnode,
        TALLOC_CTX *mem_ctx, struct ctdb_dbid_map **dbmap);
@@ -233,9 +211,6 @@ int ctdb_ctrl_setdmaster(struct ctdb_context *ctdb,
        struct timeval timeout, uint32_t destnode,
        TALLOC_CTX *mem_ctx, uint32_t dbid, uint32_t dmaster);
 
-#define CTDB_RECOVERY_NORMAL           0
-#define CTDB_RECOVERY_ACTIVE           1
-
 /*
   get the recovery mode of a remote node
  */
@@ -350,24 +325,6 @@ int ctdb_ctrl_modflags(struct ctdb_context *ctdb,
                       uint32_t destnode,
                       uint32_t set, uint32_t clear);
 
-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];
-};
-
-
 int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
                struct timeval timeout,
                struct ctdb_server_id *id);
@@ -382,18 +339,6 @@ int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
                struct timeval timeout, uint32_t destnode,
                struct ctdb_server_id_list **svid_list);
 
-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;
-};
-
 int ctdb_socket_connect(struct ctdb_context *ctdb);
 
 /*
@@ -497,19 +442,9 @@ int ctdb_ctrl_setrecmasterrole(struct ctdb_context *ctdb, struct timeval timeout
 int ctdb_ctrl_enablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
 int ctdb_ctrl_disablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
 
-struct ctdb_ban_time {
-       uint32_t pnn;
-       uint32_t time;
-};
-
 int ctdb_ctrl_set_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_ban_time *bantime);
 int ctdb_ctrl_get_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, struct ctdb_ban_time **bantime);
 
-struct ctdb_db_priority {
-       uint32_t db_id;
-       uint32_t priority;
-};
-
 int ctdb_ctrl_set_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_db_priority *db_prio);
 int ctdb_ctrl_get_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t db_id, uint32_t *priority);
 
index 750abc423d5d288440fadcb51c6e149816171860..f5e0c8e437860b5efcfe7c81a4c4607100a3f803 100644 (file)
@@ -772,4 +772,69 @@ struct ctdb_vnn_map_wire {
        uint32_t map[1];
 };
 
+struct ctdb_client_notify_register {
+       uint64_t srvid;
+       uint32_t len;
+       uint8_t notify_data[1];
+};
+
+struct ctdb_client_notify_deregister {
+       uint64_t srvid;
+};
+
+/* table that contains a list of all dbids on a node
+ */
+struct ctdb_dbid_map {
+       uint32_t num;
+       struct ctdb_dbid {
+               uint32_t dbid;
+#define CTDB_DB_FLAGS_PERSISTENT       0x01
+#define CTDB_DB_FLAGS_READONLY         0x02
+#define CTDB_DB_FLAGS_STICKY           0x04
+               uint8_t flags;
+       } 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;
+};
+
 #endif