corosync 3.1.7
Functions
The closed process group API

Functions

cs_error_t cpg_initialize (cpg_handle_t *handle, cpg_callbacks_t *callbacks)
 Create a new cpg connection. More...
 
cs_error_t cpg_model_initialize (cpg_handle_t *handle, cpg_model_t model, cpg_model_data_t *model_data, void *context)
 Create a new cpg connection, initialize with model. More...
 
cs_error_t cpg_finalize (cpg_handle_t handle)
 Close the cpg handle. More...
 
cs_error_t cpg_fd_get (cpg_handle_t handle, int *fd)
 Get a file descriptor on which to poll. More...
 
cs_error_t cpg_max_atomic_msgsize_get (cpg_handle_t handle, uint32_t *size)
 Get maximum size of a message that will not be fragmented. More...
 
cs_error_t cpg_context_get (cpg_handle_t handle, void **context)
 Get contexts for a CPG handle. More...
 
cs_error_t cpg_context_set (cpg_handle_t handle, void *context)
 Set contexts for a CPG handle. More...
 
cs_error_t cpg_dispatch (cpg_handle_t handle, cs_dispatch_flags_t dispatch_types)
 Dispatch messages and configuration changes. More...
 
cs_error_t cpg_join (cpg_handle_t handle, const struct cpg_name *group)
 Join one or more groups. More...
 
cs_error_t cpg_leave (cpg_handle_t handle, const struct cpg_name *group)
 Leave one or more groups. More...
 
cs_error_t cpg_membership_get (cpg_handle_t handle, struct cpg_name *group_name, struct cpg_address *member_list, int *member_list_entries)
 Get membership information from cpg. More...
 
cs_error_t cpg_local_get (cpg_handle_t handle, unsigned int *local_nodeid)
 cpg_local_get More...
 
cs_error_t cpg_flow_control_state_get (cpg_handle_t handle, cpg_flow_control_state_t *flow_control_state)
 cpg_flow_control_state_get More...
 
cs_error_t cpg_zcb_alloc (cpg_handle_t handle, size_t size, void **buffer)
 cpg_zcb_alloc More...
 
cs_error_t cpg_zcb_free (cpg_handle_t handle, void *buffer)
 cpg_zcb_free More...
 
cs_error_t cpg_zcb_mcast_joined (cpg_handle_t handle, cpg_guarantee_t guarantee, void *msg, size_t msg_len)
 cpg_zcb_mcast_joined More...
 
cs_error_t cpg_mcast_joined (cpg_handle_t handle, cpg_guarantee_t guarantee, const struct iovec *iovec, unsigned int iov_len)
 Multicast to groups joined with cpg_join. More...
 
cs_error_t cpg_iteration_initialize (cpg_handle_t handle, cpg_iteration_type_t iteration_type, const struct cpg_name *group, cpg_iteration_handle_t *cpg_iteration_handle)
 cpg_iteration_initialize More...
 
cs_error_t cpg_iteration_next (cpg_iteration_handle_t handle, struct cpg_iteration_description_t *description)
 cpg_iteration_next More...
 
cs_error_t cpg_iteration_finalize (cpg_iteration_handle_t handle)
 cpg_iteration_finalize More...
 

Detailed Description

Function Documentation

◆ cpg_context_get()

cs_error_t cpg_context_get ( cpg_handle_t  handle,
void **  context 
)

Get contexts for a CPG handle.

Parameters
handle
context
Returns

Definition at line 332 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_context_set()

cs_error_t cpg_context_set ( cpg_handle_t  handle,
void *  context 
)

Set contexts for a CPG handle.

Parameters
handle
context
Returns

Definition at line 351 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_dispatch()

cs_error_t cpg_dispatch ( cpg_handle_t  handle,
cs_dispatch_flags_t  dispatch_types 
)

Dispatch messages and configuration changes.

Parameters
handle
dispatch_types
Returns

Definition at line 370 of file lib/cpg.c.

References CPG_MEMBERS_MAX, hdb_error_to_cs(), IPC_DISPATCH_SIZE, and ring_id.

◆ cpg_fd_get()

cs_error_t cpg_fd_get ( cpg_handle_t  handle,
int *  fd 
)

Get a file descriptor on which to poll.

cpg_handle_t is NOT a file descriptor and may not be used directly.

Parameters
handle
fd
Returns

Definition at line 294 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_finalize()

cs_error_t cpg_finalize ( cpg_handle_t  handle)

Close the cpg handle.

Parameters
handle
Returns

Definition at line 249 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_flow_control_state_get()

cs_error_t cpg_flow_control_state_get ( cpg_handle_t  handle,
cpg_flow_control_state_t flow_control_enabled 
)

cpg_flow_control_state_get

Parameters
handle
flow_control_enabled
Returns

Definition at line 844 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_initialize()

cs_error_t cpg_initialize ( cpg_handle_t handle,
cpg_callbacks_t callbacks 
)

Create a new cpg connection.

Parameters
handle
callbacks
Returns

Definition at line 169 of file lib/cpg.c.

References cpg_callbacks_t::cpg_confchg_fn, cpg_model_v1_data_t::cpg_confchg_fn, cpg_callbacks_t::cpg_deliver_fn, cpg_model_v1_data_t::cpg_deliver_fn, cpg_model_initialize(), and CPG_MODEL_V1.

◆ cpg_iteration_finalize()

cs_error_t cpg_iteration_finalize ( cpg_iteration_handle_t  handle)

cpg_iteration_finalize

Parameters
handle
Returns

Definition at line 1383 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_iteration_initialize()

cs_error_t cpg_iteration_initialize ( cpg_handle_t  handle,
cpg_iteration_type_t  iteration_type,
const struct cpg_name group,
cpg_iteration_handle_t cpg_iteration_handle 
)

cpg_iteration_initialize

Parameters
handle
iteration_type
group
cpg_iteration_handle
Returns

Definition at line 1240 of file lib/cpg.c.

References CPG_ITERATION_ALL, CPG_ITERATION_NAME_ONLY, CPG_ITERATION_ONE_GROUP, CPG_MAX_NAME_LENGTH, CS_ERR_INVALID_PARAM, CS_ERR_NAME_TOO_LONG, hdb_error_to_cs(), and cpg_name::length.

◆ cpg_iteration_next()

cs_error_t cpg_iteration_next ( cpg_iteration_handle_t  handle,
struct cpg_iteration_description_t description 
)

cpg_iteration_next

Parameters
handle
description
Returns

Definition at line 1333 of file lib/cpg.c.

References CS_ERR_INVALID_PARAM, and hdb_error_to_cs().

◆ cpg_join()

cs_error_t cpg_join ( cpg_handle_t  handle,
const struct cpg_name group 
)

Join one or more groups.

messages multicasted with cpg_mcast_joined will be sent to every group that has been joined on handle handle. Any message multicasted to a group that has been previously joined will be delivered in cpg_dispatch

Parameters
handle
group
Returns

Definition at line 644 of file lib/cpg.c.

References CPG_MAX_NAME_LENGTH, CS_ERR_NAME_TOO_LONG, hdb_error_to_cs(), and cpg_name::length.

◆ cpg_leave()

cs_error_t cpg_leave ( cpg_handle_t  handle,
const struct cpg_name group 
)

Leave one or more groups.

Parameters
handle
group
Returns

Definition at line 698 of file lib/cpg.c.

References CPG_MAX_NAME_LENGTH, CS_ERR_NAME_TOO_LONG, hdb_error_to_cs(), and cpg_name::length.

◆ cpg_local_get()

cs_error_t cpg_local_get ( cpg_handle_t  handle,
unsigned int *  local_nodeid 
)

cpg_local_get

Parameters
handle
local_nodeid
Returns

Definition at line 806 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_max_atomic_msgsize_get()

cs_error_t cpg_max_atomic_msgsize_get ( cpg_handle_t  handle,
uint32_t *  size 
)

Get maximum size of a message that will not be fragmented.

Parameters
handle
size
Returns

Definition at line 313 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_mcast_joined()

cs_error_t cpg_mcast_joined ( cpg_handle_t  handle,
cpg_guarantee_t  guarantee,
const struct iovec *  iovec,
unsigned int  iov_len 
)

Multicast to groups joined with cpg_join.

Parameters
handle
guarantee
iovecThis iovec will be multicasted to all groups joined with the cpg_join interface for handle.
iov_len

Definition at line 1192 of file lib/cpg.c.

References hdb_error_to_cs().

◆ cpg_membership_get()

cs_error_t cpg_membership_get ( cpg_handle_t  handle,
struct cpg_name groupName,
struct cpg_address member_list,
int *  member_list_entries 
)

Get membership information from cpg.

Parameters
handle
groupName
member_list
member_list_entries
Returns

Definition at line 743 of file lib/cpg.c.

References CPG_MAX_NAME_LENGTH, CS_ERR_INVALID_PARAM, CS_ERR_NAME_TOO_LONG, hdb_error_to_cs(), cpg_name::length, and res_lib_cpg_membership_get::member_list.

◆ cpg_model_initialize()

cs_error_t cpg_model_initialize ( cpg_handle_t handle,
cpg_model_t  model,
cpg_model_data_t model_data,
void *  context 
)

Create a new cpg connection, initialize with model.

Parameters
handle
model
model_data
context
Returns

Definition at line 185 of file lib/cpg.c.

References CPG_MODEL_V1, CS_ERR_INVALID_PARAM, and hdb_error_to_cs().

Referenced by cpg_initialize().

◆ cpg_zcb_alloc()

cs_error_t cpg_zcb_alloc ( cpg_handle_t  handle,
size_t  size,
void **  buffer 
)

cpg_zcb_alloc

Parameters
handle
size
buffer
Returns

Definition at line 944 of file lib/cpg.c.

◆ cpg_zcb_free()

cs_error_t cpg_zcb_free ( cpg_handle_t  handle,
void *  buffer 
)

cpg_zcb_free

Parameters
handle
buffer
Returns

Definition at line 1001 of file lib/cpg.c.

◆ cpg_zcb_mcast_joined()

cs_error_t cpg_zcb_mcast_joined ( cpg_handle_t  handle,
cpg_guarantee_t  guarantee,
void *  msg,
size_t  msg_len 
)

cpg_zcb_mcast_joined

Parameters
handle
guarantee
msg
msg_len
Returns

Definition at line 1050 of file lib/cpg.c.

References hdb_error_to_cs().