예제 #1
0
/****************************************************************************
 * Name          : cpd_amf_init
 *
 * Description   : CPD initializes AMF for involking process and registers 
 *                 the various callback functions.
 *
 * Arguments     : cpd_cb  - CPD control block pointer.
 *
 * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
 *
 * Notes         : None.
 *****************************************************************************/
uint32_t cpd_amf_init(CPD_CB *cpd_cb)
{
	SaAmfCallbacksT amfCallbacks;
	SaVersionT amf_version;
	SaAisErrorT error;
	uint32_t res = NCSCC_RC_SUCCESS;

	TRACE_ENTER();
	memset(&amfCallbacks, 0, sizeof(SaAmfCallbacksT));

	amfCallbacks.saAmfHealthcheckCallback = cpd_saf_hlth_chk_cb;
	amfCallbacks.saAmfCSISetCallback = cpd_saf_csi_set_cb;
	amfCallbacks.saAmfComponentTerminateCallback = cpd_amf_comp_terminate_callback;
	amfCallbacks.saAmfCSIRemoveCallback = cpd_amf_csi_rmv_callback;

	m_CPSV_GET_AMF_VER(amf_version);

	error = saAmfInitialize(&cpd_cb->amf_hdl, &amfCallbacks, &amf_version);

	if (error != SA_AIS_OK) {
		LOG_ER("saAmfInitialize failed with Error:%u",error);
		res = NCSCC_RC_FAILURE;
	}
	if (error == SA_AIS_OK)
		TRACE_2("cpd amf init success");

	TRACE_LEAVE();
	return (res);
}
예제 #2
0
/****************************************************************************
 * Name          : cpnd_amf_init
 *
 * Description   : CPND initializes AMF for involking process and registers 
 *                 the various callback functions.
 *
 * Arguments     : cpnd_cb  - Ifsv control block pointer.
 *
 * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
 *
 * Notes         : None.
 *****************************************************************************/
uns32 cpnd_amf_init(CPND_CB *cpnd_cb)
{
	SaAmfCallbacksT amfCallbacks;
	SaVersionT amf_version;
	SaAisErrorT error;
	uns32 res = NCSCC_RC_SUCCESS;

	memset(&amfCallbacks, 0, sizeof(SaAmfCallbacksT));
	amfCallbacks.saAmfHealthcheckCallback = (SaAmfHealthcheckCallbackT)cpnd_saf_health_chk_callback;
	amfCallbacks.saAmfCSISetCallback = cpnd_saf_csi_set_cb;
	amfCallbacks.saAmfComponentTerminateCallback = cpnd_amf_comp_terminate_callback;
	amfCallbacks.saAmfCSIRemoveCallback = (SaAmfCSIRemoveCallbackT)cpnd_amf_csi_rmv_callback;

	m_CPSV_GET_AMF_VER(amf_version);

	error = saAmfInitialize(&cpnd_cb->amf_hdl, &amfCallbacks, &amf_version);

	if (error != SA_AIS_OK) {
		m_LOG_CPND_CL(CPND_AMF_INIT_FAILED, CPND_FC_HDLN, NCSFL_SEV_ERROR, __FILE__, __LINE__);
		res = NCSCC_RC_FAILURE;
	}
	return (res);
}