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__
25 #include "protocol/protocol.h"
27 /* From protocol/protocol_types.c */
29 size_t ctdb_ltdb_header_len(struct ctdb_ltdb_header *header);
30 void ctdb_ltdb_header_push(struct ctdb_ltdb_header *header, uint8_t *buf);
31 int ctdb_ltdb_header_pull(uint8_t *buf, size_t buflen,
32 struct ctdb_ltdb_header *header);
34 int ctdb_ltdb_header_extract(TDB_DATA *data, struct ctdb_ltdb_header *header);
36 size_t ctdb_rec_data_len(struct ctdb_rec_data *rec);
37 void ctdb_rec_data_push(struct ctdb_rec_data *rec, uint8_t *buf);
38 int ctdb_rec_data_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
39 struct ctdb_rec_data **out);
41 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer *recbuf);
42 void ctdb_rec_buffer_push(struct ctdb_rec_buffer *recbuf, uint8_t *buf);
43 int ctdb_rec_buffer_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
44 struct ctdb_rec_buffer **out);
46 struct ctdb_rec_buffer *ctdb_rec_buffer_init(TALLOC_CTX *mem_ctx,
48 int ctdb_rec_buffer_add(TALLOC_CTX *mem_ctx, struct ctdb_rec_buffer *recbuf,
49 uint32_t reqid, struct ctdb_ltdb_header *header,
50 TDB_DATA key, TDB_DATA data);
51 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer *recbuf,
52 ctdb_rec_parser_func_t func,
55 size_t ctdb_server_id_len(struct ctdb_server_id *sid);
56 void ctdb_server_id_push(struct ctdb_server_id *sid, uint8_t *buf);
57 int ctdb_server_id_pull(uint8_t *buf, size_t buflen,
58 struct ctdb_server_id *sid);
60 size_t ctdb_g_lock_len(struct ctdb_g_lock *lock);
61 void ctdb_g_lock_push(struct ctdb_g_lock *lock, uint8_t *buf);
62 int ctdb_g_lock_pull(uint8_t *buf, size_t buflen, struct ctdb_g_lock *lock);
64 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list *lock_list);
65 void ctdb_g_lock_list_push(struct ctdb_g_lock_list *lock_list, uint8_t *buf);
66 int ctdb_g_lock_list_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
67 struct ctdb_g_lock_list **out);
69 /* From protocol/protocol_header.c */
71 void ctdb_req_header_fill(struct ctdb_req_header *h, uint32_t generation,
72 uint32_t operation, uint32_t destnode,
73 uint32_t srcnode, uint32_t reqid);
75 int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
76 struct ctdb_req_header *h);
78 int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
80 /* From protocol/protocol_call.c */
82 int ctdb_req_call_push(struct ctdb_req_header *h,
83 struct ctdb_req_call *c,
85 uint8_t **pkt, size_t *pkt_len);
87 int ctdb_req_call_pull(uint8_t *pkt, size_t pkt_len,
88 struct ctdb_req_header *h,
90 struct ctdb_req_call *c);
92 int ctdb_reply_call_push(struct ctdb_req_header *h,
93 struct ctdb_reply_call *c,
95 uint8_t **pkt, size_t *pkt_len);
97 int ctdb_reply_call_pull(uint8_t *pkt, size_t pkt_len,
98 struct ctdb_req_header *h,
100 struct ctdb_reply_call *c);
102 int ctdb_reply_error_push(struct ctdb_req_header *h,
103 struct ctdb_reply_error *c,
105 uint8_t **pkt, size_t *pkt_len);
107 int ctdb_reply_error_pull(uint8_t *pkt, size_t pkt_len,
108 struct ctdb_req_header *h,
110 struct ctdb_reply_error *c);
112 int ctdb_req_dmaster_push(struct ctdb_req_header *h,
113 struct ctdb_req_dmaster *c,
115 uint8_t **pkt, size_t *pkt_len);
117 int ctdb_req_dmaster_pull(uint8_t *pkt, size_t pkt_len,
118 struct ctdb_req_header *h,
120 struct ctdb_req_dmaster *c);
122 int ctdb_reply_dmaster_push(struct ctdb_req_header *h,
123 struct ctdb_reply_dmaster *c,
125 uint8_t **pkt, size_t *pkt_len);
127 int ctdb_reply_dmaster_pull(uint8_t *pkt, size_t pkt_len,
128 struct ctdb_req_header *h,
130 struct ctdb_reply_dmaster *c);
132 /* From protocol/protocol_control.c */
134 int ctdb_req_control_push(struct ctdb_req_header *h,
135 struct ctdb_req_control *c,
137 uint8_t **pkt, size_t *pkt_len);
139 int ctdb_req_control_pull(uint8_t *pkt, size_t pkt_len,
140 struct ctdb_req_header *h,
142 struct ctdb_req_control *c);
144 int ctdb_reply_control_push(struct ctdb_req_header *h,
145 struct ctdb_reply_control *c,
147 uint8_t **pkt, size_t *pkt_len);
149 int ctdb_reply_control_pull(uint8_t *pkt, size_t pkt_len, uint32_t opcode,
150 struct ctdb_req_header *h,
152 struct ctdb_reply_control *c);
154 /* From protocol/protocol_client.c */
156 void ctdb_req_control_process_exists(struct ctdb_req_control *request,
158 int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
161 void ctdb_req_control_statistics(struct ctdb_req_control *request);
163 int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
165 struct ctdb_statistics **stats);
167 void ctdb_req_control_ping(struct ctdb_req_control *request);
168 int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
171 void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
173 int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
174 TALLOC_CTX *mem_ctx, const char **db_path);
176 void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
177 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
179 struct ctdb_vnn_map **vnnmap);
181 void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
182 struct ctdb_vnn_map *vnnmap);
183 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
185 void ctdb_req_control_get_debug(struct ctdb_req_control *request);
186 int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
187 uint32_t *debug_level);
189 void ctdb_req_control_set_debug(struct ctdb_req_control *request,
190 uint32_t debug_level);
191 int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
193 void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
194 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
196 struct ctdb_dbid_map **dbmap);
198 void ctdb_req_control_pull_db(struct ctdb_req_control *request,
199 struct ctdb_pulldb *pulldb);
200 int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply,
202 struct ctdb_rec_buffer **recbuf);
204 void ctdb_req_control_push_db(struct ctdb_req_control *request,
205 struct ctdb_rec_buffer *recbuf);
206 int ctdb_reply_control_push_db(struct ctdb_reply_control *reply);
208 void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
209 int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
212 void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
214 int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
216 void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
217 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
219 void ctdb_req_control_db_attach(struct ctdb_req_control *request,
220 const char *db_name, uint32_t tdb_flags);
221 int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
224 void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
225 struct ctdb_traverse_start *traverse);
226 int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
228 void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
230 int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
232 void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
234 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
236 void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
238 int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
239 TALLOC_CTX *mem_ctx, const char **db_name);
241 void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
243 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
245 void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
247 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
249 void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
250 int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
251 TALLOC_CTX *mem_ctx, const char **mem_str);
253 void ctdb_req_control_get_pid(struct ctdb_req_control *request);
254 int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
257 void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
258 int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
259 uint32_t *recmaster);
261 void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
263 int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
265 void ctdb_req_control_freeze(struct ctdb_req_control *request,
267 int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
269 void ctdb_req_control_thaw(struct ctdb_req_control *request,
271 int ctdb_reply_control_thaw(struct ctdb_reply_control *reply);
273 void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
274 int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
277 void ctdb_req_control_shutdown(struct ctdb_req_control *request);
278 int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
280 void ctdb_req_control_get_monmode(struct ctdb_req_control *request);
281 int ctdb_reply_control_get_monmode(struct ctdb_reply_control *reply,
284 void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
285 struct ctdb_connection *conn);
286 int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
288 void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
289 struct ctdb_connection *conn);
290 int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
292 void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
293 struct ctdb_connection *conn);
294 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
296 void ctdb_req_control_startup(struct ctdb_req_control *request);
297 int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
299 void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
300 struct ctdb_tunable *tunable);
301 int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
303 void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
305 int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
308 void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
309 int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
311 struct ctdb_var_list **tun_var_list);
313 void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
314 struct ctdb_node_flag_change *flag_change);
315 int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
317 void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
318 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
320 struct ctdb_tunable_list **tun_list);
322 void ctdb_req_control_kill_tcp(struct ctdb_req_control *request,
323 struct ctdb_connection *conn);
324 int ctdb_reply_control_kill_tcp(struct ctdb_reply_control *reply);
326 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
327 ctdb_sock_addr *addr);
328 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
330 struct ctdb_tickle_list **tickles);
332 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
333 struct ctdb_tickle_list *tickles);
334 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
336 void ctdb_req_control_register_server_id(struct ctdb_req_control *request,
337 struct ctdb_client_id *sid);
338 int ctdb_reply_control_register_server_id(struct ctdb_reply_control *reply);
340 void ctdb_req_control_unregister_server_id(struct ctdb_req_control *request,
341 struct ctdb_client_id *sid);
342 int ctdb_reply_control_unregister_server_id(struct ctdb_reply_control *reply);
344 void ctdb_req_control_check_server_id(struct ctdb_req_control *request,
345 struct ctdb_client_id *sid);
346 int ctdb_reply_control_check_server_id(struct ctdb_reply_control *reply);
348 void ctdb_req_control_get_server_id_list(struct ctdb_req_control *request);
349 int ctdb_reply_control_get_server_id_list(struct ctdb_reply_control *reply,
351 struct ctdb_client_id_map **cid_map);
353 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
356 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
359 void ctdb_req_control_update_record(struct ctdb_req_control *request,
360 struct ctdb_rec_buffer *recbuf);
361 int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
363 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
364 struct ctdb_addr_info *addr_info);
365 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
367 void ctdb_req_control_transaction_start(struct ctdb_req_control *request,
369 int ctdb_reply_control_transaction_start(struct ctdb_reply_control *reply);
371 void ctdb_req_control_transaction_commit(struct ctdb_req_control *request,
373 int ctdb_reply_control_transaction_commit(struct ctdb_reply_control *reply);
375 void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
376 struct ctdb_transdb *transdb);
377 int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
379 void ctdb_req_control_uptime(struct ctdb_req_control *request);
380 int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
382 struct ctdb_uptime **uptime);
384 void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
385 int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
387 void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
388 int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
390 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
391 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
393 void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
394 struct ctdb_rec_buffer *recbuf);
395 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
397 struct ctdb_rec_buffer **recbuf);
399 void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
400 int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
402 void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
403 int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
405 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
406 struct ctdb_addr_info *addr_info);
407 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
409 void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
410 struct ctdb_addr_info *addr_info);
411 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
413 void ctdb_req_control_run_eventscripts(struct ctdb_req_control *request,
414 const char *event_str);
415 int ctdb_reply_control_run_eventscripts(struct ctdb_reply_control *reply);
417 void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
418 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
421 void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
422 int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
424 void ctdb_req_control_release_ip(struct ctdb_req_control *request,
425 struct ctdb_public_ip *pubip);
426 int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
428 void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
429 struct ctdb_public_ip *pubip);
430 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
432 void ctdb_req_control_get_public_ips(struct ctdb_req_control *request);
433 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
435 struct ctdb_public_ip_list **pubip_list);
437 void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
438 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
440 struct ctdb_node_map **nodemap);
442 void ctdb_req_control_get_event_script_status(struct ctdb_req_control *request,
444 int ctdb_reply_control_get_event_script_status(struct ctdb_reply_control *reply,
446 struct ctdb_script_list **script_list);
448 void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
449 struct ctdb_traverse_start *traverse);
450 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
452 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
453 double reclock_latency);
454 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
456 void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
457 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
459 const char **reclock_file);
461 void ctdb_req_control_set_reclock_file(struct ctdb_req_control *request,
462 const char *reclock_file);
463 int ctdb_reply_control_set_reclock_file(struct ctdb_reply_control *reply);
465 void ctdb_req_control_stop_node(struct ctdb_req_control *request);
466 int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
468 void ctdb_req_control_continue_node(struct ctdb_req_control *request);
469 int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
471 void ctdb_req_control_set_natgwstate(struct ctdb_req_control *request,
472 uint32_t natgw_role);
473 int ctdb_reply_control_set_natgwstate(struct ctdb_reply_control *reply);
475 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
476 uint32_t lmaster_role);
477 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
479 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
480 uint32_t recmaster_role);
481 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
483 void ctdb_req_control_enable_script(struct ctdb_req_control *request,
485 int ctdb_reply_control_enable_script(struct ctdb_reply_control *reply);
487 void ctdb_req_control_disable_script(struct ctdb_req_control *request,
489 int ctdb_reply_control_disable_script(struct ctdb_reply_control *reply);
491 void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
492 struct ctdb_ban_state *ban_state);
493 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
495 void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
496 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
498 struct ctdb_ban_state **ban_state);
500 void ctdb_req_control_set_db_priority(struct ctdb_req_control *request,
501 struct ctdb_db_priority *db_prio);
502 int ctdb_reply_control_set_db_priority(struct ctdb_reply_control *reply);
504 void ctdb_req_control_get_db_priority(struct ctdb_req_control *request,
506 int ctdb_reply_control_get_db_priority(struct ctdb_reply_control *reply,
509 void ctdb_req_control_transaction_cancel(struct ctdb_req_control *request,
511 int ctdb_reply_control_transaction_cancel(struct ctdb_reply_control *reply);
513 void ctdb_req_control_register_notify(struct ctdb_req_control *request,
514 struct ctdb_notify_data *notify);
515 int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
517 void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
519 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
521 void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
522 struct ctdb_rec_buffer *recbuf);
523 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
525 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
527 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
530 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
532 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
534 void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
536 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
538 const char **reason);
540 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
541 ctdb_sock_addr *addr);
542 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
544 struct ctdb_public_ip_info **ipinfo);
546 void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
547 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
549 struct ctdb_iface_list **iface_list);
551 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
552 struct ctdb_iface *iface);
553 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
555 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
556 struct ctdb_connection *conn);
557 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
559 void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
560 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
562 struct ctdb_statistics_list **stats_list);
564 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
565 struct ctdb_key_data *key);
566 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
568 void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
570 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
572 void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
573 struct ctdb_uint64_array *u64_array);
574 int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
576 struct ctdb_uint8_array **u8_array);
578 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
579 struct ctdb_traverse_start_ext *traverse);
580 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
582 void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
584 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
586 struct ctdb_db_statistics **dbstats);
588 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
590 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
592 void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
593 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
595 void ctdb_req_control_receive_records(struct ctdb_req_control *request,
596 struct ctdb_rec_buffer *recbuf);
597 int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
599 struct ctdb_rec_buffer **recbuf);
601 void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
602 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
604 void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
605 int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
606 enum ctdb_runstate *runstate);
608 void ctdb_req_control_db_detach(struct ctdb_req_control *request,
610 int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
612 void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
613 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
615 struct ctdb_node_map **nodemap);
617 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
619 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
621 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
623 int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
625 void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
626 struct ctdb_transdb *transdb);
627 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
629 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
630 struct ctdb_transdb *transdb);
631 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
633 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
635 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
637 /* From protocol/protocol_message.c */
639 int ctdb_req_message_push(struct ctdb_req_header *h,
640 struct ctdb_req_message *c,
642 uint8_t **pkt, size_t *pkt_len);
644 int ctdb_req_message_pull(uint8_t *pkt, size_t pkt_len,
645 struct ctdb_req_header *h,
647 struct ctdb_req_message *c);
649 int ctdb_req_message_data_push(struct ctdb_req_header *h,
650 struct ctdb_req_message_data *message,
652 uint8_t **pkt, size_t *pkt_len);
654 int ctdb_req_message_data_pull(uint8_t *pkt, size_t pkt_len,
655 struct ctdb_req_header *h,
657 struct ctdb_req_message_data *message);
659 /* From protocol/protocol_util.c */
661 const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
662 enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
664 const char *ctdb_event_to_string(enum ctdb_event event);
665 enum ctdb_event ctdb_event_from_string(const char *event_str);
667 const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
669 #endif /* __CTDB_PROTOCOL_API_H__ */