source: vendor/current/ctdb/protocol/protocol_api.h

Last change on this file was 989, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.7

File size: 27.5 KB
Line 
1/*
2 CTDB protocol marshalling
3
4 Copyright (C) Amitay Isaacs 2015
5
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.
10
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.
15
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/>.
18*/
19
20#ifndef __CTDB_PROTOCOL_API_H__
21#define __CTDB_PROTOCOL_API_H__
22
23#include <talloc.h>
24
25#include "protocol/protocol.h"
26
27/* From protocol/protocol_types.c */
28
29size_t ctdb_ltdb_header_len(struct ctdb_ltdb_header *header);
30void ctdb_ltdb_header_push(struct ctdb_ltdb_header *header, uint8_t *buf);
31int ctdb_ltdb_header_pull(uint8_t *buf, size_t buflen,
32 struct ctdb_ltdb_header *header);
33
34int ctdb_ltdb_header_extract(TDB_DATA *data, struct ctdb_ltdb_header *header);
35
36size_t ctdb_rec_data_len(struct ctdb_rec_data *rec);
37void ctdb_rec_data_push(struct ctdb_rec_data *rec, uint8_t *buf);
38int ctdb_rec_data_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
39 struct ctdb_rec_data **out);
40
41size_t ctdb_rec_buffer_len(struct ctdb_rec_buffer *recbuf);
42void ctdb_rec_buffer_push(struct ctdb_rec_buffer *recbuf, uint8_t *buf);
43int ctdb_rec_buffer_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
44 struct ctdb_rec_buffer **out);
45
46struct ctdb_rec_buffer *ctdb_rec_buffer_init(TALLOC_CTX *mem_ctx,
47 uint32_t db_id);
48int 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);
51int ctdb_rec_buffer_traverse(struct ctdb_rec_buffer *recbuf,
52 ctdb_rec_parser_func_t func,
53 void *private_data);
54
55int ctdb_rec_buffer_write(struct ctdb_rec_buffer *recbuf, int fd);
56int ctdb_rec_buffer_read(int fd, TALLOC_CTX *mem_ctx,
57 struct ctdb_rec_buffer **out);
58
59size_t ctdb_server_id_len(struct ctdb_server_id *sid);
60void ctdb_server_id_push(struct ctdb_server_id *sid, uint8_t *buf);
61int ctdb_server_id_pull(uint8_t *buf, size_t buflen,
62 struct ctdb_server_id *sid);
63
64size_t ctdb_g_lock_len(struct ctdb_g_lock *lock);
65void ctdb_g_lock_push(struct ctdb_g_lock *lock, uint8_t *buf);
66int ctdb_g_lock_pull(uint8_t *buf, size_t buflen, struct ctdb_g_lock *lock);
67
68size_t ctdb_g_lock_list_len(struct ctdb_g_lock_list *lock_list);
69void ctdb_g_lock_list_push(struct ctdb_g_lock_list *lock_list, uint8_t *buf);
70int ctdb_g_lock_list_pull(uint8_t *buf, size_t buflen, TALLOC_CTX *mem_ctx,
71 struct ctdb_g_lock_list **out);
72
73/* From protocol/protocol_header.c */
74
75void 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);
78
79int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
80 struct ctdb_req_header *h);
81
82int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
83
84/* From protocol/protocol_call.c */
85
86int ctdb_req_call_push(struct ctdb_req_header *h,
87 struct ctdb_req_call *c,
88 TALLOC_CTX *mem_ctx,
89 uint8_t **pkt, size_t *pkt_len);
90
91int ctdb_req_call_pull(uint8_t *pkt, size_t pkt_len,
92 struct ctdb_req_header *h,
93 TALLOC_CTX *mem_ctx,
94 struct ctdb_req_call *c);
95
96int ctdb_reply_call_push(struct ctdb_req_header *h,
97 struct ctdb_reply_call *c,
98 TALLOC_CTX *mem_ctx,
99 uint8_t **pkt, size_t *pkt_len);
100
101int ctdb_reply_call_pull(uint8_t *pkt, size_t pkt_len,
102 struct ctdb_req_header *h,
103 TALLOC_CTX *mem_ctx,
104 struct ctdb_reply_call *c);
105
106int ctdb_reply_error_push(struct ctdb_req_header *h,
107 struct ctdb_reply_error *c,
108 TALLOC_CTX *mem_ctx,
109 uint8_t **pkt, size_t *pkt_len);
110
111int ctdb_reply_error_pull(uint8_t *pkt, size_t pkt_len,
112 struct ctdb_req_header *h,
113 TALLOC_CTX *mem_ctx,
114 struct ctdb_reply_error *c);
115
116int ctdb_req_dmaster_push(struct ctdb_req_header *h,
117 struct ctdb_req_dmaster *c,
118 TALLOC_CTX *mem_ctx,
119 uint8_t **pkt, size_t *pkt_len);
120
121int ctdb_req_dmaster_pull(uint8_t *pkt, size_t pkt_len,
122 struct ctdb_req_header *h,
123 TALLOC_CTX *mem_ctx,
124 struct ctdb_req_dmaster *c);
125
126int ctdb_reply_dmaster_push(struct ctdb_req_header *h,
127 struct ctdb_reply_dmaster *c,
128 TALLOC_CTX *mem_ctx,
129 uint8_t **pkt, size_t *pkt_len);
130
131int ctdb_reply_dmaster_pull(uint8_t *pkt, size_t pkt_len,
132 struct ctdb_req_header *h,
133 TALLOC_CTX *mem_ctx,
134 struct ctdb_reply_dmaster *c);
135
136/* From protocol/protocol_control.c */
137
138int ctdb_req_control_push(struct ctdb_req_header *h,
139 struct ctdb_req_control *c,
140 TALLOC_CTX *mem_ctx,
141 uint8_t **pkt, size_t *pkt_len);
142
143int ctdb_req_control_pull(uint8_t *pkt, size_t pkt_len,
144 struct ctdb_req_header *h,
145 TALLOC_CTX *mem_ctx,
146 struct ctdb_req_control *c);
147
148int ctdb_reply_control_push(struct ctdb_req_header *h,
149 struct ctdb_reply_control *c,
150 TALLOC_CTX *mem_ctx,
151 uint8_t **pkt, size_t *pkt_len);
152
153int ctdb_reply_control_pull(uint8_t *pkt, size_t pkt_len, uint32_t opcode,
154 struct ctdb_req_header *h,
155 TALLOC_CTX *mem_ctx,
156 struct ctdb_reply_control *c);
157
158/* From protocol/protocol_client.c */
159
160void ctdb_req_control_process_exists(struct ctdb_req_control *request,
161 pid_t pid);
162int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
163 int *status);
164
165void ctdb_req_control_statistics(struct ctdb_req_control *request);
166
167int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
168 TALLOC_CTX *mem_ctx,
169 struct ctdb_statistics **stats);
170
171void ctdb_req_control_ping(struct ctdb_req_control *request);
172int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
173 int *num_clients);
174
175void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
176 uint32_t db_id);
177int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
178 TALLOC_CTX *mem_ctx, const char **db_path);
179
180void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
181int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
182 TALLOC_CTX *mem_ctx,
183 struct ctdb_vnn_map **vnnmap);
184
185void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
186 struct ctdb_vnn_map *vnnmap);
187int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
188
189void ctdb_req_control_get_debug(struct ctdb_req_control *request);
190int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
191 uint32_t *debug_level);
192
193void ctdb_req_control_set_debug(struct ctdb_req_control *request,
194 uint32_t debug_level);
195int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
196
197void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
198int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
199 TALLOC_CTX *mem_ctx,
200 struct ctdb_dbid_map **dbmap);
201
202void ctdb_req_control_pull_db(struct ctdb_req_control *request,
203 struct ctdb_pulldb *pulldb);
204int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply,
205 TALLOC_CTX *mem_ctx,
206 struct ctdb_rec_buffer **recbuf);
207
208void ctdb_req_control_push_db(struct ctdb_req_control *request,
209 struct ctdb_rec_buffer *recbuf);
210int ctdb_reply_control_push_db(struct ctdb_reply_control *reply);
211
212void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
213int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
214 int *recmode);
215
216void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
217 int recmode);
218int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
219
220void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
221int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
222
223void ctdb_req_control_db_attach(struct ctdb_req_control *request,
224 const char *db_name, uint32_t tdb_flags);
225int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
226 uint32_t *db_id);
227
228void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
229 struct ctdb_traverse_start *traverse);
230int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
231
232void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
233 uint64_t srvid);
234int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
235
236void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
237 uint64_t srvid);
238int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
239
240void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
241 uint32_t db_id);
242int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
243 TALLOC_CTX *mem_ctx, const char **db_name);
244
245void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
246 uint32_t db_id);
247int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
248
249void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
250 uint32_t db_id);
251int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
252
253void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
254int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
255 TALLOC_CTX *mem_ctx, const char **mem_str);
256
257void ctdb_req_control_get_pid(struct ctdb_req_control *request);
258int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
259 pid_t *pid);
260
261void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
262int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
263 uint32_t *recmaster);
264
265void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
266 int recmaster);
267int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
268
269void ctdb_req_control_freeze(struct ctdb_req_control *request,
270 uint32_t priority);
271int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
272
273void ctdb_req_control_thaw(struct ctdb_req_control *request,
274 uint32_t priority);
275int ctdb_reply_control_thaw(struct ctdb_reply_control *reply);
276
277void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
278int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
279 uint32_t *pnn);
280
281void ctdb_req_control_shutdown(struct ctdb_req_control *request);
282int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
283
284void ctdb_req_control_get_monmode(struct ctdb_req_control *request);
285int ctdb_reply_control_get_monmode(struct ctdb_reply_control *reply,
286 int *mon_mode);
287
288void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
289 struct ctdb_connection *conn);
290int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
291
292void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
293 struct ctdb_connection *conn);
294int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
295
296void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
297 struct ctdb_connection *conn);
298int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
299
300void ctdb_req_control_startup(struct ctdb_req_control *request);
301int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
302
303void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
304 struct ctdb_tunable *tunable);
305int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
306
307void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
308 const char *name);
309int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
310 uint32_t *value);
311
312void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
313int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
314 TALLOC_CTX *mem_ctx,
315 struct ctdb_var_list **tun_var_list);
316
317void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
318 struct ctdb_node_flag_change *flag_change);
319int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
320
321void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
322int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
323 TALLOC_CTX *mem_ctx,
324 struct ctdb_tunable_list **tun_list);
325
326void ctdb_req_control_kill_tcp(struct ctdb_req_control *request,
327 struct ctdb_connection *conn);
328int ctdb_reply_control_kill_tcp(struct ctdb_reply_control *reply);
329
330void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
331 ctdb_sock_addr *addr);
332int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
333 TALLOC_CTX *mem_ctx,
334 struct ctdb_tickle_list **tickles);
335
336void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
337 struct ctdb_tickle_list *tickles);
338int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
339
340void ctdb_req_control_register_server_id(struct ctdb_req_control *request,
341 struct ctdb_client_id *sid);
342int ctdb_reply_control_register_server_id(struct ctdb_reply_control *reply);
343
344void ctdb_req_control_unregister_server_id(struct ctdb_req_control *request,
345 struct ctdb_client_id *sid);
346int ctdb_reply_control_unregister_server_id(struct ctdb_reply_control *reply);
347
348void ctdb_req_control_check_server_id(struct ctdb_req_control *request,
349 struct ctdb_client_id *sid);
350int ctdb_reply_control_check_server_id(struct ctdb_reply_control *reply);
351
352void ctdb_req_control_get_server_id_list(struct ctdb_req_control *request);
353int ctdb_reply_control_get_server_id_list(struct ctdb_reply_control *reply,
354 TALLOC_CTX *mem_ctx,
355 struct ctdb_client_id_map **cid_map);
356
357void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
358 const char *name,
359 uint32_t tdb_flags);
360int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
361 uint32_t *db_id);
362
363void ctdb_req_control_update_record(struct ctdb_req_control *request,
364 struct ctdb_rec_buffer *recbuf);
365int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
366
367void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
368 struct ctdb_addr_info *addr_info);
369int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
370
371void ctdb_req_control_transaction_start(struct ctdb_req_control *request,
372 uint32_t tid);
373int ctdb_reply_control_transaction_start(struct ctdb_reply_control *reply);
374
375void ctdb_req_control_transaction_commit(struct ctdb_req_control *request,
376 uint32_t tid);
377int ctdb_reply_control_transaction_commit(struct ctdb_reply_control *reply);
378
379void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
380 struct ctdb_transdb *transdb);
381int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
382
383void ctdb_req_control_uptime(struct ctdb_req_control *request);
384int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
385 TALLOC_CTX *mem_ctx,
386 struct ctdb_uptime **uptime);
387
388void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
389int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
390
391void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
392int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
393
394void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
395int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
396
397void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
398 struct ctdb_rec_buffer *recbuf);
399int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
400 TALLOC_CTX *mem_ctx,
401 struct ctdb_rec_buffer **recbuf);
402
403void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
404int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
405
406void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
407int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
408
409void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
410 struct ctdb_addr_info *addr_info);
411int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
412
413void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
414 struct ctdb_addr_info *addr_info);
415int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
416
417void ctdb_req_control_run_eventscripts(struct ctdb_req_control *request,
418 const char *event_str);
419int ctdb_reply_control_run_eventscripts(struct ctdb_reply_control *reply);
420
421void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
422int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
423 uint32_t *caps);
424
425void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
426int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
427
428void ctdb_req_control_release_ip(struct ctdb_req_control *request,
429 struct ctdb_public_ip *pubip);
430int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
431
432void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
433 struct ctdb_public_ip *pubip);
434int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
435
436void ctdb_req_control_get_public_ips(struct ctdb_req_control *request);
437int ctdb_reply_control_get_public_ips(struct ctdb_reply_control *reply,
438 TALLOC_CTX *mem_ctx,
439 struct ctdb_public_ip_list **pubip_list);
440
441void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
442int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
443 TALLOC_CTX *mem_ctx,
444 struct ctdb_node_map **nodemap);
445
446void ctdb_req_control_get_event_script_status(struct ctdb_req_control *request,
447 uint32_t event);
448int ctdb_reply_control_get_event_script_status(struct ctdb_reply_control *reply,
449 TALLOC_CTX *mem_ctx,
450 struct ctdb_script_list **script_list);
451
452void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
453 struct ctdb_traverse_start *traverse);
454int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
455
456void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
457 double reclock_latency);
458int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
459
460void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
461int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
462 TALLOC_CTX *mem_ctx,
463 const char **reclock_file);
464
465void ctdb_req_control_set_reclock_file(struct ctdb_req_control *request,
466 const char *reclock_file);
467int ctdb_reply_control_set_reclock_file(struct ctdb_reply_control *reply);
468
469void ctdb_req_control_stop_node(struct ctdb_req_control *request);
470int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
471
472void ctdb_req_control_continue_node(struct ctdb_req_control *request);
473int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
474
475void ctdb_req_control_set_natgwstate(struct ctdb_req_control *request,
476 uint32_t natgw_role);
477int ctdb_reply_control_set_natgwstate(struct ctdb_reply_control *reply);
478
479void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
480 uint32_t lmaster_role);
481int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
482
483void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
484 uint32_t recmaster_role);
485int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
486
487void ctdb_req_control_enable_script(struct ctdb_req_control *request,
488 const char *script);
489int ctdb_reply_control_enable_script(struct ctdb_reply_control *reply);
490
491void ctdb_req_control_disable_script(struct ctdb_req_control *request,
492 const char *script);
493int ctdb_reply_control_disable_script(struct ctdb_reply_control *reply);
494
495void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
496 struct ctdb_ban_state *ban_state);
497int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
498
499void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
500int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
501 TALLOC_CTX *mem_ctx,
502 struct ctdb_ban_state **ban_state);
503
504void ctdb_req_control_set_db_priority(struct ctdb_req_control *request,
505 struct ctdb_db_priority *db_prio);
506int ctdb_reply_control_set_db_priority(struct ctdb_reply_control *reply);
507
508void ctdb_req_control_get_db_priority(struct ctdb_req_control *request,
509 uint32_t db_id);
510int ctdb_reply_control_get_db_priority(struct ctdb_reply_control *reply,
511 uint32_t *priority);
512
513void ctdb_req_control_transaction_cancel(struct ctdb_req_control *request,
514 uint32_t tid);
515int ctdb_reply_control_transaction_cancel(struct ctdb_reply_control *reply);
516
517void ctdb_req_control_register_notify(struct ctdb_req_control *request,
518 struct ctdb_notify_data *notify);
519int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
520
521void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
522 uint64_t srvid);
523int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
524
525void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
526 struct ctdb_rec_buffer *recbuf);
527int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
528
529void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
530 uint32_t db_id);
531int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
532 uint64_t *seqnum);
533
534void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
535 uint32_t db_id);
536int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
537
538void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
539 uint32_t db_id);
540int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
541 TALLOC_CTX *mem_ctx,
542 const char **reason);
543
544void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
545 ctdb_sock_addr *addr);
546int ctdb_reply_control_get_public_ip_info(struct ctdb_reply_control *reply,
547 TALLOC_CTX *mem_ctx,
548 struct ctdb_public_ip_info **ipinfo);
549
550void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
551int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
552 TALLOC_CTX *mem_ctx,
553 struct ctdb_iface_list **iface_list);
554
555void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
556 struct ctdb_iface *iface);
557int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
558
559void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
560 struct ctdb_connection *conn);
561int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
562
563void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
564int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
565 TALLOC_CTX *mem_ctx,
566 struct ctdb_statistics_list **stats_list);
567
568void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
569 struct ctdb_key_data *key);
570int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
571
572void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
573 uint32_t db_id);
574int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
575
576void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
577 struct ctdb_uint64_array *u64_array);
578int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
579 TALLOC_CTX *mem_ctx,
580 struct ctdb_uint8_array **u8_array);
581
582void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
583 struct ctdb_traverse_start_ext *traverse);
584int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
585
586void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
587 uint32_t db_id);
588int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
589 TALLOC_CTX *mem_ctx,
590 struct ctdb_db_statistics **dbstats);
591
592void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
593 uint32_t db_id);
594int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
595
596void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
597int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
598
599void ctdb_req_control_receive_records(struct ctdb_req_control *request,
600 struct ctdb_rec_buffer *recbuf);
601int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
602 TALLOC_CTX *mem_ctx,
603 struct ctdb_rec_buffer **recbuf);
604
605void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
606int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
607
608void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
609int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
610 enum ctdb_runstate *runstate);
611
612void ctdb_req_control_db_detach(struct ctdb_req_control *request,
613 uint32_t db_id);
614int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
615
616void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
617int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
618 TALLOC_CTX *mem_ctx,
619 struct ctdb_node_map **nodemap);
620
621void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
622 uint32_t db_id);
623int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
624
625void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
626 uint32_t db_id);
627int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
628
629void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
630 struct ctdb_transdb *transdb);
631int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
632
633void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
634 struct ctdb_transdb *transdb);
635int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
636
637void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
638 uint32_t db_id);
639int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
640
641void ctdb_req_control_db_pull(struct ctdb_req_control *request,
642 struct ctdb_pulldb_ext *pulldb_ext);
643int ctdb_reply_control_db_pull(struct ctdb_reply_control *reply,
644 uint32_t *num_records);
645
646void ctdb_req_control_db_push_start(struct ctdb_req_control *request,
647 struct ctdb_pulldb_ext *pulldb_ext);
648int ctdb_reply_control_db_push_start(struct ctdb_reply_control *reply);
649
650void ctdb_req_control_db_push_confirm(struct ctdb_req_control *request,
651 uint32_t db_id);
652int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control *reply,
653 uint32_t *num_records);
654
655/* From protocol/protocol_message.c */
656
657int ctdb_req_message_push(struct ctdb_req_header *h,
658 struct ctdb_req_message *c,
659 TALLOC_CTX *mem_ctx,
660 uint8_t **pkt, size_t *pkt_len);
661
662int ctdb_req_message_pull(uint8_t *pkt, size_t pkt_len,
663 struct ctdb_req_header *h,
664 TALLOC_CTX *mem_ctx,
665 struct ctdb_req_message *c);
666
667int ctdb_req_message_data_push(struct ctdb_req_header *h,
668 struct ctdb_req_message_data *message,
669 TALLOC_CTX *mem_ctx,
670 uint8_t **pkt, size_t *pkt_len);
671
672int ctdb_req_message_data_pull(uint8_t *pkt, size_t pkt_len,
673 struct ctdb_req_header *h,
674 TALLOC_CTX *mem_ctx,
675 struct ctdb_req_message_data *message);
676
677/* From protocol/protocol_util.c */
678
679const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
680enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
681
682const char *ctdb_event_to_string(enum ctdb_event event);
683enum ctdb_event ctdb_event_from_string(const char *event_str);
684
685const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
686
687#endif /* __CTDB_PROTOCOL_API_H__ */
Note: See TracBrowser for help on using the repository browser.