wbclient: Fix a typo
[samba4-gss.git] / ctdb / include / ctdb_protocol.h
blobbec849e857c950f89a81eec002e13bb95a000e53
1 /*
2 ctdb database library
4 Copyright (C) Andrew Tridgell 2006
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef _CTDB_PROTOCOL_H
21 #define _CTDB_PROTOCOL_H
23 #include <sys/socket.h>
24 #include "protocol/protocol.h"
26 /* define ctdb port number */
27 #define CTDB_PORT 4379
29 /* we must align packets to ensure ctdb works on all architectures (eg. sparc) */
30 #define CTDB_DS_ALIGNMENT 8
33 structure passed to a ctdb call backend function
35 struct ctdb_call_info {
36 TDB_DATA key; /* record key */
37 struct ctdb_ltdb_header *header;
38 TDB_DATA record_data; /* current data in the record */
39 TDB_DATA *new_data; /* optionally updated record data */
40 TDB_DATA *call_data; /* optionally passed from caller */
41 TDB_DATA *reply_data; /* optionally returned by function */
42 uint32_t status; /* optional reply status - defaults to zero */
46 ctdb flags
48 #define CTDB_FLAG_TORTURE (1<<1)
50 struct ctdb_script_list_old {
51 uint32_t num_scripts;
52 struct ctdb_script scripts[1];
56 packet structures
58 struct ctdb_req_call_old {
59 struct ctdb_req_header hdr;
60 uint32_t flags;
61 uint32_t db_id;
62 uint32_t callid;
63 uint32_t hopcount;
64 uint32_t keylen;
65 uint32_t calldatalen;
66 uint8_t data[1]; /* key[] followed by calldata[] */
69 struct ctdb_reply_call_old {
70 struct ctdb_req_header hdr;
71 uint32_t status;
72 uint32_t datalen;
73 uint8_t data[1];
76 struct ctdb_reply_error_old {
77 struct ctdb_req_header hdr;
78 uint32_t status;
79 uint32_t msglen;
80 uint8_t msg[1];
83 struct ctdb_req_dmaster_old {
84 struct ctdb_req_header hdr;
85 uint32_t db_id;
86 uint64_t rsn;
87 uint32_t dmaster;
88 uint32_t keylen;
89 uint32_t datalen;
90 uint8_t data[1];
93 struct ctdb_reply_dmaster_old {
94 struct ctdb_req_header hdr;
95 uint32_t db_id;
96 uint64_t rsn;
97 uint32_t keylen;
98 uint32_t datalen;
99 uint8_t data[1];
102 struct ctdb_req_message_old {
103 struct ctdb_req_header hdr;
104 uint64_t srvid;
105 uint32_t datalen;
106 uint8_t data[1];
109 struct ctdb_req_control_old {
110 struct ctdb_req_header hdr;
111 uint32_t opcode;
112 uint32_t pad;
113 uint64_t srvid;
114 uint32_t client_id;
115 uint32_t flags;
116 uint32_t datalen;
117 uint8_t data[1];
120 struct ctdb_reply_control_old {
121 struct ctdb_req_header hdr;
122 int32_t status;
123 uint32_t datalen;
124 uint32_t errorlen;
125 uint8_t data[1];
128 struct ctdb_req_keepalive_old {
129 struct ctdb_req_header hdr;
130 uint32_t version;
131 uint32_t uptime;
134 struct ctdb_req_tunnel_old {
135 struct ctdb_req_header hdr;
136 uint64_t tunnel_id;
137 uint32_t flags;
138 uint32_t datalen;
139 uint8_t data[1];
143 Structure used for a nodemap.
144 The nodemap is the structure containing a list of all nodes
145 known to the cluster and their associated flags.
147 struct ctdb_node_map_old {
148 uint32_t num;
149 struct ctdb_node_and_flags nodes[1];
152 struct ctdb_public_ip_list_old {
153 uint32_t num;
154 struct ctdb_public_ip ips[1];
158 structure used to pass record data between the child and parent
160 struct ctdb_rec_data_old {
161 uint32_t length;
162 uint32_t reqid;
163 uint32_t keylen;
164 uint32_t datalen;
165 uint8_t data[1];
169 * wire format for statistics history
171 struct ctdb_statistics_list_old {
172 uint32_t num;
173 struct ctdb_statistics stats[1];
177 * db statistics
179 struct ctdb_db_statistics_old {
180 struct {
181 uint32_t num_calls;
182 uint32_t num_current;
183 uint32_t num_pending;
184 uint32_t num_failed;
185 struct ctdb_latency_counter latency;
186 uint32_t buckets[MAX_COUNT_BUCKETS];
187 } locks;
188 struct {
189 struct ctdb_latency_counter latency;
190 } vacuum;
191 uint32_t db_ro_delegations;
192 uint32_t db_ro_revokes;
193 uint32_t hop_count_bucket[MAX_COUNT_BUCKETS];
194 uint32_t num_hot_keys;
195 struct {
196 uint32_t count;
197 TDB_DATA key;
198 } hot_keys[MAX_HOT_KEYS];
199 char hot_keys_wire[1];
203 a wire representation of the vnn map
205 struct ctdb_vnn_map_wire {
206 uint32_t generation;
207 uint32_t size;
208 uint32_t map[1];
211 struct ctdb_notify_data_old {
212 uint64_t srvid;
213 uint32_t len;
214 uint8_t notify_data[1];
217 /* table that contains a list of all dbids on a node
219 struct ctdb_dbid_map_old {
220 uint32_t num;
221 struct ctdb_dbid dbs[1];
224 /* the list of tcp tickles used by get/set tcp tickle list */
225 struct ctdb_tickle_list_old {
226 ctdb_sock_addr addr;
227 uint32_t num;
228 struct ctdb_connection connections[1];
232 struct holding a ctdb_sock_addr and an interface name,
233 used to add/remove public addresses and gratuitous arp
235 struct ctdb_addr_info_old {
236 ctdb_sock_addr addr;
237 uint32_t mask;
238 uint32_t len;
239 char iface[1];
242 /* structure used for sending lists of records */
243 struct ctdb_marshall_buffer {
244 uint32_t db_id;
245 uint32_t count;
246 uint8_t data[1];
250 structure for setting a tunable
252 struct ctdb_tunable_old {
253 uint32_t value;
254 uint32_t length;
255 uint8_t name[1];
259 structure for getting a tunable
261 struct ctdb_control_get_tunable {
262 uint32_t length;
263 uint8_t name[1];
267 structure for listing tunables
269 struct ctdb_control_list_tunable {
270 uint32_t length;
271 /* returns a : separated list of tunable names */
272 uint8_t data[1];
276 struct ctdb_public_ip_info_old {
277 struct ctdb_public_ip ip;
278 uint32_t active_idx;
279 uint32_t num;
280 struct ctdb_iface ifaces[1];
283 struct ctdb_iface_list_old {
284 uint32_t num;
285 struct ctdb_iface ifaces[1];
289 * structure to pass to a schedule_for_deletion_control
291 struct ctdb_control_schedule_for_deletion {
292 uint32_t db_id;
293 struct ctdb_ltdb_header hdr;
294 uint32_t keylen;
295 uint8_t key[1]; /* key[] */
298 #endif