4 Copyright (C) Andrew Tridgell 2006
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef _CTDB_PROTOCOL_H
21 #define _CTDB_PROTOCOL_H
23 #define CTDB_IMMEDIATE_MIGRATION 0x00000001
34 structure passed to a ctdb call backend function
36 struct ctdb_call_info {
37 TDB_DATA key; /* record key */
38 TDB_DATA record_data; /* current data in the record */
39 TDB_DATA *new_data; /* optionally updated record data */
40 TDB_DATA *call_data; /* optionally passed from caller */
41 TDB_DATA *reply_data; /* optionally returned by function */
42 uint32_t status; /* optional reply status - defaults to zero */
45 #define CTDB_ERR_INVALID 1
46 #define CTDB_ERR_NOMEM 2
51 #define CTDB_FLAG_TORTURE (1<<1)
54 a message handler ID meaning "give me all messages"
56 #define CTDB_SRVID_ALL (~(uint64_t)0)
61 #define CTDB_SRVID_RECOVERY 0xF100000000000000LL
64 a message handler ID meaning that the cluster has been reconfigured
66 #define CTDB_SRVID_RECONFIGURE 0xF200000000000000LL
69 a message handler ID meaning that an IP address has been released
71 #define CTDB_SRVID_RELEASE_IP 0xF300000000000000LL
74 a message ID to set the node flags in the recovery daemon
76 #define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
79 a message ID to ask the recovery daemon to update the expected node
80 assignment for a public ip
82 #define CTDB_SRVID_RECD_UPDATE_IP 0xF500000000000000LL
85 a message to tell the recovery daemon to fetch a set of records
87 #define CTDB_SRVID_VACUUM_FETCH 0xF700000000000000LL
90 a message to tell the recovery daemon to write a talloc memdump
93 #define CTDB_SRVID_MEM_DUMP 0xF800000000000000LL
96 a message ID to get the recovery daemon to push the node flags out
98 #define CTDB_SRVID_PUSH_NODE_FLAGS 0xF900000000000000LL
101 a message ID to get the recovery daemon to reload the nodes file
103 #define CTDB_SRVID_RELOAD_NODES 0xFA00000000000000LL
106 a message ID to get the recovery daemon to perform a takeover run
108 #define CTDB_SRVID_TAKEOVER_RUN 0xFB00000000000000LL
110 /* A message id to ask the recovery daemon to temporarily disable the
113 #define CTDB_SRVID_DISABLE_IP_CHECK 0xFC00000000000000LL
115 /* A dummy port used for sending back ipreallocate resposnes to the main
118 #define CTDB_SRVID_TAKEOVER_RUN_RESPONSE 0xFD00000000000000LL
120 /* A port reserved for samba (top 32 bits)
122 #define CTDB_SRVID_SAMBA_NOTIFY 0xFE00000000000000LL
125 /* the key used for transaction locking on persistent databases */
126 #define CTDB_TRANSACTION_LOCK_KEY "__transaction_lock__"
128 /* the key used to store persistent db sequence number */
129 #define CTDB_DB_SEQNUM_KEY "__db_sequence_number__"
131 enum control_state {CTDB_CONTROL_WAIT, CTDB_CONTROL_DONE, CTDB_CONTROL_ERROR, CTDB_CONTROL_TIMEOUT};
133 struct ctdb_client_control_state {
134 struct ctdb_context *ctdb;
138 enum control_state state;
140 struct ctdb_req_control *c;
142 /* if we have a callback registered for the completion (or failure) of
144 if a callback is used, it MUST talloc_free the cb_data passed to it
147 void (*fn)(struct ctdb_client_control_state *);
152 struct ctdb_client_notify_register {
155 uint8_t notify_data[1];
158 struct ctdb_client_notify_deregister {
162 struct event_context;
165 initialise ctdb subsystem
167 struct ctdb_context *ctdb_init(struct event_context *ev);
172 int ctdb_set_transport(struct ctdb_context *ctdb, const char *transport);
175 set the directory for the local databases
177 int ctdb_set_tdb_dir(struct ctdb_context *ctdb, const char *dir);
178 int ctdb_set_tdb_dir_persistent(struct ctdb_context *ctdb, const char *dir);
179 int ctdb_set_tdb_dir_state(struct ctdb_context *ctdb, const char *dir);
184 void ctdb_set_flags(struct ctdb_context *ctdb, unsigned flags);
187 set max acess count before a dmaster migration
189 void ctdb_set_max_lacount(struct ctdb_context *ctdb, unsigned count);
192 tell ctdb what address to listen on, in transport specific format
194 int ctdb_set_address(struct ctdb_context *ctdb, const char *address);
196 int ctdb_set_socketname(struct ctdb_context *ctdb, const char *socketname);
199 tell ctdb what nodes are available. This takes a filename, which will contain
200 1 node address per line, in a transport specific format
202 int ctdb_set_nlist(struct ctdb_context *ctdb, const char *nlist);
205 Check that a specific ip address exists in the node list and returns
206 the id for the node or -1
208 int ctdb_ip_to_nodeid(struct ctdb_context *ctdb, const char *nodeip);
211 start the ctdb protocol
213 int ctdb_start(struct ctdb_context *ctdb);
214 int ctdb_start_daemon(struct ctdb_context *ctdb, bool do_fork, bool use_syslog);
217 find an attached ctdb_db handle given a name
219 struct ctdb_db_context *ctdb_db_handle(struct ctdb_context *ctdb, const char *name);
222 error string for last ctdb error
224 const char *ctdb_errstr(struct ctdb_context *);
226 /* a ctdb call function */
227 typedef int (*ctdb_fn_t)(struct ctdb_call_info *);
230 setup a ctdb call function
232 int ctdb_set_call(struct ctdb_db_context *ctdb_db, ctdb_fn_t fn, uint32_t id);
237 make a ctdb call. The associated ctdb call function will be called on the DMASTER
240 int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
243 initiate an ordered ctdb cluster shutdown
244 this function will never return
246 void ctdb_shutdown(struct ctdb_context *ctdb);
248 /* return pnn of this node */
249 uint32_t ctdb_get_pnn(struct ctdb_context *ctdb);
252 return the number of nodes
254 uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb);
257 int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
258 struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
259 int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call);
263 Fetch a ctdb record from a remote node
264 . Underneath this will force the
265 dmaster for the record to be moved to the local node.
267 struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx,
268 TDB_DATA key, TDB_DATA *data);
270 int ctdb_record_store(struct ctdb_record_handle *h, TDB_DATA data);
272 int ctdb_fetch(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx,
273 TDB_DATA key, TDB_DATA *data);
275 int ctdb_register_message_handler(struct ctdb_context *ctdb,
278 ctdb_message_fn_t handler,
281 struct ctdb_db_context *find_ctdb_db(struct ctdb_context *ctdb, uint32_t id);
284 struct ctdb_context *ctdb_cmdline_client(struct event_context *ev);
286 struct ctdb_statistics;
287 int ctdb_ctrl_statistics(struct ctdb_context *ctdb, uint32_t destnode, struct ctdb_statistics *status);
289 int ctdb_ctrl_shutdown(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
292 int ctdb_ctrl_getvnnmap(struct ctdb_context *ctdb,
293 struct timeval timeout, uint32_t destnode,
294 TALLOC_CTX *mem_ctx, struct ctdb_vnn_map **vnnmap);
295 int ctdb_ctrl_setvnnmap(struct ctdb_context *ctdb,
296 struct timeval timeout, uint32_t destnode,
297 TALLOC_CTX *mem_ctx, struct ctdb_vnn_map *vnnmap);
299 /* table that contains a list of all dbids on a node
301 struct ctdb_dbid_map {
308 int ctdb_ctrl_getdbmap(struct ctdb_context *ctdb,
309 struct timeval timeout, uint32_t destnode,
310 TALLOC_CTX *mem_ctx, struct ctdb_dbid_map **dbmap);
313 struct ctdb_node_map;
315 int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb,
316 struct timeval timeout, uint32_t destnode,
317 TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap);
319 int ctdb_ctrl_getnodemapv4(struct ctdb_context *ctdb,
320 struct timeval timeout, uint32_t destnode,
321 TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap);
323 int ctdb_ctrl_reload_nodes_file(struct ctdb_context *ctdb,
324 struct timeval timeout, uint32_t destnode);
326 struct ctdb_key_list {
330 struct ctdb_ltdb_header *headers;
334 int ctdb_ctrl_pulldb(
335 struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
336 uint32_t lmaster, TALLOC_CTX *mem_ctx,
337 struct timeval timeout, TDB_DATA *outdata);
339 struct ctdb_client_control_state *ctdb_ctrl_pulldb_send(
340 struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
341 uint32_t lmaster, TALLOC_CTX *mem_ctx, struct timeval timeout);
343 int ctdb_ctrl_pulldb_recv(
344 struct ctdb_context *ctdb,
345 TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state,
348 int ctdb_ctrl_pushdb(
349 struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
351 struct timeval timeout, TDB_DATA indata);
353 struct ctdb_client_control_state *ctdb_ctrl_pushdb_send(
354 struct ctdb_context *ctdb, uint32_t destnode, uint32_t dbid,
355 TALLOC_CTX *mem_ctx, struct timeval timeout,
358 int ctdb_ctrl_pushdb_recv(
359 struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
360 struct ctdb_client_control_state *state);
363 int ctdb_ctrl_copydb(struct ctdb_context *ctdb,
364 struct timeval timeout, uint32_t sourcenode,
365 uint32_t destnode, uint32_t dbid, uint32_t lmaster,
366 TALLOC_CTX *mem_ctx);
368 int ctdb_ctrl_getdbpath(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t dbid, TALLOC_CTX *mem_ctx, const char **path);
369 int ctdb_ctrl_getdbname(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t dbid, TALLOC_CTX *mem_ctx, const char **name);
370 int ctdb_ctrl_getdbhealth(struct ctdb_context *ctdb,
371 struct timeval timeout,
373 uint32_t dbid, TALLOC_CTX *mem_ctx,
374 const char **reason);
375 int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *name, bool persistent);
377 int ctdb_ctrl_process_exists(struct ctdb_context *ctdb, uint32_t destnode, pid_t pid);
379 int ctdb_ctrl_ping(struct ctdb_context *ctdb, uint32_t destnode);
381 int ctdb_ctrl_get_config(struct ctdb_context *ctdb);
383 int ctdb_ctrl_get_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, int32_t *level);
384 int ctdb_ctrl_set_debuglevel(struct ctdb_context *ctdb, uint32_t destnode, int32_t level);
387 change dmaster for all keys in the database to the new value
389 int ctdb_ctrl_setdmaster(struct ctdb_context *ctdb,
390 struct timeval timeout, uint32_t destnode,
391 TALLOC_CTX *mem_ctx, uint32_t dbid, uint32_t dmaster);
394 write a record on a specific db (this implicitely updates dmaster of the record to locally be the vnn of the node where the control is executed on)
396 int ctdb_ctrl_write_record(struct ctdb_context *ctdb, uint32_t destnode, TALLOC_CTX *mem_ctx, uint32_t dbid, TDB_DATA key, TDB_DATA data);
398 #define CTDB_RECOVERY_NORMAL 0
399 #define CTDB_RECOVERY_ACTIVE 1
402 get the recovery mode of a remote node
404 int ctdb_ctrl_getrecmode(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode, uint32_t *recmode);
406 struct ctdb_client_control_state *ctdb_ctrl_getrecmode_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode);
408 int ctdb_ctrl_getrecmode_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, uint32_t *recmode);
412 set the recovery mode of a remote node
414 int ctdb_ctrl_setrecmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmode);
416 get the monitoring mode of a remote node
418 int ctdb_ctrl_getmonmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *monmode);
421 set the monitoring mode of a remote node to active
423 int ctdb_ctrl_enable_monmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
426 set the monitoring mode of a remote node to disabled
428 int ctdb_ctrl_disable_monmode(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
432 get the recovery master of a remote node
434 int ctdb_ctrl_getrecmaster(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode, uint32_t *recmaster);
436 struct ctdb_client_control_state *ctdb_ctrl_getrecmaster_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode);
438 int ctdb_ctrl_getrecmaster_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, uint32_t *recmaster);
443 set the recovery master of a remote node
445 int ctdb_ctrl_setrecmaster(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmaster);
447 uint32_t *ctdb_get_connected_nodes(struct ctdb_context *ctdb,
448 struct timeval timeout,
450 uint32_t *num_nodes);
452 int ctdb_statistics_reset(struct ctdb_context *ctdb, uint32_t destnode);
454 int ctdb_set_logfile(struct ctdb_context *ctdb, const char *logfile, bool use_syslog);
456 typedef int (*ctdb_traverse_func)(struct ctdb_context *, TDB_DATA, TDB_DATA, void *);
457 int ctdb_traverse(struct ctdb_db_context *ctdb_db, ctdb_traverse_func fn, void *private_data);
459 int ctdb_dumpdb_record(struct ctdb_context *ctdb, TDB_DATA key, TDB_DATA data, void *p);
460 int ctdb_dump_db(struct ctdb_db_context *ctdb_db, FILE *f);
463 get the pid of a ctdb daemon
465 int ctdb_ctrl_getpid(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *pid);
467 int ctdb_ctrl_freeze(struct ctdb_context *ctdb, struct timeval timeout,
469 int ctdb_ctrl_freeze_priority(struct ctdb_context *ctdb, struct timeval timeout,
470 uint32_t destnode, uint32_t priority);
472 struct ctdb_client_control_state *
473 ctdb_ctrl_freeze_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
474 struct timeval timeout, uint32_t destnode,
477 int ctdb_ctrl_freeze_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
478 struct ctdb_client_control_state *state);
480 int ctdb_ctrl_thaw_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t priority);
481 int ctdb_ctrl_thaw(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
483 int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
485 int ctdb_ctrl_get_tunable(struct ctdb_context *ctdb,
486 struct timeval timeout,
488 const char *name, uint32_t *value);
490 int ctdb_ctrl_set_tunable(struct ctdb_context *ctdb,
491 struct timeval timeout,
493 const char *name, uint32_t value);
495 int ctdb_ctrl_list_tunables(struct ctdb_context *ctdb,
496 struct timeval timeout,
499 const char ***list, uint32_t *count);
501 int ctdb_ctrl_modflags(struct ctdb_context *ctdb,
502 struct timeval timeout,
504 uint32_t set, uint32_t clear);
506 enum ctdb_server_id_type { SERVER_TYPE_SAMBA=1 };
508 struct ctdb_server_id {
509 enum ctdb_server_id_type type;
514 struct ctdb_server_id_list {
516 struct ctdb_server_id server_ids[1];
520 int ctdb_ctrl_register_server_id(struct ctdb_context *ctdb,
521 struct timeval timeout,
522 struct ctdb_server_id *id);
523 int ctdb_ctrl_unregister_server_id(struct ctdb_context *ctdb,
524 struct timeval timeout,
525 struct ctdb_server_id *id);
526 int ctdb_ctrl_check_server_id(struct ctdb_context *ctdb,
527 struct timeval timeout, uint32_t destnode,
528 struct ctdb_server_id *id, uint32_t *status);
529 int ctdb_ctrl_get_server_id_list(struct ctdb_context *ctdb,
531 struct timeval timeout, uint32_t destnode,
532 struct ctdb_server_id_list **svid_list);
535 struct timeval current_time;
536 struct timeval ctdbd_start_time;
537 struct timeval last_recovery_started;
538 struct timeval last_recovery_finished;
542 definitions for different socket structures
544 typedef struct sockaddr_in ctdb_addr_in;
545 typedef struct sockaddr_in6 ctdb_addr_in6;
553 struct for tcp_client control
554 this is an ipv4 only version of this structure used by samba
555 samba will later be migrated over to use the
556 ctdb_control_tcp_addr structure instead
558 struct ctdb_control_tcp {
559 struct sockaddr_in src; // samba uses this
560 struct sockaddr_in dest;// samba uses this
562 /* new style structure */
563 struct ctdb_control_tcp_addr {
568 int ctdb_socket_connect(struct ctdb_context *ctdb);
571 get the uptime of a remote node
573 int ctdb_ctrl_uptime(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode, struct ctdb_uptime **uptime);
575 struct ctdb_client_control_state *ctdb_ctrl_uptime_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode);
577 int ctdb_ctrl_uptime_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, struct ctdb_uptime **uptime);
579 int ctdb_ctrl_end_recovery(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
581 int ctdb_ctrl_getreclock(struct ctdb_context *ctdb,
582 struct timeval timeout, uint32_t destnode,
583 TALLOC_CTX *mem_ctx, const char **reclock);
584 int ctdb_ctrl_setreclock(struct ctdb_context *ctdb,
585 struct timeval timeout, uint32_t destnode,
586 const char *reclock);
589 uint32_t *list_of_connected_nodes(struct ctdb_context *ctdb,
590 struct ctdb_node_map *node_map,
593 uint32_t *list_of_active_nodes(struct ctdb_context *ctdb,
594 struct ctdb_node_map *node_map,
597 uint32_t *list_of_vnnmap_nodes(struct ctdb_context *ctdb,
598 struct ctdb_vnn_map *vnn_map,
601 uint32_t *list_of_active_nodes_except_pnn(struct ctdb_context *ctdb,
602 struct ctdb_node_map *node_map,
606 int ctdb_read_pnn_lock(int fd, int32_t pnn);
609 get capabilities of a remote node
611 int ctdb_ctrl_getcapabilities(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t *capabilities);
613 struct ctdb_client_control_state *ctdb_ctrl_getcapabilities_send(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct timeval timeout, uint32_t destnode);
615 int ctdb_ctrl_getcapabilities_recv(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, struct ctdb_client_control_state *state, uint32_t *capabilities);
618 int32_t ctdb_ctrl_transaction_active(struct ctdb_context *ctdb,
622 struct ctdb_marshall_buffer *ctdb_marshall_add(TALLOC_CTX *mem_ctx,
623 struct ctdb_marshall_buffer *m,
627 struct ctdb_ltdb_header *header,
629 TDB_DATA ctdb_marshall_finish(struct ctdb_marshall_buffer *m);
631 struct ctdb_transaction_handle *ctdb_transaction_start(struct ctdb_db_context *ctdb_db,
632 TALLOC_CTX *mem_ctx);
633 int ctdb_transaction_fetch(struct ctdb_transaction_handle *h,
635 TDB_DATA key, TDB_DATA *data);
636 int ctdb_transaction_store(struct ctdb_transaction_handle *h,
637 TDB_DATA key, TDB_DATA data);
638 int ctdb_transaction_commit(struct ctdb_transaction_handle *h);
640 int ctdb_ctrl_recd_ping(struct ctdb_context *ctdb);
642 int switch_from_server_to_client(struct ctdb_context *ctdb);
644 #define MONITOR_SCRIPT_OK 0
645 #define MONITOR_SCRIPT_TIMEOUT 1
647 #define MAX_SCRIPT_NAME 31
648 #define MAX_SCRIPT_OUTPUT 511
649 struct ctdb_script_wire {
650 char name[MAX_SCRIPT_NAME+1];
651 struct timeval start;
652 struct timeval finished;
654 char output[MAX_SCRIPT_OUTPUT+1];
657 struct ctdb_scripts_wire {
658 uint32_t num_scripts;
659 struct ctdb_script_wire scripts[1];
662 /* different calls to event scripts. */
663 enum ctdb_eventscript_call {
664 CTDB_EVENT_INIT, /* CTDB starting up: no args */
665 CTDB_EVENT_SETUP, /* CTDB starting up after transport is readdy: no args. */
666 CTDB_EVENT_STARTUP, /* CTDB starting up after initial recovery: no args. */
667 CTDB_EVENT_START_RECOVERY, /* CTDB recovery starting: no args. */
668 CTDB_EVENT_RECOVERED, /* CTDB recovery finished: no args. */
669 CTDB_EVENT_TAKE_IP, /* IP taken: interface, IP address, netmask bits. */
670 CTDB_EVENT_RELEASE_IP, /* IP released: interface, IP address, netmask bits. */
671 CTDB_EVENT_STOPPED, /* This node is stopped: no args. */
672 CTDB_EVENT_MONITOR, /* Please check if service is healthy: no args. */
673 CTDB_EVENT_STATUS, /* Report service status: no args. */
674 CTDB_EVENT_SHUTDOWN, /* CTDB shutting down: no args. */
675 CTDB_EVENT_RELOAD, /* magic */
676 CTDB_EVENT_UPDATE_IP, /* IP updating: old interface, new interface, IP address, netmask bits. */
680 /* Mapping from enum to names. */
681 extern const char *ctdb_eventscript_call_names[];
683 int ctdb_ctrl_getscriptstatus(struct ctdb_context *ctdb,
684 struct timeval timeout, uint32_t destnode,
685 TALLOC_CTX *mem_ctx, enum ctdb_eventscript_call type,
686 struct ctdb_scripts_wire **script_status);
689 struct debug_levels {
691 const char *description;
693 extern struct debug_levels debug_levels[];
695 const char *get_debug_by_level(int32_t level);
696 int32_t get_debug_by_desc(const char *desc);
698 int ctdb_ctrl_stop_node(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
699 int ctdb_ctrl_continue_node(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode);
701 int ctdb_ctrl_setnatgwstate(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t natgwstate);
702 int ctdb_ctrl_setlmasterrole(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t lmasterrole);
703 int ctdb_ctrl_setrecmasterrole(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t recmasterrole);
705 int ctdb_ctrl_enablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
706 int ctdb_ctrl_disablescript(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, const char *script);
708 struct ctdb_ban_time {
713 int ctdb_ctrl_set_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_ban_time *bantime);
714 int ctdb_ctrl_get_ban(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, struct ctdb_ban_time **bantime);
716 struct ctdb_db_priority {
721 int ctdb_ctrl_set_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_db_priority *db_prio);
722 int ctdb_ctrl_get_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t db_id, uint32_t *priority);