From 7a98a7c27f9a1bd082e9a8dc6eb8508db015fe9c Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Wed, 2 Apr 2025 14:44:35 -0700 Subject: [PATCH 1/9] RDKCOM-5335: RDKBDEV-3195 update AnscEqualString() -> strcmp() Reason for change: The libc strcmp() function is likely to be much more optimized than the legacy AnscEqualString(). Test Procedure: Sanity Risks: None. Signed-off-by: Andre McCurdy (cherry picked from commit 8874e6ed7747374e7d48431204224f968226ceba) --- source/dml/tr_181/ml/cosa_apis_util.c | 34 +- source/dml/tr_181/ml/cosa_harvester_dml.c | 58 +- source/dml/tr_181/ml/cosa_logging_dml.c | 4 +- source/dml/tr_181/ml/cosa_wifi_dml.c | 1234 ++++++++++----------- source/dml/tr_181/ml/plugin_main.c | 4 +- source/dml/tr_181/sbapi/cosa_wifi_apis.c | 26 +- 6 files changed, 679 insertions(+), 681 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_apis_util.c b/source/dml/tr_181/ml/cosa_apis_util.c index a3c5f31c5..7b3ac1cd6 100755 --- a/source/dml/tr_181/ml/cosa_apis_util.c +++ b/source/dml/tr_181/ml/cosa_apis_util.c @@ -266,7 +266,7 @@ CosaUtilGetLowerLayers { if ( pTableStringToken->Name ) { - if ( AnscEqualString(pTableStringToken->Name, "Device.Ethernet.Interface.", TRUE ) ) + if (strcmp(pTableStringToken->Name, "Device.Ethernet.Interface.") == 0) { ulNumOfEntries = CosaGetParamValueUlong("Device.Ethernet.InterfaceNumberOfEntries"); @@ -292,7 +292,7 @@ CosaUtilGetLowerLayers } } } - else if ( AnscEqualString(pTableStringToken->Name, "Device.IP.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.IP.Interface.") == 0) { ulNumOfEntries = CosaGetParamValueUlong("Device.IP.InterfaceNumberOfEntries"); for ( i = 0 ; i < ulNumOfEntries; i++ ) @@ -317,16 +317,16 @@ CosaUtilGetLowerLayers } } } - else if ( AnscEqualString(pTableStringToken->Name, "Device.USB.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.USB.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.HPNA.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.HPNA.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.DSL.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.DSL.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.WiFi.Radio.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.WiFi.Radio.") == 0) { ulNumOfEntries = CosaGetParamValueUlong("Device.WiFi.RadioNumberOfEntries"); @@ -352,22 +352,22 @@ CosaUtilGetLowerLayers } } } - else if ( AnscEqualString(pTableStringToken->Name, "Device.HomePlug.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.HomePlug.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.MoCA.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.MoCA.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.UPA.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.UPA.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.ATM.Link.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.ATM.Link.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.PTM.Link.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.PTM.Link.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.Ethernet.Link.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.Ethernet.Link.") == 0) { ulNumOfEntries = CosaGetParamValueUlong("Device.Ethernet.LinkNumberOfEntries"); @@ -393,13 +393,13 @@ CosaUtilGetLowerLayers } } } - else if ( AnscEqualString(pTableStringToken->Name, "Device.Ethernet.VLANTermination.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.Ethernet.VLANTermination.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.WiFi.SSID.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.WiFi.SSID.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.Bridging.Bridge.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.Bridging.Bridge.") == 0) { ulNumOfEntries = CosaGetParamValueUlong("Device.Bridging.BridgeNumberOfEntries"); CcspTraceInfo(("----------CosaUtilGetLowerLayers, bridgenum:%ld\n", ulNumOfEntries)); @@ -434,10 +434,10 @@ CosaUtilGetLowerLayers } } } - else if ( AnscEqualString(pTableStringToken->Name, "Device.PPP.Interface.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.PPP.Interface.") == 0) { } - else if ( AnscEqualString(pTableStringToken->Name, "Device.DSL.Channel.", TRUE ) ) + else if (strcmp(pTableStringToken->Name, "Device.DSL.Channel.") == 0) { } diff --git a/source/dml/tr_181/ml/cosa_harvester_dml.c b/source/dml/tr_181/ml/cosa_harvester_dml.c index 0ac142bd2..053b5663f 100644 --- a/source/dml/tr_181/ml/cosa_harvester_dml.c +++ b/source/dml/tr_181/ml/cosa_harvester_dml.c @@ -140,7 +140,7 @@ WifiClient_GetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if ( AnscEqualString(ParamName, "Enabled", TRUE)) + if (strcmp(ParamName, "Enabled") == 0) { *pBool = pcfg->b_inst_client_enabled; return TRUE; @@ -164,7 +164,7 @@ WifiClient_GetParamUlongValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) + if (strcmp(ParamName, "ReportingPeriod") == 0) { *puLong = pcfg->u_inst_client_reporting_period; return TRUE; @@ -190,19 +190,19 @@ WifiClient_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "MacAddress", TRUE)) + if (strcmp(ParamName, "MacAddress") == 0) { strncpy(pValue, pcfg->mac_address, *pUlSize); return 0; } - if( AnscEqualString(ParamName, "Schema", TRUE)) + if (strcmp(ParamName, "Schema") == 0) { AnscCopyString(pValue, "WifiSingleClient.avsc"); return 0; } - if( AnscEqualString(ParamName, "SchemaID", TRUE)) + if (strcmp(ParamName, "SchemaID") == 0) { unsigned int bufsize = strlen(instSchemaIdBuffer);; if(!bufsize) @@ -249,7 +249,7 @@ WifiClient_SetParamBoolValue } /* check the parameter name and set the corresponding value */ - if ( AnscEqualString(ParamName, "Enabled", TRUE)) + if (strcmp(ParamName, "Enabled") == 0) { if((bValue == true) && (pcfg->u_inst_client_reporting_period > pcfg->u_inst_client_def_override_ttl)) @@ -281,7 +281,7 @@ WifiClient_SetParamUlongValue return FALSE; } - if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) + if (strcmp(ParamName, "ReportingPeriod") == 0) { if (validate_def_reporting_period(uValue)) { pcfg->u_inst_client_reporting_period = uValue; @@ -312,7 +312,7 @@ WifiClient_SetParamStringValue return FALSE; } - if( AnscEqualString(ParamName, "MacAddress", TRUE)) + if (strcmp(ParamName, "MacAddress") == 0) { if (validate_inst_client_mac(pValue)){ strncpy(pcfg->mac_address, pValue, sizeof(pcfg->mac_address)-1); @@ -413,14 +413,14 @@ WifiClient_Default_GetParamUlongValue return FALSE; } - if ( AnscEqualString(ParamName, "OverrideTTL", TRUE)) + if (strcmp(ParamName, "OverrideTTL") == 0) { //*puLong = get_inst_override_ttl(); *puLong = pcfg->u_inst_client_def_override_ttl; return TRUE; } - if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) + if (strcmp(ParamName, "ReportingPeriod") == 0) { *puLong = pcfg->u_inst_client_def_reporting_period; return TRUE; @@ -446,13 +446,13 @@ WifiClient_Default_SetParamUlongValue return FALSE; } - if ( AnscEqualString(ParamName, "ReportingPeriod", TRUE)) + if (strcmp(ParamName, "ReportingPeriod") == 0) { pcfg->u_inst_client_def_reporting_period = uValue; return TRUE; } - if ( AnscEqualString(ParamName, "OverrideTTL", TRUE)) + if (strcmp(ParamName, "OverrideTTL") == 0) { pcfg->u_inst_client_def_override_ttl = uValue; return TRUE; @@ -554,7 +554,7 @@ WifiClient_ActiveMeasurements_GetParamBoolValue return FALSE; } - if ( AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { *pBool = pcfg->ActiveMsmtEnable; return TRUE; } @@ -576,17 +576,17 @@ WifiClient_ActiveMeasurements_GetParamUlongValue return FALSE; } - if ( AnscEqualString(ParamName, "PacketSize", TRUE)) { + if (strcmp(ParamName, "PacketSize") == 0) { *puLong = pcfg->ActiveMsmtPktSize; return TRUE; } - if ( AnscEqualString(ParamName, "SampleDuration", TRUE)) { + if (strcmp(ParamName, "SampleDuration") == 0) { *puLong = pcfg->ActiveMsmtSampleDuration; return TRUE; } - if ( AnscEqualString(ParamName, "NumberOfSamples", TRUE)) { + if (strcmp(ParamName, "NumberOfSamples") == 0) { *puLong = pcfg->ActiveMsmtNumberOfSamples; return TRUE; } @@ -626,7 +626,7 @@ WifiClient_ActiveMeasurements_SetParamBoolValue } } - if ( AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { pcfg->ActiveMsmtEnable = bValue; push_blaster_config_dml_to_ctrl_queue(); return TRUE; @@ -651,7 +651,7 @@ WifiClient_ActiveMeasurements_SetParamUlongValue return FALSE; } - if ( AnscEqualString(ParamName, "PacketSize", TRUE)) { + if (strcmp(ParamName, "PacketSize") == 0) { if((uValue < MIN_ACTIVE_MSMT_PKT_SIZE) ||(uValue > MAX_ACTIVE_MSMT_PKT_SIZE)) { return FALSE; } @@ -659,7 +659,7 @@ WifiClient_ActiveMeasurements_SetParamUlongValue return TRUE; } - if ( AnscEqualString(ParamName, "SampleDuration", TRUE)) { + if (strcmp(ParamName, "SampleDuration") == 0) { if((uValue < MIN_ACTIVE_MSMT_SAMPLE_DURATION) ||(uValue > MAX_ACTIVE_MSMT_SAMPLE_DURATION)) { return FALSE; } @@ -667,7 +667,7 @@ WifiClient_ActiveMeasurements_SetParamUlongValue return TRUE; } - if ( AnscEqualString(ParamName, "NumberOfSamples", TRUE)) { + if (strcmp(ParamName, "NumberOfSamples") == 0) { if((uValue < MIN_ACTIVE_MSMT_SAMPLE_COUNT) ||(uValue > MAX_ACTIVE_MSMT_SAMPLE_COUNT)){ return FALSE; } @@ -732,7 +732,7 @@ ActiveMeasurements_Plan_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if ( AnscEqualString(ParamName, "PlanID", TRUE)){ + if (strcmp(ParamName, "PlanID") == 0){ strcpy(pValue,(char*)pcfg->PlanId); return 0; } @@ -754,8 +754,8 @@ ActiveMeasurements_Plan_SetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if ( AnscEqualString(ParamName, "PlanID", TRUE)) { - if (AnscEqualString(pValue, (char*)pcfg->PlanId, FALSE)) { + if (strcmp(ParamName, "PlanID") == 0) { + if (strcasecmp(pValue, (char*)pcfg->PlanId) == 0) { AnscTraceWarning(("%s : Plan ID is same\n", __func__)); return TRUE; } @@ -873,7 +873,7 @@ ActiveMeasurement_Step_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if ( AnscEqualString(ParamName, "StepID", TRUE)) { + if (strcmp(ParamName, "StepID") == 0) { /* collect value */ *puLong = pcfg->Step[StepIns].StepId; return TRUE; @@ -905,12 +905,12 @@ ActiveMeasurement_Step_GetParamStringValue return FALSE; } - if ( AnscEqualString(ParamName, "SourceMac", TRUE)) { + if (strcmp(ParamName, "SourceMac") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].SrcMac ,StepIns); strcpy(pValue, (char*)pcfg->Step[StepIns].SrcMac); return 0; } - if ( AnscEqualString(ParamName, "DestMac", TRUE)) { + if (strcmp(ParamName, "DestMac") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].DestMac ,StepIns); strcpy(pValue, (char*) pcfg->Step[StepIns].DestMac); return 0; @@ -946,7 +946,7 @@ ActiveMeasurement_Step_SetParamUlongValue } /* check the parameter name and return the corresponding value */ - if ( AnscEqualString(ParamName, "StepID", TRUE)) { + if (strcmp(ParamName, "StepID") == 0) { pcfg->Step[StepIns].StepId = (unsigned int)uValue; return TRUE; } @@ -981,13 +981,13 @@ ActiveMeasurement_Step_SetParamStringValue return FALSE; } - if (AnscEqualString(ParamName, "SourceMac", TRUE)) { + if (strcmp(ParamName, "SourceMac") == 0) { strcpy( (char*)pcfg->Step[StepIns].SrcMac,pValue); wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].SrcMac ,StepIns); return TRUE; } - if (AnscEqualString(ParamName, "DestMac", TRUE)) { + if (strcmp(ParamName, "DestMac") == 0) { strcpy((char*) pcfg->Step[StepIns].DestMac,pValue); wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].DestMac ,StepIns); return TRUE; diff --git a/source/dml/tr_181/ml/cosa_logging_dml.c b/source/dml/tr_181/ml/cosa_logging_dml.c index a21cbf0b4..b4e475955 100644 --- a/source/dml/tr_181/ml/cosa_logging_dml.c +++ b/source/dml/tr_181/ml/cosa_logging_dml.c @@ -158,7 +158,7 @@ Logging_GetParamBoolValue { UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "FlushAllLogs", TRUE)) + if (strcmp(ParamName, "FlushAllLogs") == 0) { /* collect value */ *pBool = FALSE; @@ -212,7 +212,7 @@ Logging_SetParamBoolValue UNREFERENCED_PARAMETER(bValue); /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "FlushAllLogs", TRUE)) + if (strcmp(ParamName, "FlushAllLogs") == 0) { /* save update to backup */ CosaDmlLogging_FlushAllLogs(); diff --git a/source/dml/tr_181/ml/cosa_wifi_dml.c b/source/dml/tr_181/ml/cosa_wifi_dml.c index 92534ccf7..25328626b 100755 --- a/source/dml/tr_181/ml/cosa_wifi_dml.c +++ b/source/dml/tr_181/ml/cosa_wifi_dml.c @@ -256,35 +256,35 @@ WiFi_GetParamBoolValue } wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); - if (AnscEqualString(ParamName, "ApplyRadioSettings", TRUE)) + if (strcmp(ParamName, "ApplyRadioSettings") == 0) { /* always return false when get */ *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "ApplyAccessPointSettings", TRUE)) + if (strcmp(ParamName, "ApplyAccessPointSettings") == 0) { /* always return false when get */ *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_FactoryReset", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FactoryReset") == 0) { /* always return false when get */ *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_EnableTelnet", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EnableTelnet") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ResetRadios", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ResetRadios") == 0) { /* always return false when get */ *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_WiFiHost_Sync", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_WiFiHost_Sync") == 0) { *pBool = FALSE; @@ -292,42 +292,42 @@ WiFi_GetParamBoolValue } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_PreferPrivate", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_PreferPrivate") == 0) { *pBool = pcfg->prefer_private; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_RapidReconnectIndicationEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_RapidReconnectIndicationEnable") == 0) { *pBool = pcfg->rapid_reconnect_enable; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_vAPStatsEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_vAPStatsEnable") == 0) { *pBool = pcfg->vap_stats_feature; return TRUE; } - if (AnscEqualString(ParamName, "FeatureMFPConfig", TRUE)) + if (strcmp(ParamName, "FeatureMFPConfig") == 0) { *pBool = pcfg->mfp_config_feature; return TRUE; } - if (AnscEqualString(ParamName, "TxOverflowSelfheal", TRUE)) + if (strcmp(ParamName, "TxOverflowSelfheal") == 0) { *pBool = pcfg->tx_overflow_selfheal; return TRUE; } - if (AnscEqualString(ParamName, "X_RDK-CENTRAL_COM_ForceDisable", TRUE)) + if (strcmp(ParamName, "X_RDK-CENTRAL_COM_ForceDisable") == 0) { *pBool = pcfg->force_disable_radio_feature; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_EnableRadiusGreyList", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_EnableRadiusGreyList") == 0) { #if defined (FEATURE_SUPPORT_RADIUSGREYLIST) *pBool = rfc_pcfg->radiusgreylist_rfc; @@ -336,45 +336,45 @@ WiFi_GetParamBoolValue #endif return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_EnableHostapdAuthenticator", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_EnableHostapdAuthenticator") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "DFSatBootUp", TRUE)) + if (strcmp(ParamName, "DFSatBootUp") == 0) { *pBool = rfc_pcfg->dfsatbootup_rfc; return TRUE; } - if (AnscEqualString(ParamName, "2G80211axEnable", TRUE)) + if (strcmp(ParamName, "2G80211axEnable") == 0) { *pBool = rfc_pcfg->twoG80211axEnable_rfc; return TRUE; } - if (AnscEqualString(ParamName, "Levl", TRUE)) + if (strcmp(ParamName, "Levl") == 0) { *pBool = rfc_pcfg->levl_enabled_rfc; return TRUE; } - if (AnscEqualString(ParamName, "DFS", TRUE)) + if (strcmp(ParamName, "DFS") == 0) { *pBool = rfc_pcfg->dfs_rfc; return TRUE; } - if (AnscEqualString(ParamName, "WPA3_Personal_Transition", TRUE)) + if (strcmp(ParamName, "WPA3_Personal_Transition") == 0) { *pBool = rfc_pcfg->wpa3_rfc; return TRUE; } - if (AnscEqualString(ParamName, "WiFi-Passpoint", TRUE)) + if (strcmp(ParamName, "WiFi-Passpoint") == 0) { *pBool = rfc_pcfg->wifipasspoint_rfc; return TRUE; } - if (AnscEqualString(ParamName, "WiFi-OffChannelScan-APP", TRUE)) { + if (strcmp(ParamName, "WiFi-OffChannelScan-APP") == 0) { #if defined (FEATURE_OFF_CHANNEL_SCAN_5G) *pBool = rfc_pcfg->wifi_offchannelscan_app_rfc; #else //FEATURE_OFF_CHANNEL_SCAN_5G @@ -382,18 +382,18 @@ WiFi_GetParamBoolValue #endif //FEATURE_OFF_CHANNEL_SCAN_5G return TRUE; } - if (AnscEqualString(ParamName, "WiFi-OffChannelScan", TRUE)) + if (strcmp(ParamName, "WiFi-OffChannelScan") == 0) { *pBool = rfc_pcfg->wifi_offchannelscan_sm_rfc; return TRUE; } - if (AnscEqualString(ParamName, "WiFi-Interworking", TRUE)) + if (strcmp(ParamName, "WiFi-Interworking") == 0) { *pBool = rfc_pcfg->wifiinterworking_rfc; return TRUE; } - if (AnscEqualString(ParamName, "Log_Upload", TRUE)) + if (strcmp(ParamName, "Log_Upload") == 0) { fp = popen("crontab -l | grep -c copy_wifi_logs.sh","r"); while(fgets(path,sizeof(path) , fp) != NULL) { @@ -410,7 +410,7 @@ WiFi_GetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "WiFiStuckDetect", TRUE)) + if (strcmp(ParamName, "WiFiStuckDetect") == 0) { if ((access(WIFI_STUCK_DETECT_FILE_NAME, R_OK)) != 0) { *pBool = FALSE; @@ -420,13 +420,12 @@ WiFi_GetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "Tcm", TRUE)) + if (strcmp(ParamName, "Tcm") == 0) { *pBool = rfc_pcfg->tcm_enabled_rfc; return TRUE; } - - if(AnscEqualString(ParamName, "WPA3_Personal_Compatibility", TRUE)) + if (strcmp(ParamName, "WPA3_Personal_Compatibility") == 0) { *pBool = rfc_pcfg->wpa3_compatibility_enable; return TRUE; @@ -482,7 +481,7 @@ WiFi_GetParamIntValue return FALSE; } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_GoodRssiThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_GoodRssiThreshold") == 0) { /* collect value */ *pInt = pcfg->good_rssi_threshold; @@ -490,7 +489,7 @@ WiFi_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocCountThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocCountThreshold") == 0) { /* collect value */ *pInt = pcfg->assoc_count_threshold; @@ -498,7 +497,7 @@ WiFi_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocMonitorDuration", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocMonitorDuration") == 0) { /* collect value */ *pInt = pcfg->assoc_monitor_duration; @@ -506,21 +505,21 @@ WiFi_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocGateTime", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocGateTime") == 0) { /* collect value */ *pInt = pcfg->assoc_gate_time; return TRUE; } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "WHIX_LogInterval", TRUE)) + if (strcmp(ParamName, "WHIX_LogInterval") == 0) { /* collect value */ *pInt = pcfg->whix_log_interval; //seconds return TRUE; } - if (AnscEqualString(ParamName, "WHIX_ChUtility_LogInterval", TRUE)) + if (strcmp(ParamName, "WHIX_ChUtility_LogInterval") == 0) { /* collect value */ *pInt = pcfg->whix_chutility_loginterval; //seconds @@ -572,7 +571,7 @@ WiFi_GetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Status", TRUE)) + if (strcmp(ParamName, "Status") == 0) { UINT numOfRadios = get_num_radio_dml(); *puLong = numOfRadios; @@ -639,29 +638,29 @@ WiFi_GetParamStringValue return FALSE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_RadioPower", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RadioPower") == 0) { snprintf(pValue,*pUlSize,"%s",gcfg->RadioPower); return 0; } - if( AnscEqualString(ParamName, "X_RDK_RadioData", TRUE)) + if (strcmp(ParamName, "X_RDK_RadioData") == 0) { CosaDmlWiFi_getWebConfig(); return 0; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ConfigFileBase64", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ConfigFileBase64") == 0) { return 0; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_GASConfiguration", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_GASConfiguration") == 0) { WiFi_GetGasConfig(pValue); return 0; } - if (AnscEqualString(ParamName, "Log_Enable", TRUE)) + if (strcmp(ParamName, "Log_Enable") == 0) { char dest[512] = {0}; if(access("/nvram/wifiDbDbg",F_OK) == 0) @@ -833,7 +832,7 @@ WiFi_SetParamBoolValue return FALSE; } wifi_radio_operationParam_t *wifiRadioOperParam = NULL; - if (AnscEqualString(ParamName, "ApplyRadioSettings", TRUE )) + if (strcmp(ParamName, "ApplyRadioSettings") == 0) { if (bValue == TRUE){ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d ApplyRadioSettings push to queue \n",__func__, __LINE__); @@ -852,7 +851,7 @@ WiFi_SetParamBoolValue } return TRUE; } - if (AnscEqualString(ParamName, "ApplyAccessPointSettings", TRUE )) + if (strcmp(ParamName, "ApplyAccessPointSettings") == 0) { if (bValue == TRUE){ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d ApplyAccessPointSettings push to queue \n",__func__, __LINE__); @@ -866,21 +865,21 @@ WiFi_SetParamBoolValue } return TRUE; } - if(AnscEqualString(ParamName, "X_CISCO_COM_FactoryReset", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FactoryReset") == 0) { if (wifi_factory_reset(true) != TRUE) return FALSE; return TRUE; } - if(AnscEqualString(ParamName, "X_CISCO_COM_EnableTelnet", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EnableTelnet") == 0) { if ( CosaDmlWiFi_EnableTelnet(bValue) == ANSC_STATUS_SUCCESS ) { } return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ResetRadios", TRUE)) { + if (strcmp(ParamName, "X_CISCO_COM_ResetRadios") == 0) { wifi_util_info_print(WIFI_DMCLI, "%s:%d Restarting Radios & VAPs \n", __func__, __LINE__); is_radio_config_changed = TRUE; // Force apply all Radio configuration g_update_wifi_region = TRUE; // Force apply all Global configuration @@ -919,7 +918,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_WiFiHost_Sync", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_WiFiHost_Sync") == 0) { if (push_wifi_host_sync_to_ctrl_queue() == RETURN_ERR) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Failed to push host sync to ctrl queue\n", __func__, __LINE__); @@ -928,7 +927,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "Managed_WiFi_Enabled", TRUE)) + if (strcmp(ParamName, "Managed_WiFi_Enabled") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d push_managed_wifi_disable_to_ctrl_queue to ctrl queue\n", __func__, __LINE__); if (!bValue) { @@ -943,7 +942,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_PreferPrivate", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_PreferPrivate") == 0) { if(global_wifi_config->global_parameters.prefer_private == bValue) { @@ -960,7 +959,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_RapidReconnectIndicationEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_RapidReconnectIndicationEnable") == 0) { if(global_wifi_config->global_parameters.rapid_reconnect_enable == bValue) { @@ -972,7 +971,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_vAPStatsEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_vAPStatsEnable") == 0) { if(global_wifi_config->global_parameters.vap_stats_feature == bValue) { @@ -983,7 +982,7 @@ WiFi_SetParamBoolValue push_global_config_dml_cache_to_one_wifidb(); return TRUE; } - if (AnscEqualString(ParamName, "FeatureMFPConfig", TRUE)) + if (strcmp(ParamName, "FeatureMFPConfig") == 0) { if(global_wifi_config->global_parameters.mfp_config_feature == bValue) { @@ -995,7 +994,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "TxOverflowSelfheal", TRUE)) + if (strcmp(ParamName, "TxOverflowSelfheal") == 0) { if(global_wifi_config->global_parameters.tx_overflow_selfheal == bValue) { @@ -1007,7 +1006,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDK-CENTRAL_COM_ForceDisable", TRUE)) + if (strcmp(ParamName, "X_RDK-CENTRAL_COM_ForceDisable") == 0) { if(global_wifi_config->global_parameters.force_disable_radio_feature == bValue) { @@ -1060,7 +1059,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_EnableRadiusGreyList", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_EnableRadiusGreyList") == 0) { #if defined (FEATURE_SUPPORT_RADIUSGREYLIST) if(bValue != rfc_pcfg->radiusgreylist_rfc) { @@ -1080,12 +1079,12 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_EnableHostapdAuthenticator", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_EnableHostapdAuthenticator") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "DFSatBootUp", TRUE)) + if (strcmp(ParamName, "DFSatBootUp") == 0) { if(bValue != rfc_pcfg->dfsatbootup_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_dfs_atbootup_rfc); @@ -1093,28 +1092,28 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "DFS", TRUE)) + if (strcmp(ParamName, "DFS") == 0) { if(bValue != rfc_pcfg->dfs_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_dfs_rfc); } return TRUE; } - if (AnscEqualString(ParamName, "WPA3_Personal_Transition", TRUE)) + if (strcmp(ParamName, "WPA3_Personal_Transition") == 0) { if(bValue != rfc_pcfg->wpa3_rfc){ push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_wpa3_rfc); } return TRUE; } - if (AnscEqualString(ParamName, "WiFi-Passpoint", TRUE)) + if (strcmp(ParamName, "WiFi-Passpoint") == 0) { if(bValue != rfc_pcfg->wifipasspoint_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_wifi_passpoint_rfc); } return TRUE; } - if (AnscEqualString(ParamName, "WiFi-OffChannelScan-APP", TRUE)) { + if (strcmp(ParamName, "WiFi-OffChannelScan-APP") == 0) { #if defined(FEATURE_OFF_CHANNEL_SCAN_5G) if(bValue != rfc_pcfg->wifi_offchannelscan_app_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue, wifi_event_type_wifi_offchannelscan_app_rfc); @@ -1124,20 +1123,20 @@ WiFi_SetParamBoolValue return FALSE; #endif //FEATURE_OFF_CHANNEL_SCAN_5G } - if (AnscEqualString(ParamName, "WiFi-OffChannelScan", TRUE)) { + if (strcmp(ParamName, "WiFi-OffChannelScan") == 0) { if(bValue != rfc_pcfg->wifi_offchannelscan_sm_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_wifi_offchannelscan_sm_rfc); } return TRUE; } - if (AnscEqualString(ParamName, "WiFi-Interworking", TRUE)) + if (strcmp(ParamName, "WiFi-Interworking") == 0) { if(bValue != rfc_pcfg->wifiinterworking_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue,wifi_event_type_wifi_interworking_rfc); } return TRUE; } - if (AnscEqualString(ParamName, "2G80211axEnable", TRUE)) + if (strcmp(ParamName, "2G80211axEnable") == 0) { #ifndef ALWAYS_ENABLE_AX_2G if(bValue != rfc_pcfg->twoG80211axEnable_rfc) { @@ -1147,7 +1146,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "Levl", TRUE)) + if (strcmp(ParamName, "Levl") == 0) { if(bValue != rfc_pcfg->levl_enabled_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue, wifi_event_type_levl_rfc); @@ -1156,7 +1155,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "Log_Upload", TRUE)) + if (strcmp(ParamName, "Log_Upload") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Log_upload set\n", __FUNCTION__,__LINE__); if (bValue) { @@ -1169,7 +1168,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "WiFiStuckDetect", TRUE)) + if (strcmp(ParamName, "WiFiStuckDetect") == 0) { if (bValue) { FILE *fp = fopen(WIFI_STUCK_DETECT_FILE_NAME, "a+"); @@ -1182,7 +1181,7 @@ WiFi_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "Tcm", TRUE)) + if (strcmp(ParamName, "Tcm") == 0) { if(bValue != rfc_pcfg->tcm_enabled_rfc) { push_rfc_dml_cache_to_one_wifidb(bValue, wifi_event_type_tcm_rfc); @@ -1192,7 +1191,7 @@ WiFi_SetParamBoolValue return TRUE; } - if(AnscEqualString(ParamName, "WPA3_Personal_Compatibility", TRUE)) + if (strcmp(ParamName, "WPA3_Personal_Compatibility") == 0) { if(bValue != rfc_pcfg->wpa3_compatibility_enable) { push_rfc_dml_cache_to_one_wifidb(bValue, wifi_event_type_rsn_override_rfc); @@ -1437,7 +1436,7 @@ WiFi_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_GoodRssiThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_GoodRssiThreshold") == 0) { if(global_wifi_config->global_parameters.good_rssi_threshold == iValue) { @@ -1450,7 +1449,7 @@ WiFi_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocCountThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocCountThreshold") == 0) { if ( global_wifi_config->global_parameters.assoc_count_threshold == iValue ) { @@ -1464,7 +1463,7 @@ WiFi_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocMonitorDuration", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocMonitorDuration") == 0) { if ( global_wifi_config->global_parameters.assoc_monitor_duration == iValue ) { @@ -1477,7 +1476,7 @@ WiFi_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AssocGateTime", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AssocGateTime") == 0) { if (global_wifi_config->global_parameters.assoc_gate_time == iValue) { @@ -1489,7 +1488,7 @@ WiFi_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "WHIX_LogInterval", TRUE)) + if (strcmp(ParamName, "WHIX_LogInterval") == 0) { if (global_wifi_config->global_parameters.whix_log_interval == iValue) { @@ -1503,7 +1502,7 @@ WiFi_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "WHIX_ChUtility_LogInterval", TRUE)) + if (strcmp(ParamName, "WHIX_ChUtility_LogInterval") == 0) { if (global_wifi_config->global_parameters.whix_chutility_loginterval == iValue) { @@ -1562,7 +1561,7 @@ WiFi_SetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and set the corresponding value */ - if(AnscEqualString(ParamName, "Status", TRUE)) + if (strcmp(ParamName, "Status") == 0) { return TRUE; } @@ -1599,7 +1598,7 @@ WiFiRegion_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Code", TRUE)) + if (strcmp(ParamName, "Code") == 0) { AnscCopyString(pValue,pcfg->wifi_region_code); return 0; @@ -1665,7 +1664,7 @@ WiFiRegion_SetParamStringValue return FALSE; } - if (AnscEqualString(ParamName, "Code", TRUE)) + if (strcmp(ParamName, "Code") == 0) { if (strcmp(requestorStr, BS_SOURCE_RFC_STR) == 0 && strcmp(wifiRegionUpdateSource, BS_SOURCE_WEBPA_STR) == 0) { @@ -1882,33 +1881,33 @@ Radio_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { /* collect value */ *pBool = pcfg->enable; return TRUE; } - if( AnscEqualString(ParamName, "Upstream", TRUE)) + if (strcmp(ParamName, "Upstream") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "AutoChannelSupported", TRUE)) + if (strcmp(ParamName, "AutoChannelSupported") == 0) { *pBool = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "AutoChannelEnable", TRUE)) + if (strcmp(ParamName, "AutoChannelEnable") == 0) { /* collect value */ *pBool = pcfg->autoChannelEnabled; return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_EcoPowerDown", TRUE)) + if (strcmp(ParamName, "X_RDK_EcoPowerDown") == 0) { /* collect value */ #if defined (FEATURE_SUPPORT_ECOPOWERDOWN) @@ -1919,19 +1918,19 @@ Radio_GetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "IEEE80211hSupported", TRUE)) + if (strcmp(ParamName, "IEEE80211hSupported") == 0) { *pBool = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "IEEE80211hEnabled", TRUE)) + if (strcmp(ParamName, "IEEE80211hEnabled") == 0) { *pBool = rcfg->IEEE80211hEnabled; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST_COM_DFSSupport", TRUE)) + if (strcmp(ParamName, "X_COMCAST_COM_DFSSupport") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d X_COMCAST_COM_DFSSupport band %d num_channels %d\n", __FUNCTION__,__LINE__, pcfg->band, radio_capab.channel_list[0].num_channels); for (int i=0; iDfsEnabled; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_DCSSupported", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DCSSupported") == 0) { *pBool = rcfg->DCSSupported; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DCSEnable", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DCSEnable") == 0) { *pBool = pcfg->DCSEnabled; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST_COM_IGMPSnoopingEnable", TRUE)) + if (strcmp(ParamName, "X_COMCAST_COM_IGMPSnoopingEnable") == 0) { *pBool = rcfg->IGMPSnoopingEnabled; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_AutoChannelRefreshPeriodSupported", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AutoChannelRefreshPeriodSupported") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_IEEE80211hSupported", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_IEEE80211hSupported") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_ReverseDirectionGrantSupported", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_ReverseDirectionGrantSupported") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RtsThresholdSupported", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_RtsThresholdSupported") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_APIsolation", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_APIsolation") == 0) { /* collect value */ *pBool = rcfg->APIsolation; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_FrameBurst", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FrameBurst") == 0) { /* collect value */ *pBool = rcfg->FrameBurst; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ApplySetting", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ApplySetting") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_AutoChannelRefreshPeriodSupported", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_AutoChannelRefreshPeriodSupported") == 0) { *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_RtsThresholdSupported", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_RtsThresholdSupported") == 0) { *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ReverseDirectionGrantSupported", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ReverseDirectionGrantSupported") == 0) { *pBool = FALSE; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ReverseDirectionGrant", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ReverseDirectionGrant") == 0) { *pBool = rcfg->ReverseDirectionGrant; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_AggregationMSDU", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AggregationMSDU") == 0) { *pBool = rcfg->AggregationMSDU; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_AutoBlockAck", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AutoBlockAck") == 0) { *pBool = rcfg->AutoBlockAck; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_DeclineBARequest", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DeclineBARequest") == 0) { *pBool = rcfg->DeclineBARequest; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_STBCEnable", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_STBCEnable") == 0) { *pBool = pcfg->stbcEnable; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_11nGreenfieldEnabled", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_11nGreenfieldEnabled") == 0) { *pBool = pcfg->greenFieldEnable; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_WirelessOnOffButton", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_WirelessOnOffButton") == 0) { *pBool = rcfg->WirelessOnOffButton; return TRUE; @@ -2134,14 +2133,14 @@ Radio_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "MCS", TRUE)) + if (strcmp(ParamName, "MCS") == 0) { /* collect value */ *pInt = rcfg->MCS; return TRUE; } - if( AnscEqualString(ParamName, "TransmitPower", TRUE)) + if (strcmp(ParamName, "TransmitPower") == 0) { /* collect value */ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d: tx_power:%d\n",__func__, __LINE__, pcfg->transmitPower); @@ -2150,59 +2149,59 @@ Radio_GetParamIntValue return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_MbssUserControl", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MbssUserControl") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d: userControl:%d\n",__func__, __LINE__, pcfg->userControl); *pInt = pcfg->userControl; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_AdminControl", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AdminControl") == 0) { *pInt = pcfg->adminControl; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_OnOffPushButtonTime", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_OnOffPushButtonTime") == 0) { *pInt = rcfg->OnOffPushButtonTime; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ObssCoex", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ObssCoex") == 0) { *pInt = pcfg->obssCoex; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_MulticastRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MulticastRate") == 0) { *pInt = rcfg->MulticastRate; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_CarrierSenseThresholdRange", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_CarrierSenseThresholdRange") == 0) { *pInt = rcfg->ThresholdRange; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_CarrierSenseThresholdInUse", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_CarrierSenseThresholdInUse") == 0) { *pInt = rcfg->ThresholdInUse; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_ChannelSwitchingCount", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_ChannelSwitchingCount") == 0) { *pInt = gChannelSwitchingCount; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_DCSDwelltime", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_DCSDwelltime") == 0) { return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_clientInactivityTimeout", TRUE) ) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_clientInactivityTimeout") == 0) { *pInt = 0; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST_COM_DFSTimer", TRUE) ) { + if (strcmp(ParamName, "X_COMCAST_COM_DFSTimer") == 0) { *pInt = pcfg->DFSTimer; return TRUE; } @@ -2294,14 +2293,14 @@ Radio_GetParamUlongValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_COMCAST_COM_RadioUpTime", TRUE)) + if (strcmp(ParamName, "X_COMCAST_COM_RadioUpTime") == 0) { /* collect value */ upSecs = get_Uptime(); *puLong = upSecs - startTime[instance_number]; return TRUE; } - if( AnscEqualString(ParamName, "Status", TRUE)) + if (strcmp(ParamName, "Status") == 0) { if (global_wifi_config->global_parameters.force_disable_radio_feature == TRUE ) { @@ -2321,28 +2320,28 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "LastChange", TRUE)) + if (strcmp(ParamName, "LastChange") == 0) { /* collect value */ *puLong = AnscGetTimeIntervalInSeconds(last_radio_change,AnscGetTickInSeconds()); return TRUE; } - if( AnscEqualString(ParamName, "MaxBitRate", TRUE)) + if (strcmp(ParamName, "MaxBitRate") == 0) { /* collect value */ *puLong = rcfg->MaxBitRate; return TRUE; } - if( AnscEqualString(ParamName, "SupportedFrequencyBands", TRUE)) + if (strcmp(ParamName, "SupportedFrequencyBands") == 0) { /* collect value */ *puLong = rcfg->SupportedFrequencyBands; return TRUE; } - if( AnscEqualString(ParamName, "Channel", TRUE)) + if (strcmp(ParamName, "Channel") == 0) { /* collect value */ *puLong = pcfg->channel; @@ -2350,13 +2349,13 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "AutoChannelRefreshPeriod", TRUE)) + if (strcmp(ParamName, "AutoChannelRefreshPeriod") == 0) { *puLong = rcfg->AutoChannelRefreshPeriod; return TRUE; } - if( AnscEqualString(ParamName, "OperatingChannelBandwidth", TRUE)) + if (strcmp(ParamName, "OperatingChannelBandwidth") == 0) { /* collect value */ UINT bw = 0; @@ -2368,13 +2367,13 @@ Radio_GetParamUlongValue return FALSE; } - if( AnscEqualString(ParamName, "ExtensionChannel", TRUE)) + if (strcmp(ParamName, "ExtensionChannel") == 0) { *puLong = rcfg->ExtensionChannel; return TRUE; } - if( AnscEqualString(ParamName, "GuardInterval", TRUE)) + if (strcmp(ParamName, "GuardInterval") == 0) { /* collect value */ COSA_DML_WIFI_GUARD_INTVL tmpGuardInterval = 0; @@ -2387,7 +2386,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_RTSThreshold", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RTSThreshold") == 0) { /* collect value */ *puLong = pcfg->rtsThreshold; @@ -2395,7 +2394,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_FragmentationThreshold", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FragmentationThreshold") == 0) { /* collect value */ *puLong = pcfg->fragmentationThreshold; @@ -2403,7 +2402,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_DTIMInterval", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DTIMInterval") == 0) { /* collect value */ *puLong = pcfg->dtimPeriod; @@ -2419,21 +2418,21 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_TxRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_TxRate") == 0) { /* collect value */ *puLong = pcfg->transmitPower; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BasicRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BasicRate") == 0) { /* collect value */ *puLong = rcfg->BasicRate; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_CTSProtectionMode", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_CTSProtectionMode") == 0) { /* collect value */ *puLong = (FALSE == pcfg->ctsProtection) ? 0 : 1; @@ -2441,38 +2440,38 @@ Radio_GetParamUlongValue return TRUE; } #if 0 - if (AnscEqualString(ParamName, "X_CISCO_COM_HTTxStream", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_HTTxStream") == 0) { *puLong = pWifiRadioFull->Cfg.X_CISCO_COM_HTTxStream; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_HTRxStream", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_HTRxStream") == 0) { *puLong = pWifiRadioFull->Cfg.X_CISCO_COM_HTRxStream; return TRUE; } #endif - if( AnscEqualString(ParamName, "RadioResetCount", TRUE) ) + if (strcmp(ParamName, "RadioResetCount") == 0) { *puLong = radio_reset_count; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ChanUtilSelfHealEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ChanUtilSelfHealEnable") == 0) { *puLong = pcfg->chanUtilSelfHealEnable; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ChannelUtilThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ChannelUtilThreshold") == 0) { *puLong = pcfg->chanUtilThreshold; return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_OffChannelTscan", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelTscan") == 0) { #if defined(FEATURE_OFF_CHANNEL_SCAN_5G) *puLong = fcfg->OffChanTscanInMsec; @@ -2482,7 +2481,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_OffChannelNscan", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelNscan") == 0) { #if defined(FEATURE_OFF_CHANNEL_SCAN_5G) if (fcfg->OffChanNscanInSec != 0) @@ -2497,7 +2496,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_OffChannelTidle", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelTidle") == 0) { #if defined(FEATURE_OFF_CHANNEL_SCAN_5G) *puLong = fcfg->OffChanTidleInSec; @@ -2507,7 +2506,7 @@ Radio_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_OffChannelNchannel", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelNchannel") == 0) { #if defined(FEATURE_OFF_CHANNEL_SCAN_5G) if (is_radio_band_5G(pcfg->band)) @@ -2595,13 +2594,13 @@ Radio_GetParamStringValue wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Alias", TRUE)) + if (strcmp(ParamName, "Alias") == 0) { snprintf(pValue, *pUlSize, "%s", rcfg->Alias); return 0; } - if( AnscEqualString(ParamName, "Name", TRUE)) + if (strcmp(ParamName, "Name") == 0) { /* collect value */ INT instance_number = 0; @@ -2615,7 +2614,7 @@ Radio_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "LowerLayers", TRUE)) + if (strcmp(ParamName, "LowerLayers") == 0) { /*TR-181: Since Radio is a layer 1 interface, it is expected that LowerLayers will not be used @@ -2625,7 +2624,7 @@ Radio_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "OperatingFrequencyBand", TRUE)) + if (strcmp(ParamName, "OperatingFrequencyBand") == 0) { /* collect value */ if(10 < *pUlSize) @@ -2659,7 +2658,7 @@ Radio_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "OperatingStandards", TRUE)) + if (strcmp(ParamName, "OperatingStandards") == 0) { /* collect value */ char buf[512] = {0}; @@ -2758,7 +2757,7 @@ Radio_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "PossibleChannels", TRUE)) + if (strcmp(ParamName, "PossibleChannels") == 0) { wifi_rfc_dml_parameters_t *rfc_params = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); @@ -2773,25 +2772,25 @@ Radio_GetParamStringValue pValue, *pUlSize, rfc_params->dfs_rfc) == RETURN_OK ? 0 : -1; } - if( AnscEqualString(ParamName, "ChannelsInUse", TRUE)) + if (strcmp(ParamName, "ChannelsInUse") == 0) { snprintf(pValue, *pUlSize, "%d", pcfg->channel); return 0; } - if( AnscEqualString(ParamName, "X_CISCO_COM_ApChannelScan", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ApChannelScan") == 0) { return 0; } - if( AnscEqualString(ParamName, "TransmitPowerSupported", TRUE)) + if (strcmp(ParamName, "TransmitPowerSupported") == 0) { /* collect value */ snprintf(pValue, *pUlSize, "%s", rcfg->TransmitPowerSupported); return 0; } - if( AnscEqualString(ParamName, "RegulatoryDomain", TRUE)) + if (strcmp(ParamName, "RegulatoryDomain") == 0) { /* collect value */ char regulatoryDomain[4]; @@ -2811,13 +2810,13 @@ Radio_GetParamStringValue } - if( AnscEqualString(ParamName, "SupportedStandards", TRUE)) + if (strcmp(ParamName, "SupportedStandards") == 0) { snprintf(pValue, *pUlSize, "%s", rcfg->SupportedStandards); return 0; } - if( AnscEqualString(ParamName, "BasicDataTransmitRates", TRUE)) + if (strcmp(ParamName, "BasicDataTransmitRates") == 0) { char buf[512] = {0}; wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:pcfg->basicDataTransmitRates=%d\n",__func__, __LINE__, pcfg->basicDataTransmitRates); @@ -2910,15 +2909,14 @@ Radio_GetParamStringValue } return 0; } - - if( AnscEqualString(ParamName, "SupportedDataTransmitRates", TRUE)) + if (strcmp(ParamName, "SupportedDataTransmitRates") == 0) { /* collect value */ snprintf(pValue, *pUlSize, "%s", "6,9,12,18,24,36,48,54"); return 0; } - if( AnscEqualString(ParamName, "OperationalDataTransmitRates", TRUE)) + if (strcmp(ParamName, "OperationalDataTransmitRates") == 0) { char buf[512] = {0}; wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:pcfg->operationalDataTransmitRates=%d\n",__func__, __LINE__, pcfg->operationalDataTransmitRates); @@ -3108,7 +3106,7 @@ Radio_SetParamBoolValue return FALSE; } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:enable=%d bValue = %d instanceNumber=%d true=%d false=%d \n",__func__, __LINE__,wifiRadioOperParam->enable,bValue,instance_number,TRUE,FALSE); if(global_wifi_config->global_parameters.force_disable_radio_feature) @@ -3133,7 +3131,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "AutoChannelEnable", TRUE)) + if (strcmp(ParamName, "AutoChannelEnable") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:autoChannelEnabled=%d bValue = %d \n",__func__, __LINE__,wifiRadioOperParam->autoChannelEnabled,bValue); if (wifiRadioOperParam->autoChannelEnabled == bValue) @@ -3147,13 +3145,13 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "IEEE80211hEnabled", TRUE)) + if (strcmp(ParamName, "IEEE80211hEnabled") == 0) { rcfg->IEEE80211hEnabled = bValue; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST_COM_DFSEnable", TRUE)) + if (strcmp(ParamName, "X_COMCAST_COM_DFSEnable") == 0) { wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); if (!(rfc_pcfg->dfs_rfc)) { @@ -3165,7 +3163,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DCSEnable", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DCSEnable") == 0) { if (wifiRadioOperParam->DCSEnabled == bValue) { @@ -3179,31 +3177,31 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST_COM_IGMPSnoopingEnable", TRUE)) + if (strcmp(ParamName, "X_COMCAST_COM_IGMPSnoopingEnable") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Cannot set IGMPSnoopingEnable \n",__func__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_APIsolation", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_APIsolation") == 0) { rcfg->APIsolation = bValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_FrameBurst", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FrameBurst") == 0) { rcfg->FrameBurst = bValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_ApplySetting", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ApplySetting") == 0) { return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_ReverseDirectionGrant", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ReverseDirectionGrant") == 0) { if (rcfg->ReverseDirectionGrant == bValue) { @@ -3215,7 +3213,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_AggregationMSDU", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AggregationMSDU") == 0) { if (rcfg->AggregationMSDU == bValue) { @@ -3227,7 +3225,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_AutoBlockAck", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AutoBlockAck") == 0) { if (rcfg->AutoBlockAck == bValue) { @@ -3239,7 +3237,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_DeclineBARequest", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DeclineBARequest") == 0) { if (rcfg->DeclineBARequest == bValue) { @@ -3251,7 +3249,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_STBCEnable", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_STBCEnable") == 0) { wifiRadioOperParam->stbcEnable = bValue; is_radio_config_changed = TRUE; @@ -3259,7 +3257,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_11nGreenfieldEnabled", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_11nGreenfieldEnabled") == 0) { wifiRadioOperParam->greenFieldEnable = bValue; is_radio_config_changed = TRUE; @@ -3267,7 +3265,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_WirelessOnOffButton", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_WirelessOnOffButton") == 0) { if (rcfg->WirelessOnOffButton == bValue) { @@ -3279,7 +3277,7 @@ Radio_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDK_EcoPowerDown", TRUE)) + if (strcmp(ParamName, "X_RDK_EcoPowerDown") == 0) { #if defined (FEATURE_SUPPORT_ECOPOWERDOWN) wifi_util_dbg_print(WIFI_DMCLI,"%s:%d: EcoPowerDown = %d bValue = %d \n", __func__, __LINE__, wifiRadioOperParam->EcoPowerDown, bValue); @@ -3432,13 +3430,13 @@ Radio_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "MCS", TRUE)) + if (strcmp(ParamName, "MCS") == 0) { rcfg->MCS = iValue; return TRUE; } - if( AnscEqualString(ParamName, "TransmitPower", TRUE)) + if (strcmp(ParamName, "TransmitPower") == 0) { if (wifiRadioOperParam->transmitPower == (UINT)iValue) { @@ -3456,7 +3454,7 @@ Radio_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_MbssUserControl", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MbssUserControl") == 0) { if (wifiRadioOperParam->userControl == (UINT)iValue) { @@ -3470,7 +3468,7 @@ Radio_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_AdminControl", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_AdminControl") == 0) { wifiRadioOperParam->adminControl = iValue; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s adminControl: %d\n", __FUNCTION__, wifiRadioOperParam->adminControl); @@ -3478,12 +3476,12 @@ Radio_SetParamIntValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:adminControl=%d bValue = %d \n",__func__, __LINE__,wifiRadioOperParam->adminControl,iValue); return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_OnOffPushButtonTime", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_OnOffPushButtonTime") == 0) { rcfg->OnOffPushButtonTime = iValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_ObssCoex", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_ObssCoex") == 0) { if((iValue != 0) && (iValue != 1)) { @@ -3496,24 +3494,24 @@ Radio_SetParamIntValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:obssCoex=%d bValue = %d \n",__func__, __LINE__,wifiRadioOperParam->obssCoex,iValue); return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_MulticastRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MulticastRate") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Cannot set MulticastRate \n",__func__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_CarrierSenseThresholdInUse", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_CarrierSenseThresholdInUse") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Cannot set CarrierSenseThresholdInUse \n",__func__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_DCSDwelltime", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_DCSDwelltime") == 0) { return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST_COM_DFSTimer", TRUE) ) { + if (strcmp(ParamName, "X_COMCAST_COM_DFSTimer") == 0) { if(iValue < 30) { wifi_util_error_print(WIFI_DMCLI, "%s:%d: Invalid Timer value %d for the country code : %d\n", __func__, __LINE__, iValue, wifiRadioOperParam->countryCode); return FALSE; @@ -3658,7 +3656,7 @@ Radio_SetParamUlongValue #endif //FEATURE_OFF_CHANNEL_SCAN_5G /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Channel", TRUE)) + if (strcmp(ParamName, "Channel") == 0) { if (wifiRadioChannelIsValid(wlanIndex, uValue) != ANSC_STATUS_SUCCESS) { @@ -3688,13 +3686,13 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "AutoChannelRefreshPeriod", TRUE)) + if (strcmp(ParamName, "AutoChannelRefreshPeriod") == 0) { rcfg->AutoChannelRefreshPeriod = uValue; return TRUE; } - if (AnscEqualString(ParamName, "OperatingChannelBandwidth", TRUE)) { + if (strcmp(ParamName, "OperatingChannelBandwidth") == 0) { if (operChanBandwidthDmlEnumtoHalEnum(uValue, &tmpChanWidth) != ANSC_STATUS_SUCCESS) { return FALSE; } @@ -3744,7 +3742,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "ExtensionChannel", TRUE)) + if (strcmp(ParamName, "ExtensionChannel") == 0) { ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s Extension Channel : %d\n", __FUNCTION__, uValue); if (rcfg->ExtensionChannel == uValue) { @@ -3754,7 +3752,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "GuardInterval", TRUE)) + if (strcmp(ParamName, "GuardInterval") == 0) { wifi_guard_interval_t tmpGuardInterval = 0; @@ -3775,7 +3773,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_RTSThreshold", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RTSThreshold") == 0) { if (uValue > 2347) { @@ -3794,7 +3792,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_FragmentationThreshold", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_FragmentationThreshold") == 0) { if (wifiRadioOperParam->fragmentationThreshold == uValue) { @@ -3813,7 +3811,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_DTIMInterval", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DTIMInterval") == 0) { if (wifiRadioOperParam->dtimPeriod == uValue) { @@ -3853,19 +3851,19 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_TxRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_TxRate") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Cannot set TxRate \n",__func__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BasicRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BasicRate") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Cannot set BasicRate \n",__func__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_CTSProtectionMode", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_CTSProtectionMode") == 0) { if(wifiRadioOperParam->ctsProtection == uValue) { @@ -3879,7 +3877,7 @@ Radio_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ChanUtilSelfHealEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ChanUtilSelfHealEnable") == 0) { if(wifiRadioOperParam->chanUtilSelfHealEnable == uValue) { @@ -3889,7 +3887,7 @@ Radio_SetParamUlongValue return FALSE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ChannelUtilThreshold", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ChannelUtilThreshold") == 0) { if(wifiRadioOperParam->chanUtilThreshold == uValue) { @@ -3899,7 +3897,7 @@ Radio_SetParamUlongValue return FALSE; } - if( AnscEqualString(ParamName, "X_RDK_OffChannelTscan", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelTscan") == 0) { #if defined (FEATURE_OFF_CHANNEL_SCAN_5G) if(!(is_radio_band_5G(wifiRadioOperParam->band))) @@ -3920,7 +3918,7 @@ Radio_SetParamUlongValue #endif //FEATURE_OFF_CHANNEL_SCAN_5G } - if( AnscEqualString(ParamName, "X_RDK_OffChannelNscan", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelNscan") == 0) { #if defined (FEATURE_OFF_CHANNEL_SCAN_5G) if(!(is_radio_band_5G(wifiRadioOperParam->band))) @@ -3954,7 +3952,7 @@ Radio_SetParamUlongValue #endif //FEATURE_OFF_CHANNEL_SCAN_5G } - if( AnscEqualString(ParamName, "X_RDK_OffChannelTidle", TRUE)) + if (strcmp(ParamName, "X_RDK_OffChannelTidle") == 0) { #if defined (FEATURE_OFF_CHANNEL_SCAN_5G) if(!(is_radio_band_5G(wifiRadioOperParam->band))) @@ -4089,16 +4087,16 @@ Radio_SetParamStringValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Alias", TRUE)) + if (strcmp(ParamName, "Alias") == 0) { - if ( AnscEqualString(pString, rcfg->Alias, TRUE)) { + if (strcmp(pString, rcfg->Alias) == 0) { return TRUE; } strncpy(rcfg->Alias,pString,sizeof(rcfg->Alias)-1); return TRUE; } - if( AnscEqualString(ParamName, "LowerLayers", TRUE)) + if (strcmp(ParamName, "LowerLayers") == 0) { /*TR-181: Since Radio is a layer 1 interface, it is expected that LowerLayers will not be used @@ -4107,7 +4105,7 @@ Radio_SetParamStringValue return FALSE; } - if( AnscEqualString(ParamName, "RegulatoryDomain", TRUE)) + if (strcmp(ParamName, "RegulatoryDomain") == 0) { char regulatoryDomainStr[4]; size_t reg_len; @@ -4155,7 +4153,7 @@ Radio_SetParamStringValue return TRUE; } - if(AnscEqualString(ParamName, "BasicDataTransmitRates", TRUE)) + if (strcmp(ParamName, "BasicDataTransmitRates") == 0) { if(isValidTransmitRate(pString)) { @@ -4175,7 +4173,7 @@ Radio_SetParamStringValue } } - if(AnscEqualString(ParamName, "OperationalDataTransmitRates", TRUE)) + if (strcmp(ParamName, "OperationalDataTransmitRates") == 0) { if(isValidTransmitRate(pString)) { @@ -4197,7 +4195,7 @@ Radio_SetParamStringValue } } - if(AnscEqualString(ParamName, "OperatingStandards", TRUE)) { + if (strcmp(ParamName, "OperatingStandards") == 0) { wifi_ieee80211Variant_t wifi_variant; wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); @@ -4396,7 +4394,7 @@ ReceivedSignalLevel_GetParamIntValue if(!hInsContext) return FALSE; - if( AnscEqualString(ParamName, "ReceivedSignalLevel", TRUE)) { + if (strcmp(ParamName, "ReceivedSignalLevel") == 0) { return TRUE; } return FALSE; @@ -4472,7 +4470,7 @@ Stats3_GetParamBoolValue { /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsEnable", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsEnable") == 0) { return TRUE; } return FALSE; @@ -4486,7 +4484,7 @@ Stats3_SetParamBoolValue BOOL bValue ) { - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsEnable", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsEnable") == 0) { return TRUE; } return FALSE; @@ -4552,11 +4550,11 @@ Stats3_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_COMCAST-COM_NoiseFloor", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_NoiseFloor") == 0) { *pInt = monitor_param->radio_data[instance_number].NoiseFloor; return TRUE; } - if( AnscEqualString(ParamName, "Noise", TRUE)) { + if (strcmp(ParamName, "Noise") == 0) { *pInt = monitor_param->radio_data[instance_number].NoiseFloor; return TRUE; } @@ -4598,27 +4596,27 @@ Stats3_GetParamIntValue *pInt = monitor_param->radio_data[instance_number].CarrierSenseThreshold_Exceeded; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RetransmissionMetric", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RetransmissionMetric") == 0) { *pInt = stats->RetransmissionMetric; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MaximumNoiseFloorOnChannel", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_MaximumNoiseFloorOnChannel") == 0) { *pInt = stats->MaximumNoiseFloorOnChannel; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MinimumNoiseFloorOnChannel", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_MinimumNoiseFloorOnChannel") == 0) { *pInt = stats->MinimumNoiseFloorOnChannel; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MedianNoiseFloorOnChannel", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_MedianNoiseFloorOnChannel") == 0) { *pInt = stats->MedianNoiseFloorOnChannel; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringRate", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringRate") == 0) { *pInt = stats->RadioStatisticsMeasuringRate; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringInterval", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringInterval") == 0) { *pInt = stats->RadioStatisticsMeasuringInterval; return TRUE; } @@ -4685,59 +4683,59 @@ Stats3_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "BytesSent", TRUE)) { + if (strcmp(ParamName, "BytesSent") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_BytesSent; return TRUE; } - if( AnscEqualString(ParamName, "BytesReceived", TRUE)) { + if (strcmp(ParamName, "BytesReceived") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_BytesReceived; return TRUE; } - if( AnscEqualString(ParamName, "PacketsSent", TRUE)) { + if (strcmp(ParamName, "PacketsSent") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_PacketsSent; return TRUE; } - if( AnscEqualString(ParamName, "PacketsReceived", TRUE)) { + if (strcmp(ParamName, "PacketsReceived") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_PacketsReceived; return TRUE; } - if( AnscEqualString(ParamName, "ErrorsSent", TRUE)) { + if (strcmp(ParamName, "ErrorsSent") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_ErrorsSent; return TRUE; } - if( AnscEqualString(ParamName, "ErrorsReceived", TRUE)) { + if (strcmp(ParamName, "ErrorsReceived") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_ErrorsReceived; return TRUE; } - if( AnscEqualString(ParamName, "DiscardPacketsSent", TRUE)) { + if (strcmp(ParamName, "DiscardPacketsSent") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_DiscardPacketsSent; return TRUE; } - if( AnscEqualString(ParamName, "DiscardPacketsReceived", TRUE)) { + if (strcmp(ParamName, "DiscardPacketsReceived") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_DiscardPacketsReceived; return TRUE; } - if( AnscEqualString(ParamName, "PLCPErrorCount", TRUE)) { + if (strcmp(ParamName, "PLCPErrorCount") == 0) { *puLong = stats->PLCPErrorCount; return TRUE; } - if( AnscEqualString(ParamName, "FCSErrorCount", TRUE)) { + if (strcmp(ParamName, "FCSErrorCount") == 0) { *puLong = stats->FCSErrorCount; return TRUE; } - if( AnscEqualString(ParamName, "InvalidMACCount", TRUE)) { + if (strcmp(ParamName, "InvalidMACCount") == 0) { *puLong = monitor_param->radio_data[instance_number-1].radio_InvalidMACCount; return TRUE; } - if( AnscEqualString(ParamName, "PacketsOtherReceived", TRUE)) { + if (strcmp(ParamName, "PacketsOtherReceived") == 0) { *puLong = stats->PacketsOtherReceived; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_ChannelUtilization", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_ChannelUtilization") == 0) { *puLong = monitor_param->radio_data[instance_number].channelUtil; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_StatisticsStartTime", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_StatisticsStartTime") == 0) { *puLong = stats->StatisticsStartTime; return TRUE; } @@ -4805,7 +4803,7 @@ Stats3_SetParamIntValue return FALSE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringRate", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringRate") == 0) { if( wifi_radio->radioStatsMeasuringRate == (UINT)iValue) { return TRUE; @@ -4816,7 +4814,7 @@ Stats3_SetParamIntValue is_radio_config_changed = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringInterval", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringInterval") == 0) { if( wifi_radio->radioStatsMeasuringInterval == (UINT)iValue) { return TRUE; @@ -5028,7 +5026,7 @@ SSID_GetParamBoolValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { if (global_wifi_config->global_parameters.force_disable_radio_feature == TRUE) { @@ -5045,7 +5043,7 @@ SSID_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_EnableOnline", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EnableOnline") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { *pBool = pcfg->u.sta_info.enabled; @@ -5056,7 +5054,7 @@ SSID_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_RouterEnabled", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RouterEnabled") == 0) { *pBool = cfg->router_enabled; return TRUE; @@ -5161,7 +5159,7 @@ SSID_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Status", TRUE)) + if (strcmp(ParamName, "Status") == 0) { if (global_wifi_config->global_parameters.force_disable_radio_feature == TRUE || ((webconfig_dml_t *)get_webconfig_dml())->radios[pcfg->radio_index].oper.enable == false) @@ -5194,7 +5192,7 @@ SSID_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "LastChange", TRUE)) + if (strcmp(ParamName, "LastChange") == 0) { /* collect value */ *puLong = AnscGetTimeIntervalInSeconds(last_vap_change, AnscGetTickInSeconds()); @@ -5264,7 +5262,7 @@ SSID_GetParamStringValue } memset(str,0,sizeof(str)); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Alias", TRUE)) + if (strcmp(ParamName, "Alias") == 0) { /* collect value */ if(instance_number>(MAX_NUM_RADIOS * MAX_NUM_VAP_PER_RADIO) || instance_number<0) @@ -5277,14 +5275,14 @@ SSID_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "Name", TRUE)) + if (strcmp(ParamName, "Name") == 0) { /* collect value */ AnscCopyString(pValue, pcfg->vap_name); return 0; } - if( AnscEqualString(ParamName, "LowerLayers", TRUE)) + if (strcmp(ParamName, "LowerLayers") == 0) { int radioIndex = convert_vap_name_to_radio_array_index(&((webconfig_dml_t *)get_webconfig_dml())->hal_cap.wifi_prop, pcfg->vap_name); @@ -5294,7 +5292,7 @@ SSID_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "BSSID", TRUE)) + if (strcmp(ParamName, "BSSID") == 0) { char buff[24] = {0}; @@ -5327,7 +5325,7 @@ SSID_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "MACAddress", TRUE)) + if (strcmp(ParamName, "MACAddress") == 0) { char buff[24] = {0}; if (isVapSTAMesh(pcfg->vap_index)) { @@ -5359,7 +5357,7 @@ SSID_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "SSID", TRUE)) + if (strcmp(ParamName, "SSID") == 0) { /* collect value */ if(isVapSTAMesh(pcfg->vap_index)){ @@ -5371,7 +5369,7 @@ SSID_GetParamStringValue } } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DefaultSSID", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DefaultSSID") == 0) { /* collect value */ char ssid[128] = {0}; @@ -5382,7 +5380,7 @@ SSID_GetParamStringValue } - if( AnscEqualString(ParamName, "Repurposed_VapName", TRUE)) + if (strcmp(ParamName, "Repurposed_VapName") == 0) { /* collect value */ if (strlen(pcfg->repurposed_vap_name) != 0) { @@ -5466,7 +5464,7 @@ SSID_SetParamBoolValue return FALSE; } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { rdk_wifi_vap_info_t *rdk_vap_info; rdk_vap_info = (rdk_wifi_vap_info_t *)get_dml_cache_rdk_vap_info(vapInfo->vap_index); @@ -5511,7 +5509,7 @@ SSID_SetParamBoolValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_EnableOnline", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EnableOnline") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { if (vapInfo->u.sta_info.enabled == bValue) @@ -5541,7 +5539,7 @@ SSID_SetParamBoolValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_RouterEnabled", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RouterEnabled") == 0) { /* SSID Enable object can be modified only when ForceDisableRadio feature is disabled */ if(!(global_wifi_config->global_parameters.force_disable_radio_feature)) { @@ -5712,20 +5710,20 @@ SSID_SetParamStringValue return FALSE; } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Alias", TRUE)) + if (strcmp(ParamName, "Alias") == 0) { /* save update to backup */ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Does not support modification\n", __FUNCTION__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "LowerLayers", TRUE)) + if (strcmp(ParamName, "LowerLayers") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Does not support modification\n", __FUNCTION__,__LINE__); return FALSE; } - if ( AnscEqualString(ParamName, "SSID", TRUE) ) + if (strcmp(ParamName, "SSID") == 0) { if(global_wifi_config->global_parameters.force_disable_radio_feature) { @@ -5734,7 +5732,7 @@ SSID_SetParamStringValue return FALSE; } if (isVapSTAMesh(vapInfo->vap_index)) { - if ( AnscEqualString(vapInfo->u.sta_info.ssid, pString, TRUE) ) { + if (strcmp(vapInfo->u.sta_info.ssid, pString) == 0) { return TRUE; } snprintf(vapInfo->u.sta_info.ssid,sizeof(vapInfo->u.sta_info.ssid),"%s",pString); @@ -5742,14 +5740,14 @@ SSID_SetParamStringValue return TRUE; } - if ( AnscEqualString(vapInfo->u.bss_info.ssid, pString, TRUE) ) + if (strcmp(vapInfo->u.bss_info.ssid, pString) == 0) { return TRUE; } if (IsSsidHotspot(instance_number) ) { - if(AnscEqualString(pString, "OutOfService", FALSE)) /* case insensitive */ + if (strcasecmp(pString, "OutOfService") == 0) /* case insensitive */ { vapInfo->u.bss_info.enabled = FALSE; fprintf(stderr, "%s: Disable HHS SSID since it's set to OutOfService\n", __FUNCTION__); @@ -6024,128 +6022,128 @@ Stats4_GetParamUlongValue { /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "BytesSent", TRUE)) + if (strcmp(ParamName, "BytesSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "BytesReceived", TRUE)) + if (strcmp(ParamName, "BytesReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "PacketsSent", TRUE)) + if (strcmp(ParamName, "PacketsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "PacketsReceived", TRUE)) + if (strcmp(ParamName, "PacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "ErrorsSent", TRUE)) + if (strcmp(ParamName, "ErrorsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "ErrorsReceived", TRUE)) + if (strcmp(ParamName, "ErrorsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "UnicastPacketsSent", TRUE)) + if (strcmp(ParamName, "UnicastPacketsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "UnicastPacketsReceived", TRUE)) + if (strcmp(ParamName, "UnicastPacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "DiscardPacketsSent", TRUE)) + if (strcmp(ParamName, "DiscardPacketsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "DiscardPacketsReceived", TRUE)) + if (strcmp(ParamName, "DiscardPacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "MulticastPacketsSent", TRUE)) + if (strcmp(ParamName, "MulticastPacketsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "MulticastPacketsReceived", TRUE)) + if (strcmp(ParamName, "MulticastPacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "BroadcastPacketsSent", TRUE)) + if (strcmp(ParamName, "BroadcastPacketsSent") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "BroadcastPacketsReceived", TRUE)) + if (strcmp(ParamName, "BroadcastPacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "UnknownProtoPacketsReceived", TRUE)) + if (strcmp(ParamName, "UnknownProtoPacketsReceived") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "RetransCount", TRUE)) + if (strcmp(ParamName, "RetransCount") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "FailedRetransCount", TRUE)) + if (strcmp(ParamName, "FailedRetransCount") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "RetryCount", TRUE)) + if (strcmp(ParamName, "RetryCount") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "MultipleRetryCount", TRUE)) + if (strcmp(ParamName, "MultipleRetryCount") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "ACKFailureCount", TRUE)) + if (strcmp(ParamName, "ACKFailureCount") == 0) { *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "AggregatedPacketCount", TRUE)) + if (strcmp(ParamName, "AggregatedPacketCount") == 0) { *puLong = 0; return TRUE; @@ -6378,7 +6376,7 @@ AccessPoint_GetParamBoolValue return FALSE; } - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { /* collect value */ if (isVapSTAMesh(pcfg->vap_index)) { @@ -6395,75 +6393,75 @@ AccessPoint_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "IsolationEnable", TRUE)) + if (strcmp(ParamName, "IsolationEnable") == 0) { *pBool = pcfg->u.bss_info.isolation; return TRUE; } - if( AnscEqualString(ParamName, "SSIDAdvertisementEnabled", TRUE)) + if (strcmp(ParamName, "SSIDAdvertisementEnabled") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.showSsid; return TRUE; } - if( AnscEqualString(ParamName, "MLD_Enable", TRUE)) + if (strcmp(ParamName, "MLD_Enable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.mld_info.common_info.mld_enable; return TRUE; } - if( AnscEqualString(ParamName, "MLD_Apply", TRUE)) + if (strcmp(ParamName, "MLD_Apply") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.mld_info.common_info.mld_apply; return TRUE; } - if( AnscEqualString(ParamName, "WMMCapability", TRUE)) + if (strcmp(ParamName, "WMMCapability") == 0) { /* collect value */ *pBool = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "UAPSDCapability", TRUE)) + if (strcmp(ParamName, "UAPSDCapability") == 0) { /* collect value */ *pBool = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "WMMEnable", TRUE)) + if (strcmp(ParamName, "WMMEnable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.wmm_enabled; return TRUE; } - if( AnscEqualString(ParamName, "UAPSDEnable", TRUE)) + if (strcmp(ParamName, "UAPSDEnable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.UAPSDEnabled; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssCountStaAsCpe", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssCountStaAsCpe") == 0) { /* collect value */ *pBool = cfg->bss_count_sta_as_cpe; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssHotSpot", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssHotSpot") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.bssHotspot; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_KickAssocDevices", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_KickAssocDevices") == 0) { /* collect value */ *pBool = cfg->kick_assoc_devices; @@ -6472,27 +6470,27 @@ AccessPoint_GetParamBoolValue #if defined (FEATURE_SUPPORT_INTERWORKING) - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceCapability", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceCapability") == 0) { /* collect value */ //*pBool = pWifiAp->AP.Cfg.InterworkingCapability; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.interworking.interworking.interworkingEnabled; return TRUE; } #else - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceCapability", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceCapability") == 0) { *pBool = FALSE; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable") == 0) { /* collect value */ *pBool = FALSE; @@ -6500,21 +6498,21 @@ AccessPoint_GetParamBoolValue } #endif - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_rapidReconnectCountEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_rapidReconnectCountEnable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.rapidReconnectEnable; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_StatsEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_StatsEnable") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.vapStatsEnable; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_BSSTransitionImplemented", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_BSSTransitionImplemented") == 0) { /* collect value */ if(isVapHotspot(vap_index) || isVapSTAMesh(vap_index) || (vap_index == 3)) @@ -6527,31 +6525,31 @@ AccessPoint_GetParamBoolValue } return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_BSSTransitionActivated", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_BSSTransitionActivated") == 0) { /* collect value */ *pBool = pcfg->u.bss_info.bssTransitionActivated; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_NeighborReportActivated", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_NeighborReportActivated") == 0) { *pBool = pcfg->u.bss_info.nbrReportActivated; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_WirelessManagementImplemented", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_WirelessManagementImplemented") == 0) { *pBool = 1; return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingApplySettings", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingApplySettings") == 0) { /* always return true when get */ *pBool = TRUE; return TRUE; } - if( AnscEqualString(ParamName, "Connected_Building_Enabled", TRUE)) { + if (strcmp(ParamName, "Connected_Building_Enabled") == 0) { if(isVapHotspot(vap_index)) { *pBool = pcfg->u.bss_info.connected_building_enabled; } else { @@ -6559,7 +6557,7 @@ AccessPoint_GetParamBoolValue } } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_HostapMgtFrameCtrl", TRUE)) { + if (strcmp(ParamName, "X_RDKCENTRAL-COM_HostapMgtFrameCtrl") == 0) { *pBool = pcfg->u.bss_info.hostap_mgt_frame_ctrl; return TRUE; } @@ -6629,7 +6627,7 @@ AccessPoint_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_WmmNoAck", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_WmmNoAck") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { *pInt = 0; @@ -6638,27 +6636,27 @@ AccessPoint_GetParamIntValue *pInt = pcfg->u.bss_info.wmmNoAck; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_MulticastRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MulticastRate") == 0) { *pInt = cfg->multicast_rate; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssMaxNumSta", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssMaxNumSta") == 0) { *pInt = pcfg->u.bss_info.bssMaxSta; return TRUE; } - if( AnscEqualString(ParamName, "MLD_ID", TRUE)) + if (strcmp(ParamName, "MLD_ID") == 0) { *pInt = pcfg->u.bss_info.mld_info.common_info.mld_id; return TRUE; } - if( AnscEqualString(ParamName, "MLD_Link_ID", TRUE)) + if (strcmp(ParamName, "MLD_Link_ID") == 0) { *pInt = pcfg->u.bss_info.mld_info.common_info.mld_link_id; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssUserStatus", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssUserStatus") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { *pInt = (pcfg->u.sta_info.enabled == TRUE)? 1 : 2; @@ -6667,7 +6665,7 @@ AccessPoint_GetParamIntValue *pInt = (pcfg->u.bss_info.enabled == TRUE)? 1 : 2; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ManagementFramePowerControl", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ManagementFramePowerControl") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { *pInt = 0; @@ -6679,7 +6677,7 @@ AccessPoint_GetParamIntValue CcspTraceWarning(("X_RDKCENTRAL-COM_ManagementFramePowerControl_Get:<%d>\n", pcfg->u.bss_info.mgmtPowerControl)); return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_rapidReconnectMaxTime", TRUE) ) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_rapidReconnectMaxTime") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { *pInt = 180; @@ -6755,7 +6753,7 @@ AccessPoint_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Status", TRUE)) + if (strcmp(ParamName, "Status") == 0) { /* collect value */ if (isVapSTAMesh(pcfg->vap_index)) { @@ -6781,51 +6779,51 @@ AccessPoint_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "RetryLimit", TRUE)) + if (strcmp(ParamName, "RetryLimit") == 0) { *puLong = cfg->retry_limit; return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_LongRetryLimit", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_LongRetryLimit") == 0) { *puLong = cfg->long_retry_limit; return TRUE; } - if (AnscEqualString(ParamName, "MaxAssociatedDevices", TRUE)) + if (strcmp(ParamName, "MaxAssociatedDevices") == 0) { *puLong = pcfg->u.bss_info.bssMaxSta; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThreshold", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThreshold") == 0) { *puLong = cfg->associated_devices_highwatermark_threshold; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThresholdReached", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThresholdReached") == 0) { *puLong = 3; return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermark", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermark") == 0) { *puLong = 3; return TRUE; } //zqiu - if( AnscEqualString(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkDate", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkDate") == 0) { //TODO: need cacultion for the time *puLong = AnscGetTickInSeconds(); return TRUE; } - if (AnscEqualString(ParamName, "X_COMCAST-COM_TXOverflow", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_TXOverflow") == 0) { *puLong = cfg->txoverflow; return TRUE; @@ -6894,19 +6892,19 @@ AccessPoint_GetParamStringValue instance_number = convert_vap_name_to_index(&((webconfig_dml_t *)get_webconfig_dml())->hal_cap.wifi_prop, pcfg->vap_name)+1; /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Alias", TRUE)) + if (strcmp(ParamName, "Alias") == 0) { snprintf(pValue,*pUlSize,"AccessPoint%d",instance_number); return 0; } - if( AnscEqualString(ParamName, "SSIDReference", TRUE)) + if (strcmp(ParamName, "SSIDReference") == 0) { snprintf(pValue,*pUlSize,"Device.WiFi.SSID.%d.",instance_number); return 0; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_BeaconRate", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_BeaconRate") == 0) { if (isVapSTAMesh(pcfg->vap_index)) { AnscCopyString(pValue, "6Mbps"); @@ -6917,7 +6915,7 @@ AccessPoint_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MAC_FilteringMode", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_MAC_FilteringMode") == 0) { if (isVapHotspot(pcfg->vap_index)) { snprintf(pValue, *pUlSize, "%s", "Deny"); @@ -7043,7 +7041,7 @@ AccessPoint_SetParamBoolValue return FALSE; } - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { if (global_wifi_config->global_parameters.force_disable_radio_feature) { @@ -7067,7 +7065,7 @@ AccessPoint_SetParamBoolValue } //Following parameters are nots supported in Mesh STA Mode - if( AnscEqualString(ParamName, "IsolationEnable", TRUE)) + if (strcmp(ParamName, "IsolationEnable") == 0) { if ( vapInfo->u.bss_info.isolation == bValue ) { @@ -7080,7 +7078,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "SSIDAdvertisementEnabled", TRUE)) + if (strcmp(ParamName, "SSIDAdvertisementEnabled") == 0) { if ( vapInfo->u.bss_info.showSsid == bValue ) { @@ -7093,7 +7091,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "MLD_Enable", TRUE)) + if (strcmp(ParamName, "MLD_Enable") == 0) { if ( vapInfo->u.bss_info.mld_info.common_info.mld_enable == bValue ) { @@ -7106,7 +7104,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "MLD_Apply", TRUE)) + if (strcmp(ParamName, "MLD_Apply") == 0) { if ( vapInfo->u.bss_info.mld_info.common_info.mld_apply == bValue ) { @@ -7119,7 +7117,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "WMMEnable", TRUE)) + if (strcmp(ParamName, "WMMEnable") == 0) { if ( vapInfo->u.bss_info.wmm_enabled == bValue ) { @@ -7132,7 +7130,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "UAPSDEnable", TRUE)) + if (strcmp(ParamName, "UAPSDEnable") == 0) { if ( vapInfo->u.bss_info.UAPSDEnabled == bValue ) { @@ -7144,12 +7142,12 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssCountStaAsCpe", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssCountStaAsCpe") == 0) { cfg->bss_count_sta_as_cpe = bValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssHotSpot", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssHotSpot") == 0) { if ( vapInfo->u.bss_info.bssHotspot == bValue ) { @@ -7161,14 +7159,14 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_KickAssocDevices", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_KickAssocDevices") == 0) { cfg->kick_assoc_devices = bValue; return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_BSSTransitionActivated", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_BSSTransitionActivated") == 0) { if ( vapInfo->u.bss_info.bssTransitionActivated == bValue ) { @@ -7184,7 +7182,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_rapidReconnectCountEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_rapidReconnectCountEnable") == 0) { if ( vapInfo->u.bss_info.rapidReconnectEnable == bValue ) { @@ -7195,7 +7193,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_StatsEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_StatsEnable") == 0) { if ( vapInfo->u.bss_info.vapStatsEnable == bValue ) @@ -7207,7 +7205,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_NeighborReportActivated", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_NeighborReportActivated") == 0) { if ( vapInfo->u.bss_info.nbrReportActivated == bValue ) @@ -7224,7 +7222,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingServiceEnable") == 0) { if ( vapInfo->u.bss_info.interworking.interworking.interworkingEnabled == bValue ) @@ -7237,7 +7235,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_InterworkingApplySettings", TRUE )) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_InterworkingApplySettings") == 0) { if (bValue == TRUE){ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d X_RDKCENTRAL-COM_InterworkingApplySettings push to queue \n",__func__, __LINE__); @@ -7252,7 +7250,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "connected_building_enabled", TRUE)) + if (strcmp(ParamName, "connected_building_enabled") == 0) { if (!isVapHotspot(instance_number-1)) { @@ -7265,7 +7263,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_HostapMgtFrameCtrl", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_HostapMgtFrameCtrl") == 0) { vapInfo->u.bss_info.hostap_mgt_frame_ctrl = bValue; set_dml_cache_vap_config_changed(instance_number - 1); @@ -7355,7 +7353,7 @@ AccessPoint_SetParamIntValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_WmmNoAck", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_WmmNoAck") == 0) { if (vapInfo->u.bss_info.wmmNoAck == (UINT) iValue ) { @@ -7367,13 +7365,13 @@ AccessPoint_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_MulticastRate", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_MulticastRate") == 0) { cfg->multicast_rate = iValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_BssMaxNumSta", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_BssMaxNumSta") == 0) { if (vapInfo->u.bss_info.bssMaxSta == (UINT) iValue) { @@ -7387,7 +7385,7 @@ AccessPoint_SetParamIntValue return (TRUE); } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_ManagementFramePowerControl", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_ManagementFramePowerControl") == 0) { if((iValue < -20) || (iValue > 0)) { @@ -7406,7 +7404,7 @@ AccessPoint_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_rapidReconnectMaxTime", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_rapidReconnectMaxTime") == 0) { if ( vapInfo->u.bss_info.rapidReconnThreshold == (unsigned int)iValue ) { @@ -7524,19 +7522,19 @@ AccessPoint_SetParamUlongValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "RetryLimit", TRUE)) + if (strcmp(ParamName, "RetryLimit") == 0) { cfg->retry_limit = uValue; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_LongRetryLimit", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_LongRetryLimit") == 0) { cfg->long_retry_limit = uValue; return TRUE; } - if( AnscEqualString(ParamName, "MaxAssociatedDevices", TRUE)) + if (strcmp(ParamName, "MaxAssociatedDevices") == 0) { if (isVapSTAMesh(vapInfo->vap_index)) { @@ -7555,7 +7553,7 @@ AccessPoint_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThreshold", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AssociatedDevicesHighWatermarkThreshold") == 0) { cfg->associated_devices_highwatermark_threshold = uValue; return TRUE; @@ -7875,7 +7873,7 @@ Security_GetParamBoolValue return FALSE; } } - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_TransitionDisable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_TransitionDisable") == 0) { CosaWiFiDmlGetWPA3TransitionRFC(&WPA3_RFC); @@ -7886,7 +7884,7 @@ Security_GetParamBoolValue } } - if( AnscEqualString(ParamName, "Reset", TRUE)) { + if (strcmp(ParamName, "Reset") == 0) { *pBool = FALSE; } @@ -7931,13 +7929,13 @@ Security_GetParamIntValue int* pInt ) { - if( AnscEqualString(ParamName, "X_CISCO_COM_RadiusReAuthInterval", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RadiusReAuthInterval") == 0) { /* collect value */ *pInt = 0; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_DefaultKey", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DefaultKey") == 0) { /* collect value */ *pInt = 0; @@ -8012,28 +8010,28 @@ Security_GetParamUlongValue } - if( AnscEqualString(ParamName, "RekeyingInterval", TRUE)) + if (strcmp(ParamName, "RekeyingInterval") == 0) { /* collect value */ *puLong = pcfg->rekey_interval; return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_EncryptionMethod", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EncryptionMethod") == 0) { /* collect value */ *puLong = pcfg->encr; return TRUE; } - if( AnscEqualString(ParamName, "RadiusServerPort", TRUE)) + if (strcmp(ParamName, "RadiusServerPort") == 0) { /* collect value */ *puLong = pcfg->u.radius.port; return TRUE; } - if( AnscEqualString(ParamName, "SecondaryRadiusServerPort", TRUE)) + if (strcmp(ParamName, "SecondaryRadiusServerPort") == 0) { /* collect value */ *puLong = pcfg->u.radius.s_port; @@ -8041,7 +8039,7 @@ Security_GetParamUlongValue } - if( AnscEqualString(ParamName, "RadiusDASPort", TRUE)) + if (strcmp(ParamName, "RadiusDASPort") == 0) { /* collect value */ *puLong = pcfg->u.radius.dasport; @@ -8170,7 +8168,7 @@ Security_GetParamStringValue /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "ModesSupported", TRUE)) + if (strcmp(ParamName, "ModesSupported") == 0) { /* collect value */ char buf[512] = {0}; @@ -8197,7 +8195,7 @@ Security_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "ModeEnabled", TRUE)) + if (strcmp(ParamName, "ModeEnabled") == 0) { /* collect value */ char buf[32] = {0}; @@ -8211,7 +8209,7 @@ Security_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "WEPKey", TRUE)) + if (strcmp(ParamName, "WEPKey") == 0) { /* WEP Key should always return empty string when read */ AnscCopyString(pValue, ""); @@ -8219,14 +8217,14 @@ Security_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "PreSharedKey", TRUE)) + if (strcmp(ParamName, "PreSharedKey") == 0) { /* PresharedKey should always return empty string when read */ AnscCopyString(pValue, ""); return 0; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DefaultKeyPassphrase", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DefaultKeyPassphrase") == 0) { char password[128] = {0}; @@ -8276,7 +8274,7 @@ Security_GetParamStringValue } } - if( AnscEqualString(ParamName, "SAEPassphrase", TRUE)) + if (strcmp(ParamName, "SAEPassphrase") == 0) { if (AnscSizeOfString(pcfg->u.key.key) > 0) { @@ -8293,21 +8291,21 @@ Security_GetParamStringValue } } - if( AnscEqualString(ParamName, "RadiusSecret", TRUE)) + if (strcmp(ParamName, "RadiusSecret") == 0) { /* Radius Secret should always return empty string when read */ AnscCopyString(pValue, ""); return 0; } - if( AnscEqualString(ParamName, "SecondaryRadiusSecret", TRUE)) + if (strcmp(ParamName, "SecondaryRadiusSecret") == 0) { /* Radius Secret should always return empty string when read */ AnscCopyString(pValue, ""); return 0; } - if( AnscEqualString(ParamName, "RadiusServerIPAddr", TRUE)) + if (strcmp(ParamName, "RadiusServerIPAddr") == 0) { int result; result=strcmp((char *)&pcfg->u.radius.ip,""); @@ -8322,7 +8320,7 @@ Security_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "SecondaryRadiusServerIPAddr", TRUE)) + if (strcmp(ParamName, "SecondaryRadiusServerIPAddr") == 0) { int result; result=strcmp((char *)&pcfg->u.radius.s_ip,""); @@ -8336,18 +8334,18 @@ Security_GetParamStringValue } return 0; } - if( AnscEqualString(ParamName, "MFPConfig", TRUE)) + if (strcmp(ParamName, "MFPConfig") == 0) { convert_security_mode_integer_to_string(pcfg->mfp,pValue); return 0; } - if( AnscEqualString(ParamName, "RadiusDASIPAddr", TRUE)) + if (strcmp(ParamName, "RadiusDASIPAddr") == 0) { getIpStringFromAdrress(pValue,&pcfg->u.radius.dasip); return 0; } - if( AnscEqualString(ParamName, "RadiusDASSecret", TRUE)) + if (strcmp(ParamName, "RadiusDASSecret") == 0) { /* Radius Secret should always return empty string when read */ AnscCopyString(pValue, ""); @@ -8432,7 +8430,7 @@ Security_SetParamBoolValue } } /* check the parameter name and set the corresponding value */ - if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_TransitionDisable", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_TransitionDisable") == 0) { if (radioOperation->band == WIFI_FREQUENCY_6_BAND) { @@ -8458,7 +8456,7 @@ Security_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "Reset", TRUE)) + if (strcmp(ParamName, "Reset") == 0) { return TRUE; } @@ -8506,12 +8504,12 @@ Security_SetParamIntValue ) { /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "X_CISCO_COM_RadiusReAuthInterval", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_RadiusReAuthInterval") == 0) { return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_DefaultKey", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_DefaultKey") == 0) { return TRUE; } @@ -8592,7 +8590,7 @@ Security_SetParamUlongValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "RekeyingInterval", TRUE)) + if (strcmp(ParamName, "RekeyingInterval") == 0) { if ( l_security_cfg->rekey_interval != uValue ) { @@ -8605,7 +8603,7 @@ Security_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_EncryptionMethod", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_EncryptionMethod") == 0) { if ( l_security_cfg->encr != uValue ) { @@ -8617,7 +8615,7 @@ Security_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "RadiusServerPort", TRUE)) + if (strcmp(ParamName, "RadiusServerPort") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -8634,7 +8632,7 @@ Security_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "SecondaryRadiusServerPort", TRUE)) + if (strcmp(ParamName, "SecondaryRadiusServerPort") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -8651,7 +8649,7 @@ Security_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "RadiusDASPort", TRUE)) + if (strcmp(ParamName, "RadiusDASPort") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -9505,19 +9503,19 @@ ConnectionControl_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "ClientForceDisassociation", TRUE)) + if (strcmp(ParamName, "ClientForceDisassociation") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.client_force_disassoc_info); return 0; } - if( AnscEqualString(ParamName, "ClientDenyAssociation", TRUE)) + if (strcmp(ParamName, "ClientDenyAssociation") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.client_deny_assoc_info); return 0; } - if( AnscEqualString(ParamName, "TcmClientDenyAssociation", TRUE)) + if (strcmp(ParamName, "TcmClientDenyAssociation") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.tcm_client_deny_assoc_info); return 0; @@ -9906,13 +9904,13 @@ PreAssocDeny_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "TcmWaitTime", TRUE)) + if (strcmp(ParamName, "TcmWaitTime") == 0) { *pInt = pcfg->u.bss_info.preassoc.time_ms; return TRUE; } - if( AnscEqualString(ParamName, "TcmMinMgmtFrames", TRUE)) + if (strcmp(ParamName, "TcmMinMgmtFrames") == 0) { *pInt = pcfg->u.bss_info.preassoc.min_num_mgmt_frames; return TRUE; @@ -10022,74 +10020,74 @@ PreAssocDeny_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "RssiUpThresholdSupported", TRUE)) + if (strcmp(ParamName, "RssiUpThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, 10 to 100"); return 0; } - if( AnscEqualString(ParamName, "SnrThresholdSupported", TRUE)) + if (strcmp(ParamName, "SnrThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, 1 to 100"); return 0; } - if( AnscEqualString(ParamName, "RssiUpThreshold", TRUE)) + if (strcmp(ParamName, "RssiUpThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.rssi_up_threshold); return 0; } - if( AnscEqualString(ParamName, "SnrThreshold", TRUE)) + if (strcmp(ParamName, "SnrThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.snr_threshold); return 0; } - if( AnscEqualString(ParamName, "CuThresholdSupported", TRUE)) + if (strcmp(ParamName, "CuThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, 0 to 100 (%% in integer)"); return 0; } - if( AnscEqualString(ParamName, "CuThreshold", TRUE)) + if (strcmp(ParamName, "CuThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.cu_threshold); return 0; } - if( AnscEqualString(ParamName, "BasicDataTransmitRates", TRUE)) + if (strcmp(ParamName, "BasicDataTransmitRates") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.basic_data_transmit_rates); return 0; } - if( AnscEqualString(ParamName, "OperationalDataTransmitRates", TRUE)) + if (strcmp(ParamName, "OperationalDataTransmitRates") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.operational_data_transmit_rates); return 0; } - if( AnscEqualString(ParamName, "SupportedDataTransmitRates", TRUE)) + if (strcmp(ParamName, "SupportedDataTransmitRates") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.supported_data_transmit_rates); return 0; } - if( AnscEqualString(ParamName, "MinimumAdvertisedMCS", TRUE)) + if (strcmp(ParamName, "MinimumAdvertisedMCS") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.minimum_advertised_mcs); return 0; } - if( AnscEqualString(ParamName, "6GOpInfoMinRate", TRUE)) + if (strcmp(ParamName, "6GOpInfoMinRate") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.sixGOpInfoMinRate); return 0; } - if( AnscEqualString(ParamName, "TcmExpWeightage", TRUE)) + if (strcmp(ParamName, "TcmExpWeightage") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.tcm_exp_weightage); return 0; } - if( AnscEqualString(ParamName, "TcmGradientThreshold", TRUE)) + if (strcmp(ParamName, "TcmGradientThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.preassoc.tcm_gradient_threshold); return 0; @@ -10197,7 +10195,7 @@ PreAssocDeny_SetParamIntValue return TRUE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "TcmWaitTime", TRUE)) + if (strcmp(ParamName, "TcmWaitTime") == 0) { if (vapInfo->u.bss_info.preassoc.time_ms == iValue) { return TRUE; @@ -10215,7 +10213,7 @@ PreAssocDeny_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "TcmMinMgmtFrames", TRUE)) + if (strcmp(ParamName, "TcmMinMgmtFrames") == 0) { if (vapInfo->u.bss_info.preassoc.min_num_mgmt_frames == iValue) { return TRUE; @@ -10337,7 +10335,7 @@ PreAssocDeny_SetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "RssiUpThreshold", TRUE)) + if (strcmp(ParamName, "RssiUpThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.rssi_up_threshold) == 0) { return TRUE; @@ -10367,7 +10365,7 @@ PreAssocDeny_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "SnrThreshold", TRUE)) + if (strcmp(ParamName, "SnrThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.snr_threshold) == 0) { return TRUE; @@ -10398,7 +10396,7 @@ PreAssocDeny_SetParamStringValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "CuThreshold", TRUE)) + if (strcmp(ParamName, "CuThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.cu_threshold) == 0) { return TRUE; @@ -10428,7 +10426,7 @@ PreAssocDeny_SetParamStringValue return TRUE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "BasicDataTransmitRates", TRUE)) + if (strcmp(ParamName, "BasicDataTransmitRates") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s Rate to set for preassoc\n", __FUNCTION__,__LINE__,pString); @@ -10457,7 +10455,7 @@ PreAssocDeny_SetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "OperationalDataTransmitRates", TRUE)) + if (strcmp(ParamName, "OperationalDataTransmitRates") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s operational Rate to set for preassoc\n", __FUNCTION__,__LINE__,pString); @@ -10486,7 +10484,7 @@ PreAssocDeny_SetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s Not a valid format\n", __FUNCTION__,__LINE__,pString); } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "SupportedDataTransmitRates", TRUE)) + if (strcmp(ParamName, "SupportedDataTransmitRates") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s Supported Rate to set for preassoc\n", __FUNCTION__,__LINE__,pString); if(strcmp(pString, vapInfo->u.bss_info.preassoc.supported_data_transmit_rates) == 0) { @@ -10515,7 +10513,7 @@ PreAssocDeny_SetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "MinimumAdvertisedMCS", TRUE)) + if (strcmp(ParamName, "MinimumAdvertisedMCS") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.minimum_advertised_mcs) == 0) { return TRUE; @@ -10547,7 +10545,7 @@ PreAssocDeny_SetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "6GOpInfoMinRate", TRUE)) + if (strcmp(ParamName, "6GOpInfoMinRate") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.sixGOpInfoMinRate) == 0) { return TRUE; @@ -10565,7 +10563,7 @@ PreAssocDeny_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "TcmExpWeightage", TRUE)) + if (strcmp(ParamName, "TcmExpWeightage") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.tcm_exp_weightage) == 0) { return TRUE; @@ -10584,7 +10582,7 @@ PreAssocDeny_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "TcmGradientThreshold", TRUE)) + if (strcmp(ParamName, "TcmGradientThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.preassoc.tcm_gradient_threshold) == 0) { return TRUE; @@ -10911,61 +10909,61 @@ PostAssocDisc_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "RssiUpThresholdSupported", TRUE)) + if (strcmp(ParamName, "RssiUpThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, -50 to -95"); return 0; } - if( AnscEqualString(ParamName, "RssiUpThreshold", TRUE)) + if (strcmp(ParamName, "RssiUpThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.rssi_up_threshold); return 0; } - if( AnscEqualString(ParamName, "SamplingIntervalSupported", TRUE)) + if (strcmp(ParamName, "SamplingIntervalSupported") == 0) { snprintf(pValue,*pUlSize,"1 to 10"); return 0; } - if( AnscEqualString(ParamName, "SamplingInterval", TRUE)) + if (strcmp(ParamName, "SamplingInterval") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.sampling_interval); return 0; } - if( AnscEqualString(ParamName, "SnrThresholdSupported", TRUE)) + if (strcmp(ParamName, "SnrThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, 1 to 100"); return 0; } - if( AnscEqualString(ParamName, "SnrThreshold", TRUE)) + if (strcmp(ParamName, "SnrThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.snr_threshold); return 0; } - if( AnscEqualString(ParamName, "SamplingCountSupported", TRUE)) + if (strcmp(ParamName, "SamplingCountSupported") == 0) { snprintf(pValue,*pUlSize,"1 to 10"); return 0; } - if( AnscEqualString(ParamName, "SamplingCount", TRUE)) + if (strcmp(ParamName, "SamplingCount") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.sampling_count); return 0; } - if( AnscEqualString(ParamName, "CuThresholdSupported", TRUE)) + if (strcmp(ParamName, "CuThresholdSupported") == 0) { snprintf(pValue,*pUlSize,"disabled, 0 to 100"); return 0; } - if( AnscEqualString(ParamName, "CuThreshold", TRUE)) + if (strcmp(ParamName, "CuThreshold") == 0) { snprintf(pValue,*pUlSize,pcfg->u.bss_info.postassoc.cu_threshold); return 0; @@ -11155,7 +11153,7 @@ PostAssocDisc_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "RssiUpThreshold", TRUE)) + if (strcmp(ParamName, "RssiUpThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.rssi_up_threshold) == 0) { return TRUE; @@ -11185,7 +11183,7 @@ PostAssocDisc_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "SamplingInterval", TRUE)) + if (strcmp(ParamName, "SamplingInterval") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.sampling_interval) == 0) { return TRUE; @@ -11209,7 +11207,7 @@ PostAssocDisc_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "SnrThreshold", TRUE)) + if (strcmp(ParamName, "SnrThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.snr_threshold) == 0) { return TRUE; @@ -11239,7 +11237,7 @@ PostAssocDisc_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "SamplingCount", TRUE)) + if (strcmp(ParamName, "SamplingCount") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.sampling_count) == 0) { return TRUE; @@ -11263,7 +11261,7 @@ PostAssocDisc_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "CuThreshold", TRUE)) + if (strcmp(ParamName, "CuThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.cu_threshold) == 0) { return TRUE; @@ -11475,7 +11473,7 @@ WPS_GetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { *pBool = pcfg->u.bss_info.wps.enable; return TRUE; @@ -11531,7 +11529,7 @@ WPS_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if (AnscEqualString(ParamName, "X_CISCO_COM_WpsPushButton", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_WpsPushButton") == 0) { *pInt = pcfg->u.bss_info.wpsPushButton; return TRUE; @@ -11649,7 +11647,7 @@ WPS_GetParamStringValue return FALSE; } - if( AnscEqualString(ParamName, "ConfigMethodsSupported", TRUE)) { + if (strcmp(ParamName, "ConfigMethodsSupported") == 0) { char buf[512] = {0}; if (cfg->wps_methods & WIFI_ONBOARDINGMETHODS_USBFLASHDRIVE ) { @@ -11748,7 +11746,7 @@ WPS_GetParamStringValue } } - if( AnscEqualString(ParamName, "ConfigMethodsEnabled", TRUE)) + if (strcmp(ParamName, "ConfigMethodsEnabled") == 0) { /* collect value */ char buf[512] = {0}; @@ -11850,7 +11848,7 @@ WPS_GetParamStringValue } } - if (AnscEqualString(ParamName, "X_CISCO_COM_Pin", TRUE)) { + if (strcmp(ParamName, "X_CISCO_COM_Pin") == 0) { if ( AnscSizeOfString(cfg->wps_pin) > 0 ) { if ( AnscSizeOfString(cfg->wps_pin) < *pUlSize) { @@ -11927,14 +11925,14 @@ WPS_SetParamBoolValue return TRUE; } /* check the parameter name and set the corresponding value */ - if (AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { if (vapInfo->u.bss_info.wps.enable != bValue) { vapInfo->u.bss_info.wps.enable = bValue; set_dml_cache_vap_config_changed(instance_number - 1); } return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ActivatePushButton", TRUE)) { + if (strcmp(ParamName, "X_CISCO_COM_ActivatePushButton") == 0) { if (vapInfo->u.bss_info.wpsPushButton != bValue) { wifi_util_dbg_print(WIFI_DMCLI, "%s:%d:key=%d bValue=%d\n", __func__, __LINE__, vapInfo->u.bss_info.wpsPushButton, bValue); @@ -11943,7 +11941,7 @@ WPS_SetParamBoolValue } return TRUE; } - if( AnscEqualString(ParamName, "X_CISCO_COM_CancelSession", TRUE)) + if (strcmp(ParamName, "X_CISCO_COM_CancelSession") == 0) { instance_number -= 1; wifi_util_dbg_print(WIFI_DMCLI,"%s:%d: WPS cancel for vap %d\n",__func__, __LINE__, instance_number); @@ -11997,7 +11995,7 @@ WPS_SetParamIntValue /* check the parameter name and set the corresponding value */ #ifdef FEATURE_SUPPORT_WPS - if (AnscEqualString(ParamName, "X_CISCO_COM_WpsPushButton", TRUE)) { + if (strcmp(ParamName, "X_CISCO_COM_WpsPushButton") == 0) { return TRUE; } #else @@ -12099,7 +12097,7 @@ WPS_SetParamIntValue return FALSE; } /* check the parameter name and set the corresponding value */ - if (AnscEqualString(ParamName, "ConfigMethodsEnabled", TRUE)) { + if (strcmp(ParamName, "ConfigMethodsEnabled") == 0) { int match = 0; if (isVapSTAMesh(pcfg->vap_index)) { @@ -12161,7 +12159,7 @@ WPS_SetParamIntValue return TRUE; } - if (AnscEqualString(ParamName, "X_CISCO_COM_ClientPin", TRUE)) { + if (strcmp(ParamName, "X_CISCO_COM_ClientPin") == 0) { if ((strlen(pString) >= 4) && (strlen(pString) <= 8)) { push_wps_pin_dml_to_ctrl_queue((instance_number - 1), pString); } else { @@ -12458,7 +12456,7 @@ InterworkingElement_GetParamBoolValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Internet", TRUE)) + if (strcmp(ParamName, "Internet") == 0) { /* collect value */ if(isVapHotspot(vap_pcfg->vap_index)) @@ -12473,34 +12471,34 @@ InterworkingElement_GetParamBoolValue } } - if( AnscEqualString(ParamName, "ASRA", TRUE)) + if (strcmp(ParamName, "ASRA") == 0) { /* collect value */ *pBool = pcfg->interworking.asra; return TRUE; } - if( AnscEqualString(ParamName, "ESR", TRUE)) + if (strcmp(ParamName, "ESR") == 0) { /* collect value */ *pBool = pcfg->interworking.esr; return TRUE; } - if( AnscEqualString(ParamName, "UESA", TRUE)) + if (strcmp(ParamName, "UESA") == 0) { /* collect value */ *pBool = pcfg->interworking.uesa; return TRUE; } - if( AnscEqualString(ParamName, "VenueOptionPresent", TRUE)) + if (strcmp(ParamName, "VenueOptionPresent") == 0) { *pBool = pcfg->interworking.venueOptionPresent; return TRUE; } - if( AnscEqualString(ParamName, "HESSOptionPresent", TRUE)) + if (strcmp(ParamName, "HESSOptionPresent") == 0) { /* collect value */ *pBool = pcfg->interworking.hessOptionPresent; @@ -12614,7 +12612,7 @@ InterworkingElement_GetParamUlongValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "AccessNetworkType", TRUE)) + if (strcmp(ParamName, "AccessNetworkType") == 0) { /* collect value */ *puLong = pcfg->interworking.accessNetworkType; @@ -12691,7 +12689,7 @@ InterworkingElement_GetParamStringValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "HESSID", TRUE)) + if (strcmp(ParamName, "HESSID") == 0) { /* collect value */ AnscCopyString(pValue, pcfg->interworking.hessid); @@ -12761,7 +12759,7 @@ InterworkingElement_SetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Internet", TRUE)) + if (strcmp(ParamName, "Internet") == 0) { if(vapInfo->u.bss_info.interworking.interworking.internetAvailable == bValue) { @@ -12773,7 +12771,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "ASRA", TRUE)) + if (strcmp(ParamName, "ASRA") == 0) { if(vapInfo->u.bss_info.interworking.interworking.asra == bValue) { @@ -12785,7 +12783,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "ESR", TRUE)) + if (strcmp(ParamName, "ESR") == 0) { if(vapInfo->u.bss_info.interworking.interworking.esr == bValue) { @@ -12797,7 +12795,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "UESA", TRUE)) + if (strcmp(ParamName, "UESA") == 0) { if(vapInfo->u.bss_info.interworking.interworking.uesa == bValue) { @@ -12809,7 +12807,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "VenueOptionPresent", TRUE)) + if (strcmp(ParamName, "VenueOptionPresent") == 0) { if(vapInfo->u.bss_info.interworking.interworking.venueOptionPresent == bValue) { @@ -12821,7 +12819,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "HESSOptionPresent", TRUE)) + if (strcmp(ParamName, "HESSOptionPresent") == 0) { if(vapInfo->u.bss_info.interworking.interworking.hessOptionPresent == bValue) { @@ -12941,7 +12939,7 @@ InterworkingElement_SetParamUlongValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "AccessNetworkType", TRUE)) + if (strcmp(ParamName, "AccessNetworkType") == 0) { if ((uValue < 6) || ((uValue < 16) && (uValue > 13))) { @@ -13019,7 +13017,7 @@ InterworkingElement_SetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "HESSID", TRUE)) + if (strcmp(ParamName, "HESSID") == 0) { AnscCopyString(vapInfo->u.bss_info.interworking.interworking.hessid, pString); set_dml_cache_vap_config_changed(instance_number - 1); @@ -13348,14 +13346,14 @@ BOOL InterworkingElement_Venue_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "Type", TRUE)) + if (strcmp(ParamName, "Type") == 0) { /* collect value */ *puLong = pcfg->interworking.venueType; return TRUE; } - if( AnscEqualString(ParamName, "Group", TRUE)) + if (strcmp(ParamName, "Group") == 0) { /* collect value */ *puLong = pcfg->interworking.venueGroup; @@ -13420,7 +13418,7 @@ InterworkingElement_Venue_SetParamUlongValue return FALSE; } - if( AnscEqualString(ParamName, "Type", TRUE)) + if (strcmp(ParamName, "Type") == 0) { int updateInvalidType = 0; if (uValue < 256) @@ -13521,7 +13519,7 @@ InterworkingElement_Venue_SetParamUlongValue } } - if( AnscEqualString(ParamName, "Group", TRUE)) + if (strcmp(ParamName, "Group") == 0) { if (uValue < 12) { @@ -13552,33 +13550,33 @@ InterworkingElement_GetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); - if( AnscEqualString(ParamName, "Internet", TRUE)) + if (strcmp(ParamName, "Internet") == 0) { *pBool = false; return TRUE; } - if( AnscEqualString(ParamName, "ASRA", TRUE)) + if (strcmp(ParamName, "ASRA") == 0) { *pBool = false; return TRUE; } - if( AnscEqualString(ParamName, "ESR", TRUE)) + if (strcmp(ParamName, "ESR") == 0) { *pBool = false; return TRUE; } - if( AnscEqualString(ParamName, "UESA", TRUE)) + if (strcmp(ParamName, "UESA") == 0) { *pBool = false; return TRUE; } - if( AnscEqualString(ParamName, "VenueOptionPresent", TRUE)) + if (strcmp(ParamName, "VenueOptionPresent") == 0) { *pBool = false; return TRUE; } - if( AnscEqualString(ParamName, "HESSOptionPresent", TRUE)) + if (strcmp(ParamName, "HESSOptionPresent") == 0) { *pBool = false; return TRUE; @@ -13612,7 +13610,7 @@ InterworkingElement_GetParamUlongValue ) { UNREFERENCED_PARAMETER(hInsContext); - if( AnscEqualString(ParamName, "AccessNetworkType", TRUE)) + if (strcmp(ParamName, "AccessNetworkType") == 0) { *puLong = 0; return TRUE; @@ -13631,7 +13629,7 @@ InterworkingElement_GetParamStringValue ) { UNREFERENCED_PARAMETER(hInsContext); - if( AnscEqualString(ParamName, "HESSID", TRUE)) + if (strcmp(ParamName, "HESSID") == 0) { AnscCopyString(pValue, "no support for non xb3"); *pUlSize = AnscSizeOfString(pValue); @@ -13651,14 +13649,14 @@ InterworkingElement_Venue_GetParamUlongValue ) { UNREFERENCED_PARAMETER(hInsContext); - if( AnscEqualString(ParamName, "Type", TRUE)) + if (strcmp(ParamName, "Type") == 0) { /* collect value */ *puLong = 0; return TRUE; } - if( AnscEqualString(ParamName, "Group", TRUE)) + if (strcmp(ParamName, "Group") == 0) { /* collect value */ *puLong = 0; @@ -13813,7 +13811,7 @@ GASConfig_GetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } - if( AnscEqualString(ParamName, "PauseForServerResponse", TRUE)) + if (strcmp(ParamName, "PauseForServerResponse") == 0) { /* collect value */ *pBool = pcfg->PauseForServerResponse; @@ -13870,27 +13868,27 @@ GASConfig_GetParamUlongValue return FALSE; } /* collect value */ - if( AnscEqualString(ParamName, "AdvertisementID", TRUE)) + if (strcmp(ParamName, "AdvertisementID") == 0) { *puLong = pcfg->AdvertisementID; return TRUE; } - if( AnscEqualString(ParamName, "ResponseTimeout", TRUE)) + if (strcmp(ParamName, "ResponseTimeout") == 0) { *puLong = pcfg->ResponseTimeout; return TRUE; } - if( AnscEqualString(ParamName, "ComeBackDelay", TRUE)) + if (strcmp(ParamName, "ComeBackDelay") == 0) { *puLong = pcfg->ComeBackDelay; return TRUE; } - if( AnscEqualString(ParamName, "ResponseBufferingTime", TRUE)) + if (strcmp(ParamName, "ResponseBufferingTime") == 0) { *puLong = pcfg->ResponseBufferingTime; return TRUE; } - if( AnscEqualString(ParamName, "QueryResponseLengthLimit", TRUE)) + if (strcmp(ParamName, "QueryResponseLengthLimit") == 0) { *puLong = pcfg->QueryResponseLengthLimit; return TRUE; @@ -14041,49 +14039,49 @@ GASStats_GetParamUlongValue return FALSE; } /* collect value */ - if( AnscEqualString(ParamName, "AdvertisementID", TRUE)) + if (strcmp(ParamName, "AdvertisementID") == 0) { *puLong = pGASStats->AdvertisementID; return TRUE; } - if( AnscEqualString(ParamName, "Queries", TRUE)) + if (strcmp(ParamName, "Queries") == 0) { *puLong = pGASStats->Queries; return TRUE; } - if( AnscEqualString(ParamName, "QueryRate", TRUE)) + if (strcmp(ParamName, "QueryRate") == 0) { *puLong = pGASStats->QueryRate; return TRUE; } - if( AnscEqualString(ParamName, "Responses", TRUE)) + if (strcmp(ParamName, "Responses") == 0) { *puLong = pGASStats->Responses; return TRUE; } - if( AnscEqualString(ParamName, "ResponseRate", TRUE)) + if (strcmp(ParamName, "ResponseRate") == 0) { *puLong = pGASStats->ResponseRate; return TRUE; } - if( AnscEqualString(ParamName, "NoRequestOutstanding", TRUE)) + if (strcmp(ParamName, "NoRequestOutstanding") == 0) { *puLong = pGASStats->NoRequestOutstanding; return TRUE; } - if( AnscEqualString(ParamName, "ResponsesDiscarded", TRUE)) + if (strcmp(ParamName, "ResponsesDiscarded") == 0) { *puLong = pGASStats->ResponsesDiscarded; return TRUE; } - if( AnscEqualString(ParamName, "FailedResponses", TRUE)) + if (strcmp(ParamName, "FailedResponses") == 0) { *puLong = pGASStats->FailedResponses; @@ -14163,7 +14161,7 @@ MacFilter_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { /* collect value */ if(isVapHotspot(vapInfo->vap_index)){ @@ -14174,7 +14172,7 @@ MacFilter_GetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "FilterAsBlackList", TRUE)) + if (strcmp(ParamName, "FilterAsBlackList") == 0) { /* collect value */ if ((vapInfo->u.bss_info.mac_filter_enable == true) && vapInfo->u.bss_info.mac_filter_mode == wifi_mac_filter_mode_black_list) { @@ -14402,7 +14400,7 @@ MacFilter_SetParamBoolValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { /* save update to backup */ if (vapInfo->u.bss_info.mac_filter_enable != bValue) @@ -14413,7 +14411,7 @@ MacFilter_SetParamBoolValue } return TRUE; } - if( AnscEqualString(ParamName, "FilterAsBlackList", TRUE)) + if (strcmp(ParamName, "FilterAsBlackList") == 0) { /* save update to backup */ if (vapInfo->u.bss_info.mac_filter_mode != !bValue) @@ -14843,7 +14841,7 @@ DPP_GetParamUlongValue ULONG* puLong ) { - if (AnscEqualString(ParamName, "Version", TRUE)) + if (strcmp(ParamName, "Version") == 0) { return TRUE; } @@ -14897,12 +14895,12 @@ DPP_GetParamStringValue ULONG* pUlSize ) { - if( AnscEqualString(ParamName, "PrivateSigningKey", TRUE)) + if (strcmp(ParamName, "PrivateSigningKey") == 0) { AnscCopyString(pValue, ""); return 0; } - if( AnscEqualString(ParamName, "PrivateReconfigAccessKey", TRUE)) + if (strcmp(ParamName, "PrivateReconfigAccessKey") == 0) { AnscCopyString(pValue, ""); return 0; @@ -15990,7 +15988,7 @@ AssociatedDevice1_GetParamBoolValue pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "AuthenticationState", TRUE)) + if (strcmp(ParamName, "AuthenticationState") == 0) { /* collect value */ *pBool = assoc_dev_data->dev_stats.cli_AuthenticationState; @@ -15998,7 +15996,7 @@ AssociatedDevice1_GetParamBoolValue return TRUE; } - if( AnscEqualString(ParamName, "Active", TRUE)) + if (strcmp(ParamName, "Active") == 0) { /* collect value */ *pBool = assoc_dev_data->dev_stats.cli_Active; @@ -16089,7 +16087,7 @@ AssociatedDevice1_GetParamIntValue pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "SignalStrength", TRUE)) + if (strcmp(ParamName, "SignalStrength") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_SignalStrength; @@ -16098,7 +16096,7 @@ AssociatedDevice1_GetParamIntValue } - if( AnscEqualString(ParamName, "X_COMCAST-COM_SNR", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_SNR") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_SNR; @@ -16106,7 +16104,7 @@ AssociatedDevice1_GetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_RDKCENTRAL-COM_SNR", TRUE)) + if (strcmp(ParamName, "X_RDKCENTRAL-COM_SNR") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_SNR; @@ -16114,7 +16112,7 @@ AssociatedDevice1_GetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_RSSI", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_RSSI") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_RSSI; @@ -16122,7 +16120,7 @@ AssociatedDevice1_GetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MinRSSI", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_MinRSSI") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_MinRSSI; @@ -16130,7 +16128,7 @@ AssociatedDevice1_GetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_MaxRSSI", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_MaxRSSI") == 0) { /* collect value */ *pInt = assoc_dev_data->dev_stats.cli_MaxRSSI; @@ -16218,7 +16216,7 @@ AssociatedDevice1_GetParamUlongValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - if( AnscEqualString(ParamName, "LastDataDownlinkRate", TRUE)) + if (strcmp(ParamName, "LastDataDownlinkRate") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_LastDataDownlinkRate; @@ -16226,7 +16224,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "LastDataUplinkRate", TRUE)) + if (strcmp(ParamName, "LastDataUplinkRate") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_LastDataUplinkRate; @@ -16234,7 +16232,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "Retransmissions", TRUE)) + if (strcmp(ParamName, "Retransmissions") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_Retransmissions; @@ -16242,7 +16240,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DataFramesSentAck", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentAck") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentAck; @@ -16250,7 +16248,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_DataFramesSentNoAck", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentNoAck") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentNoAck; @@ -16258,7 +16256,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_BytesSent", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_BytesSent") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_BytesSent; @@ -16266,7 +16264,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_BytesReceived", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_BytesReceived") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_BytesReceived; @@ -16274,7 +16272,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_Disassociations", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_Disassociations") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_Disassociations; @@ -16282,7 +16280,7 @@ AssociatedDevice1_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_AuthenticationFailures", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_AuthenticationFailures") == 0) { /* collect value */ *puLong = assoc_dev_data->dev_stats.cli_AuthenticationFailures; @@ -16381,7 +16379,7 @@ AssociatedDevice1_GetParamStringValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - if( AnscEqualString(ParamName, "MACAddress", TRUE)) + if (strcmp(ParamName, "MACAddress") == 0) { char p_mac[18]; snprintf(p_mac, 18, "%02x:%02x:%02x:%02x:%02x:%02x", assoc_dev_data->dev_stats.cli_MACAddress[0], assoc_dev_data->dev_stats.cli_MACAddress[1], assoc_dev_data->dev_stats.cli_MACAddress[2], @@ -16401,7 +16399,7 @@ AssociatedDevice1_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_OperatingStandard", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_OperatingStandard") == 0) { /* collect value */ rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingStandard); @@ -16410,7 +16408,7 @@ AssociatedDevice1_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_OperatingChannelBandwidth", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_OperatingChannelBandwidth") == 0) { /* collect value */ rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingChannelBandwidth); @@ -16419,7 +16417,7 @@ AssociatedDevice1_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_InterferenceSources", TRUE)) + if (strcmp(ParamName, "X_COMCAST-COM_InterferenceSources") == 0) { /* collect value */ rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_InterferenceSources); @@ -16662,7 +16660,7 @@ Stats_GetParamUlongValue pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "BytesSent", TRUE)) + if (strcmp(ParamName, "BytesSent") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_BytesSent; @@ -16670,7 +16668,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "BytesReceived", TRUE)) + if (strcmp(ParamName, "BytesReceived") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_BytesReceived; @@ -16678,7 +16676,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "PacketsSent", TRUE)) + if (strcmp(ParamName, "PacketsSent") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_PacketsSent; @@ -16686,7 +16684,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "PacketsReceived", TRUE)) + if (strcmp(ParamName, "PacketsReceived") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_PacketsReceived; @@ -16694,7 +16692,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "ErrorsSent", TRUE)) + if (strcmp(ParamName, "ErrorsSent") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_ErrorsSent; @@ -16702,7 +16700,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "RetransCount", TRUE)) + if (strcmp(ParamName, "RetransCount") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_RetransCount; @@ -16710,7 +16708,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "FailedRetransCount", TRUE)) + if (strcmp(ParamName, "FailedRetransCount") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_FailedRetransCount; @@ -16718,7 +16716,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "RetryCount", TRUE)) + if (strcmp(ParamName, "RetryCount") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_RetryCount; @@ -16726,7 +16724,7 @@ Stats_GetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "MultipleRetryCount", TRUE)) + if (strcmp(ParamName, "MultipleRetryCount") == 0) { /* collect value */ *pULong = assoc_dev_data->dev_stats.cli_MultipleRetryCount; @@ -16778,7 +16776,7 @@ Stats_GetParamBoolValue { UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "InstantMeasurementsEnable", TRUE)) + if (strcmp(ParamName, "InstantMeasurementsEnable") == 0) { /* collect value */ return TRUE; @@ -16820,7 +16818,7 @@ WEPKey64Bit_GetParamStringValue ) { - if (AnscEqualString(ParamName, "WEPKey", TRUE)) + if (strcmp(ParamName, "WEPKey") == 0) { return 0; } @@ -16837,7 +16835,7 @@ WEPKey64Bit_SetParamStringValue ) { - if (AnscEqualString(ParamName, "WEPKey", TRUE)) + if (strcmp(ParamName, "WEPKey") == 0) { return TRUE; } @@ -16905,7 +16903,7 @@ WEPKey128Bit_GetParamStringValue ) { - if (AnscEqualString(ParamName, "WEPKey", TRUE)) + if (strcmp(ParamName, "WEPKey") == 0) { return 0; } @@ -16922,7 +16920,7 @@ WEPKey128Bit_SetParamStringValue ) { - if (AnscEqualString(ParamName, "WEPKey", TRUE)) + if (strcmp(ParamName, "WEPKey") == 0) { return TRUE; } @@ -16992,7 +16990,7 @@ RadiusSettings_GetParamBoolValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "PMKCaching", TRUE)) + if (strcmp(ParamName, "PMKCaching") == 0) { /* collect value */ *pBool = l_security_cfg->disable_pmksa_caching; @@ -17036,53 +17034,53 @@ RadiusSettings_GetParamIntValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "RadiusServerRetries", TRUE)) + if (strcmp(ParamName, "RadiusServerRetries") == 0) { /* collect value */ *pInt = l_security_cfg->u.radius.server_retries; return TRUE; } - if( AnscEqualString(ParamName, "RadiusServerRequestTimeout", TRUE)) + if (strcmp(ParamName, "RadiusServerRequestTimeout") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "PMKLifetime", TRUE)) + if (strcmp(ParamName, "PMKLifetime") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "PMKCacheInterval", TRUE)) + if (strcmp(ParamName, "PMKCacheInterval") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "MaxAuthenticationAttempts", TRUE)) + if (strcmp(ParamName, "MaxAuthenticationAttempts") == 0) { /* collect value */ *pInt = l_security_cfg->u.radius.max_auth_attempts; return TRUE; } - if( AnscEqualString(ParamName, "BlacklistTableTimeout", TRUE)) + if (strcmp(ParamName, "BlacklistTableTimeout") == 0) { /* collect value */ *pInt = l_security_cfg->u.radius.blacklist_table_timeout; return TRUE; } - if( AnscEqualString(ParamName, "IdentityRequestRetryInterval", TRUE)) + if (strcmp(ParamName, "IdentityRequestRetryInterval") == 0) { /* collect value */ *pInt = l_security_cfg->u.radius.identity_req_retry_interval; return TRUE; } - if( AnscEqualString(ParamName, "QuietPeriodAfterFailedAuthentication", TRUE)) + if (strcmp(ParamName, "QuietPeriodAfterFailedAuthentication") == 0) { /* collect value */ *pInt = 0; @@ -17136,7 +17134,7 @@ RadiusSettings_SetParamBoolValue AnscTraceWarning(("ParamName: %s bvalue:%d\n", ParamName, bValue)); /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "PMKCaching", TRUE)) + if (strcmp(ParamName, "PMKCaching") == 0) { /* save update to backup */ wifi_util_dbg_print(WIFI_DMCLI,"%s:%d disable_pmksa_caching=%d Value=%d \n",__func__, __LINE__,l_security_cfg->disable_pmksa_caching,bValue); @@ -17194,7 +17192,7 @@ RadiusSettings_SetParamIntValue AnscTraceWarning(("ParamName: %s iValue: %d\n", ParamName, iValue)); /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "RadiusServerRetries", TRUE)) + if (strcmp(ParamName, "RadiusServerRetries") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -17212,23 +17210,23 @@ RadiusSettings_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "RadiusServerRequestTimeout", TRUE)) + if (strcmp(ParamName, "RadiusServerRequestTimeout") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "PMKLifetime", TRUE)) + if (strcmp(ParamName, "PMKLifetime") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "PMKCacheInterval", TRUE)) + if (strcmp(ParamName, "PMKCacheInterval") == 0) { return TRUE; } - if( AnscEqualString(ParamName, "MaxAuthenticationAttempts", TRUE)) + if (strcmp(ParamName, "MaxAuthenticationAttempts") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -17246,7 +17244,7 @@ RadiusSettings_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "BlacklistTableTimeout", TRUE)) + if (strcmp(ParamName, "BlacklistTableTimeout") == 0) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d blacklist_table_timeout=%d Value=%d \n",__func__, __LINE__,l_security_cfg->u.radius.blacklist_table_timeout,iValue); if(l_security_cfg->u.radius.blacklist_table_timeout == ((unsigned int) iValue)) @@ -17258,7 +17256,7 @@ RadiusSettings_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "IdentityRequestRetryInterval", TRUE)) + if (strcmp(ParamName, "IdentityRequestRetryInterval") == 0) { if (!security_mode_support_radius(l_security_cfg->mode)) { @@ -17275,7 +17273,7 @@ RadiusSettings_SetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "QuietPeriodAfterFailedAuthentication", TRUE)) + if (strcmp(ParamName, "QuietPeriodAfterFailedAuthentication") == 0) { return TRUE; } @@ -17335,42 +17333,42 @@ Authenticator_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "EAPOLKeyTimeout", TRUE)) + if (strcmp(ParamName, "EAPOLKeyTimeout") == 0) { /* collect value */ *puLong = pcfg->eapol_key_timeout; return TRUE; } - if( AnscEqualString(ParamName, "EAPOLKeyRetries", TRUE)) + if (strcmp(ParamName, "EAPOLKeyRetries") == 0) { /* collect value */ *puLong = pcfg->eapol_key_retries; return TRUE; } - if( AnscEqualString(ParamName, "EAPIdentityRequestTimeout", TRUE)) + if (strcmp(ParamName, "EAPIdentityRequestTimeout") == 0) { /* collect value */ *puLong = pcfg->eap_identity_req_timeout; return TRUE; } - if( AnscEqualString(ParamName, "EAPIdentityRequestRetries", TRUE)) + if (strcmp(ParamName, "EAPIdentityRequestRetries") == 0) { /* collect value */ *puLong = pcfg->eap_identity_req_retries ; return TRUE; } - if( AnscEqualString(ParamName, "EAPRequestTimeout", TRUE)) + if (strcmp(ParamName, "EAPRequestTimeout") == 0) { /* collect value */ *puLong = pcfg->eap_req_timeout; return TRUE; } - if( AnscEqualString(ParamName, "EAPRequestRetries", TRUE)) + if (strcmp(ParamName, "EAPRequestRetries") == 0) { /* collect value */ *puLong = pcfg->eap_req_retries ; @@ -17421,7 +17419,7 @@ Authenticator_SetParamUlongValue } } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "EAPOLKeyTimeout", TRUE)) + if (strcmp(ParamName, "EAPOLKeyTimeout") == 0) { if ( l_security_cfg->eapol_key_timeout != uValue ) { @@ -17432,7 +17430,7 @@ Authenticator_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "EAPOLKeyRetries", TRUE)) + if (strcmp(ParamName, "EAPOLKeyRetries") == 0) { if ( l_security_cfg->eapol_key_retries != uValue ) { @@ -17443,7 +17441,7 @@ Authenticator_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "EAPIdentityRequestTimeout", TRUE)) + if (strcmp(ParamName, "EAPIdentityRequestTimeout") == 0) { if ( l_security_cfg->eap_identity_req_timeout != uValue ) { @@ -17454,7 +17452,7 @@ Authenticator_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "EAPIdentityRequestRetries", TRUE)) + if (strcmp(ParamName, "EAPIdentityRequestRetries") == 0) { if ( l_security_cfg->eap_identity_req_retries != uValue ) { @@ -17465,7 +17463,7 @@ Authenticator_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "EAPRequestTimeout", TRUE)) + if (strcmp(ParamName, "EAPRequestTimeout") == 0) { if ( l_security_cfg->eap_req_timeout != uValue ) { @@ -17476,7 +17474,7 @@ Authenticator_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "EAPRequestRetries", TRUE)) + if (strcmp(ParamName, "EAPRequestRetries") == 0) { if ( l_security_cfg->eap_req_retries != uValue ) { @@ -17752,7 +17750,7 @@ MacFiltTab_GetParamStringValue acl_entry_t *acl_entry = (acl_entry_t *)hInsContext; /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "MACAddress", TRUE)) + if (strcmp(ParamName, "MACAddress") == 0) { char buff[24] = {0}; _ansc_sprintf(buff, "%02X:%02X:%02X:%02X:%02X:%02X", acl_entry->mac[0], @@ -17772,7 +17770,7 @@ MacFiltTab_GetParamStringValue return 1; } } - if( AnscEqualString(ParamName, "DeviceName", TRUE)) + if (strcmp(ParamName, "DeviceName") == 0) { if ( AnscSizeOfString(acl_entry->device_name) < *pUlSize) { @@ -17822,7 +17820,7 @@ MacFiltTab_SetParamStringValue *acl_new_entry_queue = queue_create(); } - if( AnscEqualString(ParamName, "MACAddress", TRUE)) + if (strcmp(ParamName, "MACAddress") == 0) { str_tolower(pString); mac_length = strlen(pString); @@ -17891,7 +17889,7 @@ MacFiltTab_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "DeviceName", TRUE)) + if (strcmp(ParamName, "DeviceName") == 0) { strncpy(acl_entry->device_name, pString, sizeof(acl_entry->device_name)-1); /* save update to backup */ @@ -17959,7 +17957,7 @@ NeighboringWiFiDiagnostic_GetParamBoolValue return FALSE; } - if (AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { *pBool = global_wifi_config->global_parameters.diagnostic_enable; return TRUE; @@ -17982,7 +17980,7 @@ NeighboringWiFiDiagnostic_GetParamStringValue errno_t rc = -1; wifi_monitor_t *monitor_param = (wifi_monitor_t *)get_wifi_monitor(); - if(AnscEqualString(ParamName, "DiagnosticsState", TRUE)) + if (strcmp(ParamName, "DiagnosticsState") == 0) { rc = strcpy_s(pValue, *pUlSize, monitor_param->neighbor_scan_cfg.DiagnosticsState); ERR_CHK(rc); @@ -18009,7 +18007,7 @@ NeighboringWiFiDiagnostic_SetParamBoolValue return FALSE; } - if(AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { // Set WiFi Neighbour Diagnostic switch value if(global_wifi_config->global_parameters.diagnostic_enable == bValue) @@ -18039,7 +18037,7 @@ NeighboringWiFiDiagnostic_SetParamStringValue wifi_monitor_t *monitor_param = (wifi_monitor_t *)get_wifi_monitor(); global_wifi_config = (wifi_global_config_t *) get_dml_cache_global_wifi_config(); - if( AnscEqualString(ParamName, "DiagnosticsState", TRUE)) { + if (strcmp(ParamName, "DiagnosticsState") == 0) { if( (strcmp(pString, "Requested") == 0) && (global_wifi_config->global_parameters.diagnostic_enable)) { if(strcmp(monitor_param->neighbor_scan_cfg.DiagnosticsState, "Requested") == 0) return TRUE; @@ -18116,12 +18114,12 @@ NeighboringScanResult_GetParamIntValue { wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; - if( AnscEqualString(ParamName, "SignalStrength", TRUE)) { + if (strcmp(ParamName, "SignalStrength") == 0) { *pInt = pResult->ap_SignalStrength; return TRUE; } - if( AnscEqualString(ParamName, "Noise", TRUE)) { + if (strcmp(ParamName, "Noise") == 0) { *pInt = pResult->ap_Noise; return TRUE; } @@ -18138,19 +18136,19 @@ NeighboringScanResult_GetParamUlongValue { wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; - if( AnscEqualString(ParamName, "DTIMPeriod", TRUE)) { + if (strcmp(ParamName, "DTIMPeriod") == 0) { *puLong = pResult->ap_DTIMPeriod; return TRUE; } - if( AnscEqualString(ParamName, "X_COMCAST-COM_ChannelUtilization", TRUE)) { + if (strcmp(ParamName, "X_COMCAST-COM_ChannelUtilization") == 0) { *puLong = pResult->ap_ChannelUtilization; return TRUE; } - if( AnscEqualString(ParamName, "Channel", TRUE)) { + if (strcmp(ParamName, "Channel") == 0) { *puLong = pResult->ap_Channel; return TRUE; } - if(AnscEqualString(ParamName, "BeaconPeriod", TRUE)) { + if (strcmp(ParamName, "BeaconPeriod") == 0) { *puLong = pResult->ap_BeaconPeriod; return TRUE; } @@ -18171,7 +18169,7 @@ NeighboringScanResult_GetParamStringValue wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; errno_t rc = -1; - if( AnscEqualString(ParamName, "Radio", TRUE)) { + if (strcmp(ParamName, "Radio") == 0) { wifi_freq_bands_t freqBand; if (freqBandStrToEnum(pResult->ap_OperatingFrequencyBand, &freqBand ) != ANSC_STATUS_SUCCESS) @@ -18190,57 +18188,57 @@ NeighboringScanResult_GetParamStringValue } return -1; } - if(AnscEqualString(ParamName, "EncryptionMode", TRUE)) { + if (strcmp(ParamName, "EncryptionMode") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_EncryptionMode); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "Mode", TRUE)) { + if (strcmp(ParamName, "Mode") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_Mode); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "SecurityModeEnabled", TRUE)) { + if (strcmp(ParamName, "SecurityModeEnabled") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_SecurityModeEnabled); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "BasicDataTransferRates", TRUE)) { + if (strcmp(ParamName, "BasicDataTransferRates") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_BasicDataTransferRates); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "SupportedDataTransferRates", TRUE)) { + if (strcmp(ParamName, "SupportedDataTransferRates") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_SupportedDataTransferRates); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "OperatingChannelBandwidth", TRUE)) { + if (strcmp(ParamName, "OperatingChannelBandwidth") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_OperatingChannelBandwidth); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "OperatingStandards", TRUE)) { + if (strcmp(ParamName, "OperatingStandards") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_OperatingStandards); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "SupportedStandards", TRUE)) { + if (strcmp(ParamName, "SupportedStandards") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_SupportedStandards); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "BSSID", TRUE)) { + if (strcmp(ParamName, "BSSID") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_BSSID); ERR_CHK(rc); return 0; } - if(AnscEqualString(ParamName, "SSID", TRUE)) { + if (strcmp(ParamName, "SSID") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_SSID); ERR_CHK(rc); return 0; } - if( AnscEqualString(ParamName, "OperatingFrequencyBand", TRUE)) { + if (strcmp(ParamName, "OperatingFrequencyBand") == 0) { rc = strcpy_s(pValue, *pUlSize, pResult->ap_OperatingFrequencyBand); ERR_CHK(rc); return 0; @@ -18311,13 +18309,13 @@ NeighboringScanResult_GetParamStringValue return FALSE; } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { *pBool = pcfg->bandsteering_enable; return TRUE; } - if( AnscEqualString(ParamName, "Capability", TRUE)) + if (strcmp(ParamName, "Capability") == 0) { *pBool = TRUE; return TRUE; @@ -18375,7 +18373,7 @@ NeighboringScanResult_GetParamStringValue } /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "Enable", TRUE)) + if (strcmp(ParamName, "Enable") == 0) { if(global_wifi_config->global_parameters.bandsteering_enable == bValue) { @@ -18442,13 +18440,13 @@ NeighboringScanResult_GetParamStringValue /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "APGroup", TRUE)) + if (strcmp(ParamName, "APGroup") == 0) { /* collect value */ return 0; } - if( AnscEqualString(ParamName, "History", TRUE)) + if (strcmp(ParamName, "History") == 0) { /* collect value */ @@ -18501,7 +18499,7 @@ NeighboringScanResult_GetParamStringValue UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "APGroup", TRUE)) + if (strcmp(ParamName, "APGroup") == 0) { return TRUE; } @@ -18765,31 +18763,31 @@ BandSetting_GetEntry int* pInt ) { - if( AnscEqualString(ParamName, "UtilizationThreshold", TRUE)) + if (strcmp(ParamName, "UtilizationThreshold") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "RSSIThreshold", TRUE)) + if (strcmp(ParamName, "RSSIThreshold") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "PhyRateThreshold", TRUE)) + if (strcmp(ParamName, "PhyRateThreshold") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "OverloadInactiveTime", TRUE)) + if (strcmp(ParamName, "OverloadInactiveTime") == 0) { /* collect value */ return TRUE; } - if( AnscEqualString(ParamName, "IdleInactiveTime", TRUE)) + if (strcmp(ParamName, "IdleInactiveTime") == 0) { /* collect value */ return TRUE; @@ -18839,31 +18837,31 @@ BandSetting_GetEntry { /* check the parameter name and set the corresponding value */ - if( AnscEqualString(ParamName, "UtilizationThreshold", TRUE)) + if (strcmp(ParamName, "UtilizationThreshold") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "RSSIThreshold", TRUE)) + if (strcmp(ParamName, "RSSIThreshold") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "PhyRateThreshold", TRUE)) + if (strcmp(ParamName, "PhyRateThreshold") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "OverloadInactiveTime", TRUE)) + if (strcmp(ParamName, "OverloadInactiveTime") == 0) { /* save update to backup */ return TRUE; } - if( AnscEqualString(ParamName, "IdleInactiveTime", TRUE)) + if (strcmp(ParamName, "IdleInactiveTime") == 0) { /* save update to backup */ return TRUE; @@ -19032,11 +19030,11 @@ ATM_GetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); - if (AnscEqualString(ParamName, "Capable", TRUE)) { + if (strcmp(ParamName, "Capable") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { return TRUE; } @@ -19082,7 +19080,7 @@ ATM_SetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); - if( AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { return TRUE; } return FALSE; @@ -19217,7 +19215,7 @@ APGroup_GetParamStringValue { UNREFERENCED_PARAMETER(pUlSize); - if( AnscEqualString(ParamName, "APList", TRUE)) { + if (strcmp(ParamName, "APList") == 0) { return 0; } @@ -19264,7 +19262,7 @@ APGroup_GetParamUlongValue ) { - if( AnscEqualString(ParamName, "AirTimePercent", TRUE)) { + if (strcmp(ParamName, "AirTimePercent") == 0) { return TRUE; } @@ -19280,7 +19278,7 @@ APGroup_SetParamUlongValue ( { CcspTraceInfo(("APGroup_SetParamUlongValue parameter '%s'\n", ParamName)); CcspTraceInfo(("---- %s %s \n", __func__, ParamName)); - if( AnscEqualString(ParamName, "AirTimePercent", TRUE)) { + if (strcmp(ParamName, "AirTimePercent") == 0) { return TRUE; } @@ -19612,7 +19610,7 @@ Sta_GetParamStringValue { CcspTraceInfo(("Sta_GetParamStringValue parameter '%s'\n", ParamName)); - if( AnscEqualString(ParamName, "MACAddress", TRUE)) { + if (strcmp(ParamName, "MACAddress") == 0) { /* collect value */ return 0; } @@ -19660,7 +19658,7 @@ Sta_GetParamUlongValue ) { CcspTraceInfo(("Sta_GetParamUlongValue parameter '%s'\n", ParamName)); - if( AnscEqualString(ParamName, "AirTimePercent", TRUE)) { + if (strcmp(ParamName, "AirTimePercent") == 0) { /* collect value */ return TRUE; } @@ -19706,7 +19704,7 @@ Sta_SetParamStringValue ) { CcspTraceInfo(("Sta_SetParamStringValue parameter '%s'\n", ParamName)); - if( AnscEqualString(ParamName, "MACAddress", TRUE)) { + if (strcmp(ParamName, "MACAddress") == 0) { return TRUE; } return FALSE; @@ -19752,7 +19750,7 @@ Sta_SetParamUlongValue { CcspTraceInfo(("Sta_SetParamIntValue parameter '%s'\n", ParamName)); - if( AnscEqualString(ParamName, "AirTimePercent", TRUE)) { + if (strcmp(ParamName, "AirTimePercent") == 0) { return TRUE; } @@ -19949,7 +19947,7 @@ InterworkingService_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Parameters", TRUE)) + if (strcmp(ParamName, "Parameters") == 0) { /* collect value */ if(pcfg->anqp.anqpParameters){ @@ -20028,9 +20026,9 @@ InterworkingService_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "Parameters", TRUE)) + if (strcmp(ParamName, "Parameters") == 0) { - if( AnscEqualString((char*)vapInfo->u.bss_info.interworking.anqp.anqpParameters, (char*) pString, TRUE)){ + if (strcmp((char*)vapInfo->u.bss_info.interworking.anqp.anqpParameters, (char*) pString) == 0){ return TRUE; }else{ cJSON *p_root = cJSON_Parse(pString); @@ -20116,11 +20114,11 @@ Passpoint_GetParamBoolValue return FALSE; } - if (AnscEqualString(ParamName, "Capability", TRUE)) { + if (strcmp(ParamName, "Capability") == 0) { return TRUE; } - if (AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { //WiFi_SetHS2Status(vap_pcfg->vap_index, false, true); *pBool = interworking_pcfg->passpoint.enable; return TRUE; @@ -20197,7 +20195,7 @@ Passpoint_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if( AnscEqualString(ParamName, "Parameters", TRUE)) + if (strcmp(ParamName, "Parameters") == 0) { if(pcfg->passpoint.hs2Parameters) { if( AnscSizeOfString((char *)pcfg->passpoint.hs2Parameters) < *pUlSize) @@ -20212,7 +20210,7 @@ Passpoint_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "WANMetrics", TRUE)) + if (strcmp(ParamName, "WANMetrics") == 0) { char WANMetricsInfo[256] = {0}; WiFi_GetWANMetrics((vap_pcfg->vap_index + 1), WANMetricsInfo, sizeof(WANMetricsInfo)); @@ -20228,7 +20226,7 @@ Passpoint_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "Stats", TRUE)) + if (strcmp(ParamName, "Stats") == 0) { WiFi_GetHS2Stats((vap_pcfg->vap_index + 1)); /* collect value */ @@ -20308,7 +20306,7 @@ Passpoint_SetParamBoolValue char *strValue = NULL; int retPsmGet = CCSP_SUCCESS; - if( AnscEqualString(ParamName, "Enable", TRUE)) { + if (strcmp(ParamName, "Enable") == 0) { if(bValue == vapInfo->u.bss_info.interworking.passpoint.enable){ CcspTraceWarning(("Passpoint value Already configured. Return Success\n")); return TRUE; @@ -20391,9 +20389,9 @@ Passpoint_SetParamStringValue return TRUE; } - if( AnscEqualString(ParamName, "Parameters", TRUE)) + if (strcmp(ParamName, "Parameters") == 0) { - if( AnscEqualString((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters, pString, TRUE)){ + if (strcmp((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters, pString) == 0){ return TRUE; }else { cJSON *p_root = cJSON_Parse(pString); diff --git a/source/dml/tr_181/ml/plugin_main.c b/source/dml/tr_181/ml/plugin_main.c index 3c88daf85..93a7c3d3f 100644 --- a/source/dml/tr_181/ml/plugin_main.c +++ b/source/dml/tr_181/ml/plugin_main.c @@ -334,7 +334,7 @@ COSA_IsObjSupported #if 0 - if( AnscEqualString(pObjName, "InternetGatewayDevice.UserInterface.",TRUE)) + if (strcmp(pObjName, "InternetGatewayDevice.UserInterface.") == 0) { /* all the objects/parameters under "UserInterface" will not be populated in Data Model Tree. */ return FALSE; @@ -344,7 +344,7 @@ COSA_IsObjSupported #if (defined(_COSA_DRG_CNS_)) - if(AnscEqualString(pObjName, "Device.DNS.Client.", TRUE)) + if (strcmp(pObjName, "Device.DNS.Client.") == 0) { return FALSE; } diff --git a/source/dml/tr_181/sbapi/cosa_wifi_apis.c b/source/dml/tr_181/sbapi/cosa_wifi_apis.c index 10f54e0ef..8e1fb5053 100644 --- a/source/dml/tr_181/sbapi/cosa_wifi_apis.c +++ b/source/dml/tr_181/sbapi/cosa_wifi_apis.c @@ -866,7 +866,7 @@ ANSC_STATUS txRateStrToUint(char *inputStr, UINT *pTxRate) isRateInvalid = TRUE; for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiDataTxRateMap); seqCounter++) { - if (AnscEqualString(token, wifiDataTxRateMap[seqCounter].DataTxRateStr, TRUE)) + if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) { *pTxRate |= wifiDataTxRateMap[seqCounter].DataTxRateEnum; //ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s Token : %s txRate : %d\n", __FUNCTION__, token, *pTxRate); @@ -906,7 +906,7 @@ ANSC_STATUS isSupportedRate(char *inputStr) isRateInvalid = TRUE; for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiDataTxRateMap); seqCounter++) { - if (AnscEqualString(token, wifiDataTxRateMap[seqCounter].DataTxRateStr, TRUE)) + if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) { isRateInvalid = FALSE; } @@ -1190,7 +1190,7 @@ ANSC_STATUS regDomainStrToEnums(char *pRegDomain, wifi_countrycode_type_t *count for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiCountryMapMembers); seqCounter++) { - if (AnscEqualString(tmp_regDomain, wifiCountryMapMembers[seqCounter].countryStr, TRUE)) + if (strcmp(tmp_regDomain, wifiCountryMapMembers[seqCounter].countryStr) == 0) { *countryCode = wifiCountryMapMembers[seqCounter].countryCode; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s Countrycode : %d\n", __FUNCTION__, pRegDomain, *countryCode); @@ -1201,7 +1201,7 @@ ANSC_STATUS regDomainStrToEnums(char *pRegDomain, wifi_countrycode_type_t *count for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiEnviromentMap); seqCounter++) { - if (AnscEqualString(environment, wifiEnviromentMap[seqCounter].environment, TRUE)) + if (strcmp(environment, wifiEnviromentMap[seqCounter].environment) == 0) { *operatingEnvironment = wifiEnviromentMap[seqCounter].operatingEnvironment; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingEnvironment : %d\n", __FUNCTION__, pRegDomain, *operatingEnvironment); @@ -1243,7 +1243,7 @@ ANSC_STATUS wifiStdStrToEnum(char *pWifiStdStr, wifi_ieee80211Variant_t *p80211V isWifiStdInvalid = TRUE; for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiStdDmlMap); seqCounter++) { - if ((AnscEqualString("ax", token, TRUE)) && (instance_number == 0) + if ((strcmp("ax", token) == 0) && (instance_number == 0) && !rfc_pcfg->twoG80211axEnable_rfc) { CcspWifiTrace(("RDK_LOG_INFO, Radio instanceNumber:%lu Device.WiFi.2G80211axEnable" @@ -1251,7 +1251,7 @@ ANSC_STATUS wifiStdStrToEnum(char *pWifiStdStr, wifi_ieee80211Variant_t *p80211V instance_number,rfc_pcfg->twoG80211axEnable_rfc)); isWifiStdInvalid = FALSE; } - else if (AnscEqualString(token, wifiStdDmlMap[seqCounter].wifiStdName, TRUE)) + else if (strcmp(token, wifiStdDmlMap[seqCounter].wifiStdName) == 0) { *p80211VarEnum |= wifiStdDmlMap[seqCounter].halWifiStd; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s wifiStandard : %d\n", __FUNCTION__, pWifiStdStr, *p80211VarEnum); @@ -1283,7 +1283,7 @@ ANSC_STATUS freqBandStrToEnum(char *pFreqBandStr, wifi_freq_bands_t *pFreqBandEn for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiFreqBandMap); seqCounter++) { - if (AnscEqualString(pFreqBandStr, wifiFreqBandMap[seqCounter].wifiFreqBandStr, TRUE)) + if (strcmp(pFreqBandStr, wifiFreqBandMap[seqCounter].wifiFreqBandStr) == 0) { *pFreqBandEnum = wifiFreqBandMap[seqCounter].halWifiFreqBand; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingFrequencyBand : %d\n", __FUNCTION__, pFreqBandStr, *pFreqBandEnum); @@ -1413,27 +1413,27 @@ void WriteWiFiLog(char *msg) strncpy(LogLevel, msg, sizeof(LogLevel)-1); LogLevel[sizeof(LogLevel)-1] = '\0'; strtok_r (LogLevel, ",",&LogMsg); - if( AnscEqualString(LogLevel, "RDK_LOG_ERROR", TRUE)) + if (strcmp(LogLevel, "RDK_LOG_ERROR") == 0) { CcspTraceError(("%s", LogMsg)); } - else if( AnscEqualString(LogLevel, "RDK_LOG_WARN", TRUE)) + else if (strcmp(LogLevel, "RDK_LOG_WARN") == 0) { CcspTraceWarning(("%s", LogMsg)); } - else if( AnscEqualString(LogLevel, "RDK_LOG_NOTICE", TRUE)) + else if (strcmp(LogLevel, "RDK_LOG_NOTICE") == 0) { CcspTraceNotice(("%s", LogMsg)); } - else if( AnscEqualString(LogLevel, "RDK_LOG_INFO", TRUE)) + else if (strcmp(LogLevel, "RDK_LOG_INFO") == 0) { CcspTraceInfo(("%s", LogMsg)); } - else if( AnscEqualString(LogLevel, "RDK_LOG_DEBUG", TRUE)) + else if (strcmp(LogLevel, "RDK_LOG_DEBUG") == 0) { CcspTraceDebug(("%s", LogMsg)); } - else if( AnscEqualString(LogLevel, "RDK_LOG_FATAL", TRUE)) + else if (strcmp(LogLevel, "RDK_LOG_FATAL") == 0) { CcspTraceCritical(("%s", LogMsg)); } From 099b95883fada3c18513963f2091d45676b76b24 Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:18:23 +0530 Subject: [PATCH 2/9] NULL check handled cosa_harvester_dml.c --- source/dml/tr_181/ml/cosa_harvester_dml.c | 92 +++++++++++++---------- 1 file changed, 53 insertions(+), 39 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_harvester_dml.c b/source/dml/tr_181/ml/cosa_harvester_dml.c index 053b5663f..f0666a415 100644 --- a/source/dml/tr_181/ml/cosa_harvester_dml.c +++ b/source/dml/tr_181/ml/cosa_harvester_dml.c @@ -135,7 +135,7 @@ WifiClient_GetParamBoolValue UNREFERENCED_PARAMETER(hInsContext); instant_measurement_config_t *pcfg = (instant_measurement_config_t *) get_dml_harvester(); - if(pcfg== NULL) + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -159,7 +159,7 @@ WifiClient_GetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); instant_measurement_config_t *pcfg = (instant_measurement_config_t *) get_dml_harvester(); - if(pcfg== NULL) + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -185,7 +185,7 @@ WifiClient_GetParamStringValue UNREFERENCED_PARAMETER(hInsContext); UNREFERENCED_PARAMETER(pUlSize); instant_measurement_config_t *pcfg = (instant_measurement_config_t *) get_dml_harvester(); - if(pcfg== NULL) + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -243,7 +243,8 @@ WifiClient_SetParamBoolValue UNREFERENCED_PARAMETER(hInsContext); instant_measurement_config_t *pcfg = NULL; pcfg = (instant_measurement_config_t*) get_dml_cache_harvester(); - if(pcfg == NULL) { + if((pcfg == NULL) || (ParamName == NULL)) + { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -276,7 +277,7 @@ WifiClient_SetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); instant_measurement_config_t *pcfg = NULL; pcfg = (instant_measurement_config_t*) get_dml_cache_harvester(); - if(pcfg == NULL) { + if((pcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -307,7 +308,8 @@ WifiClient_SetParamStringValue instant_measurement_config_t *pcfg = NULL; pcfg = (instant_measurement_config_t*) get_dml_cache_harvester(); - if(pcfg == NULL) { + if((pcfg == NULL) || (ParamName == NULL)) + { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -320,7 +322,7 @@ WifiClient_SetParamStringValue }else{ return FALSE; } - return TRUE; + return TRUE; } return FALSE; @@ -407,7 +409,7 @@ WifiClient_Default_GetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); instant_measurement_config_t *pcfg = (instant_measurement_config_t *) get_dml_harvester(); - if(pcfg== NULL) + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -441,7 +443,8 @@ WifiClient_Default_SetParamUlongValue instant_measurement_config_t *pcfg = NULL; pcfg = (instant_measurement_config_t*) get_dml_cache_harvester(); - if(pcfg == NULL) { + if((pcfg == NULL) || (ParamName == NULL)) + { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -549,7 +552,8 @@ WifiClient_ActiveMeasurements_GetParamBoolValue { UNREFERENCED_PARAMETER(hInsContext); active_msmt_t *pcfg = (active_msmt_t *) get_dml_blaster(); - if(pcfg == NULL) { + if((pcfg == NULL) || (ParamName == NULL)) + { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -571,7 +575,8 @@ WifiClient_ActiveMeasurements_GetParamUlongValue { UNREFERENCED_PARAMETER(hInsContext); active_msmt_t *pcfg = (active_msmt_t *) get_dml_blaster(); - if(pcfg== NULL) { + if((pcfg== NULL) || (ParamName == NULL)) + { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -626,11 +631,13 @@ WifiClient_ActiveMeasurements_SetParamBoolValue } } - if (strcmp(ParamName, "Enable") == 0) { - pcfg->ActiveMsmtEnable = bValue; - push_blaster_config_dml_to_ctrl_queue(); - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) { + pcfg->ActiveMsmtEnable = bValue; + push_blaster_config_dml_to_ctrl_queue(); + return TRUE; + } + } return FALSE; } @@ -646,7 +653,7 @@ WifiClient_ActiveMeasurements_SetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); active_msmt_t *pcfg = NULL; pcfg = (active_msmt_t *) get_dml_cache_blaster(); - if(pcfg== NULL) { + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -728,7 +735,7 @@ ActiveMeasurements_Plan_GetParamStringValue ) { active_msmt_t *pcfg = (active_msmt_t *) get_dml_blaster(); - if(pcfg== NULL) { + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -750,7 +757,7 @@ ActiveMeasurements_Plan_SetParamStringValue UNREFERENCED_PARAMETER(hInsContext); active_msmt_t *pcfg = NULL; pcfg = (active_msmt_t *) get_dml_cache_blaster(); - if(pcfg== NULL) { + if((pcfg== NULL) || (ParamName == NULL) || (pValue == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -873,11 +880,14 @@ ActiveMeasurement_Step_GetParamUlongValue } /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "StepID") == 0) { - /* collect value */ - *puLong = pcfg->Step[StepIns].StepId; - return TRUE; - } + if (ParamName != NULL) + { + if (strcmp(ParamName, "StepID") == 0) { + /* collect value */ + *puLong = pcfg->Step[StepIns].StepId; + return TRUE; + } + } return FALSE; } @@ -895,7 +905,7 @@ ActiveMeasurement_Step_GetParamStringValue active_msmt_step_t *pStepCfg = (active_msmt_step_t*)hInsContext; active_msmt_t *pcfg = (active_msmt_t *) get_dml_blaster(); - if(pcfg== NULL) { + if((pcfg== NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -946,10 +956,12 @@ ActiveMeasurement_Step_SetParamUlongValue } /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "StepID") == 0) { - pcfg->Step[StepIns].StepId = (unsigned int)uValue; - return TRUE; - } + if (ParamName != NULL) { + if (strcmp(ParamName, "StepID") == 0) { + pcfg->Step[StepIns].StepId = (unsigned int)uValue; + return TRUE; + } + } return FALSE; } @@ -981,17 +993,19 @@ ActiveMeasurement_Step_SetParamStringValue return FALSE; } - if (strcmp(ParamName, "SourceMac") == 0) { - strcpy( (char*)pcfg->Step[StepIns].SrcMac,pValue); - wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].SrcMac ,StepIns); - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "SourceMac") == 0) { + strcpy( (char*)pcfg->Step[StepIns].SrcMac,pValue); + wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].SrcMac ,StepIns); + return TRUE; + } - if (strcmp(ParamName, "DestMac") == 0) { - strcpy((char*) pcfg->Step[StepIns].DestMac,pValue); - wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].DestMac ,StepIns); - return TRUE; - } + if (strcmp(ParamName, "DestMac") == 0) { + strcpy((char*) pcfg->Step[StepIns].DestMac,pValue); + wifi_util_dbg_print(WIFI_DMCLI,"%s:%d \n",(char*)pcfg->Step[StepIns].DestMac ,StepIns); + return TRUE; + } + } return FALSE; } BOOL From ff06792c702a5db8e4d9388e2f31317bb479dedf Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sat, 16 Aug 2025 00:24:59 +0530 Subject: [PATCH 3/9] null check handled cosa_logging_dml.c --- source/dml/tr_181/ml/cosa_logging_dml.c | 33 +++++++++++++------------ 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_logging_dml.c b/source/dml/tr_181/ml/cosa_logging_dml.c index b4e475955..8e195b740 100644 --- a/source/dml/tr_181/ml/cosa_logging_dml.c +++ b/source/dml/tr_181/ml/cosa_logging_dml.c @@ -158,15 +158,15 @@ Logging_GetParamBoolValue { UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "FlushAllLogs") == 0) - { - /* collect value */ - *pBool = FALSE; - - return TRUE; - } - - /* CcspWecbTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + if (ParamName != NULL) { + if (strcmp(ParamName, "FlushAllLogs") == 0) + { + /* collect value */ + *pBool = FALSE; + return TRUE; + } + /* CcspWecbTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } return FALSE; } @@ -212,12 +212,13 @@ Logging_SetParamBoolValue UNREFERENCED_PARAMETER(bValue); /* check the parameter name and set the corresponding value */ - if (strcmp(ParamName, "FlushAllLogs") == 0) - { - /* save update to backup */ - CosaDmlLogging_FlushAllLogs(); - return TRUE; - } - + if (ParamName != NULL) { + if (strcmp(ParamName, "FlushAllLogs") == 0) + { + /* save update to backup */ + CosaDmlLogging_FlushAllLogs(); + return TRUE; + } + } return FALSE; } From 63df0db581d6f477e58e941e67f7e5952b5555e3 Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sat, 16 Aug 2025 21:32:01 +0530 Subject: [PATCH 4/9] null check handled plugin_main.c --- source/dml/tr_181/ml/plugin_main.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/source/dml/tr_181/ml/plugin_main.c b/source/dml/tr_181/ml/plugin_main.c index 93a7c3d3f..d4ffd56f6 100644 --- a/source/dml/tr_181/ml/plugin_main.c +++ b/source/dml/tr_181/ml/plugin_main.c @@ -331,28 +331,24 @@ COSA_IsObjSupported * 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(pObjName != NULL) { #if 0 - - if (strcmp(pObjName, "InternetGatewayDevice.UserInterface.") == 0) - { - /* all the objects/parameters under "UserInterface" will not be populated in Data Model Tree. */ - return FALSE; - } - + if (strcmp(pObjName, "InternetGatewayDevice.UserInterface.") == 0) + { + /* all the objects/parameters under "UserInterface" will not be populated in Data Model Tree. */ + return FALSE; + } #endif #if (defined(_COSA_DRG_CNS_)) - - if (strcmp(pObjName, "Device.DNS.Client.") == 0) - { - return FALSE; - } - + if (strcmp(pObjName, "Device.DNS.Client.") == 0) + { + return FALSE; + } #else - UNREFERENCED_PARAMETER(pObjName); + UNREFERENCED_PARAMETER(pObjName); #endif - + } return TRUE; } From d19fd98f59663dd3edb213cbfac2d7b3f79c04cb Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sun, 14 Sep 2025 13:50:49 +0530 Subject: [PATCH 5/9] Update cosa_wifi_apis.c --- source/dml/tr_181/sbapi/cosa_wifi_apis.c | 132 ++++++++++++----------- 1 file changed, 72 insertions(+), 60 deletions(-) diff --git a/source/dml/tr_181/sbapi/cosa_wifi_apis.c b/source/dml/tr_181/sbapi/cosa_wifi_apis.c index 8e1fb5053..eadbffef3 100644 --- a/source/dml/tr_181/sbapi/cosa_wifi_apis.c +++ b/source/dml/tr_181/sbapi/cosa_wifi_apis.c @@ -866,12 +866,14 @@ ANSC_STATUS txRateStrToUint(char *inputStr, UINT *pTxRate) isRateInvalid = TRUE; for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiDataTxRateMap); seqCounter++) { - if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) - { - *pTxRate |= wifiDataTxRateMap[seqCounter].DataTxRateEnum; - //ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s Token : %s txRate : %d\n", __FUNCTION__, token, *pTxRate); - isRateInvalid = FALSE; - } + if(wifiDataTxRateMap[seqCounter].DataTxRateStr != NULL) { + if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) + { + *pTxRate |= wifiDataTxRateMap[seqCounter].DataTxRateEnum; + //ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s Token : %s txRate : %d\n", __FUNCTION__, token, *pTxRate); + isRateInvalid = FALSE; + } + } } if (isRateInvalid == TRUE) @@ -906,10 +908,12 @@ ANSC_STATUS isSupportedRate(char *inputStr) isRateInvalid = TRUE; for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiDataTxRateMap); seqCounter++) { - if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) - { - isRateInvalid = FALSE; - } + if(wifiDataTxRateMap[seqCounter].DataTxRateStr != NULL) { + if (strcmp(token, wifiDataTxRateMap[seqCounter].DataTxRateStr) == 0) + { + isRateInvalid = FALSE; + } + } } if (isRateInvalid == TRUE) @@ -1190,24 +1194,28 @@ ANSC_STATUS regDomainStrToEnums(char *pRegDomain, wifi_countrycode_type_t *count for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiCountryMapMembers); seqCounter++) { - if (strcmp(tmp_regDomain, wifiCountryMapMembers[seqCounter].countryStr) == 0) - { - *countryCode = wifiCountryMapMembers[seqCounter].countryCode; - ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s Countrycode : %d\n", __FUNCTION__, pRegDomain, *countryCode); - isregDomainInvalid = FALSE; - break; - } + if((tmp_regDomain != NULL) && (wifiCountryMapMembers[seqCounter].countryStr != NULL)) { + if (strcmp(tmp_regDomain, wifiCountryMapMembers[seqCounter].countryStr) == 0) + { + *countryCode = wifiCountryMapMembers[seqCounter].countryCode; + ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s Countrycode : %d\n", __FUNCTION__, pRegDomain, *countryCode); + isregDomainInvalid = FALSE; + break; + } + } } for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiEnviromentMap); seqCounter++) { - if (strcmp(environment, wifiEnviromentMap[seqCounter].environment) == 0) - { - *operatingEnvironment = wifiEnviromentMap[seqCounter].operatingEnvironment; - ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingEnvironment : %d\n", __FUNCTION__, pRegDomain, *operatingEnvironment); - isregDomainInvalid = FALSE; - break; - } + if((environment != NULL) && (wifiEnviromentMap[seqCounter].environment != NULL)) { + if (strcmp(environment, wifiEnviromentMap[seqCounter].environment) == 0) + { + *operatingEnvironment = wifiEnviromentMap[seqCounter].operatingEnvironment; + ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingEnvironment : %d\n", __FUNCTION__, pRegDomain, *operatingEnvironment); + isregDomainInvalid = FALSE; + break; + } + } } if (isregDomainInvalid == TRUE) @@ -1251,7 +1259,7 @@ ANSC_STATUS wifiStdStrToEnum(char *pWifiStdStr, wifi_ieee80211Variant_t *p80211V instance_number,rfc_pcfg->twoG80211axEnable_rfc)); isWifiStdInvalid = FALSE; } - else if (strcmp(token, wifiStdDmlMap[seqCounter].wifiStdName) == 0) + else if ((wifiStdDmlMap[seqCounter].wifiStdName != NULL) && (strcmp(token, wifiStdDmlMap[seqCounter].wifiStdName) == 0)) { *p80211VarEnum |= wifiStdDmlMap[seqCounter].halWifiStd; ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s wifiStandard : %d\n", __FUNCTION__, pWifiStdStr, *p80211VarEnum); @@ -1283,13 +1291,15 @@ ANSC_STATUS freqBandStrToEnum(char *pFreqBandStr, wifi_freq_bands_t *pFreqBandEn for (seqCounter = 0; seqCounter < ARRAY_SZ(wifiFreqBandMap); seqCounter++) { - if (strcmp(pFreqBandStr, wifiFreqBandMap[seqCounter].wifiFreqBandStr) == 0) - { - *pFreqBandEnum = wifiFreqBandMap[seqCounter].halWifiFreqBand; - ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingFrequencyBand : %d\n", __FUNCTION__, pFreqBandStr, *pFreqBandEnum); - isBandInvalid = FALSE; - break; - } + if(wifiFreqBandMap[seqCounter].wifiFreqBandStr != NULL) { + if (strcmp(pFreqBandStr, wifiFreqBandMap[seqCounter].wifiFreqBandStr) == 0) + { + *pFreqBandEnum = wifiFreqBandMap[seqCounter].halWifiFreqBand; + ccspWifiDbgPrint(CCSP_WIFI_TRACE, "%s input : %s OperatingFrequencyBand : %d\n", __FUNCTION__, pFreqBandStr, *pFreqBandEnum); + isBandInvalid = FALSE; + break; + } + } } if (isBandInvalid == TRUE) @@ -1413,34 +1423,36 @@ void WriteWiFiLog(char *msg) strncpy(LogLevel, msg, sizeof(LogLevel)-1); LogLevel[sizeof(LogLevel)-1] = '\0'; strtok_r (LogLevel, ",",&LogMsg); - if (strcmp(LogLevel, "RDK_LOG_ERROR") == 0) - { - CcspTraceError(("%s", LogMsg)); - } - else if (strcmp(LogLevel, "RDK_LOG_WARN") == 0) - { - CcspTraceWarning(("%s", LogMsg)); - } - else if (strcmp(LogLevel, "RDK_LOG_NOTICE") == 0) - { - CcspTraceNotice(("%s", LogMsg)); - } - else if (strcmp(LogLevel, "RDK_LOG_INFO") == 0) - { - CcspTraceInfo(("%s", LogMsg)); - } - else if (strcmp(LogLevel, "RDK_LOG_DEBUG") == 0) - { - CcspTraceDebug(("%s", LogMsg)); - } - else if (strcmp(LogLevel, "RDK_LOG_FATAL") == 0) - { - CcspTraceCritical(("%s", LogMsg)); - } - else - { - CcspTraceInfo(("%s", LogMsg)); - } + if(LogLevel != NULL) { + if (strcmp(LogLevel, "RDK_LOG_ERROR") == 0) + { + CcspTraceError(("%s", LogMsg)); + } + else if (strcmp(LogLevel, "RDK_LOG_WARN") == 0) + { + CcspTraceWarning(("%s", LogMsg)); + } + else if (strcmp(LogLevel, "RDK_LOG_NOTICE") == 0) + { + CcspTraceNotice(("%s", LogMsg)); + } + else if (strcmp(LogLevel, "RDK_LOG_INFO") == 0) + { + CcspTraceInfo(("%s", LogMsg)); + } + else if (strcmp(LogLevel, "RDK_LOG_DEBUG") == 0) + { + CcspTraceDebug(("%s", LogMsg)); + } + else if (strcmp(LogLevel, "RDK_LOG_FATAL") == 0) + { + CcspTraceCritical(("%s", LogMsg)); + } + else + { + CcspTraceInfo(("%s", LogMsg)); + } + } } void AssociatedDevice_callback_register() From 816c4fb8f1e2dfe02455ff4136c2166c6d356cba Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sun, 14 Sep 2025 22:56:40 +0530 Subject: [PATCH 6/9] Update cosa_wifi_dml.c with null handling --- source/dml/tr_181/ml/cosa_wifi_dml.c | 77 +++++++++++++++++++--------- 1 file changed, 54 insertions(+), 23 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_wifi_dml.c b/source/dml/tr_181/ml/cosa_wifi_dml.c index 4adda5bbe..1c4e553ca 100755 --- a/source/dml/tr_181/ml/cosa_wifi_dml.c +++ b/source/dml/tr_181/ml/cosa_wifi_dml.c @@ -257,6 +257,10 @@ WiFi_GetParamBoolValue } wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); + if (ParamName == NULL) { + return FALSE; + } + if (strcmp(ParamName, "ApplyRadioSettings") == 0) { /* always return false when get */ @@ -492,7 +496,7 @@ WiFi_GetParamIntValue UNREFERENCED_PARAMETER(hInsContext); wifi_global_param_t *pcfg = (wifi_global_param_t *) get_dml_wifi_global_param(); - if (pcfg== NULL) + if ((pcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -587,14 +591,16 @@ WiFi_GetParamUlongValue { UNREFERENCED_PARAMETER(hInsContext); - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "Status") == 0) - { - UINT numOfRadios = get_num_radio_dml(); - *puLong = numOfRadios; - return TRUE; - } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + if( ParamName != NULL ) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "Status") == 0) + { + UINT numOfRadios = get_num_radio_dml(); + *puLong = numOfRadios; + return TRUE; + } + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } return FALSE; } /********************************************************************** @@ -849,6 +855,9 @@ WiFi_SetParamBoolValue return FALSE; } wifi_radio_operationParam_t *wifiRadioOperParam = NULL; + if (ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "ApplyRadioSettings") == 0) { if (bValue == TRUE){ @@ -1462,9 +1471,9 @@ WiFi_SetParamIntValue wifi_global_config_t *global_wifi_config; global_wifi_config = (wifi_global_config_t *) get_dml_cache_global_wifi_config(); - if (global_wifi_config == NULL) + if ((global_wifi_config == NULL) || (ParamName == NULL)) { - wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config\n", __FUNCTION__,__LINE__); + wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config Or Inv Param\n", __FUNCTION__,__LINE__); return FALSE; } @@ -1594,7 +1603,7 @@ WiFi_SetParamUlongValue UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and set the corresponding value */ - if (strcmp(ParamName, "Status") == 0) + if ( (ParamName != NULL) && (strcmp(ParamName, "Status") == 0) ) { return TRUE; } @@ -1631,7 +1640,7 @@ WiFiRegion_GetParamStringValue } /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "Code") == 0) + if ( (ParamName != NULL) && (strcmp(ParamName, "Code") == 0) ) { AnscCopyString(pValue,pcfg->wifi_region_code); return 0; @@ -1697,7 +1706,7 @@ WiFiRegion_SetParamStringValue return FALSE; } - if (strcmp(ParamName, "Code") == 0) + if ( (ParamName != NULL) && (strcmp(ParamName, "Code") == 0) ) { if (strcmp(requestorStr, BS_SOURCE_RFC_STR) == 0 && strcmp(wifiRegionUpdateSource, BS_SOURCE_WEBPA_STR) == 0) { @@ -1908,7 +1917,7 @@ Radio_GetParamBoolValue dml_radio_default *rcfg = (dml_radio_default *) get_radio_default_obj(instance_number); wifi_radio_capabilities_t radio_capab = ((webconfig_dml_t *)get_webconfig_dml())->hal_cap.wifi_prop.radiocap[instance_number]; - if(rcfg == NULL) { + if((rcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -2103,7 +2112,8 @@ Radio_GetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* if(ParamName != NULL) { + CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); } */ return FALSE; } @@ -2160,7 +2170,7 @@ Radio_GetParamIntValue } dml_radio_default *rcfg = (dml_radio_default *) get_radio_default_obj(instance_number); - if(rcfg == NULL) { + if((rcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointerr get fail\n", __FUNCTION__,__LINE__); return FALSE; } @@ -2239,7 +2249,8 @@ Radio_GetParamIntValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* if(ParamName != NULL) { + CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); } */ return FALSE; } @@ -2325,6 +2336,9 @@ Radio_GetParamUlongValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "X_COMCAST_COM_RadioUpTime") == 0) { @@ -2555,7 +2569,8 @@ Radio_GetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* if(ParamName != NULL) { + CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); } */ return FALSE; } @@ -2626,6 +2641,10 @@ Radio_GetParamStringValue } wifi_rfc_dml_parameters_t *rfc_pcfg = (wifi_rfc_dml_parameters_t *)get_wifi_db_rfc_parameters(); + if(ParamName == NULL) { + return -1; + } + /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Alias") == 0) { @@ -3047,7 +3066,8 @@ Radio_GetParamStringValue return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* if (ParamName != NULL) { + CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); } */ return -1; } @@ -3138,6 +3158,9 @@ Radio_SetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { @@ -3462,7 +3485,10 @@ Radio_SetParamIntValue return FALSE; } - /* check the parameter name and set the corresponding value */ + if(ParamName == NULL) { + return FALSE; + } + /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "MCS") == 0) { rcfg->MCS = iValue; @@ -3687,7 +3713,9 @@ Radio_SetParamUlongValue #else //FEATURE_OFF_CHANNEL_SCAN_5G wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Offchannel distro not present\n", __FUNCTION__,__LINE__); #endif //FEATURE_OFF_CHANNEL_SCAN_5G - + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Channel") == 0) { @@ -4119,7 +4147,10 @@ Radio_SetParamStringValue return FALSE; } - /* check the parameter name and set the corresponding value */ + if(ParamName == NULL) { + return FALSE; + } + /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Alias") == 0) { if (strcmp(pString, rcfg->Alias) == 0) { From 59714a55ca862f6829f6892a3e8a308953451251 Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:41:42 +0530 Subject: [PATCH 7/9] Update cosa_wifi_dml.c --- source/dml/tr_181/ml/cosa_wifi_dml.c | 215 ++++++++++++++++++--------- 1 file changed, 148 insertions(+), 67 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_wifi_dml.c b/source/dml/tr_181/ml/cosa_wifi_dml.c index 1c4e553ca..9fe2f1216 100755 --- a/source/dml/tr_181/ml/cosa_wifi_dml.c +++ b/source/dml/tr_181/ml/cosa_wifi_dml.c @@ -4455,7 +4455,7 @@ ReceivedSignalLevel_GetParamIntValue ) { - if(!hInsContext) + if((!hInsContext) || (ParamName == NULL)) return FALSE; if (strcmp(ParamName, "ReceivedSignalLevel") == 0) { @@ -4532,7 +4532,10 @@ Stats3_GetParamBoolValue BOOL *pBool ) { - + if(ParamName == NULL) { + return FALSE; + } + /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsEnable") == 0) { return TRUE; @@ -4548,6 +4551,9 @@ Stats3_SetParamBoolValue BOOL bValue ) { + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsEnable") == 0) { return TRUE; } @@ -4613,6 +4619,9 @@ Stats3_GetParamIntValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "X_COMCAST-COM_NoiseFloor") == 0) { *pInt = monitor_param->radio_data[instance_number].NoiseFloor; @@ -4746,6 +4755,9 @@ Stats3_GetParamUlongValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "BytesSent") == 0) { *puLong = monitor_param->radio_data[instance_number].radio_BytesSent; @@ -4866,7 +4878,10 @@ Stats3_SetParamIntValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Radio Param for instance_number:%d\n", __FUNCTION__,__LINE__,instance_number); return FALSE; } - + + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "X_COMCAST-COM_RadioStatisticsMeasuringRate") == 0) { if( wifi_radio->radioStatsMeasuringRate == (UINT)iValue) { @@ -5089,6 +5104,9 @@ SSID_GetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { @@ -5124,7 +5142,7 @@ SSID_GetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -5222,6 +5240,9 @@ SSID_GetParamUlongValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Status") == 0) { @@ -5264,7 +5285,7 @@ SSID_GetParamUlongValue } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -5325,6 +5346,9 @@ SSID_GetParamStringValue return FALSE; } memset(str,0,sizeof(str)); + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Alias") == 0) { @@ -5453,7 +5477,7 @@ SSID_GetParamStringValue return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL )); */ return -1; } @@ -5528,6 +5552,9 @@ SSID_SetParamBoolValue return FALSE; } /* check the parameter name and set the corresponding value */ + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Enable") == 0) { rdk_wifi_vap_info_t *rdk_vap_info; @@ -5622,7 +5649,7 @@ SSID_SetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -5773,6 +5800,9 @@ SSID_SetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Alias") == 0) { @@ -5826,7 +5856,7 @@ SSID_SetParamStringValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -6085,6 +6115,9 @@ Stats4_GetParamUlongValue ) { + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "BytesSent") == 0) { @@ -6212,7 +6245,7 @@ Stats4_GetParamUlongValue *puLong = 0; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -6440,22 +6473,27 @@ AccessPoint_GetParamBoolValue return FALSE; } - if (strcmp(ParamName, "Enable") == 0) - { - /* collect value */ - if (isVapSTAMesh(pcfg->vap_index)) { - *pBool = pcfg->u.sta_info.enabled; - return TRUE; - } - *pBool = pcfg->u.bss_info.enabled; - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) + { + /* collect value */ + if (isVapSTAMesh(pcfg->vap_index)) { + *pBool = pcfg->u.sta_info.enabled; + return TRUE; + } + *pBool = pcfg->u.bss_info.enabled; + return TRUE; + } + } if (isVapSTAMesh(pcfg->vap_index)) { *pBool = TRUE; return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "IsolationEnable") == 0) { @@ -6625,13 +6663,13 @@ AccessPoint_GetParamBoolValue *pBool = pcfg->u.bss_info.hostap_mgt_frame_ctrl; return TRUE; } - - if (AnscEqualString(ParamName, "InteropTelemetryCtrl", TRUE)) { + + if (strcmp(ParamName, "InteropTelemetryCtrl") == 0) { *pBool = pcfg->u.bss_info.interop_ctrl; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -6690,6 +6728,9 @@ AccessPoint_GetParamIntValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "X_CISCO_COM_WmmNoAck") == 0) { @@ -6742,14 +6783,14 @@ AccessPoint_GetParamIntValue return TRUE; } - if( AnscEqualString(ParamName, "InteropNumSta", TRUE)) + if (strcmp(ParamName, "InteropNumSta") == 0) { *pInt = pcfg->u.bss_info.inum_sta; wifi_util_dbg_print(WIFI_DMCLI,"%s:%d inumsta:%d \n", __FUNCTION__,__LINE__,pcfg->u.bss_info.inum_sta); return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -6807,6 +6848,9 @@ AccessPoint_GetParamUlongValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Status") == 0) { @@ -6896,7 +6940,7 @@ AccessPoint_GetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -6958,6 +7002,9 @@ AccessPoint_GetParamStringValue } instance_number = convert_vap_name_to_index(&((webconfig_dml_t *)get_webconfig_dml())->hal_cap.wifi_prop, pcfg->vap_name)+1; + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Alias") == 0) { @@ -7001,7 +7048,7 @@ AccessPoint_GetParamStringValue } - if( AnscEqualString(ParamName, "MLD_Addr", TRUE)) + if (strcmp(ParamName, "MLD_Addr") == 0) { char buff[24] = {0}; if (isVapSTAMesh(pcfg->vap_index)) { @@ -7032,7 +7079,7 @@ AccessPoint_GetParamStringValue memcpy(pValue, buff, strlen(buff)+1); return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return -1; } @@ -7108,29 +7155,33 @@ AccessPoint_SetParamBoolValue return FALSE; } - if (strcmp(ParamName, "Enable") == 0) - { - if (global_wifi_config->global_parameters.force_disable_radio_feature) - { - CcspWifiTrace(("RDK_LOG_ERROR, WIFI_ATTEMPT_TO_CHANGE_CONFIG_WHEN_FORCE_DISABLED\n" )); - wifi_util_dbg_print(WIFI_DMCLI,"%s:%d WIFI_ATTEMPT_TO_CHANGE_CONFIG_WHEN_FORCE_DISABLED\n", __FUNCTION__,__LINE__); - return FALSE; - } - if (isVapSTAMesh(pcfg->vap_index)) { - vapInfo->u.sta_info.enabled = bValue; - } else { - vapInfo->u.bss_info.enabled = bValue; - } - set_dml_cache_vap_config_changed(instance_number - 1); - return TRUE; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) + { + if (global_wifi_config->global_parameters.force_disable_radio_feature) + { + CcspWifiTrace(("RDK_LOG_ERROR, WIFI_ATTEMPT_TO_CHANGE_CONFIG_WHEN_FORCE_DISABLED\n" )); + wifi_util_dbg_print(WIFI_DMCLI,"%s:%d WIFI_ATTEMPT_TO_CHANGE_CONFIG_WHEN_FORCE_DISABLED\n", __FUNCTION__,__LINE__); + return FALSE; + } + if (isVapSTAMesh(pcfg->vap_index)) { + vapInfo->u.sta_info.enabled = bValue; + } else { + vapInfo->u.bss_info.enabled = bValue; + } + set_dml_cache_vap_config_changed(instance_number - 1); + return TRUE; + } + } if (isVapSTAMesh(pcfg->vap_index)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s does not support configuration\n", __FUNCTION__,__LINE__,pcfg->vap_name); return TRUE; } + if(ParamName == NULL) { + return FALSE; + } //Following parameters are nots supported in Mesh STA Mode if (strcmp(ParamName, "IsolationEnable") == 0) { @@ -7340,7 +7391,7 @@ AccessPoint_SetParamBoolValue return TRUE; } - if (AnscEqualString(ParamName, "InteropTelemetryCtrl", TRUE)) + if (strcmp(ParamName, "InteropTelemetryCtrl") == 0) { vapInfo->u.bss_info.interop_ctrl = bValue; set_dml_cache_vap_config_changed(instance_number - 1); @@ -7349,7 +7400,7 @@ AccessPoint_SetParamBoolValue __LINE__, vapInfo->u.bss_info.interop_ctrl); return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -7419,6 +7470,9 @@ AccessPoint_SetParamIntValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "X_CISCO_COM_WmmNoAck") == 0) { @@ -7482,8 +7536,8 @@ AccessPoint_SetParamIntValue set_dml_cache_vap_config_changed(instance_number - 1); return TRUE; } - - if( AnscEqualString(ParamName, "InteropNumSta", TRUE)) + + if (strcmp(ParamName, "InteropNumSta") == 0) { if (vapInfo->u.bss_info.inum_sta == (UINT)iValue) { @@ -7500,7 +7554,7 @@ AccessPoint_SetParamIntValue return (TRUE); } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -7563,7 +7617,10 @@ AccessPoint_SetParamUlongValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointerr get fail\n", __FUNCTION__,__LINE__); return FALSE; } - + + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "RetryLimit") == 0) { @@ -7601,8 +7658,8 @@ AccessPoint_SetParamUlongValue cfg->associated_devices_highwatermark_threshold = uValue; return TRUE; } - - if( AnscEqualString(ParamName, "MLD_ID", TRUE)) + + if (strcmp(ParamName, "MLD_ID") == 0) { if ( vapInfo->u.bss_info.mld_info.common_info.mld_id == (unsigned int)uValue ) { @@ -7614,7 +7671,7 @@ AccessPoint_SetParamUlongValue return TRUE; } - if( AnscEqualString(ParamName, "MLD_Link_ID", TRUE)) + if (strcmp(ParamName, "MLD_Link_ID") == 0) { if ( vapInfo->u.bss_info.mld_info.common_info.mld_link_id == (unsigned int)uValue ) { @@ -7626,7 +7683,7 @@ AccessPoint_SetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -7940,6 +7997,9 @@ Security_GetParamBoolValue return FALSE; } } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "X_RDKCENTRAL-COM_TransitionDisable") == 0) { *pBool = l_security_cfg->wpa3_transition_disable; @@ -7990,7 +8050,10 @@ Security_GetParamIntValue int* pInt ) { - if (strcmp(ParamName, "X_CISCO_COM_RadiusReAuthInterval") == 0) + if(ParamName == NULL) { + return FALSE; + } + if (strcmp(ParamName, "X_CISCO_COM_RadiusReAuthInterval") == 0) { /* collect value */ *pInt = 0; @@ -8002,7 +8065,7 @@ Security_GetParamIntValue *pInt = 0; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return TRUE; } @@ -8070,7 +8133,9 @@ Security_GetParamUlongValue } } - + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "RekeyingInterval") == 0) { /* collect value */ @@ -8105,8 +8170,8 @@ Security_GetParamUlongValue *puLong = pcfg->u.radius.s_port; return TRUE; } - - if( AnscEqualString(ParamName, "RepurposedSecondaryRadiusServerPort", TRUE)) + + if (strcmp(ParamName, "RepurposedSecondaryRadiusServerPort") == 0) { /* collect value */ *puLong = pcfg->repurposed_radius.s_port; @@ -8119,7 +8184,7 @@ Security_GetParamUlongValue *puLong = pcfg->u.radius.dasport; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -8240,7 +8305,9 @@ Security_GetParamStringValue } } - + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "ModesSupported") == 0) { @@ -8408,7 +8475,7 @@ Security_GetParamStringValue return 0; } - if( AnscEqualString(ParamName, "RepurposedRadiusServerIPAddr", TRUE)) + if (strcmp(ParamName, "RepurposedRadiusServerIPAddr") == 0) { int result; result=strcmp((char *)&pcfg->repurposed_radius.ip,""); @@ -8471,7 +8538,7 @@ Security_GetParamStringValue return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return -1; } @@ -8547,6 +8614,9 @@ Security_SetParamBoolValue return FALSE; } } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "X_RDKCENTRAL-COM_TransitionDisable") == 0) { @@ -8564,7 +8634,7 @@ Security_SetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -8606,6 +8676,9 @@ Security_SetParamIntValue int iValue ) { + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "X_CISCO_COM_RadiusReAuthInterval") == 0) { @@ -8616,8 +8689,7 @@ Security_SetParamIntValue { return TRUE; } - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -8692,6 +8764,9 @@ Security_SetParamUlongValue } } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "RekeyingInterval") == 0) { @@ -8770,7 +8845,7 @@ Security_SetParamUlongValue } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -9605,6 +9680,9 @@ ConnectionControl_GetParamStringValue return FALSE; } + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "ClientForceDisassociation") == 0) { @@ -10006,6 +10084,9 @@ PreAssocDeny_GetParamIntValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "TcmWaitTime") == 0) { From 24f339a0a7db2aa6af1815dc000bfea1c6460a6e Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sat, 20 Sep 2025 00:31:45 +0530 Subject: [PATCH 8/9] Update cosa_wifi_dml.c --- source/dml/tr_181/ml/cosa_wifi_dml.c | 785 +++++++++++++++------------ 1 file changed, 439 insertions(+), 346 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_wifi_dml.c b/source/dml/tr_181/ml/cosa_wifi_dml.c index 9fe2f1216..a4dc59306 100755 --- a/source/dml/tr_181/ml/cosa_wifi_dml.c +++ b/source/dml/tr_181/ml/cosa_wifi_dml.c @@ -10203,6 +10203,9 @@ PreAssocDeny_GetParamStringValue return FALSE; } + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "RssiUpThresholdSupported") == 0) { @@ -10378,6 +10381,9 @@ PreAssocDeny_SetParamIntValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s does not support configuration\n", __FUNCTION__,__LINE__,pcfg->vap_name); return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "TcmWaitTime") == 0) { @@ -10518,6 +10524,9 @@ PreAssocDeny_SetParamStringValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "RssiUpThreshold") == 0) { @@ -11092,6 +11101,9 @@ PostAssocDisc_GetParamStringValue return FALSE; } + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "RssiUpThresholdSupported") == 0) { @@ -11337,6 +11349,9 @@ PostAssocDisc_SetParamStringValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "RssiUpThreshold") == 0) { if(strcmp(pString, vapInfo->u.bss_info.postassoc.rssi_up_threshold) == 0) { @@ -11646,7 +11661,7 @@ WPS_GetParamBoolValue { wifi_vap_info_t *pcfg = (wifi_vap_info_t *)hInsContext; - if (pcfg == NULL) + if ((pcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -11657,7 +11672,7 @@ WPS_GetParamBoolValue return TRUE; } - if (strcmp(ParamName, "Enable") == 0) + if (strcmp(ParamName, "Enable") == 0) { *pBool = pcfg->u.bss_info.wps.enable; return TRUE; @@ -11706,12 +11721,12 @@ WPS_GetParamIntValue { wifi_vap_info_t *pcfg = (wifi_vap_info_t *)hInsContext; - if (pcfg == NULL) + if ((pcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } - + /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "X_CISCO_COM_WpsPushButton") == 0) { @@ -11818,7 +11833,7 @@ WPS_GetParamStringValue wifi_vap_info_t *pcfg = (wifi_vap_info_t *)hInsContext; ULONG vap_index = 0; errno_t rc = -1; - if (pcfg == NULL) + if ((pcfg == NULL) || (ParamName == NULL)) { wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; @@ -12108,6 +12123,9 @@ WPS_SetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s does not support configuration\n", __FUNCTION__,__LINE__,pcfg->vap_name); return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { if (vapInfo->u.bss_info.wps.enable != bValue) { @@ -12179,6 +12197,9 @@ WPS_SetParamIntValue /* check the parameter name and set the corresponding value */ #ifdef FEATURE_SUPPORT_WPS + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "X_CISCO_COM_WpsPushButton") == 0) { return TRUE; } @@ -12280,6 +12301,9 @@ WPS_SetParamIntValue __FUNCTION__, __LINE__, instance_number); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "ConfigMethodsEnabled") == 0) { int match = 0; @@ -12639,6 +12663,9 @@ InterworkingElement_GetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Internet") == 0) { @@ -12689,7 +12716,7 @@ InterworkingElement_GetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -12795,6 +12822,9 @@ InterworkingElement_GetParamUlongValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "AccessNetworkType") == 0) { @@ -12803,7 +12833,7 @@ InterworkingElement_GetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -12872,6 +12902,9 @@ InterworkingElement_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "HESSID") == 0) { @@ -12881,7 +12914,7 @@ InterworkingElement_GetParamStringValue return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return -1; } @@ -12942,6 +12975,9 @@ InterworkingElement_SetParamBoolValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Internet") == 0) { @@ -13015,7 +13051,7 @@ InterworkingElement_SetParamBoolValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13122,6 +13158,9 @@ InterworkingElement_SetParamUlongValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "AccessNetworkType") == 0) { @@ -13137,10 +13176,7 @@ InterworkingElement_SetParamUlongValue return TRUE; } } - return FALSE; - - } /********************************************************************** @@ -13200,15 +13236,18 @@ InterworkingElement_SetParamStringValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "HESSID") == 0) { AnscCopyString(vapInfo->u.bss_info.interworking.interworking.hessid, pString); - set_dml_cache_vap_config_changed(instance_number - 1); + set_dml_cache_vap_config_changed(instance_number - 1); return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13530,6 +13569,9 @@ BOOL InterworkingElement_Venue_GetParamUlongValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Type") == 0) { /* collect value */ @@ -13544,7 +13586,7 @@ BOOL InterworkingElement_Venue_GetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13602,6 +13644,9 @@ InterworkingElement_Venue_SetParamUlongValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Type") == 0) { int updateInvalidType = 0; @@ -13718,7 +13763,7 @@ InterworkingElement_Venue_SetParamUlongValue } } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; @@ -13734,6 +13779,9 @@ InterworkingElement_GetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Internet") == 0) { *pBool = false; @@ -13765,7 +13813,7 @@ InterworkingElement_GetParamBoolValue *pBool = false; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13794,12 +13842,15 @@ InterworkingElement_GetParamUlongValue ) { UNREFERENCED_PARAMETER(hInsContext); + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "AccessNetworkType") == 0) { *puLong = 0; return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13813,6 +13864,9 @@ InterworkingElement_GetParamStringValue ) { UNREFERENCED_PARAMETER(hInsContext); + if(ParamName == NULL) { + return -1; + } if (strcmp(ParamName, "HESSID") == 0) { AnscCopyString(pValue, "no support for non xb3"); @@ -13820,7 +13874,7 @@ InterworkingElement_GetParamStringValue return 0; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return -1; } @@ -13833,6 +13887,9 @@ InterworkingElement_Venue_GetParamUlongValue ) { UNREFERENCED_PARAMETER(hInsContext); + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Type") == 0) { /* collect value */ @@ -13847,7 +13904,7 @@ InterworkingElement_Venue_GetParamUlongValue return TRUE; } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -13995,13 +14052,16 @@ GASConfig_GetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "PauseForServerResponse") == 0) { /* collect value */ *pBool = pcfg->PauseForServerResponse; return TRUE; } - + return FALSE; } @@ -14051,6 +14111,9 @@ GASConfig_GetParamUlongValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Null pointer get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* collect value */ if (strcmp(ParamName, "AdvertisementID") == 0) { @@ -14222,6 +14285,9 @@ GASStats_GetParamUlongValue if(ANSC_STATUS_SUCCESS != WiFi_GetGasStats(pGASStats)){ return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* collect value */ if (strcmp(ParamName, "AdvertisementID") == 0) { @@ -14344,6 +14410,9 @@ MacFilter_GetParamBoolValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { @@ -14368,7 +14437,7 @@ MacFilter_GetParamBoolValue } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -14582,8 +14651,11 @@ MacFilter_SetParamBoolValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d %s does not support configuration\n", __FUNCTION__,__LINE__,pcfg->vap_name); return TRUE; } - - /* check the parameter name and set the corresponding value */ + + if(ParamName == NULL) { + return FALSE; + } + /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { /* save update to backup */ @@ -14608,7 +14680,7 @@ MacFilter_SetParamBoolValue } - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName ? ParamName : NULL)); */ return FALSE; } @@ -15025,6 +15097,9 @@ DPP_GetParamUlongValue ULONG* puLong ) { + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Version") == 0) { return TRUE; @@ -15079,6 +15154,9 @@ DPP_GetParamStringValue ULONG* pUlSize ) { + if(ParamName == NULL) { + return -1; + } if (strcmp(ParamName, "PrivateSigningKey") == 0) { AnscCopyString(pValue, ""); @@ -16171,26 +16249,27 @@ AssociatedDevice1_GetParamBoolValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "AuthenticationState") == 0) - { - /* collect value */ - *pBool = assoc_dev_data->dev_stats.cli_AuthenticationState; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "Active") == 0) - { - /* collect value */ - *pBool = assoc_dev_data->dev_stats.cli_Active; - free(assoc_dev_data); - return TRUE; - } - - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ - free(assoc_dev_data); + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "AuthenticationState") == 0) + { + /* collect value */ + *pBool = assoc_dev_data->dev_stats.cli_AuthenticationState; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "Active") == 0) + { + /* collect value */ + *pBool = assoc_dev_data->dev_stats.cli_Active; + free(assoc_dev_data); + return TRUE; + } + + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } + free(assoc_dev_data); return FALSE; } @@ -16270,57 +16349,59 @@ AssociatedDevice1_GetParamIntValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "SignalStrength") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_SignalStrength; - free(assoc_dev_data); - return TRUE; - } - - - if (strcmp(ParamName, "X_COMCAST-COM_SNR") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_SNR; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_RDKCENTRAL-COM_SNR") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_SNR; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_RSSI") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_RSSI; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_MinRSSI") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_MinRSSI; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_MaxRSSI") == 0) - { - /* collect value */ - *pInt = assoc_dev_data->dev_stats.cli_MaxRSSI; - free(assoc_dev_data); - return TRUE; + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "SignalStrength") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_SignalStrength; + free(assoc_dev_data); + return TRUE; + } + + + if (strcmp(ParamName, "X_COMCAST-COM_SNR") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_SNR; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_RDKCENTRAL-COM_SNR") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_SNR; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_RSSI") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_RSSI; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_MinRSSI") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_MinRSSI; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_MaxRSSI") == 0) + { + /* collect value */ + *pInt = assoc_dev_data->dev_stats.cli_MaxRSSI; + free(assoc_dev_data); + return TRUE; + } + + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ } - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ free(assoc_dev_data); return FALSE; } @@ -16399,81 +16480,83 @@ AssociatedDevice1_GetParamUlongValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - - if (strcmp(ParamName, "LastDataDownlinkRate") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_LastDataDownlinkRate; - free(assoc_dev_data); - return TRUE; - } - if (strcmp(ParamName, "LastDataUplinkRate") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_LastDataUplinkRate; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "Retransmissions") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_Retransmissions; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentAck") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentAck; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentNoAck") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentNoAck; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_BytesSent") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_BytesSent; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_BytesReceived") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_BytesReceived; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_Disassociations") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_Disassociations; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "X_COMCAST-COM_AuthenticationFailures") == 0) - { - /* collect value */ - *puLong = assoc_dev_data->dev_stats.cli_AuthenticationFailures; - free(assoc_dev_data); - return TRUE; - } - - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + if(ParamName != NULL) { + if (strcmp(ParamName, "LastDataDownlinkRate") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_LastDataDownlinkRate; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "LastDataUplinkRate") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_LastDataUplinkRate; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "Retransmissions") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_Retransmissions; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentAck") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentAck; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_DataFramesSentNoAck") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_DataFramesSentNoAck; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_BytesSent") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_BytesSent; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_BytesReceived") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_BytesReceived; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_Disassociations") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_Disassociations; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "X_COMCAST-COM_AuthenticationFailures") == 0) + { + /* collect value */ + *puLong = assoc_dev_data->dev_stats.cli_AuthenticationFailures; + free(assoc_dev_data); + return TRUE; + } + + + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } free(assoc_dev_data); return FALSE; } @@ -16562,53 +16645,55 @@ AssociatedDevice1_GetParamStringValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - - if (strcmp(ParamName, "MACAddress") == 0) - { - char p_mac[18]; - snprintf(p_mac, 18, "%02x:%02x:%02x:%02x:%02x:%02x", assoc_dev_data->dev_stats.cli_MACAddress[0], assoc_dev_data->dev_stats.cli_MACAddress[1], assoc_dev_data->dev_stats.cli_MACAddress[2], - assoc_dev_data->dev_stats.cli_MACAddress[3], assoc_dev_data->dev_stats.cli_MACAddress[4], assoc_dev_data->dev_stats.cli_MACAddress[5]); - if ( AnscSizeOfString(p_mac) < *pUlSize) - { - AnscCopyString(pValue, p_mac); - free(assoc_dev_data); - return 0; - } - else - { - *pUlSize = AnscSizeOfString(p_mac)+1; - free(assoc_dev_data); - return 1; - } - - return 0; - } - if (strcmp(ParamName, "X_COMCAST-COM_OperatingStandard") == 0) - { - /* collect value */ - rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingStandard); - ERR_CHK(rc); - free(assoc_dev_data); - return 0; - } - if (strcmp(ParamName, "X_COMCAST-COM_OperatingChannelBandwidth") == 0) - { - /* collect value */ - rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingChannelBandwidth); - ERR_CHK(rc); - free(assoc_dev_data); - return 0; - } - - if (strcmp(ParamName, "X_COMCAST-COM_InterferenceSources") == 0) - { - /* collect value */ - rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_InterferenceSources); - ERR_CHK(rc); - free(assoc_dev_data); - return 0; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "MACAddress") == 0) + { + char p_mac[18]; + snprintf(p_mac, 18, "%02x:%02x:%02x:%02x:%02x:%02x", assoc_dev_data->dev_stats.cli_MACAddress[0], assoc_dev_data->dev_stats.cli_MACAddress[1], assoc_dev_data->dev_stats.cli_MACAddress[2], + assoc_dev_data->dev_stats.cli_MACAddress[3], assoc_dev_data->dev_stats.cli_MACAddress[4], assoc_dev_data->dev_stats.cli_MACAddress[5]); + if ( AnscSizeOfString(p_mac) < *pUlSize) + { + AnscCopyString(pValue, p_mac); + free(assoc_dev_data); + return 0; + } + else + { + *pUlSize = AnscSizeOfString(p_mac)+1; + free(assoc_dev_data); + return 1; + } + + return 0; + } + if (strcmp(ParamName, "X_COMCAST-COM_OperatingStandard") == 0) + { + /* collect value */ + rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingStandard); + ERR_CHK(rc); + free(assoc_dev_data); + return 0; + } + + if (strcmp(ParamName, "X_COMCAST-COM_OperatingChannelBandwidth") == 0) + { + /* collect value */ + rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_OperatingChannelBandwidth); + ERR_CHK(rc); + free(assoc_dev_data); + return 0; + } + + if (strcmp(ParamName, "X_COMCAST-COM_InterferenceSources") == 0) + { + /* collect value */ + rc = strcpy_s(pValue, *pUlSize, assoc_dev_data->dev_stats.cli_InterferenceSources); + ERR_CHK(rc); + free(assoc_dev_data); + return 0; + } + } free(assoc_dev_data); return -1; @@ -16664,21 +16749,23 @@ BOOL RSSMemory_GetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamName, ULON return FALSE; } - if (AnscEqualString(ParamName, "Threshold1", TRUE)) { - /* collect value */ - *pULong = pcfg->rss_memory_restart_threshold_low; - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold1 = %d\n", __func__, __LINE__, - *pULong); - return TRUE; - } - - if (AnscEqualString(ParamName, "Threshold2", TRUE)) { - /* collect value */ - *pULong = pcfg->rss_memory_restart_threshold_high; - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold2 = %d\n", __func__, __LINE__, - *pULong); - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "Threshold1") == 0) { + /* collect value */ + *pULong = pcfg->rss_memory_restart_threshold_low; + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold1 = %d\n", __func__, __LINE__, + *pULong); + return TRUE; + } + + if (strcmp(ParamName, "Threshold2") == 0) { + /* collect value */ + *pULong = pcfg->rss_memory_restart_threshold_high; + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold2 = %d\n", __func__, __LINE__, + *pULong); + return TRUE; + } + } return FALSE; } @@ -16724,36 +16811,38 @@ BOOL RSSMemory_SetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamName, ULON __LINE__); return FALSE; } - /* check the parameter name and set the corresponding value */ - if (AnscEqualString(ParamName, "Threshold1", TRUE)) { - if (global_wifi_config->global_parameters.rss_memory_restart_threshold_low == iValue) { - return TRUE; - } - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold1 = %d New Value = %d\n", __func__, - __LINE__, global_wifi_config->global_parameters.rss_memory_restart_threshold_low, - iValue); - global_wifi_config->global_parameters.rss_memory_restart_threshold_low = iValue; - if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { - wifi_util_error_print(WIFI_DMCLI, - "%s:%d: Failed to push RSS Threshold1 value to onewifi db\n", __func__, __LINE__); - } - return TRUE; - } - - if (AnscEqualString(ParamName, "Threshold2", TRUE)) { - if (global_wifi_config->global_parameters.rss_memory_restart_threshold_high == iValue) { - return TRUE; - } - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold2 = %d New Value = %d\n", __func__, - __LINE__, global_wifi_config->global_parameters.rss_memory_restart_threshold_high, - iValue); - global_wifi_config->global_parameters.rss_memory_restart_threshold_high = iValue; - if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { - wifi_util_error_print(WIFI_DMCLI, - "%s:%d: Failed to push RSS Threshold2 value to onewifi db\n", __func__, __LINE__); - } - return TRUE; - } + if(ParamName != NULL) { + /* check the parameter name and set the corresponding value */ + if (strcmp(ParamName, "Threshold1") == 0) { + if (global_wifi_config->global_parameters.rss_memory_restart_threshold_low == iValue) { + return TRUE; + } + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold1 = %d New Value = %d\n", __func__, + __LINE__, global_wifi_config->global_parameters.rss_memory_restart_threshold_low, + iValue); + global_wifi_config->global_parameters.rss_memory_restart_threshold_low = iValue; + if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { + wifi_util_error_print(WIFI_DMCLI, + "%s:%d: Failed to push RSS Threshold1 value to onewifi db\n", __func__, __LINE__); + } + return TRUE; + } + + if (strcmp(ParamName, "Threshold2") == 0) { + if (global_wifi_config->global_parameters.rss_memory_restart_threshold_high == iValue) { + return TRUE; + } + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RSS Threshold2 = %d New Value = %d\n", __func__, + __LINE__, global_wifi_config->global_parameters.rss_memory_restart_threshold_high, + iValue); + global_wifi_config->global_parameters.rss_memory_restart_threshold_high = iValue; + if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { + wifi_util_error_print(WIFI_DMCLI, + "%s:%d: Failed to push RSS Threshold2 value to onewifi db\n", __func__, __LINE__); + } + return TRUE; + } + } return FALSE; } @@ -16842,79 +16931,81 @@ Stats_GetParamUlongValue memcpy(assoc_dev_data, assoc_dev_data_temp, sizeof(assoc_dev_data_t)); pthread_mutex_unlock(&((webconfig_dml_t*) get_webconfig_dml())->assoc_dev_lock); - - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "BytesSent") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_BytesSent; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "BytesReceived") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_BytesReceived; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "PacketsSent") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_PacketsSent; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "PacketsReceived") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_PacketsReceived; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "ErrorsSent") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_ErrorsSent; - free(assoc_dev_data); - return TRUE; - } - if (strcmp(ParamName, "RetransCount") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_RetransCount; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "FailedRetransCount") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_FailedRetransCount; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "RetryCount") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_RetryCount; - free(assoc_dev_data); - return TRUE; - } - - if (strcmp(ParamName, "MultipleRetryCount") == 0) - { - /* collect value */ - *pULong = assoc_dev_data->dev_stats.cli_MultipleRetryCount; - free(assoc_dev_data); - return TRUE; - } + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "BytesSent") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_BytesSent; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "BytesReceived") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_BytesReceived; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "PacketsSent") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_PacketsSent; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "PacketsReceived") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_PacketsReceived; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "ErrorsSent") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_ErrorsSent; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "RetransCount") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_RetransCount; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "FailedRetransCount") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_FailedRetransCount; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "RetryCount") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_RetryCount; + free(assoc_dev_data); + return TRUE; + } + + if (strcmp(ParamName, "MultipleRetryCount") == 0) + { + /* collect value */ + *pULong = assoc_dev_data->dev_stats.cli_MultipleRetryCount; + free(assoc_dev_data); + return TRUE; + } + } free(assoc_dev_data); return FALSE; @@ -16959,14 +17050,16 @@ Stats_GetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "InstantMeasurementsEnable") == 0) - { - /* collect value */ - return TRUE; - } - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "InstantMeasurementsEnable") == 0) + { + /* collect value */ + return TRUE; + } + + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } return FALSE; } @@ -17001,12 +17094,12 @@ WEPKey64Bit_GetParamStringValue ULONG* pUlSize ) { - - if (strcmp(ParamName, "WEPKey") == 0) - { - return 0; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "WEPKey") == 0) + { + return 0; + } + } return -1; } From 8439efe4b866861147ecc8943294f97737c36a01 Mon Sep 17 00:00:00 2001 From: Sukanya673 <60687655+Sukanya673@users.noreply.github.com> Date: Sat, 20 Sep 2025 01:14:47 +0530 Subject: [PATCH 9/9] Update cosa_wifi_dml.c --- source/dml/tr_181/ml/cosa_wifi_dml.c | 486 ++++++++++++++++----------- 1 file changed, 288 insertions(+), 198 deletions(-) diff --git a/source/dml/tr_181/ml/cosa_wifi_dml.c b/source/dml/tr_181/ml/cosa_wifi_dml.c index a4dc59306..7a12a5fe1 100755 --- a/source/dml/tr_181/ml/cosa_wifi_dml.c +++ b/source/dml/tr_181/ml/cosa_wifi_dml.c @@ -17111,12 +17111,12 @@ WEPKey64Bit_SetParamStringValue char* pString ) { - - if (strcmp(ParamName, "WEPKey") == 0) - { - return TRUE; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "WEPKey") == 0) + { + return TRUE; + } + } return FALSE; } @@ -17179,12 +17179,12 @@ WEPKey128Bit_GetParamStringValue ULONG* pUlSize ) { - - if (strcmp(ParamName, "WEPKey") == 0) - { - return 0; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "WEPKey") == 0) + { + return 0; + } + } return -1; } @@ -17196,12 +17196,12 @@ WEPKey128Bit_SetParamStringValue char* pString ) { - - if (strcmp(ParamName, "WEPKey") == 0) - { - return TRUE; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "WEPKey") == 0) + { + return TRUE; + } + } return FALSE; } @@ -17265,16 +17265,18 @@ RadiusSettings_GetParamBoolValue return FALSE; } } - - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "PMKCaching") == 0) - { - /* collect value */ - *pBool = l_security_cfg->disable_pmksa_caching; - return TRUE; - } - - /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "PMKCaching") == 0) + { + /* collect value */ + *pBool = l_security_cfg->disable_pmksa_caching; + return TRUE; + } + + /* CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName)); */ + } return FALSE; } @@ -17310,6 +17312,9 @@ RadiusSettings_GetParamIntValue } } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "RadiusServerRetries") == 0) { @@ -17408,6 +17413,9 @@ RadiusSettings_SetParamBoolValue } } + if(ParamName == NULL) { + return FALSE; + } AnscTraceWarning(("ParamName: %s bvalue:%d\n", ParamName, bValue)); /* check the parameter name and set the corresponding value */ @@ -17423,7 +17431,7 @@ RadiusSettings_SetParamBoolValue set_dml_cache_vap_config_changed(instance_number - 1); return TRUE; } -return FALSE; + return FALSE; } BOOL @@ -17466,6 +17474,9 @@ RadiusSettings_SetParamIntValue return FALSE; } } + if(ParamName == NULL) { + return FALSE; + } AnscTraceWarning(("ParamName: %s iValue: %d\n", ParamName, iValue)); /* check the parameter name and set the corresponding value */ @@ -17609,6 +17620,9 @@ Authenticator_GetParamUlongValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "EAPOLKeyTimeout") == 0) { @@ -17695,6 +17709,9 @@ Authenticator_SetParamUlongValue return FALSE; } } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "EAPOLKeyTimeout") == 0) { @@ -18026,6 +18043,9 @@ MacFiltTab_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Inside GetParamStringValue \n",__func__, __LINE__); acl_entry_t *acl_entry = (acl_entry_t *)hInsContext; + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "MACAddress") == 0) { @@ -18097,6 +18117,9 @@ MacFiltTab_SetParamStringValue *acl_new_entry_queue = queue_create(); } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "MACAddress") == 0) { str_tolower(pString); @@ -18234,6 +18257,9 @@ NeighboringWiFiDiagnostic_GetParamBoolValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Enable") == 0) { *pBool = global_wifi_config->global_parameters.diagnostic_enable; @@ -18256,7 +18282,10 @@ NeighboringWiFiDiagnostic_GetParamStringValue UNREFERENCED_PARAMETER(pUlSize); errno_t rc = -1; - wifi_monitor_t *monitor_param = (wifi_monitor_t *)get_wifi_monitor(); + if(ParamName == NULL) { + return -1; + } + wifi_monitor_t *monitor_param = (wifi_monitor_t *)get_wifi_monitor(); if (strcmp(ParamName, "DiagnosticsState") == 0) { rc = strcpy_s(pValue, *pUlSize, monitor_param->neighbor_scan_cfg.DiagnosticsState); @@ -18284,6 +18313,9 @@ NeighboringWiFiDiagnostic_SetParamBoolValue return FALSE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Enable") == 0) { // Set WiFi Neighbour Diagnostic switch value @@ -18309,11 +18341,14 @@ NeighboringWiFiDiagnostic_SetParamStringValue ) { UNREFERENCED_PARAMETER(hInsContext); - + if(ParamName == NULL) { + return FALSE; + } + wifi_global_config_t *global_wifi_config; wifi_monitor_t *monitor_param = (wifi_monitor_t *)get_wifi_monitor(); global_wifi_config = (wifi_global_config_t *) get_dml_cache_global_wifi_config(); - + if (strcmp(ParamName, "DiagnosticsState") == 0) { if( (strcmp(pString, "Requested") == 0) && (global_wifi_config->global_parameters.diagnostic_enable)) { if(strcmp(monitor_param->neighbor_scan_cfg.DiagnosticsState, "Requested") == 0) @@ -18391,6 +18426,9 @@ NeighboringScanResult_GetParamIntValue { wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "SignalStrength") == 0) { *pInt = pResult->ap_SignalStrength; return TRUE; @@ -18412,6 +18450,9 @@ NeighboringScanResult_GetParamUlongValue ) { wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "DTIMPeriod") == 0) { *puLong = pResult->ap_DTIMPeriod; @@ -18446,6 +18487,9 @@ NeighboringScanResult_GetParamStringValue wifi_neighbor_ap2_t * pResult = (wifi_neighbor_ap2_t *)hInsContext; errno_t rc = -1; + if(ParamName == NULL) { + return -1; + } if (strcmp(ParamName, "Radio") == 0) { wifi_freq_bands_t freqBand; @@ -18585,6 +18629,9 @@ NeighboringScanResult_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d NULL pointer Get fail\n", __FUNCTION__,__LINE__); return FALSE; } + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { @@ -18648,7 +18695,9 @@ NeighboringScanResult_GetParamStringValue wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Unable to get Global Config\n", __FUNCTION__,__LINE__); return FALSE; } - + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "Enable") == 0) { @@ -18717,6 +18766,9 @@ NeighboringScanResult_GetParamStringValue /* check the parameter name and return the corresponding value */ + if(ParamName == NULL) { + return -1; + } if (strcmp(ParamName, "APGroup") == 0) { /* collect value */ @@ -18776,6 +18828,9 @@ NeighboringScanResult_GetParamStringValue UNREFERENCED_PARAMETER(hInsContext); /* check the parameter name and return the corresponding value */ + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "APGroup") == 0) { return TRUE; @@ -19040,6 +19095,9 @@ BandSetting_GetEntry int* pInt ) { + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "UtilizationThreshold") == 0) { /* collect value */ @@ -19113,6 +19171,9 @@ BandSetting_GetEntry ) { + if(ParamName == NULL) { + return FALSE; + } /* check the parameter name and set the corresponding value */ if (strcmp(ParamName, "UtilizationThreshold") == 0) { @@ -19307,6 +19368,9 @@ ATM_GetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Capable") == 0) { return TRUE; } @@ -19314,7 +19378,6 @@ ATM_GetParamBoolValue if (strcmp(ParamName, "Enable") == 0) { return TRUE; } - return FALSE; } @@ -19357,10 +19420,12 @@ ATM_SetParamBoolValue ) { UNREFERENCED_PARAMETER(hInsContext); - if (strcmp(ParamName, "Enable") == 0) { - return TRUE; - } - return FALSE; + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) { + return TRUE; + } + } + return FALSE; } BOOL @@ -19491,11 +19556,11 @@ APGroup_GetParamStringValue ) { UNREFERENCED_PARAMETER(pUlSize); - - if (strcmp(ParamName, "APList") == 0) { - return 0; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "APList") == 0) { + return 0; + } + } return -1; } @@ -19538,11 +19603,11 @@ APGroup_GetParamUlongValue ULONG* puLong ) { - - if (strcmp(ParamName, "AirTimePercent") == 0) { - return TRUE; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "AirTimePercent") == 0) { + return TRUE; + } + } return FALSE; } @@ -19553,12 +19618,14 @@ APGroup_SetParamUlongValue ( ULONG uValue ) { - CcspTraceInfo(("APGroup_SetParamUlongValue parameter '%s'\n", ParamName)); -CcspTraceInfo(("---- %s %s \n", __func__, ParamName)); - if (strcmp(ParamName, "AirTimePercent") == 0) { - return TRUE; - } - + if(ParamName != NULL) { + CcspTraceInfo(("APGroup_SetParamUlongValue parameter '%s'\n", ParamName)); + CcspTraceInfo(("---- %s %s \n", __func__, ParamName)); + + if (strcmp(ParamName, "AirTimePercent") == 0) { + return TRUE; + } + } return FALSE; } @@ -19885,13 +19952,13 @@ Sta_GetParamStringValue ULONG* pUlSize ) { - CcspTraceInfo(("Sta_GetParamStringValue parameter '%s'\n", ParamName)); - - if (strcmp(ParamName, "MACAddress") == 0) { - /* collect value */ - return 0; - } - + if(ParamName != NULL) { + CcspTraceInfo(("Sta_GetParamStringValue parameter '%s'\n", ParamName)); + if (strcmp(ParamName, "MACAddress") == 0) { + /* collect value */ + return 0; + } + } return FALSE; } @@ -19934,11 +20001,13 @@ Sta_GetParamUlongValue ULONG* puLong ) { - CcspTraceInfo(("Sta_GetParamUlongValue parameter '%s'\n", ParamName)); - if (strcmp(ParamName, "AirTimePercent") == 0) { - /* collect value */ - return TRUE; - } + if(ParamName != NULL) { + CcspTraceInfo(("Sta_GetParamUlongValue parameter '%s'\n", ParamName)); + if (strcmp(ParamName, "AirTimePercent") == 0) { + /* collect value */ + return TRUE; + } + } return FALSE; } @@ -19980,10 +20049,12 @@ Sta_SetParamStringValue char* pString ) { - CcspTraceInfo(("Sta_SetParamStringValue parameter '%s'\n", ParamName)); - if (strcmp(ParamName, "MACAddress") == 0) { - return TRUE; - } + if(ParamName != NULL) { + CcspTraceInfo(("Sta_SetParamStringValue parameter '%s'\n", ParamName)); + if (strcmp(ParamName, "MACAddress") == 0) { + return TRUE; + } + } return FALSE; } @@ -20025,11 +20096,11 @@ Sta_SetParamUlongValue ULONG uValue ) { - CcspTraceInfo(("Sta_SetParamIntValue parameter '%s'\n", ParamName)); - - if (strcmp(ParamName, "AirTimePercent") == 0) { - - return TRUE; + if(ParamName != NULL) { + CcspTraceInfo(("Sta_SetParamIntValue parameter '%s'\n", ParamName)); + if (strcmp(ParamName, "AirTimePercent") == 0) { + return TRUE; + } } return FALSE; } @@ -20223,6 +20294,9 @@ InterworkingService_GetParamStringValue return TRUE; } + if(ParamName == NULL) { + return -1; + } /* check the parameter name and return the corresponding value */ if (strcmp(ParamName, "Parameters") == 0) { @@ -20303,6 +20377,9 @@ InterworkingService_SetParamStringValue return TRUE; } + if(ParamName == NULL) { + return FALSE; + } if (strcmp(ParamName, "Parameters") == 0) { if (strcmp((char*)vapInfo->u.bss_info.interworking.anqp.anqpParameters, (char*) pString) == 0){ @@ -20391,15 +20468,17 @@ Passpoint_GetParamBoolValue return FALSE; } - if (strcmp(ParamName, "Capability") == 0) { - return TRUE; - } - - if (strcmp(ParamName, "Enable") == 0) { - //WiFi_SetHS2Status(vap_pcfg->vap_index, false, true); - *pBool = interworking_pcfg->passpoint.enable; - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "Capability") == 0) { + return TRUE; + } + + if (strcmp(ParamName, "Enable") == 0) { + //WiFi_SetHS2Status(vap_pcfg->vap_index, false, true); + *pBool = interworking_pcfg->passpoint.enable; + return TRUE; + } + } return FALSE; } @@ -20471,52 +20550,54 @@ Passpoint_GetParamStringValue return FALSE; } - /* check the parameter name and return the corresponding value */ - if (strcmp(ParamName, "Parameters") == 0) - { - if(pcfg->passpoint.hs2Parameters) { - if( AnscSizeOfString((char *)pcfg->passpoint.hs2Parameters) < *pUlSize) - { - AnscCopyString(pValue, (char *)pcfg->passpoint.hs2Parameters); - return 0; - } else { - *pUlSize = AnscSizeOfString((char *)pcfg->passpoint.hs2Parameters)+1; - return 1; - } + if(ParamName != NULL) { + /* check the parameter name and return the corresponding value */ + if (strcmp(ParamName, "Parameters") == 0) + { + if(pcfg->passpoint.hs2Parameters) { + if( AnscSizeOfString((char *)pcfg->passpoint.hs2Parameters) < *pUlSize) + { + AnscCopyString(pValue, (char *)pcfg->passpoint.hs2Parameters); + return 0; + } else { + *pUlSize = AnscSizeOfString((char *)pcfg->passpoint.hs2Parameters)+1; + return 1; + } + } + return 0; + } + + if (strcmp(ParamName, "WANMetrics") == 0) + { + char WANMetricsInfo[256] = {0}; + WiFi_GetWANMetrics((vap_pcfg->vap_index + 1), WANMetricsInfo, sizeof(WANMetricsInfo)); + /* collect value */ + if( AnscSizeOfString(WANMetricsInfo) < *pUlSize) + { + AnscCopyString(pValue, WANMetricsInfo); + return 0; + }else{ + *pUlSize = AnscSizeOfString(WANMetricsInfo)+1; + return 1; + } + return 0; + } + + if (strcmp(ParamName, "Stats") == 0) + { + WiFi_GetHS2Stats((vap_pcfg->vap_index + 1)); + /* collect value */ + if( AnscSizeOfString((char *)pcfg->anqp.passpointStats) < *pUlSize) + { + AnscCopyString(pValue, (char *)pcfg->anqp.passpointStats); + return 0; + }else{ + *pUlSize = AnscSizeOfString((char *)pcfg->anqp.passpointStats)+1; + return 1; + } + return 0; + } } - return 0; - } - - if (strcmp(ParamName, "WANMetrics") == 0) - { - char WANMetricsInfo[256] = {0}; - WiFi_GetWANMetrics((vap_pcfg->vap_index + 1), WANMetricsInfo, sizeof(WANMetricsInfo)); - /* collect value */ - if( AnscSizeOfString(WANMetricsInfo) < *pUlSize) - { - AnscCopyString(pValue, WANMetricsInfo); - return 0; - }else{ - *pUlSize = AnscSizeOfString(WANMetricsInfo)+1; - return 1; - } - return 0; - } - - if (strcmp(ParamName, "Stats") == 0) - { - WiFi_GetHS2Stats((vap_pcfg->vap_index + 1)); - /* collect value */ - if( AnscSizeOfString((char *)pcfg->anqp.passpointStats) < *pUlSize) - { - AnscCopyString(pValue, (char *)pcfg->anqp.passpointStats); - return 0; - }else{ - *pUlSize = AnscSizeOfString((char *)pcfg->anqp.passpointStats)+1; - return 1; - } - return 0; - } return 0; } @@ -20583,27 +20664,29 @@ Passpoint_SetParamBoolValue char *strValue = NULL; int retPsmGet = CCSP_SUCCESS; - if (strcmp(ParamName, "Enable") == 0) { - if(bValue == vapInfo->u.bss_info.interworking.passpoint.enable){ - CcspTraceWarning(("Passpoint value Already configured. Return Success\n")); - return TRUE; - } - - retPsmGet = PSM_Get_Record_Value2(bus_handle,g_Subsystem, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.WiFi-Passpoint.Enable", NULL, &strValue); - if ((retPsmGet != CCSP_SUCCESS) || (false == _ansc_atoi(strValue)) || (FALSE == _ansc_atoi(strValue))){ - ((CCSP_MESSAGE_BUS_INFO *)bus_handle)->freefunc(strValue); - CcspTraceWarning(("Cannot Enable Passpoint. RFC Disabled\n")); - return FALSE; - } - - if(false == vapInfo->u.bss_info.interworking.interworking.interworkingEnabled){ - CcspTraceWarning(("Cannot Enable Passpoint. Interworking Disabled\n")); - return FALSE; - } - vapInfo->u.bss_info.interworking.passpoint.enable = bValue; - set_dml_cache_vap_config_changed(instance_number - 1); - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) { + if(bValue == vapInfo->u.bss_info.interworking.passpoint.enable){ + CcspTraceWarning(("Passpoint value Already configured. Return Success\n")); + return TRUE; + } + + retPsmGet = PSM_Get_Record_Value2(bus_handle,g_Subsystem, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.WiFi-Passpoint.Enable", NULL, &strValue); + if ((retPsmGet != CCSP_SUCCESS) || (false == _ansc_atoi(strValue)) || (FALSE == _ansc_atoi(strValue))){ + ((CCSP_MESSAGE_BUS_INFO *)bus_handle)->freefunc(strValue); + CcspTraceWarning(("Cannot Enable Passpoint. RFC Disabled\n")); + return FALSE; + } + + if(false == vapInfo->u.bss_info.interworking.interworking.interworkingEnabled){ + CcspTraceWarning(("Cannot Enable Passpoint. Interworking Disabled\n")); + return FALSE; + } + vapInfo->u.bss_info.interworking.passpoint.enable = bValue; + set_dml_cache_vap_config_changed(instance_number - 1); + return TRUE; + } + } return FALSE; } /********************************************************************** @@ -20666,21 +20749,23 @@ Passpoint_SetParamStringValue return TRUE; } - if (strcmp(ParamName, "Parameters") == 0) - { - if (strcmp((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters, pString) == 0){ - return TRUE; - }else { - cJSON *p_root = cJSON_Parse(pString); - if(p_root == NULL) { - wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Invalid json for vap %s\n", __FUNCTION__,__LINE__,pcfg->vap_name); - return FALSE; - } - AnscCopyString((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters,pString); - set_dml_cache_vap_config_changed(instance_number - 1); - return TRUE; - } - } + if(Parameters != NULL) { + if (strcmp(ParamName, "Parameters") == 0) + { + if (strcmp((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters, pString) == 0){ + return TRUE; + }else { + cJSON *p_root = cJSON_Parse(pString); + if(p_root == NULL) { + wifi_util_dbg_print(WIFI_DMCLI,"%s:%d Invalid json for vap %s\n", __FUNCTION__,__LINE__,pcfg->vap_name); + return FALSE; + } + AnscCopyString((char*)vapInfo->u.bss_info.interworking.passpoint.hs2Parameters,pString); + set_dml_cache_vap_config_changed(instance_number - 1); + return TRUE; + } + } + } return FALSE; } @@ -20786,21 +20871,22 @@ BOOL MgtFrameRateLimit_SetParamBoolValue(ANSC_HANDLE hInsContext, char *ParamNam return FALSE; } - if (AnscEqualString(ParamName, "Enable", TRUE)) { - if (global_wifi_config->global_parameters.mgt_frame_rate_limit_enable == bValue) { - return TRUE; - } - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RateLimit Enable: %d\n", __func__, __LINE__, - bValue); - global_wifi_config->global_parameters.mgt_frame_rate_limit_enable = bValue; - - if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { - wifi_util_error_print(WIFI_DMCLI, - "%s:%d: Failed to push RateLimit Enable value to onewifi db\n", __func__, __LINE__); - } - return TRUE; - } - + if(ParamName != NULL) { + if (strcmp(ParamName, "Enable") == 0) { + if (global_wifi_config->global_parameters.mgt_frame_rate_limit_enable == bValue) { + return TRUE; + } + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d: RateLimit Enable: %d\n", __func__, __LINE__, + bValue); + global_wifi_config->global_parameters.mgt_frame_rate_limit_enable = bValue; + + if (push_global_config_dml_cache_to_one_wifidb() != RETURN_OK) { + wifi_util_error_print(WIFI_DMCLI, + "%s:%d: Failed to push RateLimit Enable value to onewifi db\n", __func__, __LINE__); + } + return TRUE; + } + } return FALSE; } @@ -20845,24 +20931,25 @@ BOOL MgtFrameRateLimit_GetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamNa return FALSE; } - if (AnscEqualString(ParamName, "RateLimit", TRUE)) { - *pULong = pcfg->mgt_frame_rate_limit; - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d RateLimit: %d\n", __func__, __LINE__, *pULong); - return TRUE; - } + if(ParamName != NULL) { + if (strcmp(ParamName, "RateLimit") == 0) { + *pULong = pcfg->mgt_frame_rate_limit; + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d RateLimit: %d\n", __func__, __LINE__, *pULong); + return TRUE; + } - if (AnscEqualString(ParamName, "WindowSize", TRUE)) { - *pULong = pcfg->mgt_frame_rate_limit_window_size; - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d Window size: %d\n", __func__, __LINE__, *pULong); - return TRUE; - } + if (strcmp(ParamName, "WindowSize") == 0) { + *pULong = pcfg->mgt_frame_rate_limit_window_size; + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d Window size: %d\n", __func__, __LINE__, *pULong); + return TRUE; + } - if (AnscEqualString(ParamName, "CooldownTime", TRUE)) { - *pULong = pcfg->mgt_frame_rate_limit_cooldown_time; - wifi_util_dbg_print(WIFI_DMCLI, "%s:%d Cooldown time: %d\n", __func__, __LINE__, *pULong); - return TRUE; + if (strcmp(ParamName, "CooldownTime") == 0) { + *pULong = pcfg->mgt_frame_rate_limit_cooldown_time; + wifi_util_dbg_print(WIFI_DMCLI, "%s:%d Cooldown time: %d\n", __func__, __LINE__, *pULong); + return TRUE; + } } - return FALSE; } @@ -20907,7 +20994,10 @@ BOOL MgtFrameRateLimit_SetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamNa return FALSE; } - if (AnscEqualString(ParamName, "RateLimit", TRUE)) { + if(ParamName == NULL) { + return FALSE; + } + if (strcmp(ParamName, "RateLimit") == 0) { if ((ULONG)global_wifi_config->global_parameters.mgt_frame_rate_limit == iValue) { return TRUE; } @@ -20922,7 +21012,7 @@ BOOL MgtFrameRateLimit_SetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamNa return TRUE; } - if (AnscEqualString(ParamName, "WindowSize", TRUE)) { + if (strcmp(ParamName, "WindowSize") == 0) { if ((ULONG)global_wifi_config->global_parameters.mgt_frame_rate_limit_window_size == iValue) { return TRUE; @@ -20940,7 +21030,7 @@ BOOL MgtFrameRateLimit_SetParamUlongValue(ANSC_HANDLE hInsContext, char *ParamNa return TRUE; } - if (AnscEqualString(ParamName, "CooldownTime", TRUE)) { + if (strcmp(ParamName, "CooldownTime") == 0) { if ((ULONG)global_wifi_config->global_parameters.mgt_frame_rate_limit_cooldown_time == iValue) { return TRUE;