ntlm_auth: Set ntlm_auth as the service_description into gensec
[Samba.git] / ctdb / protocol / protocol_api.h
blobdfb75d49e3523d8c4bbeb85910df0e90cd1a2b46
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, uint32_t tdb_flags);
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 uint32_t tdb_flags);
351 int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
352 uint32_t *db_id);
354 void ctdb_req_control_update_record(struct ctdb_req_control *request,
355 struct ctdb_rec_buffer *recbuf);
356 int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
358 void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
359 struct ctdb_addr_info *addr_info);
360 int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
362 void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
363 struct ctdb_transdb *transdb);
364 int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
366 void ctdb_req_control_uptime(struct ctdb_req_control *request);
367 int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
368 TALLOC_CTX *mem_ctx,
369 struct ctdb_uptime **uptime);
371 void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
372 int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
374 void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
375 int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
377 void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
378 int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
380 void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
381 struct ctdb_rec_buffer *recbuf);
382 int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
383 TALLOC_CTX *mem_ctx,
384 struct ctdb_rec_buffer **recbuf);
386 void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
387 int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
389 void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
390 int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
392 void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
393 struct ctdb_addr_info *addr_info);
394 int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
396 void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
397 struct ctdb_addr_info *addr_info);
398 int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
400 void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
401 int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
402 uint32_t *caps);
404 void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
405 int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
407 void ctdb_req_control_release_ip(struct ctdb_req_control *request,
408 struct ctdb_public_ip *pubip);
409 int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
411 void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
412 struct ctdb_public_ip *pubip);
413 int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
415 void ctdb_req_control_get_public_ips(struct ctdb_req_control *request,
416 bool available_only);
417 int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
418 TALLOC_CTX *mem_ctx,
419 struct ctdb_public_ip_list **pubip_list);
421 void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
422 int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
423 TALLOC_CTX *mem_ctx,
424 struct ctdb_node_map **nodemap);
426 void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
427 struct ctdb_traverse_start *traverse);
428 int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
430 void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
431 double reclock_latency);
432 int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
434 void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
435 int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
436 TALLOC_CTX *mem_ctx,
437 const char **reclock_file);
439 void ctdb_req_control_stop_node(struct ctdb_req_control *request);
440 int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
442 void ctdb_req_control_continue_node(struct ctdb_req_control *request);
443 int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
445 void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
446 uint32_t lmaster_role);
447 int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
449 void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
450 uint32_t recmaster_role);
451 int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
453 void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
454 struct ctdb_ban_state *ban_state);
455 int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
457 void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
458 int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
459 TALLOC_CTX *mem_ctx,
460 struct ctdb_ban_state **ban_state);
462 void ctdb_req_control_register_notify(struct ctdb_req_control *request,
463 struct ctdb_notify_data *notify);
464 int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
466 void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
467 uint64_t srvid);
468 int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
470 void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
471 struct ctdb_rec_buffer *recbuf);
472 int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
474 void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
475 uint32_t db_id);
476 int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
477 uint64_t *seqnum);
479 void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
480 uint32_t db_id);
481 int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
483 void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
484 uint32_t db_id);
485 int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
486 TALLOC_CTX *mem_ctx,
487 const char **reason);
489 void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
490 ctdb_sock_addr *addr);
491 int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
492 TALLOC_CTX *mem_ctx,
493 struct ctdb_public_ip_info **ipinfo);
495 void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
496 int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
497 TALLOC_CTX *mem_ctx,
498 struct ctdb_iface_list **iface_list);
500 void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
501 struct ctdb_iface *iface);
502 int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
504 void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
505 struct ctdb_connection *conn);
506 int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
508 void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
509 int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
510 TALLOC_CTX *mem_ctx,
511 struct ctdb_statistics_list **stats_list);
513 void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
514 struct ctdb_key_data *key);
515 int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
517 void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
518 uint32_t db_id);
519 int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
521 void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
522 struct ctdb_uint64_array *u64_array);
523 int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
524 TALLOC_CTX *mem_ctx,
525 struct ctdb_uint8_array **u8_array);
527 void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
528 struct ctdb_traverse_start_ext *traverse);
529 int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
531 void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
532 uint32_t db_id);
533 int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
534 TALLOC_CTX *mem_ctx,
535 struct ctdb_db_statistics **dbstats);
537 void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
538 uint32_t db_id);
539 int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
541 void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
542 int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
544 void ctdb_req_control_receive_records(struct ctdb_req_control *request,
545 struct ctdb_rec_buffer *recbuf);
546 int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
547 TALLOC_CTX *mem_ctx,
548 struct ctdb_rec_buffer **recbuf);
550 void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
551 int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
553 void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
554 int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
555 enum ctdb_runstate *runstate);
557 void ctdb_req_control_db_detach(struct ctdb_req_control *request,
558 uint32_t db_id);
559 int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
561 void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
562 int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
563 TALLOC_CTX *mem_ctx,
564 struct ctdb_node_map **nodemap);
566 void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
567 uint32_t db_id);
568 int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
570 void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
571 uint32_t db_id);
572 int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
574 void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
575 struct ctdb_transdb *transdb);
576 int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
578 void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
579 struct ctdb_transdb *transdb);
580 int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
582 void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
583 uint32_t db_id);
584 int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
586 void ctdb_req_control_db_pull(struct ctdb_req_control *request,
587 struct ctdb_pulldb_ext *pulldb_ext);
588 int ctdb_reply_control_db_pull(struct ctdb_reply_control *reply,
589 uint32_t *num_records);
591 void ctdb_req_control_db_push_start(struct ctdb_req_control *request,
592 struct ctdb_pulldb_ext *pulldb_ext);
593 int ctdb_reply_control_db_push_start(struct ctdb_reply_control *reply);
595 void ctdb_req_control_db_push_confirm(struct ctdb_req_control *request,
596 uint32_t db_id);
597 int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control *reply,
598 uint32_t *num_records);
600 /* From protocol/protocol_debug.c */
602 void ctdb_packet_print(uint8_t *buf, size_t buflen, FILE *fp);
604 /* From protocol/protocol_message.c */
606 size_t ctdb_req_message_len(struct ctdb_req_header *h,
607 struct ctdb_req_message *c);
609 int ctdb_req_message_push(struct ctdb_req_header *h,
610 struct ctdb_req_message *c,
611 uint8_t *buf, size_t *buflen);
613 int ctdb_req_message_pull(uint8_t *buf, size_t buflen,
614 struct ctdb_req_header *h,
615 TALLOC_CTX *mem_ctx,
616 struct ctdb_req_message *c);
618 size_t ctdb_req_message_data_len(struct ctdb_req_header *h,
619 struct ctdb_req_message_data *c);
621 int ctdb_req_message_data_push(struct ctdb_req_header *h,
622 struct ctdb_req_message_data *c,
623 uint8_t *buf, size_t *buflen);
625 int ctdb_req_message_data_pull(uint8_t *buf, size_t buflen,
626 struct ctdb_req_header *h,
627 TALLOC_CTX *mem_ctx,
628 struct ctdb_req_message_data *c);
630 /* From protocol/protocol_event.c */
632 void ctdb_event_header_fill(struct ctdb_event_header *h, uint32_t reqid);
634 size_t ctdb_event_request_len(struct ctdb_event_request *in);
636 int ctdb_event_request_push(struct ctdb_event_request *in,
637 uint8_t *buf, size_t *buflen);
639 int ctdb_event_request_pull(uint8_t *buf, size_t buflen,
640 TALLOC_CTX *mem_ctx,
641 struct ctdb_event_request *out);
643 size_t ctdb_event_reply_len(struct ctdb_event_reply *in);
645 int ctdb_event_reply_push(struct ctdb_event_reply *in,
646 uint8_t *buf, size_t *buflen);
648 int ctdb_event_reply_pull(uint8_t *buf, size_t buflen,
649 TALLOC_CTX *mem_ctx,
650 struct ctdb_event_reply *out);
652 /* From protocol/protocol_packet.c */
654 int ctdb_allocate_pkt(TALLOC_CTX *mem_ctx, size_t datalen,
655 uint8_t **buf, size_t *buflen);
657 /* From protocol/protocol_util.c */
659 const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
660 enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
662 const char *ctdb_event_to_string(enum ctdb_event event);
663 enum ctdb_event ctdb_event_from_string(const char *event_str);
665 const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
666 int ctdb_sock_addr_cmp_ip(const ctdb_sock_addr *addr1,
667 const ctdb_sock_addr *addr2);
668 int ctdb_sock_addr_cmp(const ctdb_sock_addr *addr1,
669 const ctdb_sock_addr *addr2);
670 bool ctdb_sock_addr_same_ip(const ctdb_sock_addr *addr1,
671 const ctdb_sock_addr *addr2);
672 bool ctdb_sock_addr_same(const ctdb_sock_addr *addr1,
673 const ctdb_sock_addr *addr2);
675 #endif /* __CTDB_PROTOCOL_API_H__ */