provision: Add support for BIND 9.16.x
[samba.git] / ctdb / protocol / protocol_api.h
blob7bbe33b22fe06dcd2113e5c4884208923fce875c
1 /*
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 <talloc.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,
31 size_t *npush);
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_rec_data_len(struct ctdb_rec_data *in);
38 void ctdb_rec_data_push(struct ctdb_rec_data *in, uint8_t *buf, size_t *npush);
39 int ctdb_rec_data_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
40 struct ctdb_rec_data **out, size_t *npull);
42 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer *in);
43 void ctdb_rec_buffer_push(struct ctdb_rec_buffer *in, uint8_t *buf,
44 size_t *npush);
45 int ctdb_rec_buffer_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
46 struct ctdb_rec_buffer **out, size_t *npull);
48 struct ctdb_rec_buffer *ctdb_rec_buffer_init(TALLOC_CTX *mem_ctx,
49 uint32_t db_id);
50 int ctdb_rec_buffer_add(TALLOC_CTX *mem_ctx, struct ctdb_rec_buffer *recbuf,
51 uint32_t reqid, struct ctdb_ltdb_header *header,
52 TDB_DATA key, TDB_DATA data);
53 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer *recbuf,
54 ctdb_rec_parser_func_t func,
55 void *private_data);
57 int ctdb_rec_buffer_write(struct ctdb_rec_buffer *recbuf, int fd);
58 int ctdb_rec_buffer_read(int fd, TALLOC_CTX *mem_ctx,
59 struct ctdb_rec_buffer **out);
61 size_t ctdb_server_id_len(struct ctdb_server_id *in);
62 void ctdb_server_id_push(struct ctdb_server_id *in, uint8_t *buf,
63 size_t *npush);
64 int ctdb_server_id_pull(uint8_t *buf, size_t buflen,
65 struct ctdb_server_id *out, size_t *npull);
67 size_t ctdb_g_lock_len(struct ctdb_g_lock *in);
68 void ctdb_g_lock_push(struct ctdb_g_lock *in, uint8_t *buf, size_t *npush);
69 int ctdb_g_lock_pull(uint8_t *buf, size_t buflen, struct ctdb_g_lock *out,
70 size_t *npull);
72 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list *in);
73 void ctdb_g_lock_list_push(struct ctdb_g_lock_list *in, uint8_t *buf,
74 size_t *npush);
75 int ctdb_g_lock_list_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
76 struct ctdb_g_lock_list **out, size_t *npull);
78 /* From protocol/protocol_header.c */
80 void ctdb_req_header_fill(struct ctdb_req_header *h, uint32_t generation,
81 uint32_t operation, uint32_t destnode,
82 uint32_t srcnode, uint32_t reqid);
84 size_t ctdb_req_header_len(struct ctdb_req_header *in);
85 void ctdb_req_header_push(struct ctdb_req_header *in, uint8_t *buf,
86 size_t *npush);
87 int ctdb_req_header_pull(uint8_t *buf, size_t buflen,
88 struct ctdb_req_header *out, size_t *npull);
90 int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
92 /* From protocol/protocol_call.c */
94 size_t ctdb_req_call_len(struct ctdb_req_header *h,
95 struct ctdb_req_call *c);
97 int ctdb_req_call_push(struct ctdb_req_header *h,
98 struct ctdb_req_call *c,
99 uint8_t *buf, size_t *buflen);
101 int ctdb_req_call_pull(uint8_t *buf, size_t buflen,
102 struct ctdb_req_header *h,
103 TALLOC_CTX *mem_ctx,
104 struct ctdb_req_call *c);
106 size_t ctdb_reply_call_len(struct ctdb_req_header *h,
107 struct ctdb_reply_call *c);
109 int ctdb_reply_call_push(struct ctdb_req_header *h,
110 struct ctdb_reply_call *c,
111 uint8_t *buf, size_t *buflen);
113 int ctdb_reply_call_pull(uint8_t *buf, size_t buflen,
114 struct ctdb_req_header *h,
115 TALLOC_CTX *mem_ctx,
116 struct ctdb_reply_call *c);
118 size_t ctdb_reply_error_len(struct ctdb_req_header *h,
119 struct ctdb_reply_error *c);
121 int ctdb_reply_error_push(struct ctdb_req_header *h,
122 struct ctdb_reply_error *c,
123 uint8_t *buf, size_t *buflen);
125 int ctdb_reply_error_pull(uint8_t *buf, size_t buflen,
126 struct ctdb_req_header *h,
127 TALLOC_CTX *mem_ctx,
128 struct ctdb_reply_error *c);
130 size_t ctdb_req_dmaster_len(struct ctdb_req_header *h,
131 struct ctdb_req_dmaster *c);
133 int ctdb_req_dmaster_push(struct ctdb_req_header *h,
134 struct ctdb_req_dmaster *c,
135 uint8_t *buf, size_t *buflen);
137 int ctdb_req_dmaster_pull(uint8_t *buf, size_t buflen,
138 struct ctdb_req_header *h,
139 TALLOC_CTX *mem_ctx,
140 struct ctdb_req_dmaster *c);
142 size_t ctdb_reply_dmaster_len(struct ctdb_req_header *h,
143 struct ctdb_reply_dmaster *c);
145 int ctdb_reply_dmaster_push(struct ctdb_req_header *h,
146 struct ctdb_reply_dmaster *c,
147 uint8_t *buf, size_t *buflen);
149 int ctdb_reply_dmaster_pull(uint8_t *buf, size_t buflen,
150 struct ctdb_req_header *h,
151 TALLOC_CTX *mem_ctx,
152 struct ctdb_reply_dmaster *c);
154 /* From protocol/protocol_control.c */
156 size_t ctdb_req_control_len(struct ctdb_req_header *h,
157 struct ctdb_req_control *c);
159 int ctdb_req_control_push(struct ctdb_req_header *h,
160 struct ctdb_req_control *c,
161 uint8_t *buf, size_t *buflen);
163 int ctdb_req_control_pull(uint8_t *buf, size_t buflen,
164 struct ctdb_req_header *h,
165 TALLOC_CTX *mem_ctx,
166 struct ctdb_req_control *c);
168 size_t ctdb_reply_control_len(struct ctdb_req_header *h,
169 struct ctdb_reply_control *c);
171 int ctdb_reply_control_push(struct ctdb_req_header *h,
172 struct ctdb_reply_control *c,
173 uint8_t *buf, size_t *buflen);
175 int ctdb_reply_control_pull(uint8_t *buf, size_t buflen, uint32_t opcode,
176 struct ctdb_req_header *h,
177 TALLOC_CTX *mem_ctx,
178 struct ctdb_reply_control *c);
180 /* From protocol/protocol_client.c */
182 void ctdb_req_control_process_exists(struct ctdb_req_control *request,
183 pid_t pid);
184 int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
185 int *status);
187 void ctdb_req_control_statistics(struct ctdb_req_control *request);
189 int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
190 TALLOC_CTX *mem_ctx,
191 struct ctdb_statistics **stats);
193 void ctdb_req_control_ping(struct ctdb_req_control *request);
194 int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
195 int *num_clients);
197 void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
198 uint32_t db_id);
199 int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
200 TALLOC_CTX *mem_ctx, const char **db_path);
202 void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
203 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
204 TALLOC_CTX *mem_ctx,
205 struct ctdb_vnn_map **vnnmap);
207 void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
208 struct ctdb_vnn_map *vnnmap);
209 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
211 void ctdb_req_control_get_debug(struct ctdb_req_control *request);
212 int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
213 int *debug_level);
215 void ctdb_req_control_set_debug(struct ctdb_req_control *request,
216 int debug_level);
217 int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
219 void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
220 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
221 TALLOC_CTX *mem_ctx,
222 struct ctdb_dbid_map **dbmap);
224 void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
225 int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
226 int *recmode);
228 void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
229 int recmode);
230 int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
232 void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
233 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
235 void ctdb_req_control_db_attach(struct ctdb_req_control *request,
236 const char *db_name);
237 int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
238 uint32_t *db_id);
240 void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
241 struct ctdb_traverse_start *traverse);
242 int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
244 void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
245 uint64_t srvid);
246 int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
248 void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
249 uint64_t srvid);
250 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
252 void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
253 uint32_t db_id);
254 int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
255 TALLOC_CTX *mem_ctx, const char **db_name);
257 void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
258 uint32_t db_id);
259 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
261 void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
262 uint32_t db_id);
263 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
265 void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
266 int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
267 TALLOC_CTX *mem_ctx, const char **mem_str);
269 void ctdb_req_control_get_pid(struct ctdb_req_control *request);
270 int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
271 pid_t *pid);
273 void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
274 int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
275 uint32_t *recmaster);
277 void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
278 int recmaster);
279 int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
281 void ctdb_req_control_freeze(struct ctdb_req_control *request,
282 uint32_t priority);
283 int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
285 void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
286 int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
287 uint32_t *pnn);
289 void ctdb_req_control_shutdown(struct ctdb_req_control *request);
290 int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
292 void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
293 struct ctdb_connection *conn);
294 int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
296 void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
297 struct ctdb_connection *conn);
298 int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
300 void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
301 struct ctdb_connection *conn);
302 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
304 void ctdb_req_control_startup(struct ctdb_req_control *request);
305 int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
307 void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
308 struct ctdb_tunable *tunable);
309 int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
311 void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
312 const char *name);
313 int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
314 uint32_t *value);
316 void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
317 int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
318 TALLOC_CTX *mem_ctx,
319 struct ctdb_var_list **tun_var_list);
321 void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
322 struct ctdb_node_flag_change *flag_change);
323 int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
325 void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
326 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
327 TALLOC_CTX *mem_ctx,
328 struct ctdb_tunable_list **tun_list);
330 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
331 ctdb_sock_addr *addr);
332 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
333 TALLOC_CTX *mem_ctx,
334 struct ctdb_tickle_list **tickles);
336 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
337 struct ctdb_tickle_list *tickles);
338 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
340 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
341 const char *name);
342 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
343 uint32_t *db_id);
345 void ctdb_req_control_update_record(struct ctdb_req_control *request,
346 struct ctdb_rec_buffer *recbuf);
347 int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
349 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
350 struct ctdb_addr_info *addr_info);
351 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
353 void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
354 struct ctdb_transdb *transdb);
355 int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
357 void ctdb_req_control_uptime(struct ctdb_req_control *request);
358 int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
359 TALLOC_CTX *mem_ctx,
360 struct ctdb_uptime **uptime);
362 void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
363 int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
365 void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
366 int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
368 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
369 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
371 void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
372 struct ctdb_rec_buffer *recbuf);
373 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
374 TALLOC_CTX *mem_ctx,
375 struct ctdb_rec_buffer **recbuf);
377 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
378 struct ctdb_addr_info *addr_info);
379 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
381 void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
382 struct ctdb_addr_info *addr_info);
383 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
385 void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
386 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
387 uint32_t *caps);
389 void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
390 int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
392 void ctdb_req_control_release_ip(struct ctdb_req_control *request,
393 struct ctdb_public_ip *pubip);
394 int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
396 void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
397 struct ctdb_public_ip *pubip);
398 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
400 void ctdb_req_control_get_public_ips(struct ctdb_req_control *request,
401 bool available_only);
402 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
403 TALLOC_CTX *mem_ctx,
404 struct ctdb_public_ip_list **pubip_list);
406 void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
407 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
408 TALLOC_CTX *mem_ctx,
409 struct ctdb_node_map **nodemap);
411 void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
412 struct ctdb_traverse_start *traverse);
413 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
415 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
416 double reclock_latency);
417 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
419 void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
420 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
421 TALLOC_CTX *mem_ctx,
422 const char **reclock_file);
424 void ctdb_req_control_stop_node(struct ctdb_req_control *request);
425 int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
427 void ctdb_req_control_continue_node(struct ctdb_req_control *request);
428 int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
430 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
431 uint32_t lmaster_role);
432 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
434 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
435 uint32_t recmaster_role);
436 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
438 void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
439 struct ctdb_ban_state *ban_state);
440 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
442 void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
443 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
444 TALLOC_CTX *mem_ctx,
445 struct ctdb_ban_state **ban_state);
447 void ctdb_req_control_register_notify(struct ctdb_req_control *request,
448 struct ctdb_notify_data *notify);
449 int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
451 void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
452 uint64_t srvid);
453 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
455 void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
456 struct ctdb_rec_buffer *recbuf);
457 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
459 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
460 uint32_t db_id);
461 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
462 uint64_t *seqnum);
464 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
465 uint32_t db_id);
466 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
468 void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
469 uint32_t db_id);
470 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
471 TALLOC_CTX *mem_ctx,
472 const char **reason);
474 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
475 ctdb_sock_addr *addr);
476 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
477 TALLOC_CTX *mem_ctx,
478 struct ctdb_public_ip_info **ipinfo);
480 void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
481 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
482 TALLOC_CTX *mem_ctx,
483 struct ctdb_iface_list **iface_list);
485 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
486 struct ctdb_iface *iface);
487 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
489 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
490 struct ctdb_connection *conn);
491 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
493 void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
494 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
495 TALLOC_CTX *mem_ctx,
496 struct ctdb_statistics_list **stats_list);
498 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
499 struct ctdb_key_data *key);
500 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
502 void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
503 uint32_t db_id);
504 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
506 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
507 struct ctdb_traverse_start_ext *traverse);
508 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
510 void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
511 uint32_t db_id);
512 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
513 TALLOC_CTX *mem_ctx,
514 struct ctdb_db_statistics **dbstats);
516 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
517 uint32_t db_id);
518 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
520 void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
521 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
523 void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
524 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
526 void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
527 int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
528 enum ctdb_runstate *runstate);
530 void ctdb_req_control_db_detach(struct ctdb_req_control *request,
531 uint32_t db_id);
532 int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
534 void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
535 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
536 TALLOC_CTX *mem_ctx,
537 struct ctdb_node_map **nodemap);
539 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
540 uint32_t db_id);
541 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
543 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
544 uint32_t db_id);
545 int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
547 void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
548 struct ctdb_transdb *transdb);
549 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
551 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
552 struct ctdb_transdb *transdb);
553 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
555 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
556 uint32_t db_id);
557 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
559 void ctdb_req_control_db_pull(struct ctdb_req_control *request,
560 struct ctdb_pulldb_ext *pulldb_ext);
561 int ctdb_reply_control_db_pull(struct ctdb_reply_control *reply,
562 uint32_t *num_records);
564 void ctdb_req_control_db_push_start(struct ctdb_req_control *request,
565 struct ctdb_pulldb_ext *pulldb_ext);
566 int ctdb_reply_control_db_push_start(struct ctdb_reply_control *reply);
568 void ctdb_req_control_db_push_confirm(struct ctdb_req_control *request,
569 uint32_t db_id);
570 int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control *reply,
571 uint32_t *num_records);
573 void ctdb_req_control_db_open_flags(struct ctdb_req_control *request,
574 uint32_t db_id);
575 int ctdb_reply_control_db_open_flags(struct ctdb_reply_control *reply,
576 int *tdb_flags);
578 void ctdb_req_control_db_attach_replicated(struct ctdb_req_control *request,
579 const char *db_name);
580 int ctdb_reply_control_db_attach_replicated(struct ctdb_reply_control *reply,
581 uint32_t *db_id);
583 void ctdb_req_control_check_pid_srvid(struct ctdb_req_control *request,
584 struct ctdb_pid_srvid *pid_srvid);
585 int ctdb_reply_control_check_pid_srvid(struct ctdb_reply_control *reply,
586 int *status);
588 void ctdb_req_control_tunnel_register(struct ctdb_req_control *request,
589 uint64_t tunnel_id);
590 int ctdb_reply_control_tunnel_register(struct ctdb_reply_control *reply);
592 void ctdb_req_control_tunnel_deregister(struct ctdb_req_control *request,
593 uint64_t tunnel_id);
594 int ctdb_reply_control_tunnel_deregister(struct ctdb_reply_control *reply);
596 void ctdb_req_control_vacuum_fetch(struct ctdb_req_control *request,
597 struct ctdb_rec_buffer *recbuf);
598 int ctdb_reply_control_vacuum_fetch(struct ctdb_reply_control *reply);
600 void ctdb_req_control_db_vacuum(struct ctdb_req_control *request,
601 struct ctdb_db_vacuum *db_vacuum);
602 int ctdb_reply_control_db_vacuum(struct ctdb_reply_control *reply);
604 void ctdb_req_control_echo_data(struct ctdb_req_control *request,
605 struct ctdb_echo_data *echo_data);
606 int ctdb_reply_control_echo_data(struct ctdb_reply_control *reply);
608 /* From protocol/protocol_debug.c */
610 void ctdb_packet_print(uint8_t *buf, size_t buflen, FILE *fp);
612 /* From protocol/protocol_message.c */
614 size_t ctdb_req_message_len(struct ctdb_req_header *h,
615 struct ctdb_req_message *c);
617 int ctdb_req_message_push(struct ctdb_req_header *h,
618 struct ctdb_req_message *c,
619 uint8_t *buf, size_t *buflen);
621 int ctdb_req_message_pull(uint8_t *buf, size_t buflen,
622 struct ctdb_req_header *h,
623 TALLOC_CTX *mem_ctx,
624 struct ctdb_req_message *c);
626 size_t ctdb_req_message_data_len(struct ctdb_req_header *h,
627 struct ctdb_req_message_data *c);
629 int ctdb_req_message_data_push(struct ctdb_req_header *h,
630 struct ctdb_req_message_data *c,
631 uint8_t *buf, size_t *buflen);
633 int ctdb_req_message_data_pull(uint8_t *buf, size_t buflen,
634 struct ctdb_req_header *h,
635 TALLOC_CTX *mem_ctx,
636 struct ctdb_req_message_data *c);
638 /* From protocol/protocol_keepalive.c */
640 size_t ctdb_req_keepalive_len(struct ctdb_req_header *h,
641 struct ctdb_req_keepalive *c);
643 int ctdb_req_keepalive_push(struct ctdb_req_header *h,
644 struct ctdb_req_keepalive *c,
645 uint8_t *buf, size_t *buflen);
647 int ctdb_req_keepalive_pull(uint8_t *buf, size_t buflen,
648 struct ctdb_req_header *h,
649 TALLOC_CTX *mem_ctx,
650 struct ctdb_req_keepalive *c);
652 /* From protocol/protocol_tunnel.c */
654 size_t ctdb_req_tunnel_len(struct ctdb_req_header *h,
655 struct ctdb_req_tunnel *c);
657 int ctdb_req_tunnel_push(struct ctdb_req_header *h,
658 struct ctdb_req_tunnel *c,
659 uint8_t *buf, size_t *buflen);
661 int ctdb_req_tunnel_pull(uint8_t *buf, size_t buflen,
662 struct ctdb_req_header *h,
663 TALLOC_CTX *mem_ctx,
664 struct ctdb_req_tunnel *c);
666 /* From protocol/protocol_packet.c */
668 int ctdb_allocate_pkt(TALLOC_CTX *mem_ctx, size_t datalen,
669 uint8_t **buf, size_t *buflen);
671 /* From protocol/protocol_sock.c */
673 size_t sock_packet_header_len(struct sock_packet_header *in);
674 void sock_packet_header_push(struct sock_packet_header *in, uint8_t *buf,
675 size_t *npush);
676 int sock_packet_header_pull(uint8_t *buf, size_t buflen,
677 struct sock_packet_header *out, size_t *npull);
679 void sock_packet_header_set_reqid(struct sock_packet_header *h,
680 uint32_t reqid);
681 void sock_packet_header_set_length(struct sock_packet_header *h,
682 uint32_t length);
684 #endif /* __CTDB_PROTOCOL_API_H__ */