Purpose
ha_gs_protocol_approved_callback - A callback routine that the Group Services subsystem calls to deliver a protocol approved notification to a GS client
Library
GSAPI Thread-Safe Library (libha_gs_r.a)
GSAPI Library (not thread-safe) (libha_gs.a)
Syntax
#include <ha_gs.h> void ha_gs_protocol_approved_callback( const ha_gs_protocol_approved_notification_t *notification)
Parameters
Description
The ha_gs_protocol_approved_callback subroutine defines a GS client's protocol approved callback routine. The GS client uses it to handle protocol approved notifications from the Group Services subsystem. The process provides the address of the protocol approved callback routine to the Group Services subsystem on the ha_gs_join subroutine when it joins the group as a provider.
The Group Services subsystem then calls the protocol approved callback routine when it has a protocol approved notification to deliver to the GS client. For an n-phase protocol, this notification is delivered after the protocol has been approved by voting. All one-phase protocols are automatically approved.
On input, the protocol approved callback routine receives information that specifies the changes that have been made to the group, such as its membership or its state value, as well as other control information for the protocol, such as the number of phases that were run.
On input, the protocol approved callback routine receives a pointer to the protocol approved notification block. The protocol approved notification block has the following definition:
typedef struct { ha_gs_notification_type_t gs_notification_type; ha_gs_token_t gs_provider_token; ha_gs_request_t gs_protocol_type; ha_gs_summary_code_t gs_summary_code; ha_gs_proposal_t *gs_proposal; } ha_gs_approved_notification_t;
The gs_notification_type field contains the type of notification. For a protocol approved notification, it contains a value of HA_GS_APPROVED_NOTIFICATION.
The gs_provider_token field contains a token that identifies the caller as a provider of the group. This token was previously initialized when the provider joined the group using the ha_gs_join subroutine.
The gs_protocol_type field contains the type of request for which this protocol approved notification is being delivered.
The gs_summary_code field contains one or more flags that indicate whether any default votes were recorded during any previous voting phase. It can contain one or more of the following flags:
The gs_proposal field points to the proposal block for the proposal on which the vote is requested. For information about this block, see the ha_gs_n_phase_callback man page.
Restrictions
For important information about multiprocessing considerations that apply to all callback routines, see the ha_gs_n_phase_callback man page.
Return Values
None.
Error Values
None.
Synchronous Errors
None.
Asynchronous Errors
None.
Files
ha_gs.h
Prerequisite Information
Related Information
Subroutines: ha_gs_init, ha_gs_join, ha_gs_change_state_value, ha_gs_send_message, ha_gs_leave, ha_gs_expel, ha_gs_change_attributes, ha_gs_goodbye