46 #include "libIARMCore.h"
49 #define LOG_TR69HOSTIF "LOG.RDK.TR69HOSTIF"
51 #define MAX_RETRY_LOOP 15
55 faultCode_t TR69Bus_ProcessSharedMalloc(
size_t size,
void **ptr)
57 IARM_Result_t retCode = IARM_Malloc(IARM_MEMTYPE_PROCESSLOCAL, size, ptr);
59 if (IARM_RESULT_SUCCESS != retCode)
60 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s: Failed to malloc from shared mem, IARM err code = %d\n", __FUNCTION__, retCode);
64 case IARM_RESULT_SUCCESS:
67 return fcRequestDenied;
68 case IARM_RESULT_INVALID_PARAM:
69 case IARM_RESULT_IPCCORE_FAIL:
71 return fcInternalError;
79 if (NULL == requestInfo)
81 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s: Null RequestInfo Arguments Caught !!!\n", __FUNCTION__);
82 return IARM_RESULT_IPCCORE_FAIL;
85 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"[%s:%s:%d] paramName:%s \n", __FILE__, __FUNCTION__, __LINE__, requestInfo->
paramName);
87 if (
false == tr69AgentCallback(requestInfo))
89 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s: tr69AgentCallback returned error !!!\n", __FUNCTION__);
90 return IARM_RESULT_IPCCORE_FAIL;
93 RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,
"%s: tr69AgentCallback returned success !!!\n", __FUNCTION__);
95 return IARM_RESULT_SUCCESS;
100 IARM_Result_t ret = IARM_RESULT_SUCCESS;
105 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s: Owner's name cannot be null \r\n", __FUNCTION__);
109 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"%s: Registering %s callback function (%s) \r\n", __FUNCTION__, pOwnerName, IARM_BUS_TR69_COMMON_API_AgentParameterHandler);
111 tr69AgentCallback = incomingTr69RequestCallback;
112 if (NULL == tr69AgentCallback)
114 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"Error registering callback for %s, incomingTr69RequestCallback is null\n", pOwnerName);
118 for(
int loop = 0; loop < MAX_RETRY_LOOP; loop++)
121 if(IARM_RESULT_SUCCESS == ret)
128 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"[%s:%s:%d] Failed in IARM_Bus_RegisterCall with RPC: %s, so retrying [ %d ] times. \r\n", __FILE__, __FUNCTION__, __LINE__, IARM_BUS_TR69_COMMON_API_AgentParameterHandler, loop);
137 IARM_Result_t ret = IARM_RESULT_SUCCESS;
140 RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,
"%s: Owner's name cannot be null \r\n", __FUNCTION__);
148 char *paramValue = NULL;
153 if (HOSTIF_GET == requestInfo->
reqType)
157 requestInfo->
faultCode = fcInvalidParameterValue;