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
*in
);
30 void ctdb_ltdb_header_push(struct ctdb_ltdb_header
*in
, uint8_t *buf
,
32 int ctdb_ltdb_header_pull(uint8_t *buf
, size_t buflen
,
33 struct ctdb_ltdb_header
*out
, size_t *npull
);
35 int ctdb_ltdb_header_extract(TDB_DATA
*data
, struct ctdb_ltdb_header
*header
);
37 size_t ctdb_node_map_len(struct ctdb_node_map
*in
);
38 void ctdb_node_map_push(struct ctdb_node_map
*in
, uint8_t *buf
, size_t *npush
);
39 int ctdb_node_map_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
40 struct ctdb_node_map
**out
, size_t *npull
);
42 size_t ctdb_rec_data_len(struct ctdb_rec_data
*in
);
43 void ctdb_rec_data_push(struct ctdb_rec_data
*in
, uint8_t *buf
, size_t *npush
);
44 int ctdb_rec_data_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
45 struct ctdb_rec_data
**out
, size_t *npull
);
47 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer
*in
);
48 void ctdb_rec_buffer_push(struct ctdb_rec_buffer
*in
, uint8_t *buf
,
50 int ctdb_rec_buffer_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
51 struct ctdb_rec_buffer
**out
, size_t *npull
);
53 struct ctdb_rec_buffer
*ctdb_rec_buffer_init(TALLOC_CTX
*mem_ctx
,
55 int ctdb_rec_buffer_add(TALLOC_CTX
*mem_ctx
, struct ctdb_rec_buffer
*recbuf
,
56 uint32_t reqid
, struct ctdb_ltdb_header
*header
,
57 TDB_DATA key
, TDB_DATA data
);
58 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer
*recbuf
,
59 ctdb_rec_parser_func_t func
,
62 int ctdb_rec_buffer_write(struct ctdb_rec_buffer
*recbuf
, int fd
);
63 int ctdb_rec_buffer_read(int fd
, TALLOC_CTX
*mem_ctx
,
64 struct ctdb_rec_buffer
**out
);
66 size_t ctdb_server_id_len(struct ctdb_server_id
*in
);
67 void ctdb_server_id_push(struct ctdb_server_id
*in
, uint8_t *buf
,
69 int ctdb_server_id_pull(uint8_t *buf
, size_t buflen
,
70 struct ctdb_server_id
*out
, size_t *npull
);
72 size_t ctdb_g_lock_len(struct ctdb_g_lock
*in
);
73 void ctdb_g_lock_push(struct ctdb_g_lock
*in
, uint8_t *buf
, size_t *npush
);
74 int ctdb_g_lock_pull(uint8_t *buf
, size_t buflen
, struct ctdb_g_lock
*out
,
77 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list
*in
);
78 void ctdb_g_lock_list_push(struct ctdb_g_lock_list
*in
, uint8_t *buf
,
80 int ctdb_g_lock_list_pull(uint8_t *buf
, size_t buflen
, TALLOC_CTX
*mem_ctx
,
81 struct ctdb_g_lock_list
**out
, size_t *npull
);
83 /* From protocol/protocol_header.c */
85 void ctdb_req_header_fill(struct ctdb_req_header
*h
, uint32_t generation
,
86 uint32_t operation
, uint32_t destnode
,
87 uint32_t srcnode
, uint32_t reqid
);
89 size_t ctdb_req_header_len(struct ctdb_req_header
*in
);
90 void ctdb_req_header_push(struct ctdb_req_header
*in
, uint8_t *buf
,
92 int ctdb_req_header_pull(uint8_t *buf
, size_t buflen
,
93 struct ctdb_req_header
*out
, size_t *npull
);
95 int ctdb_req_header_verify(struct ctdb_req_header
*h
, uint32_t operation
);
97 /* From protocol/protocol_call.c */
99 size_t ctdb_req_call_len(struct ctdb_req_header
*h
,
100 struct ctdb_req_call
*c
);
102 int ctdb_req_call_push(struct ctdb_req_header
*h
,
103 struct ctdb_req_call
*c
,
104 uint8_t *buf
, size_t *buflen
);
106 int ctdb_req_call_pull(uint8_t *buf
, size_t buflen
,
107 struct ctdb_req_header
*h
,
109 struct ctdb_req_call
*c
);
111 size_t ctdb_reply_call_len(struct ctdb_req_header
*h
,
112 struct ctdb_reply_call
*c
);
114 int ctdb_reply_call_push(struct ctdb_req_header
*h
,
115 struct ctdb_reply_call
*c
,
116 uint8_t *buf
, size_t *buflen
);
118 int ctdb_reply_call_pull(uint8_t *buf
, size_t buflen
,
119 struct ctdb_req_header
*h
,
121 struct ctdb_reply_call
*c
);
123 size_t ctdb_reply_error_len(struct ctdb_req_header
*h
,
124 struct ctdb_reply_error
*c
);
126 int ctdb_reply_error_push(struct ctdb_req_header
*h
,
127 struct ctdb_reply_error
*c
,
128 uint8_t *buf
, size_t *buflen
);
130 int ctdb_reply_error_pull(uint8_t *buf
, size_t buflen
,
131 struct ctdb_req_header
*h
,
133 struct ctdb_reply_error
*c
);
135 size_t ctdb_req_dmaster_len(struct ctdb_req_header
*h
,
136 struct ctdb_req_dmaster
*c
);
138 int ctdb_req_dmaster_push(struct ctdb_req_header
*h
,
139 struct ctdb_req_dmaster
*c
,
140 uint8_t *buf
, size_t *buflen
);
142 int ctdb_req_dmaster_pull(uint8_t *buf
, size_t buflen
,
143 struct ctdb_req_header
*h
,
145 struct ctdb_req_dmaster
*c
);
147 size_t ctdb_reply_dmaster_len(struct ctdb_req_header
*h
,
148 struct ctdb_reply_dmaster
*c
);
150 int ctdb_reply_dmaster_push(struct ctdb_req_header
*h
,
151 struct ctdb_reply_dmaster
*c
,
152 uint8_t *buf
, size_t *buflen
);
154 int ctdb_reply_dmaster_pull(uint8_t *buf
, size_t buflen
,
155 struct ctdb_req_header
*h
,
157 struct ctdb_reply_dmaster
*c
);
159 /* From protocol/protocol_control.c */
161 size_t ctdb_req_control_len(struct ctdb_req_header
*h
,
162 struct ctdb_req_control
*c
);
164 int ctdb_req_control_push(struct ctdb_req_header
*h
,
165 struct ctdb_req_control
*c
,
166 uint8_t *buf
, size_t *buflen
);
168 int ctdb_req_control_pull(uint8_t *buf
, size_t buflen
,
169 struct ctdb_req_header
*h
,
171 struct ctdb_req_control
*c
);
173 size_t ctdb_reply_control_len(struct ctdb_req_header
*h
,
174 struct ctdb_reply_control
*c
);
176 int ctdb_reply_control_push(struct ctdb_req_header
*h
,
177 struct ctdb_reply_control
*c
,
178 uint8_t *buf
, size_t *buflen
);
180 int ctdb_reply_control_pull(uint8_t *buf
, size_t buflen
, uint32_t opcode
,
181 struct ctdb_req_header
*h
,
183 struct ctdb_reply_control
*c
);
185 /* From protocol/protocol_client.c */
187 void ctdb_req_control_process_exists(struct ctdb_req_control
*request
,
189 int ctdb_reply_control_process_exists(struct ctdb_reply_control
*reply
,
192 void ctdb_req_control_statistics(struct ctdb_req_control
*request
);
194 int ctdb_reply_control_statistics(struct ctdb_reply_control
*reply
,
196 struct ctdb_statistics
**stats
);
198 void ctdb_req_control_ping(struct ctdb_req_control
*request
);
199 int ctdb_reply_control_ping(struct ctdb_reply_control
*reply
,
202 void ctdb_req_control_getdbpath(struct ctdb_req_control
*request
,
204 int ctdb_reply_control_getdbpath(struct ctdb_reply_control
*reply
,
205 TALLOC_CTX
*mem_ctx
, const char **db_path
);
207 void ctdb_req_control_getvnnmap(struct ctdb_req_control
*request
);
208 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control
*reply
,
210 struct ctdb_vnn_map
**vnnmap
);
212 void ctdb_req_control_setvnnmap(struct ctdb_req_control
*request
,
213 struct ctdb_vnn_map
*vnnmap
);
214 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control
*reply
);
216 void ctdb_req_control_get_debug(struct ctdb_req_control
*request
);
217 int ctdb_reply_control_get_debug(struct ctdb_reply_control
*reply
,
220 void ctdb_req_control_set_debug(struct ctdb_req_control
*request
,
222 int ctdb_reply_control_set_debug(struct ctdb_reply_control
*reply
);
224 void ctdb_req_control_get_dbmap(struct ctdb_req_control
*request
);
225 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control
*reply
,
227 struct ctdb_dbid_map
**dbmap
);
229 void ctdb_req_control_get_recmode(struct ctdb_req_control
*request
);
230 int ctdb_reply_control_get_recmode(struct ctdb_reply_control
*reply
,
233 void ctdb_req_control_set_recmode(struct ctdb_req_control
*request
,
235 int ctdb_reply_control_set_recmode(struct ctdb_reply_control
*reply
);
237 void ctdb_req_control_statistics_reset(struct ctdb_req_control
*request
);
238 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control
*reply
);
240 void ctdb_req_control_db_attach(struct ctdb_req_control
*request
,
241 const char *db_name
);
242 int ctdb_reply_control_db_attach(struct ctdb_reply_control
*reply
,
245 void ctdb_req_control_traverse_start(struct ctdb_req_control
*request
,
246 struct ctdb_traverse_start
*traverse
);
247 int ctdb_reply_control_traverse_start(struct ctdb_reply_control
*reply
);
249 void ctdb_req_control_register_srvid(struct ctdb_req_control
*request
,
251 int ctdb_reply_control_register_srvid(struct ctdb_reply_control
*reply
);
253 void ctdb_req_control_deregister_srvid(struct ctdb_req_control
*request
,
255 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control
*reply
);
257 void ctdb_req_control_get_dbname(struct ctdb_req_control
*request
,
259 int ctdb_reply_control_get_dbname(struct ctdb_reply_control
*reply
,
260 TALLOC_CTX
*mem_ctx
, const char **db_name
);
262 void ctdb_req_control_enable_seqnum(struct ctdb_req_control
*request
,
264 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control
*reply
);
266 void ctdb_req_control_update_seqnum(struct ctdb_req_control
*request
,
268 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control
*reply
);
270 void ctdb_req_control_dump_memory(struct ctdb_req_control
*request
);
271 int ctdb_reply_control_dump_memory(struct ctdb_reply_control
*reply
,
272 TALLOC_CTX
*mem_ctx
, const char **mem_str
);
274 void ctdb_req_control_get_pid(struct ctdb_req_control
*request
);
275 int ctdb_reply_control_get_pid(struct ctdb_reply_control
*reply
,
278 void ctdb_req_control_freeze(struct ctdb_req_control
*request
,
280 int ctdb_reply_control_freeze(struct ctdb_reply_control
*reply
);
282 void ctdb_req_control_get_pnn(struct ctdb_req_control
*request
);
283 int ctdb_reply_control_get_pnn(struct ctdb_reply_control
*reply
,
286 void ctdb_req_control_shutdown(struct ctdb_req_control
*request
);
287 int ctdb_reply_control_shutdown(struct ctdb_reply_control
*reply
);
289 void ctdb_req_control_tcp_client(struct ctdb_req_control
*request
,
290 struct ctdb_connection
*conn
);
291 int ctdb_reply_control_tcp_client(struct ctdb_reply_control
*reply
);
293 void ctdb_req_control_tcp_add(struct ctdb_req_control
*request
,
294 struct ctdb_connection
*conn
);
295 int ctdb_reply_control_tcp_add(struct ctdb_reply_control
*reply
);
297 void ctdb_req_control_tcp_remove(struct ctdb_req_control
*request
,
298 struct ctdb_connection
*conn
);
299 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control
*reply
);
301 void ctdb_req_control_startup(struct ctdb_req_control
*request
);
302 int ctdb_reply_control_startup(struct ctdb_reply_control
*reply
);
304 void ctdb_req_control_set_tunable(struct ctdb_req_control
*request
,
305 struct ctdb_tunable
*tunable
);
306 int ctdb_reply_control_set_tunable(struct ctdb_reply_control
*reply
);
308 void ctdb_req_control_get_tunable(struct ctdb_req_control
*request
,
310 int ctdb_reply_control_get_tunable(struct ctdb_reply_control
*reply
,
313 void ctdb_req_control_list_tunables(struct ctdb_req_control
*request
);
314 int ctdb_reply_control_list_tunables(struct ctdb_reply_control
*reply
,
316 struct ctdb_var_list
**tun_var_list
);
318 void ctdb_req_control_modify_flags(struct ctdb_req_control
*request
,
319 struct ctdb_node_flag_change
*flag_change
);
320 int ctdb_reply_control_modify_flags(struct ctdb_reply_control
*reply
);
322 void ctdb_req_control_get_all_tunables(struct ctdb_req_control
*request
);
323 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control
*reply
,
325 struct ctdb_tunable_list
**tun_list
);
327 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control
*request
,
328 ctdb_sock_addr
*addr
);
329 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control
*reply
,
331 struct ctdb_tickle_list
**tickles
);
333 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control
*request
,
334 struct ctdb_tickle_list
*tickles
);
335 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control
*reply
);
337 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control
*request
,
339 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control
*reply
,
342 void ctdb_req_control_update_record(struct ctdb_req_control
*request
,
343 struct ctdb_rec_buffer
*recbuf
);
344 int ctdb_reply_control_update_record(struct ctdb_reply_control
*reply
);
346 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control
*request
,
347 struct ctdb_addr_info
*addr_info
);
348 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control
*reply
);
350 void ctdb_req_control_wipe_database(struct ctdb_req_control
*request
,
351 struct ctdb_transdb
*transdb
);
352 int ctdb_reply_control_wipe_database(struct ctdb_reply_control
*reply
);
354 void ctdb_req_control_uptime(struct ctdb_req_control
*request
);
355 int ctdb_reply_control_uptime(struct ctdb_reply_control
*reply
,
357 struct ctdb_uptime
**uptime
);
359 void ctdb_req_control_start_recovery(struct ctdb_req_control
*request
);
360 int ctdb_reply_control_start_recovery(struct ctdb_reply_control
*reply
);
362 void ctdb_req_control_end_recovery(struct ctdb_req_control
*request
);
363 int ctdb_reply_control_end_recovery(struct ctdb_reply_control
*reply
);
365 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control
*request
);
366 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control
*reply
);
368 void ctdb_req_control_try_delete_records(struct ctdb_req_control
*request
,
369 struct ctdb_rec_buffer
*recbuf
);
370 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control
*reply
,
372 struct ctdb_rec_buffer
**recbuf
);
374 void ctdb_req_control_add_public_ip(struct ctdb_req_control
*request
,
375 struct ctdb_addr_info
*addr_info
);
376 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control
*reply
);
378 void ctdb_req_control_del_public_ip(struct ctdb_req_control
*request
,
379 struct ctdb_addr_info
*addr_info
);
380 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control
*reply
);
382 void ctdb_req_control_get_capabilities(struct ctdb_req_control
*request
);
383 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control
*reply
,
386 void ctdb_req_control_recd_ping(struct ctdb_req_control
*request
);
387 int ctdb_reply_control_recd_ping(struct ctdb_reply_control
*reply
);
389 void ctdb_req_control_release_ip(struct ctdb_req_control
*request
,
390 struct ctdb_public_ip
*pubip
);
391 int ctdb_reply_control_release_ip(struct ctdb_reply_control
*reply
);
393 void ctdb_req_control_takeover_ip(struct ctdb_req_control
*request
,
394 struct ctdb_public_ip
*pubip
);
395 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control
*reply
);
397 void ctdb_req_control_get_public_ips(struct ctdb_req_control
*request
,
398 bool available_only
);
399 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control
*reply
,
401 struct ctdb_public_ip_list
**pubip_list
);
403 void ctdb_req_control_get_nodemap(struct ctdb_req_control
*request
);
404 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control
*reply
,
406 struct ctdb_node_map
**nodemap
);
408 void ctdb_req_control_traverse_kill(struct ctdb_req_control
*request
,
409 struct ctdb_traverse_start
*traverse
);
410 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control
*reply
);
412 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control
*request
,
413 double reclock_latency
);
414 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control
*reply
);
416 void ctdb_req_control_get_reclock_file(struct ctdb_req_control
*request
);
417 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control
*reply
,
419 const char **reclock_file
);
421 void ctdb_req_control_stop_node(struct ctdb_req_control
*request
);
422 int ctdb_reply_control_stop_node(struct ctdb_reply_control
*reply
);
424 void ctdb_req_control_continue_node(struct ctdb_req_control
*request
);
425 int ctdb_reply_control_continue_node(struct ctdb_reply_control
*reply
);
427 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control
*request
,
428 uint32_t lmaster_role
);
429 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control
*reply
);
431 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control
*request
,
432 uint32_t recmaster_role
);
433 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control
*reply
);
435 void ctdb_req_control_set_ban_state(struct ctdb_req_control
*request
,
436 struct ctdb_ban_state
*ban_state
);
437 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control
*reply
);
439 void ctdb_req_control_get_ban_state(struct ctdb_req_control
*request
);
440 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control
*reply
,
442 struct ctdb_ban_state
**ban_state
);
444 void ctdb_req_control_register_notify(struct ctdb_req_control
*request
,
445 struct ctdb_notify_data
*notify
);
446 int ctdb_reply_control_register_notify(struct ctdb_reply_control
*reply
);
448 void ctdb_req_control_deregister_notify(struct ctdb_req_control
*request
,
450 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control
*reply
);
452 void ctdb_req_control_trans3_commit(struct ctdb_req_control
*request
,
453 struct ctdb_rec_buffer
*recbuf
);
454 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control
*reply
);
456 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control
*request
,
458 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control
*reply
,
461 void ctdb_req_control_db_set_healthy(struct ctdb_req_control
*request
,
463 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control
*reply
);
465 void ctdb_req_control_db_get_health(struct ctdb_req_control
*request
,
467 int ctdb_reply_control_db_get_health(struct ctdb_reply_control
*reply
,
469 const char **reason
);
471 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control
*request
,
472 ctdb_sock_addr
*addr
);
473 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control
*reply
,
475 struct ctdb_public_ip_info
**ipinfo
);
477 void ctdb_req_control_get_ifaces(struct ctdb_req_control
*request
);
478 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control
*reply
,
480 struct ctdb_iface_list
**iface_list
);
482 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control
*request
,
483 struct ctdb_iface
*iface
);
484 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control
*reply
);
486 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control
*request
,
487 struct ctdb_connection
*conn
);
488 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control
*reply
);
490 void ctdb_req_control_get_stat_history(struct ctdb_req_control
*request
);
491 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control
*reply
,
493 struct ctdb_statistics_list
**stats_list
);
495 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control
*request
,
496 struct ctdb_key_data
*key
);
497 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control
*reply
);
499 void ctdb_req_control_set_db_readonly(struct ctdb_req_control
*request
,
501 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control
*reply
);
503 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control
*request
,
504 struct ctdb_traverse_start_ext
*traverse
);
505 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control
*reply
);
507 void ctdb_req_control_get_db_statistics(struct ctdb_req_control
*request
,
509 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control
*reply
,
511 struct ctdb_db_statistics
**dbstats
);
513 void ctdb_req_control_set_db_sticky(struct ctdb_req_control
*request
,
515 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control
*reply
);
517 void ctdb_req_control_reload_public_ips(struct ctdb_req_control
*request
);
518 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control
*reply
);
520 void ctdb_req_control_ipreallocated(struct ctdb_req_control
*request
);
521 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control
*reply
);
523 void ctdb_req_control_get_runstate(struct ctdb_req_control
*request
);
524 int ctdb_reply_control_get_runstate(struct ctdb_reply_control
*reply
,
525 enum ctdb_runstate
*runstate
);
527 void ctdb_req_control_db_detach(struct ctdb_req_control
*request
,
529 int ctdb_reply_control_db_detach(struct ctdb_reply_control
*reply
);
531 void ctdb_req_control_get_nodes_file(struct ctdb_req_control
*request
);
532 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control
*reply
,
534 struct ctdb_node_map
**nodemap
);
536 void ctdb_req_control_db_freeze(struct ctdb_req_control
*request
,
538 int ctdb_reply_control_db_freeze(struct ctdb_reply_control
*reply
);
540 void ctdb_req_control_db_thaw(struct ctdb_req_control
*request
,
542 int ctdb_reply_control_db_thaw(struct ctdb_reply_control
*reply
);
544 void ctdb_req_control_db_transaction_start(struct ctdb_req_control
*request
,
545 struct ctdb_transdb
*transdb
);
546 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control
*reply
);
548 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control
*request
,
549 struct ctdb_transdb
*transdb
);
550 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control
*reply
);
552 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control
*request
,
554 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control
*reply
);
556 void ctdb_req_control_db_pull(struct ctdb_req_control
*request
,
557 struct ctdb_pulldb_ext
*pulldb_ext
);
558 int ctdb_reply_control_db_pull(struct ctdb_reply_control
*reply
,
559 uint32_t *num_records
);
561 void ctdb_req_control_db_push_start(struct ctdb_req_control
*request
,
562 struct ctdb_pulldb_ext
*pulldb_ext
);
563 int ctdb_reply_control_db_push_start(struct ctdb_reply_control
*reply
);
565 void ctdb_req_control_db_push_confirm(struct ctdb_req_control
*request
,
567 int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control
*reply
,
568 uint32_t *num_records
);
570 void ctdb_req_control_db_open_flags(struct ctdb_req_control
*request
,
572 int ctdb_reply_control_db_open_flags(struct ctdb_reply_control
*reply
,
575 void ctdb_req_control_db_attach_replicated(struct ctdb_req_control
*request
,
576 const char *db_name
);
577 int ctdb_reply_control_db_attach_replicated(struct ctdb_reply_control
*reply
,
580 void ctdb_req_control_check_pid_srvid(struct ctdb_req_control
*request
,
581 struct ctdb_pid_srvid
*pid_srvid
);
582 int ctdb_reply_control_check_pid_srvid(struct ctdb_reply_control
*reply
,
585 void ctdb_req_control_tunnel_register(struct ctdb_req_control
*request
,
587 int ctdb_reply_control_tunnel_register(struct ctdb_reply_control
*reply
);
589 void ctdb_req_control_tunnel_deregister(struct ctdb_req_control
*request
,
591 int ctdb_reply_control_tunnel_deregister(struct ctdb_reply_control
*reply
);
593 void ctdb_req_control_vacuum_fetch(struct ctdb_req_control
*request
,
594 struct ctdb_rec_buffer
*recbuf
);
595 int ctdb_reply_control_vacuum_fetch(struct ctdb_reply_control
*reply
);
597 void ctdb_req_control_db_vacuum(struct ctdb_req_control
*request
,
598 struct ctdb_db_vacuum
*db_vacuum
);
599 int ctdb_reply_control_db_vacuum(struct ctdb_reply_control
*reply
);
601 void ctdb_req_control_echo_data(struct ctdb_req_control
*request
,
602 struct ctdb_echo_data
*echo_data
);
603 int ctdb_reply_control_echo_data(struct ctdb_reply_control
*reply
);
605 void ctdb_req_control_disable_node(struct ctdb_req_control
*request
);
606 int ctdb_reply_control_disable_node(struct ctdb_reply_control
*reply
);
608 void ctdb_req_control_enable_node(struct ctdb_req_control
*request
);
609 int ctdb_reply_control_enable_node(struct ctdb_reply_control
*reply
);
611 void ctdb_req_control_start_ipreallocate(struct ctdb_req_control
*request
);
612 int ctdb_reply_control_start_ipreallocate(struct ctdb_reply_control
*reply
);
614 /* From protocol/protocol_debug.c */
616 void ctdb_packet_print(uint8_t *buf
, size_t buflen
, FILE *fp
);
618 /* From protocol/protocol_message.c */
620 size_t ctdb_req_message_len(struct ctdb_req_header
*h
,
621 struct ctdb_req_message
*c
);
623 int ctdb_req_message_push(struct ctdb_req_header
*h
,
624 struct ctdb_req_message
*c
,
625 uint8_t *buf
, size_t *buflen
);
627 int ctdb_req_message_pull(uint8_t *buf
, size_t buflen
,
628 struct ctdb_req_header
*h
,
630 struct ctdb_req_message
*c
);
632 size_t ctdb_req_message_data_len(struct ctdb_req_header
*h
,
633 struct ctdb_req_message_data
*c
);
635 int ctdb_req_message_data_push(struct ctdb_req_header
*h
,
636 struct ctdb_req_message_data
*c
,
637 uint8_t *buf
, size_t *buflen
);
639 int ctdb_req_message_data_pull(uint8_t *buf
, size_t buflen
,
640 struct ctdb_req_header
*h
,
642 struct ctdb_req_message_data
*c
);
644 /* From protocol/protocol_keepalive.c */
646 size_t ctdb_req_keepalive_len(struct ctdb_req_header
*h
,
647 struct ctdb_req_keepalive
*c
);
649 int ctdb_req_keepalive_push(struct ctdb_req_header
*h
,
650 struct ctdb_req_keepalive
*c
,
651 uint8_t *buf
, size_t *buflen
);
653 int ctdb_req_keepalive_pull(uint8_t *buf
, size_t buflen
,
654 struct ctdb_req_header
*h
,
656 struct ctdb_req_keepalive
*c
);
658 /* From protocol/protocol_tunnel.c */
660 size_t ctdb_req_tunnel_len(struct ctdb_req_header
*h
,
661 struct ctdb_req_tunnel
*c
);
663 int ctdb_req_tunnel_push(struct ctdb_req_header
*h
,
664 struct ctdb_req_tunnel
*c
,
665 uint8_t *buf
, size_t *buflen
);
667 int ctdb_req_tunnel_pull(uint8_t *buf
, size_t buflen
,
668 struct ctdb_req_header
*h
,
670 struct ctdb_req_tunnel
*c
);
672 /* From protocol/protocol_packet.c */
674 int ctdb_allocate_pkt(TALLOC_CTX
*mem_ctx
, size_t datalen
,
675 uint8_t **buf
, size_t *buflen
);
677 /* From protocol/protocol_sock.c */
679 size_t sock_packet_header_len(struct sock_packet_header
*in
);
680 void sock_packet_header_push(struct sock_packet_header
*in
, uint8_t *buf
,
682 int sock_packet_header_pull(uint8_t *buf
, size_t buflen
,
683 struct sock_packet_header
*out
, size_t *npull
);
685 void sock_packet_header_set_reqid(struct sock_packet_header
*h
,
687 void sock_packet_header_set_length(struct sock_packet_header
*h
,
690 #endif /* __CTDB_PROTOCOL_API_H__ */