34 #ifndef COROAPI_H_DEFINED 35 #define COROAPI_H_DEFINED 44 #include <qb/qbloop.h> 70 #ifndef TIMER_HANDLE_T 75 #define TIMER_HANDLE_T 1 86 #define TOTEMIP_ADDRLEN (sizeof(struct in6_addr)) 88 #define INTERFACE_MAX 2 90 #ifndef MESSAGE_QUEUE_MAX 91 #ifdef HAVE_SMALL_MEMORY_FOOTPRINT 92 #define PROCESSOR_COUNT_MAX 16 93 #define MESSAGE_SIZE_MAX 1024*64 94 #define MESSAGE_QUEUE_MAX 512 96 #define PROCESSOR_COUNT_MAX 384 97 #define MESSAGE_SIZE_MAX 1024*1024 98 #define MESSAGE_QUEUE_MAX ((4 * MESSAGE_SIZE_MAX) / totem_config->net_mtu) 102 #define TOTEM_AGREED 0 105 #define MILLI_2_NANO_SECONDS 1000000ULL 107 #if !defined(TOTEM_IP_ADDRESS) 118 #if !defined(MEMB_RING_ID) 128 #if !defined(TOTEM_CONFIGURATION_TYPE) 138 #if !defined(TOTEM_CALLBACK_TOKEN_TYPE) 155 #define corosync_lib_flow_control cs_lib_flow_control 156 #define COROSYNC_LIB_FLOW_CONTROL_REQUIRED CS_LIB_FLOW_CONTROL_REQUIRED 157 #define COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED CS_LIB_FLOW_CONTROL_NOT_REQUIRED 167 #if !defined (COROSYNC_FLOW_CONTROL_STATE) 175 #define corosync_flow_control_state cs_flow_control_state 176 #define CS_FLOW_CONTROL_STATE_DISABLED CS_FLOW_CONTROL_STATE_DISABLED 177 #define CS_FLOW_CONTROL_STATE_ENABLED CS_FLOW_CONTROL_STATE_ENABLED 193 #define corosync_fatal_error_t cs_fatal_error_t; 195 #ifndef QUORUM_H_DEFINED 205 int (*quorate) (void);
214 const unsigned int *view_list,
215 size_t view_list_entries,
216 int primary_designated,
229 int (*timer_add_duration) (
230 unsigned long long nanoseconds_in_future,
232 void (*timer_nf) (
void *
data),
235 int (*timer_add_absolute) (
236 unsigned long long nanoseconds_from_epoch,
238 void (*timer_fn) (
void *
data),
241 void (*timer_delete) (
244 unsigned long long (*timer_time_get) (void);
246 unsigned long long (*timer_expire_time_get) (
256 void *(*ipc_private_data_get) (
void *conn);
258 int (*ipc_response_send) (
void *conn,
const void *msg,
size_t mlen);
260 int (*ipc_response_iov_send) (
void *conn,
261 const struct iovec *iov,
unsigned int iov_len);
263 int (*ipc_dispatch_send) (
void *conn,
const void *msg,
size_t mlen);
265 int (*ipc_dispatch_iov_send) (
void *conn,
266 const struct iovec *iov,
unsigned int iov_len);
268 void (*ipc_refcnt_inc) (
void *conn);
270 void (*ipc_refcnt_dec) (
void *conn);
275 unsigned int (*totem_nodeid_get) (void);
277 int (*totem_family_get) (void);
279 int (*totem_ring_reenable) (void);
281 int (*totem_mcast) (
const struct iovec *iovec,
282 unsigned int iov_len,
unsigned int guarantee);
284 int (*totem_ifaces_get) (
287 unsigned int interfaces_size,
289 unsigned int *iface_count);
291 const char *(*totem_ifaces_print) (
unsigned int nodeid);
295 int (*totem_crypto_set) (
const char *cipher_type,
const char *hash_type);
297 int (*totem_callback_token_create) (
315 unsigned int msg_len,
316 int endian_conversion_required),
320 const unsigned int *member_list,
321 size_t member_list_entries,
322 const unsigned int *left_list,
323 size_t left_list_entries,
324 const unsigned int *joined_list,
325 size_t joined_list_entries,
341 int (*tpg_joined_mcast) (
342 void *totempg_groups_instance,
343 const struct iovec *iovec,
344 unsigned int iov_len,
347 int (*tpg_joined_reserve) (
348 void *totempg_groups_instance,
349 const struct iovec *iovec,
350 unsigned int iov_len);
352 int (*tpg_joined_release) (
355 int (*tpg_groups_mcast) (
360 const struct iovec *iovec,
361 unsigned int iov_len);
363 int (*tpg_groups_reserve) (
367 const struct iovec *iovec,
368 unsigned int iov_len);
370 int (*tpg_groups_release) (
375 int (schedwrk_fn) (
const void *),
376 const void *context);
380 int (*sync_request) (
381 const char *service_name);
386 int (*quorum_is_quorate) (void);
398 int (*plugin_interface_reference) (
400 const char *iface_name,
410 unsigned int (*service_link_and_init) (
412 const char *service_name,
413 unsigned int service_ver);
416 struct corosync_api_v1 *corosync_api_v1,
417 const char *service_name,
418 unsigned int service_ver);
425 #define corosync_fatal_error(err) api->fatal_error ((err), __FILE__, __LINE__) 428 unsigned int line) __attribute__ ((noreturn));
434 qb_loop_t *(*poll_handle_get) (void);
436 void *(*totem_get_stats)(void);
440 int (schedwrk_fn) (
const void *),
441 const void *context);
448 int (*dispatch_fn) (
int fd,
459 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) ) 461 #define SERVICE_HANDLER_MAXIMUM_COUNT 64 463 #define SERVICES_COUNT_MAX 64 469 void (*lib_handler_fn) (
void *conn,
const void *msg);
477 void (*exec_handler_fn) (
const void *msg,
unsigned int nodeid);
478 void (*exec_endian_convert_fn) (
void *msg);
500 char *(*exec_init_fn) (
struct corosync_api_v1 *);
501 int (*exec_exit_fn) (void);
502 void (*exec_dump_fn) (void);
503 int (*lib_init_fn) (
void *conn);
504 int (*lib_exit_fn) (
void *conn);
509 int (*config_init_fn) (
struct corosync_api_v1 *);
512 const unsigned int *member_list,
size_t member_list_entries,
513 const unsigned int *left_list,
size_t left_list_entries,
514 const unsigned int *joined_list,
size_t joined_list_entries,
517 const unsigned int *trans_list,
518 size_t trans_list_entries,
519 const unsigned int *member_list,
520 size_t member_list_entries,
522 int (*sync_process) (void);
523 void (*sync_activate) (void);
int(* poll_dispatch_add)(qb_loop_t *handle, int fd, int events, void *data, int(*dispatch_fn)(int fd, int revents, void *data))
enum totem_configuration_type __attribute__
#define CS_FLOW_CONTROL_STATE_DISABLED
The totem_ip_address struct.
The corosync_service_engine struct.
int sync_init(int(*sync_callbacks_retrieve)(int service_id, struct sync_callbacks *callbacks), void(*synchronization_completed)(void))
void(* shutdown_request)(void)
void(* fatal_error)(cs_fatal_error_t err, const char *file, unsigned int line) __attribute__((noreturn))
totem_configuration_type
The totem_configuration_type enum.
cs_fatal_error_t
The cs_fatal_error_t enum.
The corosync_lib_handler struct.
unsigned char addr[TOTEMIP_ADDRLEN]
The corosync_exec_handler struct.
The quorum_callin_functions struct.
The corosync_service_engine_iface_ver0 struct.
The corosync_tpg_group struct.
void schedwrk_destroy(hdb_handle_t handle)
#define CS_FLOW_CONTROL_STATE_ENABLED
void(* error_memory_failure)(void) __attribute__((noreturn))
struct corosync_exec_handler * exec_engine
struct corosync_lib_handler * lib_engine
cs_flow_control_state
The cs_flow_control_state enum.
int schedwrk_create_nolock(hdb_handle_t *handle, int(schedwrk_fn)(const void *), const void *context)
The corosync_api_v1 struct.
void(* quorum_callback_fn_t)(int quorate, void *context)
The quorum_callback_fn_t callback.
#define swab32(x)
The swab32 macro.
void(* sync_callback_fn_t)(const unsigned int *view_list, size_t view_list_entries, int primary_designated, struct memb_ring_id *ring_id)
The sync_callback_fn_t callback.
cs_lib_allow_inquorate
The cs_lib_allow_inquorate enum.
qb_loop_timer_handle corosync_timer_handle_t
corosync_timer_handle_t
cs_lib_flow_control
The cs_lib_flow_control enum.
unsigned int private_data_size
struct memb_ring_id ring_id
int(* poll_dispatch_delete)(qb_loop_t *handle, int fd)
unsigned int(* service_unlink_and_exit)(struct corosync_api_v1 *corosync_api_v1, const char *service_name, unsigned int service_ver)
int schedwrk_create(hdb_handle_t *handle, int(schedwrk_fn)(const void *), const void *context)
cs_error_t quorum_initialize(quorum_handle_t *handle, quorum_callbacks_t *callbacks, uint32_t *quorum_type)
Create a new quorum connection.
totem_callback_token_type
The totem_callback_token_type enum.
The mar_message_source_t struct.
struct totem_ip_address rep