s3:tests: Add test for changing the local user password with smbpasswd
[Samba.git] / ctdb / protocol / protocol_api.h
blob75ded4f350bdbdb37f873815941d833a0537cb89
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 *header);
30 void ctdb_ltdb_header_push(struct ctdb_ltdb_header *header, uint8_t *buf);
31 int ctdb_ltdb_header_pull(uint8_t *buf, size_t buflen,
32 struct ctdb_ltdb_header *header);
34 int ctdb_ltdb_header_extract(TDB_DATA *data, struct ctdb_ltdb_header *header);
36 size_t ctdb_rec_data_len(struct ctdb_rec_data *rec);
37 void ctdb_rec_data_push(struct ctdb_rec_data *rec, uint8_t *buf);
38 int ctdb_rec_data_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
39 struct ctdb_rec_data **out);
41 size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer *recbuf);
42 void ctdb_rec_buffer_push(struct ctdb_rec_buffer *recbuf, uint8_t *buf);
43 int ctdb_rec_buffer_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
44 struct ctdb_rec_buffer **out);
46 struct ctdb_rec_buffer *ctdb_rec_buffer_init(TALLOC_CTX *mem_ctx,
47 uint32_t db_id);
48 int ctdb_rec_buffer_add(TALLOC_CTX *mem_ctx, struct ctdb_rec_buffer *recbuf,
49 uint32_t reqid, struct ctdb_ltdb_header *header,
50 TDB_DATA key, TDB_DATA data);
51 int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer *recbuf,
52 ctdb_rec_parser_func_t func,
53 void *private_data);
55 int ctdb_rec_buffer_write(struct ctdb_rec_buffer *recbuf, int fd);
56 int ctdb_rec_buffer_read(int fd, TALLOC_CTX *mem_ctx,
57 struct ctdb_rec_buffer **out);
59 size_t ctdb_server_id_len(struct ctdb_server_id *sid);
60 void ctdb_server_id_push(struct ctdb_server_id *sid, uint8_t *buf);
61 int ctdb_server_id_pull(uint8_t *buf, size_t buflen,
62 struct ctdb_server_id *sid);
64 size_t ctdb_g_lock_len(struct ctdb_g_lock *lock);
65 void ctdb_g_lock_push(struct ctdb_g_lock *lock, uint8_t *buf);
66 int ctdb_g_lock_pull(uint8_t *buf, size_t buflen, struct ctdb_g_lock *lock);
68 size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list *lock_list);
69 void ctdb_g_lock_list_push(struct ctdb_g_lock_list *lock_list, uint8_t *buf);
70 int ctdb_g_lock_list_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
71 struct ctdb_g_lock_list **out);
73 /* From protocol/protocol_header.c */
75 void ctdb_req_header_fill(struct ctdb_req_header *h, uint32_t generation,
76 uint32_t operation, uint32_t destnode,
77 uint32_t srcnode, uint32_t reqid);
79 size_t ctdb_req_header_len(struct ctdb_req_header *h);
80 void ctdb_req_header_push(struct ctdb_req_header *h, uint8_t *buf);
81 int ctdb_req_header_pull(uint8_t *buf, size_t buflen,
82 struct ctdb_req_header *h);
84 int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
86 /* From protocol/protocol_call.c */
88 size_t ctdb_req_call_len(struct ctdb_req_header *h,
89 struct ctdb_req_call *c);
91 int ctdb_req_call_push(struct ctdb_req_header *h,
92 struct ctdb_req_call *c,
93 uint8_t *buf, size_t *buflen);
95 int ctdb_req_call_pull(uint8_t *buf, size_t buflen,
96 struct ctdb_req_header *h,
97 TALLOC_CTX *mem_ctx,
98 struct ctdb_req_call *c);
100 size_t ctdb_reply_call_len(struct ctdb_req_header *h,
101 struct ctdb_reply_call *c);
103 int ctdb_reply_call_push(struct ctdb_req_header *h,
104 struct ctdb_reply_call *c,
105 uint8_t *buf, size_t *buflen);
107 int ctdb_reply_call_pull(uint8_t *buf, size_t buflen,
108 struct ctdb_req_header *h,
109 TALLOC_CTX *mem_ctx,
110 struct ctdb_reply_call *c);
112 size_t ctdb_reply_error_len(struct ctdb_req_header *h,
113 struct ctdb_reply_error *c);
115 int ctdb_reply_error_push(struct ctdb_req_header *h,
116 struct ctdb_reply_error *c,
117 uint8_t *buf, size_t *buflen);
119 int ctdb_reply_error_pull(uint8_t *buf, size_t buflen,
120 struct ctdb_req_header *h,
121 TALLOC_CTX *mem_ctx,
122 struct ctdb_reply_error *c);
124 size_t ctdb_req_dmaster_len(struct ctdb_req_header *h,
125 struct ctdb_req_dmaster *c);
127 int ctdb_req_dmaster_push(struct ctdb_req_header *h,
128 struct ctdb_req_dmaster *c,
129 uint8_t *buf, size_t *buflen);
131 int ctdb_req_dmaster_pull(uint8_t *buf, size_t buflen,
132 struct ctdb_req_header *h,
133 TALLOC_CTX *mem_ctx,
134 struct ctdb_req_dmaster *c);
136 size_t ctdb_reply_dmaster_len(struct ctdb_req_header *h,
137 struct ctdb_reply_dmaster *c);
139 int ctdb_reply_dmaster_push(struct ctdb_req_header *h,
140 struct ctdb_reply_dmaster *c,
141 uint8_t *buf, size_t *buflen);
143 int ctdb_reply_dmaster_pull(uint8_t *buf, size_t buflen,
144 struct ctdb_req_header *h,
145 TALLOC_CTX *mem_ctx,
146 struct ctdb_reply_dmaster *c);
148 /* From protocol/protocol_control.c */
150 size_t ctdb_req_control_len(struct ctdb_req_header *h,
151 struct ctdb_req_control *c);
153 int ctdb_req_control_push(struct ctdb_req_header *h,
154 struct ctdb_req_control *c,
155 uint8_t *buf, size_t *buflen);
157 int ctdb_req_control_pull(uint8_t *buf, size_t buflen,
158 struct ctdb_req_header *h,
159 TALLOC_CTX *mem_ctx,
160 struct ctdb_req_control *c);
162 size_t ctdb_reply_control_len(struct ctdb_req_header *h,
163 struct ctdb_reply_control *c);
165 int ctdb_reply_control_push(struct ctdb_req_header *h,
166 struct ctdb_reply_control *c,
167 uint8_t *buf, size_t *buflen);
169 int ctdb_reply_control_pull(uint8_t *buf, size_t buflen, uint32_t opcode,
170 struct ctdb_req_header *h,
171 TALLOC_CTX *mem_ctx,
172 struct ctdb_reply_control *c);
174 /* From protocol/protocol_client.c */
176 void ctdb_req_control_process_exists(struct ctdb_req_control *request,
177 pid_t pid);
178 int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
179 int *status);
181 void ctdb_req_control_statistics(struct ctdb_req_control *request);
183 int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
184 TALLOC_CTX *mem_ctx,
185 struct ctdb_statistics **stats);
187 void ctdb_req_control_ping(struct ctdb_req_control *request);
188 int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
189 int *num_clients);
191 void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
192 uint32_t db_id);
193 int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
194 TALLOC_CTX *mem_ctx, const char **db_path);
196 void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
197 int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
198 TALLOC_CTX *mem_ctx,
199 struct ctdb_vnn_map **vnnmap);
201 void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
202 struct ctdb_vnn_map *vnnmap);
203 int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
205 void ctdb_req_control_get_debug(struct ctdb_req_control *request);
206 int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
207 int *debug_level);
209 void ctdb_req_control_set_debug(struct ctdb_req_control *request,
210 int debug_level);
211 int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
213 void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
214 int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
215 TALLOC_CTX *mem_ctx,
216 struct ctdb_dbid_map **dbmap);
218 void ctdb_req_control_pull_db(struct ctdb_req_control *request,
219 struct ctdb_pulldb *pulldb);
220 int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply,
221 TALLOC_CTX *mem_ctx,
222 struct ctdb_rec_buffer **recbuf);
224 void ctdb_req_control_push_db(struct ctdb_req_control *request,
225 struct ctdb_rec_buffer *recbuf);
226 int ctdb_reply_control_push_db(struct ctdb_reply_control *reply);
228 void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
229 int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
230 int *recmode);
232 void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
233 int recmode);
234 int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
236 void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
237 int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
239 void ctdb_req_control_db_attach(struct ctdb_req_control *request,
240 const char *db_name);
241 int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
242 uint32_t *db_id);
244 void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
245 struct ctdb_traverse_start *traverse);
246 int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
248 void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
249 uint64_t srvid);
250 int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
252 void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
253 uint64_t srvid);
254 int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
256 void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
257 uint32_t db_id);
258 int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
259 TALLOC_CTX *mem_ctx, const char **db_name);
261 void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
262 uint32_t db_id);
263 int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
265 void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
266 uint32_t db_id);
267 int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
269 void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
270 int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
271 TALLOC_CTX *mem_ctx, const char **mem_str);
273 void ctdb_req_control_get_pid(struct ctdb_req_control *request);
274 int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
275 pid_t *pid);
277 void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
278 int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
279 uint32_t *recmaster);
281 void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
282 int recmaster);
283 int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
285 void ctdb_req_control_freeze(struct ctdb_req_control *request,
286 uint32_t priority);
287 int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
289 void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
290 int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
291 uint32_t *pnn);
293 void ctdb_req_control_shutdown(struct ctdb_req_control *request);
294 int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
296 void ctdb_req_control_get_monmode(struct ctdb_req_control *request);
297 int ctdb_reply_control_get_monmode(struct ctdb_reply_control *reply,
298 int *mon_mode);
300 void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
301 struct ctdb_connection *conn);
302 int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
304 void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
305 struct ctdb_connection *conn);
306 int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
308 void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
309 struct ctdb_connection *conn);
310 int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
312 void ctdb_req_control_startup(struct ctdb_req_control *request);
313 int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
315 void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
316 struct ctdb_tunable *tunable);
317 int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
319 void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
320 const char *name);
321 int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
322 uint32_t *value);
324 void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
325 int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
326 TALLOC_CTX *mem_ctx,
327 struct ctdb_var_list **tun_var_list);
329 void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
330 struct ctdb_node_flag_change *flag_change);
331 int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
333 void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
334 int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
335 TALLOC_CTX *mem_ctx,
336 struct ctdb_tunable_list **tun_list);
338 void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
339 ctdb_sock_addr *addr);
340 int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
341 TALLOC_CTX *mem_ctx,
342 struct ctdb_tickle_list **tickles);
344 void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
345 struct ctdb_tickle_list *tickles);
346 int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
348 void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
349 const char *name);
350 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
351 uint32_t *db_id);
353 void ctdb_req_control_update_record(struct ctdb_req_control *request,
354 struct ctdb_rec_buffer *recbuf);
355 int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
357 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
358 struct ctdb_addr_info *addr_info);
359 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
361 void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
362 struct ctdb_transdb *transdb);
363 int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
365 void ctdb_req_control_uptime(struct ctdb_req_control *request);
366 int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
367 TALLOC_CTX *mem_ctx,
368 struct ctdb_uptime **uptime);
370 void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
371 int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
373 void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
374 int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
376 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
377 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
379 void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
380 struct ctdb_rec_buffer *recbuf);
381 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
382 TALLOC_CTX *mem_ctx,
383 struct ctdb_rec_buffer **recbuf);
385 void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
386 int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
388 void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
389 int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
391 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
392 struct ctdb_addr_info *addr_info);
393 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
395 void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
396 struct ctdb_addr_info *addr_info);
397 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
399 void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
400 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
401 uint32_t *caps);
403 void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
404 int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
406 void ctdb_req_control_release_ip(struct ctdb_req_control *request,
407 struct ctdb_public_ip *pubip);
408 int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
410 void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
411 struct ctdb_public_ip *pubip);
412 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
414 void ctdb_req_control_get_public_ips(struct ctdb_req_control *request,
415 bool available_only);
416 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
417 TALLOC_CTX *mem_ctx,
418 struct ctdb_public_ip_list **pubip_list);
420 void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
421 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
422 TALLOC_CTX *mem_ctx,
423 struct ctdb_node_map **nodemap);
425 void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
426 struct ctdb_traverse_start *traverse);
427 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
429 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
430 double reclock_latency);
431 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
433 void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
434 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
435 TALLOC_CTX *mem_ctx,
436 const char **reclock_file);
438 void ctdb_req_control_stop_node(struct ctdb_req_control *request);
439 int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
441 void ctdb_req_control_continue_node(struct ctdb_req_control *request);
442 int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
444 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
445 uint32_t lmaster_role);
446 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
448 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
449 uint32_t recmaster_role);
450 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
452 void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
453 struct ctdb_ban_state *ban_state);
454 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
456 void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
457 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
458 TALLOC_CTX *mem_ctx,
459 struct ctdb_ban_state **ban_state);
461 void ctdb_req_control_register_notify(struct ctdb_req_control *request,
462 struct ctdb_notify_data *notify);
463 int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
465 void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
466 uint64_t srvid);
467 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
469 void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
470 struct ctdb_rec_buffer *recbuf);
471 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
473 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
474 uint32_t db_id);
475 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
476 uint64_t *seqnum);
478 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
479 uint32_t db_id);
480 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
482 void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
483 uint32_t db_id);
484 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
485 TALLOC_CTX *mem_ctx,
486 const char **reason);
488 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
489 ctdb_sock_addr *addr);
490 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
491 TALLOC_CTX *mem_ctx,
492 struct ctdb_public_ip_info **ipinfo);
494 void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
495 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
496 TALLOC_CTX *mem_ctx,
497 struct ctdb_iface_list **iface_list);
499 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
500 struct ctdb_iface *iface);
501 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
503 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
504 struct ctdb_connection *conn);
505 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
507 void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
508 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
509 TALLOC_CTX *mem_ctx,
510 struct ctdb_statistics_list **stats_list);
512 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
513 struct ctdb_key_data *key);
514 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
516 void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
517 uint32_t db_id);
518 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
520 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
521 struct ctdb_traverse_start_ext *traverse);
522 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
524 void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
525 uint32_t db_id);
526 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
527 TALLOC_CTX *mem_ctx,
528 struct ctdb_db_statistics **dbstats);
530 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
531 uint32_t db_id);
532 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
534 void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
535 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
537 void ctdb_req_control_receive_records(struct ctdb_req_control *request,
538 struct ctdb_rec_buffer *recbuf);
539 int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
540 TALLOC_CTX *mem_ctx,
541 struct ctdb_rec_buffer **recbuf);
543 void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
544 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
546 void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
547 int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
548 enum ctdb_runstate *runstate);
550 void ctdb_req_control_db_detach(struct ctdb_req_control *request,
551 uint32_t db_id);
552 int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
554 void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
555 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
556 TALLOC_CTX *mem_ctx,
557 struct ctdb_node_map **nodemap);
559 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
560 uint32_t db_id);
561 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
563 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
564 uint32_t db_id);
565 int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
567 void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
568 struct ctdb_transdb *transdb);
569 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
571 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
572 struct ctdb_transdb *transdb);
573 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
575 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
576 uint32_t db_id);
577 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
579 void ctdb_req_control_db_pull(struct ctdb_req_control *request,
580 struct ctdb_pulldb_ext *pulldb_ext);
581 int ctdb_reply_control_db_pull(struct ctdb_reply_control *reply,
582 uint32_t *num_records);
584 void ctdb_req_control_db_push_start(struct ctdb_req_control *request,
585 struct ctdb_pulldb_ext *pulldb_ext);
586 int ctdb_reply_control_db_push_start(struct ctdb_reply_control *reply);
588 void ctdb_req_control_db_push_confirm(struct ctdb_req_control *request,
589 uint32_t db_id);
590 int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control *reply,
591 uint32_t *num_records);
593 void ctdb_req_control_db_open_flags(struct ctdb_req_control *request,
594 uint32_t db_id);
595 int ctdb_reply_control_db_open_flags(struct ctdb_reply_control *reply,
596 int *tdb_flags);
598 void ctdb_req_control_db_attach_replicated(struct ctdb_req_control *request,
599 const char *db_name);
600 int ctdb_reply_control_db_attach_replicated(struct ctdb_reply_control *reply,
601 uint32_t *db_id);
603 /* From protocol/protocol_debug.c */
605 void ctdb_packet_print(uint8_t *buf, size_t buflen, FILE *fp);
607 /* From protocol/protocol_message.c */
609 size_t ctdb_req_message_len(struct ctdb_req_header *h,
610 struct ctdb_req_message *c);
612 int ctdb_req_message_push(struct ctdb_req_header *h,
613 struct ctdb_req_message *c,
614 uint8_t *buf, size_t *buflen);
616 int ctdb_req_message_pull(uint8_t *buf, size_t buflen,
617 struct ctdb_req_header *h,
618 TALLOC_CTX *mem_ctx,
619 struct ctdb_req_message *c);
621 size_t ctdb_req_message_data_len(struct ctdb_req_header *h,
622 struct ctdb_req_message_data *c);
624 int ctdb_req_message_data_push(struct ctdb_req_header *h,
625 struct ctdb_req_message_data *c,
626 uint8_t *buf, size_t *buflen);
628 int ctdb_req_message_data_pull(uint8_t *buf, size_t buflen,
629 struct ctdb_req_header *h,
630 TALLOC_CTX *mem_ctx,
631 struct ctdb_req_message_data *c);
633 /* From protocol/protocol_event.c */
635 void ctdb_event_header_fill(struct ctdb_event_header *h, uint32_t reqid);
637 size_t ctdb_event_request_len(struct ctdb_event_request *in);
639 int ctdb_event_request_push(struct ctdb_event_request *in,
640 uint8_t *buf, size_t *buflen);
642 int ctdb_event_request_pull(uint8_t *buf, size_t buflen,
643 TALLOC_CTX *mem_ctx,
644 struct ctdb_event_request *out);
646 size_t ctdb_event_reply_len(struct ctdb_event_reply *in);
648 int ctdb_event_reply_push(struct ctdb_event_reply *in,
649 uint8_t *buf, size_t *buflen);
651 int ctdb_event_reply_pull(uint8_t *buf, size_t buflen,
652 TALLOC_CTX *mem_ctx,
653 struct ctdb_event_reply *out);
655 /* From protocol/protocol_packet.c */
657 int ctdb_allocate_pkt(TALLOC_CTX *mem_ctx, size_t datalen,
658 uint8_t **buf, size_t *buflen);
660 /* From protocol/protocol_util.c */
662 const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
663 enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
665 const char *ctdb_event_to_string(enum ctdb_event event);
666 enum ctdb_event ctdb_event_from_string(const char *event_str);
668 const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
669 int ctdb_sock_addr_cmp_ip(const ctdb_sock_addr *addr1,
670 const ctdb_sock_addr *addr2);
671 int ctdb_sock_addr_cmp(const ctdb_sock_addr *addr1,
672 const ctdb_sock_addr *addr2);
673 bool ctdb_sock_addr_same_ip(const ctdb_sock_addr *addr1,
674 const ctdb_sock_addr *addr2);
675 bool ctdb_sock_addr_same(const ctdb_sock_addr *addr1,
676 const ctdb_sock_addr *addr2);
678 #endif /* __CTDB_PROTOCOL_API_H__ */