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 size_t ctdb_rec_data_len(struct ctdb_rec_data *rec);
35 void ctdb_rec_data_push(struct ctdb_rec_data *rec, uint8_t *buf);
36 int ctdb_rec_data_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
37 struct ctdb_rec_data **out);
39 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer *recbuf);
40 void ctdb_rec_buffer_push(struct ctdb_rec_buffer *recbuf, uint8_t *buf);
41 int ctdb_rec_buffer_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
42 struct ctdb_rec_buffer **out);
44 struct ctdb_rec_buffer *ctdb_rec_buffer_init(TALLOC_CTX *mem_ctx,
46 int ctdb_rec_buffer_add(TALLOC_CTX *mem_ctx, struct ctdb_rec_buffer *recbuf,
47 uint32_t reqid, struct ctdb_ltdb_header *header,
48 TDB_DATA key, TDB_DATA data);
49 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer *recbuf,
50 ctdb_rec_parser_func_t func,
53 size_t ctdb_server_id_len(struct ctdb_server_id *sid);
54 void ctdb_server_id_push(struct ctdb_server_id *sid, uint8_t *buf);
55 int ctdb_server_id_pull(uint8_t *buf, size_t buflen,
56 struct ctdb_server_id *sid);
58 size_t ctdb_g_lock_len(struct ctdb_g_lock *lock);
59 void ctdb_g_lock_push(struct ctdb_g_lock *lock, uint8_t *buf);
60 int ctdb_g_lock_pull(uint8_t *buf, size_t buflen, struct ctdb_g_lock *lock);
62 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list *lock_list);
63 void ctdb_g_lock_list_push(struct ctdb_g_lock_list *lock_list, uint8_t *buf);
64 int ctdb_g_lock_list_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
65 struct ctdb_g_lock_list **out);
67 /* From protocol/protocol_header.c */
69 void ctdb_req_header_fill(struct ctdb_req_header *h, uint32_t generation,
70 uint32_t operation, uint32_t destnode,
71 uint32_t srcnode, uint32_t reqid);
73 int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
74 struct ctdb_req_header *h);
76 int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
78 /* From protocol/protocol_call.c */
80 int ctdb_req_call_push(struct ctdb_req_header *h,
81 struct ctdb_req_call *c,
83 uint8_t **pkt, size_t *pkt_len);
85 int ctdb_req_call_pull(uint8_t *pkt, size_t pkt_len,
86 struct ctdb_req_header *h,
88 struct ctdb_req_call *c);
90 int ctdb_reply_call_push(struct ctdb_req_header *h,
91 struct ctdb_reply_call *c,
93 uint8_t **pkt, size_t *pkt_len);
95 int ctdb_reply_call_pull(uint8_t *pkt, size_t pkt_len,
96 struct ctdb_req_header *h,
98 struct ctdb_reply_call *c);
100 int ctdb_reply_error_push(struct ctdb_req_header *h,
101 struct ctdb_reply_error *c,
103 uint8_t **pkt, size_t *pkt_len);
105 int ctdb_reply_error_pull(uint8_t *pkt, size_t pkt_len,
106 struct ctdb_req_header *h,
108 struct ctdb_reply_error *c);
110 int ctdb_req_dmaster_push(struct ctdb_req_header *h,
111 struct ctdb_req_dmaster *c,
113 uint8_t **pkt, size_t *pkt_len);
115 int ctdb_req_dmaster_pull(uint8_t *pkt, size_t pkt_len,
116 struct ctdb_req_header *h,
118 struct ctdb_req_dmaster *c);
120 int ctdb_reply_dmaster_push(struct ctdb_req_header *h,
121 struct ctdb_reply_dmaster *c,
123 uint8_t **pkt, size_t *pkt_len);
125 int ctdb_reply_dmaster_pull(uint8_t *pkt, size_t pkt_len,
126 struct ctdb_req_header *h,
128 struct ctdb_reply_dmaster *c);
130 /* From protocol/protocol_control.c */
132 int ctdb_req_control_push(struct ctdb_req_header *h,
133 struct ctdb_req_control *c,
135 uint8_t **pkt, size_t *pkt_len);
137 int ctdb_req_control_pull(uint8_t *pkt, size_t pkt_len,
138 struct ctdb_req_header *h,
140 struct ctdb_req_control *c);
142 int ctdb_reply_control_push(struct ctdb_req_header *h,
143 struct ctdb_reply_control *c,
145 uint8_t **pkt, size_t *pkt_len);
147 int ctdb_reply_control_pull(uint8_t *pkt, size_t pkt_len, uint32_t opcode,
148 struct ctdb_req_header *h,
150 struct ctdb_reply_control *c);
152 /* From protocol/protocol_client.c */
154 void ctdb_req_control_process_exists(struct ctdb_req_control *request,
156 int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
159 void ctdb_req_control_statistics(struct ctdb_req_control *request);
161 int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
163 struct ctdb_statistics **stats);
165 void ctdb_req_control_ping(struct ctdb_req_control *request);
166 int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
169 void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
171 int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
172 TALLOC_CTX *mem_ctx, const char **db_path);
174 void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
175 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
177 struct ctdb_vnn_map **vnnmap);
179 void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
180 struct ctdb_vnn_map *vnnmap);
181 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
183 void ctdb_req_control_get_debug(struct ctdb_req_control *request);
184 int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
185 uint32_t *debug_level);
187 void ctdb_req_control_set_debug(struct ctdb_req_control *request,
188 uint32_t debug_level);
189 int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
191 void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
192 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
194 struct ctdb_dbid_map **dbmap);
196 void ctdb_req_control_pull_db(struct ctdb_req_control *request,
197 struct ctdb_pulldb *pulldb);
198 int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply,
200 struct ctdb_rec_buffer **recbuf);
202 void ctdb_req_control_push_db(struct ctdb_req_control *request,
203 struct ctdb_rec_buffer *recbuf);
204 int ctdb_reply_control_push_db(struct ctdb_reply_control *reply);
206 void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
207 int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
210 void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
212 int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
214 void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
215 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
217 void ctdb_req_control_db_attach(struct ctdb_req_control *request,
218 const char *db_name, uint32_t tdb_flags);
219 int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
222 void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
223 struct ctdb_traverse_start *traverse);
224 int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
226 void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
228 int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
230 void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
232 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
234 void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
236 int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
237 TALLOC_CTX *mem_ctx, const char **db_name);
239 void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
241 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
243 void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
245 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
247 void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
248 int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
249 TALLOC_CTX *mem_ctx, const char **mem_str);
251 void ctdb_req_control_get_pid(struct ctdb_req_control *request);
252 int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
255 void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
256 int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
257 uint32_t *recmaster);
259 void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
261 int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
263 void ctdb_req_control_freeze(struct ctdb_req_control *request,
265 int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
267 void ctdb_req_control_thaw(struct ctdb_req_control *request,
269 int ctdb_reply_control_thaw(struct ctdb_reply_control *reply);
271 void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
272 int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
275 void ctdb_req_control_shutdown(struct ctdb_req_control *request);
276 int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
278 void ctdb_req_control_get_monmode(struct ctdb_req_control *request);
279 int ctdb_reply_control_get_monmode(struct ctdb_reply_control *reply,
282 void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
283 struct ctdb_connection *conn);
284 int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
286 void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
287 struct ctdb_connection *conn);
288 int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
290 void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
291 struct ctdb_connection *conn);
292 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
294 void ctdb_req_control_startup(struct ctdb_req_control *request);
295 int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
297 void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
298 struct ctdb_tunable *tunable);
299 int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
301 void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
303 int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
306 void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
307 int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
309 struct ctdb_var_list **tun_var_list);
311 void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
312 struct ctdb_node_flag_change *flag_change);
313 int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
315 void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
316 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
318 struct ctdb_tunable_list **tun_list);
320 void ctdb_req_control_kill_tcp(struct ctdb_req_control *request,
321 struct ctdb_connection *conn);
322 int ctdb_reply_control_kill_tcp(struct ctdb_reply_control *reply);
324 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
325 ctdb_sock_addr *addr);
326 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
328 struct ctdb_tickle_list **tickles);
330 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
331 struct ctdb_tickle_list *tickles);
332 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
334 void ctdb_req_control_register_server_id(struct ctdb_req_control *request,
335 struct ctdb_client_id *sid);
336 int ctdb_reply_control_register_server_id(struct ctdb_reply_control *reply);
338 void ctdb_req_control_unregister_server_id(struct ctdb_req_control *request,
339 struct ctdb_client_id *sid);
340 int ctdb_reply_control_unregister_server_id(struct ctdb_reply_control *reply);
342 void ctdb_req_control_check_server_id(struct ctdb_req_control *request,
343 struct ctdb_client_id *sid);
344 int ctdb_reply_control_check_server_id(struct ctdb_reply_control *reply);
346 void ctdb_req_control_get_server_id_list(struct ctdb_req_control *request);
347 int ctdb_reply_control_get_server_id_list(struct ctdb_reply_control *reply,
349 struct ctdb_client_id_map **cid_map);
351 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
354 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
357 void ctdb_req_control_update_record(struct ctdb_req_control *request,
358 struct ctdb_rec_buffer *recbuf);
359 int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
361 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
362 struct ctdb_addr_info *addr_info);
363 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
365 void ctdb_req_control_transaction_start(struct ctdb_req_control *request,
367 int ctdb_reply_control_transaction_start(struct ctdb_reply_control *reply);
369 void ctdb_req_control_transaction_commit(struct ctdb_req_control *request,
371 int ctdb_reply_control_transaction_commit(struct ctdb_reply_control *reply);
373 void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
374 struct ctdb_transdb *transdb);
375 int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
377 void ctdb_req_control_uptime(struct ctdb_req_control *request);
378 int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
380 struct ctdb_uptime **uptime);
382 void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
383 int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
385 void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
386 int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
388 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
389 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
391 void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
392 struct ctdb_rec_buffer *recbuf);
393 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
395 struct ctdb_rec_buffer **recbuf);
397 void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
398 int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
400 void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
401 int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
403 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
404 struct ctdb_addr_info *addr_info);
405 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
407 void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
408 struct ctdb_addr_info *addr_info);
409 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
411 void ctdb_req_control_run_eventscripts(struct ctdb_req_control *request,
412 const char *event_str);
413 int ctdb_reply_control_run_eventscripts(struct ctdb_reply_control *reply);
415 void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
416 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
419 void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
420 int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
422 void ctdb_req_control_release_ip(struct ctdb_req_control *request,
423 struct ctdb_public_ip *pubip);
424 int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
426 void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
427 struct ctdb_public_ip *pubip);
428 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
430 void ctdb_req_control_get_public_ips(struct ctdb_req_control *request);
431 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
433 struct ctdb_public_ip_list **pubip_list);
435 void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
436 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
438 struct ctdb_node_map **nodemap);
440 void ctdb_req_control_get_event_script_status(struct ctdb_req_control *request,
442 int ctdb_reply_control_get_event_script_status(struct ctdb_reply_control *reply,
444 struct ctdb_script_list **script_list);
446 void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
447 struct ctdb_traverse_start *traverse);
448 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
450 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
451 double reclock_latency);
452 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
454 void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
455 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
457 const char **reclock_file);
459 void ctdb_req_control_set_reclock_file(struct ctdb_req_control *request,
460 const char *reclock_file);
461 int ctdb_reply_control_set_reclock_file(struct ctdb_reply_control *reply);
463 void ctdb_req_control_stop_node(struct ctdb_req_control *request);
464 int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
466 void ctdb_req_control_continue_node(struct ctdb_req_control *request);
467 int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
469 void ctdb_req_control_set_natgwstate(struct ctdb_req_control *request,
470 uint32_t natgw_role);
471 int ctdb_reply_control_set_natgwstate(struct ctdb_reply_control *reply);
473 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
474 uint32_t lmaster_role);
475 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
477 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
478 uint32_t recmaster_role);
479 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
481 void ctdb_req_control_enable_script(struct ctdb_req_control *request,
483 int ctdb_reply_control_enable_script(struct ctdb_reply_control *reply);
485 void ctdb_req_control_disable_script(struct ctdb_req_control *request,
487 int ctdb_reply_control_disable_script(struct ctdb_reply_control *reply);
489 void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
490 struct ctdb_ban_state *ban_state);
491 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
493 void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
494 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
496 struct ctdb_ban_state **ban_state);
498 void ctdb_req_control_set_db_priority(struct ctdb_req_control *request,
499 struct ctdb_db_priority *db_prio);
500 int ctdb_reply_control_set_db_priority(struct ctdb_reply_control *reply);
502 void ctdb_req_control_get_db_priority(struct ctdb_req_control *request,
504 int ctdb_reply_control_get_db_priority(struct ctdb_reply_control *reply,
507 void ctdb_req_control_transaction_cancel(struct ctdb_req_control *request,
509 int ctdb_reply_control_transaction_cancel(struct ctdb_reply_control *reply);
511 void ctdb_req_control_register_notify(struct ctdb_req_control *request,
512 struct ctdb_notify_data *notify);
513 int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
515 void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
517 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
519 void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
520 struct ctdb_rec_buffer *recbuf);
521 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
523 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
525 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
528 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
530 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
532 void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
534 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
536 const char **reason);
538 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
539 ctdb_sock_addr *addr);
540 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
542 struct ctdb_public_ip_info **ipinfo);
544 void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
545 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
547 struct ctdb_iface_list **iface_list);
549 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
550 struct ctdb_iface *iface);
551 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
553 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
554 struct ctdb_connection *conn);
555 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
557 void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
558 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
560 struct ctdb_statistics_list **stats_list);
562 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
563 struct ctdb_key_data *key);
564 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
566 void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
568 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
570 void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
571 struct ctdb_uint64_array *u64_array);
572 int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
574 struct ctdb_uint8_array **u8_array);
576 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
577 struct ctdb_traverse_start_ext *traverse);
578 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
580 void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
582 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
584 struct ctdb_db_statistics **dbstats);
586 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
588 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
590 void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
591 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
593 void ctdb_req_control_receive_records(struct ctdb_req_control *request,
594 struct ctdb_rec_buffer *recbuf);
595 int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
597 struct ctdb_rec_buffer **recbuf);
599 void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
600 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
602 void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
603 int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
604 enum ctdb_runstate *runstate);
606 void ctdb_req_control_db_detach(struct ctdb_req_control *request,
608 int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
610 void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
611 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
613 struct ctdb_node_map **nodemap);
615 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
617 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
619 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
621 int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
623 void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
624 struct ctdb_transdb *transdb);
625 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
627 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
628 struct ctdb_transdb *transdb);
629 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
631 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
633 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
635 /* From protocol/protocol_message.c */
637 int ctdb_req_message_push(struct ctdb_req_header *h,
638 struct ctdb_req_message *c,
640 uint8_t **pkt, size_t *pkt_len);
642 int ctdb_req_message_pull(uint8_t *pkt, size_t pkt_len,
643 struct ctdb_req_header *h,
645 struct ctdb_req_message *c);
647 int ctdb_req_message_data_push(struct ctdb_req_header *h,
648 struct ctdb_req_message_data *message,
650 uint8_t **pkt, size_t *pkt_len);
652 int ctdb_req_message_data_pull(uint8_t *pkt, size_t pkt_len,
653 struct ctdb_req_header *h,
655 struct ctdb_req_message_data *message);
657 /* From protocol/protocol_util.c */
659 const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
660 enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
662 const char *ctdb_event_to_string(enum ctdb_event event);
663 enum ctdb_event ctdb_event_from_string(const char *event_str);
665 const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
667 #endif /* __CTDB_PROTOCOL_API_H__ */