2015-04-14 10:20:05 +03:00
/*
CTDB protocol marshalling
Copyright ( C ) Amitay Isaacs 2015
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef __CTDB_PROTOCOL_API_H__
# define __CTDB_PROTOCOL_API_H__
2015-11-02 08:01:13 +03:00
# include <talloc.h>
2015-04-14 10:20:05 +03:00
# include "protocol/protocol.h"
/* From protocol/protocol_types.c */
2017-06-29 15:39:41 +03:00
size_t ctdb_ltdb_header_len ( struct ctdb_ltdb_header * in ) ;
void ctdb_ltdb_header_push ( struct ctdb_ltdb_header * in , uint8_t * buf ,
size_t * npush ) ;
2015-04-14 10:20:05 +03:00
int ctdb_ltdb_header_pull ( uint8_t * buf , size_t buflen ,
2017-06-29 15:39:41 +03:00
struct ctdb_ltdb_header * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
2015-11-10 10:29:39 +03:00
int ctdb_ltdb_header_extract ( TDB_DATA * data , struct ctdb_ltdb_header * header ) ;
2017-06-29 16:27:33 +03:00
size_t ctdb_rec_data_len ( struct ctdb_rec_data * in ) ;
void ctdb_rec_data_push ( struct ctdb_rec_data * in , uint8_t * buf , size_t * npush ) ;
2015-04-14 10:20:05 +03:00
int ctdb_rec_data_pull ( uint8_t * buf , size_t buflen , TALLOC_CTX * mem_ctx ,
2017-06-29 16:27:33 +03:00
struct ctdb_rec_data * * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
2017-06-29 16:41:08 +03:00
size_t ctdb_rec_buffer_len ( struct ctdb_rec_buffer * in ) ;
void ctdb_rec_buffer_push ( struct ctdb_rec_buffer * in , uint8_t * buf ,
size_t * npush ) ;
2015-04-14 10:20:05 +03:00
int ctdb_rec_buffer_pull ( uint8_t * buf , size_t buflen , TALLOC_CTX * mem_ctx ,
2017-06-29 16:41:08 +03:00
struct ctdb_rec_buffer * * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
struct ctdb_rec_buffer * ctdb_rec_buffer_init ( TALLOC_CTX * mem_ctx ,
uint32_t db_id ) ;
int ctdb_rec_buffer_add ( TALLOC_CTX * mem_ctx , struct ctdb_rec_buffer * recbuf ,
uint32_t reqid , struct ctdb_ltdb_header * header ,
TDB_DATA key , TDB_DATA data ) ;
int ctdb_rec_buffer_traverse ( struct ctdb_rec_buffer * recbuf ,
ctdb_rec_parser_func_t func ,
void * private_data ) ;
2016-03-08 09:20:30 +03:00
int ctdb_rec_buffer_write ( struct ctdb_rec_buffer * recbuf , int fd ) ;
int ctdb_rec_buffer_read ( int fd , TALLOC_CTX * mem_ctx ,
struct ctdb_rec_buffer * * out ) ;
2017-07-13 08:15:25 +03:00
size_t ctdb_server_id_len ( struct ctdb_server_id * in ) ;
void ctdb_server_id_push ( struct ctdb_server_id * in , uint8_t * buf ,
size_t * npush ) ;
2015-04-14 10:20:05 +03:00
int ctdb_server_id_pull ( uint8_t * buf , size_t buflen ,
2017-07-13 08:15:25 +03:00
struct ctdb_server_id * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
2017-07-13 08:22:08 +03:00
size_t ctdb_g_lock_len ( struct ctdb_g_lock * in ) ;
void ctdb_g_lock_push ( struct ctdb_g_lock * in , uint8_t * buf , size_t * npush ) ;
int ctdb_g_lock_pull ( uint8_t * buf , size_t buflen , struct ctdb_g_lock * out ,
size_t * npull ) ;
2015-04-14 10:20:05 +03:00
2017-07-13 08:27:17 +03:00
size_t ctdb_g_lock_list_len ( struct ctdb_g_lock_list * in ) ;
void ctdb_g_lock_list_push ( struct ctdb_g_lock_list * in , uint8_t * buf ,
size_t * npush ) ;
2015-04-14 10:20:05 +03:00
int ctdb_g_lock_list_pull ( uint8_t * buf , size_t buflen , TALLOC_CTX * mem_ctx ,
2017-07-13 08:27:17 +03:00
struct ctdb_g_lock_list * * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
/* From protocol/protocol_header.c */
void ctdb_req_header_fill ( struct ctdb_req_header * h , uint32_t generation ,
uint32_t operation , uint32_t destnode ,
uint32_t srcnode , uint32_t reqid ) ;
2017-07-19 04:12:08 +03:00
size_t ctdb_req_header_len ( struct ctdb_req_header * in ) ;
void ctdb_req_header_push ( struct ctdb_req_header * in , uint8_t * buf ,
size_t * npush ) ;
2016-04-21 17:12:16 +03:00
int ctdb_req_header_pull ( uint8_t * buf , size_t buflen ,
2017-07-19 04:12:08 +03:00
struct ctdb_req_header * out , size_t * npull ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_header_verify ( struct ctdb_req_header * h , uint32_t operation ) ;
/* From protocol/protocol_call.c */
2016-04-21 17:45:01 +03:00
size_t ctdb_req_call_len ( struct ctdb_req_header * h ,
struct ctdb_req_call * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_call_push ( struct ctdb_req_header * h ,
struct ctdb_req_call * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_req_call_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_req_call * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_reply_call_len ( struct ctdb_req_header * h ,
struct ctdb_reply_call * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_call_push ( struct ctdb_req_header * h ,
struct ctdb_reply_call * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_reply_call_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_reply_call * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_reply_error_len ( struct ctdb_req_header * h ,
struct ctdb_reply_error * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_error_push ( struct ctdb_req_header * h ,
struct ctdb_reply_error * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_reply_error_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_reply_error * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_req_dmaster_len ( struct ctdb_req_header * h ,
struct ctdb_req_dmaster * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_dmaster_push ( struct ctdb_req_header * h ,
struct ctdb_req_dmaster * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_req_dmaster_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_req_dmaster * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_reply_dmaster_len ( struct ctdb_req_header * h ,
struct ctdb_reply_dmaster * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_dmaster_push ( struct ctdb_req_header * h ,
struct ctdb_reply_dmaster * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_reply_dmaster_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_reply_dmaster * c ) ;
/* From protocol/protocol_control.c */
2016-04-21 17:45:01 +03:00
size_t ctdb_req_control_len ( struct ctdb_req_header * h ,
struct ctdb_req_control * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_control_push ( struct ctdb_req_header * h ,
struct ctdb_req_control * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_req_control_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_req_control * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_reply_control_len ( struct ctdb_req_header * h ,
struct ctdb_reply_control * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_control_push ( struct ctdb_req_header * h ,
struct ctdb_reply_control * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_reply_control_pull ( uint8_t * buf , size_t buflen , uint32_t opcode ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_reply_control * c ) ;
/* From protocol/protocol_client.c */
void ctdb_req_control_process_exists ( struct ctdb_req_control * request ,
pid_t pid ) ;
int ctdb_reply_control_process_exists ( struct ctdb_reply_control * reply ,
int * status ) ;
void ctdb_req_control_statistics ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_statistics ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_statistics * * stats ) ;
void ctdb_req_control_ping ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_ping ( struct ctdb_reply_control * reply ,
int * num_clients ) ;
void ctdb_req_control_getdbpath ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_getdbpath ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx , const char * * db_path ) ;
void ctdb_req_control_getvnnmap ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_getvnnmap ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_vnn_map * * vnnmap ) ;
void ctdb_req_control_setvnnmap ( struct ctdb_req_control * request ,
struct ctdb_vnn_map * vnnmap ) ;
int ctdb_reply_control_setvnnmap ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_debug ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_debug ( struct ctdb_reply_control * reply ,
2016-11-25 05:23:11 +03:00
int * debug_level ) ;
2015-04-14 10:20:05 +03:00
void ctdb_req_control_set_debug ( struct ctdb_req_control * request ,
2016-11-25 05:23:11 +03:00
int debug_level ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_control_set_debug ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_dbmap ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_dbmap ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_dbid_map * * dbmap ) ;
void ctdb_req_control_pull_db ( struct ctdb_req_control * request ,
struct ctdb_pulldb * pulldb ) ;
int ctdb_reply_control_pull_db ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_rec_buffer * * recbuf ) ;
void ctdb_req_control_push_db ( struct ctdb_req_control * request ,
struct ctdb_rec_buffer * recbuf ) ;
int ctdb_reply_control_push_db ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_recmode ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_recmode ( struct ctdb_reply_control * reply ,
int * recmode ) ;
void ctdb_req_control_set_recmode ( struct ctdb_req_control * request ,
int recmode ) ;
int ctdb_reply_control_set_recmode ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_statistics_reset ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_statistics_reset ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_attach ( struct ctdb_req_control * request ,
2017-03-21 07:02:56 +03:00
const char * db_name ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_control_db_attach ( struct ctdb_reply_control * reply ,
uint32_t * db_id ) ;
void ctdb_req_control_traverse_start ( struct ctdb_req_control * request ,
struct ctdb_traverse_start * traverse ) ;
int ctdb_reply_control_traverse_start ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_register_srvid ( struct ctdb_req_control * request ,
uint64_t srvid ) ;
int ctdb_reply_control_register_srvid ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_deregister_srvid ( struct ctdb_req_control * request ,
uint64_t srvid ) ;
int ctdb_reply_control_deregister_srvid ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_dbname ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_get_dbname ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx , const char * * db_name ) ;
void ctdb_req_control_enable_seqnum ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_enable_seqnum ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_update_seqnum ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_update_seqnum ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_dump_memory ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_dump_memory ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx , const char * * mem_str ) ;
void ctdb_req_control_get_pid ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_pid ( struct ctdb_reply_control * reply ,
pid_t * pid ) ;
void ctdb_req_control_get_recmaster ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_recmaster ( struct ctdb_reply_control * reply ,
uint32_t * recmaster ) ;
void ctdb_req_control_set_recmaster ( struct ctdb_req_control * request ,
int recmaster ) ;
int ctdb_reply_control_set_recmaster ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_freeze ( struct ctdb_req_control * request ,
uint32_t priority ) ;
int ctdb_reply_control_freeze ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_pnn ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_pnn ( struct ctdb_reply_control * reply ,
uint32_t * pnn ) ;
void ctdb_req_control_shutdown ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_shutdown ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_monmode ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_monmode ( struct ctdb_reply_control * reply ,
int * mon_mode ) ;
void ctdb_req_control_tcp_client ( struct ctdb_req_control * request ,
struct ctdb_connection * conn ) ;
int ctdb_reply_control_tcp_client ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_tcp_add ( struct ctdb_req_control * request ,
struct ctdb_connection * conn ) ;
int ctdb_reply_control_tcp_add ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_tcp_remove ( struct ctdb_req_control * request ,
struct ctdb_connection * conn ) ;
int ctdb_reply_control_tcp_remove ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_startup ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_startup ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_set_tunable ( struct ctdb_req_control * request ,
struct ctdb_tunable * tunable ) ;
int ctdb_reply_control_set_tunable ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_tunable ( struct ctdb_req_control * request ,
const char * name ) ;
int ctdb_reply_control_get_tunable ( struct ctdb_reply_control * reply ,
uint32_t * value ) ;
void ctdb_req_control_list_tunables ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_list_tunables ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_var_list * * tun_var_list ) ;
void ctdb_req_control_modify_flags ( struct ctdb_req_control * request ,
struct ctdb_node_flag_change * flag_change ) ;
int ctdb_reply_control_modify_flags ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_all_tunables ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_all_tunables ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_tunable_list * * tun_list ) ;
void ctdb_req_control_get_tcp_tickle_list ( struct ctdb_req_control * request ,
ctdb_sock_addr * addr ) ;
int ctdb_reply_control_get_tcp_tickle_list ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_tickle_list * * tickles ) ;
void ctdb_req_control_set_tcp_tickle_list ( struct ctdb_req_control * request ,
struct ctdb_tickle_list * tickles ) ;
int ctdb_reply_control_set_tcp_tickle_list ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_attach_persistent ( struct ctdb_req_control * request ,
2017-03-21 07:02:56 +03:00
const char * name ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_control_db_attach_persistent ( struct ctdb_reply_control * reply ,
uint32_t * db_id ) ;
void ctdb_req_control_update_record ( struct ctdb_req_control * request ,
struct ctdb_rec_buffer * recbuf ) ;
int ctdb_reply_control_update_record ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_send_gratuitous_arp ( struct ctdb_req_control * request ,
struct ctdb_addr_info * addr_info ) ;
int ctdb_reply_control_send_gratuitous_arp ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_wipe_database ( struct ctdb_req_control * request ,
struct ctdb_transdb * transdb ) ;
int ctdb_reply_control_wipe_database ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_uptime ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_uptime ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_uptime * * uptime ) ;
void ctdb_req_control_start_recovery ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_start_recovery ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_end_recovery ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_end_recovery ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_reload_nodes_file ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_reload_nodes_file ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_try_delete_records ( struct ctdb_req_control * request ,
struct ctdb_rec_buffer * recbuf ) ;
int ctdb_reply_control_try_delete_records ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_rec_buffer * * recbuf ) ;
void ctdb_req_control_enable_monitor ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_enable_monitor ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_disable_monitor ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_disable_monitor ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_add_public_ip ( struct ctdb_req_control * request ,
struct ctdb_addr_info * addr_info ) ;
int ctdb_reply_control_add_public_ip ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_del_public_ip ( struct ctdb_req_control * request ,
struct ctdb_addr_info * addr_info ) ;
int ctdb_reply_control_del_public_ip ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_capabilities ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_capabilities ( struct ctdb_reply_control * reply ,
uint32_t * caps ) ;
void ctdb_req_control_recd_ping ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_recd_ping ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_release_ip ( struct ctdb_req_control * request ,
struct ctdb_public_ip * pubip ) ;
int ctdb_reply_control_release_ip ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_takeover_ip ( struct ctdb_req_control * request ,
struct ctdb_public_ip * pubip ) ;
int ctdb_reply_control_takeover_ip ( struct ctdb_reply_control * reply ) ;
2016-11-10 08:11:12 +03:00
void ctdb_req_control_get_public_ips ( struct ctdb_req_control * request ,
bool available_only ) ;
2015-04-14 10:20:05 +03:00
int ctdb_reply_control_get_public_ips ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_public_ip_list * * pubip_list ) ;
void ctdb_req_control_get_nodemap ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_nodemap ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_node_map * * nodemap ) ;
void ctdb_req_control_traverse_kill ( struct ctdb_req_control * request ,
struct ctdb_traverse_start * traverse ) ;
int ctdb_reply_control_traverse_kill ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_recd_reclock_latency ( struct ctdb_req_control * request ,
double reclock_latency ) ;
int ctdb_reply_control_recd_reclock_latency ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_reclock_file ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_reclock_file ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
const char * * reclock_file ) ;
void ctdb_req_control_stop_node ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_stop_node ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_continue_node ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_continue_node ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_set_lmasterrole ( struct ctdb_req_control * request ,
uint32_t lmaster_role ) ;
int ctdb_reply_control_set_lmasterrole ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_set_recmasterrole ( struct ctdb_req_control * request ,
uint32_t recmaster_role ) ;
int ctdb_reply_control_set_recmasterrole ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_set_ban_state ( struct ctdb_req_control * request ,
struct ctdb_ban_state * ban_state ) ;
int ctdb_reply_control_set_ban_state ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_ban_state ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_ban_state ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_ban_state * * ban_state ) ;
void ctdb_req_control_register_notify ( struct ctdb_req_control * request ,
struct ctdb_notify_data * notify ) ;
int ctdb_reply_control_register_notify ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_deregister_notify ( struct ctdb_req_control * request ,
uint64_t srvid ) ;
int ctdb_reply_control_deregister_notify ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_trans3_commit ( struct ctdb_req_control * request ,
struct ctdb_rec_buffer * recbuf ) ;
int ctdb_reply_control_trans3_commit ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_db_seqnum ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_get_db_seqnum ( struct ctdb_reply_control * reply ,
uint64_t * seqnum ) ;
void ctdb_req_control_db_set_healthy ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_set_healthy ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_get_health ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_get_health ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
const char * * reason ) ;
void ctdb_req_control_get_public_ip_info ( struct ctdb_req_control * request ,
ctdb_sock_addr * addr ) ;
int ctdb_reply_control_get_public_ip_info ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_public_ip_info * * ipinfo ) ;
void ctdb_req_control_get_ifaces ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_ifaces ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_iface_list * * iface_list ) ;
void ctdb_req_control_set_iface_link_state ( struct ctdb_req_control * request ,
struct ctdb_iface * iface ) ;
int ctdb_reply_control_set_iface_link_state ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_tcp_add_delayed_update ( struct ctdb_req_control * request ,
struct ctdb_connection * conn ) ;
int ctdb_reply_control_tcp_add_delayed_update ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_stat_history ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_stat_history ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_statistics_list * * stats_list ) ;
void ctdb_req_control_schedule_for_deletion ( struct ctdb_req_control * request ,
struct ctdb_key_data * key ) ;
int ctdb_reply_control_schedule_for_deletion ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_set_db_readonly ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_set_db_readonly ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_traverse_start_ext ( struct ctdb_req_control * request ,
struct ctdb_traverse_start_ext * traverse ) ;
int ctdb_reply_control_traverse_start_ext ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_db_statistics ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_get_db_statistics ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_db_statistics * * dbstats ) ;
void ctdb_req_control_set_db_sticky ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_set_db_sticky ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_reload_public_ips ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_reload_public_ips ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_receive_records ( struct ctdb_req_control * request ,
struct ctdb_rec_buffer * recbuf ) ;
int ctdb_reply_control_receive_records ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_rec_buffer * * recbuf ) ;
void ctdb_req_control_ipreallocated ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_ipreallocated ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_runstate ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_runstate ( struct ctdb_reply_control * reply ,
enum ctdb_runstate * runstate ) ;
void ctdb_req_control_db_detach ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_detach ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_get_nodes_file ( struct ctdb_req_control * request ) ;
int ctdb_reply_control_get_nodes_file ( struct ctdb_reply_control * reply ,
TALLOC_CTX * mem_ctx ,
struct ctdb_node_map * * nodemap ) ;
2015-07-31 18:47:22 +03:00
void ctdb_req_control_db_freeze ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_freeze ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_thaw ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_thaw ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_transaction_start ( struct ctdb_req_control * request ,
struct ctdb_transdb * transdb ) ;
int ctdb_reply_control_db_transaction_start ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_transaction_commit ( struct ctdb_req_control * request ,
struct ctdb_transdb * transdb ) ;
int ctdb_reply_control_db_transaction_commit ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_transaction_cancel ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_transaction_cancel ( struct ctdb_reply_control * reply ) ;
2016-02-19 02:54:15 +03:00
void ctdb_req_control_db_pull ( struct ctdb_req_control * request ,
struct ctdb_pulldb_ext * pulldb_ext ) ;
int ctdb_reply_control_db_pull ( struct ctdb_reply_control * reply ,
uint32_t * num_records ) ;
void ctdb_req_control_db_push_start ( struct ctdb_req_control * request ,
struct ctdb_pulldb_ext * pulldb_ext ) ;
int ctdb_reply_control_db_push_start ( struct ctdb_reply_control * reply ) ;
void ctdb_req_control_db_push_confirm ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_push_confirm ( struct ctdb_reply_control * reply ,
uint32_t * num_records ) ;
2017-06-14 09:24:02 +03:00
void ctdb_req_control_db_open_flags ( struct ctdb_req_control * request ,
uint32_t db_id ) ;
int ctdb_reply_control_db_open_flags ( struct ctdb_reply_control * reply ,
int * tdb_flags ) ;
2017-03-02 09:07:13 +03:00
void ctdb_req_control_db_attach_replicated ( struct ctdb_req_control * request ,
const char * db_name ) ;
int ctdb_reply_control_db_attach_replicated ( struct ctdb_reply_control * reply ,
uint32_t * db_id ) ;
2016-03-10 06:00:56 +03:00
/* From protocol/protocol_debug.c */
void ctdb_packet_print ( uint8_t * buf , size_t buflen , FILE * fp ) ;
2015-04-14 10:20:05 +03:00
/* From protocol/protocol_message.c */
2016-04-21 17:45:01 +03:00
size_t ctdb_req_message_len ( struct ctdb_req_header * h ,
struct ctdb_req_message * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_message_push ( struct ctdb_req_header * h ,
struct ctdb_req_message * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_req_message_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_req_message * c ) ;
2016-04-21 17:45:01 +03:00
size_t ctdb_req_message_data_len ( struct ctdb_req_header * h ,
struct ctdb_req_message_data * c ) ;
2015-04-14 10:20:05 +03:00
int ctdb_req_message_data_push ( struct ctdb_req_header * h ,
2016-04-21 18:08:11 +03:00
struct ctdb_req_message_data * c ,
2016-05-01 15:13:35 +03:00
uint8_t * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
2016-04-21 18:25:06 +03:00
int ctdb_req_message_data_pull ( uint8_t * buf , size_t buflen ,
2015-04-14 10:20:05 +03:00
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
2016-04-21 18:25:06 +03:00
struct ctdb_req_message_data * c ) ;
2015-04-14 10:20:05 +03:00
2017-06-28 09:50:53 +03:00
/* From protocol/protocol_keepalive.c */
size_t ctdb_req_keepalive_len ( struct ctdb_req_header * h ,
struct ctdb_req_keepalive * c ) ;
int ctdb_req_keepalive_push ( struct ctdb_req_header * h ,
struct ctdb_req_keepalive * c ,
uint8_t * buf , size_t * buflen ) ;
int ctdb_req_keepalive_pull ( uint8_t * buf , size_t buflen ,
struct ctdb_req_header * h ,
TALLOC_CTX * mem_ctx ,
struct ctdb_req_keepalive * c ) ;
2016-08-31 10:02:55 +03:00
/* From protocol/protocol_event.c */
void ctdb_event_header_fill ( struct ctdb_event_header * h , uint32_t reqid ) ;
size_t ctdb_event_request_len ( struct ctdb_event_request * in ) ;
int ctdb_event_request_push ( struct ctdb_event_request * in ,
uint8_t * buf , size_t * buflen ) ;
int ctdb_event_request_pull ( uint8_t * buf , size_t buflen ,
TALLOC_CTX * mem_ctx ,
struct ctdb_event_request * out ) ;
size_t ctdb_event_reply_len ( struct ctdb_event_reply * in ) ;
int ctdb_event_reply_push ( struct ctdb_event_reply * in ,
uint8_t * buf , size_t * buflen ) ;
int ctdb_event_reply_pull ( uint8_t * buf , size_t buflen ,
TALLOC_CTX * mem_ctx ,
struct ctdb_event_reply * out ) ;
2016-04-28 11:12:36 +03:00
/* From protocol/protocol_packet.c */
int ctdb_allocate_pkt ( TALLOC_CTX * mem_ctx , size_t datalen ,
uint8_t * * buf , size_t * buflen ) ;
2015-04-14 10:20:05 +03:00
/* From protocol/protocol_util.c */
const char * ctdb_runstate_to_string ( enum ctdb_runstate runstate ) ;
enum ctdb_runstate ctdb_runstate_from_string ( const char * runstate_str ) ;
const char * ctdb_event_to_string ( enum ctdb_event event ) ;
enum ctdb_event ctdb_event_from_string ( const char * event_str ) ;
2015-11-02 08:24:15 +03:00
const char * ctdb_sock_addr_to_string ( TALLOC_CTX * mem_ctx , ctdb_sock_addr * addr ) ;
2016-05-23 03:35:10 +03:00
int ctdb_sock_addr_cmp_ip ( const ctdb_sock_addr * addr1 ,
const ctdb_sock_addr * addr2 ) ;
int ctdb_sock_addr_cmp ( const ctdb_sock_addr * addr1 ,
const ctdb_sock_addr * addr2 ) ;
bool ctdb_sock_addr_same_ip ( const ctdb_sock_addr * addr1 ,
const ctdb_sock_addr * addr2 ) ;
bool ctdb_sock_addr_same ( const ctdb_sock_addr * addr1 ,
const ctdb_sock_addr * addr2 ) ;
2015-11-02 08:24:15 +03:00
2015-04-14 10:20:05 +03:00
# endif /* __CTDB_PROTOCOL_API_H__ */