ctdb-recovery: Move recovery lock functions to recovery daemon code
[vlendec/samba-autobuild/.git] / ctdb / include / ctdb_private.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_PRIVATE_H
21 #define _CTDB_PRIVATE_H
22
23 #include "ctdb_client.h"
24 #include <sys/socket.h>
25
26 /*
27   array of tcp connections
28  */
29 struct ctdb_tcp_array {
30         uint32_t num;
31         struct ctdb_connection *connections;
32 };
33
34 /*
35   an installed ctdb remote call
36 */
37 struct ctdb_registered_call {
38         struct ctdb_registered_call *next, *prev;
39         uint32_t id;
40         ctdb_fn_t fn;
41 };
42
43 /*
44   check that a pnn is valid
45  */
46 #define ctdb_validate_pnn(ctdb, pnn) (((uint32_t)(pnn)) < (ctdb)->num_nodes)
47
48
49 /* called from the queue code when a packet comes in. Called with data==NULL
50    on error */
51 typedef void (*ctdb_queue_cb_fn_t)(uint8_t *data, size_t length,
52                                    void *private_data);
53
54 /* used for callbacks in ctdb_control requests */
55 typedef void (*ctdb_control_callback_fn_t)(struct ctdb_context *,
56                                            int32_t status, TDB_DATA data, 
57                                            const char *errormsg,
58                                            void *private_data);
59 /*
60   structure describing a connected client in the daemon
61  */
62 struct ctdb_client {
63         struct ctdb_context *ctdb;
64         int fd;
65         struct ctdb_queue *queue;
66         uint32_t client_id;
67         pid_t pid;
68         struct ctdb_tcp_list *tcp_list;
69         uint32_t db_id;
70         uint32_t num_persistent_updates;
71         struct ctdb_client_notify_list *notify;
72 };
73
74 /* state associated with a public ip address */
75 struct ctdb_vnn {
76         struct ctdb_vnn *prev, *next;
77
78         struct ctdb_interface *iface;
79         const char **ifaces;
80         ctdb_sock_addr public_address;
81         uint8_t public_netmask_bits;
82
83         /* the node number that is serving this public address, if any. 
84            If no node serves this ip it is set to -1 */
85         int32_t pnn;
86
87         /* List of clients to tickle for this public address */
88         struct ctdb_tcp_array *tcp_array;
89
90         /* whether we need to update the other nodes with changes to our list
91            of connected clients */
92         bool tcp_update_needed;
93
94         /* a context to hang sending gratious arp events off */
95         TALLOC_CTX *takeover_ctx;
96
97         /* Set to true any time an update to this VNN is in flight.
98            This helps to avoid races. */
99         bool update_in_flight;
100
101         /* If CTDB_CONTROL_DEL_PUBLIC_IP is received for this IP
102          * address then this flag is set.  It will be deleted in the
103          * release IP callback. */
104         bool delete_pending;
105 };
106
107 /*
108   state associated with one node
109 */
110 struct ctdb_node {
111         struct ctdb_context *ctdb;
112         ctdb_sock_addr address;
113         const char *name; /* for debug messages */
114         void *private_data; /* private to transport */
115         uint32_t pnn;
116         uint32_t flags;
117
118         /* used by the dead node monitoring */
119         uint32_t dead_count;
120         uint32_t rx_cnt;
121         uint32_t tx_cnt;
122
123         /* a list of controls pending to this node, so we can time them out quickly
124            if the node becomes disconnected */
125         struct daemon_control_state *pending_controls;
126
127         /* used by the recovery dameon to track when a node should be banned */
128         struct ctdb_banning_state *ban_state; 
129 };
130
131 /*
132   transport specific methods
133 */
134 struct ctdb_methods {
135         int (*initialise)(struct ctdb_context *); /* initialise transport structures */ 
136         int (*start)(struct ctdb_context *); /* start the transport */
137         int (*add_node)(struct ctdb_node *); /* setup a new node */     
138         int (*connect_node)(struct ctdb_node *); /* connect to node */
139         int (*queue_pkt)(struct ctdb_node *, uint8_t *data, uint32_t length);
140         void *(*allocate_pkt)(TALLOC_CTX *mem_ctx, size_t );
141         void (*shutdown)(struct ctdb_context *); /* shutdown transport */
142         void (*restart)(struct ctdb_node *); /* stop and restart the connection */
143 };
144
145 /*
146   transport calls up to the ctdb layer
147 */
148 struct ctdb_upcalls {
149         /* recv_pkt is called when a packet comes in */
150         void (*recv_pkt)(struct ctdb_context *, uint8_t *data, uint32_t length);
151
152         /* node_dead is called when an attempt to send to a node fails */
153         void (*node_dead)(struct ctdb_node *);
154
155         /* node_connected is called when a connection to a node is established */
156         void (*node_connected)(struct ctdb_node *);
157 };
158
159 /* additional data required for the daemon mode */
160 struct ctdb_daemon_data {
161         int sd;
162         char *name;
163         struct ctdb_queue *queue;
164 };
165
166
167 #define CTDB_UPDATE_STAT(ctdb, counter, value) \
168         {                                                                               \
169                 if (value > ctdb->statistics.counter) {                                 \
170                         ctdb->statistics.counter = c->hopcount;                         \
171                 }                                                                       \
172                 if (value > ctdb->statistics_current.counter) {                         \
173                         ctdb->statistics_current.counter = c->hopcount;                 \
174                 }                                                                       \
175         }
176
177 #define CTDB_INCREMENT_STAT(ctdb, counter) \
178         {                                                                               \
179                 ctdb->statistics.counter++;                                             \
180                 ctdb->statistics_current.counter++;                                     \
181         }
182
183 #define CTDB_DECREMENT_STAT(ctdb, counter) \
184         {                                                                               \
185                 if (ctdb->statistics.counter > 0)                                       \
186                         ctdb->statistics.counter--;                                     \
187                 if (ctdb->statistics_current.counter > 0)                               \
188                         ctdb->statistics_current.counter--;                             \
189         }
190
191 #define CTDB_INCREMENT_DB_STAT(ctdb_db, counter) \
192         {                                                                               \
193                 ctdb_db->statistics.counter++;                                          \
194         }
195
196 #define CTDB_DECREMENT_DB_STAT(ctdb_db, counter) \
197         {                                                                               \
198                 if (ctdb_db->statistics.counter > 0)                                    \
199                         ctdb_db->statistics.counter--;                                  \
200         }
201
202 #define CTDB_UPDATE_RECLOCK_LATENCY(ctdb, name, counter, value) \
203         {                                                                               \
204                 if (value > ctdb->statistics.counter.max)                               \
205                         ctdb->statistics.counter.max = value;                           \
206                 if (value > ctdb->statistics_current.counter.max)                       \
207                         ctdb->statistics_current.counter.max = value;                   \
208                                                                                         \
209                 if (ctdb->statistics.counter.num == 0 ||                                \
210                     value < ctdb->statistics.counter.min)                               \
211                         ctdb->statistics.counter.min = value;                           \
212                 if (ctdb->statistics_current.counter.num == 0 ||                        \
213                     value < ctdb->statistics_current.counter.min)                       \
214                         ctdb->statistics_current.counter.min = value;                   \
215                                                                                         \
216                 ctdb->statistics.counter.total += value;                                \
217                 ctdb->statistics_current.counter.total += value;                        \
218                                                                                         \
219                 ctdb->statistics.counter.num++;                                         \
220                 ctdb->statistics_current.counter.num++;                                 \
221                                                                                         \
222                 if (ctdb->tunable.reclock_latency_ms != 0) {                            \
223                         if (value*1000 > ctdb->tunable.reclock_latency_ms) {            \
224                                 DEBUG(DEBUG_ERR,                                        \
225                                       ("High RECLOCK latency %fs for operation %s\n",   \
226                                        value, name));                                   \
227                         }                                                               \
228                 }                                                                       \
229         }
230
231 #define CTDB_UPDATE_DB_LATENCY(ctdb_db, operation, counter, value)                      \
232         {                                                                               \
233                 if (value > ctdb_db->statistics.counter.max)                            \
234                         ctdb_db->statistics.counter.max = value;                        \
235                 if (ctdb_db->statistics.counter.num == 0 ||                             \
236                     value < ctdb_db->statistics.counter.min)                            \
237                         ctdb_db->statistics.counter.min = value;                        \
238                                                                                         \
239                 ctdb_db->statistics.counter.total += value;                             \
240                 ctdb_db->statistics.counter.num++;                                      \
241                                                                                         \
242                 if (ctdb_db->ctdb->tunable.log_latency_ms != 0) {                       \
243                         if (value*1000 > ctdb_db->ctdb->tunable.log_latency_ms) {       \
244                                 DEBUG(DEBUG_ERR,                                        \
245                                       ("High latency %.6fs for operation %s on database %s\n",\
246                                        value, operation, ctdb_db->db_name));            \
247                         }                                                               \
248                 }                                                                       \
249         }
250
251 #define CTDB_UPDATE_LATENCY(ctdb, db, operation, counter, t) \
252         {                                                                               \
253                 double l = timeval_elapsed(&t);                                         \
254                                                                                         \
255                 if (l > ctdb->statistics.counter.max)                                   \
256                         ctdb->statistics.counter.max = l;                               \
257                 if (l > ctdb->statistics_current.counter.max)                           \
258                         ctdb->statistics_current.counter.max = l;                       \
259                                                                                         \
260                 if (ctdb->statistics.counter.num == 0 ||                                \
261                     l < ctdb->statistics.counter.min)                                   \
262                         ctdb->statistics.counter.min = l;                               \
263                 if (ctdb->statistics_current.counter.num == 0 ||                        \
264                     l < ctdb->statistics_current.counter.min)                           \
265                         ctdb->statistics_current.counter.min = l;                       \
266                                                                                         \
267                 ctdb->statistics.counter.total += l;                                    \
268                 ctdb->statistics_current.counter.total += l;                            \
269                                                                                         \
270                 ctdb->statistics.counter.num++;                                         \
271                 ctdb->statistics_current.counter.num++;                                 \
272                                                                                         \
273                 if (ctdb->tunable.log_latency_ms != 0) {                                \
274                         if (l*1000 > ctdb->tunable.log_latency_ms) {                    \
275                                 DEBUG(DEBUG_WARNING,                                    \
276                                       ("High latency %.6fs for operation %s on database %s\n",\
277                                        l, operation, db->db_name));                     \
278                         }                                                               \
279                 }                                                                       \
280         }
281
282
283 struct ctdb_cluster_mutex_handle;
284
285 enum ctdb_freeze_mode {CTDB_FREEZE_NONE, CTDB_FREEZE_PENDING, CTDB_FREEZE_FROZEN};
286
287 #define NUM_DB_PRIORITIES 3
288 /* main state of the ctdb daemon */
289 struct ctdb_context {
290         struct tevent_context *ev;
291         struct timeval ctdbd_start_time;
292         struct timeval last_recovery_started;
293         struct timeval last_recovery_finished;
294         uint32_t recovery_mode;
295         TALLOC_CTX *tickle_update_context;
296         TALLOC_CTX *keepalive_ctx;
297         TALLOC_CTX *check_public_ifaces_ctx;
298         struct ctdb_tunable_list tunable;
299         enum ctdb_freeze_mode freeze_mode[NUM_DB_PRIORITIES+1];
300         struct ctdb_freeze_handle *freeze_handles[NUM_DB_PRIORITIES+1];
301         bool freeze_transaction_started;
302         uint32_t freeze_transaction_id;
303         ctdb_sock_addr *address;
304         const char *name;
305         const char *db_directory;
306         const char *db_directory_persistent;
307         const char *db_directory_state;
308         struct tdb_wrap *db_persistent_health;
309         uint32_t db_persistent_startup_generation;
310         uint64_t db_persistent_check_errors;
311         uint64_t max_persistent_check_errors;
312         const char *transport;
313         char *recovery_lock_file;
314         struct ctdb_cluster_mutex_handle *recovery_lock_handle;
315         uint32_t pnn; /* our own pnn */
316         uint32_t num_nodes;
317         uint32_t num_connected;
318         unsigned flags;
319         uint32_t capabilities;
320         struct reqid_context *idr;
321         struct ctdb_node **nodes; /* array of nodes in the cluster - indexed by vnn */
322         struct ctdb_vnn *vnn; /* list of public ip addresses and interfaces */
323         struct ctdb_interface *ifaces; /* list of local interfaces */
324         char *err_msg;
325         const struct ctdb_methods *methods; /* transport methods */
326         const struct ctdb_upcalls *upcalls; /* transport upcalls */
327         void *private_data; /* private to transport */
328         struct ctdb_db_context *db_list;
329         struct srvid_context *srv;
330         struct ctdb_daemon_data daemon;
331         struct ctdb_statistics statistics;
332         struct ctdb_statistics statistics_current;
333 #define MAX_STAT_HISTORY 100
334         struct ctdb_statistics statistics_history[MAX_STAT_HISTORY];
335         struct ctdb_vnn_map *vnn_map;
336         uint32_t num_clients;
337         uint32_t recovery_master;
338         struct ctdb_client_ip *client_ip_list;
339         bool do_checkpublicip;
340         bool do_setsched;
341         const char *event_script_dir;
342         const char *notification_script;
343         const char *default_public_interface;
344         pid_t ctdbd_pid;
345         pid_t recoverd_pid;
346         enum ctdb_runstate runstate;
347         struct ctdb_monitor_state *monitor;
348         int start_as_disabled;
349         int start_as_stopped;
350         bool valgrinding;
351         uint32_t *recd_ping_count;
352         TALLOC_CTX *recd_ctx; /* a context used to track recoverd monitoring events */
353         TALLOC_CTX *release_ips_ctx; /* a context used to automatically drop all IPs if we fail to recover the node */
354
355         TALLOC_CTX *event_script_ctx;
356         int active_events;
357
358         struct ctdb_event_script_state *current_monitor;
359         struct ctdb_script_list_old *last_status[CTDB_EVENT_MAX];
360
361         TALLOC_CTX *banning_ctx;
362
363         struct ctdb_vacuum_child_context *vacuumers;
364
365         /* mapping from pid to ctdb_client * */
366         struct ctdb_client_pid_list *client_pids;
367
368         /* used in the recovery daemon to remember the ip allocation */
369         struct trbt_tree *ip_tree;
370
371         /* Used to defer db attach requests while in recovery mode */
372         struct ctdb_deferred_attach_context *deferred_attach;
373
374         /* if we are a child process, do we have a domain socket to send controls on */
375         bool can_send_controls;
376
377         /* list of event script callback functions that are active */
378         struct event_script_callback *script_callbacks;
379
380         struct ctdb_reloadips_handle *reload_ips;
381
382         const char *nodes_file;
383         const char *public_addresses_file;
384         struct trbt_tree *child_processes; 
385
386         /* Used for locking record/db/alldb */
387         struct lock_context *lock_current;
388         struct lock_context *lock_pending;
389 };
390
391 struct ctdb_db_context {
392         struct ctdb_db_context *next, *prev;
393         struct ctdb_context *ctdb;
394         uint32_t db_id;
395         uint32_t priority;
396         bool persistent;
397         bool readonly; /* Do we support read-only delegations ? */
398         bool sticky; /* Do we support sticky records ? */
399         const char *db_name;
400         const char *db_path;
401         struct tdb_wrap *ltdb;
402         struct tdb_context *rottdb; /* ReadOnly tracking TDB */
403         struct ctdb_registered_call *calls; /* list of registered calls */
404         uint32_t seqnum;
405         struct tevent_timer *seqnum_update;
406         struct ctdb_traverse_local_handle *traverse;
407         struct ctdb_vacuum_handle *vacuum_handle;
408         char *unhealthy_reason;
409         int pending_requests;
410         struct revokechild_handle *revokechild_active;
411         struct ctdb_persistent_state *persistent_state;
412         struct trbt_tree *delete_queue;
413         struct trbt_tree *sticky_records; 
414         int (*ctdb_ltdb_store_fn)(struct ctdb_db_context *ctdb_db,
415                                   TDB_DATA key,
416                                   struct ctdb_ltdb_header *header,
417                                   TDB_DATA data);
418
419         /* used to track which records we are currently fetching
420            so we can avoid sending duplicate fetch requests
421         */
422         struct trbt_tree *deferred_fetch;
423         struct trbt_tree *defer_dmaster;
424
425         struct ctdb_db_statistics_old statistics;
426
427         struct lock_context *lock_current;
428         struct lock_context *lock_pending;
429         int lock_num_current;
430
431         struct ctdb_call_state *pending_calls;
432
433         enum ctdb_freeze_mode freeze_mode;
434         struct ctdb_db_freeze_handle *freeze_handle;
435         bool freeze_transaction_started;
436         uint32_t freeze_transaction_id;
437         uint32_t generation;
438
439         bool push_started;
440         void *push_state;
441 };
442
443
444 #define CTDB_NO_MEMORY(ctdb, p) do { if (!(p)) { \
445           DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
446           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
447           return -1; }} while (0)
448
449 #define CTDB_NO_MEMORY_VOID(ctdb, p) do { if (!(p)) { \
450           DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
451           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
452           return; }} while (0)
453
454 #define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
455           DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
456           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
457           return NULL; }} while (0)
458
459 #define CTDB_NO_MEMORY_FATAL(ctdb, p) do { if (!(p)) { \
460           DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
461           ctdb_fatal(ctdb, "Out of memory in " __location__ ); \
462           }} while (0)
463
464
465 enum call_state {CTDB_CALL_WAIT, CTDB_CALL_DONE, CTDB_CALL_ERROR};
466
467 /*
468   state of a in-progress ctdb call
469 */
470 struct ctdb_call_state {
471         struct ctdb_call_state *next, *prev;
472         enum call_state state;
473         uint32_t reqid;
474         struct ctdb_req_call_old *c;
475         struct ctdb_db_context *ctdb_db;
476         const char *errmsg;
477         struct ctdb_call *call;
478         uint32_t generation;
479         struct {
480                 void (*fn)(struct ctdb_call_state *);
481                 void *private_data;
482         } async;
483 };
484
485 /* internal prototypes */
486
487 #define CHECK_CONTROL_DATA_SIZE(size) do { \
488  if (indata.dsize != size) { \
489          DEBUG(0,(__location__ " Invalid data size in opcode %u. Got %u expected %u\n", \
490                   opcode, (unsigned)indata.dsize, (unsigned)size));     \
491          return -1; \
492  } \
493  } while (0)
494
495 #define CHECK_CONTROL_MIN_DATA_SIZE(size) do { \
496  if (indata.dsize < size) { \
497          DEBUG(0,(__location__ " Invalid data size in opcode %u. Got %u expected >= %u\n", \
498                   opcode, (unsigned)indata.dsize, (unsigned)size));     \
499          return -1; \
500  } \
501  } while (0)
502
503 /*
504   state of a in-progress ctdb call in client
505 */
506 struct ctdb_client_call_state {
507         enum call_state state;
508         uint32_t reqid;
509         struct ctdb_db_context *ctdb_db;
510         struct ctdb_call *call;
511         struct {
512                 void (*fn)(struct ctdb_client_call_state *);
513                 void *private_data;
514         } async;
515 };
516
517 extern int script_log_level;
518 extern bool fast_start;
519 extern const char *ctdbd_pidfile;
520
521 typedef void (*deferred_requeue_fn)(void *call_context, struct ctdb_req_header *hdr);
522
523
524 /* from tcp/ and ib/ */
525
526 int ctdb_tcp_init(struct ctdb_context *ctdb);
527 int ctdb_ibw_init(struct ctdb_context *ctdb);
528
529 /* from ctdb_banning.c */
530
531 void ctdb_local_node_got_banned(struct ctdb_context *ctdb);
532 int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata);
533 int32_t ctdb_control_get_ban_state(struct ctdb_context *ctdb, TDB_DATA *outdata);
534 void ctdb_ban_self(struct ctdb_context *ctdb);
535
536 /* from ctdb_call.c */
537
538 struct ctdb_db_context *find_ctdb_db(struct ctdb_context *ctdb, uint32_t id);
539
540 void ctdb_request_dmaster(struct ctdb_context *ctdb,
541                           struct ctdb_req_header *hdr);
542 void ctdb_reply_dmaster(struct ctdb_context *ctdb,
543                         struct ctdb_req_header *hdr);
544 void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
545 void ctdb_reply_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
546 void ctdb_reply_error(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
547
548 void ctdb_call_resend_db(struct ctdb_db_context *ctdb);
549 void ctdb_call_resend_all(struct ctdb_context *ctdb);
550
551 struct ctdb_call_state *ctdb_call_local_send(struct ctdb_db_context *ctdb_db,
552                                              struct ctdb_call *call,
553                                              struct ctdb_ltdb_header *header,
554                                              TDB_DATA *data);
555
556 struct ctdb_call_state *ctdb_daemon_call_send_remote(
557                                         struct ctdb_db_context *ctdb_db,
558                                         struct ctdb_call *call,
559                                         struct ctdb_ltdb_header *header);
560 int ctdb_daemon_call_recv(struct ctdb_call_state *state,
561                           struct ctdb_call *call);
562
563 void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode);
564
565 int ctdb_start_revoke_ro_record(struct ctdb_context *ctdb,
566                                 struct ctdb_db_context *ctdb_db,
567                                 TDB_DATA key, struct ctdb_ltdb_header *header,
568                                 TDB_DATA data);
569
570 int ctdb_add_revoke_deferred_call(struct ctdb_context *ctdb,
571                                   struct ctdb_db_context *ctdb_db,
572                                   TDB_DATA key, struct ctdb_req_header *hdr,
573                                   deferred_requeue_fn fn, void *call_context);
574
575 /* from server/ctdb_control.c */
576
577 int32_t ctdb_dump_memory(struct ctdb_context *ctdb, TDB_DATA *outdata);
578
579 void ctdb_request_control_reply(struct ctdb_context *ctdb,
580                                 struct ctdb_req_control_old *c,
581                                 TDB_DATA *outdata, int32_t status,
582                                 const char *errormsg);
583
584 void ctdb_request_control(struct ctdb_context *ctdb,
585                           struct ctdb_req_header *hdr);
586 void ctdb_reply_control(struct ctdb_context *ctdb,
587                         struct ctdb_req_header *hdr);
588
589 int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
590                              uint64_t srvid, uint32_t opcode,
591                              uint32_t client_id, uint32_t flags,
592                              TDB_DATA data,
593                              ctdb_control_callback_fn_t callback,
594                              void *private_data);
595
596 /* from server/ctdb_daemon.c */
597
598 int daemon_register_message_handler(struct ctdb_context *ctdb,
599                                     uint32_t client_id, uint64_t srvid);
600 int daemon_deregister_message_handler(struct ctdb_context *ctdb,
601                                       uint32_t client_id, uint64_t srvid);
602 int daemon_check_srvids(struct ctdb_context *ctdb, TDB_DATA indata,
603                         TDB_DATA *outdata);
604
605 int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork);
606
607 struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
608                                                  TALLOC_CTX *mem_ctx,
609                                                  enum ctdb_operation operation,
610                                                  size_t length, size_t slength,
611                                                  const char *type);
612
613 #define ctdb_transport_allocate(ctdb, mem_ctx, operation, length, type) \
614         (type *)_ctdb_transport_allocate(ctdb, mem_ctx, operation, length, \
615                                          sizeof(type), #type)
616
617 void ctdb_daemon_cancel_controls(struct ctdb_context *ctdb,
618                                  struct ctdb_node *node);
619
620 int ctdb_daemon_set_call(struct ctdb_context *ctdb, uint32_t db_id,
621                          ctdb_fn_t fn, int id);
622
623 int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
624                              uint64_t srvid, TDB_DATA data);
625
626 int32_t ctdb_control_register_notify(struct ctdb_context *ctdb,
627                                      uint32_t client_id, TDB_DATA indata);
628 int32_t ctdb_control_deregister_notify(struct ctdb_context *ctdb,
629                                        uint32_t client_id, TDB_DATA indata);
630
631 struct ctdb_client *ctdb_find_client_by_pid(struct ctdb_context *ctdb,
632                                             pid_t pid);
633
634 int32_t ctdb_control_process_exists(struct ctdb_context *ctdb, pid_t pid);
635
636 int ctdb_control_getnodesfile(struct ctdb_context *ctdb, uint32_t opcode,
637                               TDB_DATA indata, TDB_DATA *outdata);
638
639 void ctdb_shutdown_sequence(struct ctdb_context *ctdb, int exit_code);
640
641 int switch_from_server_to_client(struct ctdb_context *ctdb,
642                                  const char *fmt, ...);
643
644 /* From server/ctdb_fork.c */
645
646 void ctdb_set_child_info(TALLOC_CTX *mem_ctx, const char *child_name_fmt, ...);
647
648 void ctdb_track_child(struct ctdb_context *ctdb, pid_t pid);
649
650 pid_t ctdb_fork(struct ctdb_context *ctdb);
651
652 struct tevent_signal *ctdb_init_sigchld(struct ctdb_context *ctdb);
653
654 int ctdb_kill(struct ctdb_context *ctdb, pid_t pid, int signum);
655
656 /* from server/ctdb_freeze.c */
657
658 int32_t ctdb_control_db_freeze(struct ctdb_context *ctdb,
659                                struct ctdb_req_control_old *c,
660                                uint32_t db_id, bool *async_reply);
661 int32_t ctdb_control_db_thaw(struct ctdb_context *ctdb, uint32_t db_id);
662
663 int32_t ctdb_control_freeze(struct ctdb_context *ctdb,
664                             struct ctdb_req_control_old *c, bool *async_reply);
665 int32_t ctdb_control_thaw(struct ctdb_context *ctdb, uint32_t priority,
666                           bool check_recmode);
667
668 bool ctdb_blocking_freeze(struct ctdb_context *ctdb);
669
670 int32_t ctdb_control_db_transaction_start(struct ctdb_context *ctdb,
671                                           TDB_DATA indata);
672 int32_t ctdb_control_db_transaction_cancel(struct ctdb_context *ctdb,
673                                            TDB_DATA indata);
674 int32_t ctdb_control_db_transaction_commit(struct ctdb_context *ctdb,
675                                            TDB_DATA indata);
676
677 int32_t ctdb_control_transaction_start(struct ctdb_context *ctdb, uint32_t id);
678 int32_t ctdb_control_transaction_cancel(struct ctdb_context *ctdb);
679 int32_t ctdb_control_transaction_commit(struct ctdb_context *ctdb, uint32_t id);
680
681 int32_t ctdb_control_wipe_database(struct ctdb_context *ctdb, TDB_DATA indata);
682
683 bool ctdb_db_frozen(struct ctdb_db_context *ctdb_db);
684 bool ctdb_db_prio_frozen(struct ctdb_context *ctdb, uint32_t priority);
685 bool ctdb_db_all_frozen(struct ctdb_context *ctdb);
686
687 /* from server/ctdb_keepalive.c */
688
689 void ctdb_start_keepalive(struct ctdb_context *ctdb);
690 void ctdb_stop_keepalive(struct ctdb_context *ctdb);
691
692 /* from server/ctdb_lock.c */
693
694 struct lock_request;
695
696 typedef int (*ctdb_db_handler_t)(struct ctdb_db_context *ctdb_db,
697                                  void *private_data);
698
699 int ctdb_db_prio_iterator(struct ctdb_context *ctdb, uint32_t priority,
700                           ctdb_db_handler_t handler, void *private_data);
701 int ctdb_db_iterator(struct ctdb_context *ctdb, ctdb_db_handler_t handler,
702                      void *private_data);
703
704 int ctdb_lockdb_mark(struct ctdb_db_context *ctdb_db);
705 int ctdb_lockall_mark_prio(struct ctdb_context *ctdb, uint32_t priority);
706
707 int ctdb_lockdb_unmark(struct ctdb_db_context *ctdb_db);
708 int ctdb_lockall_unmark_prio(struct ctdb_context *ctdb, uint32_t priority);
709
710 struct lock_request *ctdb_lock_record(TALLOC_CTX *mem_ctx,
711                                       struct ctdb_db_context *ctdb_db,
712                                       TDB_DATA key,
713                                       bool auto_mark,
714                                       void (*callback)(void *, bool),
715                                       void *private_data);
716
717 struct lock_request *ctdb_lock_db(TALLOC_CTX *mem_ctx,
718                                   struct ctdb_db_context *ctdb_db,
719                                   bool auto_mark,
720                                   void (*callback)(void *, bool),
721                                   void *private_data);
722
723 struct lock_request *ctdb_lock_alldb_prio(TALLOC_CTX *mem_ctx,
724                                           struct ctdb_context *ctdb,
725                                           uint32_t priority,
726                                           bool auto_mark,
727                                           void (*callback)(void *, bool),
728                                           void *private_data);
729
730 struct lock_request *ctdb_lock_alldb(TALLOC_CTX *mem_ctx,
731                                      struct ctdb_context *ctdb,
732                                      bool auto_mark,
733                                      void (*callback)(void *, bool),
734                                      void *private_data);
735
736 /* from ctdb_logging.c */
737
738 extern const char *debug_extra;
739
740 typedef int (*ctdb_log_setup_fn_t)(TALLOC_CTX *mem_ctx,
741                                    const char *logging,
742                                    const char *app_name);
743
744 void ctdb_log_register_backend(const char *prefix, ctdb_log_setup_fn_t init);
745
746 bool ctdb_logging_init(TALLOC_CTX *mem_ctx, const char *logging);
747
748 struct ctdb_log_state *ctdb_vfork_with_logging(TALLOC_CTX *mem_ctx,
749                                                struct ctdb_context *ctdb,
750                                                const char *log_prefix,
751                                                const char *helper,
752                                                int helper_argc,
753                                                const char **helper_argv,
754                                                void (*logfn)(const char *,
755                                                              uint16_t, void *),
756                                                void *logfn_private, pid_t *pid);
757
758 int ctdb_set_child_logging(struct ctdb_context *ctdb);
759 int ctdb_init_tevent_logging(struct ctdb_context *ctdb);
760
761 /* from ctdb_logging_file.c */
762
763 void ctdb_log_init_file(void);
764
765 /* from ctdb_logging_syslog.c */
766
767 void ctdb_log_init_syslog(void);
768
769 /* from ctdb_ltdb_server.c */
770
771 int ctdb_ltdb_lock_requeue(struct ctdb_db_context *ctdb_db,
772                            TDB_DATA key, struct ctdb_req_header *hdr,
773                            void (*recv_pkt)(void *, struct ctdb_req_header *),
774                            void *recv_context, bool ignore_generation);
775
776 int ctdb_ltdb_lock_fetch_requeue(struct ctdb_db_context *ctdb_db,
777                                  TDB_DATA key, struct ctdb_ltdb_header *header,
778                                  struct ctdb_req_header *hdr, TDB_DATA *data,
779                                  void (*recv_pkt)(void *, struct ctdb_req_header *),
780                                  void *recv_context, bool ignore_generation);
781
782 int ctdb_load_persistent_health(struct ctdb_context *ctdb,
783                                 struct ctdb_db_context *ctdb_db);
784 int ctdb_update_persistent_health(struct ctdb_context *ctdb,
785                                   struct ctdb_db_context *ctdb_db,
786                                   const char *reason,/* NULL means healthy */
787                                   int num_healthy_nodes);
788 int ctdb_recheck_persistent_health(struct ctdb_context *ctdb);
789
790 int32_t ctdb_control_db_set_healthy(struct ctdb_context *ctdb,
791                                     TDB_DATA indata);
792 int32_t ctdb_control_db_get_health(struct ctdb_context *ctdb,
793                                    TDB_DATA indata, TDB_DATA *outdata);
794
795 int ctdb_set_db_readonly(struct ctdb_context *ctdb,
796                          struct ctdb_db_context *ctdb_db);
797
798 int ctdb_process_deferred_attach(struct ctdb_context *ctdb);
799
800 int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
801                                TDB_DATA *outdata, uint64_t tdb_flags,
802                                bool persistent, uint32_t client_id,
803                                struct ctdb_req_control_old *c,
804                                bool *async_reply);
805 int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata,
806                                uint32_t client_id);
807
808 int ctdb_attach_databases(struct ctdb_context *ctdb);
809
810 int32_t ctdb_ltdb_update_seqnum(struct ctdb_context *ctdb, uint32_t db_id,
811                                 uint32_t srcnode);
812 int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id);
813
814 int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata,
815                                      uint32_t client_id);
816
817 int ctdb_set_db_sticky(struct ctdb_context *ctdb,
818                        struct ctdb_db_context *ctdb_db);
819
820 void ctdb_db_statistics_reset(struct ctdb_db_context *ctdb_db);
821
822 int32_t ctdb_control_get_db_statistics(struct ctdb_context *ctdb,
823                                        uint32_t db_id, TDB_DATA *outdata);
824
825 /* from ctdb_monitor.c */
826
827 int ctdb_set_notification_script(struct ctdb_context *ctdb, const char *script);
828 void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event);
829
830 void ctdb_disable_monitoring(struct ctdb_context *ctdb);
831 void ctdb_enable_monitoring(struct ctdb_context *ctdb);
832 void ctdb_stop_monitoring(struct ctdb_context *ctdb);
833
834 void ctdb_wait_for_first_recovery(struct ctdb_context *ctdb);
835
836 int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata);
837
838 int32_t ctdb_monitoring_mode(struct ctdb_context *ctdb);
839 bool ctdb_stopped_monitoring(struct ctdb_context *ctdb);
840
841 /* from ctdb_persistent.c */
842
843 void ctdb_persistent_finish_trans3_commits(struct ctdb_context *ctdb);
844
845 int32_t ctdb_control_trans3_commit(struct ctdb_context *ctdb,
846                                    struct ctdb_req_control_old *c,
847                                    TDB_DATA recdata, bool *async_reply);
848
849 int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb,
850                                              struct ctdb_req_control_old *c,
851                                              TDB_DATA recdata);
852 int32_t ctdb_control_cancel_persistent_update(struct ctdb_context *ctdb,
853                                               struct ctdb_req_control_old *c,
854                                               TDB_DATA recdata);
855
856 int32_t ctdb_control_get_db_seqnum(struct ctdb_context *ctdb,
857                                    TDB_DATA indata, TDB_DATA *outdata);
858
859 /* from ctdb_recover.c */
860
861 int ctdb_control_getvnnmap(struct ctdb_context *ctdb, uint32_t opcode,
862                            TDB_DATA indata, TDB_DATA *outdata);
863 int ctdb_control_setvnnmap(struct ctdb_context *ctdb, uint32_t opcode,
864                            TDB_DATA indata, TDB_DATA *outdata);
865
866 int ctdb_control_getdbmap(struct ctdb_context *ctdb, uint32_t opcode,
867                           TDB_DATA indata, TDB_DATA *outdata);
868 int ctdb_control_getnodemap(struct ctdb_context *ctdb, uint32_t opcode,
869                             TDB_DATA indata, TDB_DATA *outdata);
870
871 int ctdb_control_reload_nodes_file(struct ctdb_context *ctdb, uint32_t opcode);
872
873 int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata,
874                              TDB_DATA *outdata);
875 int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata);
876
877 int32_t ctdb_control_db_pull(struct ctdb_context *ctdb,
878                              struct ctdb_req_control_old *c,
879                              TDB_DATA indata, TDB_DATA *outdata);
880 int32_t ctdb_control_db_push_start(struct ctdb_context *ctdb,
881                                    TDB_DATA indata);
882 int32_t ctdb_control_db_push_confirm(struct ctdb_context *ctdb,
883                                      TDB_DATA indata, TDB_DATA *outdata);
884
885 int ctdb_deferred_drop_all_ips(struct ctdb_context *ctdb);
886
887 int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb,
888                                  struct ctdb_req_control_old *c,
889                                  TDB_DATA indata, bool *async_reply,
890                                  const char **errormsg);
891
892 int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
893                                  struct ctdb_req_control_old *c,
894                                  bool *async_reply);
895 int32_t ctdb_control_start_recovery(struct ctdb_context *ctdb,
896                                  struct ctdb_req_control_old *c,
897                                  bool *async_reply);
898
899 int32_t ctdb_control_try_delete_records(struct ctdb_context *ctdb,
900                                         TDB_DATA indata, TDB_DATA *outdata);
901 int32_t ctdb_control_receive_records(struct ctdb_context *ctdb,
902                                      TDB_DATA indata, TDB_DATA *outdata);
903
904 int32_t ctdb_control_get_capabilities(struct ctdb_context *ctdb,
905                                       TDB_DATA *outdata);
906
907 int32_t ctdb_control_recd_ping(struct ctdb_context *ctdb);
908 int32_t ctdb_control_set_recmaster(struct ctdb_context *ctdb,
909                                    uint32_t opcode, TDB_DATA indata);
910
911 int32_t ctdb_control_stop_node(struct ctdb_context *ctdb);
912 int32_t ctdb_control_continue_node(struct ctdb_context *ctdb);
913
914 /* from ctdb_recoverd.c */
915
916 int ctdb_start_recoverd(struct ctdb_context *ctdb);
917 void ctdb_stop_recoverd(struct ctdb_context *ctdb);
918
919 /* from ctdb_server.c */
920
921 int ctdb_set_transport(struct ctdb_context *ctdb, const char *transport);
922
923 int ctdb_ip_to_nodeid(struct ctdb_context *ctdb, const ctdb_sock_addr *nodeip);
924
925 int ctdb_set_recovery_lock_file(struct ctdb_context *ctdb, const char *file);
926
927 void ctdb_load_nodes_file(struct ctdb_context *ctdb);
928
929 int ctdb_set_address(struct ctdb_context *ctdb, const char *address);
930
931 uint32_t ctdb_get_num_active_nodes(struct ctdb_context *ctdb);
932
933 void ctdb_input_pkt(struct ctdb_context *ctdb, struct ctdb_req_header *);
934
935 void ctdb_node_dead(struct ctdb_node *node);
936 void ctdb_node_connected(struct ctdb_node *node);
937
938 void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
939 void ctdb_queue_packet_opcode(struct ctdb_context *ctdb,
940                               struct ctdb_req_header *hdr, unsigned opcode);
941
942 /* from ctdb_serverids.c */
943
944 int32_t ctdb_control_register_server_id(struct ctdb_context *ctdb,
945                                         uint32_t client_id, TDB_DATA indata);
946 int32_t ctdb_control_check_server_id(struct ctdb_context *ctdb,
947                                      TDB_DATA indata);
948 int32_t ctdb_control_unregister_server_id(struct ctdb_context *ctdb,
949                                           TDB_DATA indata);
950 int32_t ctdb_control_get_server_id_list(struct ctdb_context *ctdb,
951                                         TDB_DATA *outdata);
952
953 /* from ctdb_statistics.c */
954
955 int ctdb_statistics_init(struct ctdb_context *ctdb);
956
957 int32_t ctdb_control_get_stat_history(struct ctdb_context *ctdb,
958                                       struct ctdb_req_control_old *c,
959                                       TDB_DATA *outdata);
960
961 /* from ctdb_takeover.c */
962
963 int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
964                                  struct ctdb_req_control_old *c,
965                                  TDB_DATA indata,
966                                  bool *async_reply);
967 int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
968                                  struct ctdb_req_control_old *c,
969                                  TDB_DATA indata,
970                                  bool *async_reply);
971 int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
972                                  struct ctdb_req_control_old *c,
973                                  bool *async_reply);
974
975 int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses);
976
977 int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
978                       uint32_t *force_rebalance_nodes,
979                       client_async_callback fail_callback, void *callback_data);
980
981 int32_t ctdb_control_tcp_client(struct ctdb_context *ctdb, uint32_t client_id,
982                                 TDB_DATA indata);
983 int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, TDB_DATA indata,
984                              bool tcp_update_needed);
985 int32_t ctdb_control_tcp_remove(struct ctdb_context *ctdb, TDB_DATA indata);
986 int32_t ctdb_control_startup(struct ctdb_context *ctdb, uint32_t vnn);
987
988 void ctdb_takeover_client_destructor_hook(struct ctdb_client *client);
989
990 void ctdb_release_all_ips(struct ctdb_context *ctdb);
991
992 int32_t ctdb_control_get_public_ips(struct ctdb_context *ctdb,
993                                     struct ctdb_req_control_old *c,
994                                     TDB_DATA *outdata);
995 int32_t ctdb_control_get_public_ip_info(struct ctdb_context *ctdb,
996                                         struct ctdb_req_control_old *c,
997                                         TDB_DATA indata, TDB_DATA *outdata);
998
999 int32_t ctdb_control_get_ifaces(struct ctdb_context *ctdb,
1000                                 struct ctdb_req_control_old *c,
1001                                 TDB_DATA *outdata);
1002 int32_t ctdb_control_set_iface_link(struct ctdb_context *ctdb,
1003                                     struct ctdb_req_control_old *c,
1004                                     TDB_DATA indata);
1005
1006 int32_t ctdb_control_set_tcp_tickle_list(struct ctdb_context *ctdb,
1007                                          TDB_DATA indata);
1008 int32_t ctdb_control_get_tcp_tickle_list(struct ctdb_context *ctdb,
1009                                          TDB_DATA indata, TDB_DATA *outdata);
1010
1011 void ctdb_start_tcp_tickle_update(struct ctdb_context *ctdb);
1012
1013 int32_t ctdb_control_send_gratious_arp(struct ctdb_context *ctdb,
1014                                        TDB_DATA indata);
1015
1016 int32_t ctdb_control_add_public_address(struct ctdb_context *ctdb,
1017                                         TDB_DATA indata);
1018 int32_t ctdb_control_del_public_address(struct ctdb_context *ctdb,
1019                                         struct ctdb_req_control_old *c,
1020                                         TDB_DATA recdata, bool *async_reply);
1021
1022 int update_ip_assignment_tree(struct ctdb_context *ctdb,
1023                                 struct ctdb_public_ip *ip);
1024 void clear_ip_assignment_tree(struct ctdb_context *ctdb);
1025
1026 int32_t ctdb_control_reload_public_ips(struct ctdb_context *ctdb,
1027                                        struct ctdb_req_control_old *c,
1028                                        bool *async_reply);
1029
1030 /* from ctdb_traverse.c */
1031
1032 int32_t ctdb_control_traverse_all_ext(struct ctdb_context *ctdb,
1033                                       TDB_DATA data, TDB_DATA *outdata);
1034 int32_t ctdb_control_traverse_all(struct ctdb_context *ctdb,
1035                                   TDB_DATA data, TDB_DATA *outdata);
1036 int32_t ctdb_control_traverse_data(struct ctdb_context *ctdb,
1037                                    TDB_DATA data, TDB_DATA *outdata);
1038 int32_t ctdb_control_traverse_kill(struct ctdb_context *ctdb, TDB_DATA indata,
1039                                     TDB_DATA *outdata, uint32_t srcnode);
1040
1041 int32_t ctdb_control_traverse_start_ext(struct ctdb_context *ctdb,
1042                                         TDB_DATA indata, TDB_DATA *outdata,
1043                                         uint32_t srcnode, uint32_t client_id);
1044 int32_t ctdb_control_traverse_start(struct ctdb_context *ctdb,
1045                                     TDB_DATA indata, TDB_DATA *outdata,
1046                                     uint32_t srcnode, uint32_t client_id);
1047
1048 /* from ctdb_tunables.c */
1049
1050 void ctdb_tunables_set_defaults(struct ctdb_context *ctdb);
1051
1052 int32_t ctdb_control_get_tunable(struct ctdb_context *ctdb, TDB_DATA indata,
1053                                  TDB_DATA *outdata);
1054 int32_t ctdb_control_set_tunable(struct ctdb_context *ctdb, TDB_DATA indata);
1055 int32_t ctdb_control_list_tunables(struct ctdb_context *ctdb,
1056                                    TDB_DATA *outdata);
1057
1058 /* from ctdb_update_record.c */
1059
1060 int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
1061                                    struct ctdb_req_control_old *c,
1062                                    TDB_DATA recdata, bool *async_reply);
1063
1064 /* from ctdb_uptime.c */
1065
1066 int32_t ctdb_control_uptime(struct ctdb_context *ctdb, TDB_DATA *outdata);
1067
1068 /* from ctdb_vacuum.c */
1069
1070 void ctdb_stop_vacuuming(struct ctdb_context *ctdb);
1071 int ctdb_vacuum_init(struct ctdb_db_context *ctdb_db);
1072
1073 int32_t ctdb_control_schedule_for_deletion(struct ctdb_context *ctdb,
1074                                            TDB_DATA indata);
1075 int32_t ctdb_local_schedule_for_deletion(struct ctdb_db_context *ctdb_db,
1076                                          const struct ctdb_ltdb_header *hdr,
1077                                          TDB_DATA key);
1078
1079 void ctdb_local_remove_from_delete_queue(struct ctdb_db_context *ctdb_db,
1080                                          const struct ctdb_ltdb_header *hdr,
1081                                          const TDB_DATA key);
1082
1083 /* from eventscript.c */
1084
1085 int32_t ctdb_control_get_event_script_status(struct ctdb_context *ctdb,
1086                                              uint32_t call_type,
1087                                              TDB_DATA *outdata);
1088
1089 int ctdb_event_script_callback(struct ctdb_context *ctdb,
1090                                TALLOC_CTX *mem_ctx,
1091                                void (*callback)(struct ctdb_context *,
1092                                                 int, void *),
1093                                void *private_data,
1094                                enum ctdb_event call,
1095                                const char *fmt, ...) PRINTF_ATTRIBUTE(6,7);
1096
1097 int ctdb_event_script_args(struct ctdb_context *ctdb,
1098                            enum ctdb_event call,
1099                            const char *fmt, ...) PRINTF_ATTRIBUTE(3,4);
1100
1101 int ctdb_event_script(struct ctdb_context *ctdb,
1102                       enum ctdb_event call);
1103
1104 int32_t ctdb_run_eventscripts(struct ctdb_context *ctdb,
1105                               struct ctdb_req_control_old *c,
1106                               TDB_DATA data, bool *async_reply);
1107
1108 int32_t ctdb_control_enable_script(struct ctdb_context *ctdb, TDB_DATA indata);
1109 int32_t ctdb_control_disable_script(struct ctdb_context *ctdb, TDB_DATA indata);
1110
1111 #endif