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