/********************************************************************** caller: owner of this object prototype: BOOL MemoryStatus_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL MemoryStatus_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "Total", TRUE)) { /* collect value */ *puLong = COSADmlGetMemoryStatus(ParamName); return TRUE; } if( AnscEqualString(ParamName, "Free", TRUE)) { /* collect value */ *puLong = COSADmlGetMemoryStatus(ParamName); return TRUE; } /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Device_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ); description: This function is called to set BOOL parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; BOOL bValue The updated BOOL value; return: TRUE if succeeded. **********************************************************************/ BOOL Device_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ) { PCOSA_DATAMODEL_UPNP pMyObject = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp; /* check the parameter name and set the corresponding value */ if( AnscEqualString(ParamName, "Enable", TRUE)) { /* save update to backup */ pMyObject->bUpnpDevEnable = bValue; CosaDmlUpnpDevEnable(NULL, pMyObject->bUpnpDevEnable); return TRUE; } if( AnscEqualString(ParamName, "UPnPIGD", TRUE)) { /* save update to backup */ pMyObject->bUpnpDevIgdEnable = bValue; CosaDmlUpnpDevEnableIgd(NULL, pMyObject->bUpnpDevIgdEnable); return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Device_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Device_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { PCOSA_DATAMODEL_UPNP pMyObject = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp; /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_AdvertisementPeriod", TRUE) ) { /* collect value */ CosaDmlUpnpDevGetAdvPeriod(NULL, &pMyObject->AdvertisementPeriod); *puLong = pMyObject->AdvertisementPeriod; return TRUE; } if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_TTL", TRUE) ) { /* collect value */ CosaDmlUpnpDevGetTTL(NULL, &pMyObject->TTL); *puLong = pMyObject->TTL; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Device_GetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL* pBool ); description: This function is called to retrieve Boolean parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; BOOL* pBool The buffer of returned boolean value; return: TRUE if succeeded. **********************************************************************/ BOOL Device_GetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL* pBool ) { PCOSA_DATAMODEL_UPNP pMyObject = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp; /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "Enable", TRUE)) { /* collect value */ *pBool = pMyObject->bUpnpDevEnable; return TRUE; } if( AnscEqualString(ParamName, "UPnPIGD", TRUE)) { /* collect value */ *pBool = pMyObject->bUpnpDevIgdEnable; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Time_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ); description: This function is called to set BOOL parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; BOOL bValue The updated BOOL value; return: TRUE if succeeded. **********************************************************************/ BOOL Time_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ) { PCOSA_DATAMODEL_TIME pMyObject = (PCOSA_DATAMODEL_TIME)g_pCosaBEManager->hTime; /* check the parameter name and set the corresponding value */ if( AnscEqualString(ParamName, "Enable", TRUE)) { /* save update to backup */ pMyObject->TimeCfg.bEnabled = bValue; return TRUE; } if( AnscEqualString(ParamName, "DaylightSaving", TRUE)) { /* save update to backup */ pMyObject->TimeCfg.bDaylightSaving = bValue; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Time_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Time_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { PCOSA_DATAMODEL_TIME pMyObject = (PCOSA_DATAMODEL_TIME)g_pCosaBEManager->hTime; /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "Status", TRUE)) { /* collect value */ CosaDmlTimeGetState(NULL, &pMyObject->TimeStatus, &pMyObject->CurrLocalTime); *puLong = pMyObject->TimeStatus; return TRUE; } /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "CityIndex", TRUE)) { /* collect value */ *puLong = pMyObject->TimeCfg.cityIndex; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Device_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ); description: This function is called to set ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG uValue The updated ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Device_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ) { PCOSA_DATAMODEL_UPNP pMyObject = (PCOSA_DATAMODEL_UPNP)g_pCosaBEManager->hUpnp; /* check the parameter name and set the corresponding value */ if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_AdvertisementPeriod", TRUE) ) { /* save update to backup */ pMyObject->AdvertisementPeriod = uValue; CosaDmlUpnpDevSetAdvPeriod(NULL, pMyObject->AdvertisementPeriod); return TRUE; } if( AnscEqualString(ParamName, "X_CISCO_COM_IGD_TTL", TRUE) ) { /* save update to backup */ pMyObject->TTL = uValue; CosaDmlUpnpDevSetTTL(NULL, pMyObject->TTL); return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: ANSC_STATUS CcspCwmpsoSaveCwmpEvent ( ANSC_HANDLE hThisObject ); description: This function is called to save Cwmp Events before reboot argument: ANSC_HANDLE hThisObject This handle is actually the pointer of this object itself. return: status of operation. **********************************************************************/ BOOL CcspCwmpIsUndiscardedEvent ( char* eventName ) { /* * According to WT151, the events "2 PERIODIC", "3 SCHEDULED", "7 TRANSFERCOMPLETE" * and the ones start with "M" won't be discarded */ if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_Peroidic, TRUE)) { return TRUE; } else if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_Scheduled, TRUE)) { return TRUE; } else if( AnscEqualString(eventName, CCSP_CWMP_INFORM_EVENT_NAME_TransferComplete, TRUE)) { return TRUE; } else if( eventName[0] == 'M') { return TRUE; } return FALSE; }
BOOL ANSC_EXPORT_API COSA_IsObjSupported ( char* pObjName ) { /* COSA XML file will be generated based on standard TR-xxx data model definition. * By default, all the objects are expected to supported in the libraray. * Realistically, we will have certain ones cannot be supported at the early stage of development. * We can rule them out by return FALSE even if they're defined in COSA XML file. */ #if 0 if( AnscEqualString(pObjName, "InternetGatewayDevice.UserInterface.",TRUE)) { /* all the objects/parameters under "UserInterface" will not be populated in Data Model Tree. */ return FALSE; } #endif #if (defined(_COSA_DRG_CNS_)) if(AnscEqualString(pObjName, "Device.DNS.Client.", TRUE)) { return FALSE; } #endif return TRUE; }
/********************************************************************** caller: owner of this object prototype: BOOL Host_GetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL* pBool ); description: This function is called to retrieve Boolean parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; BOOL* pBool The buffer of returned boolean value; return: TRUE if succeeded. **********************************************************************/ BOOL Host_GetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL* pBool ) { //printf("Host_GetParamBoolValue %p, %s\n", hInsContext, ParamName); PLmObjectHost pHost = (PLmObjectHost) hInsContext; int i = 0; for(; i<LM_HOST_NumBoolPara; i++){ if( AnscEqualString(ParamName, lmHosts.pHostBoolParaName[i], TRUE)) { /* collect value */ *pBool = pHost->bBoolParaValue[i]; return TRUE; } } if( AnscEqualString(ParamName, "X_CISCO_COM_TrueStaticIPClient", TRUE)) { /* collect value */ *pBool = pHost->bTrueStaticIPClient; return TRUE; } /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
BOOL IPv6rdIF_GetParamBoolValue( ANSC_HANDLE hInsContext, char *ParamName, BOOL *pBool) { PCOSA_CONTEXT_LINK_OBJECT pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext; PCOSA_DML_IPV6RD_IF pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext; if (!pLinkObject || !pEntry) return FALSE; CosaDml_IPv6rdGetEntry(NULL, pEntry->InstanceNumber, pEntry); if (AnscEqualString(ParamName, "Enable", TRUE)) { *pBool = pEntry->Enable; return TRUE; } else if (AnscEqualString(ParamName, "AllTrafficToBorderRelay", TRUE)) { *pBool = pEntry->AllTrafficToBorderRelay; return TRUE; } return FALSE; }
BOOL NetworkDevicesTraffic_Default_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ENTER \n", __FUNCTION__ )); if ( AnscEqualString(ParamName, "PollingPeriod", TRUE)) { *puLong = GetNDTPollingPeriodDefault(); CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong )); return TRUE; } if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) { *puLong = GetNDTReportingPeriodDefault(); CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong )); return TRUE; } if ( AnscEqualString(ParamName, "OverrideTTL", TRUE)) { *puLong = GetNDTOverrideTTLDefault(); CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, *puLong )); return TRUE; } CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : EXIT \n", __FUNCTION__ )); return FALSE; }
BOOL ConnectivityTest_GetParamIntValue ( ANSC_HANDLE hInsContext, char* ParamName, int* pInt ) { PCOSA_DATAMODEL_SELFHEAL pMyObject = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_RebootInterval", TRUE)) { /* collect value */ *pInt = pMyObject->pConnTest->RouterRebootInterval ; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_CurrentCount", TRUE)) { /* collect value */ char buf[16]={0}; syscfg_get( NULL, "todays_reset_count", buf, sizeof(buf)); if( buf[0] != '\0' ) { *pInt = atoi(buf); return TRUE; } } return FALSE; }
/********************************************************************** caller: owner of this object prototype BOOL ResourceMonitor_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL ResourceMonitor_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { PCOSA_DATAMODEL_SELFHEAL pMyObject = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; PCOSA_DML_RESOUCE_MONITOR pRescMonitor = pMyObject->pResMonitor; if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_UsageComputeWindow", TRUE)) { *puLong = pRescMonitor->MonIntervalTime; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AvgCPUThreshold", TRUE)) { *puLong = pRescMonitor->AvgCpuThreshold; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AvgMemoryThreshold", TRUE)) { *puLong = pRescMonitor->AvgMemThreshold; return TRUE; } return FALSE; }
BOOL IPv6rdIF_SetParamBoolValue( ANSC_HANDLE hInsContext, char *ParamName, BOOL bValue ) { PCOSA_CONTEXT_LINK_OBJECT pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext; PCOSA_DML_IPV6RD_IF pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext; if (!pLinkObject || !pEntry) return FALSE; if (AnscEqualString(ParamName, "Enable", TRUE)) { pEntry->Enable = bValue; return TRUE; } else if (AnscEqualString(ParamName, "AllTrafficToBorderRelay", TRUE)) { pEntry->AllTrafficToBorderRelay = bValue; return TRUE; } return FALSE; }
BOOL NetworkDevicesTraffic_Default_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ) { CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ENTER \n", __FUNCTION__ )); if ( AnscEqualString(ParamName, "PollingPeriod", TRUE)) { g_pReports->bNDTDefPollingPeriodChanged = true; g_pReports->uNDTPollingPeriodDefault = uValue; CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, uValue )); return TRUE; } if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) { g_pReports->bNDTDefReportingPeriodChanged = true; g_pReports->uNDTReportingPeriodDefault = uValue; CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : ParamName[%s] Value[%d] \n", __FUNCTION__ , ParamName, uValue )); return TRUE; } CcspLMLiteConsoleTrace(("RDK_LOG_DEBUG, LMLite %s : EXIT \n", __FUNCTION__ )); return FALSE; }
BOOL BwrmCpoMatchPath ( ANSC_HANDLE hThisObject, char* root_path, char* page_path ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PBWRM_COOKED_PAGE_OBJECT pMyObject = (PBWRM_COOKED_PAGE_OBJECT)hThisObject; if ( !root_path || !page_path ) { return FALSE; } else if ( !pMyObject->RootPath || !pMyObject->PagePath ) { return FALSE; } else if ( !AnscEqualString(root_path, pMyObject->RootPath, FALSE) ) { return FALSE; } else if ( !AnscEqualString(page_path, pMyObject->PagePath, FALSE) ) { return FALSE; } return TRUE; }
/********************************************************************** caller: owner of this object prototype: BOOL Hosts_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Hosts_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "X_CISCO_COM_ConnectedDeviceNumber", TRUE)) { /* collect value */ *puLong = CosaDmlHostsGetOnline(); //*puLong = HostsConnectedDeviceNum; return TRUE; } if( AnscEqualString(ParamName, "X_CISCO_COM_ConnectedWiFiNumber", TRUE)) { /* collect value */ *puLong = 0; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL SelfHeal_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ); description: This function is called to set ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG uValue The updated ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL SelfHeal_SetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG uValue ) { PCOSA_DATAMODEL_SELFHEAL pMyObject = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_MaxRebootCount", TRUE)) { if( pMyObject->MaxRebootCnt == uValue ) { return TRUE; } char buf[8]; memset(buf, 0, sizeof(buf)); snprintf(buf,sizeof(buf),"%d",uValue); if (syscfg_set(NULL, "max_reboot_count", buf) != 0) { CcspTraceWarning(("%s: syscfg_set failed for %s\n", __FUNCTION__, ParamName)); return FALSE; } if (syscfg_commit() != 0) { CcspTraceWarning(("%s: syscfg commit failed for %s\n", __FUNCTION__, ParamName)); return FALSE; } pMyObject->MaxRebootCnt = uValue; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_MaxResetCount", TRUE)) { if( pMyObject->MaxResetCnt == uValue ) { return TRUE; } char buf[8]; memset(buf, 0, sizeof(buf)); snprintf(buf,sizeof(buf),"%d",uValue); if (syscfg_set(NULL, "max_reset_count", buf) != 0) { CcspTraceWarning(("%s: syscfg_set failed for %s\n", __FUNCTION__, ParamName)); return FALSE; } if (syscfg_commit() != 0) { CcspTraceWarning(("%s: syscfg commit failed for %s\n", __FUNCTION__, ParamName)); return FALSE; } pMyObject->MaxResetCnt = uValue; return TRUE; } return FALSE; }
BOOL IPv6rdIF_SetParamStringValue( ANSC_HANDLE hInsContext, char *ParamName, char *pString ) { PCOSA_CONTEXT_LINK_OBJECT pLinkObject = (PCOSA_CONTEXT_LINK_OBJECT)hInsContext; PCOSA_DML_IPV6RD_IF pEntry = (PCOSA_DML_IPV6RD_IF)pLinkObject->hContext; char v4addr[16]; ULONG addlen; char tmp[128]; if (!pLinkObject || !pEntry) return FALSE; if (AnscEqualString(ParamName, "Alias", TRUE)) { AnscCopyString(pEntry->Alias, pString); return TRUE; } else if (AnscEqualString(ParamName, "BorderRelayIPv4Addresses", TRUE)) { AnscCopyString(pEntry->BorderRelayIPv4Addr, pString); return TRUE; } else if (AnscEqualString(ParamName, "SPIPv6Prefix", TRUE)) { AnscCopyString(pEntry->SPIPv6Prefix, pString); return TRUE; } else if (AnscEqualString(ParamName, "AddressSource", TRUE)) { if (!pString || _ansc_strlen(pString) == 0) { AnscCopyString(pEntry->AddressSource, ""); return TRUE; } addlen = sizeof(v4addr); _ansc_sprintf(tmp, "%sIPAddress", pString); if (g_GetParamValueString(g_pDslhDmlAgent, tmp, v4addr, &addlen) != 0) { CcspTraceWarning(("IPv6rdIF_SetParamStringValue: fail to get %s\n", tmp)); return FALSE; } AnscCopyString(pEntry->AddressSource, v4addr); /* AnscCopyString(pEntry->AddressSource, pString); */ return TRUE; } return FALSE; }
ANSC_STATUS CcspCwmpsoDiscardCwmpEvent ( ANSC_HANDLE hThisObject, int EventCode ) { PCCSP_CWMP_SESSION_OBJECT pMyObject = (PCCSP_CWMP_SESSION_OBJECT )hThisObject; PCCSP_CWMP_EVENT pCcspCwmpEvent = (PCCSP_CWMP_EVENT )NULL; ULONG i = 0; ULONG j = 0; /* * According to WT151, only the event "6 CONNECTIONREQUEST" must NOT retry delivery and it's a * single type event. * * Let's find and discard it; */ for( i = 0; i < pMyObject->EventCount; i ++) { pCcspCwmpEvent = (PCCSP_CWMP_EVENT)pMyObject->EventArray[i]; if ( ( EventCode == CCSP_CWMPSO_EVENTCODE_ConnectionRequest && AnscEqualString(pCcspCwmpEvent->EventCode, CCSP_CWMP_INFORM_EVENT_NAME_ConnectionRequest, TRUE) ) || ( EventCode == CCSP_CWMPSO_EVENTCODE_ValueChange && AnscEqualString(pCcspCwmpEvent->EventCode, CCSP_CWMP_INFORM_EVENT_NAME_ValueChange, TRUE) ) ) { if ( EventCode == CCSP_CWMPSO_EVENTCODE_ConnectionRequest ) { CcspTr069PaTraceWarning(("Before the session retry, the event '%s' was discarded.\n", CCSP_CWMP_INFORM_EVENT_NAME_ConnectionRequest)); } else { CcspTr069PaTraceWarning(("The event with code %d was discarded.\n", EventCode)); } CcspCwmpFreeEvent(pCcspCwmpEvent); pMyObject->EventArray[i] = NULL; /* move the reminder event back */ for( j = i; j < pMyObject->EventCount - 1; j ++) { pMyObject->EventArray[j] = pMyObject->EventArray[j + 1]; } pMyObject->EventArray[pMyObject->EventCount - 1] = NULL; pMyObject->EventCount --; } } return ANSC_STATUS_SUCCESS;; }
/********************************************************************** caller: owner of this object prototype: BOOL Host_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Host_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { //printf("Host_GetParamUlongValue %p, %s\n", hInsContext, ParamName); PLmObjectHost pHost = (PLmObjectHost) hInsContext; int i = 0; for(; i<LM_HOST_NumUlongPara; i++){ if( AnscEqualString(ParamName, COSA_HOSTS_Extension1_Name, TRUE)) { time_t currentTime = time(NULL); if(currentTime > pHost->activityChangeTime){ *puLong = currentTime - pHost->activityChangeTime; }else{ *puLong = 0; } return TRUE; } else if( AnscEqualString(ParamName, lmHosts.pHostUlongParaName[i], TRUE)) { /* collect value */ *puLong = pHost->ulUlongParaValue[i]; return TRUE; } } #if 0 /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "X_CISCO_COM_DeviceType", TRUE)) { /* collect value */ return TRUE; } if( AnscEqualString(ParamName, "X_CISCO_COM_NetworkInterface", TRUE)) { /* collect value */ return TRUE; } if( AnscEqualString(ParamName, "X_CISCO_COM_ConnectionStatus", TRUE)) { /* collect value */ return TRUE; } #endif /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
BOOL ConnectivityTest_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* pUlong ) { PCOSA_DATAMODEL_SELFHEAL pMyObject = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_PingInterval", TRUE)) { /* collect value */ *pUlong = pMyObject->pConnTest->PingInterval; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_NumPingsPerServer", TRUE)) { /* collect value */ *pUlong = pMyObject->pConnTest->PingCount; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_MinNumPingServer", TRUE)) { /* collect value */ *pUlong = pMyObject->pConnTest->MinPingServer; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_PingRespWaitTime", TRUE)) { /* collect value */ *pUlong = pMyObject->pConnTest->WaitTime; return TRUE; } if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_LastReboot", TRUE)) { /* collect value */ char buf[64]={0}; syscfg_get( NULL, "last_router_reboot_time", buf, sizeof(buf)); if( buf[0] != '\0' ) { *pUlong = atoi(buf); return TRUE; } } return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL Process_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL Process_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { PCOSA_PROCESS_ENTRY p_proc = (PCOSA_PROCESS_ENTRY)hInsContext; /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "PID", TRUE)) { /* collect value */ *puLong = p_proc->Pid; return TRUE; } if( AnscEqualString(ParamName, "Size", TRUE)) { /* collect value */ *puLong = p_proc->Size; return TRUE; } if( AnscEqualString(ParamName, "Priority", TRUE)) { /* collect value */ *puLong = p_proc->Priority; return TRUE; } if( AnscEqualString(ParamName, "CPUTime", TRUE)) { /* collect value */ *puLong = p_proc->CPUTime; return TRUE; } if( AnscEqualString(ParamName, "State", TRUE)) { /* collect value */ *puLong = p_proc->State; return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype: BOOL FileTransfer_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ); description: This function is called to retrieve ULONG parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; ULONG* puLong The buffer of returned ULONG value; return: TRUE if succeeded. **********************************************************************/ BOOL FileTransfer_GetParamUlongValue ( ANSC_HANDLE hInsContext, char* ParamName, ULONG* puLong ) { PCOSA_DATAMODEL_FILETRANSFER pMyObject = (PCOSA_DATAMODEL_FILETRANSFER)g_pCosaBEManager->hFileTransfer; PCOSA_DML_FILETRANSFER_CFG pCfg = (PCOSA_DML_FILETRANSFER_CFG)&pMyObject->Cfg; /* check the parameter name and return the corresponding value */ if( AnscEqualString(ParamName, "Server", TRUE)) { /* collect value */ *puLong = pCfg->Server; return TRUE; } if( AnscEqualString(ParamName, "Protocol", TRUE)) { /* collect value */ *puLong = pCfg->Protocol; return TRUE; } if( AnscEqualString(ParamName, "AuthType", TRUE)) { /* collect value */ *puLong = pCfg->AuthType; return TRUE; } if( AnscEqualString(ParamName, "Action", TRUE)) { /* collect value */ *puLong = pCfg->Action; return TRUE; } if( AnscEqualString(ParamName, "Status", TRUE)) { /* collect value */ *puLong = CosaDmlFileTransferGetStatus((ANSC_HANDLE)pMyObject); return TRUE; } /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
/********************************************************************** caller: owner of this object prototype BOOL ConnectivityTest_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ); description: This function is called to set BOOL parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; BOOL bValue The buffer of returned BOOL value; return: TRUE if succeeded. **********************************************************************/ BOOL ConnectivityTest_SetParamBoolValue ( ANSC_HANDLE hInsContext, char* ParamName, BOOL bValue ) { PCOSA_DATAMODEL_SELFHEAL pMyObject = (PCOSA_DATAMODEL_SELFHEAL)g_pCosaBEManager->hSelfHeal; if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_CorrectiveAction", TRUE)) { if ( pMyObject->pConnTest->CorrectiveAction == bValue ) { return TRUE; } CcspTraceWarning(("%s Changing X_RDKCENTRAL-COM_CorrectiveAction state to %d \n",__FUNCTION__,bValue)); /* save update to backup */ char buf[128]; memset(buf, 0, sizeof(buf)); snprintf(buf,sizeof(buf),"%s",bValue ? "true" : "false"); if (syscfg_set(NULL, "ConnTest_CorrectiveAction", buf) != 0) { CcspTraceWarning(("%s syscfg set failed for ConnTest_CorrectiveAction\n",__FUNCTION__)); return FALSE; } if (syscfg_commit() != 0) { CcspTraceWarning(("%s syscfg commit failed for ConnTest_CorrectiveAction\n",__FUNCTION__)); return FALSE; } pMyObject->pConnTest->CorrectiveAction = bValue; return TRUE; } return FALSE; }
ANSC_HANDLE AnscXmlDomNodeGetChildByName ( ANSC_HANDLE hThisObject, char* name ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PANSC_XML_DOM_NODE_OBJECT pXmlNode = (PANSC_XML_DOM_NODE_OBJECT)hThisObject; PANSC_XML_DOM_NODE_OBJECT pChildNode = NULL; while ( pChildNode = (PANSC_XML_DOM_NODE_OBJECT)AnscXmlDomNodeGetNextChild ( (ANSC_HANDLE)pXmlNode, (ANSC_HANDLE)pChildNode ) ) { if ( AnscEqualString(AnscXmlDomNodeGetName((ANSC_HANDLE)pChildNode), name, FALSE) ) { return (ANSC_HANDLE)pChildNode; } } return (ANSC_HANDLE)NULL; }
/********************************************************************** caller: owner of this object prototype: BOOL Host_SetParamStringValue ( ANSC_HANDLE hInsContext, char* ParamName, char* pString ); description: This function is called to set string parameter value; argument: ANSC_HANDLE hInsContext, The instance handle; char* ParamName, The parameter name; char* pString The updated string value; return: TRUE if succeeded. **********************************************************************/ BOOL Host_SetParamStringValue ( ANSC_HANDLE hInsContext, char* ParamName, char* pString ) { /* check the parameter name and set the corresponding value */ PLmObjectHost pHost = (PLmObjectHost) hInsContext; if( AnscEqualString(ParamName, "Comments", TRUE)) { /* save update to backup */ if( pHost->pStringParaValue[LM_HOST_Comments] ) { LanManager_Free(pHost->pStringParaValue[LM_HOST_Comments]); } pHost->pStringParaValue[LM_HOST_Comments] = LanManager_CloneString(pString); return TRUE; } /* AnscTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ return FALSE; }
ANSC_HANDLE DslhObjroGetVarRecord ( ANSC_HANDLE hThisObject, char* name ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PDSLH_OBJ_RECORD_OBJECT pMyObject = (PDSLH_OBJ_RECORD_OBJECT)hThisObject; PDSLH_OBJ_ENTITY_OBJECT pObjEntity = (PDSLH_OBJ_ENTITY_OBJECT)pMyObject->hDslhObjEntity; PDSLH_VAR_RECORD_OBJECT pChildVarRecord = (PDSLH_VAR_RECORD_OBJECT)NULL; PSINGLE_LINK_ENTRY pSLinkEntry = (PSINGLE_LINK_ENTRY )NULL; pSLinkEntry = AnscQueueGetFirstEntry(&pMyObject->VarroTable); while ( pSLinkEntry ) { pChildVarRecord = ACCESS_DSLH_VAR_RECORD_OBJECT(pSLinkEntry); pSLinkEntry = AnscQueueGetNextEntry(pSLinkEntry); if ( AnscEqualString ( pChildVarRecord->GetLastName((ANSC_HANDLE)pChildVarRecord), name, TRUE ) ) { return (ANSC_HANDLE)pChildVarRecord; } } return (ANSC_HANDLE)NULL; }
ANSC_HANDLE HttpFcoGetFormElement ( ANSC_HANDLE hThisObject, char* name ) { ANSC_STATUS returnStatus = ANSC_STATUS_SUCCESS; PHTTP_FORM_CONTENT_OBJECT pMyObject = (PHTTP_FORM_CONTENT_OBJECT)hThisObject; PHTTP_HFP_INTERFACE pHfpIf = (PHTTP_HFP_INTERFACE )pMyObject->hHfpIf; PHTTP_FORM_ELEMENT pFormElement = NULL; PSINGLE_LINK_ENTRY pSLinkEntry = NULL; ULONG ulHashIndex = AnscHashString(name, AnscSizeOfString(name), HTTP_FCO_FEO_TABLE_SIZE); AnscAcquireLock(&pMyObject->FeoTableLock); pSLinkEntry = AnscQueueGetFirstEntry(&pMyObject->FeoTable[ulHashIndex]); while ( pSLinkEntry ) { pFormElement = ACCESS_HTTP_FORM_ELEMENT(pSLinkEntry); pSLinkEntry = AnscQueueGetNextEntry(pSLinkEntry); if ( AnscEqualString(pFormElement->Name, name, TRUE) ) { AnscReleaseLock(&pMyObject->FeoTableLock); return (ANSC_HANDLE)pFormElement; } } AnscReleaseLock(&pMyObject->FeoTableLock); return (ANSC_HANDLE)NULL; }