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 |
|
---|
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);
|
---|
33 |
|
---|
34 | int ctdb_ltdb_header_extract(TDB_DATA *data, struct ctdb_ltdb_header *header);
|
---|
35 |
|
---|
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);
|
---|
40 |
|
---|
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);
|
---|
45 |
|
---|
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);
|
---|
54 |
|
---|
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);
|
---|
58 |
|
---|
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);
|
---|
63 |
|
---|
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);
|
---|
67 |
|
---|
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);
|
---|
72 |
|
---|
73 | /* From protocol/protocol_header.c */
|
---|
74 |
|
---|
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);
|
---|
78 |
|
---|
79 | int ctdb_req_header_pull(uint8_t *pkt, size_t pkt_len,
|
---|
80 | struct ctdb_req_header *h);
|
---|
81 |
|
---|
82 | int ctdb_req_header_verify(struct ctdb_req_header *h, uint32_t operation);
|
---|
83 |
|
---|
84 | /* From protocol/protocol_call.c */
|
---|
85 |
|
---|
86 | int 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 |
|
---|
91 | int 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 |
|
---|
96 | int 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 |
|
---|
101 | int 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 |
|
---|
106 | int 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 |
|
---|
111 | int 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 |
|
---|
116 | int 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 |
|
---|
121 | int 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 |
|
---|
126 | int 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 |
|
---|
131 | int 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 |
|
---|
138 | int 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 |
|
---|
143 | int 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 |
|
---|
148 | int 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 |
|
---|
153 | int 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 |
|
---|
160 | void ctdb_req_control_process_exists(struct ctdb_req_control *request,
|
---|
161 | pid_t pid);
|
---|
162 | int ctdb_reply_control_process_exists(struct ctdb_reply_control *reply,
|
---|
163 | int *status);
|
---|
164 |
|
---|
165 | void ctdb_req_control_statistics(struct ctdb_req_control *request);
|
---|
166 |
|
---|
167 | int ctdb_reply_control_statistics(struct ctdb_reply_control *reply,
|
---|
168 | TALLOC_CTX *mem_ctx,
|
---|
169 | struct ctdb_statistics **stats);
|
---|
170 |
|
---|
171 | void ctdb_req_control_ping(struct ctdb_req_control *request);
|
---|
172 | int ctdb_reply_control_ping(struct ctdb_reply_control *reply,
|
---|
173 | int *num_clients);
|
---|
174 |
|
---|
175 | void ctdb_req_control_getdbpath(struct ctdb_req_control *request,
|
---|
176 | uint32_t db_id);
|
---|
177 | int ctdb_reply_control_getdbpath(struct ctdb_reply_control *reply,
|
---|
178 | TALLOC_CTX *mem_ctx, const char **db_path);
|
---|
179 |
|
---|
180 | void ctdb_req_control_getvnnmap(struct ctdb_req_control *request);
|
---|
181 | int ctdb_reply_control_getvnnmap(struct ctdb_reply_control *reply,
|
---|
182 | TALLOC_CTX *mem_ctx,
|
---|
183 | struct ctdb_vnn_map **vnnmap);
|
---|
184 |
|
---|
185 | void ctdb_req_control_setvnnmap(struct ctdb_req_control *request,
|
---|
186 | struct ctdb_vnn_map *vnnmap);
|
---|
187 | int ctdb_reply_control_setvnnmap(struct ctdb_reply_control *reply);
|
---|
188 |
|
---|
189 | void ctdb_req_control_get_debug(struct ctdb_req_control *request);
|
---|
190 | int ctdb_reply_control_get_debug(struct ctdb_reply_control *reply,
|
---|
191 | uint32_t *debug_level);
|
---|
192 |
|
---|
193 | void ctdb_req_control_set_debug(struct ctdb_req_control *request,
|
---|
194 | uint32_t debug_level);
|
---|
195 | int ctdb_reply_control_set_debug(struct ctdb_reply_control *reply);
|
---|
196 |
|
---|
197 | void ctdb_req_control_get_dbmap(struct ctdb_req_control *request);
|
---|
198 | int ctdb_reply_control_get_dbmap(struct ctdb_reply_control *reply,
|
---|
199 | TALLOC_CTX *mem_ctx,
|
---|
200 | struct ctdb_dbid_map **dbmap);
|
---|
201 |
|
---|
202 | void ctdb_req_control_pull_db(struct ctdb_req_control *request,
|
---|
203 | struct ctdb_pulldb *pulldb);
|
---|
204 | int ctdb_reply_control_pull_db(struct ctdb_reply_control *reply,
|
---|
205 | TALLOC_CTX *mem_ctx,
|
---|
206 | struct ctdb_rec_buffer **recbuf);
|
---|
207 |
|
---|
208 | void ctdb_req_control_push_db(struct ctdb_req_control *request,
|
---|
209 | struct ctdb_rec_buffer *recbuf);
|
---|
210 | int ctdb_reply_control_push_db(struct ctdb_reply_control *reply);
|
---|
211 |
|
---|
212 | void ctdb_req_control_get_recmode(struct ctdb_req_control *request);
|
---|
213 | int ctdb_reply_control_get_recmode(struct ctdb_reply_control *reply,
|
---|
214 | int *recmode);
|
---|
215 |
|
---|
216 | void ctdb_req_control_set_recmode(struct ctdb_req_control *request,
|
---|
217 | int recmode);
|
---|
218 | int ctdb_reply_control_set_recmode(struct ctdb_reply_control *reply);
|
---|
219 |
|
---|
220 | void ctdb_req_control_statistics_reset(struct ctdb_req_control *request);
|
---|
221 | int ctdb_reply_control_statistics_reset(struct ctdb_reply_control *reply);
|
---|
222 |
|
---|
223 | void ctdb_req_control_db_attach(struct ctdb_req_control *request,
|
---|
224 | const char *db_name, uint32_t tdb_flags);
|
---|
225 | int ctdb_reply_control_db_attach(struct ctdb_reply_control *reply,
|
---|
226 | uint32_t *db_id);
|
---|
227 |
|
---|
228 | void ctdb_req_control_traverse_start(struct ctdb_req_control *request,
|
---|
229 | struct ctdb_traverse_start *traverse);
|
---|
230 | int ctdb_reply_control_traverse_start(struct ctdb_reply_control *reply);
|
---|
231 |
|
---|
232 | void ctdb_req_control_register_srvid(struct ctdb_req_control *request,
|
---|
233 | uint64_t srvid);
|
---|
234 | int ctdb_reply_control_register_srvid(struct ctdb_reply_control *reply);
|
---|
235 |
|
---|
236 | void ctdb_req_control_deregister_srvid(struct ctdb_req_control *request,
|
---|
237 | uint64_t srvid);
|
---|
238 | int ctdb_reply_control_deregister_srvid(struct ctdb_reply_control *reply);
|
---|
239 |
|
---|
240 | void ctdb_req_control_get_dbname(struct ctdb_req_control *request,
|
---|
241 | uint32_t db_id);
|
---|
242 | int ctdb_reply_control_get_dbname(struct ctdb_reply_control *reply,
|
---|
243 | TALLOC_CTX *mem_ctx, const char **db_name);
|
---|
244 |
|
---|
245 | void ctdb_req_control_enable_seqnum(struct ctdb_req_control *request,
|
---|
246 | uint32_t db_id);
|
---|
247 | int ctdb_reply_control_enable_seqnum(struct ctdb_reply_control *reply);
|
---|
248 |
|
---|
249 | void ctdb_req_control_update_seqnum(struct ctdb_req_control *request,
|
---|
250 | uint32_t db_id);
|
---|
251 | int ctdb_reply_control_update_seqnum(struct ctdb_reply_control *reply);
|
---|
252 |
|
---|
253 | void ctdb_req_control_dump_memory(struct ctdb_req_control *request);
|
---|
254 | int ctdb_reply_control_dump_memory(struct ctdb_reply_control *reply,
|
---|
255 | TALLOC_CTX *mem_ctx, const char **mem_str);
|
---|
256 |
|
---|
257 | void ctdb_req_control_get_pid(struct ctdb_req_control *request);
|
---|
258 | int ctdb_reply_control_get_pid(struct ctdb_reply_control *reply,
|
---|
259 | pid_t *pid);
|
---|
260 |
|
---|
261 | void ctdb_req_control_get_recmaster(struct ctdb_req_control *request);
|
---|
262 | int ctdb_reply_control_get_recmaster(struct ctdb_reply_control *reply,
|
---|
263 | uint32_t *recmaster);
|
---|
264 |
|
---|
265 | void ctdb_req_control_set_recmaster(struct ctdb_req_control *request,
|
---|
266 | int recmaster);
|
---|
267 | int ctdb_reply_control_set_recmaster(struct ctdb_reply_control *reply);
|
---|
268 |
|
---|
269 | void ctdb_req_control_freeze(struct ctdb_req_control *request,
|
---|
270 | uint32_t priority);
|
---|
271 | int ctdb_reply_control_freeze(struct ctdb_reply_control *reply);
|
---|
272 |
|
---|
273 | void ctdb_req_control_thaw(struct ctdb_req_control *request,
|
---|
274 | uint32_t priority);
|
---|
275 | int ctdb_reply_control_thaw(struct ctdb_reply_control *reply);
|
---|
276 |
|
---|
277 | void ctdb_req_control_get_pnn(struct ctdb_req_control *request);
|
---|
278 | int ctdb_reply_control_get_pnn(struct ctdb_reply_control *reply,
|
---|
279 | uint32_t *pnn);
|
---|
280 |
|
---|
281 | void ctdb_req_control_shutdown(struct ctdb_req_control *request);
|
---|
282 | int ctdb_reply_control_shutdown(struct ctdb_reply_control *reply);
|
---|
283 |
|
---|
284 | void ctdb_req_control_get_monmode(struct ctdb_req_control *request);
|
---|
285 | int ctdb_reply_control_get_monmode(struct ctdb_reply_control *reply,
|
---|
286 | int *mon_mode);
|
---|
287 |
|
---|
288 | void ctdb_req_control_tcp_client(struct ctdb_req_control *request,
|
---|
289 | struct ctdb_connection *conn);
|
---|
290 | int ctdb_reply_control_tcp_client(struct ctdb_reply_control *reply);
|
---|
291 |
|
---|
292 | void ctdb_req_control_tcp_add(struct ctdb_req_control *request,
|
---|
293 | struct ctdb_connection *conn);
|
---|
294 | int ctdb_reply_control_tcp_add(struct ctdb_reply_control *reply);
|
---|
295 |
|
---|
296 | void ctdb_req_control_tcp_remove(struct ctdb_req_control *request,
|
---|
297 | struct ctdb_connection *conn);
|
---|
298 | int ctdb_reply_control_tcp_remove(struct ctdb_reply_control *reply);
|
---|
299 |
|
---|
300 | void ctdb_req_control_startup(struct ctdb_req_control *request);
|
---|
301 | int ctdb_reply_control_startup(struct ctdb_reply_control *reply);
|
---|
302 |
|
---|
303 | void ctdb_req_control_set_tunable(struct ctdb_req_control *request,
|
---|
304 | struct ctdb_tunable *tunable);
|
---|
305 | int ctdb_reply_control_set_tunable(struct ctdb_reply_control *reply);
|
---|
306 |
|
---|
307 | void ctdb_req_control_get_tunable(struct ctdb_req_control *request,
|
---|
308 | const char *name);
|
---|
309 | int ctdb_reply_control_get_tunable(struct ctdb_reply_control *reply,
|
---|
310 | uint32_t *value);
|
---|
311 |
|
---|
312 | void ctdb_req_control_list_tunables(struct ctdb_req_control *request);
|
---|
313 | int ctdb_reply_control_list_tunables(struct ctdb_reply_control *reply,
|
---|
314 | TALLOC_CTX *mem_ctx,
|
---|
315 | struct ctdb_var_list **tun_var_list);
|
---|
316 |
|
---|
317 | void ctdb_req_control_modify_flags(struct ctdb_req_control *request,
|
---|
318 | struct ctdb_node_flag_change *flag_change);
|
---|
319 | int ctdb_reply_control_modify_flags(struct ctdb_reply_control *reply);
|
---|
320 |
|
---|
321 | void ctdb_req_control_get_all_tunables(struct ctdb_req_control *request);
|
---|
322 | int ctdb_reply_control_get_all_tunables(struct ctdb_reply_control *reply,
|
---|
323 | TALLOC_CTX *mem_ctx,
|
---|
324 | struct ctdb_tunable_list **tun_list);
|
---|
325 |
|
---|
326 | void ctdb_req_control_kill_tcp(struct ctdb_req_control *request,
|
---|
327 | struct ctdb_connection *conn);
|
---|
328 | int ctdb_reply_control_kill_tcp(struct ctdb_reply_control *reply);
|
---|
329 |
|
---|
330 | void ctdb_req_control_get_tcp_tickle_list(struct ctdb_req_control *request,
|
---|
331 | ctdb_sock_addr *addr);
|
---|
332 | int ctdb_reply_control_get_tcp_tickle_list(struct ctdb_reply_control *reply,
|
---|
333 | TALLOC_CTX *mem_ctx,
|
---|
334 | struct ctdb_tickle_list **tickles);
|
---|
335 |
|
---|
336 | void ctdb_req_control_set_tcp_tickle_list(struct ctdb_req_control *request,
|
---|
337 | struct ctdb_tickle_list *tickles);
|
---|
338 | int ctdb_reply_control_set_tcp_tickle_list(struct ctdb_reply_control *reply);
|
---|
339 |
|
---|
340 | void ctdb_req_control_register_server_id(struct ctdb_req_control *request,
|
---|
341 | struct ctdb_client_id *sid);
|
---|
342 | int ctdb_reply_control_register_server_id(struct ctdb_reply_control *reply);
|
---|
343 |
|
---|
344 | void ctdb_req_control_unregister_server_id(struct ctdb_req_control *request,
|
---|
345 | struct ctdb_client_id *sid);
|
---|
346 | int ctdb_reply_control_unregister_server_id(struct ctdb_reply_control *reply);
|
---|
347 |
|
---|
348 | void ctdb_req_control_check_server_id(struct ctdb_req_control *request,
|
---|
349 | struct ctdb_client_id *sid);
|
---|
350 | int ctdb_reply_control_check_server_id(struct ctdb_reply_control *reply);
|
---|
351 |
|
---|
352 | void ctdb_req_control_get_server_id_list(struct ctdb_req_control *request);
|
---|
353 | int 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 |
|
---|
357 | void ctdb_req_control_db_attach_persistent(struct ctdb_req_control *request,
|
---|
358 | const char *name,
|
---|
359 | uint32_t tdb_flags);
|
---|
360 | int ctdb_reply_control_db_attach_persistent(struct ctdb_reply_control *reply,
|
---|
361 | uint32_t *db_id);
|
---|
362 |
|
---|
363 | void ctdb_req_control_update_record(struct ctdb_req_control *request,
|
---|
364 | struct ctdb_rec_buffer *recbuf);
|
---|
365 | int ctdb_reply_control_update_record(struct ctdb_reply_control *reply);
|
---|
366 |
|
---|
367 | void ctdb_req_control_send_gratuitous_arp(struct ctdb_req_control *request,
|
---|
368 | struct ctdb_addr_info *addr_info);
|
---|
369 | int ctdb_reply_control_send_gratuitous_arp(struct ctdb_reply_control *reply);
|
---|
370 |
|
---|
371 | void ctdb_req_control_transaction_start(struct ctdb_req_control *request,
|
---|
372 | uint32_t tid);
|
---|
373 | int ctdb_reply_control_transaction_start(struct ctdb_reply_control *reply);
|
---|
374 |
|
---|
375 | void ctdb_req_control_transaction_commit(struct ctdb_req_control *request,
|
---|
376 | uint32_t tid);
|
---|
377 | int ctdb_reply_control_transaction_commit(struct ctdb_reply_control *reply);
|
---|
378 |
|
---|
379 | void ctdb_req_control_wipe_database(struct ctdb_req_control *request,
|
---|
380 | struct ctdb_transdb *transdb);
|
---|
381 | int ctdb_reply_control_wipe_database(struct ctdb_reply_control *reply);
|
---|
382 |
|
---|
383 | void ctdb_req_control_uptime(struct ctdb_req_control *request);
|
---|
384 | int ctdb_reply_control_uptime(struct ctdb_reply_control *reply,
|
---|
385 | TALLOC_CTX *mem_ctx,
|
---|
386 | struct ctdb_uptime **uptime);
|
---|
387 |
|
---|
388 | void ctdb_req_control_start_recovery(struct ctdb_req_control *request);
|
---|
389 | int ctdb_reply_control_start_recovery(struct ctdb_reply_control *reply);
|
---|
390 |
|
---|
391 | void ctdb_req_control_end_recovery(struct ctdb_req_control *request);
|
---|
392 | int ctdb_reply_control_end_recovery(struct ctdb_reply_control *reply);
|
---|
393 |
|
---|
394 | void ctdb_req_control_reload_nodes_file(struct ctdb_req_control *request);
|
---|
395 | int ctdb_reply_control_reload_nodes_file(struct ctdb_reply_control *reply);
|
---|
396 |
|
---|
397 | void ctdb_req_control_try_delete_records(struct ctdb_req_control *request,
|
---|
398 | struct ctdb_rec_buffer *recbuf);
|
---|
399 | int ctdb_reply_control_try_delete_records(struct ctdb_reply_control *reply,
|
---|
400 | TALLOC_CTX *mem_ctx,
|
---|
401 | struct ctdb_rec_buffer **recbuf);
|
---|
402 |
|
---|
403 | void ctdb_req_control_enable_monitor(struct ctdb_req_control *request);
|
---|
404 | int ctdb_reply_control_enable_monitor(struct ctdb_reply_control *reply);
|
---|
405 |
|
---|
406 | void ctdb_req_control_disable_monitor(struct ctdb_req_control *request);
|
---|
407 | int ctdb_reply_control_disable_monitor(struct ctdb_reply_control *reply);
|
---|
408 |
|
---|
409 | void ctdb_req_control_add_public_ip(struct ctdb_req_control *request,
|
---|
410 | struct ctdb_addr_info *addr_info);
|
---|
411 | int ctdb_reply_control_add_public_ip(struct ctdb_reply_control *reply);
|
---|
412 |
|
---|
413 | void ctdb_req_control_del_public_ip(struct ctdb_req_control *request,
|
---|
414 | struct ctdb_addr_info *addr_info);
|
---|
415 | int ctdb_reply_control_del_public_ip(struct ctdb_reply_control *reply);
|
---|
416 |
|
---|
417 | void ctdb_req_control_run_eventscripts(struct ctdb_req_control *request,
|
---|
418 | const char *event_str);
|
---|
419 | int ctdb_reply_control_run_eventscripts(struct ctdb_reply_control *reply);
|
---|
420 |
|
---|
421 | void ctdb_req_control_get_capabilities(struct ctdb_req_control *request);
|
---|
422 | int ctdb_reply_control_get_capabilities(struct ctdb_reply_control *reply,
|
---|
423 | uint32_t *caps);
|
---|
424 |
|
---|
425 | void ctdb_req_control_recd_ping(struct ctdb_req_control *request);
|
---|
426 | int ctdb_reply_control_recd_ping(struct ctdb_reply_control *reply);
|
---|
427 |
|
---|
428 | void ctdb_req_control_release_ip(struct ctdb_req_control *request,
|
---|
429 | struct ctdb_public_ip *pubip);
|
---|
430 | int ctdb_reply_control_release_ip(struct ctdb_reply_control *reply);
|
---|
431 |
|
---|
432 | void ctdb_req_control_takeover_ip(struct ctdb_req_control *request,
|
---|
433 | struct ctdb_public_ip *pubip);
|
---|
434 | int ctdb_reply_control_takeover_ip(struct ctdb_reply_control *reply);
|
---|
435 |
|
---|
436 | void ctdb_req_control_get_public_ips(struct ctdb_req_control *request);
|
---|
437 | int 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 |
|
---|
441 | void ctdb_req_control_get_nodemap(struct ctdb_req_control *request);
|
---|
442 | int ctdb_reply_control_get_nodemap(struct ctdb_reply_control *reply,
|
---|
443 | TALLOC_CTX *mem_ctx,
|
---|
444 | struct ctdb_node_map **nodemap);
|
---|
445 |
|
---|
446 | void ctdb_req_control_get_event_script_status(struct ctdb_req_control *request,
|
---|
447 | uint32_t event);
|
---|
448 | int 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 |
|
---|
452 | void ctdb_req_control_traverse_kill(struct ctdb_req_control *request,
|
---|
453 | struct ctdb_traverse_start *traverse);
|
---|
454 | int ctdb_reply_control_traverse_kill(struct ctdb_reply_control *reply);
|
---|
455 |
|
---|
456 | void ctdb_req_control_recd_reclock_latency(struct ctdb_req_control *request,
|
---|
457 | double reclock_latency);
|
---|
458 | int ctdb_reply_control_recd_reclock_latency(struct ctdb_reply_control *reply);
|
---|
459 |
|
---|
460 | void ctdb_req_control_get_reclock_file(struct ctdb_req_control *request);
|
---|
461 | int ctdb_reply_control_get_reclock_file(struct ctdb_reply_control *reply,
|
---|
462 | TALLOC_CTX *mem_ctx,
|
---|
463 | const char **reclock_file);
|
---|
464 |
|
---|
465 | void ctdb_req_control_set_reclock_file(struct ctdb_req_control *request,
|
---|
466 | const char *reclock_file);
|
---|
467 | int ctdb_reply_control_set_reclock_file(struct ctdb_reply_control *reply);
|
---|
468 |
|
---|
469 | void ctdb_req_control_stop_node(struct ctdb_req_control *request);
|
---|
470 | int ctdb_reply_control_stop_node(struct ctdb_reply_control *reply);
|
---|
471 |
|
---|
472 | void ctdb_req_control_continue_node(struct ctdb_req_control *request);
|
---|
473 | int ctdb_reply_control_continue_node(struct ctdb_reply_control *reply);
|
---|
474 |
|
---|
475 | void ctdb_req_control_set_natgwstate(struct ctdb_req_control *request,
|
---|
476 | uint32_t natgw_role);
|
---|
477 | int ctdb_reply_control_set_natgwstate(struct ctdb_reply_control *reply);
|
---|
478 |
|
---|
479 | void ctdb_req_control_set_lmasterrole(struct ctdb_req_control *request,
|
---|
480 | uint32_t lmaster_role);
|
---|
481 | int ctdb_reply_control_set_lmasterrole(struct ctdb_reply_control *reply);
|
---|
482 |
|
---|
483 | void ctdb_req_control_set_recmasterrole(struct ctdb_req_control *request,
|
---|
484 | uint32_t recmaster_role);
|
---|
485 | int ctdb_reply_control_set_recmasterrole(struct ctdb_reply_control *reply);
|
---|
486 |
|
---|
487 | void ctdb_req_control_enable_script(struct ctdb_req_control *request,
|
---|
488 | const char *script);
|
---|
489 | int ctdb_reply_control_enable_script(struct ctdb_reply_control *reply);
|
---|
490 |
|
---|
491 | void ctdb_req_control_disable_script(struct ctdb_req_control *request,
|
---|
492 | const char *script);
|
---|
493 | int ctdb_reply_control_disable_script(struct ctdb_reply_control *reply);
|
---|
494 |
|
---|
495 | void ctdb_req_control_set_ban_state(struct ctdb_req_control *request,
|
---|
496 | struct ctdb_ban_state *ban_state);
|
---|
497 | int ctdb_reply_control_set_ban_state(struct ctdb_reply_control *reply);
|
---|
498 |
|
---|
499 | void ctdb_req_control_get_ban_state(struct ctdb_req_control *request);
|
---|
500 | int ctdb_reply_control_get_ban_state(struct ctdb_reply_control *reply,
|
---|
501 | TALLOC_CTX *mem_ctx,
|
---|
502 | struct ctdb_ban_state **ban_state);
|
---|
503 |
|
---|
504 | void ctdb_req_control_set_db_priority(struct ctdb_req_control *request,
|
---|
505 | struct ctdb_db_priority *db_prio);
|
---|
506 | int ctdb_reply_control_set_db_priority(struct ctdb_reply_control *reply);
|
---|
507 |
|
---|
508 | void ctdb_req_control_get_db_priority(struct ctdb_req_control *request,
|
---|
509 | uint32_t db_id);
|
---|
510 | int ctdb_reply_control_get_db_priority(struct ctdb_reply_control *reply,
|
---|
511 | uint32_t *priority);
|
---|
512 |
|
---|
513 | void ctdb_req_control_transaction_cancel(struct ctdb_req_control *request,
|
---|
514 | uint32_t tid);
|
---|
515 | int ctdb_reply_control_transaction_cancel(struct ctdb_reply_control *reply);
|
---|
516 |
|
---|
517 | void ctdb_req_control_register_notify(struct ctdb_req_control *request,
|
---|
518 | struct ctdb_notify_data *notify);
|
---|
519 | int ctdb_reply_control_register_notify(struct ctdb_reply_control *reply);
|
---|
520 |
|
---|
521 | void ctdb_req_control_deregister_notify(struct ctdb_req_control *request,
|
---|
522 | uint64_t srvid);
|
---|
523 | int ctdb_reply_control_deregister_notify(struct ctdb_reply_control *reply);
|
---|
524 |
|
---|
525 | void ctdb_req_control_trans3_commit(struct ctdb_req_control *request,
|
---|
526 | struct ctdb_rec_buffer *recbuf);
|
---|
527 | int ctdb_reply_control_trans3_commit(struct ctdb_reply_control *reply);
|
---|
528 |
|
---|
529 | void ctdb_req_control_get_db_seqnum(struct ctdb_req_control *request,
|
---|
530 | uint32_t db_id);
|
---|
531 | int ctdb_reply_control_get_db_seqnum(struct ctdb_reply_control *reply,
|
---|
532 | uint64_t *seqnum);
|
---|
533 |
|
---|
534 | void ctdb_req_control_db_set_healthy(struct ctdb_req_control *request,
|
---|
535 | uint32_t db_id);
|
---|
536 | int ctdb_reply_control_db_set_healthy(struct ctdb_reply_control *reply);
|
---|
537 |
|
---|
538 | void ctdb_req_control_db_get_health(struct ctdb_req_control *request,
|
---|
539 | uint32_t db_id);
|
---|
540 | int ctdb_reply_control_db_get_health(struct ctdb_reply_control *reply,
|
---|
541 | TALLOC_CTX *mem_ctx,
|
---|
542 | const char **reason);
|
---|
543 |
|
---|
544 | void ctdb_req_control_get_public_ip_info(struct ctdb_req_control *request,
|
---|
545 | ctdb_sock_addr *addr);
|
---|
546 | int 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 |
|
---|
550 | void ctdb_req_control_get_ifaces(struct ctdb_req_control *request);
|
---|
551 | int ctdb_reply_control_get_ifaces(struct ctdb_reply_control *reply,
|
---|
552 | TALLOC_CTX *mem_ctx,
|
---|
553 | struct ctdb_iface_list **iface_list);
|
---|
554 |
|
---|
555 | void ctdb_req_control_set_iface_link_state(struct ctdb_req_control *request,
|
---|
556 | struct ctdb_iface *iface);
|
---|
557 | int ctdb_reply_control_set_iface_link_state(struct ctdb_reply_control *reply);
|
---|
558 |
|
---|
559 | void ctdb_req_control_tcp_add_delayed_update(struct ctdb_req_control *request,
|
---|
560 | struct ctdb_connection *conn);
|
---|
561 | int ctdb_reply_control_tcp_add_delayed_update(struct ctdb_reply_control *reply);
|
---|
562 |
|
---|
563 | void ctdb_req_control_get_stat_history(struct ctdb_req_control *request);
|
---|
564 | int ctdb_reply_control_get_stat_history(struct ctdb_reply_control *reply,
|
---|
565 | TALLOC_CTX *mem_ctx,
|
---|
566 | struct ctdb_statistics_list **stats_list);
|
---|
567 |
|
---|
568 | void ctdb_req_control_schedule_for_deletion(struct ctdb_req_control *request,
|
---|
569 | struct ctdb_key_data *key);
|
---|
570 | int ctdb_reply_control_schedule_for_deletion(struct ctdb_reply_control *reply);
|
---|
571 |
|
---|
572 | void ctdb_req_control_set_db_readonly(struct ctdb_req_control *request,
|
---|
573 | uint32_t db_id);
|
---|
574 | int ctdb_reply_control_set_db_readonly(struct ctdb_reply_control *reply);
|
---|
575 |
|
---|
576 | void ctdb_req_control_check_srvids(struct ctdb_req_control *request,
|
---|
577 | struct ctdb_uint64_array *u64_array);
|
---|
578 | int ctdb_reply_control_check_srvids(struct ctdb_reply_control *reply,
|
---|
579 | TALLOC_CTX *mem_ctx,
|
---|
580 | struct ctdb_uint8_array **u8_array);
|
---|
581 |
|
---|
582 | void ctdb_req_control_traverse_start_ext(struct ctdb_req_control *request,
|
---|
583 | struct ctdb_traverse_start_ext *traverse);
|
---|
584 | int ctdb_reply_control_traverse_start_ext(struct ctdb_reply_control *reply);
|
---|
585 |
|
---|
586 | void ctdb_req_control_get_db_statistics(struct ctdb_req_control *request,
|
---|
587 | uint32_t db_id);
|
---|
588 | int ctdb_reply_control_get_db_statistics(struct ctdb_reply_control *reply,
|
---|
589 | TALLOC_CTX *mem_ctx,
|
---|
590 | struct ctdb_db_statistics **dbstats);
|
---|
591 |
|
---|
592 | void ctdb_req_control_set_db_sticky(struct ctdb_req_control *request,
|
---|
593 | uint32_t db_id);
|
---|
594 | int ctdb_reply_control_set_db_sticky(struct ctdb_reply_control *reply);
|
---|
595 |
|
---|
596 | void ctdb_req_control_reload_public_ips(struct ctdb_req_control *request);
|
---|
597 | int ctdb_reply_control_reload_public_ips(struct ctdb_reply_control *reply);
|
---|
598 |
|
---|
599 | void ctdb_req_control_receive_records(struct ctdb_req_control *request,
|
---|
600 | struct ctdb_rec_buffer *recbuf);
|
---|
601 | int ctdb_reply_control_receive_records(struct ctdb_reply_control *reply,
|
---|
602 | TALLOC_CTX *mem_ctx,
|
---|
603 | struct ctdb_rec_buffer **recbuf);
|
---|
604 |
|
---|
605 | void ctdb_req_control_ipreallocated(struct ctdb_req_control *request);
|
---|
606 | int ctdb_reply_control_ipreallocated(struct ctdb_reply_control *reply);
|
---|
607 |
|
---|
608 | void ctdb_req_control_get_runstate(struct ctdb_req_control *request);
|
---|
609 | int ctdb_reply_control_get_runstate(struct ctdb_reply_control *reply,
|
---|
610 | enum ctdb_runstate *runstate);
|
---|
611 |
|
---|
612 | void ctdb_req_control_db_detach(struct ctdb_req_control *request,
|
---|
613 | uint32_t db_id);
|
---|
614 | int ctdb_reply_control_db_detach(struct ctdb_reply_control *reply);
|
---|
615 |
|
---|
616 | void ctdb_req_control_get_nodes_file(struct ctdb_req_control *request);
|
---|
617 | int ctdb_reply_control_get_nodes_file(struct ctdb_reply_control *reply,
|
---|
618 | TALLOC_CTX *mem_ctx,
|
---|
619 | struct ctdb_node_map **nodemap);
|
---|
620 |
|
---|
621 | void ctdb_req_control_db_freeze(struct ctdb_req_control *request,
|
---|
622 | uint32_t db_id);
|
---|
623 | int ctdb_reply_control_db_freeze(struct ctdb_reply_control *reply);
|
---|
624 |
|
---|
625 | void ctdb_req_control_db_thaw(struct ctdb_req_control *request,
|
---|
626 | uint32_t db_id);
|
---|
627 | int ctdb_reply_control_db_thaw(struct ctdb_reply_control *reply);
|
---|
628 |
|
---|
629 | void ctdb_req_control_db_transaction_start(struct ctdb_req_control *request,
|
---|
630 | struct ctdb_transdb *transdb);
|
---|
631 | int ctdb_reply_control_db_transaction_start(struct ctdb_reply_control *reply);
|
---|
632 |
|
---|
633 | void ctdb_req_control_db_transaction_commit(struct ctdb_req_control *request,
|
---|
634 | struct ctdb_transdb *transdb);
|
---|
635 | int ctdb_reply_control_db_transaction_commit(struct ctdb_reply_control *reply);
|
---|
636 |
|
---|
637 | void ctdb_req_control_db_transaction_cancel(struct ctdb_req_control *request,
|
---|
638 | uint32_t db_id);
|
---|
639 | int ctdb_reply_control_db_transaction_cancel(struct ctdb_reply_control *reply);
|
---|
640 |
|
---|
641 | void ctdb_req_control_db_pull(struct ctdb_req_control *request,
|
---|
642 | struct ctdb_pulldb_ext *pulldb_ext);
|
---|
643 | int ctdb_reply_control_db_pull(struct ctdb_reply_control *reply,
|
---|
644 | uint32_t *num_records);
|
---|
645 |
|
---|
646 | void ctdb_req_control_db_push_start(struct ctdb_req_control *request,
|
---|
647 | struct ctdb_pulldb_ext *pulldb_ext);
|
---|
648 | int ctdb_reply_control_db_push_start(struct ctdb_reply_control *reply);
|
---|
649 |
|
---|
650 | void ctdb_req_control_db_push_confirm(struct ctdb_req_control *request,
|
---|
651 | uint32_t db_id);
|
---|
652 | int ctdb_reply_control_db_push_confirm(struct ctdb_reply_control *reply,
|
---|
653 | uint32_t *num_records);
|
---|
654 |
|
---|
655 | /* From protocol/protocol_message.c */
|
---|
656 |
|
---|
657 | int 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 |
|
---|
662 | int 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 |
|
---|
667 | int 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 |
|
---|
672 | int 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 |
|
---|
679 | const char *ctdb_runstate_to_string(enum ctdb_runstate runstate);
|
---|
680 | enum ctdb_runstate ctdb_runstate_from_string(const char *runstate_str);
|
---|
681 |
|
---|
682 | const char *ctdb_event_to_string(enum ctdb_event event);
|
---|
683 | enum ctdb_event ctdb_event_from_string(const char *event_str);
|
---|
684 |
|
---|
685 | const char *ctdb_sock_addr_to_string(TALLOC_CTX *mem_ctx, ctdb_sock_addr *addr);
|
---|
686 |
|
---|
687 | #endif /* __CTDB_PROTOCOL_API_H__ */
|
---|