34#ifndef COROAPI_H_DEFINED
35#define COROAPI_H_DEFINED
75#define TIMER_HANDLE_T 1
86#define TOTEMIP_ADDRLEN (sizeof(struct in6_addr))
88#define INTERFACE_MAX 8
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
214 const unsigned int *view_list,
215 size_t view_list_entries,
216 int primary_designated,
230 unsigned long long nanoseconds_in_future,
232 void (*timer_nf) (
void *data),
236 unsigned long long nanoseconds_from_epoch,
238 void (*timer_fn) (
void *data),
256 void *(*ipc_private_data_get) (
void *conn);
261 const struct iovec *iov,
unsigned int iov_len);
266 const struct iovec *iov,
unsigned int iov_len);
280 unsigned int iov_len,
unsigned int guarantee);
284 unsigned int *interface_ids,
286 unsigned int interfaces_size,
288 unsigned int *iface_count);
290 const char *(*totem_ifaces_print) (
unsigned int nodeid);
314 unsigned int msg_len,
315 int endian_conversion_required),
319 const unsigned int *member_list,
320 size_t member_list_entries,
321 const unsigned int *left_list,
322 size_t left_list_entries,
323 const unsigned int *joined_list,
324 size_t joined_list_entries,
341 void *totempg_groups_instance,
342 const struct iovec *iovec,
343 unsigned int iov_len,
347 void *totempg_groups_instance,
348 const struct iovec *iovec,
349 unsigned int iov_len);
359 const struct iovec *iovec,
360 unsigned int iov_len);
366 const struct iovec *iovec,
367 unsigned int iov_len);
374 int (schedwrk_fn) (
const void *),
375 const void *context);
380 const char *service_name);
399 const char *iface_name,
411 const char *service_name,
412 unsigned int service_ver);
416 const char *service_name,
417 unsigned int service_ver);
424#define corosync_fatal_error(err) api->fatal_error ((err), __FILE__, __LINE__)
433 qb_loop_t *(*poll_handle_get) (void);
435 void *(*totem_get_stats)(void);
439 int (schedwrk_fn) (
const void *),
440 const void *context);
447 int (*dispatch_fn) (
int fd,
458#define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
460#define SERVICE_HANDLER_MAXIMUM_COUNT 64
462#define SERVICES_COUNT_MAX 64
511 const unsigned int *member_list,
size_t member_list_entries,
512 const unsigned int *left_list,
size_t left_list_entries,
513 const unsigned int *joined_list,
size_t joined_list_entries,
516 const unsigned int *trans_list,
517 size_t trans_list_entries,
518 const unsigned int *member_list,
519 size_t member_list_entries,
totem_configuration_type
The totem_configuration_type enum.
@ TOTEM_CONFIGURATION_REGULAR
@ TOTEM_CONFIGURATION_TRANSITIONAL
#define CS_FLOW_CONTROL_STATE_ENABLED
cs_lib_allow_inquorate
The cs_lib_allow_inquorate enum.
@ CS_LIB_DISALLOW_INQUORATE
qb_loop_timer_handle corosync_timer_handle_t
corosync_timer_handle_t
enum totem_configuration_type __attribute__
unsigned char addr[TOTEMIP_ADDRLEN]
void(* quorum_callback_fn_t)(int quorate, void *context)
The quorum_callback_fn_t callback.
totem_callback_token_type
The totem_callback_token_type enum.
@ TOTEM_CALLBACK_TOKEN_SENT
@ TOTEM_CALLBACK_TOKEN_RECEIVED
cs_lib_flow_control
The cs_lib_flow_control enum.
@ CS_LIB_FLOW_CONTROL_REQUIRED
@ CS_LIB_FLOW_CONTROL_NOT_REQUIRED
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_fatal_error_t
The cs_fatal_error_t enum.
@ COROSYNC_INVALID_CONFIG
@ COROSYNC_FATAL_ERROR_EXIT
cs_flow_control_state
The cs_flow_control_state enum.
#define CS_FLOW_CONTROL_STATE_DISABLED
The corosync_api_v1 struct.
int(* timer_add_duration)(unsigned long long nanoseconds_in_future, void *data, void(*timer_nf)(void *data), corosync_timer_handle_t *handle)
int(* totem_crypto_set)(const char *cipher_type, const char *hash_type)
unsigned long long(* timer_time_get)(void)
int(* tpg_groups_mcast)(void *instance, int guarantee, const struct corosync_tpg_group *groups, size_t groups_cnt, const struct iovec *iovec, unsigned int iov_len)
int(* totem_mcast)(const struct iovec *iovec, unsigned int iov_len, unsigned int guarantee)
int(* poll_dispatch_delete)(qb_loop_t *handle, int fd)
int(* quorum_initialize)(struct quorum_callin_functions *fns)
int(* ipc_source_is_local)(const mar_message_source_t *source)
int(* plugin_interface_reference)(hdb_handle_t *handle, const char *iface_name, int version, void **interface, void *context)
void(* timer_delete)(corosync_timer_handle_t timer_handle)
int(* tpg_join)(void *instance, const struct corosync_tpg_group *groups, size_t group_cnt)
int(* tpg_joined_release)(int reserved_msgs)
unsigned int(* totem_nodeid_get)(void)
unsigned int(* service_link_and_init)(struct corosync_api_v1 *corosync_api_v1, const char *service_name, unsigned int service_ver)
int(* tpg_groups_release)(int reserved_msgs)
void(* fatal_error)(cs_fatal_error_t err, const char *file, unsigned int line) __attribute__((noreturn))
int(* tpg_leave)(void *instance, const struct corosync_tpg_group *groups, size_t group_cnt)
void(* ipc_refcnt_dec)(void *conn)
int(* tpg_init)(void **instance, void(*deliver_fn)(unsigned int nodeid, const void *msg, unsigned int msg_len, int endian_conversion_required), void(*confchg_fn)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id))
void(* schedwrk_destroy)(hdb_handle_t handle)
int(* ipc_response_iov_send)(void *conn, const struct iovec *iov, unsigned int iov_len)
void(* ipc_source_set)(mar_message_source_t *source, void *conn)
int(* schedwrk_create_nolock)(hdb_handle_t *handle, int(schedwrk_fn)(const void *), const void *context)
void(* shutdown_request)(void)
int(* totem_ifaces_get)(unsigned int nodeid, unsigned int *interface_ids, struct totem_ip_address *interfaces, unsigned int interfaces_size, char ***status, unsigned int *iface_count)
int(* plugin_interface_release)(hdb_handle_t handle)
int(* quorum_register_callback)(quorum_callback_fn_t callback_fn, void *context)
void(* ipc_refcnt_inc)(void *conn)
int(* tpg_exit)(void *instance)
int(* ipc_dispatch_send)(void *conn, const void *msg, size_t mlen)
int(* schedwrk_create)(hdb_handle_t *handle, int(schedwrk_fn)(const void *), const void *context)
int(* tpg_joined_reserve)(void *totempg_groups_instance, const struct iovec *iovec, unsigned int iov_len)
int(* tpg_joined_mcast)(void *totempg_groups_instance, const struct iovec *iovec, unsigned int iov_len, int guarantee)
int(* totem_family_get)(void)
int(* sync_request)(const char *service_name)
int(* poll_dispatch_add)(qb_loop_t *handle, int fd, int events, void *data, int(*dispatch_fn)(int fd, int revents, void *data))
unsigned long long(* timer_expire_time_get)(corosync_timer_handle_t timer_handle)
int(* ipc_response_send)(void *conn, const void *msg, size_t mlen)
void(* error_memory_failure)(void) __attribute__((noreturn))
int(* ipc_dispatch_iov_send)(void *conn, const struct iovec *iov, unsigned int iov_len)
int(* tpg_groups_reserve)(void *instance, const struct corosync_tpg_group *groups, size_t groups_cnt, const struct iovec *iovec, unsigned int iov_len)
int(* quorum_unregister_callback)(quorum_callback_fn_t callback_fn, void *context)
unsigned int(* service_unlink_and_exit)(struct corosync_api_v1 *corosync_api_v1, const char *service_name, unsigned int service_ver)
int(* quorum_is_quorate)(void)
int(* timer_add_absolute)(unsigned long long nanoseconds_from_epoch, void *data, void(*timer_fn)(void *data), corosync_timer_handle_t *handle)
int(* totem_callback_token_create)(void **handle_out, enum totem_callback_token_type type, int delete, int(*callback_fn)(enum totem_callback_token_type type, const void *), const void *data)
The corosync_exec_handler struct.
void(* exec_handler_fn)(const void *msg, unsigned int nodeid)
void(* exec_endian_convert_fn)(void *msg)
The corosync_lib_handler struct.
enum cs_lib_flow_control flow_control
void(* lib_handler_fn)(void *conn, const void *msg)
The corosync_service_engine_iface_ver0 struct.
The corosync_service_engine struct.
void(* sync_init)(const unsigned int *trans_list, size_t trans_list_entries, const unsigned int *member_list, size_t member_list_entries, const struct memb_ring_id *ring_id)
int(* lib_exit_fn)(void *conn)
int(* config_init_fn)(struct corosync_api_v1 *)
void(* sync_activate)(void)
enum cs_lib_allow_inquorate allow_inquorate
int(* lib_init_fn)(void *conn)
void(* confchg_fn)(enum totem_configuration_type configuration_type, const unsigned int *member_list, size_t member_list_entries, const unsigned int *left_list, size_t left_list_entries, const unsigned int *joined_list, size_t joined_list_entries, const struct memb_ring_id *ring_id)
enum cs_lib_flow_control flow_control
struct corosync_exec_handler * exec_engine
int(* exec_exit_fn)(void)
void(* exec_dump_fn)(void)
struct corosync_lib_handler * lib_engine
int(* sync_process)(void)
The corosync_tpg_group struct.
The mar_message_source_t struct.
void *conn __attribute__((aligned(8)))
uint32_t nodeid __attribute__((aligned(8)))
The quorum_callin_functions struct.
int(* unregister_callback)(quorum_callback_fn_t callback_fn, void *context)
int(* register_callback)(quorum_callback_fn_t callback_fn, void *contexxt)
The totem_ip_address struct.
unsigned char addr[TOTEMIP_ADDRLEN]
#define swab32(x)
The swab32 macro.
struct memb_ring_id ring_id