4 Copyright (C) Amitay Isaacs 2015
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_CLIENT_H__
21 #define __CTDB_CLIENT_H__
26 #include "protocol/protocol.h"
27 #include "common/srvid.h"
29 struct ctdb_client_context
;
30 struct ctdb_db_context
;
31 struct ctdb_record_handle
;
33 /* from client/client_connect.c */
35 int ctdb_client_init(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
36 const char *sockpath
, struct ctdb_client_context
**ret
);
38 uint32_t ctdb_client_pnn(struct ctdb_client_context
*client
);
40 void ctdb_client_wait(struct tevent_context
*ev
, bool *done
);
42 struct tevent_req
*ctdb_recovery_wait_send(TALLOC_CTX
*mem_ctx
,
43 struct tevent_context
*ev
,
44 struct ctdb_client_context
*client
);
46 bool ctdb_recovery_wait_recv(struct tevent_req
*req
, int *perr
);
48 /* from client/client_call.c */
50 struct tevent_req
*ctdb_client_call_send(TALLOC_CTX
*mem_ctx
,
51 struct tevent_context
*ev
,
52 struct ctdb_client_context
*client
,
53 struct ctdb_req_call
*request
);
55 bool ctdb_client_call_recv(struct tevent_req
*req
, TALLOC_CTX
*mem_ctx
,
56 struct ctdb_reply_call
**reply
, int *perr
);
59 /* from client/client_message.c */
61 struct tevent_req
*ctdb_client_message_send(TALLOC_CTX
*mem_ctx
,
62 struct tevent_context
*ev
,
63 struct ctdb_client_context
*client
,
65 struct ctdb_req_message
*message
);
67 bool ctdb_client_message_recv(struct tevent_req
*req
, int *perr
);
69 int ctdb_client_message(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
70 struct ctdb_client_context
*client
,
71 uint32_t destnode
, struct ctdb_req_message
*message
);
73 int ctdb_client_set_message_handler(TALLOC_CTX
*mem_ctx
,
74 struct tevent_context
*ev
,
75 struct ctdb_client_context
*client
,
76 uint64_t srvid
, srvid_handler_fn handler
,
79 int ctdb_client_remove_message_handler(TALLOC_CTX
*mem_ctx
,
80 struct tevent_context
*ev
,
81 struct ctdb_client_context
*client
,
82 uint64_t srvid
, void *private_data
);
84 /* from client/client_message_sync.c */
86 int ctdb_message_recd_update_ip(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
87 struct ctdb_client_context
*client
,
88 int destnode
, struct ctdb_public_ip
*pubip
);
90 int ctdb_message_mem_dump(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
91 struct ctdb_client_context
*client
,
92 int destnode
, struct ctdb_srvid_message
*msg
);
94 int ctdb_message_reload_nodes(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
95 struct ctdb_client_context
*client
,
98 int ctdb_message_takeover_run(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
99 struct ctdb_client_context
*client
,
100 int destnode
, struct ctdb_srvid_message
*msg
);
102 int ctdb_message_rebalance_node(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
103 struct ctdb_client_context
*client
,
104 int destnode
, uint32_t pnn
);
106 int ctdb_message_disable_takeover_runs(TALLOC_CTX
*mem_ctx
,
107 struct tevent_context
*ev
,
108 struct ctdb_client_context
*client
,
110 struct ctdb_disable_message
*disable
);
112 int ctdb_message_disable_recoveries(TALLOC_CTX
*mem_ctx
,
113 struct tevent_context
*ev
,
114 struct ctdb_client_context
*client
,
116 struct ctdb_disable_message
*disable
);
118 int ctdb_message_disable_ip_check(TALLOC_CTX
*mem_ctx
,
119 struct tevent_context
*ev
,
120 struct ctdb_client_context
*client
,
121 int destnode
, uint32_t timeout
);
123 /* from client/client_control.c */
125 struct tevent_req
*ctdb_client_control_send(TALLOC_CTX
*mem_ctx
,
126 struct tevent_context
*ev
,
127 struct ctdb_client_context
*client
,
129 struct timeval timeout
,
130 struct ctdb_req_control
*request
);
132 bool ctdb_client_control_recv(struct tevent_req
*req
, int *perr
,
134 struct ctdb_reply_control
**preply
);
136 struct tevent_req
*ctdb_client_control_multi_send(
138 struct tevent_context
*ev
,
139 struct ctdb_client_context
*client
,
140 uint32_t *pnn_list
, int count
,
141 struct timeval timeout
,
142 struct ctdb_req_control
*request
);
144 bool ctdb_client_control_multi_recv(struct tevent_req
*req
, int *perr
,
145 TALLOC_CTX
*mem_ctx
, int **perr_list
,
146 struct ctdb_reply_control
***preply
);
148 int ctdb_client_control_multi_error(uint32_t *pnn_list
, int count
,
149 int *err_list
, uint32_t *pnn
);
151 int ctdb_client_control(TALLOC_CTX
*mem_ctx
,
152 struct tevent_context
*ev
,
153 struct ctdb_client_context
*client
,
155 struct timeval timeout
,
156 struct ctdb_req_control
*c
,
157 struct ctdb_reply_control
**preply
);
159 int ctdb_client_control_multi(TALLOC_CTX
*mem_ctx
,
160 struct tevent_context
*ev
,
161 struct ctdb_client_context
*client
,
162 uint32_t *pnn_list
, int count
,
163 struct timeval timeout
,
164 struct ctdb_req_control
*request
,
166 struct ctdb_reply_control
***preply
);
168 /* from client/client_control_sync.c */
170 int ctdb_ctrl_process_exists(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
171 struct ctdb_client_context
*client
,
172 int destnode
, struct timeval timeout
,
173 pid_t pid
, int *status
);
175 int ctdb_ctrl_statistics(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
176 struct ctdb_client_context
*client
,
177 int destnode
, struct timeval timeout
,
178 struct ctdb_statistics
**stats
);
180 int ctdb_ctrl_ping(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
181 struct ctdb_client_context
*client
,
182 int destnode
, struct timeval timeout
,
185 int ctdb_ctrl_getdbpath(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
186 struct ctdb_client_context
*client
,
187 int destnode
, struct timeval timeout
,
188 uint32_t db_id
, const char **db_path
);
190 int ctdb_ctrl_getvnnmap(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
191 struct ctdb_client_context
*client
,
192 int destnode
, struct timeval timeout
,
193 struct ctdb_vnn_map
**vnnmap
);
195 int ctdb_ctrl_getdebug(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
196 struct ctdb_client_context
*client
,
197 int destnode
, struct timeval timeout
,
200 int ctdb_ctrl_setdebug(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
201 struct ctdb_client_context
*client
,
202 int destnode
, struct timeval timeout
,
205 int ctdb_ctrl_get_dbmap(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
206 struct ctdb_client_context
*client
,
207 int destnode
, struct timeval timeout
,
208 struct ctdb_dbid_map
**dbmap
);
210 int ctdb_ctrl_pull_db(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
211 struct ctdb_client_context
*client
, int destnode
,
212 struct timeval timeout
, struct ctdb_pulldb
*pulldb
,
213 struct ctdb_rec_buffer
**recbuf
);
215 int ctdb_ctrl_push_db(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
216 struct ctdb_client_context
*client
, int destnode
,
217 struct timeval timeout
, struct ctdb_rec_buffer
*recbuf
);
219 int ctdb_ctrl_get_recmode(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
220 struct ctdb_client_context
*client
,
221 int destnode
, struct timeval timeout
,
224 int ctdb_ctrl_set_recmode(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
225 struct ctdb_client_context
*client
,
226 int destnode
, struct timeval timeout
,
229 int ctdb_ctrl_statistics_reset(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
230 struct ctdb_client_context
*client
,
231 int destnode
, struct timeval timeout
);
233 int ctdb_ctrl_db_attach(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
234 struct ctdb_client_context
*client
,
235 int destnode
, struct timeval timeout
,
236 const char *db_name
, uint32_t tdb_flags
,
239 int ctdb_ctrl_traverse_start(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
240 struct ctdb_client_context
*client
,
241 int destnode
, struct timeval timeout
,
242 struct ctdb_traverse_start
*traverse
);
244 int ctdb_ctrl_register_srvid(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
245 struct ctdb_client_context
*client
,
246 int destnode
, struct timeval timeout
,
249 int ctdb_ctrl_deregister_srvid(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
250 struct ctdb_client_context
*client
,
251 int destnode
, struct timeval timeout
,
254 int ctdb_ctrl_get_dbname(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
255 struct ctdb_client_context
*client
,
256 int destnode
, struct timeval timeout
,
257 uint32_t db_id
, const char **db_name
);
259 int ctdb_ctrl_enable_seqnum(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
260 struct ctdb_client_context
*client
,
261 int destnode
, struct timeval timeout
,
264 int ctdb_ctrl_update_seqnum(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
265 struct ctdb_client_context
*client
,
266 int destnode
, struct timeval timeout
,
269 int ctdb_ctrl_dump_memory(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
270 struct ctdb_client_context
*client
,
271 int destnode
, struct timeval timeout
,
272 const char **mem_str
);
274 int ctdb_ctrl_get_pid(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
275 struct ctdb_client_context
*client
,
276 int destnode
, struct timeval timeout
,
279 int ctdb_ctrl_get_recmaster(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
280 struct ctdb_client_context
*client
,
281 int destnode
, struct timeval timeout
,
282 uint32_t *recmaster
);
284 int ctdb_ctrl_set_recmaster(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
285 struct ctdb_client_context
*client
,
286 int destnode
, struct timeval timeout
,
289 int ctdb_ctrl_freeze(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
290 struct ctdb_client_context
*client
,
291 int destnode
, struct timeval timeout
,
294 int ctdb_ctrl_thaw(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
295 struct ctdb_client_context
*client
,
296 int destnode
, struct timeval timeout
,
299 int ctdb_ctrl_get_pnn(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
300 struct ctdb_client_context
*client
,
301 int destnode
, struct timeval timeout
,
304 int ctdb_ctrl_shutdown(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
305 struct ctdb_client_context
*client
,
306 int destnode
, struct timeval timeout
);
308 int ctdb_ctrl_get_monmode(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
309 struct ctdb_client_context
*client
,
310 int destnode
, struct timeval timeout
,
313 int ctdb_ctrl_tcp_add(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
314 struct ctdb_client_context
*client
,
315 int destnode
, struct timeval timeout
,
316 struct ctdb_connection
*conn
);
318 int ctdb_ctrl_tcp_remove(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
319 struct ctdb_client_context
*client
,
320 int destnode
, struct timeval timeout
,
321 struct ctdb_connection
*conn
);
323 int ctdb_ctrl_set_tunable(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
324 struct ctdb_client_context
*client
,
325 int destnode
, struct timeval timeout
,
326 struct ctdb_tunable
*tunable
);
328 int ctdb_ctrl_get_tunable(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
329 struct ctdb_client_context
*client
,
330 int destnode
, struct timeval timeout
,
331 const char *var
, uint32_t *value
);
333 int ctdb_ctrl_list_tunables(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
334 struct ctdb_client_context
*client
,
335 int destnode
, struct timeval timeout
,
336 struct ctdb_var_list
**var_list
);
338 int ctdb_ctrl_modify_flags(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
339 struct ctdb_client_context
*client
,
340 int destnode
, struct timeval timeout
,
341 uint32_t pnn
, uint32_t old_flags
,
344 int ctdb_ctrl_get_all_tunables(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
345 struct ctdb_client_context
*client
,
346 int destnode
, struct timeval timeout
,
347 struct ctdb_tunable_list
**tun_list
);
349 int ctdb_ctrl_kill_tcp(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
350 struct ctdb_client_context
*client
,
351 int destnode
, struct timeval timeout
,
352 struct ctdb_connection
*conn
);
354 int ctdb_ctrl_get_tcp_tickle_list(TALLOC_CTX
*mem_ctx
,
355 struct tevent_context
*ev
,
356 struct ctdb_client_context
*client
,
357 int destnode
, struct timeval timeout
,
358 ctdb_sock_addr
*addr
,
359 struct ctdb_tickle_list
**tickles
);
361 int ctdb_ctrl_set_tcp_tickle_list(TALLOC_CTX
*mem_ctx
,
362 struct tevent_context
*ev
,
363 struct ctdb_client_context
*client
,
364 int destnode
, struct timeval timeout
,
365 struct ctdb_tickle_list
*tickles
);
367 int ctdb_ctrl_register_server_id(TALLOC_CTX
*mem_ctx
,
368 struct tevent_context
*ev
,
369 struct ctdb_client_context
*client
,
370 int destnode
, struct timeval timeout
,
371 struct ctdb_client_id
*cid
);
373 int ctdb_ctrl_unregister_server_id(TALLOC_CTX
*mem_ctx
,
374 struct tevent_context
*ev
,
375 struct ctdb_client_context
*client
,
376 int destnode
, struct timeval timeout
,
377 struct ctdb_client_id
*cid
);
379 int ctdb_ctrl_check_server_id(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
380 struct ctdb_client_context
*client
,
381 int destnode
, struct timeval timeout
,
382 struct ctdb_client_id
*cid
);
384 int ctdb_ctrl_get_server_id_list(TALLOC_CTX
*mem_ctx
,
385 struct tevent_context
*ev
,
386 struct ctdb_client_context
*client
,
387 int destnode
, struct timeval timeout
,
388 struct ctdb_client_id_map
**cid_map
);
390 int ctdb_ctrl_db_attach_persistent(TALLOC_CTX
*mem_ctx
,
391 struct tevent_context
*ev
,
392 struct ctdb_client_context
*client
,
393 int destnode
, struct timeval timeout
,
394 const char *db_name
, int tdb_flags
,
397 int ctdb_ctrl_send_gratuitous_arp(TALLOC_CTX
*mem_ctx
,
398 struct tevent_context
*ev
,
399 struct ctdb_client_context
*client
,
400 int destnode
, struct timeval timeout
,
401 struct ctdb_addr_info
*addr_info
);
403 int ctdb_ctrl_transaction_start(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
404 struct ctdb_client_context
*client
,
405 int destnode
, struct timeval timeout
,
408 int ctdb_ctrl_transaction_commit(TALLOC_CTX
*mem_ctx
,
409 struct tevent_context
*ev
,
410 struct ctdb_client_context
*client
,
411 int destnode
, struct timeval timeout
,
414 int ctdb_ctrl_wipe_database(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
415 struct ctdb_client_context
*client
,
416 int destnode
, struct timeval timeout
,
417 uint32_t db_id
, uint32_t tid
);
419 int ctdb_ctrl_uptime(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
420 struct ctdb_client_context
*client
,
421 int destnode
, struct timeval timeout
,
422 struct ctdb_uptime
**uptime
);
424 int ctdb_ctrl_start_recovery(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
425 struct ctdb_client_context
*client
,
426 int destnode
, struct timeval timeout
);
428 int ctdb_ctrl_end_recovery(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
429 struct ctdb_client_context
*client
,
430 int destnode
, struct timeval timeout
);
432 int ctdb_ctrl_reload_nodes_file(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
433 struct ctdb_client_context
*client
,
434 int destnode
, struct timeval timeout
);
436 int ctdb_ctrl_enable_monitor(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
437 struct ctdb_client_context
*client
,
438 int destnode
, struct timeval timeout
);
440 int ctdb_ctrl_disable_monitor(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
441 struct ctdb_client_context
*client
,
442 int destnode
, struct timeval timeout
);
444 int ctdb_ctrl_add_public_ip(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
445 struct ctdb_client_context
*client
,
446 int destnode
, struct timeval timeout
,
447 struct ctdb_addr_info
*addr_info
);
449 int ctdb_ctrl_del_public_ip(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
450 struct ctdb_client_context
*client
,
451 int destnode
, struct timeval timeout
,
452 struct ctdb_addr_info
*addr_info
);
454 int ctdb_ctrl_run_eventscripts(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
455 struct ctdb_client_context
*client
,
456 int destnode
, struct timeval timeout
,
459 int ctdb_ctrl_get_capabilities(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
460 struct ctdb_client_context
*client
,
461 int destnode
, struct timeval timeout
,
464 int ctdb_ctrl_release_ip(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
465 struct ctdb_client_context
*client
,
466 int destnode
, struct timeval timeout
,
467 struct ctdb_public_ip
*pubip
);
469 int ctdb_ctrl_takeover_ip(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
470 struct ctdb_client_context
*client
,
471 int destnode
, struct timeval timeout
,
472 struct ctdb_public_ip
*pubip
);
474 int ctdb_ctrl_get_public_ips(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
475 struct ctdb_client_context
*client
,
476 int destnode
, struct timeval timeout
,
477 struct ctdb_public_ip_list
**pubip_list
);
479 int ctdb_ctrl_get_nodemap(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
480 struct ctdb_client_context
*client
,
481 int destnode
, struct timeval timeout
,
482 struct ctdb_node_map
**nodemap
);
484 int ctdb_ctrl_get_event_script_status(TALLOC_CTX
*mem_ctx
,
485 struct tevent_context
*ev
,
486 struct ctdb_client_context
*client
,
487 int destnode
, struct timeval timeout
,
488 enum ctdb_event event
,
489 struct ctdb_script_list
**slist
);
491 int ctdb_ctrl_traverse_kill(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
492 struct ctdb_client_context
*client
,
493 int destnode
, struct timeval timeout
,
494 struct ctdb_traverse_start
*traverse
);
496 int ctdb_ctrl_get_reclock_file(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
497 struct ctdb_client_context
*client
,
498 int destnode
, struct timeval timeout
,
499 const char **reclock_file
);
501 int ctdb_ctrl_set_reclock_file(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
502 struct ctdb_client_context
*client
,
503 int destnode
, struct timeval timeout
,
504 const char *reclock_file
);
506 int ctdb_ctrl_stop_node(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
507 struct ctdb_client_context
*client
,
508 int destnode
, struct timeval timeout
);
510 int ctdb_ctrl_continue_node(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
511 struct ctdb_client_context
*client
,
512 int destnode
, struct timeval timeout
);
514 int ctdb_ctrl_set_natgwstate(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
515 struct ctdb_client_context
*client
,
516 int destnode
, struct timeval timeout
,
517 uint32_t natgw_role
);
519 int ctdb_ctrl_set_lmasterrole(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
520 struct ctdb_client_context
*client
,
521 int destnode
, struct timeval timeout
,
522 uint32_t lmaster_role
);
524 int ctdb_ctrl_set_recmasterrole(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
525 struct ctdb_client_context
*client
,
526 int destnode
, struct timeval timeout
,
527 uint32_t recmaster_role
);
529 int ctdb_ctrl_enable_script(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
530 struct ctdb_client_context
*client
,
531 int destnode
, struct timeval timeout
,
534 int ctdb_ctrl_disable_script(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
535 struct ctdb_client_context
*client
,
536 int destnode
, struct timeval timeout
,
539 int ctdb_ctrl_set_ban_state(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
540 struct ctdb_client_context
*client
,
541 int destnode
, struct timeval timeout
,
542 struct ctdb_ban_state
*ban_state
);
544 int ctdb_ctrl_get_ban_state(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
545 struct ctdb_client_context
*client
,
546 int destnode
, struct timeval timeout
,
547 struct ctdb_ban_state
**ban_state
);
549 int ctdb_ctrl_set_db_priority(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
550 struct ctdb_client_context
*client
,
551 int destnode
, struct timeval timeout
,
552 uint32_t db_id
, int priority
);
554 int ctdb_ctrl_get_db_priority(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
555 struct ctdb_client_context
*client
,
556 int destnode
, struct timeval timeout
,
557 uint32_t db_id
, uint32_t *priority
);
559 int ctdb_ctrl_transaction_cancel(TALLOC_CTX
*mem_ctx
,
560 struct tevent_context
*ev
,
561 struct ctdb_client_context
*client
,
562 int destnode
, struct timeval timeout
,
565 int ctdb_ctrl_register_notify(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
566 struct ctdb_client_context
*client
,
567 int destnode
, struct timeval timeout
,
568 struct ctdb_notify_data
*notify
);
570 int ctdb_ctrl_deregister_notify(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
571 struct ctdb_client_context
*client
,
572 int destnode
, struct timeval timeout
,
575 int ctdb_ctrl_trans3_commit(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
576 struct ctdb_client_context
*client
,
577 int destnode
, struct timeval timeout
,
578 struct ctdb_rec_buffer
*recbuf
);
580 int ctdb_ctrl_get_db_seqnum(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
581 struct ctdb_client_context
*client
,
582 int destnode
, struct timeval timeout
,
583 uint32_t db_id
, uint64_t *seqnum
);
585 int ctdb_ctrl_db_set_healthy(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
586 struct ctdb_client_context
*client
,
587 int destnode
, struct timeval timeout
,
590 int ctdb_ctrl_db_get_health(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
591 struct ctdb_client_context
*client
,
592 int destnode
, struct timeval timeout
,
593 uint32_t db_id
, const char **reason
);
595 int ctdb_ctrl_get_public_ip_info(TALLOC_CTX
*mem_ctx
,
596 struct tevent_context
*ev
,
597 struct ctdb_client_context
*client
,
598 int destnode
, struct timeval timeout
,
599 ctdb_sock_addr
*addr
,
600 struct ctdb_public_ip_info
**ipinfo
);
602 int ctdb_ctrl_get_ifaces(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
603 struct ctdb_client_context
*client
,
604 int destnode
, struct timeval timeout
,
605 struct ctdb_iface_list
**iface_list
);
607 int ctdb_ctrl_set_iface_link_state(TALLOC_CTX
*mem_ctx
,
608 struct tevent_context
*ev
,
609 struct ctdb_client_context
*client
,
610 int destnode
, struct timeval timeout
,
611 struct ctdb_iface
*iface
);
613 int ctdb_ctrl_tcp_add_delayed_update(TALLOC_CTX
*mem_ctx
,
614 struct tevent_context
*ev
,
615 struct ctdb_client_context
*client
,
616 int destnode
, struct timeval timeout
,
617 struct ctdb_connection
*conn
);
619 int ctdb_ctrl_get_stat_history(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
620 struct ctdb_client_context
*client
,
621 int destnode
, struct timeval timeout
,
622 struct ctdb_statistics_list
**stats_list
);
624 int ctdb_ctrl_schedule_for_deletion(TALLOC_CTX
*mem_ctx
,
625 struct tevent_context
*ev
,
626 struct ctdb_client_context
*client
,
627 int destnode
, struct timeval timeout
,
628 struct ctdb_key_data
*key
);
630 int ctdb_ctrl_set_db_readonly(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
631 struct ctdb_client_context
*client
,
632 int destnode
, struct timeval timeout
,
635 int ctdb_ctrl_check_srvids(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
636 struct ctdb_client_context
*client
,
637 int destnode
, struct timeval timeout
,
638 uint64_t *srvid
, int count
, uint8_t **result
);
640 int ctdb_ctrl_traverse_start_ext(TALLOC_CTX
*mem_ctx
,
641 struct tevent_context
*ev
,
642 struct ctdb_client_context
*client
,
643 int destnode
, struct timeval timeout
,
644 struct ctdb_traverse_start_ext
*traverse
);
646 int ctdb_ctrl_get_db_statistics(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
647 struct ctdb_client_context
*client
,
648 int destnode
, struct timeval timeout
,
650 struct ctdb_db_statistics
**dbstats
);
652 int ctdb_ctrl_set_db_sticky(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
653 struct ctdb_client_context
*client
,
654 int destnode
, struct timeval timeout
,
657 int ctdb_ctrl_reload_public_ips(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
658 struct ctdb_client_context
*client
,
659 int destnode
, struct timeval timeout
);
661 int ctdb_ctrl_ipreallocated(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
662 struct ctdb_client_context
*client
,
663 int destnode
, struct timeval timeout
);
665 int ctdb_ctrl_get_runstate(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
666 struct ctdb_client_context
*client
,
667 int destnode
, struct timeval timeout
,
668 enum ctdb_runstate
*runstate
);
670 int ctdb_ctrl_db_detach(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
671 struct ctdb_client_context
*client
,
672 int destnode
, struct timeval timeout
,
675 int ctdb_ctrl_get_nodes_file(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
676 struct ctdb_client_context
*client
,
677 int destnode
, struct timeval timeout
,
678 struct ctdb_node_map
**nodemap
);
680 int ctdb_ctrl_db_freeze(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
681 struct ctdb_client_context
*client
,
682 int destnode
, struct timeval timeout
, uint32_t db_id
);
684 int ctdb_ctrl_db_thaw(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
685 struct ctdb_client_context
*client
,
686 int destnode
, struct timeval timeout
, uint32_t db_id
);
688 int ctdb_ctrl_db_transaction_start(TALLOC_CTX
*mem_ctx
,
689 struct tevent_context
*ev
,
690 struct ctdb_client_context
*client
,
691 int destnode
, struct timeval timeout
,
692 struct ctdb_transdb
*transdb
);
694 int ctdb_ctrl_db_transaction_commit(TALLOC_CTX
*mem_ctx
,
695 struct tevent_context
*ev
,
696 struct ctdb_client_context
*client
,
697 int destnode
, struct timeval timeout
,
698 struct ctdb_transdb
*transdb
);
700 int ctdb_ctrl_db_transaction_cancel(TALLOC_CTX
*mem_ctx
,
701 struct tevent_context
*ev
,
702 struct ctdb_client_context
*client
,
703 int destnode
, struct timeval timeout
,
706 /* from client/client_db.c */
708 struct tevent_req
*ctdb_attach_send(TALLOC_CTX
*mem_ctx
,
709 struct tevent_context
*ev
,
710 struct ctdb_client_context
*client
,
711 struct timeval timeout
,
712 const char *db_name
, uint8_t db_flags
);
714 bool ctdb_attach_recv(struct tevent_req
*req
, int *perr
,
715 struct ctdb_db_context
**out
);
717 int ctdb_attach(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
718 struct ctdb_client_context
*client
,
719 struct timeval timeout
,
720 const char *db_name
, uint8_t db_flags
,
721 struct ctdb_db_context
**out
);
723 int ctdb_detach(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
724 struct ctdb_client_context
*client
,
725 struct timeval timeout
, uint32_t db_id
);
727 uint32_t ctdb_db_id(struct ctdb_db_context
*db
);
729 int ctdb_db_traverse(struct ctdb_db_context
*db
, bool readonly
,
731 ctdb_rec_parser_func_t parser
, void *private_data
);
733 struct tevent_req
*ctdb_fetch_lock_send(TALLOC_CTX
*mem_ctx
,
734 struct tevent_context
*ev
,
735 struct ctdb_client_context
*client
,
736 struct ctdb_db_context
*db
,
737 TDB_DATA key
, bool readonly
);
739 struct ctdb_record_handle
*ctdb_fetch_lock_recv(struct tevent_req
*req
,
740 struct ctdb_ltdb_header
*header
,
742 TDB_DATA
*data
, int *perr
);
744 int ctdb_fetch_lock(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
745 struct ctdb_client_context
*client
,
746 struct ctdb_db_context
*db
, TDB_DATA key
, bool readonly
,
747 struct ctdb_record_handle
**out
,
748 struct ctdb_ltdb_header
*header
, TDB_DATA
*data
);
750 int ctdb_store_record(struct ctdb_record_handle
*h
, TDB_DATA data
);
752 int ctdb_delete_record(struct ctdb_record_handle
*h
);
754 struct tevent_req
*ctdb_g_lock_lock_send(TALLOC_CTX
*mem_ctx
,
755 struct tevent_context
*ev
,
756 struct ctdb_client_context
*client
,
757 struct ctdb_db_context
*db
,
759 struct ctdb_server_id
*sid
,
762 bool ctdb_g_lock_lock_recv(struct tevent_req
*req
, int *perr
);
764 struct tevent_req
*ctdb_g_lock_unlock_send(TALLOC_CTX
*mem_ctx
,
765 struct tevent_context
*ev
,
766 struct ctdb_client_context
*client
,
767 struct ctdb_db_context
*db
,
769 struct ctdb_server_id sid
);
771 bool ctdb_g_lock_unlock_recv(struct tevent_req
*req
, int *perr
);
773 struct tevent_req
*ctdb_transaction_start_send(TALLOC_CTX
*mem_ctx
,
774 struct tevent_context
*ev
,
775 struct ctdb_client_context
*client
,
776 struct timeval timeout
,
777 struct ctdb_db_context
*db
,
780 struct ctdb_transaction_handle
*ctdb_transaction_start_recv(
781 struct tevent_req
*req
,
784 int ctdb_transaction_start(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
785 struct ctdb_client_context
*client
,
786 struct timeval timeout
,
787 struct ctdb_db_context
*db
, bool readonly
,
788 struct ctdb_transaction_handle
**out
);
790 int ctdb_transaction_fetch_record(struct ctdb_transaction_handle
*h
,
792 TALLOC_CTX
*mem_ctx
, TDB_DATA
*data
);
794 int ctdb_transaction_store_record(struct ctdb_transaction_handle
*h
,
795 TDB_DATA key
, TDB_DATA data
);
797 int ctdb_transaction_delete_record(struct ctdb_transaction_handle
*h
,
800 struct tevent_req
*ctdb_transaction_commit_send(
802 struct tevent_context
*ev
,
803 struct ctdb_transaction_handle
*h
);
805 bool ctdb_transaction_commit_recv(struct tevent_req
*req
, int *perr
);
807 int ctdb_transaction_commit(struct ctdb_transaction_handle
*h
);
809 int ctdb_transaction_cancel(struct ctdb_transaction_handle
*h
);
811 /* from client/client_util.c */
813 int list_of_nodes(struct ctdb_node_map
*nodemap
,
814 uint32_t flags_mask
, uint32_t exclude_pnn
,
815 TALLOC_CTX
*mem_ctx
, uint32_t **pnn_list
);
817 int list_of_active_nodes(struct ctdb_node_map
*nodemap
, uint32_t exclude_pnn
,
818 TALLOC_CTX
*mem_ctx
, uint32_t **pnn_list
);
820 int list_of_connected_nodes(struct ctdb_node_map
*nodemap
,
821 uint32_t exclude_pnn
,
822 TALLOC_CTX
*mem_ctx
, uint32_t **pnn_list
);
824 int ctdb_ctrl_modflags(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
825 struct ctdb_client_context
*client
,
826 uint32_t destnode
, struct timeval timeout
,
827 uint32_t set
, uint32_t clear
);
829 bool ctdb_server_id_equal(struct ctdb_server_id
*sid1
,
830 struct ctdb_server_id
*sid2
);
832 int ctdb_server_id_exists(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev
,
833 struct ctdb_client_context
*client
,
834 struct ctdb_server_id
*sid
, bool *exists
);
836 #endif /* __CTDB_CLIENT_H__ */