vfs_ceph_new: handle case of readlinkat with empty name string
[Samba.git] / ctdb / protocol / protocol_api.h
blobc7aa94fe9bc56ce74f9f2592ef092670f4ab1d9d
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_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,
49 size_t *npush);
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,
54 uint32_t db_id);
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,
60 void *private_data);
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,
68 size_t *npush);
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,
75 size_t *npull);
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,
79 size_t *npush);
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,
91 size_t *npush);
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,
108 TALLOC_CTX *mem_ctx,
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,
120 TALLOC_CTX *mem_ctx,
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,
132 TALLOC_CTX *mem_ctx,
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,
144 TALLOC_CTX *mem_ctx,
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,
156 TALLOC_CTX *mem_ctx,
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,
170 TALLOC_CTX *mem_ctx,
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,
182 TALLOC_CTX *mem_ctx,
183 struct ctdb_reply_control *c);
185 /* From protocol/protocol_client.c */
187 void ctdb_req_control_process_exists(struct ctdb_req_control *request,
188 pid_t pid);
189 int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
190 int *status);
192 void ctdb_req_control_statistics(struct ctdb_req_control *request);
194 int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
195 TALLOC_CTX *mem_ctx,
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,
200 int *num_clients);
202 void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
203 uint32_t db_id);
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,
209 TALLOC_CTX *mem_ctx,
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,
218 int *debug_level);
220 void ctdb_req_control_set_debug(struct ctdb_req_control *request,
221 int debug_level);
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,
226 TALLOC_CTX *mem_ctx,
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,
231 int *recmode);
233 void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
234 int recmode);
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,
243 uint32_t *db_id);
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,
250 uint64_t srvid);
251 int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
253 void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
254 uint64_t srvid);
255 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
257 void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
258 uint32_t db_id);
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,
263 uint32_t db_id);
264 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
266 void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
267 uint32_t db_id);
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,
276 pid_t *pid);
278 void ctdb_req_control_freeze(struct ctdb_req_control *request,
279 uint32_t priority);
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,
284 uint32_t *pnn);
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,
309 const char *name);
310 int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
311 uint32_t *value);
313 void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
314 int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
315 TALLOC_CTX *mem_ctx,
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,
324 TALLOC_CTX *mem_ctx,
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,
330 TALLOC_CTX *mem_ctx,
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,
338 const char *name);
339 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
340 uint32_t *db_id);
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,
356 TALLOC_CTX *mem_ctx,
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,
371 TALLOC_CTX *mem_ctx,
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,
384 uint32_t *caps);
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,
400 TALLOC_CTX *mem_ctx,
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,
405 TALLOC_CTX *mem_ctx,
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,
418 TALLOC_CTX *mem_ctx,
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,
441 TALLOC_CTX *mem_ctx,
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,
449 uint64_t srvid);
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,
457 uint32_t db_id);
458 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
459 uint64_t *seqnum);
461 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
462 uint32_t db_id);
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,
466 uint32_t db_id);
467 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
468 TALLOC_CTX *mem_ctx,
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,
474 TALLOC_CTX *mem_ctx,
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,
479 TALLOC_CTX *mem_ctx,
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,
492 TALLOC_CTX *mem_ctx,
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,
500 uint32_t db_id);
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,
508 uint32_t db_id);
509 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
510 TALLOC_CTX *mem_ctx,
511 struct ctdb_db_statistics **dbstats);
513 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
514 uint32_t db_id);
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,
528 uint32_t db_id);
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,
533 TALLOC_CTX *mem_ctx,
534 struct ctdb_node_map **nodemap);
536 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
537 uint32_t db_id);
538 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
540 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
541 uint32_t db_id);
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,
553 uint32_t db_id);
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,
566 uint32_t db_id);
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,
571 uint32_t db_id);
572 int ctdb_reply_control_db_open_flags(struct ctdb_reply_control *reply,
573 int *tdb_flags);
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,
578 uint32_t *db_id);
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,
583 int *status);
585 void ctdb_req_control_tunnel_register(struct ctdb_req_control *request,
586 uint64_t tunnel_id);
587 int ctdb_reply_control_tunnel_register(struct ctdb_reply_control *reply);
589 void ctdb_req_control_tunnel_deregister(struct ctdb_req_control *request,
590 uint64_t tunnel_id);
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,
629 TALLOC_CTX *mem_ctx,
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,
641 TALLOC_CTX *mem_ctx,
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,
655 TALLOC_CTX *mem_ctx,
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,
669 TALLOC_CTX *mem_ctx,
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,
681 size_t *npush);
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,
686 uint32_t reqid);
687 void sock_packet_header_set_length(struct sock_packet_header *h,
688 uint32_t length);
690 #endif /* __CTDB_PROTOCOL_API_H__ */