Esempio n. 1
0
SaAisErrorT
saAmfProtectionGroupTrackStop (
	SaAmfHandleT amfHandle,
	const SaNameT *csiName)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_protectiongrouptrackstop req_lib_amf_protectiongrouptrackstop;
	struct res_lib_amf_protectiongrouptrackstop res_lib_amf_protectiongrouptrackstop;
	struct iovec iov;
	SaAisErrorT error;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_protectiongrouptrackstop.header.size = sizeof (struct req_lib_amf_protectiongrouptrackstop);
	req_lib_amf_protectiongrouptrackstop.header.id = MESSAGE_REQ_AMF_PROTECTIONGROUPTRACKSTOP;
	memcpy (&req_lib_amf_protectiongrouptrackstop.csiName, csiName, sizeof (SaNameT));

	iov.iov_base = (void *)&req_lib_amf_protectiongrouptrackstop,
	iov.iov_len = sizeof (struct req_lib_amf_protectiongrouptrackstop),

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_protectiongrouptrackstop,
		sizeof (struct res_lib_amf_protectiongrouptrackstop));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_protectiongrouptrackstop.header.error : error);
}
Esempio n. 2
0
SaAisErrorT
saAmfComponentErrorClear (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	SaNtfIdentifierT ntfIdentifier)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_componenterrorclear req_lib_amf_componenterrorclear;
	struct res_lib_amf_componenterrorclear res_lib_amf_componenterrorclear;
	struct iovec iov;
	SaAisErrorT error;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_componenterrorclear.header.id = MESSAGE_REQ_AMF_COMPONENTERRORCLEAR;
	req_lib_amf_componenterrorclear.header.size = sizeof (struct req_lib_amf_componenterrorclear);
	memcpy (&req_lib_amf_componenterrorclear.compName, compName, sizeof (SaNameT));

	iov.iov_base = (void *)&req_lib_amf_componenterrorclear;
	iov.iov_len = sizeof (struct req_lib_amf_componenterrorclear);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_componenterrorclear,
		sizeof (struct res_lib_amf_componenterrorclear));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_componenterrorclear.header.error : error);
}
Esempio n. 3
0
gboolean
get_ais_nodeid(uint32_t * id, char **uname)
{
    struct iovec iov;
    int retries = 0;
    int rc = CS_OK;
    cs_ipc_header_response_t header;
    struct crm_ais_nodeid_resp_s answer;

    header.error = CS_OK;
    header.id = crm_class_nodeid;
    header.size = sizeof(cs_ipc_header_response_t);

    CRM_CHECK(id != NULL, return FALSE);
    CRM_CHECK(uname != NULL, return FALSE);

    iov.iov_base = &header;
    iov.iov_len = header.size;

  retry:
    errno = 0;
    rc = coroipcc_msg_send_reply_receive(ais_ipc_handle, &iov, 1, &answer, sizeof(answer));
    if (rc == CS_OK) {
        CRM_CHECK(answer.header.size == sizeof(struct crm_ais_nodeid_resp_s),
                  crm_err("Odd message: id=%d, size=%d, error=%d",
                          answer.header.id, answer.header.size, answer.header.error));
        CRM_CHECK(answer.header.id == crm_class_nodeid,
                  crm_err("Bad response id: %d", answer.header.id));
    }

    if ((rc == CS_ERR_TRY_AGAIN || rc == CS_ERR_QUEUE_FULL) && retries < 20) {
        retries++;
        crm_info("Peer overloaded: Re-sending message (Attempt %d of 20)", retries);
        sleep(retries);         /* Proportional back off */
        goto retry;
    }

    if (rc != CS_OK) {
        crm_err("Sending nodeid request: FAILED (rc=%d): %s", rc, ais_error2text(rc));
        return FALSE;

    } else if (answer.header.error != CS_OK) {
        crm_err("Bad response from peer: (rc=%d): %s", rc, ais_error2text(rc));
        return FALSE;
    }

    crm_info("Server details: id=%u uname=%s cname=%s", answer.id, answer.uname, answer.cname);

    *id = answer.id;
    *uname = strdup(answer.uname);
    ais_cluster_name = strdup(answer.cname);

    return TRUE;
}
Esempio n. 4
0
evs_error_t evs_membership_get (
	evs_handle_t handle,
	unsigned int *local_nodeid,
	unsigned int *member_list,
	size_t *member_list_entries)
{
	evs_error_t error;
	struct evs_inst *evs_inst;
	struct iovec iov;
	struct req_lib_evs_membership_get req_lib_evs_membership_get;
	struct res_lib_evs_membership_get res_lib_evs_membership_get;

	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
	if (error != CS_OK) {
		return (error);
	}

	req_lib_evs_membership_get.header.size = sizeof (struct req_lib_evs_membership_get);
	req_lib_evs_membership_get.header.id = MESSAGE_REQ_EVS_MEMBERSHIP_GET;

	iov.iov_base = (void *)&req_lib_evs_membership_get;
	iov.iov_len = sizeof (struct req_lib_evs_membership_get);

	error = coroipcc_msg_send_reply_receive (evs_inst->handle,
		&iov,
		1,
		&res_lib_evs_membership_get,
		sizeof (struct res_lib_evs_membership_get));

	if (error != CS_OK) {
		goto error_exit;
	}

	error = res_lib_evs_membership_get.header.error;

	/*
	 * Copy results to caller
	 */
	if (local_nodeid) {
		*local_nodeid = res_lib_evs_membership_get.local_nodeid;
 	}
	*member_list_entries = MIN (*member_list_entries,
				    res_lib_evs_membership_get.member_list_entries);
	if (member_list) {
		memcpy (member_list, &res_lib_evs_membership_get.member_list,
			*member_list_entries * sizeof (struct in_addr));
	}

error_exit:
	hdb_handle_put (&evs_handle_t_db, handle);

	return (error);
}
Esempio n. 5
0
evs_error_t evs_mcast_groups (
	evs_handle_t handle,
	evs_guarantee_t guarantee,
	const struct evs_group *groups,
	size_t group_entries,
	const struct iovec *iovec,
	unsigned int iov_len)
{
	int i;
	evs_error_t error;
	struct evs_inst *evs_inst;
	struct iovec iov[64]; /* FIXME: what if iov_len > 62 ?  use malloc */
	struct req_lib_evs_mcast_groups req_lib_evs_mcast_groups;
	struct res_lib_evs_mcast_groups res_lib_evs_mcast_groups;
	size_t msg_len = 0;

	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
	if (error != CS_OK) {
		return (error);
	}
	for (i = 0; i < iov_len; i++) {
		msg_len += iovec[i].iov_len;
	}
	req_lib_evs_mcast_groups.header.size = sizeof (struct req_lib_evs_mcast_groups) +
		(group_entries * sizeof (struct evs_group)) + msg_len;
	req_lib_evs_mcast_groups.header.id = MESSAGE_REQ_EVS_MCAST_GROUPS;
	req_lib_evs_mcast_groups.guarantee = guarantee;
	req_lib_evs_mcast_groups.msg_len = msg_len;
	req_lib_evs_mcast_groups.group_entries = group_entries;

	iov[0].iov_base = (void *)&req_lib_evs_mcast_groups;
	iov[0].iov_len = sizeof (struct req_lib_evs_mcast_groups);
	iov[1].iov_base = (void *) groups; /* cast away const */
	iov[1].iov_len = (group_entries * sizeof (struct evs_group));
	memcpy (&iov[2], iovec, iov_len * sizeof (struct iovec));

	error = coroipcc_msg_send_reply_receive (evs_inst->handle, iov,
		iov_len + 2,
		&res_lib_evs_mcast_groups,
		sizeof (struct res_lib_evs_mcast_groups));

	if (error != CS_OK) {
		goto error_exit;
	}

	error = res_lib_evs_mcast_groups.header.error;

error_exit:
	hdb_handle_put (&evs_handle_t_db, handle);

	return (error);
}
Esempio n. 6
0
evs_error_t evs_mcast_joined (
	evs_handle_t handle,
	evs_guarantee_t guarantee,
	const struct iovec *iovec,
	unsigned int iov_len)
{
	int i;
	evs_error_t error;
	struct evs_inst *evs_inst;
	struct iovec iov[64];
	struct req_lib_evs_mcast_joined req_lib_evs_mcast_joined;
	struct res_lib_evs_mcast_joined res_lib_evs_mcast_joined;
	size_t msg_len = 0;

	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
	if (error != CS_OK) {
		return (error);
	}

	for (i = 0; i < iov_len; i++ ) {
		msg_len += iovec[i].iov_len;
	}

	req_lib_evs_mcast_joined.header.size = sizeof (struct req_lib_evs_mcast_joined) +
		msg_len;

	req_lib_evs_mcast_joined.header.id = MESSAGE_REQ_EVS_MCAST_JOINED;
	req_lib_evs_mcast_joined.guarantee = guarantee;
	req_lib_evs_mcast_joined.msg_len = msg_len;

	iov[0].iov_base = (void *)&req_lib_evs_mcast_joined;
	iov[0].iov_len = sizeof (struct req_lib_evs_mcast_joined);
	memcpy (&iov[1], iovec, iov_len * sizeof (struct iovec));

	error = coroipcc_msg_send_reply_receive (evs_inst->handle, iov,
		iov_len + 1,
		&res_lib_evs_mcast_joined,
		sizeof (struct res_lib_evs_mcast_joined));

	if (error != CS_OK) {
		goto error_exit;
	}

	error = res_lib_evs_mcast_joined.header.error;

error_exit:
	hdb_handle_put (&evs_handle_t_db, handle);

	return (error);
}
Esempio n. 7
0
cs_error_t
coroipcc_zcb_alloc (
	hdb_handle_t handle,
	void **buffer,
	size_t size,
	size_t header_size)
{
	struct ipc_instance *ipc_instance;
	void *buf = NULL;
	char path[PATH_MAX];
	unsigned int res;
	mar_req_coroipcc_zc_alloc_t req_coroipcc_zc_alloc;
	coroipc_response_header_t res_coroipcs_zc_alloc;
	size_t map_size;
	struct iovec iovec;
	struct coroipcs_zc_header *hdr;

	res = hdb_error_to_cs (hdb_handle_get (&ipc_hdb, handle, (void **)&ipc_instance));
	if (res != CS_OK) {
		return (res);
	}
	map_size = size + header_size + sizeof (struct coroipcs_zc_header);
	res = memory_map (path, "corosync_zerocopy-XXXXXX", &buf, map_size);
	assert (res != -1);

	req_coroipcc_zc_alloc.header.size = sizeof (mar_req_coroipcc_zc_alloc_t);
	req_coroipcc_zc_alloc.header.id = ZC_ALLOC_HEADER;
	req_coroipcc_zc_alloc.map_size = map_size;
	strcpy (req_coroipcc_zc_alloc.path_to_file, path);


	iovec.iov_base = (void *)&req_coroipcc_zc_alloc;
	iovec.iov_len = sizeof (mar_req_coroipcc_zc_alloc_t);

	res = coroipcc_msg_send_reply_receive (
		handle,
		&iovec,
		1,
		&res_coroipcs_zc_alloc,
		sizeof (coroipc_response_header_t));

	hdr = (struct coroipcs_zc_header *)buf;
	hdr->map_size = map_size;
	*buffer = ((char *)buf) + sizeof (struct coroipcs_zc_header);

	hdb_handle_put (&ipc_hdb, handle);
	return (res);
}
Esempio n. 8
0
SaAisErrorT
saAmfComponentRegister (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	const SaNameT *proxyCompName)
{
	struct amfInstance *amfInstance;
	SaAisErrorT error;
	struct req_lib_amf_componentregister req_lib_amf_componentregister;
	struct res_lib_amf_componentregister res_lib_amf_componentregister;
	struct iovec iov;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_componentregister.header.size = sizeof (struct req_lib_amf_componentregister);
	req_lib_amf_componentregister.header.id = MESSAGE_REQ_AMF_COMPONENTREGISTER;
	memcpy (&req_lib_amf_componentregister.compName, compName,
		sizeof (SaNameT));
	if (proxyCompName) {
		memcpy (&req_lib_amf_componentregister.proxyCompName,
			proxyCompName, sizeof (SaNameT));
	} else {
		memset (&req_lib_amf_componentregister.proxyCompName, 0,
			sizeof (SaNameT));
	}

	iov.iov_base = (void *)&req_lib_amf_componentregister;
	iov.iov_len = sizeof (struct req_lib_amf_componentregister);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_componentregister,
		sizeof (struct res_lib_amf_componentregister));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

	if (res_lib_amf_componentregister.header.error == SA_AIS_OK) {
		amfInstance->compRegistered = 1;
		memcpy (&amfInstance->compName, compName, sizeof (SaNameT));
	}
        return (error == SA_AIS_OK ? res_lib_amf_componentregister.header.error : error);
}
Esempio n. 9
0
SaAisErrorT
saAmfComponentErrorReport (
	SaAmfHandleT amfHandle,
	const SaNameT *erroneousComponent,
	SaTimeT errorDetectionTime,
	SaAmfRecommendedRecoveryT recommendedRecovery,
	SaNtfIdentifierT ntfIdentifier)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_componenterrorreport req_lib_amf_componenterrorreport;
	struct res_lib_amf_componenterrorreport res_lib_amf_componenterrorreport;
	struct iovec iov;
	SaAisErrorT error;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_componenterrorreport.header.id = MESSAGE_REQ_AMF_COMPONENTERRORREPORT;
	req_lib_amf_componenterrorreport.header.size = sizeof (struct req_lib_amf_componenterrorreport);
	memcpy (&req_lib_amf_componenterrorreport.erroneousComponent, erroneousComponent,
		sizeof (SaNameT));
	req_lib_amf_componenterrorreport.errorDetectionTime = errorDetectionTime;
	req_lib_amf_componenterrorreport.recommendedRecovery = recommendedRecovery;

	iov.iov_base = (void *)&req_lib_amf_componenterrorreport;
	iov.iov_len = sizeof (struct req_lib_amf_componenterrorreport);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_componenterrorreport,
		sizeof (struct res_lib_amf_componenterrorreport));


	error = res_lib_amf_componenterrorreport.header.error;

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_componenterrorreport.header.error : error);
}
Esempio n. 10
0
SaAisErrorT
saAmfPmStart (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	SaUint64T processId,
	SaInt32T descendentsTreeDepth,
	SaAmfPmErrorsT pmErrors,
	SaAmfRecommendedRecoveryT recommendedRecovery)
{
	struct req_lib_amf_pmstart req_lib_amf_pmstart;
	struct res_lib_amf_pmstart res_lib_amf_pmstart;
	struct amfInstance *amfInstance;
	SaAisErrorT error;
	struct iovec iov;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_pmstart.header.size = sizeof (struct req_lib_amf_pmstart);
	req_lib_amf_pmstart.header.id = MESSAGE_REQ_AMF_PMSTART;
	memcpy (&req_lib_amf_pmstart.compName, compName,
		sizeof (SaNameT));
	req_lib_amf_pmstart.processId = processId;
	req_lib_amf_pmstart.descendentsTreeDepth = descendentsTreeDepth;
	req_lib_amf_pmstart.pmErrors = pmErrors;
	req_lib_amf_pmstart.recommendedRecovery = recommendedRecovery;

	iov.iov_base = (void *)&req_lib_amf_pmstart;
	iov.iov_len = sizeof (struct req_lib_amf_pmstart);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_pmstart,
		sizeof (struct res_lib_amf_pmstart));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_pmstart.header.error : error);
}
Esempio n. 11
0
SaAisErrorT
saAmfHealthcheckStart (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	const SaAmfHealthcheckKeyT *healthcheckKey,
	SaAmfHealthcheckInvocationT invocationType,
	SaAmfRecommendedRecoveryT recommendedRecovery)
{
	struct req_lib_amf_healthcheckstart req_lib_amf_healthcheckstart;
	struct res_lib_amf_healthcheckstart res_lib_amf_healthcheckstart;
	struct amfInstance *amfInstance;
	SaAisErrorT error;
	struct iovec iov;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_healthcheckstart.header.size = sizeof (struct req_lib_amf_healthcheckstart);
	req_lib_amf_healthcheckstart.header.id = MESSAGE_REQ_AMF_HEALTHCHECKSTART;
	memcpy (&req_lib_amf_healthcheckstart.compName, compName,
		sizeof (SaNameT));
	memcpy (&req_lib_amf_healthcheckstart.healthcheckKey,
		healthcheckKey, sizeof (SaAmfHealthcheckKeyT));
	req_lib_amf_healthcheckstart.invocationType = invocationType;
	req_lib_amf_healthcheckstart.recommendedRecovery = recommendedRecovery;

	iov.iov_base = (void *)&req_lib_amf_healthcheckstart;
	iov.iov_len = sizeof (struct req_lib_amf_healthcheckstart);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_healthcheckstart,
		sizeof (struct res_lib_amf_healthcheckstart));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_healthcheckstart.header.error : error);
}
Esempio n. 12
0
SaAisErrorT
saAmfHAStateGet (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	const SaNameT *csiName,
	SaAmfHAStateT *haState)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_hastateget req_lib_amf_hastateget;
	struct res_lib_amf_hastateget res_lib_amf_hastateget;
	struct iovec iov;
	SaAisErrorT error;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	iov.iov_base = (void *)&req_lib_amf_hastateget,
	iov.iov_len = sizeof (struct req_lib_amf_hastateget),

	req_lib_amf_hastateget.header.id = MESSAGE_REQ_AMF_HASTATEGET;
	req_lib_amf_hastateget.header.size = sizeof (struct req_lib_amf_hastateget);
	memcpy (&req_lib_amf_hastateget.compName, compName, sizeof (SaNameT));
	memcpy (&req_lib_amf_hastateget.csiName, csiName, sizeof (SaNameT));

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_hastateget,
		sizeof (struct res_lib_amf_hastateget));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

	if (res_lib_amf_hastateget.header.error == SA_AIS_OK) {
		memcpy (haState, &res_lib_amf_hastateget.haState,
			sizeof (SaAmfHAStateT));
	}
        return (error == SA_AIS_OK ? res_lib_amf_hastateget.header.error : error);
}
Esempio n. 13
0
SaAisErrorT
saAmfPmStop (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	SaAmfPmStopQualifierT stopQualifier,
	SaInt64T processId,
	SaAmfPmErrorsT pmErrors)
{
	struct req_lib_amf_pmstop req_lib_amf_pmstop;
	struct res_lib_amf_pmstop res_lib_amf_pmstop;
	struct amfInstance *amfInstance;
	SaAisErrorT error;
	struct iovec iov;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_pmstop.header.size = sizeof (struct req_lib_amf_pmstop);
	req_lib_amf_pmstop.header.id = MESSAGE_REQ_AMF_PMSTOP;
	memcpy (&req_lib_amf_pmstop.compName, compName, sizeof (SaNameT));
	req_lib_amf_pmstop.stopQualifier = stopQualifier;
	req_lib_amf_pmstop.processId = processId;
	req_lib_amf_pmstop.pmErrors = pmErrors;

	iov.iov_base = (void *)&req_lib_amf_pmstop;
	iov.iov_len = sizeof (struct req_lib_amf_pmstop);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_pmstop,
		sizeof (struct res_lib_amf_pmstop));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_pmstop.header.error : error);
	return (SA_AIS_OK);
}
Esempio n. 14
0
evs_error_t evs_leave (
    evs_handle_t handle,
    const struct evs_group *groups,
    size_t group_entries)
{
	evs_error_t error;
	struct evs_inst *evs_inst;
	struct iovec iov[2];
	struct req_lib_evs_leave req_lib_evs_leave;
	struct res_lib_evs_leave res_lib_evs_leave;

	error = hdb_error_to_cs(hdb_handle_get (&evs_handle_t_db, handle, (void *)&evs_inst));
	if (error != CS_OK) {
		return (error);
	}

	req_lib_evs_leave.header.size = sizeof (struct req_lib_evs_leave) +
		(group_entries * sizeof (struct evs_group));
	req_lib_evs_leave.header.id = MESSAGE_REQ_EVS_LEAVE;
	req_lib_evs_leave.group_entries = group_entries;

	iov[0].iov_base = (void *)&req_lib_evs_leave;
	iov[0].iov_len = sizeof (struct req_lib_evs_leave);
	iov[1].iov_base = (void *) groups; /* cast away const */
	iov[1].iov_len = (group_entries * sizeof (struct evs_group));

	error = coroipcc_msg_send_reply_receive (evs_inst->handle, iov, 2,
		&res_lib_evs_leave, sizeof (struct res_lib_evs_leave));

	if (error != CS_OK) {
		goto error_exit;
	}

	error = res_lib_evs_leave.header.error;

error_exit:
	hdb_handle_put (&evs_handle_t_db, handle);

	return (error);
}
Esempio n. 15
0
SaAisErrorT
saAmfHealthcheckConfirm (
	SaAmfHandleT amfHandle,
	const SaNameT *compName,
	const SaAmfHealthcheckKeyT *healthcheckKey,
	SaAisErrorT healthcheckResult)
{
	struct req_lib_amf_healthcheckconfirm req_lib_amf_healthcheckconfirm;
	struct res_lib_amf_healthcheckconfirm res_lib_amf_healthcheckconfirm;
	struct amfInstance *amfInstance;
	SaAisErrorT error;
	struct iovec iov;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_healthcheckconfirm.header.size = sizeof (struct req_lib_amf_healthcheckconfirm);
	req_lib_amf_healthcheckconfirm.header.id = MESSAGE_REQ_AMF_HEALTHCHECKCONFIRM;
	memcpy (&req_lib_amf_healthcheckconfirm.compName, compName,
		sizeof (SaNameT));
	memcpy (&req_lib_amf_healthcheckconfirm.healthcheckKey,
		healthcheckKey, sizeof (SaAmfHealthcheckKeyT));
	req_lib_amf_healthcheckconfirm.healthcheckResult = healthcheckResult;

	iov.iov_base = (void *)&req_lib_amf_healthcheckconfirm;
	iov.iov_len = sizeof (struct req_lib_amf_healthcheckconfirm);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_healthcheckconfirm,
		sizeof (struct res_lib_amf_healthcheckconfirm));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_healthcheckconfirm.header.error : error);
}
Esempio n. 16
0
SaAisErrorT
saAmfProtectionGroupTrack (
	SaAmfHandleT amfHandle,
	const SaNameT *csiName,
	SaUint8T trackFlags,
	SaAmfProtectionGroupNotificationBufferT *notificationBuffer)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_protectiongrouptrack req_lib_amf_protectiongrouptrack;
	struct res_lib_amf_protectiongrouptrack res_lib_amf_protectiongrouptrack;
	struct iovec iov;
	SaAisErrorT error;

	req_lib_amf_protectiongrouptrack.header.size = sizeof (struct req_lib_amf_protectiongrouptrack);
	req_lib_amf_protectiongrouptrack.header.id = MESSAGE_REQ_AMF_PROTECTIONGROUPTRACK;
	memcpy (&req_lib_amf_protectiongrouptrack.csiName, csiName,
		sizeof (SaNameT));
	req_lib_amf_protectiongrouptrack.trackFlags = trackFlags;
	req_lib_amf_protectiongrouptrack.notificationBufferAddress = (SaAmfProtectionGroupNotificationBufferT *)notificationBuffer;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	iov.iov_base = (void *)&req_lib_amf_protectiongrouptrack;
	iov.iov_len = sizeof (struct req_lib_amf_protectiongrouptrack);

	error = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_protectiongrouptrack,
		sizeof (struct res_lib_amf_protectiongrouptrack));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (error == SA_AIS_OK ? res_lib_amf_protectiongrouptrack.header.error : error);
}
Esempio n. 17
0
cs_error_t
coroipcc_zcb_free (
	hdb_handle_t handle,
	void *buffer)
{
	struct ipc_instance *ipc_instance;
	mar_req_coroipcc_zc_free_t req_coroipcc_zc_free;
	coroipc_response_header_t res_coroipcs_zc_free;
	struct iovec iovec;
	unsigned int res;
	struct coroipcs_zc_header *header = (struct coroipcs_zc_header *)((char *)buffer - sizeof (struct coroipcs_zc_header));

	res = hdb_error_to_cs (hdb_handle_get (&ipc_hdb, handle, (void **)&ipc_instance));
	if (res != CS_OK) {
		return (res);
	}

	req_coroipcc_zc_free.header.size = sizeof (mar_req_coroipcc_zc_free_t);
	req_coroipcc_zc_free.header.id = ZC_FREE_HEADER;
	req_coroipcc_zc_free.map_size = header->map_size;
	req_coroipcc_zc_free.server_address = header->server_address;

	iovec.iov_base = (void *)&req_coroipcc_zc_free;
	iovec.iov_len = sizeof (mar_req_coroipcc_zc_free_t);

	res = coroipcc_msg_send_reply_receive (
		handle,
		&iovec,
		1,
		&res_coroipcs_zc_free,
		sizeof (coroipc_response_header_t));

	munmap ((void *)header, header->map_size);

	hdb_handle_put (&ipc_hdb, handle);

	return (res);
}
Esempio n. 18
0
SaAisErrorT
saAmfResponse (
	SaAmfHandleT amfHandle,
	SaInvocationT invocation,
	SaAisErrorT error)
{
	struct amfInstance *amfInstance;
	struct req_lib_amf_response req_lib_amf_response;
	struct res_lib_amf_response res_lib_amf_response;
	struct iovec iov;
	SaAisErrorT errorResult;

	errorResult = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (errorResult != SA_AIS_OK) {
		return (errorResult);
	}

	req_lib_amf_response.header.id = MESSAGE_REQ_AMF_RESPONSE;
	req_lib_amf_response.header.size = sizeof (struct req_lib_amf_response);
	req_lib_amf_response.invocation = invocation;
	req_lib_amf_response.error = error;

	iov.iov_base = (void *)&req_lib_amf_response;
	iov.iov_len = sizeof (struct req_lib_amf_response);

	errorResult = coroipcc_msg_send_reply_receive (
		amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_response,
		sizeof (struct res_lib_amf_response));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (errorResult == SA_AIS_OK ? res_lib_amf_response.header.error : errorResult);
}
Esempio n. 19
0
cs_error_t
coroipcc_zcb_msg_send_reply_receive (
	hdb_handle_t handle,
        void *msg,
        void *res_msg,
        size_t res_len)
{
	struct ipc_instance *ipc_instance;
	mar_req_coroipcc_zc_execute_t req_coroipcc_zc_execute;
	struct coroipcs_zc_header *hdr;
	struct iovec iovec;
	cs_error_t res;

	res = hdb_error_to_cs (hdb_handle_get (&ipc_hdb, handle, (void **)&ipc_instance));
	if (res != CS_OK) {
		return (res);
	}
	hdr = (struct coroipcs_zc_header *)(((char *)msg) - sizeof (struct coroipcs_zc_header));

	req_coroipcc_zc_execute.header.size = sizeof (mar_req_coroipcc_zc_execute_t);
	req_coroipcc_zc_execute.header.id = ZC_EXECUTE_HEADER;
	req_coroipcc_zc_execute.server_address = hdr->server_address;

	iovec.iov_base = (void *)&req_coroipcc_zc_execute;
	iovec.iov_len = sizeof (mar_req_coroipcc_zc_execute_t);

	res = coroipcc_msg_send_reply_receive (
		handle,
		&iovec,
		1,
		res_msg,
		res_len);

	hdb_handle_put (&ipc_hdb, handle);
	return (res);
}
Esempio n. 20
0
SaAisErrorT
saAmfCSIQuiescingComplete (
	SaAmfHandleT amfHandle,
	SaInvocationT invocation,
	SaAisErrorT error)
{
	struct req_lib_amf_csiquiescingcomplete req_lib_amf_csiquiescingcomplete;
	struct res_lib_amf_csiquiescingcomplete res_lib_amf_csiquiescingcomplete;
	struct amfInstance *amfInstance;
	struct iovec iov;
	SaAisErrorT errorResult;

	error = hdb_error_to_sa(hdb_handle_get (&amfHandleDatabase, amfHandle,
		(void *)&amfInstance));
	if (error != SA_AIS_OK) {
		return (error);
	}

	req_lib_amf_csiquiescingcomplete.header.size = sizeof (struct req_lib_amf_csiquiescingcomplete);
	req_lib_amf_csiquiescingcomplete.header.id = MESSAGE_REQ_AMF_CSIQUIESCINGCOMPLETE;
	req_lib_amf_csiquiescingcomplete.invocation = invocation;
	req_lib_amf_csiquiescingcomplete.error = error;

	iov.iov_base = (void *)&req_lib_amf_csiquiescingcomplete;
	iov.iov_len = sizeof (struct req_lib_amf_csiquiescingcomplete);

	errorResult = coroipcc_msg_send_reply_receive (amfInstance->handle,
		&iov,
		1,
		&res_lib_amf_csiquiescingcomplete,
		sizeof (struct res_lib_amf_csiquiescingcomplete));

	hdb_handle_put (&amfHandleDatabase, amfHandle);

        return (errorResult == SA_AIS_OK ? res_lib_amf_csiquiescingcomplete.header.error : errorResult);
}