2 CTDB protocol marshalling
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_PROTOCOL_API_H__
21 #define __CTDB_PROTOCOL_API_H__
23 #include "protocol/protocol.h"
25 /* From protocol/protocol_types.c */
27 size_t ctdb_ltdb_header_len(struct ctdb_ltdb_header
*header
);
28 void ctdb_ltdb_header_push(struct ctdb_ltdb_header
*header
, uint8_t *buf
);
29 int ctdb_ltdb_header_pull(uint8_t *buf
, size_t buflen
,
30 struct ctdb_ltdb_header
*header
);
32 size_t ctdb_rec_data_len(struct ctdb_rec_data
*rec
);
33 void ctdb_rec_data_push(struct ctdb_rec_data
*rec
, uint8_t *buf
);
34 int ctdb_rec_data_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
35 struct ctdb_rec_data
**out
);
37 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer
*recbuf
);
38 void ctdb_rec_buffer_push(struct ctdb_rec_buffer
*recbuf
, uint8_t *buf
);
39 int ctdb_rec_buffer_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
40 struct ctdb_rec_buffer
**out
);
42 struct ctdb_rec_buffer
*ctdb_rec_buffer_init(TALLOC_CTX
*mem_ctx
,
44 int ctdb_rec_buffer_add(TALLOC_CTX
*mem_ctx
, struct ctdb_rec_buffer
*recbuf
,
45 uint32_t reqid
, struct ctdb_ltdb_header
*header
,
46 TDB_DATA key
, TDB_DATA data
);
47 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer
*recbuf
,
48 ctdb_rec_parser_func_t func
,
51 size_t ctdb_server_id_len(struct ctdb_server_id
*sid
);
52 void ctdb_server_id_push(struct ctdb_server_id
*sid
, uint8_t *buf
);
53 int ctdb_server_id_pull(uint8_t *buf
, size_t buflen
,
54 struct ctdb_server_id
*sid
);
56 size_t ctdb_g_lock_len(struct ctdb_g_lock
*lock
);
57 void ctdb_g_lock_push(struct ctdb_g_lock
*lock
, uint8_t *buf
);
58 int ctdb_g_lock_pull(uint8_t *buf
, size_t buflen
, struct ctdb_g_lock
*lock
);
60 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list
*lock_list
);
61 void ctdb_g_lock_list_push(struct ctdb_g_lock_list
*lock_list
, uint8_t *buf
);
62 int ctdb_g_lock_list_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
63 struct ctdb_g_lock_list
**out
);
65 /* From protocol/protocol_header.c */
67 void ctdb_req_header_fill(struct ctdb_req_header
*h
, uint32_t generation
,
68 uint32_t operation
, uint32_t destnode
,
69 uint32_t srcnode
, uint32_t reqid
);
71 int ctdb_req_header_pull(uint8_t *pkt
, size_t pkt_len
,
72 struct ctdb_req_header
*h
);
74 int ctdb_req_header_verify(struct ctdb_req_header
*h
, uint32_t operation
);
76 /* From protocol/protocol_call.c */
78 int ctdb_req_call_push(struct ctdb_req_header
*h
,
79 struct ctdb_req_call
*c
,
81 uint8_t **pkt
, size_t *pkt_len
);
83 int ctdb_req_call_pull(uint8_t *pkt
, size_t pkt_len
,
84 struct ctdb_req_header
*h
,
86 struct ctdb_req_call
*c
);
88 int ctdb_reply_call_push(struct ctdb_req_header
*h
,
89 struct ctdb_reply_call
*c
,
91 uint8_t **pkt
, size_t *pkt_len
);
93 int ctdb_reply_call_pull(uint8_t *pkt
, size_t pkt_len
,
94 struct ctdb_req_header
*h
,
96 struct ctdb_reply_call
*c
);
98 int ctdb_reply_error_push(struct ctdb_req_header
*h
,
99 struct ctdb_reply_error
*c
,
101 uint8_t **pkt
, size_t *pkt_len
);
103 int ctdb_reply_error_pull(uint8_t *pkt
, size_t pkt_len
,
104 struct ctdb_req_header
*h
,
106 struct ctdb_reply_error
*c
);
108 int ctdb_req_dmaster_push(struct ctdb_req_header
*h
,
109 struct ctdb_req_dmaster
*c
,
111 uint8_t **pkt
, size_t *pkt_len
);
113 int ctdb_req_dmaster_pull(uint8_t *pkt
, size_t pkt_len
,
114 struct ctdb_req_header
*h
,
116 struct ctdb_req_dmaster
*c
);
118 int ctdb_reply_dmaster_push(struct ctdb_req_header
*h
,
119 struct ctdb_reply_dmaster
*c
,
121 uint8_t **pkt
, size_t *pkt_len
);
123 int ctdb_reply_dmaster_pull(uint8_t *pkt
, size_t pkt_len
,
124 struct ctdb_req_header
*h
,
126 struct ctdb_reply_dmaster
*c
);
128 /* From protocol/protocol_control.c */
130 int ctdb_req_control_push(struct ctdb_req_header
*h
,
131 struct ctdb_req_control
*c
,
133 uint8_t **pkt
, size_t *pkt_len
);
135 int ctdb_req_control_pull(uint8_t *pkt
, size_t pkt_len
,
136 struct ctdb_req_header
*h
,
138 struct ctdb_req_control
*c
);
140 int ctdb_reply_control_push(struct ctdb_req_header
*h
,
141 struct ctdb_reply_control
*c
,
143 uint8_t **pkt
, size_t *pkt_len
);
145 int ctdb_reply_control_pull(uint8_t *pkt
, size_t pkt_len
, uint32_t opcode
,
146 struct ctdb_req_header
*h
,
148 struct ctdb_reply_control
*c
);
150 /* From protocol/protocol_client.c */
152 void ctdb_req_control_process_exists(struct ctdb_req_control
*request
,
154 int ctdb_reply_control_process_exists(struct ctdb_reply_control
*reply
,
157 void ctdb_req_control_statistics(struct ctdb_req_control
*request
);
159 int ctdb_reply_control_statistics(struct ctdb_reply_control
*reply
,
161 struct ctdb_statistics
**stats
);
163 void ctdb_req_control_ping(struct ctdb_req_control
*request
);
164 int ctdb_reply_control_ping(struct ctdb_reply_control
*reply
,
167 void ctdb_req_control_getdbpath(struct ctdb_req_control
*request
,
169 int ctdb_reply_control_getdbpath(struct ctdb_reply_control
*reply
,
170 TALLOC_CTX
*mem_ctx
, const char **db_path
);
172 void ctdb_req_control_getvnnmap(struct ctdb_req_control
*request
);
173 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control
*reply
,
175 struct ctdb_vnn_map
**vnnmap
);
177 void ctdb_req_control_setvnnmap(struct ctdb_req_control
*request
,
178 struct ctdb_vnn_map
*vnnmap
);
179 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control
*reply
);
181 void ctdb_req_control_get_debug(struct ctdb_req_control
*request
);
182 int ctdb_reply_control_get_debug(struct ctdb_reply_control
*reply
,
183 uint32_t *debug_level
);
185 void ctdb_req_control_set_debug(struct ctdb_req_control
*request
,
186 uint32_t debug_level
);
187 int ctdb_reply_control_set_debug(struct ctdb_reply_control
*reply
);
189 void ctdb_req_control_get_dbmap(struct ctdb_req_control
*request
);
190 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control
*reply
,
192 struct ctdb_dbid_map
**dbmap
);
194 void ctdb_req_control_pull_db(struct ctdb_req_control
*request
,
195 struct ctdb_pulldb
*pulldb
);
196 int ctdb_reply_control_pull_db(struct ctdb_reply_control
*reply
,
198 struct ctdb_rec_buffer
**recbuf
);
200 void ctdb_req_control_push_db(struct ctdb_req_control
*request
,
201 struct ctdb_rec_buffer
*recbuf
);
202 int ctdb_reply_control_push_db(struct ctdb_reply_control
*reply
);
204 void ctdb_req_control_get_recmode(struct ctdb_req_control
*request
);
205 int ctdb_reply_control_get_recmode(struct ctdb_reply_control
*reply
,
208 void ctdb_req_control_set_recmode(struct ctdb_req_control
*request
,
210 int ctdb_reply_control_set_recmode(struct ctdb_reply_control
*reply
);
212 void ctdb_req_control_statistics_reset(struct ctdb_req_control
*request
);
213 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control
*reply
);
215 void ctdb_req_control_db_attach(struct ctdb_req_control
*request
,
216 const char *db_name
, uint32_t tdb_flags
);
217 int ctdb_reply_control_db_attach(struct ctdb_reply_control
*reply
,
220 void ctdb_req_control_traverse_start(struct ctdb_req_control
*request
,
221 struct ctdb_traverse_start
*traverse
);
222 int ctdb_reply_control_traverse_start(struct ctdb_reply_control
*reply
);
224 void ctdb_req_control_register_srvid(struct ctdb_req_control
*request
,
226 int ctdb_reply_control_register_srvid(struct ctdb_reply_control
*reply
);
228 void ctdb_req_control_deregister_srvid(struct ctdb_req_control
*request
,
230 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control
*reply
);
232 void ctdb_req_control_get_dbname(struct ctdb_req_control
*request
,
234 int ctdb_reply_control_get_dbname(struct ctdb_reply_control
*reply
,
235 TALLOC_CTX
*mem_ctx
, const char **db_name
);
237 void ctdb_req_control_enable_seqnum(struct ctdb_req_control
*request
,
239 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control
*reply
);
241 void ctdb_req_control_update_seqnum(struct ctdb_req_control
*request
,
243 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control
*reply
);
245 void ctdb_req_control_dump_memory(struct ctdb_req_control
*request
);
246 int ctdb_reply_control_dump_memory(struct ctdb_reply_control
*reply
,
247 TALLOC_CTX
*mem_ctx
, const char **mem_str
);
249 void ctdb_req_control_get_pid(struct ctdb_req_control
*request
);
250 int ctdb_reply_control_get_pid(struct ctdb_reply_control
*reply
,
253 void ctdb_req_control_get_recmaster(struct ctdb_req_control
*request
);
254 int ctdb_reply_control_get_recmaster(struct ctdb_reply_control
*reply
,
255 uint32_t *recmaster
);
257 void ctdb_req_control_set_recmaster(struct ctdb_req_control
*request
,
259 int ctdb_reply_control_set_recmaster(struct ctdb_reply_control
*reply
);
261 void ctdb_req_control_freeze(struct ctdb_req_control
*request
,
263 int ctdb_reply_control_freeze(struct ctdb_reply_control
*reply
);
265 void ctdb_req_control_thaw(struct ctdb_req_control
*request
,
267 int ctdb_reply_control_thaw(struct ctdb_reply_control
*reply
);
269 void ctdb_req_control_get_pnn(struct ctdb_req_control
*request
);
270 int ctdb_reply_control_get_pnn(struct ctdb_reply_control
*reply
,
273 void ctdb_req_control_shutdown(struct ctdb_req_control
*request
);
274 int ctdb_reply_control_shutdown(struct ctdb_reply_control
*reply
);
276 void ctdb_req_control_get_monmode(struct ctdb_req_control
*request
);
277 int ctdb_reply_control_get_monmode(struct ctdb_reply_control
*reply
,
280 void ctdb_req_control_tcp_client(struct ctdb_req_control
*request
,
281 struct ctdb_connection
*conn
);
282 int ctdb_reply_control_tcp_client(struct ctdb_reply_control
*reply
);
284 void ctdb_req_control_tcp_add(struct ctdb_req_control
*request
,
285 struct ctdb_connection
*conn
);
286 int ctdb_reply_control_tcp_add(struct ctdb_reply_control
*reply
);
288 void ctdb_req_control_tcp_remove(struct ctdb_req_control
*request
,
289 struct ctdb_connection
*conn
);
290 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control
*reply
);
292 void ctdb_req_control_startup(struct ctdb_req_control
*request
);
293 int ctdb_reply_control_startup(struct ctdb_reply_control
*reply
);
295 void ctdb_req_control_set_tunable(struct ctdb_req_control
*request
,
296 struct ctdb_tunable
*tunable
);
297 int ctdb_reply_control_set_tunable(struct ctdb_reply_control
*reply
);
299 void ctdb_req_control_get_tunable(struct ctdb_req_control
*request
,
301 int ctdb_reply_control_get_tunable(struct ctdb_reply_control
*reply
,
304 void ctdb_req_control_list_tunables(struct ctdb_req_control
*request
);
305 int ctdb_reply_control_list_tunables(struct ctdb_reply_control
*reply
,
307 struct ctdb_var_list
**tun_var_list
);
309 void ctdb_req_control_modify_flags(struct ctdb_req_control
*request
,
310 struct ctdb_node_flag_change
*flag_change
);
311 int ctdb_reply_control_modify_flags(struct ctdb_reply_control
*reply
);
313 void ctdb_req_control_get_all_tunables(struct ctdb_req_control
*request
);
314 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control
*reply
,
316 struct ctdb_tunable_list
**tun_list
);
318 void ctdb_req_control_kill_tcp(struct ctdb_req_control
*request
,
319 struct ctdb_connection
*conn
);
320 int ctdb_reply_control_kill_tcp(struct ctdb_reply_control
*reply
);
322 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control
*request
,
323 ctdb_sock_addr
*addr
);
324 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control
*reply
,
326 struct ctdb_tickle_list
**tickles
);
328 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control
*request
,
329 struct ctdb_tickle_list
*tickles
);
330 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control
*reply
);
332 void ctdb_req_control_register_server_id(struct ctdb_req_control
*request
,
333 struct ctdb_client_id
*sid
);
334 int ctdb_reply_control_register_server_id(struct ctdb_reply_control
*reply
);
336 void ctdb_req_control_unregister_server_id(struct ctdb_req_control
*request
,
337 struct ctdb_client_id
*sid
);
338 int ctdb_reply_control_unregister_server_id(struct ctdb_reply_control
*reply
);
340 void ctdb_req_control_check_server_id(struct ctdb_req_control
*request
,
341 struct ctdb_client_id
*sid
);
342 int ctdb_reply_control_check_server_id(struct ctdb_reply_control
*reply
);
344 void ctdb_req_control_get_server_id_list(struct ctdb_req_control
*request
);
345 int ctdb_reply_control_get_server_id_list(struct ctdb_reply_control
*reply
,
347 struct ctdb_client_id_map
**cid_map
);
349 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control
*request
,
352 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control
*reply
,
355 void ctdb_req_control_update_record(struct ctdb_req_control
*request
,
356 struct ctdb_rec_buffer
*recbuf
);
357 int ctdb_reply_control_update_record(struct ctdb_reply_control
*reply
);
359 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control
*request
,
360 struct ctdb_addr_info
*addr_info
);
361 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control
*reply
);
363 void ctdb_req_control_transaction_start(struct ctdb_req_control
*request
,
365 int ctdb_reply_control_transaction_start(struct ctdb_reply_control
*reply
);
367 void ctdb_req_control_transaction_commit(struct ctdb_req_control
*request
,
369 int ctdb_reply_control_transaction_commit(struct ctdb_reply_control
*reply
);
371 void ctdb_req_control_wipe_database(struct ctdb_req_control
*request
,
372 struct ctdb_transdb
*transdb
);
373 int ctdb_reply_control_wipe_database(struct ctdb_reply_control
*reply
);
375 void ctdb_req_control_uptime(struct ctdb_req_control
*request
);
376 int ctdb_reply_control_uptime(struct ctdb_reply_control
*reply
,
378 struct ctdb_uptime
**uptime
);
380 void ctdb_req_control_start_recovery(struct ctdb_req_control
*request
);
381 int ctdb_reply_control_start_recovery(struct ctdb_reply_control
*reply
);
383 void ctdb_req_control_end_recovery(struct ctdb_req_control
*request
);
384 int ctdb_reply_control_end_recovery(struct ctdb_reply_control
*reply
);
386 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control
*request
);
387 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control
*reply
);
389 void ctdb_req_control_try_delete_records(struct ctdb_req_control
*request
,
390 struct ctdb_rec_buffer
*recbuf
);
391 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control
*reply
,
393 struct ctdb_rec_buffer
**recbuf
);
395 void ctdb_req_control_enable_monitor(struct ctdb_req_control
*request
);
396 int ctdb_reply_control_enable_monitor(struct ctdb_reply_control
*reply
);
398 void ctdb_req_control_disable_monitor(struct ctdb_req_control
*request
);
399 int ctdb_reply_control_disable_monitor(struct ctdb_reply_control
*reply
);
401 void ctdb_req_control_add_public_ip(struct ctdb_req_control
*request
,
402 struct ctdb_addr_info
*addr_info
);
403 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control
*reply
);
405 void ctdb_req_control_del_public_ip(struct ctdb_req_control
*request
,
406 struct ctdb_addr_info
*addr_info
);
407 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control
*reply
);
409 void ctdb_req_control_run_eventscripts(struct ctdb_req_control
*request
,
410 const char *event_str
);
411 int ctdb_reply_control_run_eventscripts(struct ctdb_reply_control
*reply
);
413 void ctdb_req_control_get_capabilities(struct ctdb_req_control
*request
);
414 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control
*reply
,
417 void ctdb_req_control_recd_ping(struct ctdb_req_control
*request
);
418 int ctdb_reply_control_recd_ping(struct ctdb_reply_control
*reply
);
420 void ctdb_req_control_release_ip(struct ctdb_req_control
*request
,
421 struct ctdb_public_ip
*pubip
);
422 int ctdb_reply_control_release_ip(struct ctdb_reply_control
*reply
);
424 void ctdb_req_control_takeover_ip(struct ctdb_req_control
*request
,
425 struct ctdb_public_ip
*pubip
);
426 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control
*reply
);
428 void ctdb_req_control_get_public_ips(struct ctdb_req_control
*request
);
429 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control
*reply
,
431 struct ctdb_public_ip_list
**pubip_list
);
433 void ctdb_req_control_get_nodemap(struct ctdb_req_control
*request
);
434 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control
*reply
,
436 struct ctdb_node_map
**nodemap
);
438 void ctdb_req_control_get_event_script_status(struct ctdb_req_control
*request
,
440 int ctdb_reply_control_get_event_script_status(struct ctdb_reply_control
*reply
,
442 struct ctdb_script_list
**script_list
);
444 void ctdb_req_control_traverse_kill(struct ctdb_req_control
*request
,
445 struct ctdb_traverse_start
*traverse
);
446 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control
*reply
);
448 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control
*request
,
449 double reclock_latency
);
450 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control
*reply
);
452 void ctdb_req_control_get_reclock_file(struct ctdb_req_control
*request
);
453 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control
*reply
,
455 const char **reclock_file
);
457 void ctdb_req_control_set_reclock_file(struct ctdb_req_control
*request
,
458 const char *reclock_file
);
459 int ctdb_reply_control_set_reclock_file(struct ctdb_reply_control
*reply
);
461 void ctdb_req_control_stop_node(struct ctdb_req_control
*request
);
462 int ctdb_reply_control_stop_node(struct ctdb_reply_control
*reply
);
464 void ctdb_req_control_continue_node(struct ctdb_req_control
*request
);
465 int ctdb_reply_control_continue_node(struct ctdb_reply_control
*reply
);
467 void ctdb_req_control_set_natgwstate(struct ctdb_req_control
*request
,
468 uint32_t natgw_role
);
469 int ctdb_reply_control_set_natgwstate(struct ctdb_reply_control
*reply
);
471 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control
*request
,
472 uint32_t lmaster_role
);
473 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control
*reply
);
475 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control
*request
,
476 uint32_t recmaster_role
);
477 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control
*reply
);
479 void ctdb_req_control_enable_script(struct ctdb_req_control
*request
,
481 int ctdb_reply_control_enable_script(struct ctdb_reply_control
*reply
);
483 void ctdb_req_control_disable_script(struct ctdb_req_control
*request
,
485 int ctdb_reply_control_disable_script(struct ctdb_reply_control
*reply
);
487 void ctdb_req_control_set_ban_state(struct ctdb_req_control
*request
,
488 struct ctdb_ban_state
*ban_state
);
489 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control
*reply
);
491 void ctdb_req_control_get_ban_state(struct ctdb_req_control
*request
);
492 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control
*reply
,
494 struct ctdb_ban_state
**ban_state
);
496 void ctdb_req_control_set_db_priority(struct ctdb_req_control
*request
,
497 struct ctdb_db_priority
*db_prio
);
498 int ctdb_reply_control_set_db_priority(struct ctdb_reply_control
*reply
);
500 void ctdb_req_control_get_db_priority(struct ctdb_req_control
*request
,
502 int ctdb_reply_control_get_db_priority(struct ctdb_reply_control
*reply
,
505 void ctdb_req_control_transaction_cancel(struct ctdb_req_control
*request
,
507 int ctdb_reply_control_transaction_cancel(struct ctdb_reply_control
*reply
);
509 void ctdb_req_control_register_notify(struct ctdb_req_control
*request
,
510 struct ctdb_notify_data
*notify
);
511 int ctdb_reply_control_register_notify(struct ctdb_reply_control
*reply
);
513 void ctdb_req_control_deregister_notify(struct ctdb_req_control
*request
,
515 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control
*reply
);
517 void ctdb_req_control_trans3_commit(struct ctdb_req_control
*request
,
518 struct ctdb_rec_buffer
*recbuf
);
519 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control
*reply
);
521 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control
*request
,
523 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control
*reply
,
526 void ctdb_req_control_db_set_healthy(struct ctdb_req_control
*request
,
528 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control
*reply
);
530 void ctdb_req_control_db_get_health(struct ctdb_req_control
*request
,
532 int ctdb_reply_control_db_get_health(struct ctdb_reply_control
*reply
,
534 const char **reason
);
536 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control
*request
,
537 ctdb_sock_addr
*addr
);
538 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control
*reply
,
540 struct ctdb_public_ip_info
**ipinfo
);
542 void ctdb_req_control_get_ifaces(struct ctdb_req_control
*request
);
543 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control
*reply
,
545 struct ctdb_iface_list
**iface_list
);
547 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control
*request
,
548 struct ctdb_iface
*iface
);
549 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control
*reply
);
551 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control
*request
,
552 struct ctdb_connection
*conn
);
553 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control
*reply
);
555 void ctdb_req_control_get_stat_history(struct ctdb_req_control
*request
);
556 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control
*reply
,
558 struct ctdb_statistics_list
**stats_list
);
560 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control
*request
,
561 struct ctdb_key_data
*key
);
562 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control
*reply
);
564 void ctdb_req_control_set_db_readonly(struct ctdb_req_control
*request
,
566 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control
*reply
);
568 void ctdb_req_control_check_srvids(struct ctdb_req_control
*request
,
569 struct ctdb_uint64_array
*u64_array
);
570 int ctdb_reply_control_check_srvids(struct ctdb_reply_control
*reply
,
572 struct ctdb_uint8_array
**u8_array
);
574 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control
*request
,
575 struct ctdb_traverse_start_ext
*traverse
);
576 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control
*reply
);
578 void ctdb_req_control_get_db_statistics(struct ctdb_req_control
*request
,
580 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control
*reply
,
582 struct ctdb_db_statistics
**dbstats
);
584 void ctdb_req_control_set_db_sticky(struct ctdb_req_control
*request
,
586 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control
*reply
);
588 void ctdb_req_control_reload_public_ips(struct ctdb_req_control
*request
);
589 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control
*reply
);
591 void ctdb_req_control_receive_records(struct ctdb_req_control
*request
,
592 struct ctdb_rec_buffer
*recbuf
);
593 int ctdb_reply_control_receive_records(struct ctdb_reply_control
*reply
,
595 struct ctdb_rec_buffer
**recbuf
);
597 void ctdb_req_control_ipreallocated(struct ctdb_req_control
*request
);
598 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control
*reply
);
600 void ctdb_req_control_get_runstate(struct ctdb_req_control
*request
);
601 int ctdb_reply_control_get_runstate(struct ctdb_reply_control
*reply
,
602 enum ctdb_runstate
*runstate
);
604 void ctdb_req_control_db_detach(struct ctdb_req_control
*request
,
606 int ctdb_reply_control_db_detach(struct ctdb_reply_control
*reply
);
608 void ctdb_req_control_get_nodes_file(struct ctdb_req_control
*request
);
609 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control
*reply
,
611 struct ctdb_node_map
**nodemap
);
613 void ctdb_req_control_db_freeze(struct ctdb_req_control
*request
,
615 int ctdb_reply_control_db_freeze(struct ctdb_reply_control
*reply
);
617 void ctdb_req_control_db_thaw(struct ctdb_req_control
*request
,
619 int ctdb_reply_control_db_thaw(struct ctdb_reply_control
*reply
);
621 void ctdb_req_control_db_transaction_start(struct ctdb_req_control
*request
,
622 struct ctdb_transdb
*transdb
);
623 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control
*reply
);
625 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control
*request
,
626 struct ctdb_transdb
*transdb
);
627 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control
*reply
);
629 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control
*request
,
631 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control
*reply
);
633 /* From protocol/protocol_message.c */
635 int ctdb_req_message_push(struct ctdb_req_header
*h
,
636 struct ctdb_req_message
*c
,
638 uint8_t **pkt
, size_t *pkt_len
);
640 int ctdb_req_message_pull(uint8_t *pkt
, size_t pkt_len
,
641 struct ctdb_req_header
*h
,
643 struct ctdb_req_message
*c
);
645 int ctdb_req_message_data_push(struct ctdb_req_header
*h
,
646 struct ctdb_req_message_data
*message
,
648 uint8_t **pkt
, size_t *pkt_len
);
650 int ctdb_req_message_data_pull(uint8_t *pkt
, size_t pkt_len
,
651 struct ctdb_req_header
*h
,
653 struct ctdb_req_message_data
*message
);
655 /* From protocol/protocol_util.c */
657 const char *ctdb_runstate_to_string(enum ctdb_runstate runstate
);
658 enum ctdb_runstate
ctdb_runstate_from_string(const char *runstate_str
);
660 const char *ctdb_event_to_string(enum ctdb_event event
);
661 enum ctdb_event
ctdb_event_from_string(const char *event_str
);
663 #endif /* __CTDB_PROTOCOL_API_H__ */