diff --git a/exec/amf.c b/exec/amf.c index 17241e53..b9ae3992 100644 --- a/exec/amf.c +++ b/exec/amf.c @@ -127,71 +127,66 @@ static char *operationalstate_ntoa (OpenaisCfgOperationalStateT state); static char *hastate_ntoa (SaAmfHAStateT state); static char *readinessstate_ntoa (int state); -static int amf_confchg_fn ( +static void amf_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); -static int amf_exit_fn (struct conn_info *conn_info); +static int amf_lib_exit_fn (struct conn_info *conn_info); static int amf_exec_init_fn (struct openais_config *); -static int amf_init_two_fn (struct conn_info *conn_info); +static int amf_lib_init_fn (struct conn_info *conn_info); -static int message_handler_req_lib_amf_componentregister (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_componentregister (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_componentunregister (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_componentunregister (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_pmstart (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_pmstart (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_pmstop (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_pmstop (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_healthcheckstart (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_healthcheckstart (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_healthcheckconfirm (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_healthcheckconfirm (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_healthcheckstop (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_healthcheckstop (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_hastateget (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_hastateget (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_csiquiescingcomplete (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_csiquiescingcomplete (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_protectiongrouptrackstart (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_protectiongrouptrackstart (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_componenterrorreport (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_componenterrorreport (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_componenterrorclear (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_componenterrorclear (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_amf_response (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_amf_response (struct conn_info *conn_info, void *message); -static int message_handler_req_exec_amf_operational_state_comp_set ( +static void message_handler_req_exec_amf_operational_state_comp_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required); + struct totem_ip_address *source); -static int message_handler_req_exec_amf_presence_state_comp_set ( +static void message_handler_req_exec_amf_presence_state_comp_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required); + struct totem_ip_address *source); -static int message_handler_req_exec_amf_administrative_state_csi_set ( +static void message_handler_req_exec_amf_administrative_state_csi_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required); + struct totem_ip_address *source); -static int message_handler_req_exec_amf_administrative_state_unit_set ( +static void message_handler_req_exec_amf_administrative_state_unit_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required); + struct totem_ip_address *source); -static int message_handler_req_exec_amf_administrative_state_group_set ( +static void message_handler_req_exec_amf_administrative_state_group_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required); + struct totem_ip_address *source); void presence_state_comp_set ( struct amf_comp *comp, @@ -266,129 +261,136 @@ struct clc_interface *clc_interfaces[4] = { /* * Service Handler Definition */ -struct libais_handler amf_libais_handlers[] = +static struct openais_lib_handler amf_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_amf_componentregister, + .lib_handler_fn = message_handler_req_lib_amf_componentregister, .response_size = sizeof (struct res_lib_amf_componentregister), .response_id = MESSAGE_RES_AMF_COMPONENTREGISTER, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_amf_componentunregister, + .lib_handler_fn = message_handler_req_lib_amf_componentunregister, .response_size = sizeof (struct res_lib_amf_componentunregister), .response_id = MESSAGE_RES_AMF_COMPONENTUNREGISTER, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_amf_pmstart, + .lib_handler_fn = message_handler_req_lib_amf_pmstart, .response_size = sizeof (struct res_lib_amf_pmstart), .response_id = MESSAGE_RES_AMF_PMSTART, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_amf_pmstop, + .lib_handler_fn = message_handler_req_lib_amf_pmstop, .response_size = sizeof (struct res_lib_amf_pmstop), .response_id = MESSAGE_RES_AMF_PMSTOP, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 4 */ - .libais_handler_fn = message_handler_req_lib_amf_healthcheckstart, + .lib_handler_fn = message_handler_req_lib_amf_healthcheckstart, .response_size = sizeof (struct res_lib_amf_healthcheckstart), .response_id = MESSAGE_RES_AMF_HEALTHCHECKSTART, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 5 */ - .libais_handler_fn = message_handler_req_lib_amf_healthcheckconfirm, + .lib_handler_fn = message_handler_req_lib_amf_healthcheckconfirm, .response_size = sizeof (struct res_lib_amf_healthcheckconfirm), .response_id = MESSAGE_RES_AMF_HEALTHCHECKCONFIRM, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 6 */ - .libais_handler_fn = message_handler_req_lib_amf_healthcheckstop, + .lib_handler_fn = message_handler_req_lib_amf_healthcheckstop, .response_size = sizeof (struct res_lib_amf_healthcheckstop), .response_id = MESSAGE_RES_AMF_HEALTHCHECKSTOP, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 7 */ - .libais_handler_fn = message_handler_req_lib_amf_hastateget, + .lib_handler_fn = message_handler_req_lib_amf_hastateget, .response_size = sizeof (struct res_lib_amf_hastateget), .response_id = MESSAGE_RES_AMF_HASTATEGET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 8 */ - .libais_handler_fn = message_handler_req_lib_amf_csiquiescingcomplete, + .lib_handler_fn = message_handler_req_lib_amf_csiquiescingcomplete, .response_size = sizeof (struct res_lib_amf_csiquiescingcomplete), .response_id = MESSAGE_RES_AMF_CSIQUIESCINGCOMPLETE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 9 */ - .libais_handler_fn = message_handler_req_lib_amf_protectiongrouptrackstart, + .lib_handler_fn = message_handler_req_lib_amf_protectiongrouptrackstart, .response_size = sizeof (struct res_lib_amf_protectiongrouptrackstart), .response_id = MESSAGE_RES_AMF_PROTECTIONGROUPTRACKSTART, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 10 */ - .libais_handler_fn = message_handler_req_lib_amf_protectiongrouptrackstop, + .lib_handler_fn = message_handler_req_lib_amf_protectiongrouptrackstop, .response_size = sizeof (struct res_lib_amf_protectiongrouptrackstop), .response_id = MESSAGE_RES_AMF_PROTECTIONGROUPTRACKSTOP, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 11 */ - .libais_handler_fn = message_handler_req_lib_amf_componenterrorreport, + .lib_handler_fn = message_handler_req_lib_amf_componenterrorreport, .response_size = sizeof (struct res_lib_amf_componenterrorreport), .response_id = MESSAGE_RES_AMF_COMPONENTERRORREPORT, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 12 */ - .libais_handler_fn = message_handler_req_lib_amf_componenterrorclear, + .lib_handler_fn = message_handler_req_lib_amf_componenterrorclear, .response_size = sizeof (struct res_lib_amf_componenterrorclear), .response_id = MESSAGE_RES_AMF_COMPONENTERRORCLEAR, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 13 */ - .libais_handler_fn = message_handler_req_lib_amf_response, + .lib_handler_fn = message_handler_req_lib_amf_response, .response_size = sizeof (struct res_lib_amf_response), .response_id = MESSAGE_RES_AMF_RESPONSE, // TODO - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, }; -int (*amf_aisexec_handler_fns[]) ( - void *, - struct totem_ip_address *source, - int endian_conversion_required) = -{ - message_handler_req_exec_amf_operational_state_comp_set, - message_handler_req_exec_amf_presence_state_comp_set, - message_handler_req_exec_amf_administrative_state_csi_set, - message_handler_req_exec_amf_administrative_state_unit_set, - message_handler_req_exec_amf_administrative_state_group_set +static struct openais_exec_handler amf_exec_handlers[] = { + { + .exec_handler_fn = message_handler_req_exec_amf_operational_state_comp_set, + }, + { + .exec_handler_fn = message_handler_req_exec_amf_presence_state_comp_set, + }, + { + .exec_handler_fn = message_handler_req_exec_amf_administrative_state_csi_set, + }, + { + .exec_handler_fn = message_handler_req_exec_amf_administrative_state_unit_set, + }, + { + .exec_handler_fn = message_handler_req_exec_amf_administrative_state_group_set + } }; + /* * Exports the interface for the service */ -struct service_handler amf_service_handler = { - .name = "openais availability management framework B.01.01", +struct openais_service_handler amf_service_handler = { + .name = (unsigned char *)"openais availability management framework B.01.01", .id = AMF_SERVICE, - .libais_handlers = amf_libais_handlers, - .libais_handlers_count = sizeof (amf_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = amf_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (amf_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = amf_confchg_fn, - .libais_init_two_fn = amf_init_two_fn, - .libais_exit_fn = amf_exit_fn, + .lib_init_fn = amf_lib_init_fn, + .lib_exit_fn = amf_lib_exit_fn, + .lib_handlers = amf_lib_handlers, + .lib_handlers_count = sizeof (amf_lib_handlers) / sizeof (struct openais_lib_handler), .exec_init_fn = amf_exec_init_fn, + .exec_handlers = amf_exec_handlers, + .exec_handlers_count = sizeof (amf_exec_handlers) / sizeof (struct openais_exec_handler), + .confchg_fn = amf_confchg_fn, }; #ifdef BUILD_DYNAMIC -struct service_handler *amf_get_handler_ver0 (void); +struct openais_service_handler *amf_get_handler_ver0 (void); -struct aisexec_iface_ver0 amf_service_handler_iface = { +struct openais_service_handler_iface_ver0 amf_service_handler_iface = { .test = NULL, - .get_handler_ver0 = amf_get_handler_ver0 + .openais_get_service_handler_ver0 = amf_get_handler_ver0 }; struct lcr_iface openais_amf_ver0[1] = { @@ -416,7 +418,7 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *amf_get_handler_ver0 (void) +struct openais_service_handler *amf_get_handler_ver0 (void) { return (&amf_service_handler); } @@ -726,8 +728,8 @@ printf ("component presence state %d\n", comp->presence_state); invocation_create ( AMF_RESPONSE_COMPONENTTERMINATECALLBACK, component_terminate_callback_data); -printf ("Creating invocation %lld", - res_lib_amf_componentterminatecallback.invocation); +printf ("Creating invocation %llu", + (unsigned long long)res_lib_amf_componentterminatecallback.invocation); libais_send_response ( comp->conn_info->conn_info_partner, @@ -836,7 +838,7 @@ static int amf_exec_init_fn (struct openais_config *openais_config) } return (0); } -static int amf_confchg_fn ( +static void amf_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -873,10 +875,9 @@ static int amf_confchg_fn ( #endif #endif - return (0); } -int amf_exit_fn (struct conn_info *conn_info) +int amf_lib_exit_fn (struct conn_info *conn_info) { struct amf_comp *comp; @@ -899,7 +900,7 @@ printf ("setting in exit fn to uninst for comp %p\n", comp); return (0); } -static int amf_init_two_fn (struct conn_info *conn_info) +static int amf_lib_init_fn (struct conn_info *conn_info) { log_printf (LOG_LEVEL_DEBUG, "Got request to initalize availability management framework service.\n"); @@ -1343,8 +1344,9 @@ void operational_state_comp_set (struct amf_comp *comp, OpenaisCfgOperationalSta struct iovec iovec; req_exec_amf_operational_state_comp_set.header.size = sizeof (struct req_exec_amf_operational_state_comp_set); - req_exec_amf_operational_state_comp_set.header.id = MESSAGE_REQ_EXEC_AMF_OPERATIONAL_STATE_COMP_SET; + req_exec_amf_operational_state_comp_set.header.id = SERVICE_ID_MAKE (AMF_SERVICE, MESSAGE_REQ_EXEC_AMF_OPERATIONAL_STATE_COMP_SET); + req_exec_amf_operational_state_comp_set.operational_state = operational_state; memcpy (&req_exec_amf_operational_state_comp_set.name, &comp->name, @@ -1502,7 +1504,7 @@ int clc_instantiate_all (void) { comp = list_entry (list_comp, struct amf_comp, comp_list); - if (strlen (comp->instantiate_cmd)) { + if (strlen ((char *)comp->instantiate_cmd)) { clc_instantiate (comp); } @@ -1681,8 +1683,8 @@ void csi_unit_create (struct amf_unit *unit, struct amf_si *si, csi->unit = unit; csi->pg_set = 0; - sprintf (csi->name.value, "CSI %d", csi_number); - csi->name.length = strlen (csi->name.value); + sprintf ((char *)csi->name.value, "CSI %d", csi_number); + csi->name.length = strlen ((char *)csi->name.value); csi_number += 1; *csi_out = csi; @@ -2244,10 +2246,9 @@ void operational_state_unit_set ( } -static int message_handler_req_exec_amf_operational_state_comp_set ( +static void message_handler_req_exec_amf_operational_state_comp_set ( void *message, - struct totem_ip_address *address, - int endian_conversion_required) + struct totem_ip_address *address) { struct req_exec_amf_operational_state_comp_set *req_exec_amf_operational_state_comp_set = (struct req_exec_amf_operational_state_comp_set *)message; @@ -2284,13 +2285,11 @@ static int message_handler_req_exec_amf_operational_state_comp_set ( OPENAIS_CFG_OPERATIONALSTATE_DISABLED); } readiness_state_comp_set (comp); - return (0); } -static int message_handler_req_exec_amf_presence_state_comp_set ( +static void message_handler_req_exec_amf_presence_state_comp_set ( void *message, - struct totem_ip_address *address, - int endian_conversion_required) + struct totem_ip_address *address) { struct req_exec_amf_presence_state_comp_set *req_exec_amf_presence_state_comp_set = (struct req_exec_amf_presence_state_comp_set *)message; @@ -2302,7 +2301,7 @@ static int message_handler_req_exec_amf_presence_state_comp_set ( comp = find_comp (&req_exec_amf_presence_state_comp_set->name); if (req_exec_amf_presence_state_comp_set->presence_state == comp->presence_state) { printf ("duplicate presence state set, not setting presence state\n"); - return (0); + return; } if (req_exec_amf_presence_state_comp_set->presence_state == OPENAIS_CFG_PRESENCESTATE_UNINSTANTIATED) { @@ -2316,7 +2315,7 @@ static int message_handler_req_exec_amf_presence_state_comp_set ( comp->presence_state != OPENAIS_CFG_PRESENCESTATE_UNINSTANTIATED) { printf ("restart presence state set even though not in terminating state\n"); - return (0); + return; } comp->presence_state = req_exec_amf_presence_state_comp_set->presence_state; @@ -2352,45 +2351,38 @@ printf ("restart presence state set even though not in terminating state\n"); presence_state_unit_set (comp->unit, OPENAIS_CFG_PRESENCESTATE_INSTANTIATED); } - return (0); } -static int message_handler_req_exec_amf_administrative_state_csi_set ( +static void message_handler_req_exec_amf_administrative_state_csi_set ( void *message, - struct totem_ip_address *address, - int endian_conversion_required) + struct totem_ip_address *address) { // struct req_exec_amf_administrative_state_csi_set *req_exec_amf_administrative_state_csi_set = // (struct req_exec_amf_administrative_state_csi_set *)message; // TODO - return (0); } -static int message_handler_req_exec_amf_administrative_state_unit_set ( +static void message_handler_req_exec_amf_administrative_state_unit_set ( void *message, - struct totem_ip_address *address, - int endian_conversion_required) + struct totem_ip_address *address) { // struct req_exec_amf_administrative_state_unit_set *req_exec_amf_administrative_state_unit_set = // (struct req_exec_amf_administrative_state_unit_set *)message; // TODO - return (0); } -static int message_handler_req_exec_amf_administrative_state_group_set ( +static void message_handler_req_exec_amf_administrative_state_group_set ( void *message, - struct totem_ip_address *source, - int endian_conversion_required) + struct totem_ip_address *source) { // struct req_exec_amf_administrative_state_group_set *req_exec_amf_administrative_state_group_set = // (struct req_exec_amf_administrative_state_group_set *)message; // TODO - return (0); } /* * Library Interface Implementation */ -static int message_handler_req_lib_amf_componentregister (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_componentregister (struct conn_info *conn_info, void *message) { struct req_lib_amf_componentregister *req_lib_amf_componentregister = (struct req_lib_amf_componentregister *)message; @@ -2415,10 +2407,9 @@ static int message_handler_req_lib_amf_componentregister (struct conn_info *conn res_lib_amf_componentregister.header.error = error; libais_send_response (conn_info, &res_lib_amf_componentregister, sizeof (struct res_lib_amf_componentregister)); - return (0); } -static int message_handler_req_lib_amf_componentunregister (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_componentunregister (struct conn_info *conn_info, void *message) { #ifdef COMPILE_OUT struct req_lib_amf_componentunregister *req_lib_amf_componentunregister = (struct req_lib_amf_componentunregister *)message; @@ -2448,19 +2439,16 @@ static int message_handler_req_lib_amf_componentunregister (struct conn_info *co assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); #endif - return (0); } -static int message_handler_req_lib_amf_pmstart (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_pmstart (struct conn_info *conn_info, void *message) { - return (0); } -static int message_handler_req_lib_amf_pmstop (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_pmstop (struct conn_info *conn_info, void *message) { - return (0); } -static int message_handler_req_lib_amf_healthcheckstart (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_healthcheckstart (struct conn_info *conn_info, void *message) { struct req_lib_amf_healthcheckstart *req_lib_amf_healthcheckstart = (struct req_lib_amf_healthcheckstart *)message; @@ -2539,15 +2527,13 @@ error_exit: libais_send_response (conn_info, &res_lib_amf_healthcheckstart, sizeof (struct res_lib_amf_healthcheckstart)); - return (0); } -static int message_handler_req_lib_amf_healthcheckconfirm (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_healthcheckconfirm (struct conn_info *conn_info, void *message) { - return (0); } -static int message_handler_req_lib_amf_healthcheckstop (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_healthcheckstop (struct conn_info *conn_info, void *message) { struct req_lib_amf_healthcheckstop *req_lib_amf_healthcheckstop = (struct req_lib_amf_healthcheckstop *)message; @@ -2584,10 +2570,9 @@ error_exit: libais_send_response (conn_info, &res_lib_amf_healthcheckstop, sizeof (struct res_lib_amf_healthcheckstop)); - return (0); } -static int message_handler_req_lib_amf_hastateget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_hastateget (struct conn_info *conn_info, void *message) { #ifdef COMPILE_OUT struct req_lib_amf_hastateget *req_lib_amf_hastateget = (struct req_lib_amf_hastateget *)message; @@ -2611,10 +2596,9 @@ static int message_handler_req_lib_amf_hastateget (struct conn_info *conn_info, } libais_send_response (conn_info, &res_lib_amf_hastateget, sizeof (struct res_lib_amf_hastateget)); #endif - return (0); } -static int message_handler_req_lib_amf_protectiongrouptrackstart (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_protectiongrouptrackstart (struct conn_info *conn_info, void *message) { #ifdef COMPILE_OUT struct req_lib_amf_protectiongrouptrackstart *req_lib_amf_protectiongrouptrackstart = (struct req_lib_amf_protectiongrouptrackstart *)message; @@ -2680,15 +2664,13 @@ static int message_handler_req_lib_amf_protectiongrouptrackstart (struct conn_in track->trackFlags &= ~SA_TRACK_CURRENT; } #endif - return (0); } -static int message_handler_req_lib_amf_csiquiescingcomplete (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_csiquiescingcomplete (struct conn_info *conn_info, void *message) { - return (0); } -static int message_handler_req_lib_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message) { #ifdef COMPILE_OUT struct req_lib_amf_protectiongrouptrackstop *req_lib_amf_protectiongrouptrackstop = (struct req_lib_amf_protectiongrouptrackstop *)message; @@ -2726,10 +2708,9 @@ static int message_handler_req_lib_amf_protectiongrouptrackstop (struct conn_inf sizeof (struct res_lib_amf_protectiongrouptrackstop)); #endif - return (0); } -static int message_handler_req_lib_amf_componenterrorreport (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_componenterrorreport (struct conn_info *conn_info, void *message) { struct req_lib_amf_componenterrorreport *req_lib_amf_componenterrorreport = (struct req_lib_amf_componenterrorreport *)message; struct res_lib_amf_componenterrorreport res_lib_amf_componenterrorreport; @@ -2755,10 +2736,9 @@ printf ("escalation policy terminate\n"); &res_lib_amf_componenterrorreport, sizeof (struct res_lib_amf_componenterrorreport)); - return (0); } -static int message_handler_req_lib_amf_componenterrorclear (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_componenterrorclear (struct conn_info *conn_info, void *message) { #ifdef COMPILLE_OUT struct req_lib_amf_componenterrorclear *req_lib_amf_componenterrorclear = (struct req_lib_amf_componenterrorclear *)message; @@ -2785,7 +2765,6 @@ static int message_handler_req_lib_amf_componenterrorclear (struct conn_info *co &iovec, 1, TOTEMPG_AGREED) == 0); #endif - return (0); } void pg_comp_create ( @@ -2804,7 +2783,7 @@ void pg_comp_create ( list_add_tail (&pg_comp->list, &pg->pg_comp_head); } -static int message_handler_req_lib_amf_response (struct conn_info *conn_info_nouse, void *message) +static void message_handler_req_lib_amf_response (struct conn_info *conn_info_nouse, void *message) { struct req_lib_amf_response *req_lib_amf_response = (struct req_lib_amf_response *)message; struct res_lib_amf_response res_lib_amf_response; @@ -2896,7 +2875,6 @@ error_exit: &res_lib_amf_response, sizeof (struct res_lib_amf_response)); - return (0); } @@ -2904,7 +2882,7 @@ error_exit: /* * Executive Message Implementation */ -static int message_handler_req_exec_amf_componentregister (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_componentregister (void *message, struct in_addr source_addr, int endian_conversion_required) { #ifdef COMPILE_OUT struct req_exec_amf_componentregister *req_exec_amf_componentregister = (struct req_exec_amf_componentregister *)message; @@ -2928,7 +2906,7 @@ static int message_handler_req_exec_amf_componentregister (void *message, struct */ if (req_exec_amf_componentregister->source.in_addr.s_addr == 0) { amf_synchronize (message, source_addr); - return (0); + return; } /* @@ -3010,10 +2988,9 @@ static int message_handler_req_exec_amf_componentregister (void *message, struct } #endif - return (0); } -static int message_handler_req_exec_amf_componentunregister (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_componentunregister (void *message, struct in_addr source_addr, int endian_conversion_required) { struct req_exec_amf_componentunregister *req_exec_amf_componentunregister = (struct req_exec_amf_componentunregister *)message; struct res_lib_amf_componentunregister res_lib_amf_componentunregister; @@ -3078,10 +3055,10 @@ static int message_handler_req_exec_amf_componentunregister (void *message, stru &res_lib_amf_componentunregister, sizeof (struct res_lib_amf_componentunregister)); } - return (0); + return; } -static int message_handler_req_exec_amf_componenterrorreport (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_componenterrorreport (void *message, struct in_addr source_addr, int endian_conversion_required) { struct req_exec_amf_componenterrorreport *req_exec_amf_componenterrorreport = (struct req_exec_amf_componenterrorreport *)message; struct res_lib_amf_componenterrorreport res_lib_amf_componenterrorreport; @@ -3117,7 +3094,7 @@ static int message_handler_req_exec_amf_componenterrorreport (void *message, str return (0); } -static int message_handler_req_exec_amf_componenterrorclear (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_componenterrorclear (void *message, struct in_addr source_addr, int endian_conversion_required) { struct req_exec_amf_componenterrorclear *req_exec_amf_componenterrorclear = (struct req_exec_amf_componenterrorclear *)message; struct res_lib_amf_componenterrorclear res_lib_amf_componenterrorclear; @@ -4255,7 +4232,7 @@ void amf_confchg_nleave (struct amf_comp *component ,void *data) * node. That cluster node API has verified the readiness state, so its time to let * the rest of the cluster nodes know about the readiness state change. */ -static int message_handler_req_exec_amf_readinessstateset (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_readinessstateset (void *message, struct in_addr source_addr, int endian_conversion_required) { struct req_exec_amf_readinessstateset *req_exec_amf_readinessstateset = (struct req_exec_amf_readinessstateset *)message; struct amf_comp *component; @@ -4280,7 +4257,7 @@ static int message_handler_req_exec_amf_readinessstateset (void *message, struct * node. That cluster node API has verified the ha state, so its time to let * the rest of the cluster nodes know about the HA state change. */ -static int message_handler_req_exec_amf_hastateset (void *message, struct in_addr source_addr, int endian_conversion_required) +static void message_handler_req_exec_amf_hastateset (void *message, struct in_addr source_addr, int endian_conversion_required) { struct req_exec_amf_hastateset *req_exec_amf_hastateset = (struct req_exec_amf_hastateset *)message; struct amf_comp *component; @@ -4319,7 +4296,7 @@ static int message_handler_req_exec_amf_hastateset (void *message, struct in_add -static int message_handler_req_lib_amf_readinessstateget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_readinessstateget (struct conn_info *conn_info, void *message) { <<<<<<< .mine struct req_lib_amf_readinessstateget *req_lib_amf_readinessstateget = (struct req_lib_amf_readinessstateget *)message; @@ -4347,7 +4324,7 @@ static int message_handler_req_lib_amf_readinessstateget (struct conn_info *conn return (0); } -static int message_handler_req_amf_componentunregister (struct conn_info *conn_info, void *message) +static void message_handler_req_amf_componentunregister (struct conn_info *conn_info, void *message) { struct req_lib_amf_componentunregister *req_lib_amf_componentunregister = (struct req_lib_amf_componentunregister *)message; struct req_exec_amf_componentunregister req_exec_amf_componentunregister; @@ -4376,7 +4353,7 @@ static int message_handler_req_amf_componentunregister (struct conn_info *conn_i return (0); } -static int message_handler_req_amf_readinessstateget (struct conn_info *conn_info, void *message) +static void message_handler_req_amf_readinessstateget (struct conn_info *conn_info, void *message) { struct req_amf_readinessstateget *req_amf_readinessstateget = (struct req_amf_readinessstateget *)message; >>>>>>> .r872 @@ -4401,7 +4378,7 @@ static int message_handler_req_amf_readinessstateget (struct conn_info *conn_inf } -static int message_handler_req_lib_amf_stoppingcomplete (struct conn_info *conn_info_notused, +static void message_handler_req_lib_amf_stoppingcomplete (struct conn_info *conn_info_notused, void *message) { struct req_lib_amf_stoppingcomplete *req_lib_amf_stoppingcomplete = (struct req_lib_amf_stoppingcomplete *)message; @@ -4468,7 +4445,7 @@ static int message_handler_req_lib_amf_stoppingcomplete (struct conn_info *conn_ return (0); } -static int message_handler_req_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message) +static void message_handler_req_amf_protectiongrouptrackstop (struct conn_info *conn_info, void *message) { struct req_amf_protectiongrouptrackstop *req_amf_protectiongrouptrackstop = (struct req_amf_protectiongrouptrackstop *)message; struct res_lib_amf_protectiongrouptrackstop res_lib_amf_protectiongrouptrackstop; @@ -4507,7 +4484,7 @@ static int message_handler_req_amf_protectiongrouptrackstop (struct conn_info *c return (0); } -static int message_handler_req_amf_errorreport (struct conn_info *conn_info, void *message) +static void message_handler_req_amf_errorreport (struct conn_info *conn_info, void *message) { struct req_lib_amf_errorreport *req_lib_amf_errorreport = (struct req_lib_amf_errorreport *)message; struct req_exec_amf_errorreport req_exec_amf_errorreport; @@ -4533,7 +4510,7 @@ static int message_handler_req_amf_errorreport (struct conn_info *conn_info, voi return (0); } -static int message_handler_req_amf_errorcancelall (struct conn_info *conn_info, void *message) +static void message_handler_req_amf_errorcancelall (struct conn_info *conn_info, void *message) { struct req_lib_amf_errorcancelall *req_lib_amf_errorcancelall = (struct req_lib_amf_errorcancelall *)message; struct req_exec_amf_errorcancelall req_exec_amf_errorcancelall; @@ -4559,7 +4536,7 @@ static int message_handler_req_amf_errorcancelall (struct conn_info *conn_info, return (0); } -static int message_handler_req_amf_stoppingcomplete (struct conn_info *conn_info_notused, +static void message_handler_req_amf_stoppingcomplete (struct conn_info *conn_info_notused, void *message) { struct req_amf_stoppingcomplete *req_amf_stoppingcomplete = (struct req_amf_stoppingcomplete *)message; @@ -4590,7 +4567,7 @@ void response_handler_healthcheckcallback (struct conn_info *conn_info, } } -static int message_handler_req_lib_amf_componentcapabilitymodelget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_amf_componentcapabilitymodelget (struct conn_info *conn_info, void *message) { struct req_lib_amf_componentcapabilitymodelget *req_lib_amf_componentcapabilitymodelget = (struct req_lib_amf_componentcapabilitymodelget *)message; struct res_lib_amf_componentcapabilitymodelget res_lib_amf_componentcapabilitymodelget; diff --git a/exec/amf.h b/exec/amf.h index d8d25ee9..30b8edbb 100644 --- a/exec/amf.h +++ b/exec/amf.h @@ -58,6 +58,6 @@ struct libamf_ci { }; void amf_dump (); -extern struct service_handler amf_service_handler; +extern struct openais_service_handler amf_service_handler; #endif /* AMF_H_DEFINED */ diff --git a/exec/cfg.c b/exec/cfg.c index c843f9cd..8a10c70f 100644 --- a/exec/cfg.c +++ b/exec/cfg.c @@ -64,59 +64,62 @@ #define LOG_LEVEL_FROM_GMI LOG_LEVEL_DEBUG #define LOG_LEVEL_ENTER_FUNC LOG_LEVEL_DEBUG -static int cfg_confchg_fn ( +static void cfg_confchg_fn ( enum totem_configuration_type configuration_type, - struct in_addr *member_list, int member_list_entries, - struct in_addr *left_list, int left_list_entries, - struct in_addr *joined_list, int joined_list_entries, + struct totem_ip_address *member_list, int member_list_entries, + struct totem_ip_address *left_list, int left_list_entries, + struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); -static int cfg_exit_fn (struct conn_info *conn_info); +static int cfg_lib_exit_fn (struct conn_info *conn_info); static int cfg_exec_init_fn (struct openais_config *); -static int cfg_init_two_fn (struct conn_info *conn_info); +static int cfg_lib_init_fn (struct conn_info *conn_info); -static int message_handler_req_lib_cfg_statetrackstart (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_cfg_statetrackstart (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_cfg_statetrackstop (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_cfg_statetrackstop (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_cfg_administrativestateset (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_cfg_administrativestateset (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_cfg_administrativestateget (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_cfg_administrativestateget (struct conn_info *conn_info, void *message); /* * Service Handler Definition */ -struct libais_handler cfg_libais_handlers[] = +static struct openais_lib_handler cfg_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_cfg_statetrackstart, + .lib_handler_fn = message_handler_req_lib_cfg_statetrackstart, .response_size = sizeof (struct res_lib_cfg_statetrackstart), .response_id = MESSAGE_RES_CFG_STATETRACKSTART, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_cfg_statetrackstop, + .lib_handler_fn = message_handler_req_lib_cfg_statetrackstop, .response_size = sizeof (struct res_lib_cfg_statetrackstop), .response_id = MESSAGE_RES_CFG_STATETRACKSTOP, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_cfg_administrativestateset, + .lib_handler_fn = message_handler_req_lib_cfg_administrativestateset, .response_size = sizeof (struct res_lib_cfg_administrativestateset), .response_id = MESSAGE_RES_CFG_ADMINISTRATIVESTATESET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_cfg_administrativestateget, + .lib_handler_fn = message_handler_req_lib_cfg_administrativestateget, .response_size = sizeof (struct res_lib_cfg_administrativestateget), .response_id = MESSAGE_RES_CFG_ADMINISTRATIVESTATEGET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED } }; -int (*cfg_aisexec_handler_fns[]) (void *, struct in_addr source_addr, int endian_conversion_required) = { +static struct openais_exec_handler cfg_exec_handlers[] = +{ + { + } /* message_handler_req_exec_cfg_componentregister, message_handler_req_exec_cfg_componentunregister, @@ -128,44 +131,46 @@ int (*cfg_aisexec_handler_fns[]) (void *, struct in_addr source_addr, int endian /* * Exports the interface for the service */ -struct service_handler cfg_service_handler = { - .name = "openais configuration service", +struct openais_service_handler cfg_service_handler = { + .name = (unsigned char*)"openais configuration service", .id = CFG_SERVICE, - .libais_handlers = cfg_libais_handlers, - .libais_handlers_count = sizeof (cfg_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = cfg_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (cfg_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = cfg_confchg_fn, - .libais_init_two_fn = cfg_init_two_fn, - .libais_exit_fn = cfg_exit_fn, + .lib_init_fn = cfg_lib_init_fn, + .lib_exit_fn = cfg_lib_exit_fn, + .lib_handlers = cfg_lib_handlers, + .lib_handlers_count = sizeof (cfg_lib_handlers) / sizeof (struct openais_lib_handler), .exec_init_fn = cfg_exec_init_fn, + .exec_handlers = cfg_exec_handlers, + .exec_handlers_count = 0, /* sizeof (cfg_aisexec_handler_fns) / sizeof (openais_exec_handler), */ + .confchg_fn = cfg_confchg_fn, }; +/* + * Dynamic Loader definition + */ #ifdef BUILD_DYNAMIC -struct service_handler *cfg_get_handler_ver0 (void); +struct openais_service_handler *cfg_get_handler_ver0 (void); -struct aisexec_iface_ver0 cfg_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = cfg_get_handler_ver0 +struct openais_service_handler_iface_ver0 cfg_service_handler_iface = { + .openais_get_service_handler_ver0 = cfg_get_handler_ver0 }; struct lcr_iface openais_cfg_ver0[1] = { { - .name = "openais_cfg", - .version = 0, + .name = "openais_cfg", + .version = 0, .versions_replace = 0, - .versions_replace_count = 0, + .versions_replace_count = 0, .dependencies = 0, .dependency_count = 0, .constructor = NULL, - .destructor = NULL, - .interfaces = (void **)&cfg_service_handler_iface, + .destructor = NULL, + .interfaces = (void **)&cfg_service_handler_iface, } }; struct lcr_comp cfg_comp_ver0 = { - .iface_count = 1, + .iface_count = 1, .ifaces = openais_cfg_ver0 }; @@ -175,37 +180,37 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *cfg_get_handler_ver0 (void) +struct openais_service_handler *cfg_get_handler_ver0 (void) { return (&cfg_service_handler); } #endif /* BUILD_DYNAMIC */ + /* IMPL */ static int cfg_exec_init_fn (struct openais_config *openais_config) { return (0); } -static int cfg_confchg_fn ( +static void cfg_confchg_fn ( enum totem_configuration_type configuration_type, - struct in_addr *member_list, int member_list_entries, - struct in_addr *left_list, int left_list_entries, - struct in_addr *joined_list, int joined_list_entries, + struct totem_ip_address *member_list, int member_list_entries, + struct totem_ip_address *left_list, int left_list_entries, + struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id) { - return (0); } -int cfg_exit_fn (struct conn_info *conn_info) +int cfg_lib_exit_fn (struct conn_info *conn_info) { return (0); } -static int cfg_init_two_fn (struct conn_info *conn_info) +static int cfg_lib_init_fn (struct conn_info *conn_info) { log_printf (LOG_LEVEL_DEBUG, "Got request to initalize configuration service.\n"); - list_init (&conn_info->conn_list); + // list_init (&conn_info->conn_list); return (0); } @@ -213,37 +218,32 @@ static int cfg_init_two_fn (struct conn_info *conn_info) /* * Library Interface Implementation */ -static int message_handler_req_lib_cfg_statetrackstart (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_cfg_statetrackstart (struct conn_info *conn_info, void *message) { - struct req_lib_cfg_statetrackstart *req_lib_cfg_statetrackstart = (struct req_lib_cfg_statetrackstart *)message; +// struct req_lib_cfg_statetrackstart *req_lib_cfg_statetrackstart = (struct req_lib_cfg_statetrackstart *)message; log_printf (LOG_LEVEL_FROM_LIB, "Handle : message_handler_req_lib_cfg_statetrackstart()\n"); - - return (0); } -static int message_handler_req_lib_cfg_statetrackstop (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_cfg_statetrackstop (struct conn_info *conn_info, void *message) { - struct req_lib_cfg_statetrackstop *req_lib_cfg_statetrackstop = (struct req_lib_cfg_statetrackstop *)message; +// struct req_lib_cfg_statetrackstop *req_lib_cfg_statetrackstop = (struct req_lib_cfg_statetrackstop *)message; log_printf (LOG_LEVEL_FROM_LIB, "Handle : message_handler_req_lib_cfg_administrativestateget()\n"); - return (0); } -static int message_handler_req_lib_cfg_administrativestateset (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_cfg_administrativestateset (struct conn_info *conn_info, void *message) { - struct req_lib_cfg_administrativestateset *req_lib_cfg_administrativestateset = (struct req_lib_cfg_administrativestateset *)message; +// struct req_lib_cfg_administrativestateset *req_lib_cfg_administrativestateset = (struct req_lib_cfg_administrativestateset *)message; log_printf (LOG_LEVEL_FROM_LIB, "Handle : message_handler_req_lib_cfg_administrativestateset()\n"); - return (0); } -static int message_handler_req_lib_cfg_administrativestateget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_cfg_administrativestateget (struct conn_info *conn_info, void *message) { - struct req_lib_cfg_administrativestateget *req_lib_cfg_administrativestateget = (struct req_lib_cfg_administrativestateget *)message; +// struct req_lib_cfg_administrativestateget *req_lib_cfg_administrativestateget = (struct req_lib_cfg_administrativestateget *)message; log_printf (LOG_LEVEL_FROM_LIB, "Handle : message_handler_req_lib_cfg_administrativestateget()\n"); - return (0); } diff --git a/exec/ckpt.c b/exec/ckpt.c index 2e8eb79d..54d24acc 100644 --- a/exec/ckpt.c +++ b/exec/ckpt.c @@ -104,69 +104,69 @@ typedef enum { static int ckpt_exec_init_fn (struct openais_config *); -static int ckpt_exit_fn (struct conn_info *conn_info); +static int ckpt_lib_exit_fn (struct conn_info *conn_info); -static int ckpt_init_two_fn (struct conn_info *conn_info); +static int ckpt_lib_init_fn (struct conn_info *conn_info); -static int message_handler_req_exec_ckpt_checkpointopen (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_checkpointopen (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_synchronize_state (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_synchronize_state (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_synchronize_section (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_synchronize_section (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_checkpointclose (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_checkpointclose (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_checkpointunlink (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_checkpointunlink (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_checkpointretentiondurationexpire (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_checkpointretentiondurationexpire (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectioncreate (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectioncreate (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectiondelete (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectiondelete (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectionwrite (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectionwrite (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectionoverwrite (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectionoverwrite (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_ckpt_sectionread (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void message_handler_req_exec_ckpt_sectionread (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_lib_ckpt_checkpointopen (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointopen (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointopenasync (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointopenasync (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointclose (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointclose (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointunlink (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointunlink (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointretentiondurationset (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointretentiondurationset (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_activereplicaset (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_activereplicaset (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointstatusget (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointstatusget (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectioncreate (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectioncreate (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectiondelete (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectiondelete (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectionexpirationtimeset (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectionexpirationtimeset (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectionwrite (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectionwrite (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectionoverwrite (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectionoverwrite (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointsynchronize (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointsynchronize (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_checkpointsynchronizeasync (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_checkpointsynchronizeasync (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectioniterationinitialize (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectioniterationfinalize (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_ckpt_sectioniteratornext (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectioniterationinitialize (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectioniterationfinalize (struct conn_info *conn_info, void *message); +static void message_handler_req_lib_ckpt_sectioniteratornext (struct conn_info *conn_info, void *message); static void ckpt_recovery_activate (void); @@ -204,7 +204,7 @@ static int recovery_abort = 0; static struct memb_ring_id saved_ring_id; -static int ckpt_confchg_fn( +static void ckpt_confchg_fn( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -214,179 +214,207 @@ static int ckpt_confchg_fn( /* * Executive Handler Definition */ -struct libais_handler ckpt_libais_handlers[] = +static struct openais_lib_handler ckpt_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointopen, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointopen, .response_size = sizeof (struct res_lib_ckpt_checkpointopen), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTOPEN, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointopenasync, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointopenasync, .response_size = sizeof (struct res_lib_ckpt_checkpointopenasync), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTOPENASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointclose, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointclose, .response_size = sizeof (struct res_lib_ckpt_checkpointclose), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTCLOSE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointunlink, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointunlink, .response_size = sizeof (struct res_lib_ckpt_checkpointunlink), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTUNLINK, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 4 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointretentiondurationset, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointretentiondurationset, .response_size = sizeof (struct res_lib_ckpt_checkpointretentiondurationset), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 5 */ - .libais_handler_fn = message_handler_req_lib_ckpt_activereplicaset, + .lib_handler_fn = message_handler_req_lib_ckpt_activereplicaset, .response_size = sizeof (struct res_lib_ckpt_activereplicaset), .response_id = MESSAGE_RES_CKPT_ACTIVEREPLICASET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 6 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointstatusget, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointstatusget, .response_size = sizeof (struct res_lib_ckpt_checkpointstatusget), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 7 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectioncreate, + .lib_handler_fn = message_handler_req_lib_ckpt_sectioncreate, .response_size = sizeof (struct res_lib_ckpt_sectioncreate), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONCREATE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 8 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectiondelete, + .lib_handler_fn = message_handler_req_lib_ckpt_sectiondelete, .response_size = sizeof (struct res_lib_ckpt_sectiondelete), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONDELETE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 9 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectionexpirationtimeset, + .lib_handler_fn = message_handler_req_lib_ckpt_sectionexpirationtimeset, .response_size = sizeof (struct res_lib_ckpt_sectionexpirationtimeset), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONEXPIRATIONTIMESET, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 10 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectionwrite, + .lib_handler_fn = message_handler_req_lib_ckpt_sectionwrite, .response_size = sizeof (struct res_lib_ckpt_sectionwrite), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONWRITE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 11 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectionoverwrite, + .lib_handler_fn = message_handler_req_lib_ckpt_sectionoverwrite, .response_size = sizeof (struct res_lib_ckpt_sectionoverwrite), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONOVERWRITE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 12 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectionread, + .lib_handler_fn = message_handler_req_lib_ckpt_sectionread, .response_size = sizeof (struct res_lib_ckpt_sectionread), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_SECTIONREAD, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 13 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointsynchronize, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointsynchronize, .response_size = sizeof (struct res_lib_ckpt_checkpointsynchronize), .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 14 */ - .libais_handler_fn = message_handler_req_lib_ckpt_checkpointsynchronizeasync, + .lib_handler_fn = message_handler_req_lib_ckpt_checkpointsynchronizeasync, .response_size = sizeof (struct res_lib_ckpt_checkpointsynchronizeasync), /* TODO RESPONSE */ .response_id = MESSAGE_RES_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 15 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectioniterationinitialize, + .lib_handler_fn = message_handler_req_lib_ckpt_sectioniterationinitialize, .response_size = sizeof (struct res_lib_ckpt_sectioniterationinitialize), .response_id = MESSAGE_RES_CKPT_SECTIONITERATOR_SECTIONITERATORINITIALIZE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 16 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectioniterationfinalize, + .lib_handler_fn = message_handler_req_lib_ckpt_sectioniterationfinalize, .response_size = sizeof (struct res_lib_ckpt_sectioniterationfinalize), .response_id = MESSAGE_RES_CKPT_SECTIONITERATOR_SECTIONITERATORFINALIZE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 17 */ - .libais_handler_fn = message_handler_req_lib_ckpt_sectioniteratornext, + .lib_handler_fn = message_handler_req_lib_ckpt_sectioniteratornext, .response_size = sizeof (struct res_lib_ckpt_sectioniteratornext), .response_id = MESSAGE_RES_CKPT_SECTIONITERATOR_SECTIONITERATORNEXT, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED } }; -static int (*ckpt_aisexec_handler_fns[]) (void *msg, struct totem_ip_address *source_addr, int endian_conversion_required) = { - message_handler_req_exec_ckpt_checkpointopen, - message_handler_req_exec_ckpt_checkpointclose, - message_handler_req_exec_ckpt_checkpointunlink, - message_handler_req_exec_ckpt_checkpointretentiondurationset, - message_handler_req_exec_ckpt_checkpointretentiondurationexpire, - message_handler_req_exec_ckpt_sectioncreate, - message_handler_req_exec_ckpt_sectiondelete, - message_handler_req_exec_ckpt_sectionexpirationtimeset, - message_handler_req_exec_ckpt_sectionwrite, - message_handler_req_exec_ckpt_sectionoverwrite, - message_handler_req_exec_ckpt_sectionread, - message_handler_req_exec_ckpt_synchronize_state, - message_handler_req_exec_ckpt_synchronize_section +static struct openais_exec_handler ckpt_exec_handlers[] = { + { + .exec_handler_fn = message_handler_req_exec_ckpt_checkpointopen, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_checkpointclose, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_checkpointunlink, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_checkpointretentiondurationset, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_checkpointretentiondurationexpire, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectioncreate, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectiondelete, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectionexpirationtimeset, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectionwrite, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectionoverwrite, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_sectionread, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_synchronize_state, + }, + { + .exec_handler_fn = message_handler_req_exec_ckpt_synchronize_section + } }; -struct service_handler ckpt_service_handler = { - .name = "openais checkpoint service B.01.01", +struct openais_service_handler ckpt_service_handler = { + .name = (unsigned char *)"openais checkpoint service B.01.01", .id = CKPT_SERVICE, - .libais_handlers = ckpt_libais_handlers, - .libais_handlers_count = sizeof (ckpt_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = ckpt_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (ckpt_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = ckpt_confchg_fn, - .libais_init_two_fn = ckpt_init_two_fn, - .libais_exit_fn = ckpt_exit_fn, - .exec_init_fn = ckpt_exec_init_fn, - .exec_dump_fn = 0, - .sync_init = ckpt_recovery_initialize, - .sync_process = ckpt_recovery_process, - .sync_activate = ckpt_recovery_activate, - .sync_abort = ckpt_recovery_abort, + .lib_init_fn = ckpt_lib_init_fn, + .lib_exit_fn = ckpt_lib_exit_fn, + .lib_handlers = ckpt_lib_handlers, + .lib_handlers_count = sizeof (ckpt_lib_handlers) / sizeof (struct openais_lib_handler), + .exec_init_fn = ckpt_exec_init_fn, + .exec_dump_fn = 0, + .exec_handlers = ckpt_exec_handlers, + .exec_handlers_count = sizeof (ckpt_exec_handlers) / sizeof (struct openais_exec_handler), + .confchg_fn = ckpt_confchg_fn, + .sync_init = ckpt_recovery_initialize, + .sync_process = ckpt_recovery_process, + .sync_activate = ckpt_recovery_activate, + .sync_abort = ckpt_recovery_abort, }; +/* + * Dynamic loader definition + */ #ifdef BUILD_DYNAMIC -struct service_handler *ckpt_get_handler_ver0 (void); +struct openais_service_handler *ckpt_get_handler_ver0 (void); -struct aisexec_iface_ver0 ckpt_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = ckpt_get_handler_ver0 +struct openais_service_handler_iface_ver0 ckpt_service_handler_iface = { + .openais_get_service_handler_ver0 = ckpt_get_handler_ver0 }; struct lcr_iface openais_ckpt_ver0[1] = { { - .name = "openais_ckpt", - .version = 0, + .name = "openais_ckpt", + .version = 0, .versions_replace = 0, - .versions_replace_count = 0, + .versions_replace_count = 0, .dependencies = 0, .dependency_count = 0, .constructor = NULL, - .destructor = NULL, - .interfaces = (void **)&ckpt_service_handler_iface, + .destructor = NULL, + .interfaces = (void **)&ckpt_service_handler_iface, } }; struct lcr_comp ckpt_comp_ver0 = { .iface_count = 1, - .ifaces = openais_ckpt_ver0 + .ifaces = openais_ckpt_ver0 }; extern int lcr_comp_get (struct lcr_comp **component) @@ -395,7 +423,7 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *ckpt_get_handler_ver0 (void) +struct openais_service_handler *ckpt_get_handler_ver0 (void) { return (&ckpt_service_handler); } @@ -503,7 +531,7 @@ struct req_exec_ckpt_synchronize_section { * Implementation */ static int processor_index_set(struct totem_ip_address *proc_addr, - struct ckpt_refcnt *ckpt_refcount) + struct ckpt_refcnt *ckpt_refcount) { int i; for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) { @@ -585,7 +613,7 @@ static int processor_add (struct totem_ip_address *proc_addr, int count, struct } static int processor_index_find(struct totem_ip_address *proc_addr, - struct ckpt_refcnt *ckpt_refcount) + struct ckpt_refcnt *ckpt_refcount) { int i; for (i = 0; i < PROCESSOR_COUNT_MAX; i ++) { @@ -933,7 +961,7 @@ recovery_exit_clean: } } -static void ckpt_recovery_finalize () +static void ckpt_recovery_finalize (void) { struct list_head *checkpoint_list; struct list_head *checkpoint_section_list; @@ -1059,7 +1087,7 @@ static void ckpt_replace_localhost_ip (struct totem_ip_address *joined_list) { static void ckpt_recovery_process_members_exit(struct totem_ip_address *left_list, - int left_list_entries) + int left_list_entries) { struct list_head *checkpoint_list; struct saCkptCheckpoint *checkpoint; @@ -1166,18 +1194,14 @@ void clean_checkpoint_list(struct list_head *head) } } -static int ckpt_confchg_fn ( +static void ckpt_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id) { - if (configuration_type == TOTEM_CONFIGURATION_REGULAR) { -#ifdef TODO - totempg_recovery_plug_unplug (ckpt_checkpoint_recovery_plug_handle); -#endif if (recovery_state == SYNCHRONY_STATE_ENDED) { memcpy (&saved_ring_id, ring_id, sizeof(struct memb_ring_id)); } @@ -1191,8 +1215,6 @@ static int ckpt_confchg_fn ( recovery_state = SYNCHRONY_STATE_STARTED; recovery_abort = 0; } - - return (0); } static struct saCkptCheckpoint *ckpt_checkpoint_find_global (SaNameT *name) @@ -1200,12 +1222,12 @@ static struct saCkptCheckpoint *ckpt_checkpoint_find_global (SaNameT *name) struct list_head *checkpoint_list; struct saCkptCheckpoint *checkpoint; - for (checkpoint_list = checkpoint_list_head.next; - checkpoint_list != &checkpoint_list_head; - checkpoint_list = checkpoint_list->next) { + for (checkpoint_list = checkpoint_list_head.next; + checkpoint_list != &checkpoint_list_head; + checkpoint_list = checkpoint_list->next) { - checkpoint = list_entry (checkpoint_list, - struct saCkptCheckpoint, list); + checkpoint = list_entry (checkpoint_list, + struct saCkptCheckpoint, list); if (name_match (name, &checkpoint->name)) { return (checkpoint); @@ -1221,12 +1243,11 @@ static void ckpt_checkpoint_remove_cleanup ( struct list_head *list; struct checkpoint_cleanup *checkpoint_cleanup; - for (list = conn_info->ais_ci.u.libckpt_ci.checkpoint_list.next; + for (list = conn_info->ais_ci.u.libckpt_ci.checkpoint_list.next; list != &conn_info->ais_ci.u.libckpt_ci.checkpoint_list; - list = list->next) { + list = list->next) { - checkpoint_cleanup = list_entry (list, - struct checkpoint_cleanup, list); + checkpoint_cleanup = list_entry (list, struct checkpoint_cleanup, list); if (name_match (&checkpoint_cleanup->checkpoint.name, &checkpoint->name) || (checkpoint_cleanup->checkpoint.name.length == 0)) { @@ -1365,19 +1386,10 @@ static int ckpt_exec_init_fn (struct openais_config *openais_config) saved_ring_id.seq = 0; totemip_copy(&saved_ring_id.rep, this_ip); -#ifdef TODO - int res; - res = totempg_recovery_plug_create (&ckpt_checkpoint_recovery_plug_handle); - if (res != 0) { - log_printf(LOG_LEVEL_ERROR, - "Could not create recovery plug for clm service.\n"); - return (-1); - } -#endif return (0); } -static int ckpt_exit_fn (struct conn_info *conn_info) +static int ckpt_lib_exit_fn (struct conn_info *conn_info) { struct checkpoint_cleanup *checkpoint_cleanup; struct list_head *cleanup_list; @@ -1414,7 +1426,9 @@ static int ckpt_exit_fn (struct conn_info *conn_info) return (0); } -static int message_handler_req_exec_ckpt_checkpointopen (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_checkpointopen ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_ckpt_checkpointopen *req_exec_ckpt_checkpointopen = (struct req_exec_ckpt_checkpointopen *)message; struct req_lib_ckpt_checkpointopen *req_lib_ckpt_checkpointopen = (struct req_lib_ckpt_checkpointopen *)&req_exec_ckpt_checkpointopen->req_lib_ckpt_checkpointopen; @@ -1614,13 +1628,12 @@ error_exit: free (checkpoint_cleanup); } } - - return (0); } -static int recovery_checkpoint_open(SaNameT *checkpointName, - SaCkptCheckpointCreationAttributesT *ckptAttributes, - struct ckpt_refcnt *ref_cnt) +static int recovery_checkpoint_open( + SaNameT *checkpointName, + SaCkptCheckpointCreationAttributesT *ckptAttributes, + struct ckpt_refcnt *ref_cnt) { int i; struct saCkptCheckpoint *ckptCheckpoint = 0; @@ -1751,7 +1764,9 @@ error_exit: return (error); } -static int message_handler_req_exec_ckpt_synchronize_state (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_synchronize_state ( + void *message, + struct totem_ip_address *source_addr) { int retcode; struct req_exec_ckpt_synchronize_state *req_exec_ckpt_sync_state @@ -1763,7 +1778,7 @@ static int message_handler_req_exec_ckpt_synchronize_state (void *message, struc */ if (memcmp (&req_exec_ckpt_sync_state->previous_ring_id, &saved_ring_id,sizeof (struct memb_ring_id)) == 0) { log_printf(LOG_LEVEL_DEBUG, "CKPT: message_handler_req_exec_ckpt_synchronize_state ignoring ...\n"); - return(0); + return; } retcode = recovery_checkpoint_open(&req_exec_ckpt_sync_state->checkpointName, &req_exec_ckpt_sync_state->checkpointCreationAttributes, @@ -1781,11 +1796,11 @@ static int message_handler_req_exec_ckpt_synchronize_state (void *message, struc log_printf(LOG_LEVEL_DEBUG, "CKPT: message_handler_req_exec_ckpt_synchronize_state\n"); log_printf(LOG_LEVEL_DEBUG, "CKPT: recovery_section_create returned %d\n",retcode); } - - return (0); } -static int message_handler_req_exec_ckpt_synchronize_section (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_synchronize_section ( + void *message, + struct totem_ip_address *source_addr) { int retcode; struct req_exec_ckpt_synchronize_section *req_exec_ckpt_sync_section @@ -1797,7 +1812,7 @@ static int message_handler_req_exec_ckpt_synchronize_section (void *message, str */ if (memcmp (&req_exec_ckpt_sync_section->previous_ring_id, &saved_ring_id,sizeof (struct memb_ring_id)) == 0) { log_printf(LOG_LEVEL_DEBUG, "CKPT: message_handler_req_exec_ckpt_synchronize_section ignoring ...\n"); - return(0); + return; } /* * Write the contents of the section to the checkpoint section. @@ -1815,8 +1830,6 @@ static int message_handler_req_exec_ckpt_synchronize_section (void *message, str log_printf(LOG_LEVEL_ERROR, "CKPT: message_handler_req_exec_ckpt_synchronize_section\n"); log_printf(LOG_LEVEL_ERROR, "CKPT: recovery_section_write returned %d\n",retcode); } - - return (0); } @@ -1903,7 +1916,9 @@ void timer_function_retention (void *data) assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); } -extern int message_handler_req_exec_ckpt_checkpointclose (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_checkpointclose ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_ckpt_checkpointclose *req_exec_ckpt_checkpointclose = (struct req_exec_ckpt_checkpointclose *)message; struct res_lib_ckpt_checkpointclose res_lib_ckpt_checkpointclose; @@ -1970,11 +1985,11 @@ error_exit: if (release_checkpoint) { checkpoint_release(checkpoint); } - - return (0); } -static int message_handler_req_exec_ckpt_checkpointunlink (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_checkpointunlink ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_ckpt_checkpointunlink *req_exec_ckpt_checkpointunlink = (struct req_exec_ckpt_checkpointunlink *)message; @@ -2016,10 +2031,11 @@ error_exit: libais_send_response (req_exec_ckpt_checkpointunlink->source.conn_info, &res_lib_ckpt_checkpointunlink, sizeof (struct res_lib_ckpt_checkpointunlink)); } - return (0); } -static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_checkpointretentiondurationset ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_ckpt_checkpointretentiondurationset *req_exec_ckpt_checkpointretentiondurationset = (struct req_exec_ckpt_checkpointretentiondurationset *)message; struct res_lib_ckpt_checkpointretentiondurationset res_lib_ckpt_checkpointretentiondurationset; @@ -2059,10 +2075,11 @@ static int message_handler_req_exec_ckpt_checkpointretentiondurationset (void *m &res_lib_ckpt_checkpointretentiondurationset, sizeof (struct res_lib_ckpt_checkpointretentiondurationset)); } - return (0); } -static int message_handler_req_exec_ckpt_checkpointretentiondurationexpire (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void message_handler_req_exec_ckpt_checkpointretentiondurationexpire ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_ckpt_checkpointretentiondurationexpire *req_exec_ckpt_checkpointretentiondurationexpire = (struct req_exec_ckpt_checkpointretentiondurationexpire *)message; struct req_exec_ckpt_checkpointunlink req_exec_ckpt_checkpointunlink; @@ -2092,12 +2109,11 @@ static int message_handler_req_exec_ckpt_checkpointretentiondurationexpire (void assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); } - return (0); } static int recovery_section_create (SaCkptSectionDescriptorT *sectionDescriptor, - SaNameT *checkpointName, - char* SectionId) + SaNameT *checkpointName, + char* SectionId) { struct saCkptCheckpoint *ckptCheckpoint; struct saCkptCheckpointSection *ckptCheckpointSection; @@ -2240,7 +2256,10 @@ error_exit: } -static int message_handler_req_exec_ckpt_sectioncreate (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { +static void message_handler_req_exec_ckpt_sectioncreate ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectioncreate *req_exec_ckpt_sectioncreate = (struct req_exec_ckpt_sectioncreate *)message; struct req_lib_ckpt_sectioncreate *req_lib_ckpt_sectioncreate = (struct req_lib_ckpt_sectioncreate *)&req_exec_ckpt_sectioncreate->req_lib_ckpt_sectioncreate; struct res_lib_ckpt_sectioncreate res_lib_ckpt_sectioncreate; @@ -2376,10 +2395,12 @@ error_exit: &res_lib_ckpt_sectioncreate, sizeof (struct res_lib_ckpt_sectioncreate)); } - return (0); } -static int message_handler_req_exec_ckpt_sectiondelete (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { +static void message_handler_req_exec_ckpt_sectiondelete ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectiondelete *req_exec_ckpt_sectiondelete = (struct req_exec_ckpt_sectiondelete *)message; struct req_lib_ckpt_sectiondelete *req_lib_ckpt_sectiondelete = (struct req_lib_ckpt_sectiondelete *)&req_exec_ckpt_sectiondelete->req_lib_ckpt_sectiondelete; struct res_lib_ckpt_sectiondelete res_lib_ckpt_sectiondelete; @@ -2417,8 +2438,6 @@ static int message_handler_req_exec_ckpt_sectiondelete (void *message, struct to error = SA_AIS_ERR_NOT_EXIST; goto error_exit; } -printf ("delete ckptCheckpointSection name %s\n", - ckptCheckpointSection->sectionDescriptor.sectionId.id); /* * Delete checkpoint section @@ -2439,10 +2458,12 @@ error_exit: &res_lib_ckpt_sectiondelete, sizeof (struct res_lib_ckpt_sectiondelete)); } - return (0); } -static int message_handler_req_exec_ckpt_sectionexpirationtimeset (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { +static void message_handler_req_exec_ckpt_sectionexpirationtimeset ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectionexpirationtimeset *req_exec_ckpt_sectionexpirationtimeset = (struct req_exec_ckpt_sectionexpirationtimeset *)message; struct req_lib_ckpt_sectionexpirationtimeset *req_lib_ckpt_sectionexpirationtimeset = (struct req_lib_ckpt_sectionexpirationtimeset *)&req_exec_ckpt_sectionexpirationtimeset->req_lib_ckpt_sectionexpirationtimeset; struct res_lib_ckpt_sectionexpirationtimeset res_lib_ckpt_sectionexpirationtimeset; @@ -2518,15 +2539,14 @@ error_exit: &res_lib_ckpt_sectionexpirationtimeset, sizeof (struct res_lib_ckpt_sectionexpirationtimeset)); } - return (0); } static int recovery_section_write(int sectionIdLen, - char* sectionId, - SaNameT *checkpointName, - void *newData, - SaUint32T dataOffSet, - SaUint32T dataSize) + char* sectionId, + SaNameT *checkpointName, + void *newData, + SaUint32T dataOffSet, + SaUint32T dataSize) { struct saCkptCheckpoint *ckptCheckpoint; struct saCkptCheckpointSection *ckptCheckpointSection; @@ -2579,7 +2599,10 @@ error_exit: } -static int message_handler_req_exec_ckpt_sectionwrite (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { +static void message_handler_req_exec_ckpt_sectionwrite ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectionwrite *req_exec_ckpt_sectionwrite = (struct req_exec_ckpt_sectionwrite *)message; struct req_lib_ckpt_sectionwrite *req_lib_ckpt_sectionwrite = (struct req_lib_ckpt_sectionwrite *)&req_exec_ckpt_sectionwrite->req_lib_ckpt_sectionwrite; struct res_lib_ckpt_sectionwrite res_lib_ckpt_sectionwrite; @@ -2673,10 +2696,12 @@ error_exit: &res_lib_ckpt_sectionwrite, sizeof (struct res_lib_ckpt_sectionwrite)); } - return (0); } -static int message_handler_req_exec_ckpt_sectionoverwrite (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { +static void message_handler_req_exec_ckpt_sectionoverwrite ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectionoverwrite *req_exec_ckpt_sectionoverwrite = (struct req_exec_ckpt_sectionoverwrite *)message; struct req_lib_ckpt_sectionoverwrite *req_lib_ckpt_sectionoverwrite = (struct req_lib_ckpt_sectionoverwrite *)&req_exec_ckpt_sectionoverwrite->req_lib_ckpt_sectionoverwrite; struct res_lib_ckpt_sectionoverwrite res_lib_ckpt_sectionoverwrite; @@ -2750,9 +2775,12 @@ error_exit: &res_lib_ckpt_sectionoverwrite, sizeof (struct res_lib_ckpt_sectionoverwrite)); } - return (0); } -static int message_handler_req_exec_ckpt_sectionread (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) { + +static void message_handler_req_exec_ckpt_sectionread ( + void *message, + struct totem_ip_address *source_addr) +{ struct req_exec_ckpt_sectionread *req_exec_ckpt_sectionread = (struct req_exec_ckpt_sectionread *)message; struct req_lib_ckpt_sectionread *req_lib_ckpt_sectionread = (struct req_lib_ckpt_sectionread *)&req_exec_ckpt_sectionread->req_lib_ckpt_sectionread; struct res_lib_ckpt_sectionread res_lib_ckpt_sectionread; @@ -2828,10 +2856,9 @@ error_exit: sectionSize); } } - return (0); } -static int ckpt_init_two_fn (struct conn_info *conn_info) +static int ckpt_lib_init_fn (struct conn_info *conn_info) { list_init (&conn_info->conn_info_partner->ais_ci.u.libckpt_ci.sectionIterator .list); @@ -2846,7 +2873,9 @@ static int ckpt_init_two_fn (struct conn_info *conn_info) } -static int message_handler_req_lib_ckpt_checkpointopen (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointopen ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointopen *req_lib_ckpt_checkpointopen = (struct req_lib_ckpt_checkpointopen *)message; struct req_exec_ckpt_checkpointopen req_exec_ckpt_checkpointopen; @@ -2873,11 +2902,11 @@ static int message_handler_req_lib_ckpt_checkpointopen (struct conn_info *conn_i iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointopen); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_ckpt_checkpointopenasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointopenasync ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointopenasync *req_lib_ckpt_checkpointopenasync = (struct req_lib_ckpt_checkpointopenasync *)message; struct req_exec_ckpt_checkpointopen req_exec_ckpt_checkpointopen; @@ -2904,12 +2933,13 @@ static int message_handler_req_lib_ckpt_checkpointopenasync (struct conn_info *c iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointopen); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_ckpt_checkpointclose (struct conn_info *conn_info, void *message) { +static void message_handler_req_lib_ckpt_checkpointclose ( + struct conn_info *conn_info, + void *message) +{ struct req_lib_ckpt_checkpointclose *req_lib_ckpt_checkpointclose = (struct req_lib_ckpt_checkpointclose *)message; struct req_exec_ckpt_checkpointclose req_exec_ckpt_checkpointclose; struct iovec iovecs[2]; @@ -2947,10 +2977,11 @@ static int message_handler_req_lib_ckpt_checkpointclose (struct conn_info *conn_ &res_lib_ckpt_checkpointclose, sizeof (struct res_lib_ckpt_checkpointclose)); } - return (0); } -static int message_handler_req_lib_ckpt_checkpointunlink (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointunlink ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointunlink *req_lib_ckpt_checkpointunlink = (struct req_lib_ckpt_checkpointunlink *)message; struct req_exec_ckpt_checkpointunlink req_exec_ckpt_checkpointunlink; @@ -2971,11 +3002,11 @@ static int message_handler_req_lib_ckpt_checkpointunlink (struct conn_info *conn iovecs[0].iov_len = sizeof (req_exec_ckpt_checkpointunlink); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_ckpt_checkpointretentiondurationset (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointretentiondurationset ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointretentiondurationset *req_lib_ckpt_checkpointretentiondurationset = (struct req_lib_ckpt_checkpointretentiondurationset *)message; struct req_exec_ckpt_checkpointretentiondurationset req_exec_ckpt_checkpointretentiondurationset; @@ -2999,10 +3030,11 @@ static int message_handler_req_lib_ckpt_checkpointretentiondurationset (struct c assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - return (0); } -static int message_handler_req_lib_ckpt_activereplicaset (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_activereplicaset ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_activereplicaset *req_lib_ckpt_activereplicaset = (struct req_lib_ckpt_activereplicaset *)message; struct res_lib_ckpt_activereplicaset res_lib_ckpt_activereplicaset; @@ -3025,10 +3057,11 @@ static int message_handler_req_lib_ckpt_activereplicaset (struct conn_info *conn libais_send_response (conn_info, &res_lib_ckpt_activereplicaset, sizeof (struct res_lib_ckpt_activereplicaset)); - return (0); } -static int message_handler_req_lib_ckpt_checkpointstatusget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointstatusget ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointstatusget *req_lib_ckpt_checkpointstatusget = (struct req_lib_ckpt_checkpointstatusget *)message; struct res_lib_ckpt_checkpointstatusget res_lib_ckpt_checkpointstatusget; @@ -3085,10 +3118,11 @@ static int message_handler_req_lib_ckpt_checkpointstatusget (struct conn_info *c log_printf (LOG_LEVEL_DEBUG, "before sending message\n"); libais_send_response (conn_info, &res_lib_ckpt_checkpointstatusget, sizeof (struct res_lib_ckpt_checkpointstatusget)); - return (0); } -static int message_handler_req_lib_ckpt_sectioncreate (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectioncreate ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectioncreate *req_lib_ckpt_sectioncreate = (struct req_lib_ckpt_sectioncreate *)message; struct req_exec_ckpt_sectioncreate req_exec_ckpt_sectioncreate; @@ -3165,11 +3199,11 @@ printf ("|\n"); &res_lib_ckpt_sectioncreate, sizeof (struct res_lib_ckpt_sectioncreate)); } - - return (0); } -static int message_handler_req_lib_ckpt_sectiondelete (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectiondelete ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectiondelete *req_lib_ckpt_sectiondelete = (struct req_lib_ckpt_sectiondelete *)message; struct req_exec_ckpt_sectiondelete req_exec_ckpt_sectiondelete; @@ -3207,11 +3241,11 @@ static int message_handler_req_lib_ckpt_sectiondelete (struct conn_info *conn_in } else { assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); } - - return (0); } -static int message_handler_req_lib_ckpt_sectionexpirationtimeset (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectionexpirationtimeset ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectionexpirationtimeset *req_lib_ckpt_sectionexpirationtimeset = (struct req_lib_ckpt_sectionexpirationtimeset *)message; struct req_exec_ckpt_sectionexpirationtimeset req_exec_ckpt_sectionexpirationtimeset; @@ -3249,12 +3283,11 @@ static int message_handler_req_lib_ckpt_sectionexpirationtimeset (struct conn_in } else { assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); } - - return (0); } -int write_inv = 0; -static int message_handler_req_lib_ckpt_sectionwrite (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectionwrite ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectionwrite *req_lib_ckpt_sectionwrite = (struct req_lib_ckpt_sectionwrite *)message; struct req_exec_ckpt_sectionwrite req_exec_ckpt_sectionwrite; @@ -3318,11 +3351,11 @@ static int message_handler_req_lib_ckpt_sectionwrite (struct conn_info *conn_inf &res_lib_ckpt_sectionwrite, sizeof (struct res_lib_ckpt_sectionwrite)); } - - return (0); } -static int message_handler_req_lib_ckpt_sectionoverwrite (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectionoverwrite ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectionoverwrite *req_lib_ckpt_sectionoverwrite = (struct req_lib_ckpt_sectionoverwrite *)message; struct req_exec_ckpt_sectionoverwrite req_exec_ckpt_sectionoverwrite; @@ -3378,11 +3411,11 @@ static int message_handler_req_lib_ckpt_sectionoverwrite (struct conn_info *conn &res_lib_ckpt_sectionoverwrite, sizeof (struct res_lib_ckpt_sectionoverwrite)); } - - return (0); } -static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectionread ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectionread *req_lib_ckpt_sectionread = (struct req_lib_ckpt_sectionread *)message; struct req_exec_ckpt_sectionread req_exec_ckpt_sectionread; @@ -3432,7 +3465,7 @@ static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info } else { assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); } - return (0); /* DO NOT REMOVE */ + return; } if (checkpoint) { @@ -3461,11 +3494,11 @@ static int message_handler_req_lib_ckpt_sectionread (struct conn_info *conn_info libais_send_response (conn_info, &res_lib_ckpt_sectionread, sizeof (struct res_lib_ckpt_sectionread)); - - return (0); } -static int message_handler_req_lib_ckpt_checkpointsynchronize (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointsynchronize ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointsynchronize *req_lib_ckpt_checkpointsynchronize = (struct req_lib_ckpt_checkpointsynchronize *)message; struct res_lib_ckpt_checkpointsynchronize res_lib_ckpt_checkpointsynchronize; @@ -3487,11 +3520,11 @@ static int message_handler_req_lib_ckpt_checkpointsynchronize (struct conn_info libais_send_response (conn_info, &res_lib_ckpt_checkpointsynchronize, sizeof (struct res_lib_ckpt_checkpointsynchronize)); - - return (0); } -static int message_handler_req_lib_ckpt_checkpointsynchronizeasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_checkpointsynchronizeasync ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_checkpointsynchronizeasync *req_lib_ckpt_checkpointsynchronizeasync = (struct req_lib_ckpt_checkpointsynchronizeasync *)message; struct res_lib_ckpt_checkpointsynchronizeasync res_lib_ckpt_checkpointsynchronizeasync; @@ -3518,11 +3551,11 @@ static int message_handler_req_lib_ckpt_checkpointsynchronizeasync (struct conn_ libais_send_response (conn_info->conn_info_partner, &res_lib_ckpt_checkpointsynchronizeasync, sizeof (struct res_lib_ckpt_checkpointsynchronizeasync)); - - return (0); } -static int message_handler_req_lib_ckpt_sectioniterationinitialize (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectioniterationinitialize ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectioniterationinitialize *req_lib_ckpt_sectioniterationinitialize = (struct req_lib_ckpt_sectioniterationinitialize *)message; struct res_lib_ckpt_sectioniterationinitialize res_lib_ckpt_sectioniterationinitialize; @@ -3591,11 +3624,11 @@ error_exit: libais_send_response (conn_info, &res_lib_ckpt_sectioniterationinitialize, sizeof (struct res_lib_ckpt_sectioniterationinitialize)); - - return (0); } -static int message_handler_req_lib_ckpt_sectioniterationfinalize (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectioniterationfinalize ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectioniterationfinalize *req_lib_ckpt_sectioniterationfinalize = (struct req_lib_ckpt_sectioniterationfinalize *)message; struct res_lib_ckpt_sectioniterationfinalize res_lib_ckpt_sectioniterationfinalize; @@ -3620,11 +3653,11 @@ error_exit: libais_send_response (conn_info, &res_lib_ckpt_sectioniterationfinalize, sizeof (struct res_lib_ckpt_sectioniterationfinalize)); - - return (0); } -static int message_handler_req_lib_ckpt_sectioniteratornext (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_ckpt_sectioniteratornext ( + struct conn_info *conn_info, + void *message) { struct req_lib_ckpt_sectioniteratornext *req_lib_ckpt_sectioniteratornext = (struct req_lib_ckpt_sectioniteratornext *)message; struct res_lib_ckpt_sectioniteratornext res_lib_ckpt_sectioniteratornext; @@ -3687,5 +3720,4 @@ error_exit: libais_send_response (conn_info, ckptSectionIterator->sectionIteratorEntries[iteratorPos].checkpointSection->sectionDescriptor.sectionId.id, sectionIdSize); - return (0); } diff --git a/exec/ckpt.h b/exec/ckpt.h index 4a3d5cf5..3b63dda7 100644 --- a/exec/ckpt.h +++ b/exec/ckpt.h @@ -82,6 +82,6 @@ struct libckpt_ci { struct saCkptSectionIterator sectionIterator; }; -extern struct service_handler ckpt_service_handler; +extern struct openais_service_handler ckpt_service_handler; #endif /* CKPT_H_DEFINED */ diff --git a/exec/clm.c b/exec/clm.c index 42039f17..2155dcfe 100644 --- a/exec/clm.c +++ b/exec/clm.c @@ -77,9 +77,9 @@ SaClmClusterNodeT thisClusterNode; #define NODE_MAX 16 -SaClmClusterNodeT clusterNodes[NODE_MAX]; +static SaClmClusterNodeT clusterNodes[NODE_MAX]; -int clusterNodeEntries = 0; +static int clusterNodeEntries = 0; static unsigned long long view_current = 0; @@ -107,7 +107,7 @@ SaClmClusterNodeT *clm_get_by_nodeid (unsigned int node_id) /* * Service Interfaces required by service_message_handler struct */ -static int clm_confchg_fn ( +static void clm_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -124,86 +124,93 @@ static void clm_sync_abort (void); static int clm_exec_init_fn (struct openais_config *); -static int clm_init_two_fn (struct conn_info *conn_info); +static int clm_lib_init_fn (struct conn_info *conn_info); -static int clm_exit_fn (struct conn_info *conn_info); +static int clm_lib_exit_fn (struct conn_info *conn_info); -static int message_handler_req_exec_clm_nodejoin (void *message, struct totem_ip_address *source_addr, - int endian_conversion_required); +static void message_handler_req_exec_clm_nodejoin ( + void *message, + struct totem_ip_address *source_addr); -static int message_handler_req_lib_clm_clustertrack (struct conn_info *conn_info, +static void exec_clm_nodejoin_endian_convert (void *msg); + +static void message_handler_req_lib_clm_clustertrack (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_clm_trackstop (struct conn_info *conn_info, +static void message_handler_req_lib_clm_trackstop (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_clm_nodeget (struct conn_info *conn_info, +static void message_handler_req_lib_clm_nodeget (struct conn_info *conn_info, void *message); -static int message_handler_req_lib_clm_nodegetasync (struct conn_info *conn_info, +static void message_handler_req_lib_clm_nodegetasync (struct conn_info *conn_info, void *message); -static int clm_exit_fn (struct conn_info *conn_info); - /* * Executive Handler Definition */ -struct libais_handler clm_libais_handlers[] = +static struct openais_lib_handler clm_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_clm_clustertrack, + .lib_handler_fn = message_handler_req_lib_clm_clustertrack, .response_size = sizeof (struct res_lib_clm_clustertrack), .response_id = MESSAGE_RES_CLM_TRACKSTART, // TODO RESPONSE - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_clm_trackstop, + .lib_handler_fn = message_handler_req_lib_clm_trackstop, .response_size = sizeof (struct res_lib_clm_trackstop), .response_id = MESSAGE_RES_CLM_TRACKSTOP, // TODO RESPONSE - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_clm_nodeget, + .lib_handler_fn = message_handler_req_lib_clm_nodeget, .response_size = sizeof (struct res_clm_nodeget), .response_id = MESSAGE_RES_CLM_NODEGET, // TODO RESPONSE - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_clm_nodegetasync, + .lib_handler_fn = message_handler_req_lib_clm_nodegetasync, .response_size = sizeof (struct res_clm_nodegetasync), .response_id = MESSAGE_RES_CLM_NODEGETCALLBACK, // TODO RESPONSE - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED } }; -static int (*clm_aisexec_handler_fns[]) (void *, struct totem_ip_address *source_addr, int endian_conversion_required) = { - message_handler_req_exec_clm_nodejoin +static struct openais_exec_handler clm_exec_handlers[] = +{ + { + .exec_handler_fn = message_handler_req_exec_clm_nodejoin, + .exec_endian_convert_fn = exec_clm_nodejoin_endian_convert + } }; -struct service_handler clm_service_handler = { - .name = "openais cluster membership service B.01.01", +struct openais_service_handler clm_service_handler = { + .name = (unsigned char*)"openais cluster membership service B.01.01", .id = CLM_SERVICE, - .libais_handlers = clm_libais_handlers, - .libais_handlers_count = sizeof (clm_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = clm_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (clm_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = clm_confchg_fn, - .libais_init_two_fn = clm_init_two_fn, - .libais_exit_fn = clm_exit_fn, + .lib_init_fn = clm_lib_init_fn, + .lib_exit_fn = clm_lib_exit_fn, + .lib_handlers = clm_lib_handlers, + .lib_handlers_count = sizeof (clm_lib_handlers) / sizeof (struct openais_lib_handler), .exec_init_fn = clm_exec_init_fn, - .exec_dump_fn = 0, + .exec_dump_fn = NULL, + .exec_handlers = clm_exec_handlers, + .exec_handlers_count = sizeof (clm_exec_handlers) / sizeof (struct openais_exec_handler), + .confchg_fn = clm_confchg_fn, .sync_init = clm_sync_init, .sync_process = clm_sync_process, .sync_activate = clm_sync_activate, .sync_abort = clm_sync_abort, }; +/* + * Dynamic loader definition + */ #ifdef BUILD_DYNAMIC -struct service_handler *clm_get_handler_ver0 (void); +struct openais_service_handler *clm_get_service_handler_ver0 (void); -struct aisexec_iface_ver0 clm_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = clm_get_handler_ver0 +struct openais_service_handler_iface_ver0 clm_service_handler_iface = { + .openais_get_service_handler_ver0 = clm_get_service_handler_ver0 }; struct lcr_iface openais_clm_ver0[1] = { @@ -226,13 +233,13 @@ struct lcr_comp clm_comp_ver0 = { }; -extern int lcr_comp_get (struct lcr_comp **component) +int lcr_comp_get (struct lcr_comp **component) { *component = &clm_comp_ver0; return (0); } -struct service_handler *clm_get_handler_ver0 (void) +struct openais_service_handler *clm_get_service_handler_ver0 (void) { return (&clm_service_handler); } @@ -286,7 +293,7 @@ static int clm_exec_init_fn (struct openais_config *openais_config) return (0); } -static int clm_exit_fn (struct conn_info *conn_info) +static int clm_lib_exit_fn (struct conn_info *conn_info) { /* * Delete track entry if there is one @@ -296,7 +303,7 @@ static int clm_exit_fn (struct conn_info *conn_info) return (0); } -void library_notification_send (SaClmClusterNotificationT *cluster_notification_entries, +static void library_notification_send (SaClmClusterNotificationT *cluster_notification_entries, int notify_entries) { struct res_lib_clm_clustertrack res_lib_clm_clustertrack; @@ -441,7 +448,7 @@ static int clm_nodejoin_send (void) return (result); } -static int clm_confchg_fn ( +static void clm_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -496,7 +503,6 @@ static int clm_confchg_fn ( (char *)thisClusterNode.nodeAddress.value); thisClusterNode.nodeName.length = thisClusterNode.nodeAddress.length; thisClusterNode.nodeId = this_ip->nodeid; - return (0); } /* @@ -536,32 +542,18 @@ static void clm_sync_abort (void) } -static void exec_clm_nodejoin_endian_conversion (struct req_exec_clm_nodejoin *in, - struct req_exec_clm_nodejoin *out) +static void exec_clm_nodejoin_endian_convert (void *msg) { - // TODO this isn't complete yet - // TODO SaNameT needs to be packed and aligned - memmove (&out->clusterNode.nodeName.value[0], - &in->clusterNode.nodeName.value[2], - SA_MAX_NAME_LENGTH); } -static int message_handler_req_exec_clm_nodejoin (void *message, struct totem_ip_address *source_addr, - int endian_conversion_required) +static void message_handler_req_exec_clm_nodejoin ( + void *message, + struct totem_ip_address *source_addr) { struct req_exec_clm_nodejoin *req_exec_clm_nodejoin = (struct req_exec_clm_nodejoin *)message; - struct req_exec_clm_nodejoin req_exec_clm_nodejoin_storage; int found = 0; int i; - if (endian_conversion_required) { - exec_clm_nodejoin_endian_conversion (message, &req_exec_clm_nodejoin_storage); - req_exec_clm_nodejoin = &req_exec_clm_nodejoin_storage; - } else { - req_exec_clm_nodejoin = (struct req_exec_clm_nodejoin *)message; - } - - log_printf (LOG_LEVEL_NOTICE, "got nodejoin message %s\n", req_exec_clm_nodejoin->clusterNode.nodeName.value); /* @@ -584,11 +576,9 @@ static int message_handler_req_exec_clm_nodejoin (void *message, struct totem_ip clusterNodeEntries += 1; } - - return (0); } -static int clm_init_two_fn (struct conn_info *conn_info) +static int clm_lib_init_fn (struct conn_info *conn_info) { log_printf (LOG_LEVEL_DEBUG, "Got request to initalize cluster membership service.\n"); @@ -597,7 +587,7 @@ static int clm_init_two_fn (struct conn_info *conn_info) return (0); } -int message_handler_req_lib_clm_clustertrack (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_clm_clustertrack (struct conn_info *conn_info, void *message) { struct req_lib_clm_clustertrack *req_lib_clm_clustertrack = (struct req_lib_clm_clustertrack *)message; struct res_lib_clm_clustertrack res_lib_clm_clustertrack; @@ -644,11 +634,10 @@ int message_handler_req_lib_clm_clustertrack (struct conn_info *conn_info, void &res_lib_clm_clustertrack, sizeof (struct res_lib_clm_clustertrack)); } - return (0); } -static int message_handler_req_lib_clm_trackstop (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_clm_trackstop (struct conn_info *conn_info, void *message) { struct res_lib_clm_trackstop res_lib_clm_trackstop; @@ -668,11 +657,9 @@ static int message_handler_req_lib_clm_trackstop (struct conn_info *conn_info, v libais_send_response (conn_info, &res_lib_clm_trackstop, sizeof (struct res_lib_clm_trackstop)); - - return (0); } -static int message_handler_req_lib_clm_nodeget (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_clm_nodeget (struct conn_info *conn_info, void *message) { struct req_lib_clm_nodeget *req_lib_clm_nodeget = (struct req_lib_clm_nodeget *)message; struct res_clm_nodeget res_clm_nodeget; @@ -704,11 +691,9 @@ static int message_handler_req_lib_clm_nodeget (struct conn_info *conn_info, voi memcpy (&res_clm_nodeget.clusterNode, clusterNode, sizeof (SaClmClusterNodeT)); } libais_send_response (conn_info, &res_clm_nodeget, sizeof (struct res_clm_nodeget)); - - return (0); } -static int message_handler_req_lib_clm_nodegetasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_clm_nodegetasync (struct conn_info *conn_info, void *message) { struct req_lib_clm_nodegetasync *req_lib_clm_nodegetasync = (struct req_lib_clm_nodegetasync *)message; struct res_clm_nodegetasync res_clm_nodegetasync; @@ -754,6 +739,4 @@ static int message_handler_req_lib_clm_nodegetasync (struct conn_info *conn_info } libais_send_response (conn_info->conn_info_partner, &res_clm_nodegetcallback, sizeof (struct res_clm_nodegetcallback)); - - return (0); } diff --git a/exec/clm.h b/exec/clm.h index 0698cd63..ab3b57d3 100644 --- a/exec/clm.h +++ b/exec/clm.h @@ -47,6 +47,6 @@ struct libclm_ci { extern SaClmClusterNodeT *clm_get_by_nodeid (unsigned int node_id); -extern struct service_handler clm_service_handler; +extern struct openais_service_handler clm_service_handler; #endif /* CLM_H_DEFINED */ diff --git a/exec/evs.c b/exec/evs.c index b8b8583a..dc59c956 100644 --- a/exec/evs.c +++ b/exec/evs.c @@ -73,88 +73,94 @@ enum evs_exec_message_req_types { /* * Service Interfaces required by service_message_handler struct */ -static int evs_executive_initialize (struct openais_config *); - -static int evs_confchg_fn ( +static void evs_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); -static int evs_init_two_fn (struct conn_info *conn_info); +static void message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr); -static int message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr, int endian_conversion_required); +static void req_exec_mcast_endian_convert (void *msg); -static int message_handler_req_evs_join (struct conn_info *conn_info, void *message); -static int message_handler_req_evs_leave (struct conn_info *conn_info, void *message); -static int message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message); -static int message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message); -static int message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message); +static void message_handler_req_evs_join (struct conn_info *conn_info, void *message); +static void message_handler_req_evs_leave (struct conn_info *conn_info, void *message); +static void message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message); +static void message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message); +static void message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message); -static int evs_exit_fn (struct conn_info *conn_info); +static int evs_lib_init_fn (struct conn_info *conn_info); +static int evs_lib_exit_fn (struct conn_info *conn_info); -struct libais_handler evs_libais_handlers[] = +static struct openais_lib_handler evs_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_evs_join, + .lib_handler_fn = message_handler_req_evs_join, .response_size = sizeof (struct res_lib_evs_join), .response_id = MESSAGE_RES_EVS_JOIN, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_evs_leave, + .lib_handler_fn = message_handler_req_evs_leave, .response_size = sizeof (struct res_lib_evs_leave), .response_id = MESSAGE_RES_EVS_LEAVE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_evs_mcast_joined, + .lib_handler_fn = message_handler_req_evs_mcast_joined, .response_size = sizeof (struct res_lib_evs_mcast_joined), .response_id = MESSAGE_RES_EVS_MCAST_JOINED, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_evs_mcast_groups, + .lib_handler_fn = message_handler_req_evs_mcast_groups, .response_size = sizeof (struct res_lib_evs_mcast_groups), .response_id = MESSAGE_RES_EVS_MCAST_GROUPS, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 4 */ - .libais_handler_fn = message_handler_req_evs_membership_get, + .lib_handler_fn = message_handler_req_evs_membership_get, .response_size = sizeof (struct res_lib_evs_membership_get), .response_id = MESSAGE_RES_EVS_MEMBERSHIP_GET, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED } }; -static int (*evs_aisexec_handler_fns[]) (void *, struct totem_ip_address *source_addr, int endian_conversion_required) = { - message_handler_req_exec_mcast +static struct openais_exec_handler evs_exec_handlers[] = +{ + { + .exec_handler_fn = message_handler_req_exec_mcast, + .exec_endian_convert_fn = req_exec_mcast_endian_convert + } }; -struct service_handler evs_service_handler = { - .name = "openais extended virtual synchrony service", +struct openais_service_handler evs_service_handler = { + .name = (unsigned char*)"openais extended virtual synchrony service", .id = EVS_SERVICE, - .libais_handlers = evs_libais_handlers, - .libais_handlers_count = sizeof (evs_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = evs_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (evs_aisexec_handler_fns) / sizeof (int (*)), + .lib_init_fn = evs_lib_init_fn, + .lib_exit_fn = evs_lib_exit_fn, + .lib_handlers = evs_lib_handlers, + .lib_handlers_count = sizeof (evs_lib_handlers) / sizeof (struct openais_lib_handler), + .exec_handlers = evs_exec_handlers, + .exec_handlers_count = sizeof (evs_exec_handlers) / sizeof (struct openais_exec_handler), .confchg_fn = evs_confchg_fn, - .libais_init_two_fn = evs_init_two_fn, - .libais_exit_fn = evs_exit_fn, - .exec_init_fn = evs_executive_initialize, - .exec_dump_fn = 0 + .exec_init_fn = NULL, + .exec_dump_fn = NULL }; static DECLARE_LIST_INIT (confchg_notify); +/* + * Dynamic loading descriptor + */ + #ifdef BUILD_DYNAMIC -struct service_handler *evs_get_handler_ver0 (void); +struct openais_service_handler *evs_get_service_handler_ver0 (void); -struct aisexec_iface_ver0 evs_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = evs_get_handler_ver0 +struct openais_service_handler_iface_ver0 evs_service_handler_iface = { + .openais_get_service_handler_ver0 = evs_get_service_handler_ver0 }; struct lcr_iface openais_evs_ver0[1] = { @@ -176,34 +182,22 @@ struct lcr_comp evs_comp_ver0 = { .ifaces = openais_evs_ver0 }; -extern int lcr_comp_get (struct lcr_comp **component) +int lcr_comp_get (struct lcr_comp **component) { *component = &evs_comp_ver0; return (0); } -struct service_handler *evs_get_handler_ver0 (void) +struct openais_service_handler *evs_get_service_handler_ver0 (void) { return (&evs_service_handler); } #endif /* BUILD_DYNAMIC */ -static int evs_executive_initialize (struct openais_config *openais_config) -{ - return (0); -} - -static int evs_exit_fn (struct conn_info *conn_info) -{ - - list_del (&conn_info->conn_list); - return (0); -} - struct res_evs_confchg_callback res_evs_confchg_callback; -static int evs_confchg_fn ( +static void evs_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -246,22 +240,27 @@ static int evs_confchg_fn ( libais_send_response (conn_info, &res_evs_confchg_callback, sizeof (res_evs_confchg_callback)); } - - return (0); } -static int evs_init_two_fn (struct conn_info *conn_info) +static int evs_lib_init_fn (struct conn_info *conn_info) { log_printf (LOG_LEVEL_DEBUG, "Got request to initalize evs service.\n"); list_init (&conn_info->conn_list); list_add (&conn_info->conn_list, &confchg_notify); + libais_send_response (conn_info, &res_evs_confchg_callback, sizeof (res_evs_confchg_callback)); return (0); } -static int message_handler_req_evs_join (struct conn_info *conn_info, void *message) +static int evs_lib_exit_fn (struct conn_info *conn_info) +{ + list_del (&conn_info->conn_list); + return (0); +} + +static void message_handler_req_evs_join (struct conn_info *conn_info, void *message) { evs_error_t error = EVS_OK; struct req_lib_evs_join *req_lib_evs_join = (struct req_lib_evs_join *)message; @@ -303,11 +302,9 @@ exit_error: libais_send_response (conn_info, &res_lib_evs_join, sizeof (struct res_lib_evs_join)); - - return (0); } -static int message_handler_req_evs_leave (struct conn_info *conn_info, void *message) +static void message_handler_req_evs_leave (struct conn_info *conn_info, void *message) { struct req_lib_evs_leave *req_lib_evs_leave = (struct req_lib_evs_leave *)message; struct res_lib_evs_leave res_lib_evs_leave; @@ -358,11 +355,9 @@ static int message_handler_req_evs_leave (struct conn_info *conn_info, void *mes libais_send_response (conn_info, &res_lib_evs_leave, sizeof (struct res_lib_evs_leave)); - - return (0); } -static int message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message) +static void message_handler_req_evs_mcast_joined (struct conn_info *conn_info, void *message) { evs_error_t error = EVS_ERR_TRY_AGAIN; struct req_lib_evs_mcast_joined *req_lib_evs_mcast_joined = (struct req_lib_evs_mcast_joined *)message; @@ -403,11 +398,9 @@ static int message_handler_req_evs_mcast_joined (struct conn_info *conn_info, vo libais_send_response (conn_info, &res_lib_evs_mcast_joined, sizeof (struct res_lib_evs_mcast_joined)); - - return (0); } -static int message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message) +static void message_handler_req_evs_mcast_groups (struct conn_info *conn_info, void *message) { evs_error_t error = EVS_ERR_TRY_AGAIN; struct req_lib_evs_mcast_groups *req_lib_evs_mcast_groups = (struct req_lib_evs_mcast_groups *)message; @@ -451,10 +444,9 @@ static int message_handler_req_evs_mcast_groups (struct conn_info *conn_info, vo libais_send_response (conn_info, &res_lib_evs_mcast_groups, sizeof (struct res_lib_evs_mcast_groups)); - - return (0); } -static int message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message) + +static void message_handler_req_evs_membership_get (struct conn_info *conn_info, void *message) { struct res_lib_evs_membership_get res_lib_evs_membership_get; @@ -472,11 +464,13 @@ static int message_handler_req_evs_membership_get (struct conn_info *conn_info, libais_send_response (conn_info, &res_lib_evs_membership_get, sizeof (struct res_lib_evs_membership_get)); - - return (0); } -static int message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr, int endian_conversion_required) +static void req_exec_mcast_endian_convert (void *msg) +{ +} + +static void message_handler_req_exec_mcast (void *message, struct totem_ip_address *source_addr) { struct req_exec_evs_mcast *req_exec_evs_mcast = (struct req_exec_evs_mcast *)message; struct res_evs_deliver_callback res_evs_deliver_callback; @@ -523,7 +517,4 @@ static int message_handler_req_exec_mcast (void *message, struct totem_ip_addres req_exec_evs_mcast->msg_len); } } -//TODO printf ("Got evs message %s\n", msg_addr); - - return (0); } diff --git a/exec/evs.h b/exec/evs.h index c92af308..72f076cc 100644 --- a/exec/evs.h +++ b/exec/evs.h @@ -44,6 +44,6 @@ struct libevs_ci { int group_entries; }; -extern struct service_handler evs_service_handler; +extern struct openais_service_handler evs_service_handler; #endif /* EVS_H_DEFINED */ diff --git a/exec/evt.c b/exec/evt.c index fad0f1d7..0a0624b3 100644 --- a/exec/evt.c +++ b/exec/evt.c @@ -72,30 +72,30 @@ enum evt_message_req_types { MESSAGE_REQ_EXEC_EVT_RECOVERY_EVENTDATA = 2 }; -static int lib_evt_open_channel(struct conn_info *conn_info, void *message); -static int lib_evt_open_channel_async(struct conn_info *conn_info, +static void lib_evt_open_channel(struct conn_info *conn_info, void *message); +static void lib_evt_open_channel_async(struct conn_info *conn_info, void *message); -static int lib_evt_close_channel(struct conn_info *conn_info, void *message); -static int lib_evt_unlink_channel(struct conn_info *conn_info, void *message); -static int lib_evt_event_subscribe(struct conn_info *conn_info, +static void lib_evt_close_channel(struct conn_info *conn_info, void *message); +static void lib_evt_unlink_channel(struct conn_info *conn_info, void *message); +static void lib_evt_event_subscribe(struct conn_info *conn_info, void *message); -static int lib_evt_event_unsubscribe(struct conn_info *conn_info, +static void lib_evt_event_unsubscribe(struct conn_info *conn_info, void *message); -static int lib_evt_event_publish(struct conn_info *conn_info, void *message); -static int lib_evt_event_clear_retentiontime(struct conn_info *conn_info, +static void lib_evt_event_publish(struct conn_info *conn_info, void *message); +static void lib_evt_event_clear_retentiontime(struct conn_info *conn_info, void *message); -static int lib_evt_event_data_get(struct conn_info *conn_info, +static void lib_evt_event_data_get(struct conn_info *conn_info, void *message); -static int evt_conf_change( +static void evt_conf_change( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); -static int evt_initialize(struct conn_info *conn_info); -static int evt_finalize(struct conn_info *conn_info); +static int evt_lib_init(struct conn_info *conn_info); +static int evt_lib_exit(struct conn_info *conn_info); static int evt_exec_init(struct openais_config *openais_config); /* @@ -106,94 +106,99 @@ static int evt_sync_process(void); static void evt_sync_activate(void); static void evt_sync_abort(void); +static void convert_event(void *msg); +static void convert_chan_packet(void *msg); -static struct libais_handler evt_libais_handlers[] = { +static struct openais_lib_handler evt_lib_handlers[] = { { - .libais_handler_fn = lib_evt_open_channel, + .lib_handler_fn = lib_evt_open_channel, .response_size = sizeof(struct res_evt_channel_open), .response_id = MESSAGE_RES_EVT_OPEN_CHANNEL, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_open_channel_async, + .lib_handler_fn = lib_evt_open_channel_async, .response_size = sizeof(struct res_evt_channel_open), .response_id = MESSAGE_RES_EVT_OPEN_CHANNEL, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_close_channel, + .lib_handler_fn = lib_evt_close_channel, .response_size = sizeof(struct res_evt_channel_close), .response_id = MESSAGE_RES_EVT_CLOSE_CHANNEL, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_unlink_channel, + .lib_handler_fn = lib_evt_unlink_channel, .response_size = sizeof(struct res_evt_channel_unlink), .response_id = MESSAGE_RES_EVT_UNLINK_CHANNEL, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_event_subscribe, + .lib_handler_fn = lib_evt_event_subscribe, .response_size = sizeof(struct res_evt_event_subscribe), .response_id = MESSAGE_RES_EVT_SUBSCRIBE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { - .libais_handler_fn = lib_evt_event_unsubscribe, + .lib_handler_fn = lib_evt_event_unsubscribe, .response_size = sizeof(struct res_evt_event_unsubscribe), .response_id = MESSAGE_RES_EVT_UNSUBSCRIBE, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, { - .libais_handler_fn = lib_evt_event_publish, + .lib_handler_fn = lib_evt_event_publish, .response_size = sizeof(struct res_evt_event_publish), .response_id = MESSAGE_RES_EVT_PUBLISH, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_event_clear_retentiontime, + .lib_handler_fn = lib_evt_event_clear_retentiontime, .response_size = sizeof(struct res_evt_event_clear_retentiontime), .response_id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { - .libais_handler_fn = lib_evt_event_data_get, + .lib_handler_fn = lib_evt_event_data_get, .response_size = sizeof(struct lib_event_data), .response_id = MESSAGE_RES_EVT_EVENT_DATA, - .flow_control = FLOW_CONTROL_NOT_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_NOT_REQUIRED }, }; -static int evt_remote_evt(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required); -static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required); -static int evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required); +static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr); +static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr); +static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr); -static int (*evt_exec_handler_fns[]) (void *m, struct totem_ip_address *s, - int endian_conversion_required) = { - evt_remote_evt, - evt_remote_chan_op, - evt_remote_recovery_evt +static struct openais_exec_handler evt_exec_handlers[] = { + { + .exec_handler_fn = evt_remote_evt, + .exec_endian_convert_fn = convert_event + }, + { + .exec_handler_fn = evt_remote_chan_op, + .exec_endian_convert_fn = convert_chan_packet + }, + { + .exec_handler_fn = evt_remote_recovery_evt, + .exec_endian_convert_fn = convert_event + } }; -struct service_handler evt_service_handler = { +struct openais_service_handler evt_service_handler = { .name = (unsigned char*)"openais event service B.01.01", .id = EVT_SERVICE, - .libais_handlers = evt_libais_handlers, - .libais_handlers_count = sizeof(evt_libais_handlers) / - sizeof(struct libais_handler), - .aisexec_handler_fns = evt_exec_handler_fns, - .aisexec_handler_fns_count = sizeof(evt_exec_handler_fns) / - sizeof(int (*)), - .confchg_fn = evt_conf_change, - .libais_init_two_fn = evt_initialize, - .libais_exit_fn = evt_finalize, + .lib_init_fn = evt_lib_init, + .lib_exit_fn = evt_lib_exit, + .lib_handlers = evt_lib_handlers, + .lib_handlers_count = sizeof(evt_lib_handlers) / sizeof(struct openais_lib_handler), .exec_init_fn = evt_exec_init, - .exec_dump_fn = 0, + .exec_handlers = evt_exec_handlers, + .exec_handlers_count = sizeof(evt_exec_handlers) / sizeof(struct openais_exec_handler), + .exec_dump_fn = NULL, + .confchg_fn = evt_conf_change, .sync_init = evt_sync_init, .sync_process = evt_sync_process, .sync_activate = evt_sync_activate, @@ -201,11 +206,10 @@ struct service_handler evt_service_handler = { }; #ifdef BUILD_DYNAMIC -struct service_handler *evt_get_handler_ver0 (void); +struct openais_service_handler *evt_get_handler_ver0 (void); -struct aisexec_iface_ver0 evt_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = evt_get_handler_ver0 +struct openais_service_handler_iface_ver0 evt_service_handler_iface = { + .openais_get_service_handler_ver0 = evt_get_handler_ver0 }; struct lcr_iface openais_evt_ver0[1] = { @@ -233,7 +237,7 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *evt_get_handler_ver0 (void) +struct openais_service_handler *evt_get_handler_ver0 (void) { return (&evt_service_handler); } @@ -1526,7 +1530,6 @@ remove_delivered_channel(struct event_svr_channel_open *eco) } } } - return; } /* @@ -1902,8 +1905,9 @@ deliver_event(struct event_data *evt, * word order. */ static void -convert_event(struct lib_event_data *evt) +convert_event(void *msg) { + struct lib_event_data *evt = (struct lib_event_data *)msg; SaEvtEventPatternT *eps; int i; @@ -2064,7 +2068,7 @@ static struct event_svr_channel_subscr *find_subscr( /* * Handler for saEvtInitialize */ -static int evt_initialize(struct conn_info *conn_info) +static int evt_lib_init(struct conn_info *conn_info) { struct libevt_ci *libevt_ci; struct conn_info *resp_conn_info; @@ -2107,7 +2111,7 @@ static int evt_initialize(struct conn_info *conn_info) /* * Handler for saEvtChannelOpen */ -static int lib_evt_open_channel(struct conn_info *conn_info, void *message) +static void lib_evt_open_channel(struct conn_info *conn_info, void *message) { SaAisErrorT error; struct req_evt_channel_open *req; @@ -2169,7 +2173,7 @@ static int lib_evt_open_channel(struct conn_info *conn_info, void *message) "Error setting timeout for open channel %s\n", req->ico_channel_name.value); } - return 0; + return; open_return: @@ -2177,14 +2181,12 @@ open_return: res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL; res.ico_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } /* * Handler for saEvtChannelOpen */ -static int lib_evt_open_channel_async(struct conn_info *conn_info, +static void lib_evt_open_channel_async(struct conn_info *conn_info, void *message) { SaAisErrorT error; @@ -2237,8 +2239,6 @@ open_return: res.ico_head.id = MESSAGE_RES_EVT_OPEN_CHANNEL; res.ico_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } @@ -2296,7 +2296,7 @@ common_chan_close(struct event_svr_channel_open *eco, struct libevt_ci *esip) /* * Handler for saEvtChannelClose */ -static int lib_evt_close_channel(struct conn_info *conn_info, void *message) +static void lib_evt_close_channel(struct conn_info *conn_info, void *message) { struct req_evt_channel_close *req; struct res_evt_channel_close res; @@ -2330,14 +2330,12 @@ chan_close_done: res.icc_head.id = MESSAGE_RES_EVT_CLOSE_CHANNEL; res.icc_head.error = ((ret == 0) ? SA_AIS_OK : SA_AIS_ERR_BAD_HANDLE); libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } /* * Handler for saEvtChannelUnlink */ -static int lib_evt_unlink_channel(struct conn_info *conn_info, void *message) +static void lib_evt_unlink_channel(struct conn_info *conn_info, void *message) { struct req_evt_channel_unlink *req; struct res_evt_channel_unlink res; @@ -2391,7 +2389,7 @@ static int lib_evt_unlink_channel(struct conn_info *conn_info, void *message) chn_iovec.iov_base = &cpkt; chn_iovec.iov_len = cpkt.chc_head.size; if (totempg_groups_mcast_joined (openais_group_handle, &chn_iovec, 1, TOTEMPG_AGREED) == 0) { - return 0; + return; } evt_unlink_err: @@ -2403,7 +2401,6 @@ evt_unlink_err: res.iuc_head.id = MESSAGE_RES_EVT_UNLINK_CHANNEL; res.iuc_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - return 0; } /* @@ -2427,7 +2424,7 @@ static char *filter_types[] = { /* * saEvtEventSubscribe Handler */ -static int lib_evt_event_subscribe(struct conn_info *conn_info, void *message) +static void lib_evt_event_subscribe(struct conn_info *conn_info, void *message) { struct req_evt_event_subscribe *req; struct res_evt_event_subscribe res; @@ -2530,7 +2527,7 @@ static int lib_evt_event_subscribe(struct conn_info *conn_info, void *message) } } hdb_handle_put(&esip->esi_hdb, req->ics_channel_handle); - return 0; + return; subr_put: hdb_handle_put(&esip->esi_hdb, req->ics_channel_handle); @@ -2539,14 +2536,12 @@ subr_done: res.ics_head.id = MESSAGE_RES_EVT_SUBSCRIBE; res.ics_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } /* * saEvtEventUnsubscribe Handler */ -static int lib_evt_event_unsubscribe(struct conn_info *conn_info, +static void lib_evt_event_unsubscribe(struct conn_info *conn_info, void *message) { struct req_evt_event_unsubscribe *req; @@ -2607,14 +2602,12 @@ unsubr_done: res.icu_head.id = MESSAGE_RES_EVT_UNSUBSCRIBE; res.icu_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } /* * saEvtEventPublish Handler */ -static int lib_evt_event_publish(struct conn_info *conn_info, void *message) +static void lib_evt_event_publish(struct conn_info *conn_info, void *message) { struct lib_event_data *req; struct res_evt_event_publish res; @@ -2679,14 +2672,12 @@ pub_done: res.iep_head.error = error; res.iep_event_id = event_id; libais_send_response (conn_info, &res, sizeof(res)); - - return 0; } /* * saEvtEventRetentionTimeClear handler */ -static int lib_evt_event_clear_retentiontime(struct conn_info *conn_info, +static void lib_evt_event_clear_retentiontime(struct conn_info *conn_info, void *message) { struct req_evt_event_clear_retentiontime *req; @@ -2731,7 +2722,8 @@ static int lib_evt_event_clear_retentiontime(struct conn_info *conn_info, rtn_iovec.iov_len = cpkt.chc_head.size; ret = totempg_groups_mcast_joined (openais_group_handle, &rtn_iovec, 1, TOTEMPG_AGREED); if (ret == 0) { - return 0; + // TODO this should really assert + return; } error = SA_AIS_ERR_LIBRARY; @@ -2744,14 +2736,13 @@ evt_ret_clr_err: res.iec_head.id = MESSAGE_RES_EVT_CLEAR_RETENTIONTIME; res.iec_head.error = error; libais_send_response (conn_info, &res, sizeof(res)); - return 0; } /* * Send requested event data to the application */ -static int lib_evt_event_data_get(struct conn_info *conn_info, void *message) +static void lib_evt_event_data_get(struct conn_info *conn_info, void *message) { struct lib_event_data res; struct libevt_ci *esip = &conn_info->ais_ci.u.libevt_ci; @@ -2801,7 +2792,6 @@ data_get_done: if (esip->esi_nevents) { __notify_event(conn_info); } - return 0; } /* @@ -2827,7 +2817,7 @@ static void remove_chan_open_info(SaClmNodeIdT node_id) * node list. The node list is used to keep track of event IDs * received for each node for the detection of duplicate events. */ -static int evt_conf_change( +static void evt_conf_change( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -2940,14 +2930,12 @@ static int evt_conf_change( sizeof(struct totem_ip_address) * member_list_entries); } } - - return 0; } /* * saEvtFinalize Handler */ -static int evt_finalize(struct conn_info *conn_info) +static int evt_lib_exit(struct conn_info *conn_info) { struct libevt_ci *esip = &conn_info->conn_info_partner->ais_ci.u.libevt_ci; @@ -3101,8 +3089,7 @@ try_deliver_event(struct event_data *evt, /* * Receive the network event message and distribute it to local subscribers */ -static int evt_remote_evt(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required) +static void evt_remote_evt(void *msg, struct totem_ip_address *source_addr) { /* * - retain events that have a retention time @@ -3131,15 +3118,11 @@ static int evt_remote_evt(void *msg, struct totem_ip_address *source_addr, log_printf(LOG_LEVEL_DEBUG, "No cluster node data for %s\n", totemip_print(source_addr)); errno = ENXIO; - return -1; + return; } log_printf(LOG_LEVEL_DEBUG, "Cluster node ID 0x%x name %s\n", cn->nodeId, cn->nodeName.value); - if (endian_conversion_required) { - convert_event(evtpkt); - } - evtpkt->led_publisher_node_id = cn->nodeId; totemip_copy(&evtpkt->led_addr, source_addr); evtpkt->led_receive_time = clust_time_now(); @@ -3171,19 +3154,18 @@ static int evt_remote_evt(void *msg, struct totem_ip_address *source_addr, if (!eci) { log_printf(LOG_LEVEL_DEBUG, "Channel %s doesn't exist\n", evtpkt->led_chan_name.value); - return 0; + return; } if (check_last_event(evtpkt, source_addr)) { - return 0; + return; } evt = make_local_event(evtpkt, eci); if (!evt) { log_printf(LOG_LEVEL_WARNING, "1Memory allocation error, can't deliver event\n"); - errno = ENOMEM; - return -1; + return; } if (evt->ed_event.led_retention_time) { @@ -3192,9 +3174,6 @@ static int evt_remote_evt(void *msg, struct totem_ip_address *source_addr, try_deliver_event(evt, eci); free_event_data(evt); - - - return 0; } /* @@ -3213,8 +3192,7 @@ inline SaTimeT calc_retention_time(SaTimeT retention, /* * Receive a recovery network event message and save it in the retained list */ -static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required) +static void evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_addr) { /* * - calculate remaining retention time @@ -3239,11 +3217,7 @@ static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_ad if (recovery_phase == evt_recovery_complete) { log_printf(RECOVERY_EVENT_DEBUG, "Received recovery data, not in recovery mode\n"); - return 0; - } - - if (endian_conversion_required) { - convert_event(evtpkt); + return; } log_printf(RECOVERY_EVENT_DEBUG, @@ -3284,8 +3258,7 @@ static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_ad */ log_printf(LOG_LEVEL_NOTICE, "No node for %s\n", totemip_print(&evtpkt->led_addr)); - errno = ENXIO; - return -1; + return; } log_printf(LOG_LEVEL_DEBUG, "Cluster node ID 0x%x name %s\n", md->mn_node_info.nodeId, @@ -3303,7 +3276,7 @@ static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_ad if (!eci) { log_printf(RECOVERY_EVENT_DEBUG, "Channel %s doesn't exist\n", evtpkt->led_chan_name.value); - return 0; + return; } evt = make_local_event(evtpkt, eci); @@ -3311,7 +3284,7 @@ static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_ad log_printf(LOG_LEVEL_WARNING, "2Memory allocation error, can't deliver event\n"); errno = ENOMEM; - return -1; + return; } retain_event(evt); @@ -3320,8 +3293,6 @@ static int evt_remote_recovery_evt(void *msg, struct totem_ip_address *source_ad num_delivered); free_event_data(evt); } - - return 0; } @@ -3497,8 +3468,10 @@ static void evt_ret_time_clr_finish(struct retention_time_clear_pending *rtc, * our architectures word order. */ static void -convert_chan_packet(struct req_evt_chan_command *cpkt) +convert_chan_packet(void *msg) { + struct req_evt_chan_command *cpkt = (struct req_evt_chan_command *)msg; + /* * converted in the main deliver_fn: * led_head.id, led_head.size. @@ -3563,8 +3536,7 @@ convert_chan_packet(struct req_evt_chan_command *cpkt) * Used to communicate channel opens/closes, clear retention time, * config change updates... */ -static int evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr, - int endian_conversion_required) +static void evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr) { struct req_evt_chan_command *cpkt = msg; unsigned int local_node = {SA_CLM_LOCAL_NODE_ID}; @@ -3572,10 +3544,6 @@ static int evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr, struct member_node_data *mn; struct event_svr_channel_instance *eci; - if (endian_conversion_required) { - convert_chan_packet(cpkt); - } - log_printf(REMOTE_OP_DEBUG, "Remote channel operation request\n"); my_node = main_clm_get_by_nodeid(local_node); log_printf(REMOTE_OP_DEBUG, "my node ID: 0x%x\n", my_node->nodeId); @@ -3587,7 +3555,7 @@ static int evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr, log_printf(LOG_LEVEL_WARNING, "Evt remote channel op: Node data for addr %s is NULL\n", totemip_print(source_addr)); - return 0; + return; } else { evt_add_node(source_addr, cn); mn = evt_find_node(source_addr); @@ -3905,8 +3873,6 @@ static int evt_remote_chan_op(void *msg, struct totem_ip_address *source_addr, cpkt->chc_op); break; } - - return 0; } /* diff --git a/exec/evt.h b/exec/evt.h index 797bf58e..f4ac861f 100644 --- a/exec/evt.h +++ b/exec/evt.h @@ -36,8 +36,9 @@ #include "../include/hdb.h" #include "../include/list.h" #include "../include/saEvt.h" +#include "handlers.h" -extern struct service_handler evt_service_handler; +extern struct openais_service_handler evt_service_handler; /* * event instance structure. Contains information about the diff --git a/exec/handlers.h b/exec/handlers.h index aa33a341..a62826e8 100644 --- a/exec/handlers.h +++ b/exec/handlers.h @@ -31,56 +31,61 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef HANDLERS_H_DEFINED -#define HANDLERS_H_DEFINED +#ifndef OPENAIS_HANDLERS_H_DEFINED +#define OPENAIS_HANDLERS_H_DEFINED #include -#include "main.h" -#include "totempg.h" -#include "totemsrp.h" +#include "mainconfig.h" /* openais_config */ +#include "main.h" /* conn_info */ +#include "totemip.h" #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) ) -enum flow_control { - FLOW_CONTROL_REQUIRED = 1, - FLOW_CONTROL_NOT_REQUIRED = 2 +// TODO we need to abstract the conn_info data structure to make dynamic loading work perfectly + +enum openais_flow_control { + OPENAIS_FLOW_CONTROL_REQUIRED = 1, + OPENAIS_FLOW_CONTROL_NOT_REQUIRED = 2 }; -struct libais_handler { - int (*libais_handler_fn) (struct conn_info *conn_info, void *msg); +struct openais_lib_handler { + void (*lib_handler_fn) (struct conn_info *conn_info, void *msg); int response_size; int response_id; - enum flow_control flow_control; + enum openais_flow_control flow_control; }; -struct service_handler { +struct openais_exec_handler { + void (*exec_handler_fn) (void *msg, struct totem_ip_address *source_addr); + void (*exec_endian_convert_fn) (void *msg); +}; + +struct openais_service_handler { unsigned char *name; unsigned short id; - struct libais_handler *libais_handlers; - int libais_handlers_count; - int (**aisexec_handler_fns) (void *msg, struct totem_ip_address *source_addr, int endian_conversion_needed); - int aisexec_handler_fns_count; - int (*confchg_fn) ( + int (*lib_init_fn) (struct conn_info *conn_info); + int (*lib_exit_fn) (struct conn_info *conn_info); + struct openais_lib_handler *lib_handlers; + int lib_handlers_count; + struct openais_exec_handler *exec_handlers; + int (*exec_init_fn) (struct openais_config *); + void (*exec_dump_fn) (void); + int exec_handlers_count; + void (*confchg_fn) ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); - int (*libais_init_fn) (struct conn_info *conn_info, void *msg); - int (*libais_init_two_fn) (struct conn_info *conn_info); - int (*libais_exit_fn) (struct conn_info *conn_info); - int (*exec_init_fn) (struct openais_config *); - void (*exec_dump_fn) (void); - void (*sync_init) (void); int (*sync_process) (void); void (*sync_activate) (void); void (*sync_abort) (void); }; -struct aisexec_iface_ver0 { +struct openais_service_handler_iface_ver0 { void (*test) (void); - struct service_handler *(*get_handler_ver0) (void); + struct openais_service_handler *(*openais_get_service_handler_ver0) (void); }; #endif /* HANDLERS_H_DEFINED */ diff --git a/exec/lck.c b/exec/lck.c index 940b7798..0145f21c 100644 --- a/exec/lck.c +++ b/exec/lck.c @@ -110,77 +110,72 @@ DECLARE_LIST_INIT(resource_list_head); static int lck_exec_init_fn (struct openais_config *); -static int lck_exit_fn (struct conn_info *conn_info); +static int lck_lib_exit_fn (struct conn_info *conn_info); -static int lck_init_two_fn (struct conn_info *conn_info); +static int lck_lib_init_fn (struct conn_info *conn_info); -static int message_handler_req_exec_lck_resourceopen ( +static void message_handler_req_exec_lck_resourceopen ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_lck_resourceclose ( +static void message_handler_req_exec_lck_resourceclose ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_lck_resourcelock ( +static void message_handler_req_exec_lck_resourcelock ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_lck_resourceunlock ( +static void message_handler_req_exec_lck_resourceunlock ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_lck_resourcelockorphan ( +static void message_handler_req_exec_lck_resourcelockorphan ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_lck_lockpurge ( +static void message_handler_req_exec_lck_lockpurge ( void *message, - struct in_addr source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_lib_lck_resourceopen ( +static void message_handler_req_lib_lck_resourceopen ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourceopenasync ( +static void message_handler_req_lib_lck_resourceopenasync ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourceclose ( +static void message_handler_req_lib_lck_resourceclose ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourcelock ( +static void message_handler_req_lib_lck_resourcelock ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourcelockasync ( +static void message_handler_req_lib_lck_resourcelockasync ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourceunlock ( +static void message_handler_req_lib_lck_resourceunlock ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_resourceunlockasync ( +static void message_handler_req_lib_lck_resourceunlockasync ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_lck_lockpurge ( +static void message_handler_req_lib_lck_lockpurge ( struct conn_info *conn_info, void *message); -static void lck_recovery_activate (void); -static void lck_recovery_initialize (void); -static int lck_recovery_process (void); -static void lck_recovery_finalize(); -static void lck_recovery_abort(void); +#ifdef TODO +static void lck_sync_init (void); +#endif +static int lck_sync_process (void); +static void lck_sync_activate (void); +static void lck_sync_abort (void); void resource_release (struct resource *resource); @@ -190,125 +185,140 @@ static struct list_head *recovery_lck_section_next = 0; static int recovery_section_data_offset = 0; static int recovery_section_send_flag = 0; static int recovery_abort = 0; +//static struct memb_ring_id saved_ring_id; */ -static struct memb_ring_id saved_ring_id; -static int lck_confchg_fn ( +static void lck_confchg_fn ( enum totem_configuration_type configuration_type, - struct in_addr *member_list, int member_list_entries, - struct in_addr *left_list, int left_list_entries, - struct in_addr *joined_list, int joined_list_entries, + struct totem_ip_address *member_list, int member_list_entries, + struct totem_ip_address *left_list, int left_list_entries, + struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id); /* * Executive Handler Definition */ -struct libais_handler lck_libais_handlers[] = +static struct openais_lib_handler lck_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_lck_resourceopen, + .lib_handler_fn = message_handler_req_lib_lck_resourceopen, .response_size = sizeof (struct res_lib_lck_resourceopen), .response_id = MESSAGE_RES_LCK_RESOURCEOPEN, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_lck_resourceopenasync, + .lib_handler_fn = message_handler_req_lib_lck_resourceopenasync, .response_size = sizeof (struct res_lib_lck_resourceopenasync), .response_id = MESSAGE_RES_LCK_RESOURCEOPENASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_lck_resourceclose, + .lib_handler_fn = message_handler_req_lib_lck_resourceclose, .response_size = sizeof (struct res_lib_lck_resourceclose), .response_id = MESSAGE_RES_LCK_RESOURCECLOSE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_lck_resourcelock, + .lib_handler_fn = message_handler_req_lib_lck_resourcelock, .response_size = sizeof (struct res_lib_lck_resourcelock), .response_id = MESSAGE_RES_LCK_RESOURCELOCK, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 4 */ - .libais_handler_fn = message_handler_req_lib_lck_resourcelockasync, + .lib_handler_fn = message_handler_req_lib_lck_resourcelockasync, .response_size = sizeof (struct res_lib_lck_resourcelockasync), .response_id = MESSAGE_RES_LCK_RESOURCELOCKASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 5 */ - .libais_handler_fn = message_handler_req_lib_lck_resourceunlock, + .lib_handler_fn = message_handler_req_lib_lck_resourceunlock, .response_size = sizeof (struct res_lib_lck_resourceunlock), .response_id = MESSAGE_RES_LCK_RESOURCELOCK, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 6 */ - .libais_handler_fn = message_handler_req_lib_lck_resourceunlockasync, + .lib_handler_fn = message_handler_req_lib_lck_resourceunlockasync, .response_size = sizeof (struct res_lib_lck_resourceunlock), .response_id = MESSAGE_RES_LCK_RESOURCEUNLOCKASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 7 */ - .libais_handler_fn = message_handler_req_lib_lck_lockpurge, + .lib_handler_fn = message_handler_req_lib_lck_lockpurge, .response_size = sizeof (struct res_lib_lck_lockpurge), .response_id = MESSAGE_RES_LCK_LOCKPURGE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED } }; -static int (*lck_aisexec_handler_fns[]) (void *msg, struct in_addr source_addr, int endian_conversion_required) = { - message_handler_req_exec_lck_resourceopen, - message_handler_req_exec_lck_resourceclose, - message_handler_req_exec_lck_resourcelock, - message_handler_req_exec_lck_resourceunlock, - message_handler_req_exec_lck_resourcelockorphan, - message_handler_req_exec_lck_lockpurge, +static struct openais_exec_handler lck_exec_handlers[] = { + { + .exec_handler_fn = message_handler_req_exec_lck_resourceopen, + }, + { + .exec_handler_fn = message_handler_req_exec_lck_resourceclose, + }, + { + .exec_handler_fn = message_handler_req_exec_lck_resourcelock, + }, + { + .exec_handler_fn = message_handler_req_exec_lck_resourceunlock, + }, + { + .exec_handler_fn = message_handler_req_exec_lck_resourcelockorphan, + }, + { + .exec_handler_fn = message_handler_req_exec_lck_lockpurge, + } }; -struct service_handler lck_service_handler = { - .name = "openais distributed locking service B.01.01", +struct openais_service_handler lck_service_handler = { + .name = (unsigned char*)"openais distributed locking service B.01.01", .id = LCK_SERVICE, - .libais_handlers = lck_libais_handlers, - .libais_handlers_count = sizeof (lck_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = lck_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (lck_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = lck_confchg_fn, - .libais_init_two_fn = lck_init_two_fn, - .libais_exit_fn = lck_exit_fn, + .lib_init_fn = lck_lib_init_fn, + .lib_exit_fn = lck_lib_exit_fn, + .lib_handlers = lck_lib_handlers, + .lib_handlers_count = sizeof (lck_lib_handlers) / sizeof (struct openais_lib_handler), .exec_init_fn = lck_exec_init_fn, + .exec_handlers = lck_exec_handlers, + .exec_handlers_count = sizeof (lck_exec_handlers) / sizeof (struct openais_exec_handler), .exec_dump_fn = NULL, - .sync_init = NULL, // TODO lck_recovery_initialize, - .sync_process = lck_recovery_process, - .sync_activate = lck_recovery_activate, - .sync_abort = lck_recovery_abort, + .confchg_fn = lck_confchg_fn, + .sync_init = NULL, +// .sync_init = lck_sync_init, + .sync_process = lck_sync_process, + .sync_activate = lck_sync_activate, + .sync_abort = lck_sync_abort, }; +/* + * Dynamic loader definition + */ #ifdef BUILD_DYNAMIC -struct service_handler *lck_get_handler_ver0 (void); +struct openais_service_handler *lck_get_handler_ver0 (void); -struct aisexec_iface_ver0 lck_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = lck_get_handler_ver0 +struct openais_service_handler_iface_ver0 lck_service_handler_iface = { + .openais_get_service_handler_ver0 = lck_get_handler_ver0 }; struct lcr_iface openais_lck_ver0[1] = { { - .name = "openais_lck", - .version = 0, + .name = "openais_lck", + .version = 0, .versions_replace = 0, - .versions_replace_count = 0, + .versions_replace_count = 0, .dependencies = 0, .dependency_count = 0, .constructor = NULL, - .destructor = NULL, - .interfaces = (void **)&lck_service_handler_iface, + .destructor = NULL, + .interfaces = (void **)&lck_service_handler_iface, } }; struct lcr_comp lck_comp_ver0 = { - .iface_count = 1, + .iface_count = 1, .ifaces = openais_lck_ver0 }; @@ -318,7 +328,7 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *lck_get_handler_ver0 (void) +struct openais_service_handler *lck_get_handler_ver0 (void) { return (&lck_service_handler); } @@ -379,40 +389,35 @@ struct req_exec_lck_lockpurge { struct req_lib_lck_lockpurge req_lib_lck_lockpurge; }; -static void lck_recovery_initialize (void) +#ifdef TODO +static void lck_sync_init (void) { return; } +#endif -static int lck_recovery_process (void) +static int lck_sync_process (void) { return (0); } -static void lck_recovery_finalize () -{ - return; - -} - -static void lck_recovery_activate (void) +static void lck_sync_activate (void) { return; } -static void lck_recovery_abort (void) +static void lck_sync_abort (void) { return; } -static int lck_confchg_fn ( +static void lck_confchg_fn ( enum totem_configuration_type configuration_type, - struct in_addr *member_list, int member_list_entries, - struct in_addr *left_list, int left_list_entries, - struct in_addr *joined_list, int joined_list_entries, + struct totem_ip_address *member_list, int member_list_entries, + struct totem_ip_address *left_list, int left_list_entries, + struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id) { - return (0); } static struct resource *resource_find (SaNameT *name) @@ -573,15 +578,10 @@ static int lck_exec_init_fn (struct openais_config *openais_config) /* * Initialize the saved ring ID. */ -#ifdef TODO - saved_ring_id.seq = 0; - saved_ring_id.rep.s_addr = this_ip->sin_addr.s_addr; -#endif - return (0); } -static int lck_exit_fn (struct conn_info *conn_info) +static int lck_lib_exit_fn (struct conn_info *conn_info) { struct resource_cleanup *resource_cleanup; struct list_head *list; @@ -614,26 +614,24 @@ static int lck_exit_fn (struct conn_info *conn_info) return (0); } -static int lck_init_two_fn (struct conn_info *conn_info) +static int lck_lib_init_fn (struct conn_info *conn_info) { list_init (&conn_info->conn_info_partner->ais_ci.u.liblck_ci.resource_list); list_init (&conn_info->conn_info_partner->ais_ci.u.liblck_ci.resource_cleanup_list); return (0); - } -static int message_handler_req_exec_lck_resourceopen ( +static void message_handler_req_exec_lck_resourceopen ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_resourceopen *req_exec_lck_resourceopen = (struct req_exec_lck_resourceopen *)message; struct res_lib_lck_resourceopen res_lib_lck_resourceopen; struct res_lib_lck_resourceopenasync res_lib_lck_resourceopenasync; struct resource *resource; struct resource_cleanup *resource_cleanup; - SaErrorT error = SA_AIS_OK; + SaAisErrorT error = SA_AIS_OK; log_printf (LOG_LEVEL_NOTICE, "EXEC request: saLckResourceOpen %s\n", getSaNameT (&req_exec_lck_resourceopen->resource_name)); @@ -739,14 +737,11 @@ error_exit: sizeof (struct res_lib_lck_resourceopen)); } } - - return (0); } -static int message_handler_req_exec_lck_resourceclose ( +static void message_handler_req_exec_lck_resourceclose ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_resourceclose *req_exec_lck_resourceclose = (struct req_exec_lck_resourceclose *)message; struct res_lib_lck_resourceclose res_lib_lck_resourceclose; @@ -776,7 +771,6 @@ error_exit: libais_send_response (req_exec_lck_resourceclose->source.conn_info, &res_lib_lck_resourceclose, sizeof (struct res_lib_lck_resourceclose)); } - return (0); } void waiter_notification_send (struct resource_lock *resource_lock) @@ -1033,10 +1027,9 @@ void unlock_algorithm ( } } -static int message_handler_req_exec_lck_resourcelock ( +static void message_handler_req_exec_lck_resourcelock ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_resourcelock *req_exec_lck_resourcelock = (struct req_exec_lck_resourcelock *)message; struct resource *resource = 0; @@ -1142,13 +1135,12 @@ static int message_handler_req_exec_lck_resourcelock ( } error_exit: - return (0); + return; } -static int message_handler_req_exec_lck_resourceunlock ( +static void message_handler_req_exec_lck_resourceunlock ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_resourceunlock *req_exec_lck_resourceunlock = (struct req_exec_lck_resourceunlock *)message; struct res_lib_lck_resourceunlock res_lib_lck_resourceunlock; @@ -1199,13 +1191,11 @@ error_exit: &res_lib_lck_resourceunlock, sizeof (struct res_lib_lck_resourceunlock)); } } - return (0); } -static int message_handler_req_exec_lck_resourcelockorphan ( +static void message_handler_req_exec_lck_resourcelockorphan ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_resourcelockorphan *req_exec_lck_resourcelockorphan = (struct req_exec_lck_resourcelockorphan *)message; struct resource *resource = 0; @@ -1227,13 +1217,11 @@ static int message_handler_req_exec_lck_resourcelockorphan ( list_del (&resource_lock->resource_cleanup_list); unlock_algorithm (resource, resource_lock); - return (0); } -static int message_handler_req_exec_lck_lockpurge ( +static void message_handler_req_exec_lck_lockpurge ( void *message, - struct in_addr source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_lck_lockpurge *req_exec_lck_lockpurge = (struct req_exec_lck_lockpurge *)message; struct res_lib_lck_lockpurge res_lib_lck_lockpurge; @@ -1259,10 +1247,9 @@ error_exit: libais_send_response (req_exec_lck_lockpurge->source.conn_info, &res_lib_lck_lockpurge, sizeof (struct res_lib_lck_lockpurge)); } - return (0); } -static int message_handler_req_lib_lck_resourceopen (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourceopen (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourceopen *req_lib_lck_resourceopen = (struct req_lib_lck_resourceopen *)message; struct req_exec_lck_resourceopen req_exec_lck_resourceopen; @@ -1292,11 +1279,9 @@ static int message_handler_req_lib_lck_resourceopen (struct conn_info *conn_info iovec.iov_len = sizeof (req_exec_lck_resourceopen); assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_resourceopenasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourceopenasync (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourceopen *req_lib_lck_resourceopen = (struct req_lib_lck_resourceopen *)message; struct req_exec_lck_resourceopen req_exec_lck_resourceopen; @@ -1326,11 +1311,9 @@ static int message_handler_req_lib_lck_resourceopenasync (struct conn_info *conn iovec.iov_len = sizeof (req_exec_lck_resourceopen); assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_resourceclose (struct conn_info *conn_info, void *message) { +static void message_handler_req_lib_lck_resourceclose (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourceclose *req_lib_lck_resourceclose = (struct req_lib_lck_resourceclose *)message; struct req_exec_lck_resourceclose req_exec_lck_resourceclose; struct iovec iovecs[2]; @@ -1371,10 +1354,9 @@ static int message_handler_req_lib_lck_resourceclose (struct conn_info *conn_inf &res_lib_lck_resourceclose, sizeof (struct res_lib_lck_resourceclose)); } - return (0); } -static int message_handler_req_lib_lck_resourcelock (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourcelock (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourcelock *req_lib_lck_resourcelock = (struct req_lib_lck_resourcelock *)message; struct req_exec_lck_resourcelock req_exec_lck_resourcelock; @@ -1403,11 +1385,9 @@ static int message_handler_req_lib_lck_resourcelock (struct conn_info *conn_info iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_resourcelockasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourcelockasync (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourcelock *req_lib_lck_resourcelock = (struct req_lib_lck_resourcelock *)message; struct req_exec_lck_resourcelock req_exec_lck_resourcelock; @@ -1435,11 +1415,9 @@ static int message_handler_req_lib_lck_resourcelockasync (struct conn_info *conn iovecs[0].iov_len = sizeof (req_exec_lck_resourcelock); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_resourceunlock (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourceunlock (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourceunlock *req_lib_lck_resourceunlock = (struct req_lib_lck_resourceunlock *)message; struct req_exec_lck_resourceunlock req_exec_lck_resourceunlock; @@ -1467,11 +1445,9 @@ static int message_handler_req_lib_lck_resourceunlock (struct conn_info *conn_in iovec.iov_len = sizeof (req_exec_lck_resourceunlock); assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_resourceunlockasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_resourceunlockasync (struct conn_info *conn_info, void *message) { struct req_lib_lck_resourceunlock *req_lib_lck_resourceunlock = (struct req_lib_lck_resourceunlock *)message; struct req_exec_lck_resourceunlock req_exec_lck_resourceunlock; @@ -1499,11 +1475,9 @@ static int message_handler_req_lib_lck_resourceunlockasync (struct conn_info *co iovec.iov_len = sizeof (req_exec_lck_resourceunlock); assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_lck_lockpurge (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_lck_lockpurge (struct conn_info *conn_info, void *message) { struct req_lib_lck_lockpurge *req_lib_lck_lockpurge = (struct req_lib_lck_lockpurge *)message; struct req_exec_lck_lockpurge req_exec_lck_lockpurge; @@ -1527,7 +1501,5 @@ static int message_handler_req_lib_lck_lockpurge (struct conn_info *conn_info, v iovecs[0].iov_len = sizeof (req_exec_lck_lockpurge); assert (totempg_groups_mcast_joined (openais_group_handle, iovecs, 1, TOTEMPG_AGREED) == 0); - - return (0); } diff --git a/exec/lck.h b/exec/lck.h index 106ddb1d..7709acdc 100644 --- a/exec/lck.h +++ b/exec/lck.h @@ -44,6 +44,6 @@ struct liblck_ci { struct list_head resource_cleanup_list; }; -extern struct service_handler lck_service_handler; +extern struct openais_service_handler lck_service_handler; #endif /* CKPT_H_DEFINED */ diff --git a/exec/main.c b/exec/main.c index 91099b06..1942db7b 100644 --- a/exec/main.c +++ b/exec/main.c @@ -79,6 +79,7 @@ #include "lck.h" #include "msg.h" #include "cfg.h" +#include "ykd.h" #include "swab.h" #define LOG_SERVICE LOG_SERVICE_MAIN @@ -97,7 +98,7 @@ struct dynamic_service { char *name; unsigned int ver; unsigned int handle; - struct aisexec_iface_ver0 *iface_ver0; + struct openais_service_handler_iface_ver0 *iface_ver0; }; /* @@ -155,13 +156,7 @@ struct dynamic_service dynamic_services[128] = { }; #endif /* BUILD_DYNAMIC */ -static struct service_handler *ais_service_handlers[32]; - -/* -unsigned int aisexec_ifact_handle_ver0[32]; - -static struct aisexec_iface_ver0 *aisexec_iface_ver0[32]; -*/ +static struct openais_service_handler *ais_service_handlers[32]; static unsigned int service_handlers_count = 32; @@ -280,16 +275,16 @@ static int libais_disconnect (struct conn_info *conn_info) struct outq_item *outq_item; if (conn_info->should_exit_fn && - ais_service_handlers[conn_info->service]->libais_exit_fn) { + ais_service_handlers[conn_info->service]->lib_exit_fn) { - res = ais_service_handlers[conn_info->service]->libais_exit_fn (conn_info); + res = ais_service_handlers[conn_info->service]->lib_exit_fn (conn_info); } if (conn_info->conn_info_partner && conn_info->conn_info_partner->should_exit_fn && - ais_service_handlers[conn_info->conn_info_partner->service]->libais_exit_fn) { + ais_service_handlers[conn_info->conn_info_partner->service]->lib_exit_fn) { - res = ais_service_handlers[conn_info->conn_info_partner->service]->libais_exit_fn (conn_info->conn_info_partner); + res = ais_service_handlers[conn_info->conn_info_partner->service]->lib_exit_fn (conn_info->conn_info_partner); } /* @@ -621,7 +616,7 @@ static int dispatch_init_send_response (struct conn_info *conn_info, void *messa } conn_info->should_exit_fn = 1; - ais_service_handlers[req_lib_dispatch_init->resdis_header.service]->libais_init_two_fn (conn_info); + ais_service_handlers[req_lib_dispatch_init->resdis_header.service]->lib_init_fn (conn_info); return (0); } @@ -770,9 +765,9 @@ retry_recv: /* * Not an init service, but a standard service */ - if (header->id < 0 || header->id > ais_service_handlers[service]->libais_handlers_count) { + if (header->id < 0 || header->id > ais_service_handlers[service]->lib_handlers_count) { log_printf (LOG_LEVEL_SECURITY, "Invalid header id is %d min 0 max %d\n", - header->id, ais_service_handlers[service]->libais_handlers_count); + header->id, ais_service_handlers[service]->lib_handlers_count); res = -1; goto error_disconnect; } @@ -790,14 +785,14 @@ retry_recv: send_ok = (ykd_primary() == 1) && ( - (ais_service_handlers[service]->libais_handlers[header->id].flow_control == FLOW_CONTROL_NOT_REQUIRED) || - ((ais_service_handlers[service]->libais_handlers[header->id].flow_control == FLOW_CONTROL_REQUIRED) && + (ais_service_handlers[service]->lib_handlers[header->id].flow_control == OPENAIS_FLOW_CONTROL_NOT_REQUIRED) || + ((ais_service_handlers[service]->lib_handlers[header->id].flow_control == OPENAIS_FLOW_CONTROL_REQUIRED) && (send_ok_joined) && (sync_in_process() == 0))); if (send_ok) { // *prio = 0; - res = ais_service_handlers[service]->libais_handlers[header->id].libais_handler_fn(conn_info, header); + ais_service_handlers[service]->lib_handlers[header->id].lib_handler_fn(conn_info, header); } else { // *prio = (*prio) + 1; @@ -805,9 +800,9 @@ retry_recv: * Overload, tell library to retry */ res_overlay.header.size = - ais_service_handlers[service]->libais_handlers[header->id].response_size; + ais_service_handlers[service]->lib_handlers[header->id].response_size; res_overlay.header.id = - ais_service_handlers[service]->libais_handlers[header->id].response_id; + ais_service_handlers[service]->lib_handlers[header->id].response_id; res_overlay.header.error = SA_AIS_ERR_TRY_AGAIN; libais_send_response (conn_info, &res_overlay, res_overlay.header.size); @@ -830,7 +825,7 @@ retry_recv: conn_info->inb_start = conn_info->inb_inuse; } - return (res); + return (0); error_disconnect: res = libais_disconnect (conn_info); @@ -893,7 +888,6 @@ static void deliver_fn ( int endian_conversion_required) { struct req_header *header; - int res; int pos = 0; int i; int service; @@ -926,8 +920,13 @@ static void deliver_fn ( */ service = header->id >> 16; fn_id = header->id & 0xffff; - res = ais_service_handlers[service]->aisexec_handler_fns[fn_id] - (header, source_addr, endian_conversion_required); + if (endian_conversion_required) { + ais_service_handlers[service]->exec_handlers[fn_id].exec_endian_convert_fn + (header); + } + + ais_service_handlers[service]->exec_handlers[fn_id].exec_handler_fn + (header, source_addr); } static struct memb_ring_id aisexec_ring_id; @@ -1100,15 +1099,18 @@ void message_source_set (struct message_source *source, struct conn_info *conn_i struct totem_logging_configuration totem_logging_configuration; int service_handler_register ( - struct service_handler *handler, + struct openais_service_handler *handler, struct openais_config *config) { + int res = 0; assert (ais_service_handlers[handler->id] == NULL); log_printf (LOG_LEVEL_NOTICE, "Registering service handler '%s'\n", handler->name); ais_service_handlers[handler->id] = handler; if (ais_service_handlers[handler->id]->exec_init_fn) { - ais_service_handlers[handler->id]->exec_init_fn (config); + res = ais_service_handlers[handler->id]->exec_init_fn (config); } + + return (res); } void default_services_register (struct openais_config *openais_config) @@ -1124,7 +1126,9 @@ void default_services_register (struct openais_config *openais_config) (void **)&dynamic_services[i].iface_ver0, (void *)0); - service_handler_register (dynamic_services[i].iface_ver0->get_handler_ver0(), openais_config); + service_handler_register ( + dynamic_services[i].iface_ver0->openais_get_service_handler_ver0(), + openais_config); } #else /* NOT BUILD_DYNAMIC */ diff --git a/exec/msg.c b/exec/msg.c index 52b41021..34667f9c 100644 --- a/exec/msg.c +++ b/exec/msg.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 MontaVista Software, Inc. + * Copyright (c) 2005-2006 MontaVista Software, Inc. * * All rights reserved. * @@ -19,7 +19,8 @@ * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR @@ -109,176 +110,152 @@ DECLARE_LIST_INIT(queue_group_list_head); static int msg_exec_init_fn (struct openais_config *); -static int msg_exit_fn (struct conn_info *conn_info); +static int msg_lib_exit_fn (struct conn_info *conn_info); -static int msg_init_two_fn (struct conn_info *conn_info); +static int msg_lib_init_fn (struct conn_info *conn_info); -static int message_handler_req_exec_msg_queueopen ( +static void message_handler_req_exec_msg_queueopen ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queueclose ( +static void message_handler_req_exec_msg_queueclose ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuestatusget ( +static void message_handler_req_exec_msg_queuestatusget ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queueunlink ( +static void message_handler_req_exec_msg_queueunlink ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegroupcreate ( +static void message_handler_req_exec_msg_queuegroupcreate ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegroupinsert ( +static void message_handler_req_exec_msg_queuegroupinsert ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegroupremove ( +static void message_handler_req_exec_msg_queuegroupremove ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegroupdelete ( +static void message_handler_req_exec_msg_queuegroupdelete ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegrouptrack ( +static void message_handler_req_exec_msg_queuegrouptrack ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_queuegrouptrackstop ( +static void message_handler_req_exec_msg_queuegrouptrackstop ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_messagesend ( +static void message_handler_req_exec_msg_messagesend ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_messageget ( +static void message_handler_req_exec_msg_messageget ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_messagecancel ( +static void message_handler_req_exec_msg_messagecancel ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_messagesendreceive ( +static void message_handler_req_exec_msg_messagesendreceive ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_exec_msg_messagereply ( +static void message_handler_req_exec_msg_messagereply ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required); + struct totem_ip_address *source_addr); -static int message_handler_req_lib_msg_queueopen ( +static void message_handler_req_lib_msg_queueopen ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queueopenasync ( +static void message_handler_req_lib_msg_queueopenasync ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queueclose ( +static void message_handler_req_lib_msg_queueclose ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuestatusget ( +static void message_handler_req_lib_msg_queuestatusget ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queueunlink ( +static void message_handler_req_lib_msg_queueunlink ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegroupcreate ( +static void message_handler_req_lib_msg_queuegroupcreate ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegroupinsert ( +static void message_handler_req_lib_msg_queuegroupinsert ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegroupremove ( +static void message_handler_req_lib_msg_queuegroupremove ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegroupdelete ( +static void message_handler_req_lib_msg_queuegroupdelete ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegrouptrack ( +static void message_handler_req_lib_msg_queuegrouptrack ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_queuegrouptrackstop ( +static void message_handler_req_lib_msg_queuegrouptrackstop ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagesend ( +static void message_handler_req_lib_msg_messagesend ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagesendasync ( +static void message_handler_req_lib_msg_messagesendasync ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messageget ( +static void message_handler_req_lib_msg_messageget ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagecancel ( +static void message_handler_req_lib_msg_messagecancel ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagesendreceive ( +static void message_handler_req_lib_msg_messagesendreceive ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagereply ( +static void message_handler_req_lib_msg_messagereply ( struct conn_info *conn_info, void *message); -static int message_handler_req_lib_msg_messagereplyasync ( +static void message_handler_req_lib_msg_messagereplyasync ( struct conn_info *conn_info, void *message); -static void msg_recovery_activate (void); -static void msg_recovery_initialize (void); -static int msg_recovery_process (void); -static void msg_recovery_finalize(); -static void msg_recovery_abort(void); +#ifdef TODO +static void msg_sync_init (void); +#endif +static void msg_sync_activate (void); +static int msg_sync_process (void); +static void msg_sync_abort(void); void queue_release (struct message_queue *queue); -/* -static struct list_head *recovery_msg_next = 0; -static struct list_head *recovery_msg_section_next = 0; -static int recovery_section_data_offset = 0; -static int recovery_section_send_flag = 0; -static int recovery_abort = 0; -*/ - -static struct memb_ring_id saved_ring_id; - -static int msg_confchg_fn ( +static void msg_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, @@ -288,161 +265,190 @@ static int msg_confchg_fn ( /* * Executive Handler Definition */ -struct libais_handler msg_libais_handlers[] = +struct openais_lib_handler msg_lib_handlers[] = { { /* 0 */ - .libais_handler_fn = message_handler_req_lib_msg_queueopen, + .lib_handler_fn = message_handler_req_lib_msg_queueopen, .response_size = sizeof (struct res_lib_msg_queueopen), .response_id = MESSAGE_RES_MSG_QUEUEOPEN, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 1 */ - .libais_handler_fn = message_handler_req_lib_msg_queueopenasync, + .lib_handler_fn = message_handler_req_lib_msg_queueopenasync, .response_size = sizeof (struct res_lib_msg_queueopenasync), .response_id = MESSAGE_RES_MSG_QUEUEOPENASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 2 */ - .libais_handler_fn = message_handler_req_lib_msg_queueclose, + .lib_handler_fn = message_handler_req_lib_msg_queueclose, .response_size = sizeof (struct res_lib_msg_queueclose), .response_id = MESSAGE_RES_MSG_QUEUECLOSE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 3 */ - .libais_handler_fn = message_handler_req_lib_msg_queuestatusget, + .lib_handler_fn = message_handler_req_lib_msg_queuestatusget, .response_size = sizeof (struct res_lib_msg_queuestatusget), .response_id = MESSAGE_RES_MSG_QUEUESTATUSGET, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 4 */ - .libais_handler_fn = message_handler_req_lib_msg_queueunlink, + .lib_handler_fn = message_handler_req_lib_msg_queueunlink, .response_size = sizeof (struct res_lib_msg_queueunlink), .response_id = MESSAGE_RES_MSG_QUEUEUNLINK, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 5 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegroupcreate, + .lib_handler_fn = message_handler_req_lib_msg_queuegroupcreate, .response_size = sizeof (struct res_lib_msg_queuegroupcreate), .response_id = MESSAGE_RES_MSG_QUEUEGROUPCREATE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 6 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegroupinsert, + .lib_handler_fn = message_handler_req_lib_msg_queuegroupinsert, .response_size = sizeof (struct res_lib_msg_queuegroupinsert), .response_id = MESSAGE_RES_MSG_QUEUEGROUPINSERT, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 7 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegroupremove, + .lib_handler_fn = message_handler_req_lib_msg_queuegroupremove, .response_size = sizeof (struct res_lib_msg_queuegroupremove), .response_id = MESSAGE_RES_MSG_QUEUEGROUPREMOVE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 8 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegroupdelete, + .lib_handler_fn = message_handler_req_lib_msg_queuegroupdelete, .response_size = sizeof (struct res_lib_msg_queuegroupdelete), .response_id = MESSAGE_RES_MSG_QUEUEGROUPDELETE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 9 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegrouptrack, + .lib_handler_fn = message_handler_req_lib_msg_queuegrouptrack, .response_size = sizeof (struct res_lib_msg_queuegrouptrack), .response_id = MESSAGE_RES_MSG_QUEUEGROUPTRACK, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 10 */ - .libais_handler_fn = message_handler_req_lib_msg_queuegrouptrackstop, + .lib_handler_fn = message_handler_req_lib_msg_queuegrouptrackstop, .response_size = sizeof (struct res_lib_msg_queuegrouptrackstop), .response_id = MESSAGE_RES_MSG_QUEUEGROUPTRACKSTOP, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 11 */ - .libais_handler_fn = message_handler_req_lib_msg_messagesend, + .lib_handler_fn = message_handler_req_lib_msg_messagesend, .response_size = sizeof (struct res_lib_msg_messagesend), .response_id = MESSAGE_RES_MSG_MESSAGESEND, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 12 */ - .libais_handler_fn = message_handler_req_lib_msg_messagesendasync, + .lib_handler_fn = message_handler_req_lib_msg_messagesendasync, .response_size = sizeof (struct res_lib_msg_messagesendasync), .response_id = MESSAGE_RES_MSG_MESSAGESENDASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 13 */ - .libais_handler_fn = message_handler_req_lib_msg_messageget, + .lib_handler_fn = message_handler_req_lib_msg_messageget, .response_size = sizeof (struct res_lib_msg_messageget), .response_id = MESSAGE_RES_MSG_MESSAGEGET, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 14 */ - .libais_handler_fn = message_handler_req_lib_msg_messagecancel, + .lib_handler_fn = message_handler_req_lib_msg_messagecancel, .response_size = sizeof (struct res_lib_msg_messagecancel), .response_id = MESSAGE_RES_MSG_MESSAGECANCEL, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 15 */ - .libais_handler_fn = message_handler_req_lib_msg_messagesendreceive, + .lib_handler_fn = message_handler_req_lib_msg_messagesendreceive, .response_size = sizeof (struct res_lib_msg_messagesendreceive), .response_id = MESSAGE_RES_MSG_MESSAGESENDRECEIVE, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 16 */ - .libais_handler_fn = message_handler_req_lib_msg_messagereply, + .lib_handler_fn = message_handler_req_lib_msg_messagereply, .response_size = sizeof (struct res_lib_msg_messagereply), .response_id = MESSAGE_RES_MSG_MESSAGEREPLY, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, { /* 17 */ - .libais_handler_fn = message_handler_req_lib_msg_messagereplyasync, + .lib_handler_fn = message_handler_req_lib_msg_messagereplyasync, .response_size = sizeof (struct res_lib_msg_messagereplyasync), .response_id = MESSAGE_RES_MSG_MESSAGEREPLYASYNC, - .flow_control = FLOW_CONTROL_REQUIRED + .flow_control = OPENAIS_FLOW_CONTROL_REQUIRED }, }; -static int (*msg_aisexec_handler_fns[]) (void *msg, struct totem_ip_address *source_addr, int endian_conversion_required) = { - message_handler_req_exec_msg_queueopen, - message_handler_req_exec_msg_queueclose, - message_handler_req_exec_msg_queuestatusget, - message_handler_req_exec_msg_queueunlink, - message_handler_req_exec_msg_queuegroupcreate, - message_handler_req_exec_msg_queuegroupinsert, - message_handler_req_exec_msg_queuegroupremove, - message_handler_req_exec_msg_queuegroupdelete, - message_handler_req_exec_msg_queuegrouptrack, - message_handler_req_exec_msg_queuegrouptrackstop, - message_handler_req_exec_msg_messagesend, - message_handler_req_exec_msg_messageget, - message_handler_req_exec_msg_messagecancel, - message_handler_req_exec_msg_messagesendreceive, - message_handler_req_exec_msg_messagereply +static struct openais_exec_handler msg_exec_handlers[] = { + { + .exec_handler_fn = message_handler_req_exec_msg_queueopen, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queueclose, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuestatusget, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queueunlink, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegroupcreate, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegroupinsert, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegroupremove, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegroupdelete, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegrouptrack, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_queuegrouptrackstop, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_messagesend, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_messageget, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_messagecancel, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_messagesendreceive, + }, + { + .exec_handler_fn = message_handler_req_exec_msg_messagereply + } }; -struct service_handler msg_service_handler = { - .name = "openais message service", +struct openais_service_handler msg_service_handler = { + .name = (unsigned char *)"openais message service B.01.01", .id = MSG_SERVICE, - .libais_handlers = msg_libais_handlers, - .libais_handlers_count = sizeof (msg_libais_handlers) / sizeof (struct libais_handler), - .aisexec_handler_fns = msg_aisexec_handler_fns, - .aisexec_handler_fns_count = sizeof (msg_aisexec_handler_fns) / sizeof (int (*)), - .confchg_fn = msg_confchg_fn, - .libais_init_two_fn = msg_init_two_fn, - .libais_exit_fn = msg_exit_fn, + .lib_init_fn = msg_lib_init_fn, + .lib_exit_fn = msg_lib_exit_fn, + .lib_handlers = msg_lib_handlers, + .lib_handlers_count = sizeof (msg_lib_handlers) / sizeof (struct openais_lib_handler), .exec_init_fn = msg_exec_init_fn, - .exec_dump_fn = 0, - .sync_init = msg_recovery_initialize, - .sync_process = msg_recovery_process, - .sync_activate = msg_recovery_activate, - .sync_abort = msg_recovery_abort, + .exec_handlers = msg_exec_handlers, + .exec_handlers_count = sizeof (msg_exec_handlers) / sizeof (struct openais_exec_handler), + .confchg_fn = msg_confchg_fn, + .exec_dump_fn = NULL, + .sync_init = NULL, // TODO msg_sync_init, + .sync_process = msg_sync_process, + .sync_activate = msg_sync_activate, + .sync_abort = msg_sync_abort }; #ifdef BUILD_DYNAMIC -struct service_handler *msg_get_handler_ver0 (void); +struct openais_service_handler *msg_get_handler_ver0 (void); -struct aisexec_iface_ver0 msg_service_handler_iface = { - .test = NULL, - .get_handler_ver0 = msg_get_handler_ver0 +struct openais_service_handler_iface_ver0 msg_service_handler_iface = { + .openais_get_service_handler_ver0 = msg_get_handler_ver0 }; struct lcr_iface openais_msg_ver0[1] = { @@ -470,7 +476,7 @@ extern int lcr_comp_get (struct lcr_comp **component) return (0); } -struct service_handler *msg_get_handler_ver0 (void) +struct openais_service_handler *msg_get_handler_ver0 (void) { return (&msg_service_handler); } @@ -569,40 +575,35 @@ struct req_exec_msg_messagereply { int async_call; }; -static void msg_recovery_initialize (void) +#ifdef TODO +static void msg_sync_init (void) { return; } +#endif -static int msg_recovery_process (void) +static int msg_sync_process (void) { return (0); } -static void msg_recovery_finalize () -{ - return; - -} - -static void msg_recovery_activate (void) +static void msg_sync_activate (void) { return; } -static void msg_recovery_abort (void) +static void msg_sync_abort (void) { return; } -static int msg_confchg_fn ( +static void msg_confchg_fn ( enum totem_configuration_type configuration_type, struct totem_ip_address *member_list, int member_list_entries, struct totem_ip_address *left_list, int left_list_entries, struct totem_ip_address *joined_list, int joined_list_entries, struct memb_ring_id *ring_id) { - return (0); } static struct message_queue *queue_find (SaNameT *name) @@ -672,7 +673,7 @@ static int msg_exec_init_fn (struct openais_config *openais_config) return (0); } -static int msg_exit_fn (struct conn_info *conn_info) +static int msg_lib_exit_fn (struct conn_info *conn_info) { #ifdef COMPILE_OUT struct queue_cleanup *queue_cleanup; @@ -710,33 +711,31 @@ printf ("queue cleanup %x\n", queue_cleanup); return (0); } -static int msg_init_two_fn (struct conn_info *conn_info) +static int msg_lib_init_fn (struct conn_info *conn_info) { list_init (&conn_info->conn_info_partner->ais_ci.u.libmsg_ci.queue_list); list_init (&conn_info->conn_info_partner->ais_ci.u.libmsg_ci.queue_cleanup_list); return (0); - } -static int message_handler_req_exec_msg_queueopen ( +static void message_handler_req_exec_msg_queueopen ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queueopen *req_exec_msg_queueopen = (struct req_exec_msg_queueopen *)message; struct res_lib_msg_queueopen res_lib_msg_queueopen; struct res_lib_msg_queueopenasync res_lib_msg_queueopenasync; struct message_queue *queue; // struct queue_cleanup *queue_cleanup; - SaErrorT error = SA_AIS_OK; + SaAisErrorT error = SA_AIS_OK; log_printf (LOG_LEVEL_NOTICE, "EXEC request: saMsgQueueOpen %s\n", getSaNameT (&req_exec_msg_queueopen->queue_name)); queue = queue_find (&req_exec_msg_queueopen->queue_name); - printf ("queue %x\n", queue); + printf ("queue %p\n", queue); /* * If queue doesn't exist, create one */ @@ -827,14 +826,11 @@ error_exit: sizeof (struct res_lib_msg_queueopen)); } } - - return (0); } -static int message_handler_req_exec_msg_queueclose ( +static void message_handler_req_exec_msg_queueclose ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queueclose *req_exec_msg_queueclose = (struct req_exec_msg_queueclose *)message; struct res_lib_msg_queueclose res_lib_msg_queueclose; @@ -866,37 +862,29 @@ error_exit: libais_send_response (req_exec_msg_queueclose->source.conn_info, &res_lib_msg_queueclose, sizeof (struct res_lib_msg_queueclose)); } - return (0); } -static int message_handler_req_exec_msg_queuestatusget ( +static void message_handler_req_exec_msg_queuestatusget ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuestatusget *req_exec_msg_queuestatusget = (struct req_exec_msg_queuestatusget *)message; struct res_lib_msg_queueclose res_lib_msg_queuestatusget; - - return (0); } -static int message_handler_req_exec_msg_queueunlink ( +static void message_handler_req_exec_msg_queueunlink ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queueunlink *req_exec_msg_queueunlink = (struct req_exec_msg_queueunlink *)message; struct res_lib_msg_queueclose res_lib_msg_queueunlink; - - return (0); } -static int message_handler_req_exec_msg_queuegroupcreate ( +static void message_handler_req_exec_msg_queuegroupcreate ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegroupcreate *req_exec_msg_queuegroupcreate = (struct req_exec_msg_queuegroupcreate *)message; @@ -934,13 +922,11 @@ error_exit: &res_lib_msg_queuegroupcreate, sizeof (struct res_lib_msg_queuegroupcreate)); } - return (0); } -static int message_handler_req_exec_msg_queuegroupinsert ( +static void message_handler_req_exec_msg_queuegroupinsert ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegroupinsert *req_exec_msg_queuegroupinsert = (struct req_exec_msg_queuegroupinsert *)message; @@ -983,13 +969,11 @@ error_exit: &res_lib_msg_queuegroupinsert, sizeof (struct res_lib_msg_queuegroupinsert)); } - return (0); } -static int message_handler_req_exec_msg_queuegroupremove ( +static void message_handler_req_exec_msg_queuegroupremove ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegroupremove *req_exec_msg_queuegroupremove = (struct req_exec_msg_queuegroupremove *)message; @@ -1029,13 +1013,11 @@ error_exit: &res_lib_msg_queuegroupremove, sizeof (struct res_lib_msg_queuegroupremove)); } - return (0); } -static int message_handler_req_exec_msg_queuegroupdelete ( +static void message_handler_req_exec_msg_queuegroupdelete ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegroupdelete *req_exec_msg_queuegroupdelete = (struct req_exec_msg_queuegroupdelete *)message; @@ -1062,95 +1044,73 @@ static int message_handler_req_exec_msg_queuegroupdelete ( &res_lib_msg_queuegroupdelete, sizeof (struct res_lib_msg_queuegroupdelete)); } - return (0); } -static int message_handler_req_exec_msg_queuegrouptrack ( +static void message_handler_req_exec_msg_queuegrouptrack ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegrouptrack *req_exec_msg_queuegrouptrack = (struct req_exec_msg_queuegrouptrack *)message; struct res_lib_msg_queueclose res_lib_msg_queuegrouptrack; - - return (0); } -static int message_handler_req_exec_msg_queuegrouptrackstop ( +static void message_handler_req_exec_msg_queuegrouptrackstop ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_queuegrouptrackstop *req_exec_msg_queuegrouptrackstop = (struct req_exec_msg_queuegrouptrackstop *)message; struct res_lib_msg_queueclose res_lib_msg_queuegrouptrackstop; - - return (0); } -static int message_handler_req_exec_msg_messagesend ( +static void message_handler_req_exec_msg_messagesend ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_messagesend *req_exec_msg_messagesend = (struct req_exec_msg_messagesend *)message; struct res_lib_msg_queueclose res_lib_msg_messagesend; - - return (0); } -static int message_handler_req_exec_msg_messageget ( +static void message_handler_req_exec_msg_messageget ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_messageget *req_exec_msg_messageget = (struct req_exec_msg_messageget *)message; struct res_lib_msg_queueclose res_lib_msg_messageget; - - return (0); } -static int message_handler_req_exec_msg_messagecancel ( +static void message_handler_req_exec_msg_messagecancel ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_messagecancel *req_exec_msg_messagecancel = (struct req_exec_msg_messagecancel *)message; struct res_lib_msg_queueclose res_lib_msg_messagecancel; - - return (0); } -static int message_handler_req_exec_msg_messagesendreceive ( +static void message_handler_req_exec_msg_messagesendreceive ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_messagesendreceive *req_exec_msg_messagesendreceive = (struct req_exec_msg_messagesendreceive *)message; struct res_lib_msg_queueclose res_lib_msg_messagesendreceive; - - return (0); } -static int message_handler_req_exec_msg_messagereply ( +static void message_handler_req_exec_msg_messagereply ( void *message, - struct totem_ip_address *source_addr, - int endian_conversion_required) + struct totem_ip_address *source_addr) { struct req_exec_msg_messagereply *req_exec_msg_messagereply = (struct req_exec_msg_messagereply *)message; struct res_lib_msg_queueclose res_lib_msg_messagereply; - - return (0); } -static int message_handler_req_lib_msg_queueopen (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_msg_queueopen (struct conn_info *conn_info, void *message) { struct req_lib_msg_queueopen *req_lib_msg_queueopen = (struct req_lib_msg_queueopen *)message; struct req_exec_msg_queueopen req_exec_msg_queueopen; @@ -1183,11 +1143,9 @@ static int message_handler_req_lib_msg_queueopen (struct conn_info *conn_info, v assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queueopenasync (struct conn_info *conn_info, void *message) +static void message_handler_req_lib_msg_queueopenasync (struct conn_info *conn_info, void *message) { struct req_lib_msg_queueopen *req_lib_msg_queueopen = (struct req_lib_msg_queueopen *)message; struct req_exec_msg_queueopen req_exec_msg_queueopen; @@ -1221,11 +1179,9 @@ static int message_handler_req_lib_msg_queueopenasync (struct conn_info *conn_in assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queueclose (struct conn_info *conn_info, void *message) { +static void message_handler_req_lib_msg_queueclose (struct conn_info *conn_info, void *message) { struct req_lib_msg_queueclose *req_lib_msg_queueclose = (struct req_lib_msg_queueclose *)message; struct req_exec_msg_queueclose req_exec_msg_queueclose; struct iovec iovec; @@ -1248,10 +1204,9 @@ static int message_handler_req_lib_msg_queueclose (struct conn_info *conn_info, assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - return (0); } -static int message_handler_req_lib_msg_queuestatusget ( +static void message_handler_req_lib_msg_queuestatusget ( struct conn_info *conn_info, void *message) { @@ -1278,11 +1233,9 @@ static int message_handler_req_lib_msg_queuestatusget ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queueunlink ( +static void message_handler_req_lib_msg_queueunlink ( struct conn_info *conn_info, void *message) { @@ -1309,11 +1262,9 @@ static int message_handler_req_lib_msg_queueunlink ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegroupcreate ( +static void message_handler_req_lib_msg_queuegroupcreate ( struct conn_info *conn_info, void *message) { @@ -1340,11 +1291,9 @@ static int message_handler_req_lib_msg_queuegroupcreate ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegroupinsert ( +static void message_handler_req_lib_msg_queuegroupinsert ( struct conn_info *conn_info, void *message) { @@ -1373,11 +1322,9 @@ static int message_handler_req_lib_msg_queuegroupinsert ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegroupremove ( +static void message_handler_req_lib_msg_queuegroupremove ( struct conn_info *conn_info, void *message) { @@ -1406,11 +1353,9 @@ static int message_handler_req_lib_msg_queuegroupremove ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegroupdelete ( +static void message_handler_req_lib_msg_queuegroupdelete ( struct conn_info *conn_info, void *message) { @@ -1437,11 +1382,9 @@ static int message_handler_req_lib_msg_queuegroupdelete ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegrouptrack ( +static void message_handler_req_lib_msg_queuegrouptrack ( struct conn_info *conn_info, void *message) { @@ -1468,11 +1411,9 @@ static int message_handler_req_lib_msg_queuegrouptrack ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_queuegrouptrackstop ( +static void message_handler_req_lib_msg_queuegrouptrackstop ( struct conn_info *conn_info, void *message) { @@ -1499,11 +1440,9 @@ static int message_handler_req_lib_msg_queuegrouptrackstop ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagesend ( +static void message_handler_req_lib_msg_messagesend ( struct conn_info *conn_info, void *message) { @@ -1531,11 +1470,9 @@ static int message_handler_req_lib_msg_messagesend ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagesendasync ( +static void message_handler_req_lib_msg_messagesendasync ( struct conn_info *conn_info, void *message) { @@ -1563,11 +1500,9 @@ static int message_handler_req_lib_msg_messagesendasync ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messageget ( +static void message_handler_req_lib_msg_messageget ( struct conn_info *conn_info, void *message) { @@ -1594,11 +1529,9 @@ static int message_handler_req_lib_msg_messageget ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagecancel ( +static void message_handler_req_lib_msg_messagecancel ( struct conn_info *conn_info, void *message) { @@ -1625,11 +1558,9 @@ static int message_handler_req_lib_msg_messagecancel ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagesendreceive ( +static void message_handler_req_lib_msg_messagesendreceive ( struct conn_info *conn_info, void *message) { @@ -1656,11 +1587,9 @@ static int message_handler_req_lib_msg_messagesendreceive ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagereply ( +static void message_handler_req_lib_msg_messagereply ( struct conn_info *conn_info, void *message) { @@ -1688,11 +1617,9 @@ static int message_handler_req_lib_msg_messagereply ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } -static int message_handler_req_lib_msg_messagereplyasync ( +static void message_handler_req_lib_msg_messagereplyasync ( struct conn_info *conn_info, void *message) { @@ -1720,6 +1647,4 @@ static int message_handler_req_lib_msg_messagereplyasync ( assert (totempg_groups_mcast_joined (openais_group_handle, &iovec, 1, TOTEMPG_AGREED) == 0); - - return (0); } diff --git a/exec/msg.h b/exec/msg.h index 3efe4380..0149022d 100644 --- a/exec/msg.h +++ b/exec/msg.h @@ -44,6 +44,6 @@ struct libmsg_ci { struct list_head queue_cleanup_list; }; -extern struct service_handler msg_service_handler; +extern struct openais_service_handler msg_service_handler; #endif /* MSG_H_DEFINED */