Add two new flags for the ltdb header.
[sahlberg/ctdb.git] / include / ctdb_protocol.h
1 /*
2    ctdb database library
3
4    Copyright (C) Andrew Tridgell  2006
5
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.
10
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.
15
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/>.
18 */
19
20 #ifndef _CTDB_PROTOCOL_H
21 #define _CTDB_PROTOCOL_H
22
23 /* location of daemon socket */
24 #define CTDB_PATH       "/tmp/ctdb.socket"
25
26 /* default ctdb port number */
27 #define CTDB_PORT 4379
28
29 /* we must align packets to ensure ctdb works on all architectures (eg. sparc) */
30 #define CTDB_DS_ALIGNMENT 8
31
32
33 #define CTDB_NULL_FUNC      0xFF000001
34 #define CTDB_FETCH_FUNC     0xFF000002
35
36
37 #define CTDB_IMMEDIATE_MIGRATION        0x00000001
38 struct ctdb_call {
39         int call_id;
40         TDB_DATA key;
41         TDB_DATA call_data;
42         TDB_DATA reply_data;
43         uint32_t status;
44         uint32_t flags;
45 };
46
47 /*
48   structure passed to a ctdb call backend function
49 */
50 struct ctdb_call_info {
51         TDB_DATA key;          /* record key */
52         TDB_DATA record_data;  /* current data in the record */
53         TDB_DATA *new_data;    /* optionally updated record data */
54         TDB_DATA *call_data;   /* optionally passed from caller */
55         TDB_DATA *reply_data;  /* optionally returned by function */
56         uint32_t status;       /* optional reply status - defaults to zero */
57 };
58
59 #define CTDB_ERR_INVALID 1
60 #define CTDB_ERR_NOMEM 2
61
62 /*
63   ctdb flags
64 */
65 #define CTDB_FLAG_TORTURE      (1<<1)
66
67 /*
68    a message handler ID meaning "give me all messages"
69  */
70 #define CTDB_SRVID_ALL (~(uint64_t)0)
71
72 /*
73   srvid type : RECOVERY
74 */
75 #define CTDB_SRVID_RECOVERY     0xF100000000000000LL
76
77 /*
78    a message handler ID meaning that the cluster has been reconfigured
79  */
80 #define CTDB_SRVID_RECONFIGURE 0xF200000000000000LL
81
82 /*
83    a message handler ID meaning that an IP address has been released
84  */
85 #define CTDB_SRVID_RELEASE_IP 0xF300000000000000LL
86
87 /*
88    a message handler ID meaning that an IP address has been taken
89  */
90 #define CTDB_SRVID_TAKE_IP 0xF301000000000000LL
91
92 /*
93    a message ID to set the node flags in the recovery daemon
94  */
95 #define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
96
97 /*
98    a message ID to ask the recovery daemon to update the expected node
99    assignment for a public ip
100  */
101 #define CTDB_SRVID_RECD_UPDATE_IP 0xF500000000000000LL
102
103 /*
104   a message to tell the recovery daemon to fetch a set of records
105  */
106 #define CTDB_SRVID_VACUUM_FETCH 0xF700000000000000LL
107
108 /*
109   a message to tell the recovery daemon to write a talloc memdump
110   to the log
111  */
112 #define CTDB_SRVID_MEM_DUMP 0xF800000000000000LL
113
114 /*
115    a message ID to get the recovery daemon to push the node flags out
116  */
117 #define CTDB_SRVID_PUSH_NODE_FLAGS 0xF900000000000000LL
118
119 /*
120    a message ID to get the recovery daemon to reload the nodes file
121  */
122 #define CTDB_SRVID_RELOAD_NODES 0xFA00000000000000LL
123
124 /*
125    a message ID to get the recovery daemon to perform a takeover run
126  */
127 #define CTDB_SRVID_TAKEOVER_RUN 0xFB00000000000000LL
128
129 /* A message id to ask the recovery daemon to temporarily disable the
130    public ip checks
131 */
132 #define CTDB_SRVID_DISABLE_IP_CHECK  0xFC00000000000000LL
133
134 /* A dummy port used for sending back ipreallocate resposnes to the main
135    daemon
136 */
137 #define CTDB_SRVID_TAKEOVER_RUN_RESPONSE  0xFD00000000000000LL
138
139 /* A range of ports reserved for samba (top 32 bits)
140  * All ports matching the 32 top bits are reserved for exclusive use by
141  * CIFS server
142  */
143 #define CTDB_SRVID_SAMBA_NOTIFY  0xFE00000000000000LL
144 #define CTDB_SRVID_SAMBA_RANGE   0xFE00000000000000LL
145
146 /* A range of ports reserved for a CTDB NFS server (top 32 bits)
147  * All ports matching the 32 top bits are reserved for exclusive use by
148  * NFS server
149  */
150 #define CTDB_SRVID_NFSD_RANGE  0xFE01000000000000LL
151
152 /* A range of ports reserved for a CTDB ISCSI server (top 32 bits)
153  * All ports matching the 32 top bits are reserved for exclusive use by
154  * ISCSI server
155  */
156 #define CTDB_SRVID_ISCSID_RANGE  0xFE02000000000000LL
157
158 /* A range of ports reserved for testing (top 32 bits)
159  * All ports matching the 32 top bits are reserved for exclusive use by
160  * test applications
161  */
162 #define CTDB_SRVID_TEST_RANGE  0xFE03000000000000LL
163
164 /* used on the domain socket, send a pdu to the local daemon */
165 #define CTDB_CURRENT_NODE     0xF0000001
166 /* send a broadcast to all nodes in the cluster, active or not */
167 #define CTDB_BROADCAST_ALL    0xF0000002
168 /* send a broadcast to all nodes in the current vnn map */
169 #define CTDB_BROADCAST_VNNMAP 0xF0000003
170 /* send a broadcast to all connected nodes */
171 #define CTDB_BROADCAST_CONNECTED 0xF0000004
172
173 /* the key used for transaction locking on persistent databases */
174 #define CTDB_TRANSACTION_LOCK_KEY "__transaction_lock__"
175
176 /* the key used to store persistent db sequence number */
177 #define CTDB_DB_SEQNUM_KEY "__db_sequence_number__"
178
179 #define MONITOR_SCRIPT_OK      0
180 #define MONITOR_SCRIPT_TIMEOUT 1
181
182 #define MAX_SCRIPT_NAME 31
183 #define MAX_SCRIPT_OUTPUT 511
184 struct ctdb_script_wire {
185         char name[MAX_SCRIPT_NAME+1];
186         struct timeval start;
187         struct timeval finished;
188         int32_t status;
189         char output[MAX_SCRIPT_OUTPUT+1];
190 };
191
192 struct ctdb_scripts_wire {
193         uint32_t num_scripts;
194         struct ctdb_script_wire scripts[1];
195 };
196
197 /* different calls to event scripts. */
198 enum ctdb_eventscript_call {
199         CTDB_EVENT_INIT,                /* CTDB starting up: no args */
200         CTDB_EVENT_SETUP,               /* CTDB starting up after transport is readdy: no args. */
201         CTDB_EVENT_STARTUP,             /* CTDB starting up after initial recovery: no args. */
202         CTDB_EVENT_START_RECOVERY,      /* CTDB recovery starting: no args. */
203         CTDB_EVENT_RECOVERED,           /* CTDB recovery finished: no args. */
204         CTDB_EVENT_TAKE_IP,             /* IP taken: interface, IP address, netmask bits. */
205         CTDB_EVENT_RELEASE_IP,          /* IP released: interface, IP address, netmask bits. */
206         CTDB_EVENT_STOPPED,             /* This node is stopped: no args. */
207         CTDB_EVENT_MONITOR,             /* Please check if service is healthy: no args. */
208         CTDB_EVENT_STATUS,              /* Report service status: no args. */
209         CTDB_EVENT_SHUTDOWN,            /* CTDB shutting down: no args. */
210         CTDB_EVENT_RELOAD,              /* magic */
211         CTDB_EVENT_UPDATE_IP,           /* IP updating: old interface, new interface, IP address, netmask bits. */
212         CTDB_EVENT_IPREALLOCATED,       /* when a takeover_run() completes */
213         CTDB_EVENT_MAX
214 };
215
216 /* Mapping from enum to names. */
217 extern const char *ctdb_eventscript_call_names[];
218
219 /*
220   operation IDs
221 */
222 enum ctdb_operation {
223         CTDB_REQ_CALL           = 0,
224         CTDB_REPLY_CALL         = 1,
225         CTDB_REQ_DMASTER        = 2,
226         CTDB_REPLY_DMASTER      = 3,
227         CTDB_REPLY_ERROR        = 4,
228         CTDB_REQ_MESSAGE        = 5,
229         /* #6 removed */
230         CTDB_REQ_CONTROL        = 7,
231         CTDB_REPLY_CONTROL      = 8,
232         CTDB_REQ_KEEPALIVE      = 9,
233 };
234
235 #define CTDB_MAGIC 0x43544442 /* CTDB */
236 #define CTDB_VERSION 1
237
238 enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS          = 0,
239                     CTDB_CONTROL_STATISTICS              = 1,
240                     /* #2 removed */
241                     CTDB_CONTROL_PING                    = 3,
242                     CTDB_CONTROL_GETDBPATH               = 4,
243                     CTDB_CONTROL_GETVNNMAP               = 5,
244                     CTDB_CONTROL_SETVNNMAP               = 6,
245                     CTDB_CONTROL_GET_DEBUG               = 7,
246                     CTDB_CONTROL_SET_DEBUG               = 8,
247                     CTDB_CONTROL_GET_DBMAP               = 9,
248                     CTDB_CONTROL_GET_NODEMAPv4           = 10, /* obsolete */
249                     CTDB_CONTROL_SET_DMASTER             = 11,
250                     /* #12 removed */
251                     CTDB_CONTROL_PULL_DB                 = 13,
252                     CTDB_CONTROL_PUSH_DB                 = 14,
253                     CTDB_CONTROL_GET_RECMODE             = 15,
254                     CTDB_CONTROL_SET_RECMODE             = 16,
255                     CTDB_CONTROL_STATISTICS_RESET        = 17,
256                     CTDB_CONTROL_DB_ATTACH               = 18,
257                     CTDB_CONTROL_SET_CALL                = 19,
258                     CTDB_CONTROL_TRAVERSE_START          = 20,
259                     CTDB_CONTROL_TRAVERSE_ALL            = 21,
260                     CTDB_CONTROL_TRAVERSE_DATA           = 22,
261                     CTDB_CONTROL_REGISTER_SRVID          = 23,
262                     CTDB_CONTROL_DEREGISTER_SRVID        = 24,
263                     CTDB_CONTROL_GET_DBNAME              = 25,
264                     CTDB_CONTROL_ENABLE_SEQNUM           = 26,
265                     CTDB_CONTROL_UPDATE_SEQNUM           = 27,
266                     /* #28 removed */
267                     CTDB_CONTROL_DUMP_MEMORY             = 29,
268                     CTDB_CONTROL_GET_PID                 = 30,
269                     CTDB_CONTROL_GET_RECMASTER           = 31,
270                     CTDB_CONTROL_SET_RECMASTER           = 32,
271                     CTDB_CONTROL_FREEZE                  = 33,
272                     CTDB_CONTROL_THAW                    = 34,
273                     CTDB_CONTROL_GET_PNN                 = 35,
274                     CTDB_CONTROL_SHUTDOWN                = 36,
275                     CTDB_CONTROL_GET_MONMODE             = 37,
276                     /* #38 removed */
277                     /* #39 removed */
278                     /* #40 removed */
279                     /* #41 removed */
280                     CTDB_CONTROL_TAKEOVER_IPv4           = 42, /* obsolete */
281                     CTDB_CONTROL_RELEASE_IPv4            = 43, /* obsolete */
282                     CTDB_CONTROL_TCP_CLIENT              = 44,
283                     CTDB_CONTROL_TCP_ADD                 = 45,
284                     CTDB_CONTROL_TCP_REMOVE              = 46,
285                     CTDB_CONTROL_STARTUP                 = 47,
286                     CTDB_CONTROL_SET_TUNABLE             = 48,
287                     CTDB_CONTROL_GET_TUNABLE             = 49,
288                     CTDB_CONTROL_LIST_TUNABLES           = 50,
289                     CTDB_CONTROL_GET_PUBLIC_IPSv4        = 51, /* obsolete */
290                     CTDB_CONTROL_MODIFY_FLAGS            = 52,
291                     CTDB_CONTROL_GET_ALL_TUNABLES        = 53,
292                     CTDB_CONTROL_KILL_TCP                = 54,
293                     CTDB_CONTROL_GET_TCP_TICKLE_LIST     = 55,
294                     CTDB_CONTROL_SET_TCP_TICKLE_LIST     = 56,
295                     CTDB_CONTROL_REGISTER_SERVER_ID      = 57,
296                     CTDB_CONTROL_UNREGISTER_SERVER_ID    = 58,
297                     CTDB_CONTROL_CHECK_SERVER_ID         = 59,
298                     CTDB_CONTROL_GET_SERVER_ID_LIST      = 60,
299                     CTDB_CONTROL_DB_ATTACH_PERSISTENT    = 61,
300                     CTDB_CONTROL_PERSISTENT_STORE        = 62,
301                     CTDB_CONTROL_UPDATE_RECORD           = 63,
302                     CTDB_CONTROL_SEND_GRATIOUS_ARP       = 64,
303                     CTDB_CONTROL_TRANSACTION_START       = 65,
304                     CTDB_CONTROL_TRANSACTION_COMMIT      = 66,
305                     CTDB_CONTROL_WIPE_DATABASE           = 67,
306                     /* #68 removed */
307                     CTDB_CONTROL_UPTIME                  = 69,
308                     CTDB_CONTROL_START_RECOVERY          = 70,
309                     CTDB_CONTROL_END_RECOVERY            = 71,
310                     CTDB_CONTROL_RELOAD_NODES_FILE       = 72,
311                     /* #73 removed */
312                     CTDB_CONTROL_TRY_DELETE_RECORDS      = 74,
313                     CTDB_CONTROL_ENABLE_MONITOR          = 75,
314                     CTDB_CONTROL_DISABLE_MONITOR         = 76,
315                     CTDB_CONTROL_ADD_PUBLIC_IP           = 77,
316                     CTDB_CONTROL_DEL_PUBLIC_IP           = 78,
317                     CTDB_CONTROL_RUN_EVENTSCRIPTS        = 79,
318                     CTDB_CONTROL_GET_CAPABILITIES        = 80,
319                     CTDB_CONTROL_START_PERSISTENT_UPDATE = 81,
320                     CTDB_CONTROL_CANCEL_PERSISTENT_UPDATE= 82,
321                     CTDB_CONTROL_TRANS2_COMMIT           = 83,
322                     CTDB_CONTROL_TRANS2_FINISHED         = 84,
323                     CTDB_CONTROL_TRANS2_ERROR            = 85,
324                     CTDB_CONTROL_TRANS2_COMMIT_RETRY     = 86,
325                     CTDB_CONTROL_RECD_PING               = 87,
326                     CTDB_CONTROL_RELEASE_IP              = 88,
327                     CTDB_CONTROL_TAKEOVER_IP             = 89,
328                     CTDB_CONTROL_GET_PUBLIC_IPS          = 90,
329                     CTDB_CONTROL_GET_NODEMAP             = 91,
330                     CTDB_CONTROL_GET_EVENT_SCRIPT_STATUS = 96,
331                     CTDB_CONTROL_TRAVERSE_KILL           = 97,
332                     CTDB_CONTROL_RECD_RECLOCK_LATENCY    = 98,
333                     CTDB_CONTROL_GET_RECLOCK_FILE        = 99,
334                     CTDB_CONTROL_SET_RECLOCK_FILE        = 100,
335                     CTDB_CONTROL_STOP_NODE               = 101,
336                     CTDB_CONTROL_CONTINUE_NODE           = 102,
337                     CTDB_CONTROL_SET_NATGWSTATE          = 103,
338                     CTDB_CONTROL_SET_LMASTERROLE         = 104,
339                     CTDB_CONTROL_SET_RECMASTERROLE       = 105,
340                     CTDB_CONTROL_ENABLE_SCRIPT           = 107,
341                     CTDB_CONTROL_DISABLE_SCRIPT          = 108,
342                     CTDB_CONTROL_SET_BAN_STATE           = 109,
343                     CTDB_CONTROL_GET_BAN_STATE           = 110,
344                     CTDB_CONTROL_SET_DB_PRIORITY         = 111,
345                     CTDB_CONTROL_GET_DB_PRIORITY         = 112,
346                     CTDB_CONTROL_TRANSACTION_CANCEL      = 113,
347                     CTDB_CONTROL_REGISTER_NOTIFY         = 114,
348                     CTDB_CONTROL_DEREGISTER_NOTIFY       = 115,
349                     CTDB_CONTROL_TRANS2_ACTIVE           = 116,
350                     CTDB_CONTROL_GET_LOG                 = 117,
351                     CTDB_CONTROL_CLEAR_LOG               = 118,
352                     CTDB_CONTROL_TRANS3_COMMIT           = 119,
353                     CTDB_CONTROL_GET_DB_SEQNUM           = 120,
354                     CTDB_CONTROL_DB_SET_HEALTHY          = 121,
355                     CTDB_CONTROL_DB_GET_HEALTH           = 122,
356                     CTDB_CONTROL_GET_PUBLIC_IP_INFO      = 123,
357                     CTDB_CONTROL_GET_IFACES              = 124,
358                     CTDB_CONTROL_SET_IFACE_LINK_STATE    = 125,
359                     CTDB_CONTROL_TCP_ADD_DELAYED_UPDATE  = 126,
360                     CTDB_CONTROL_GET_STAT_HISTORY        = 127,
361 };
362
363 /*
364   packet structures
365 */
366 struct ctdb_req_header {
367         uint32_t length;
368         uint32_t ctdb_magic;
369         uint32_t ctdb_version;
370         uint32_t generation;
371         uint32_t operation;
372         uint32_t destnode;
373         uint32_t srcnode;
374         uint32_t reqid;
375 };
376
377 struct ctdb_req_call {
378         struct ctdb_req_header hdr;
379         uint32_t flags;
380         uint32_t db_id;
381         uint32_t callid;
382         uint32_t hopcount;
383         uint32_t keylen;
384         uint32_t calldatalen;
385         uint8_t data[1]; /* key[] followed by calldata[] */
386 };
387
388 struct ctdb_reply_call {
389         struct ctdb_req_header hdr;
390         uint32_t status;
391         uint32_t datalen;
392         uint8_t  data[1];
393 };
394
395 struct ctdb_reply_error {
396         struct ctdb_req_header hdr;
397         uint32_t status;
398         uint32_t msglen;
399         uint8_t  msg[1];
400 };
401
402 struct ctdb_req_dmaster {
403         struct ctdb_req_header hdr;
404         uint32_t db_id;
405         uint64_t rsn;
406         uint32_t dmaster;
407         uint32_t keylen;
408         uint32_t datalen;
409         uint8_t  data[1];
410 };
411
412 struct ctdb_reply_dmaster {
413         struct ctdb_req_header hdr;
414         uint32_t db_id;
415         uint64_t rsn;
416         uint32_t keylen;
417         uint32_t datalen;
418         uint8_t  data[1];
419 };
420
421 struct ctdb_req_message {
422         struct ctdb_req_header hdr;
423         uint64_t srvid;
424         uint32_t datalen;
425         uint8_t data[1];
426 };
427
428 struct ctdb_req_getdbpath {
429         struct ctdb_req_header hdr;
430         uint32_t db_id;
431 };
432
433 struct ctdb_reply_getdbpath {
434         struct ctdb_req_header hdr;
435         uint32_t datalen;
436         uint8_t data[1];
437 };
438
439 struct ctdb_req_control {
440         struct ctdb_req_header hdr;
441         uint32_t opcode;
442         uint32_t pad;
443         uint64_t srvid;
444         uint32_t client_id;
445 #define CTDB_CTRL_FLAG_NOREPLY   1
446 #define CTDB_CTRL_FLAG_OPCODE_SPECIFIC   0xFFFF0000
447         uint32_t flags;
448         uint32_t datalen;
449         uint8_t data[1];
450 };
451
452 struct ctdb_reply_control {
453         struct ctdb_req_header hdr;
454         int32_t  status;
455         uint32_t datalen;
456         uint32_t errorlen;
457         uint8_t data[1];
458 };
459
460 struct ctdb_req_keepalive {
461         struct ctdb_req_header hdr;
462 };
463
464
465 /* types of failures possible from TRANS2_COMMIT */
466 enum ctdb_trans2_commit_error {
467         CTDB_TRANS2_COMMIT_SUCCESS=0, /* all nodes committed successfully */
468         CTDB_TRANS2_COMMIT_TIMEOUT=1, /* at least one node timed out */
469         CTDB_TRANS2_COMMIT_ALLFAIL=2, /* all nodes failed the commit */
470         CTDB_TRANS2_COMMIT_SOMEFAIL=3 /* some nodes failed the commit, some allowed it */
471 };
472
473 /*
474   the extended header for records in the ltdb
475 */
476 struct ctdb_ltdb_header {
477         uint64_t rsn;
478         uint32_t dmaster;
479         uint32_t reserved1;
480 #define CTDB_REC_FLAG_DEFAULT                   0x00000000
481 #define CTDB_REC_FLAG_MIGRATED_WITH_DATA        0x00010000
482         uint32_t flags;
483 };
484
485
486 /*
487   definitions for different socket structures
488  */
489 typedef struct sockaddr_in ctdb_addr_in;
490 typedef struct sockaddr_in6 ctdb_addr_in6;
491 typedef union {
492         struct sockaddr sa;
493         ctdb_addr_in    ip;
494         ctdb_addr_in6   ip6;
495 } ctdb_sock_addr;
496
497 /*
498    A structure describing a single node, its flags and its address
499 */
500 struct ctdb_node_and_flags {
501         uint32_t pnn;
502         uint32_t flags;
503         ctdb_sock_addr addr;
504 };
505
506
507 /*
508    Structure used for a nodemap. 
509    The nodemap is the structure containing a list of all nodes
510    known to the cluster and their associated flags.
511 */
512 struct ctdb_node_map {
513         uint32_t num;
514         struct ctdb_node_and_flags nodes[1];
515 };
516
517 /*
518  * Node flags
519  */
520 #define NODE_FLAGS_DISCONNECTED         0x00000001 /* node isn't connected */
521 #define NODE_FLAGS_UNHEALTHY            0x00000002 /* monitoring says node is unhealthy */
522 #define NODE_FLAGS_PERMANENTLY_DISABLED 0x00000004 /* administrator has disabled node */
523 #define NODE_FLAGS_BANNED               0x00000008 /* recovery daemon has banned the node */
524 #define NODE_FLAGS_DELETED              0x00000010 /* this node has been deleted */
525 #define NODE_FLAGS_STOPPED              0x00000020 /* this node has been stopped */
526 #define NODE_FLAGS_DISABLED             (NODE_FLAGS_UNHEALTHY|NODE_FLAGS_PERMANENTLY_DISABLED)
527 #define NODE_FLAGS_INACTIVE             (NODE_FLAGS_DELETED|NODE_FLAGS_DISCONNECTED|NODE_FLAGS_BANNED|NODE_FLAGS_STOPPED)
528
529
530 struct ctdb_public_ip {
531         uint32_t pnn;
532         ctdb_sock_addr addr;
533 };
534
535 struct ctdb_all_public_ips {
536         uint32_t num;
537         struct ctdb_public_ip ips[1];
538 };
539
540
541 struct latency_counter {
542         int num;
543         double min;
544         double max;
545         double total;
546 };
547
548 /*
549   ctdb statistics information
550  */
551 struct ctdb_statistics {
552         uint32_t num_clients;
553         uint32_t frozen;
554         uint32_t recovering;
555         uint32_t client_packets_sent;
556         uint32_t client_packets_recv;
557         uint32_t node_packets_sent;
558         uint32_t node_packets_recv;
559         uint32_t keepalive_packets_sent;
560         uint32_t keepalive_packets_recv;
561         struct {
562                 uint32_t req_call;
563                 uint32_t reply_call;
564                 uint32_t req_dmaster;
565                 uint32_t reply_dmaster;
566                 uint32_t reply_error;
567                 uint32_t req_message;
568                 uint32_t req_control;
569                 uint32_t reply_control;
570         } node;
571         struct {
572                 uint32_t req_call;
573                 uint32_t req_message;
574                 uint32_t req_control;
575         } client;
576         struct {
577                 uint32_t call;
578                 uint32_t control;
579                 uint32_t traverse;
580         } timeouts;
581         struct {
582                 struct latency_counter ctdbd;
583                 struct latency_counter recd;
584         } reclock;
585         uint32_t total_calls;
586         uint32_t pending_calls;
587         uint32_t lockwait_calls;
588         uint32_t pending_lockwait_calls;
589         uint32_t childwrite_calls;
590         uint32_t pending_childwrite_calls;
591         uint32_t memory_used;
592         uint32_t __last_counter; /* hack for control_statistics_all */
593         uint32_t max_hop_count;
594         struct latency_counter call_latency;
595         struct latency_counter lockwait_latency;
596         struct latency_counter childwrite_latency;
597         uint32_t num_recoveries;
598         struct timeval statistics_start_time;
599         struct timeval statistics_current_time;
600 };
601
602 /*
603  * wire format for statistics history
604  */
605 struct ctdb_statistics_wire {
606         uint32_t num;
607         struct ctdb_statistics stats[1];
608 };
609
610
611 #endif