From abf4905eec3e89cc17cabc3f470118bfb87393b3 Mon Sep 17 00:00:00 2001 From: Anand Date: Sat, 1 Aug 2026 15:00:55 +0000 Subject: [PATCH 1/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- configure.ac | 17 - src/Makefile.am | 10 - src/hostif/handlers/Makefile.am | 6 +- .../handlers/include/hostIf_WiFi_ReqHandler.h | 97 -- .../handlers/src/hostIf_WiFi_ReqHandler.cpp | 843 ------------------ src/hostif/handlers/src/hostIf_msgHandler.cpp | 14 - .../handlers/src/hostIf_updateHandler.cpp | 15 +- src/hostif/profiles/Makefile.am | 6 - src/hostif/profiles/wifi/Device_WiFi.cpp | 445 --------- src/hostif/profiles/wifi/Device_WiFi.h | 267 ------ .../profiles/wifi/Device_WiFi_AccessPoint.cpp | 193 ---- .../profiles/wifi/Device_WiFi_AccessPoint.h | 211 ----- ...vice_WiFi_AccessPoint_AssociatedDevice.cpp | 168 ---- ...Device_WiFi_AccessPoint_AssociatedDevice.h | 154 ---- .../wifi/Device_WiFi_AccessPoint_Security.cpp | 178 ---- .../wifi/Device_WiFi_AccessPoint_Security.h | 195 ---- .../wifi/Device_WiFi_AccessPoint_WPS.cpp | 127 --- .../wifi/Device_WiFi_AccessPoint_WPS.h | 117 --- .../profiles/wifi/Device_WiFi_EndPoint.cpp | 452 ---------- .../profiles/wifi/Device_WiFi_EndPoint.h | 258 ------ .../wifi/Device_WiFi_EndPoint_Profile.cpp | 160 ---- .../wifi/Device_WiFi_EndPoint_Profile.h | 171 ---- .../Device_WiFi_EndPoint_Profile_Security.cpp | 136 --- .../Device_WiFi_EndPoint_Profile_Security.h | 128 --- .../wifi/Device_WiFi_EndPoint_Security.cpp | 188 ---- .../wifi/Device_WiFi_EndPoint_Security.h | 102 --- .../wifi/Device_WiFi_EndPoint_WPS.cpp | 118 --- .../profiles/wifi/Device_WiFi_EndPoint_WPS.h | 115 --- .../profiles/wifi/Device_WiFi_Radio.cpp | 651 -------------- src/hostif/profiles/wifi/Device_WiFi_Radio.h | 641 ------------- .../profiles/wifi/Device_WiFi_Radio_Stats.cpp | 421 --------- .../profiles/wifi/Device_WiFi_Radio_Stats.h | 224 ----- src/hostif/profiles/wifi/Device_WiFi_SSID.cpp | 533 ----------- src/hostif/profiles/wifi/Device_WiFi_SSID.h | 362 -------- .../profiles/wifi/Device_WiFi_SSID_Stats.cpp | 196 ---- .../profiles/wifi/Device_WiFi_SSID_Stats.h | 280 ------ ...ce_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp | 778 ---------------- ...vice_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h | 320 ------- src/hostif/profiles/wifi/Makefile.am | 50 -- src/hostif/profiles/wifi/docs/README.md | 345 ------- src/hostif/src/hostIf_main.cpp | 12 - src/integrationtest/conf/mgrlist.conf | 1 - .../tr69hostif_negative_tests.feature | 11 - .../tr69hostif_thunder_plugins.feature | 105 --- ..._networkmanager_endpoint_thunder_plugin.py | 113 --- ...stif_networkmanager_ssid_thunder_plugin.py | 115 --- 46 files changed, 2 insertions(+), 10047 deletions(-) delete mode 100755 src/hostif/handlers/include/hostIf_WiFi_ReqHandler.h delete mode 100644 src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_Radio.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_Radio.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_SSID.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_SSID.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.h delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp delete mode 100644 src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h delete mode 100644 src/hostif/profiles/wifi/Makefile.am delete mode 100644 src/hostif/profiles/wifi/docs/README.md delete mode 100644 test/functional-tests/tests/tr69hostif_networkmanager_endpoint_thunder_plugin.py delete mode 100644 test/functional-tests/tests/tr69hostif_networkmanager_ssid_thunder_plugin.py diff --git a/configure.ac b/configure.ac index 8d9f1a171..3cf4e6e61 100644 --- a/configure.ac +++ b/configure.ac @@ -110,21 +110,6 @@ m4_syscmd([test -d src/hostif/profiles/moca]) m4_if(m4_sysval,[0],[AC_CONFIG_FILES([src/hostif/profiles/moca/Makefile])]) m4_if(m4_sysval,[0],[SUBDIRS_MOCA="src/hostif/profiles/moca"]) -AC_ARG_ENABLE([wifi], - AS_HELP_STRING([--enable-wifi],[enable WiFi profile (default is no)]), - [ - case "${enableval}" in - yes) WIFI_PROFILE_ENABLE=true - WIFI_PROFILE_FLAG="-DUSE_WIFI_PROFILE" - m4_syscmd([test -d src/hostif/profiles/wifi]) - m4_if(m4_sysval,[0],[AC_CONFIG_FILES([src/hostif/profiles/wifi/Makefile])]) - m4_if(m4_sysval,[0],[SUBDIRS_WIFI="src/hostif/profiles/wifi"]) ;; - no) WIFI_PROFILE_ENABLE=false AC_MSG_ERROR([wifi profile is disabled]) ;; - *) AC_MSG_ERROR([bad value ${enableval} for --enable-wifi ]) ;; - esac - ], - [echo "WiFi profile is disabled"]) - AC_ARG_ENABLE([sdcard], AS_HELP_STRING([--enable-sdcard],[enable X_RDKCENTRAL_COM SDcard profile (default is no)]), [ @@ -402,7 +387,6 @@ AM_CONDITIONAL([WITH_THUNDER_CLIENT], [test x$THUNDER_CLIENT_ENABLE = xtrue]) AM_CONDITIONAL([WITH_MOCA_PROFILE], [test "x$enable_moca" = "xyes"]) AM_CONDITIONAL([WITH_MOCA20], [test "x$enable_moca2" = "xyes"]) -AM_CONDITIONAL([WITH_WIFI_PROFILE], [test x$WIFI_PROFILE_ENABLE = xtrue]) AM_CONDITIONAL([WITH_XRDK_SDCARD_PROFILE], [test x$XRDK_SDCARD_PROFILE_ENABLE = xtrue]) AM_CONDITIONAL([WITH_XRDK_EMMC_PROFILE], [test x$XRDK_EMMC_PROFILE_ENABLE = xtrue]) AM_CONDITIONAL([WITH_DHCP_PROFILE], [test x$DHCPv4_PROFILE_ENABLE = xtrue]) @@ -450,7 +434,6 @@ AC_SUBST(SUBDIRS_STORAGESERVICE) AC_SUBST(SUBDIRS_DHCPv4) AC_SUBST(SUBDIRS_INTFSTACK) AC_SUBST(MOCA2_FLAG) -AC_SUBST(WIFI_PROFILE_ENABLE) AC_SUBST(WIFI_PROFILE_FLAG) AC_SUBST(XRDK_SDCARD_PROFILE_FLAG) AC_SUBST(XRDK_EMMC_PROFILE_FLAG) diff --git a/src/Makefile.am b/src/Makefile.am index 142dacd91..7f92c70b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -52,12 +52,6 @@ else NEXUS_LIB = endif - - -if WITH_WIFI_PROFILE -AM_CXXFLAGS += -DUSE_WIFI_PROFILE -AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/profiles/wifi -endif if WITH_DHCP_PROFILE AM_CXXFLAGS += -DUSE_DHCPv4_PROFILE AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/profiles/DHCPv4 @@ -153,10 +147,6 @@ if XRELIB_FLAG tr69hostif_LDADD += -ltr69ProfileXcaliber endif -if WITH_WIFI_PROFILE -tr69hostif_LDADD += $(top_builddir)/src/hostif/profiles/wifi/libhostIfWiFi.la -endif - AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/parodusClient/pal AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/parodusClient/waldb tr69hostif_LDADD += $(top_builddir)/src/hostif/parodusClient/waldb/libwaldb.la diff --git a/src/hostif/handlers/Makefile.am b/src/hostif/handlers/Makefile.am index 98f324ded..d0fa76594 100644 --- a/src/hostif/handlers/Makefile.am +++ b/src/hostif/handlers/Makefile.am @@ -38,7 +38,7 @@ AM_CXXFLAGS = -I$(top_srcdir)/src/hostif/include \ -I$(top_srcdir)/src/hostif/profiles/wifi \ -I./include $(GLIB_CFLAGS) $(G_THREAD_CFLAGS) \ $(XREMGR_FLAGS) $(MOCAMGR_FLAGS) $(SOUP_CFLAGS) $(MOCA2_FLAG) \ - $(WIFI_PROFILE_FLAG) $(XRDK_SDCARD_PROFILE_FLAG) $(XRDK_EMMC_PROFILE_FLAG) \ + $(XRDK_SDCARD_PROFILE_FLAG) $(XRDK_EMMC_PROFILE_FLAG) \ -I=/usr/include/rdk/iarmbus/ \ -I=/usr/include/rdk/iarmmgrs/sysmgr/ \ -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/rbus/ \ @@ -111,10 +111,6 @@ if WITH_MOCA_PROFILE libMsgHandlers_la_SOURCES += src/hostIf_MoCAClient_ReqHandler.cpp endif -if WITH_WIFI_PROFILE -libMsgHandlers_la_SOURCES += src/hostIf_WiFi_ReqHandler.cpp -endif - if WITH_DHCP_PROFILE libMsgHandlers_la_SOURCES += src/hostIf_DHCPv4Client_ReqHandler.cpp endif diff --git a/src/hostif/handlers/include/hostIf_WiFi_ReqHandler.h b/src/hostif/handlers/include/hostIf_WiFi_ReqHandler.h deleted file mode 100755 index 805ef6f45..000000000 --- a/src/hostif/handlers/include/hostIf_WiFi_ReqHandler.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file hostIf_WiFi_ReqHandler.h - * @brief The header file provides HostIf WiFi request handler information APIs. - */ - -/** - * @defgroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES WiFi RequestHandler Public Classes - * Describe the details about classes used in TR-069 WiFi request handler. - * @ingroup TR-069HOSTIF_DEVICECLIENT_HANDLER - */ - -/** - * It allows moca client applications to communicate by sending Get operation - * from Time library. - */ - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef HOSTIF_WIFI_REQHANDLER_H_ -#define HOSTIF_WIFI_REQHANDLER_H_ - -#ifdef USE_WIFI_PROFILE - -#include "hostIf_msgHandler.h" -#include "hostIf_updateHandler.h" - - -#define DEVICE_WIFI_SSID_PROFILE "Device.WiFi.SSID." -#define DEVICE_WIFI_RADIO_PROFILE "Device.WiFi.Radio." -#define DEVICE_WIFI_ENDPOINT_PROFILE "Device.WiFi.EndPoint." - -/** - * @brief This class provides the interface for getting WiFi request handler information. - * @ingroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES - */ -class WiFiReqHandler : public msgHandler -{ -//private: - WiFiReqHandler() {}; - ~WiFiReqHandler() {}; - static class WiFiReqHandler *pInstance; - static updateCallback mUpdateCallback; -private: - static int savedSSIDNumberOfEntries; - static int savedRadioNumberOfEntries; - static int savedEndPointNumberOfEntries; - -public: - virtual bool init(); - virtual bool unInit(); - virtual int handleSetMsg(HOSTIF_MsgData_t *stMsgData); - virtual int handleGetMsg(HOSTIF_MsgData_t *stMsgData); - virtual int handleGetAttributesMsg(HOSTIF_MsgData_t *stMsgData); - virtual int handleSetAttributesMsg(HOSTIF_MsgData_t *stMsgData); - static msgHandler* getInstance(); - static void registerUpdateCallback(updateCallback cb); - static void checkForUpdates(); - static void reset(); -}; - -#endif /* #ifdef USE_WIFI_PROFILE*/ - -#endif /* HOSTIF_WIFI_REQHANDLER_H_ */ -/* End of HOSTIF_WIFI_REQHANDLER_H_ doxygen group */ -/** - * @} - */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp deleted file mode 100644 index e6200bfb3..000000000 --- a/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp +++ /dev/null @@ -1,843 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file hostIf_WiFi_ReqHandler.cpp - * @brief The header file provides HostIf IP WiFi request handler information APIs. - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifdef USE_WIFI_PROFILE -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_msgHandler.h" - -#include "hostIf_WiFi_ReqHandler.h" -#include "Device_WiFi.h" -#include "Device_WiFi_Radio.h" -#include "Device_WiFi_Radio_Stats.h" -#include "Device_WiFi_EndPoint.h" -#include "Device_WiFi_EndPoint_WPS.h" -#include "Device_WiFi_EndPoint_Security.h" -#include "Device_WiFi_EndPoint_Profile.h" -#include "Device_WiFi_EndPoint_Profile_Security.h" -#include "Device_WiFi_AccessPoint.h" -#include "Device_WiFi_AccessPoint_WPS.h" -#include "Device_WiFi_AccessPoint_Security.h" -#include "Device_WiFi_AccessPoint_AssociatedDevice.h" -#include "Device_WiFi_SSID.h" -#include "Device_WiFi_SSID_Stats.h" - -#ifdef WIFI_CLIENT_ROAMING -#include "Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h" -#endif - -WiFiReqHandler* WiFiReqHandler::pInstance = NULL; -updateCallback WiFiReqHandler::mUpdateCallback = NULL; -int WiFiReqHandler::savedSSIDNumberOfEntries = 0; -int WiFiReqHandler::savedRadioNumberOfEntries = 0; -int WiFiReqHandler::savedEndPointNumberOfEntries = 0; -static bool bfirstInstance=false; - -msgHandler* WiFiReqHandler::getInstance() -{ - if(!pInstance) - pInstance = new WiFiReqHandler(); - return pInstance; -} - -/** - * @brief This function is use to initialize. Currently not implemented. - * - * @return Returns the status of the operation. - * - * @retval true if initialization is successfully . - * @retval false if initialization is not successful. - * @ingroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES - */ -bool WiFiReqHandler::init() -{ - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s()] WiFi manager Initializing\n", __FUNCTION__); - return true; -} - -void WiFiReqHandler::reset() -{ - bfirstInstance=false; - savedSSIDNumberOfEntries = 0; - savedRadioNumberOfEntries = 0; - savedEndPointNumberOfEntries = 0; -} - -/** - * @brief This function is used to close all the instances of WiFi, WiFi Radio, - * SSID, AccessPoint, EndPoint etc.. - * - * @return Returns the status of the operation. - * - * @retval true if it is successfully close all the instances. - * @retval false if not able to close all the instances. - * @ingroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES - */ -bool WiFiReqHandler::unInit() -{ - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s()] WiFi manager Deinitializing. \n", __FUNCTION__); - - hostIf_WiFi::closeAllInstances(); - - hostIf_WiFi_Radio::closeAllInstances(); - hostIf_WiFi_Radio_Stats::closeAllInstances(); - - hostIf_WiFi_SSID::closeAllInstances(); - hostIf_WiFi_SSID_Stats::closeAllInstances(); - - hostIf_WiFi_AccessPoint::closeAllInstances(); - hostIf_WiFi_AccessPoint_WPS::closeAllInstances(); - hostIf_WiFi_AccessPoint_Security::closeAllInstances(); - hostIf_WiFi_AccessPoint_AssociatedDevice::closeAllInstances(); - - hostIf_WiFi_EndPoint::closeAllInstances(); - hostIf_WiFi_EndPoint_WPS::closeAllInstances(); - hostIf_WiFi_EndPoint_Security::closeAllInstances(); - hostIf_WiFi_EndPoint_Profile::closeAllInstances(); - hostIf_WiFi_EndPoint_Profile_Security::closeAllInstances(); -#ifdef WIFI_CLIENT_ROAMING - hostIf_WiFi_Xrdk_ClientRoaming::closeAllInstances(); -#endif - - WiFiDevice::closeAllInstances(); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return true; -} - -/** - * @brief This function use to handle the set message request of WiFi. - * Currently not implemented. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns the status of the operation. - * - * @retval OK if it is successfully. - * @retval ERR_INTERNAL_ERROR if not able to set the data to the device. - * @ingroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES - */ -int WiFiReqHandler::handleSetMsg(HOSTIF_MsgData_t *stMsgData) -{ - int ret = NOT_HANDLED; -/* RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Found string as %s. Set command not supported.\n", - __FUNCTION__, __FILE__, stMsgData->paramName); - stMsgData->faultCode = fcAttemptToSetaNonWritableParameter;*/ - if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable") == 0) - { - hostIf_WiFi *pIface = hostIf_WiFi::getInstance (1); - - if(!pIface) - { - return NOK; - } - ret = pIface->set_Device_WiFi_EnableWiFi(stMsgData); - } -#ifdef WIFI_CLIENT_ROAMING - else if(strncasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming",strlen("Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming"))==0) - { - //Setting Roaming params - hostIf_WiFi_Xrdk_ClientRoaming* clntRoamInst = hostIf_WiFi_Xrdk_ClientRoaming::getInstance(stMsgData->instanceNum); - if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.Enable") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestThresholdLevel") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestDeltaLevel") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelConnected") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelDisconnected") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerThresholdLevel") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerTimeframe") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(stMsgData); - } - /* else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerBeaconsMissedTime") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(stMsgData); - }*/ - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolThresholdLevel") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolTimeframe") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.SelfSteer_OverrideEnable") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BackOffTime") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.80211kvrEnable") == 0) - { - ret = clntRoamInst->set_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(stMsgData); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - } -#endif - else - { - RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Found string as %s. Set command not supported.\n", __FUNCTION__, __FILE__, stMsgData->paramName); - stMsgData->faultCode = fcAttemptToSetaNonWritableParameter; - } - return ret; -} - -/** - * @brief This function use to handle the get message request of WiFi interface - * and get the attributes of "Radio", "SSID", "AccessPoint", "Endpoint" etc. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns the status of the operation. - * - * @retval OK if it is successfully. - * @retval ERR_INTERNAL_ERROR if not able to get data from the device. - * @ingroup TR-069HOSTIF_WIFI_REQHANDLER_CLASSES - */ -int WiFiReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData) -{ - int ret = NOT_HANDLED; - const char *pSetting; - const int maxSSID_Instances = 1; - int instanceNum = 0; - int radioIndex = 1; - #ifdef RDKV_TR69 - const int maxRadioInstances = 1; - if (strcasecmp(stMsgData->paramName,"Device.WiFi.RadioNumberOfEntries") == 0) - { - stMsgData->instanceNum = maxRadioInstances; - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(maxRadioInstances); - - if(!pIface) - { - return NOK; - } - - ret = pIface->get_Device_WiFi_RadioNumberOfEntries(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.SSIDNumberOfEntries") == 0) - { - stMsgData->instanceNum = maxSSID_Instances; - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(maxSSID_Instances); - - if(!pIface) - { - return NOK; - } - - ret = pIface->get_Device_WiFi_SSIDNumberOfEntries(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.AccessPointNumberOfEntries") == 0) - { - stMsgData->instanceNum = 0; - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(stMsgData->instanceNum); - if(!pIface) - { - return NOK; - } - ret = pIface->get_Device_WiFi_AccessPointNumberOfEntries(stMsgData); - } - #else - - if (strcasecmp(stMsgData->paramName,"Device.WiFi.AccessPointNumberOfEntries") == 0) - { - stMsgData->instanceNum = 0; - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(stMsgData->instanceNum); - - if(!pIface) - { - return NOK; - } - - ret = pIface->get_Device_WiFi_AccessPointNumberOfEntries(stMsgData); - } - #endif - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.EndPointNumberOfEntries") == 0) - { - hostIf_WiFi *pIface = hostIf_WiFi::getInstance (1); - - if(!pIface) - { - return NOK; - } - ret = pIface->get_Device_WiFi_EndPointNumberOfEntries(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable") == 0) - { - hostIf_WiFi *pIface = hostIf_WiFi::getInstance (1); - - if(!pIface) - { - return NOK; - } - ret = pIface->get_Device_WiFi_EnableWiFi(stMsgData); - } - #ifndef RDKV_TR69 - else if (matchComponent(stMsgData->paramName, "Device.WiFi.Radio", &pSetting, instanceNum)) - { - if (instanceNum != 1) - { - return NOK; - } - - stMsgData->instanceNum = instanceNum; - hostIf_WiFi_Radio *pWifiRadio = hostIf_WiFi_Radio::getInstance(stMsgData->instanceNum); - hostIf_WiFi_Radio_Stats *pWifiRadioStats = hostIf_WiFi_Radio_Stats::getInstance(stMsgData->instanceNum); - - if ((!pWifiRadio) || (!pWifiRadioStats)) - { - return NOK; - } - - if (strcasecmp(pSetting,"OperatingChannelBandwidth") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_OperatingChannelBandwidth(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.PacketsReceived") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_PacketsReceived(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.Noise") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_NoiseFloor(stMsgData,radioIndex); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - } - #endif - #ifdef RDKV_TR69 - else if (matchComponent(stMsgData->paramName, "Device.WiFi.Radio", &pSetting, instanceNum)) - { - if ((instanceNum <= 0) || (instanceNum > maxRadioInstances)) - { - return NOK; - } - - stMsgData->instanceNum = instanceNum; - hostIf_WiFi_Radio *pWifiRadio = hostIf_WiFi_Radio::getInstance(stMsgData->instanceNum); - hostIf_WiFi_Radio_Stats *pWifiRadioStats = hostIf_WiFi_Radio_Stats::getInstance(stMsgData->instanceNum); - - if ((!pWifiRadio) || (!pWifiRadioStats)) - { - return NOK; - } - - if (strcasecmp(pSetting,"Enable") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Enable(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Status") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Status(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Alias") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Alias(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Name") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Name(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"LastChange") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_LastChange(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"LowerLayers") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_LowerLayers(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Upstream") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Upstream(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"MaxBitRate") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_MaxBitRate(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"SupportedFrequencyBands") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_SupportedFrequencyBands(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"OperatingFrequencyBand") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_OperatingFrequencyBand(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"SupportedStandards") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_SupportedStandards(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"OperatingStandards") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_OperatingStandards(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"PossibleChannels") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_PossibleChannels(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"ChannelsInUse") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_ChannelsInUse(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Channel") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_Channel(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"AutoChannelSupported") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelSupported(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"AutoChannelEnable") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelEnable(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"AutoChannelRefreshPeriod") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelRefreshPeriod(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"OperatingChannelBandwidth") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_OperatingChannelBandwidth(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"ExtensionChannel") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_ExtensionChannel(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"GuardInterval") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_GuardInterval(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"MCS") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_MCS(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"MCS") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_MCS(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"TransmitPowerSupported") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_TransmitPowerSupported(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"TransmitPower") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_TransmitPower(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"IEEE80211hSupported") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_IEEE80211hSupported(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"IEEE80211hEnabled") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_IEEE80211hEnabled(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"RegulatoryDomain") == 0) - { - ret = pWifiRadio->get_Device_WiFi_Radio_RegulatoryDomain(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.BytesSent") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_BytesSent(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.BytesReceived") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_BytesReceived(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.PacketsSent") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_PacketsSent(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.PacketsReceived") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_PacketsReceived(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.ErrorsSent") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_ErrorsSent(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.ErrorsReceived") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_ErrorsReceived(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.DiscardPacketsSent") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_DiscardPacketsSent(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.DiscardPacketsReceived") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_DiscardPacketsReceived(stMsgData,radioIndex); - } - else if (strcasecmp(pSetting,"Stats.Noise") == 0) - { - ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_NoiseFloor(stMsgData,radioIndex); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - } - #endif - else if (matchComponent(stMsgData->paramName, "Device.WiFi.Endpoint", &pSetting, instanceNum)) - { - stMsgData->instanceNum = instanceNum; - hostIf_WiFi_EndPoint *pWifiEndPoint = hostIf_WiFi_EndPoint::getInstance(stMsgData->instanceNum); - hostIf_WiFi_EndPoint_WPS *pWifiEndPointWps = hostIf_WiFi_EndPoint_WPS::getInstance(stMsgData->instanceNum); - hostIf_WiFi_EndPoint_Security *pWifiEndpointSec = hostIf_WiFi_EndPoint_Security::getInstance(stMsgData->instanceNum); - - if ((!pWifiEndPoint) || (!pWifiEndPointWps) || (!pWifiEndpointSec)) - { - return NOK; - } - - if (strcasecmp(pSetting,"Enable") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Enable(stMsgData); - } - else if (strcasecmp(pSetting,"Status") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Status(stMsgData); - } - else if (strcasecmp(pSetting,"Alias") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Alias(stMsgData); - } - else if (strcasecmp(pSetting,"ProfileReference") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_ProfileReference(stMsgData); - } - else if (strcasecmp(pSetting,"SSIDReference") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_SSIDReference(stMsgData); - } - else if (strcasecmp(pSetting,"ProfileNumberOfEntries") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_ProfileNumberOfEntries(stMsgData); - } - else if (strcasecmp(pSetting,"Stats.LastDataDownlinkRate") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate(stMsgData); - } - else if (strcasecmp(pSetting,"Stats.LastDataUplinkRate") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate(stMsgData); - } - else if (strcasecmp(pSetting,"Stats.SignalStrength") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Stats_SignalStrength(stMsgData); - } - else if (strcasecmp(pSetting,"Stats.Retransmissions") == 0) - { - ret = pWifiEndPoint->get_Device_WiFi_EndPoint_Stats_Retransmissions(stMsgData); - } - else if(strcasecmp(pSetting,"Security.ModesEnabled") == 0) - { - ret = pWifiEndpointSec->get_hostIf_WiFi_EndPoint_Security_ModesEnabled(stMsgData); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - - } - else if (matchComponent(stMsgData->paramName, "Device.WiFi.AccessPoint", &pSetting, instanceNum)) - { - stMsgData->instanceNum = instanceNum; - hostIf_WiFi_AccessPoint *pIfaceAccessPoint = hostIf_WiFi_AccessPoint::getInstance(stMsgData->instanceNum); - hostIf_WiFi_AccessPoint_WPS *pIfaceAccessPointWps = hostIf_WiFi_AccessPoint_WPS::getInstance(stMsgData->instanceNum); - hostIf_WiFi_AccessPoint_Security *pIfaceAccessPointSec = hostIf_WiFi_AccessPoint_Security::getInstance(stMsgData->instanceNum); - hostIf_WiFi_AccessPoint_AssociatedDevice *pIfaceAccessPointAssDev = hostIf_WiFi_AccessPoint_AssociatedDevice::getInstance(stMsgData->instanceNum); - - if ((!pIfaceAccessPoint) || (!pIfaceAccessPointWps) || (!pIfaceAccessPointSec) || (!pIfaceAccessPointAssDev)) - { - return NOK; - } - } - else if (matchComponent(stMsgData->paramName, "Device.WiFi.SSID", &pSetting, instanceNum)) - { - if ((instanceNum <= 0) || (instanceNum > maxSSID_Instances)) - { - return NOK; - } - - stMsgData->instanceNum = instanceNum; - hostIf_WiFi_SSID *pIfaceSsid = hostIf_WiFi_SSID::getInstance(stMsgData->instanceNum); - hostIf_WiFi_SSID_Stats *pIfaceSsidStats = hostIf_WiFi_SSID_Stats::getInstance(stMsgData->instanceNum); - - if ((!pIfaceSsid) || (!pIfaceSsidStats)) - { - return NOK; - } - - if (strcasecmp(pSetting, "Enable") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_Enable(stMsgData); - } - else if (strcasecmp(pSetting, "Status") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_Status(stMsgData); - } - else if (strcasecmp(pSetting, "BSSID") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_BSSID(stMsgData); - } - else if (strcasecmp(pSetting, "MACAddress") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_MACAddress(stMsgData); - } - else if (strcasecmp(pSetting, "SSID") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_SSID(stMsgData); - } - else if (strcasecmp(pSetting, "Name") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_Name(stMsgData); - } - else if (strcasecmp(pSetting, "Alias") == 0) - { - ret = pIfaceSsid->get_Device_WiFi_SSID_Alias(stMsgData); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - - } -#ifdef WIFI_CLIENT_ROAMING - else if (strncasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming",strlen("Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming")) == 0) - { - // Get Client Roaming Settings - hostIf_WiFi_Xrdk_ClientRoaming* clntRoamInst = hostIf_WiFi_Xrdk_ClientRoaming::getInstance(stMsgData->instanceNum); - if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.Enable") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestThresholdLevel") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestDeltaLevel") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.SelfSteer_Override") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelConnected") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelDisconnected") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerThresholdLevel") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(stMsgData); - } - else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerTimeframe") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(stMsgData); - } - /* else if (strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerBeaconsMissedTime") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(stMsgData); - }*/ - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolThresholdLevel") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolTimeframe") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.SelfSteer_OverrideEnable") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BackOffTime") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(stMsgData); - } - else if(strcasecmp(stMsgData->paramName,"Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.80211kvrEnable") == 0) - { - ret = clntRoamInst->get_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(stMsgData); - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - } -#endif - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterName; - ret = NOK; - } - - return ret; -} - -int WiFiReqHandler::handleGetAttributesMsg(HOSTIF_MsgData_t *stMsgData) -{ - int ret = NOT_HANDLED; - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s] TODO Entering Parameter value = %s \n", __FILE__, __FUNCTION__,stMsgData->paramName); - // TODO: Retrieve notification value from DeviceInfo structure for given parameter - return ret; -} - -int WiFiReqHandler::handleSetAttributesMsg(HOSTIF_MsgData_t *stMsgData) -{ - - int ret = NOT_HANDLED; -/* int instanceNumber = 0; - hostIf_WiFi::getLock(); - // TODO: Set notification value from DeviceInfo structure for given parameter - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s:%d] WiFiReqHandler get para as %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->paramName); - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(instanceNumber); - stMsgData->instanceNum = instanceNumber; - if(!pIface) - { - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s:%d] pIface is failed. For param as %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->paramName); - hostIf_WiFi::releaseLock(); - return NOK; - } - GHashTable* notifyhash = pIface->getNotifyHash(); - if(notifyhash != NULL) - { - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s:%d] notifyhash is not Null %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->paramName); - int notifyvalue = get_int(stMsgData->paramValue); - g_hash_table_insert(notifyhash,stMsgData->paramName,(gpointer) notifyvalue); - ret = OK; - } - else - { - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s:%d] notifyhash is Null %s\n", __FUNCTION__, __FILE__, __LINE__, stMsgData->paramName); - ret = NOK; - } - hostIf_WiFi::releaseLock();*/ - return ret; -} -void WiFiReqHandler::registerUpdateCallback(updateCallback cb) -{ - mUpdateCallback = cb; -} - -void WiFiReqHandler::checkForUpdates() -{ - LOG_ENTRY_EXIT; - - if (NULL == mUpdateCallback) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%s] mUpdateCallback is NULL\n", __FILE__, __FUNCTION__); - return; - } - - hostIf_WiFi *pIface = hostIf_WiFi::getInstance(1); - if (NULL == pIface) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%s] hostIf_WiFi::getInstance(1) returned NULL\n", __FILE__, __FUNCTION__); - return; - } - #ifdef RDKV_TR69 - HOSTIF_MsgData_t stMsgData; - - if (OK == pIface->get_Device_WiFi_SSIDNumberOfEntries(&stMsgData)) - { - int currentSSIDNumberOfEntries = get_int (stMsgData.paramValue); - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentSSIDNumberOfEntries = %d, savedSSIDNumberOfEntries = %d\n", - __FILE__, __FUNCTION__, currentSSIDNumberOfEntries, savedSSIDNumberOfEntries); - sendAddRemoveEvents (mUpdateCallback, currentSSIDNumberOfEntries, savedSSIDNumberOfEntries, (char *)DEVICE_WIFI_SSID_PROFILE); - } - - if (!bfirstInstance && (OK == pIface->get_Device_WiFi_RadioNumberOfEntries (&stMsgData))) - { - bfirstInstance = true; - int currentRadioNumberOfEntries = get_int (stMsgData.paramValue); - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentRadioNumberOfEntries = %d, savedRadioNumberOfEntries = %d\n", - __FILE__, __FUNCTION__, currentRadioNumberOfEntries, savedRadioNumberOfEntries); - sendAddRemoveEvents (mUpdateCallback, currentRadioNumberOfEntries, savedRadioNumberOfEntries, (char *)DEVICE_WIFI_RADIO_PROFILE); - } - - if (OK == pIface->get_Device_WiFi_EndPointNumberOfEntries (&stMsgData)) - { - int currentEndPointNumberOfEntries = get_int (stMsgData.paramValue); - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentEndPointNumberOfEntries = %d, savedEndPointNumberOfEntries = %d\n", - __FILE__, __FUNCTION__, currentEndPointNumberOfEntries, savedEndPointNumberOfEntries); - sendAddRemoveEvents (mUpdateCallback, currentEndPointNumberOfEntries, savedEndPointNumberOfEntries, (char *)DEVICE_WIFI_ENDPOINT_PROFILE); - } - #endif -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/handlers/src/hostIf_msgHandler.cpp b/src/hostif/handlers/src/hostIf_msgHandler.cpp index e79beaf50..b780b4679 100644 --- a/src/hostif/handlers/src/hostIf_msgHandler.cpp +++ b/src/hostif/handlers/src/hostIf_msgHandler.cpp @@ -50,9 +50,6 @@ #include "hostIf_EthernetClient_ReqHandler.h" #include "hostIf_IPClient_ReqHandler.h" #include "hostIf_TimeClient_ReqHandler.h" -#ifdef USE_WIFI_PROFILE -#include "hostIf_WiFi_ReqHandler.h" -#endif /* USE_WIFI_PROFILE */ #ifdef USE_DHCPv4_PROFILE #include "hostIf_DHCPv4Client_ReqHandler.h" #endif /* WITH_DHCP_PROFILE*/ @@ -448,12 +445,6 @@ bool hostIf_initalize_ConfigManger() { mgrName = HOSTIF_TimeMgr; } -#ifdef USE_WIFI_PROFILE - else if (strcasecmp(mgr, "wifiMgr") == 0) - { - mgrName = HOSTIF_WiFiMgr; - } -#endif #ifdef USE_DHCPv4_PROFILE else if(strcasecmp(mgr, "dhcpv4Mgr") == 0) { @@ -552,11 +543,6 @@ msgHandler* HostIf_GetMgr(HOSTIF_MsgData_t *stMsgHandlerData) case HOSTIF_IPMgr: pRet = IPClientReqHandler::getInstance(); break; -#ifdef USE_WIFI_PROFILE - case HOSTIF_WiFiMgr: - pRet = WiFiReqHandler::getInstance(); - break; -#endif /* USE_WIFI_PROFILE*/ #ifdef USE_DHCPv4_PROFILE case HOSTIF_DHCPv4: pRet = DHCPv4ClientReqHandler::getInstance(); diff --git a/src/hostif/handlers/src/hostIf_updateHandler.cpp b/src/hostif/handlers/src/hostIf_updateHandler.cpp index 949f53478..f68a4a8b4 100644 --- a/src/hostif/handlers/src/hostIf_updateHandler.cpp +++ b/src/hostif/handlers/src/hostIf_updateHandler.cpp @@ -38,10 +38,6 @@ #include "hostIf_NotificationHandler.h" #include -#ifdef USE_WIFI_PROFILE -#include "hostIf_WiFi_ReqHandler.h" -#endif - #ifdef USE_DHCPv4_PROFILE #include "hostIf_DHCPv4Client_ReqHandler.h" #endif /* WITH_DHCP_PROFILE*/ @@ -80,10 +76,6 @@ void updateHandler::Init() DeviceClientReqHandler::registerUpdateCallback(notifyCallback); /*TimeClientReqHandler::registerUpdateCallback(notifyCallback);*/ -#ifdef USE_WIFI_PROFILE - WiFiReqHandler::registerUpdateCallback(notifyCallback); -#endif - #ifdef USE_DHCPv4_PROFILE DHCPv4ClientReqHandler::registerUpdateCallback(notifyCallback); #endif /* USE_DHCPv4_PROFILE*/ @@ -117,9 +109,6 @@ void updateHandler::reset() EthernetClientReqHandler::reset(); IPClientReqHandler::reset(); DeviceClientReqHandler::reset(); -#ifdef USE_WIFI_PROFILE - WiFiReqHandler::reset(); -#endif #ifdef USE_INTFSTACK_PROFILE InterfaceStackClientReqHandler::reset(); @@ -151,9 +140,7 @@ gpointer updateHandler::run(gpointer ptr) EthernetClientReqHandler::checkForUpdates(); IPClientReqHandler::checkForUpdates(); DeviceClientReqHandler::checkForUpdates(); -#ifdef USE_WIFI_PROFILE - WiFiReqHandler::checkForUpdates(); -#endif + #ifdef USE_DHCPv4_PROFILE DHCPv4ClientReqHandler::checkForUpdates(); #endif /* USE_DHCPv4_PROFILE*/ diff --git a/src/hostif/profiles/Makefile.am b/src/hostif/profiles/Makefile.am index e231874bb..a60189b37 100644 --- a/src/hostif/profiles/Makefile.am +++ b/src/hostif/profiles/Makefile.am @@ -27,9 +27,6 @@ endif if WITH_INTFSTACK_PROFILE SUBDIRS += InterfaceStack endif -if WITH_WIFI_PROFILE -SUBDIRS += wifi -endif DIST_SUBDIRS = STBService DeviceInfo Ethernet IP Time if WITH_DHCP_PROFILE @@ -41,6 +38,3 @@ endif if WITH_INTFSTACK_PROFILE DIST_SUBDIRS += InterfaceStack endif -if WITH_WIFI_PROFILE - DIST_SUBDIRS += wifi -endif diff --git a/src/hostif/profiles/wifi/Device_WiFi.cpp b/src/hostif/profiles/wifi/Device_WiFi.cpp deleted file mode 100644 index bf683ed8e..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -#ifdef USE_WIFI_PROFILE - -/** - * @file Device_WiFi.c - * - * @brief MoCA_Interface API Implementation. - * - * This is the implementation of the MoCA_Interface API. - * - * @par Document - * TBD Relevant design or API documentation. - * - */ - -/** @addtogroup MoCA_Interface Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi.h" -#include -#include -#ifdef RDKV_NM -extern "C" { - /* #include "c_only_header.h"*/ -#include "wifi_client_hal.h" -#include "wifiSrvMgrIarmIf.h" -#include "netsrvmgrIarm.h" -}; -#else -#include -#include "cJSON.h" -#include "hostIf_utils.h" -#endif - -//char *moca_interface = NULL; -GHashTable* WiFiDevice::devHash = NULL; -GHashTable* hostIf_WiFi::ifHash = NULL; - -WiFiDevice::WiFiDevice(int dev_id):dev_id(dev_id) -{ -// ctxt = WiFiCtl_Open(interface); - - if(!ctxt) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Error! Unable to connect to WiFi Device instance %d\n",dev_id); - throw 1; - } -} - -WiFiDevice* WiFiDevice::getInstance(int dev_id) -{ - WiFiDevice* pRet = NULL; - - if(devHash) - { - pRet = (WiFiDevice *)g_hash_table_lookup(devHash, (gpointer) dev_id); - } - else - { - devHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new WiFiDevice(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create WiFi device instance..\n"); - } - g_hash_table_insert(devHash,(gpointer)dev_id, pRet); - } - return pRet; -} -void* WiFiDevice::getContext() -{ - return ctxt; -} - -void WiFiDevice::closeInstance(WiFiDevice *pDev) -{ - if(pDev) - { - g_hash_table_remove(devHash, (gconstpointer)pDev->dev_id); - if(pDev->ctxt) - { -// WiFiCtl_Close(pDev->ctxt); - } - delete pDev; - } -} - -void WiFiDevice::closeAllInstances() -{ - if(devHash) - { - GList* tmp_list = g_hash_table_get_values (devHash); - - GList* current = tmp_list; - - while(current) - { - WiFiDevice* pDev = (WiFiDevice *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - -//------------------------------------------------------------------------------ -// init: Perform the necessary operations to initialise the WiFi device. -// Returns 0 on success, -1 on failure. -//------------------------------------------------------------------------------ -int WiFiDevice::init() -{ - /* Initialise the WiFi HAL */ - /* int ret = wifi_init(); - - if (ret != 0) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Error! Unable to initialise WiFi HAL\n"); - throw 1; - }*/ - return 1; -} - -//------------------------------------------------------------------------------ -// shutdown: Perform the necessary operations to shut down the WiFi device. -//------------------------------------------------------------------------------ -void WiFiDevice::shutdown() -{ - /* Shut down the WiFi HAL */ -// (void)wifi_down(); -} - -hostIf_WiFi::hostIf_WiFi(int dev_id): - dev_id(dev_id), - uiRadioNumberOfEntries(0), - uiSSIDNumberOfEntries(0), - uiAccessPointNumberOfEntries(0), - uiEndPointNumberOfEntries(0) //CID:103645 - UNINIT_CTOR -{ - -} - - -hostIf_WiFi* hostIf_WiFi::getInstance(int dev_id) -{ - hostIf_WiFi* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create Wifi Interface instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - - return pRet; -} - -GList* hostIf_WiFi::getAllIntefaces() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi::closeInstance(hostIf_WiFi *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi* pDev = (hostIf_WiFi *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - -/****************************************************************************************************************************************************/ -// Device.WiFi. Profile. Getters: -/****************************************************************************************************************************************************/ -#ifdef RDKV_NM -int hostIf_WiFi::get_Device_WiFi_RadioNumberOfEntries(HOSTIF_MsgData_t *stMsgData) -{ - ULONG radioNumOfEntries = 0; - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - IARM_BUS_WiFi_DiagsPropParam_t param; - int ret = OK; - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - - param.numEntry=IARM_BUS_WIFI_MGR_RadioEntry; -// ret = wifi_getRadioNumberOfEntries(&radioNumOfEntries); - - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getSSIDProps, (void *)¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s] param.data.radioNumberOfEntries returned %d radioNumOfEntries:%lu\n", - __FUNCTION__, __FILE__, ret, param.data.radioNumberOfEntries); - radioNumOfEntries=param.data.radioNumberOfEntries; - put_int(stMsgData->paramValue,radioNumOfEntries); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen = sizeof(radioNumOfEntries); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} - -int hostIf_WiFi::get_Device_WiFi_SSIDNumberOfEntries(HOSTIF_MsgData_t *stMsgData) -{ - ULONG ssidNumOfEntries = 0; - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - int ret = OK; - IARM_BUS_WiFi_DiagsPropParam_t param; - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - param.numEntry=IARM_BUS_WIFI_MGR_SSIDEntry; - - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getSSIDProps, (void *)¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering.. param.data.ssidNumberOfEntries %d \n", __FUNCTION__, __FILE__,param.data.ssidNumberOfEntries); - ssidNumOfEntries=param.data.ssidNumberOfEntries; - put_int(stMsgData->paramValue,ssidNumOfEntries); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen = 4; - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} -#endif -int hostIf_WiFi::get_Device_WiFi_AccessPointNumberOfEntries(HOSTIF_MsgData_t *stMsgData) -{ - unsigned int accessPointNumOfEntries = 1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - - put_int(stMsgData->paramValue, accessPointNumOfEntries); - - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen = sizeof (unsigned int); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return OK; -} - -int hostIf_WiFi::get_Device_WiFi_EndPointNumberOfEntries(HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - - unsigned int endPointNumOfEntries = 1; - put_int(stMsgData->paramValue, endPointNumOfEntries); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen = sizeof (unsigned int); - - return OK; -} -#ifdef RDKV_NM -int hostIf_WiFi::get_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - - IARM_BUS_NetSrvMgr_Iface_EventData_t param = {0}; - snprintf (param.setInterface, INTERFACE_SIZE, "WIFI"); - IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_NETSRVMGR_API_isInterfaceEnabled, (void*)¶m, sizeof(param)); - put_boolean(stMsgData->paramValue, param.isInterfaceEnabled); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - return OK; -} -#else -int hostIf_WiFi::get_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - - std::string response; - if (!invokeThunderPluginMethod("org.rdk.NetworkManager.GetAvailableInterfaces", "", response)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch interfaces from NetworkManager.GetAvailableInterfaces\n", __FUNCTION__); - return NOK; - } - - bool enabled = false; - if (readThunderArrayItemByKey(response, "interfaces", "type", "WIFI", "enabled", enabled)) - { - put_boolean(stMsgData->paramValue, enabled); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen = 1; - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing enabled for WIFI interface\n", __FUNCTION__); - return NOK; - } - - return OK; -} -#endif -#ifdef RDKV_NM -int hostIf_WiFi::set_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (stMsgData->paramtype != hostIf_BooleanType) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed due to wrong data type for %s, please use boolean(0/1) to set.\n", __FUNCTION__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterType; - return NOK; - } - - IARM_BUS_NetSrvMgr_Iface_EventData_t iarmData = { 0 }; - snprintf (iarmData.setInterface, INTERFACE_SIZE, "WIFI"); - iarmData.isInterfaceEnabled = get_boolean(stMsgData->paramValue); - iarmData.persist = true; // set interface control persistence = true, whether WiFi is asked to be enabled or not - - if (IARM_RESULT_SUCCESS == IARM_Bus_Call (IARM_BUS_NM_SRV_MGR_NAME, - IARM_BUS_NETSRVMGR_API_setInterfaceEnabled, - (void*)&iarmData, sizeof(iarmData))) - { - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, - "[%s] IARM call succeeded %s %s (interface = %s enabled = %d persist = %d)\n", - __FUNCTION__, IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_NETSRVMGR_API_setInterfaceEnabled, - iarmData.setInterface, iarmData.isInterfaceEnabled, iarmData.persist); - return OK; - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, - "[%s] IARM call failed %s %s (interface = %s enabled = %d persist = %d)\n", - __FUNCTION__, IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_NETSRVMGR_API_setInterfaceEnabled, - iarmData.setInterface, iarmData.isInterfaceEnabled, iarmData.persist); - return NOK; - } -} -#else -int hostIf_WiFi::set_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - string paramsJson; - - if (stMsgData->paramtype != hostIf_BooleanType) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed due to wrong data type for %s, please use boolean(0/1) to set.\n", __FUNCTION__, stMsgData->paramName); - stMsgData->faultCode = fcInvalidParameterType; - return NOK; - } - - if(get_boolean(stMsgData->paramValue)) { - paramsJson = "{\"interface\": \"wlan0\", \"enabled\": true}"; - } - else { - paramsJson = "{\"interface\": \"wlan0\", \"enabled\": false}"; - } - - bool result = false; - if (invokeThunderPluginMethodAndExtractBoolField("org.rdk.NetworkManager.SetInterfaceState", paramsJson, "success", result)) - { - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: Result of Set operation = %s\n", - __FUNCTION__, result ? "true" : "false"); - if (!result) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: WiFi SetInterfaceState rejected by Thunder\n", __FUNCTION__); - stMsgData->faultCode = fcRequestDenied; - return NOK; - } - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: WiFi SetInterfaceState call failed\n", __FUNCTION__); - return NOK; - } - return OK; -} -#endif - -#endif -/* End of doxygen group */ -/** - * @} - */ - -/* End of file xxx_api.c. */ diff --git a/src/hostif/profiles/wifi/Device_WiFi.h b/src/hostif/profiles/wifi/Device_WiFi.h deleted file mode 100644 index 3056df8aa..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi.h +++ /dev/null @@ -1,267 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi.h - * TR-069 Device.WiFi object Public API. - */ - -/** - * @defgroup TR69_HOSTIF_WIFI TR-069 Object (Device.WiFi) - * The WiFi object is based on the WiFi Alliance 802.11 specifications ([802.11-2007]). - * It defines interface objects (Radio and SSID), and application objects (AccessPoint and EndPoint). - * - * @par About TR-069 Object Device.WiFi.AccessPoint.{i} - * @n - * This object models an 802.11 connection from the perspective of a wireless access point. - * Each AccessPoint entry is associated with a particular SSID interface instance via the SSIDReference parameter. - * @n @n - * For enabled table entries, if SSIDReference is not a valid reference then the table entry is inoperable - * and the CPE MUST set Status to Error_Misconfigured. - * @n - * @note The AccessPoint table includes a unique key parameter that is a strong reference. - * If a strongly referenced object is deleted, the CPE will set the referencing parameter to an empty string. - * However, doing so under these circumstances might cause the updated AccessPoint row to then violate - * the table's unique key constraint; if this occurs, the CPE MUST set Status to Error_Misconfigured - * and disable the offending AccessPoint row. - * @n @n - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value - * for Alias. On creation of a new table entry, the CPE MUST choose an initial value for Alias such that the - * new entry does not conflict with any existing entries. - * @n @n - * At most one enabled entry in this table can exist with a given value for SSIDReference. - * - * @par About TR-069 Object Device.WiFi.EndPoint.{i} - * @n - * This object models an 802.11 connection from the perspective of a wireless end point. - * Each EndPoint entry is associated with a particular SSID interface instance via the SSIDReference parameter, - * and an associated active Profile instance via the ProfileReference parameter. - * The active profile is responsible for specifying the actual SSID and security settings used by the end point. - * @n @n - * For enabled table entries, if SSIDReference or ProfileReference is not a valid reference then the table entry - * is inoperable and the CPE MUST set Status to Error_Misconfigured. - * @n @n - * Note: The EndPoint table includes a unique key parameter that is a strong reference. - * If a strongly referenced object is deleted, the CPE will set the referencing parameter to an empty string. - * However, doing so under these circumstances might cause the updated EndPoint row to then violate the table's - * unique key constraint; - * @n @n - * if this occurs, the CPE MUST set Status to Error_Misconfigured and disable the offending EndPoint row. - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value for Alias. - * On creation of a new table entry, the CPE MUST choose an initial value for Alias - * such that the new entry does not conflict with any existing entries. - * @n @n - * At most one enabled entry in this table can exist with a given value for SSIDReference. - * - * @par About TR-069 Object Device.WiFi.Radio.{i}. - * @n - * This object models an 802.11 wireless radio on a device (a stackable interface object as described - * in [Section 4.2/TR-181i2]). - * @n @n - * If the device can establish more than one connection simultaneously (e.g. a dual radio device), - * a separate Radio instance MUST be used for each physical radio of the device. See [Appendix III.1/TR-181i2] - * for additional information. - * @n - * @note A dual-band single-radio device (e.g. an 802.11a/b/g radio) can be configured to operate at 2.4 or - * 5 GHz frequency bands, but only a single frequency band is used to transmit/receive at a given time. - * Therefore, a single Radio instance is used even for a dual-band radio. - * @n @n - * At most one entry in this table can exist with a given value for Alias, or with a given value for Name. - * - * @par About TR-069 Object Device.WiFi.SSID.{i}. - * @n - * WiFi SSID table (a stackable interface object as described in [Section 4.2/TR-181i2]), where table - * entries model the MAC layer. A WiFi SSID entry is typically stacked on top of a Radio object. - * @n - * WiFi SSID is also a multiplexing layer, i.e. more than one SSID can be stacked above a single Radio. - * @n - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given - * value for Alias, or with a given value for Name. On creation of a new table entry, the CPE MUST choose - * initial values for Alias and Name such that the new entry does not conflict with any existing entries. - * @n - * At most one enabled entry in this table can exist with a given value for SSID, or with a given value for BSSID. - * - * @ingroup TR69_HOSTIF_PROFILE - * - * @defgroup TR69_HOSTIF_WIFI_API TR-069 Object (Device.WiFi.) Public APIs - * The WiFi object is based on the WiFi Alliance 802.11 specifications ([802.11-2007]). - * It defines interface objects (Radio and SSID), and application objects (AccessPoint and EndPoint). - * - * @ingroup TR69_HOSTIF_WIFI - */ - - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_H_ -#define DEVICE_WIFI_H_ - -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * TR069-DEVICE-WIFI API SPECIFIC INCLUDE FILES - *****************************************************************************/ -#include "hostIf_main.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_utils.h" -#include "hostIf_updateHandler.h" - -#define QUERY_INTERVAL 10 - -/** @defgroup TR_069_DEVICE_WIFI_API TR-069 Device.WiFi object API. - * @ingroup TR_069_API - * - * The The WiFi object is based on the WiFi Alliance 802.11 specifications ([802.11-2007]). - * It defines interface objects (Radio and SSID), and application objects (AccessPoint and EndPoint). - * - */ - -/** @addtogroup TR_069_DEVICE_WIFI_GETTER_API TR-069 Device.WiFi Getter API. - * @ingroup TR_069_DEVICE_WIFI_API - * - * \section TR-069 Device.WiFi Getter API - * - * This is the getter group of API for the Device.WiFi object. - * - * The interface for all functions is identical and is described here. - * - * @param[in] HOSTIF_MsgData_t This is the host IF Message Request data - * - * @return The status of the operation. - * @retval OK If parameter requested was successfully fetched. (Same as NO_ERROR). - * @retval NOK If parameter requested was successfully fetched. (Same as OK). - * - * - * @{ - */ - -/** - * @brief Get the status of the time client. - * - * This function provides the status (enabled or disabled) of the NTP or SNTP time - * client. - * - * See @ref dev_time_getter - * - */ - -class WiFiDevice { - void *ctxt = NULL; //CID:103345,102998 - UNINIT_CTOR,UNINIT - static GHashTable *devHash; - - int dev_id; - - WiFiDevice(int dev_id); - ~WiFiDevice() {}; -public: - static class WiFiDevice *getInstance(int dev_id); - static void closeInstance(WiFiDevice *); - static void closeAllInstances(); - - static int init(); - static void shutdown(); - - void* getContext(); -}; - - -class hostIf_WiFi { - - static GHashTable *ifHash; - - int dev_id; - unsigned int uiRadioNumberOfEntries; - unsigned int uiSSIDNumberOfEntries; - unsigned int uiAccessPointNumberOfEntries; - unsigned int uiEndPointNumberOfEntries; - - hostIf_WiFi(int dev_id); - ~hostIf_WiFi() {}; - -public: - - static hostIf_WiFi* getInstance(int dev_id); - static void closeInstance(hostIf_WiFi*); - static GList* getAllIntefaces(); - static void closeAllInstances(); - - #ifdef RDKV_NM - /** - * @ingroup TR69_HOSTIF_WIFI_API - * @{ - */ - /** - * @brief This function provides the number of entries in the Radio table. - */ - int get_Device_WiFi_RadioNumberOfEntries(HOSTIF_MsgData_t *); - - - /** - * @brief This function provides the number of entries in the SSID table. - */ - int get_Device_WiFi_SSIDNumberOfEntries(HOSTIF_MsgData_t *); - #endif - /** - * @brief This function provides the number of entries in the AccessPoint table. - */ - int get_Device_WiFi_AccessPointNumberOfEntries(HOSTIF_MsgData_t *); - - /** - * @brief This function provides the number of entries in the EndPoint table. - */ - int get_Device_WiFi_EndPointNumberOfEntries(HOSTIF_MsgData_t *); - - /** - * @brief Get the wifi enable status. - * - * This function gets the value of enable or disable wifi. - * - */ - int get_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *); - /** - * @brief set the wifi enable status. - * - * This function sets the value for enable or disable wifi. - * - */ - int set_Device_WiFi_EnableWiFi(HOSTIF_MsgData_t *); - - /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_API - /* End of TR_069_DEVICE_WIFI_GETTER_API doxygen group. */ - /** - * @} - */ - -}; -/* End of TR_069_DEVICE_WIFI_SETTER_API doxygen group. */ -/** - * @} - */ -#endif /*#ifdef USE_WIFI_PROFILE*/ -#endif /* DEVICE_WIFI_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.cpp b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.cpp deleted file mode 100644 index e165758ea..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_EndPoint_AccessPoint.cpp - * - * @brief Device_WiFi_EndPoint_AccessPoint API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_AccessPoint.h" - -GHashTable* hostIf_WiFi_AccessPoint::ifHash = NULL; - -hostIf_WiFi_AccessPoint* hostIf_WiFi_AccessPoint::getInstance(int dev_id) -{ - hostIf_WiFi_AccessPoint* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_AccessPoint *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_AccessPoint(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - - -GList* hostIf_WiFi_AccessPoint::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - - -void hostIf_WiFi_AccessPoint::closeInstance(hostIf_WiFi_AccessPoint *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_AccessPoint::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_AccessPoint* pDev = (hostIf_WiFi_AccessPoint *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} -/* -void hostIf_WiFi_AccessPoint::getLock() -{ - if(!m_mutex) - { - m_mutex = g_mutex_new(); - } - g_mutex_lock(m_mutex); -} - -void hostIf_WiFi_AccessPoint::releaseLock() -{ - RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%d] Unlocking mutex... \n", __FUNCTION__, __LINE__); - g_mutex_unlock(m_mutex); -}*/ - - -hostIf_WiFi_AccessPoint::hostIf_WiFi_AccessPoint(int dev_id): - dev_id(0), - Enable(false), - SSIDAdvertisementEnabled(false), - RetryLimit(0), - WMMCapability(false), - UAPSDCapability(false), - WMMEnable(false), - UAPSDEnable(false), - AssociatedDeviceNumberOfEntries(0) -{ - - memset(Status , 0, 64); - memset (Alias, 0,64); - memset (SSIDReference, 0, 256); -} - - - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Status(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_Alias(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_SSIDReference(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_SSIDAdvertisementEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_RetryLimit(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_WMMCapability(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_UAPSDCapability(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_WMMEnable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_UAPSDEnable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_AccessPoint::get_hostIf_WiFi_AccessPoint_AssociatedDeviceNumberOfEntries(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.h b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.h deleted file mode 100644 index e08a0d9c3..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_ACCESSPOINT TR-069 Object (Device.WiFi.AccessPoint.{i}) API - * - * This object models an 802.11 connection from the perspective of a wireless access point. - * Each AccessPoint entry is associated with a particular SSID interface instance via the SSIDReference parameter. - * - * For enabled table entries, if SSIDReference is not a valid reference then the table entry is inoperable - * and the CPE MUST set Status to Error_Misconfigured. - * - * @note The AccessPoint table includes a unique key parameter that is a strong reference. - * If a strongly referenced object is deleted, the CPE will set the referencing parameter to an empty string. - * However, doing so under these circumstances might cause the updated AccessPoint row to then violate - * the table's unique key constraint; if this occurs, the CPE MUST set Status to Error_Misconfigured - * and disable the offending AccessPoint row. - * - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value - * for Alias. On creation of a new table entry, the CPE MUST choose an initial value for Alias such that the - * new entry does not conflict with any existing entries. - * - * At most one enabled entry in this table can exist with a given value for SSIDReference. - * @ingroup TR69_HOSTIF_WIFI - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ACCESSPOINT_H_ -#define DEVICE_WIFI_ACCESSPOINT_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - -class hostIf_WiFi_AccessPoint { - - static GHashTable *ifHash; - int dev_id; - hostIf_WiFi_AccessPoint(int dev_id); - ~hostIf_WiFi_AccessPoint() {}; - -public: - static class hostIf_WiFi_AccessPoint *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_AccessPoint *); - static void closeAllInstances(); - - static unsigned int AccessPointNumberOfEntries; - - bool Enable; - char Status[64]; - char Alias[64]; - char SSIDReference[256]; - bool SSIDAdvertisementEnabled; - unsigned int RetryLimit; - bool WMMCapability; - bool UAPSDCapability; - bool WMMEnable; - bool UAPSDEnable; - unsigned int AssociatedDeviceNumberOfEntries; - - /** - * @ingroup TR69_HOSTIF_WIFI_ACCESSPOINT - * @{ - */ - /** - * @brief Enables or disables this access point. - * - * @param[in] stMsgData TR-069 Host interface message request. - */ - int get_hostIf_WiFi_AccessPoint_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the status of the access point which is currently being set. - * The status of the access point could be the following types, - * - Disabled - * - Enabled - * - Error_Misconfigured - * - Error (OPTIONAL) - * The Error_Misconfigured value indicates that a necessary configuration value is undefined or invalid. - * The Error value may be used by the CPE to indicate a locally defined error condition. - * - * @param[in] stMsgData TR-069 Host interface message request. - */ - int get_hostIf_WiFi_AccessPoint_Status(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the access point alias based addressing. Alias provides a mechanism for an ACS to label - * the instance for future reference. The following mandatory constraints MUST be enforced: - * - Its value MUST NOT be empty. - * - Its value MUST start with a letter. - * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix. - * - The CPE MUST NOT change the parameter value. - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Alias(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get path name of a row in the SSID table. If the parameter value is set to Null indicate that - * the reference object is deleted. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_SSIDReference(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check whether or not beacons include the SSID name. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_SSIDAdvertisementEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get thee maximum number of retransmission for a packet. This corresponds to IEEE 802.11 - * parameter dot11ShortRetryLimit. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_RetryLimit(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check whether this access point supports WiFi Multimedia (WMM) Access Categories (AC). - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_WMMCapability(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check whether this access point supports WMM Unscheduled Automatic Power Save Delivery (U-APSD). - * @note U-APSD support implies WMM support. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_UAPSDCapability(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check whether WMM support is currently enabled. When enabled, this is indicated in beacon frames. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_WMMEnable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Whether U-APSD support is currently enabled. When enabled, this is indicated in beacon frames. - * @note U-APSD can only be enabled if WMM is also enabled. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_UAPSDEnable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the number of entries in the AssociatedDevice table. The AssociatedDevice table contains - * information about other Wifi devices currently associated with this Wifi interface. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDeviceNumberOfEntries(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_ACCESSPOINT -}; - - - - -#endif /* DEVICE_WIFI_ACCESSPOINT_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.cpp b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.cpp deleted file mode 100644 index 56108a71d..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_AccessPoint_AssociatedDevice.cpp - * - * @brief WiFi AccessPoint AssociatedDevice API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -#ifdef USE_WIFI_PROFILE - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_AccessPoint_AssociatedDevice.h" - -GHashTable* hostIf_WiFi_AccessPoint_AssociatedDevice::ifHash = NULL; - -hostIf_WiFi_AccessPoint_AssociatedDevice* hostIf_WiFi_AccessPoint_AssociatedDevice::getInstance(int dev_id) -{ - hostIf_WiFi_AccessPoint_AssociatedDevice* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_AccessPoint_AssociatedDevice *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_AccessPoint_AssociatedDevice(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint_AssociatedDevice instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_AccessPoint_AssociatedDevice::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_AccessPoint_AssociatedDevice::closeInstance(hostIf_WiFi_AccessPoint_AssociatedDevice *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_AccessPoint_AssociatedDevice::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_AccessPoint_AssociatedDevice* pDev = (hostIf_WiFi_AccessPoint_AssociatedDevice *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_AccessPoint_AssociatedDevice::hostIf_WiFi_AccessPoint_AssociatedDevice(int dev_id): - dev_id(0), - AuthenticationState(false), - LastDataDownlinkRate(0), - LastDataUplinkRate(0), - SignalStrength(0), - Retransmissions(0), - Active(false) -{ - m_mutex = NULL; //CID:103455 - UNINIT_CTOR - memset(MACAddress, 0, 17); -} - - - - -/** - * @brief Get the MAC Address of an Associated Device of a MoCA Interface. - * - * This function provides the MAC address of the MoCA interface of the device associated - * with this MoCA interface. - * - * See @ref dev_moca_if_assocdev_getter - * - */ -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_MACAddress(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} - -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_AuthenticationState(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataDownlinkRate(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataUplinkRate(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_SignalStrength(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_Retransmissions(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_AssociatedDevice::get_hostIf_WiFi_AccessPoint_AssociatedDevice_Active(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.h b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.h deleted file mode 100644 index 2b2b6d6f8..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_AssociatedDevice.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_ACP_ASSOCIATEDDEV TR-069 Object (Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.) Public APIs - * The module provide the interface specifications for TR-069 Object Access Point. - * A table of the devices currently associated with the access point. - * At most one entry in this table can exist with a given value for MACAddress. - * @ingroup TR69_HOSTIF_WIFI - */ - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ACCESSPOINT_ASSOCIATEDDEVICE_H_ -#define DEVICE_WIFI_ACCESSPOINT_ASSOCIATEDDEVICE_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - - -class hostIf_WiFi_AccessPoint_AssociatedDevice { - - static GHashTable *ifHash; - GMutex* m_mutex; - int dev_id; - hostIf_WiFi_AccessPoint_AssociatedDevice(int dev_id); - ~hostIf_WiFi_AccessPoint_AssociatedDevice() {}; - -public: - static class hostIf_WiFi_AccessPoint_AssociatedDevice *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_AccessPoint_AssociatedDevice *); - static void closeAllInstances(); - - char MACAddress[17]; - bool AuthenticationState; - unsigned int LastDataDownlinkRate; - unsigned int LastDataUplinkRate; - int SignalStrength; - unsigned int Retransmissions; - bool Active; - - /** @addtogroup TR69_HOSTIF_WIFI_ACP_ASSOCIATEDDEV - * @{ - */ - /** - * @brief Get the MAC Address of an Associated Device of a WiFi Interface. - * - * This function provides the MAC address of the WiFi interface of the device associated - * with this WiFi interface. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_MACAddress(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check Whether an associated device has authenticated (true) or not (false). - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_AuthenticationState(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the data transmit rate in kbps that was most recently used for transmission from the access - * point to the associated device. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataDownlinkRate(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the data transmit rate in kbps that was most recently used for transmission from the associated - * device to the access point. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_LastDataUplinkRate(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the radio signal strength of the uplink from the associated device to the access point, - * measured in dBm, as an average of the last 100 packets received from the device. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_SignalStrength(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the number of packets that had to be re-transmitted, from the last 100 packets sent to the - * associated device. Multiple re-transmissions of the same packet count as one. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_Retransmissions(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check whether or not this node is currently present in the WiFi AccessPoint network. - * - * The ability to list inactive nodes is optional. If the CPE includes inactive nodes in this table, - * Active MUST be set to false for each inactive node. The length of time an inactive node remains listed - * in this table is a local matter to the CPE. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_AssociatedDevice_Active(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of doxygen Tag TR69_HOSTIF_WIFI_ACP_ASSOCIATEDDEV -}; - - - -#endif /* DEVICE_WIFI_ACCESSPOINT_ASSOCIATEDDEVICE_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.cpp b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.cpp deleted file mode 100644 index ec862eada..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint_AccessPoint_Security.cpp - * - * @brief Device_WiFi_EndPoint_AccessPoint_WPS API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_AccessPoint_Security.h" - -GHashTable* hostIf_WiFi_AccessPoint_Security::ifHash = NULL; - -hostIf_WiFi_AccessPoint_Security* hostIf_WiFi_AccessPoint_Security::getInstance(int dev_id) -{ - hostIf_WiFi_AccessPoint_Security* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_AccessPoint_Security *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_AccessPoint_Security(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint_Security instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_AccessPoint_Security::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - - -void hostIf_WiFi_AccessPoint_Security::closeInstance(hostIf_WiFi_AccessPoint_Security *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_AccessPoint_Security::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_AccessPoint_Security* pDev = (hostIf_WiFi_AccessPoint_Security *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - -hostIf_WiFi_AccessPoint_Security::hostIf_WiFi_AccessPoint_Security(int dev_id): - dev_id(0), - RekeyingInterval(0), - RadiusServerPort(0) -{ - memset(ModesSupported, 0, 20); - memset(ModeEnabled, 0, 20); - memset(WEPKey, 0, 64); - memset(PreSharedKey, 0, 64); - memset(KeyPassphrase, 0, 64); - memset(RadiusServerIPAddr, 0, 45); - memset(RadiusSecret, 0, 64); -} -/** - * @brief Get the MAC Address of an Associated Device of a MoCA Interface. - * - * This function provides the MAC address of the MoCA interface of the device associated - * with this MoCA interface. - * - * See @ref dev_moca_if_assocdev_getter - * - */ -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_ModesSupported(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_WEPKey(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RekeyingInterval(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusServerIPAddr(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusServerPort(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -int hostIf_WiFi_AccessPoint_Security::get_hostIf_WiFi_AccessPoint_Security_RadiusSecret(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.h b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.h deleted file mode 100644 index 8c6f1796b..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_Security.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @defgroup TR69_HOSTIF_WIFI_AP_SECURITY TR-069 Object (Device.WiFi.AccessPoint.{i}.Security.) Public APIs - * This module contains security related parameters that apply to a CPE acting as an Access Point [802.11-2007]. - * @ingroup TR69_HOSTIF_WIFI - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ACCESSPOINT_SECURITY_H_ -#define DEVICE_WIFI_ACCESSPOINT_SECURITY_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - - -class hostIf_WiFi_AccessPoint_Security { - static GHashTable *ifHash; - int dev_id; - hostIf_WiFi_AccessPoint_Security(int dev_id); - ~hostIf_WiFi_AccessPoint_Security() {}; - -public: - static class hostIf_WiFi_AccessPoint_Security *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_AccessPoint_Security *); - static void closeAllInstances(); - - char ModesSupported[20]; - char ModeEnabled[20]; - char WEPKey[64]; - char PreSharedKey[64]; - char KeyPassphrase[64]; - unsigned int RekeyingInterval; - char RadiusServerIPAddr[45]; - unsigned int RadiusServerPort; - char RadiusSecret[64]; - - /** - * @ingroup TR69_HOSTIF_WIFI_AP_SECURITY - * @{ - */ - /** - * @brief Get the comma-separated list of strings, indicate which security modes this AccessPoint instance - * is capable of supporting. Each list item is an enumeration of. - * - None - * - WEP-64 - * - WEP-128 - * - WPA-Personal - * - WPA2-Personal - * - WPA-WPA2-Personal - * - WPA-Enterprise - * - WPA2-Enterprise - * - WPA-WPA2-Enterprise - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_ModesSupported(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the security mode enabled for wifi device. The value must be a member of the list - * reported by the ModesSupported parameter, indicates which security mode is enabled. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Provide A WEP key expressed as a hexadecimal string. - * - * WEPKey is used only if ModeEnabled is set to WEP-64 or WEP-128. - * A 5 byte WEPKey corresponds to security mode WEP-64 and a 13 byte WEPKey corresponds to security mode WEP-128. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_WEPKey(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief A literal PreSharedKey (PSK) expressed as a hexadecimal string. - * - * PreSharedKey is only used if ModeEnabled is set to WPA-Personal or WPA2-Personal or WPA-WPA2-Personal. - * If KeyPassphrase is written, then PreSharedKey is immediately generated. - * The ACS SHOULD NOT set both the KeyPassphrase and the PreSharedKey directly (the result of doing this is undefined). - * When read, this parameter returns an empty string, regardless of the actual value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Provide a passphrase from which the PreSharedKey is to be generated, - * for WPA-Personal or WPA2-Personal or WPA-WPA2-Personal security modes. - * - * If KeyPassphrase is written, then PreSharedKey is immediately generated. - * The ACS SHOULD NOT set both the KeyPassphrase and the PreSharedKey directly - * (the result of doing this is undefined). The key is generated as specified by WPA, - * which uses PBKDF2 from PKCS #5: Password-based Cryptography Specification Version 2.0 ([RFC2898]). - * - * When read, this parameter returns an empty string, regardless of the actual value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the interval (expressed in seconds) in which the keys are re-generated. - * - * This is applicable to WPA, WPA2 and Mixed (WPA-WPA2) modes in Personal or Enterprise mode - * (i.e. when ModeEnabled is set to a value other than None or WEP-64 or WEP-128. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_RekeyingInterval(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the IP Address of the RADIUS server used for WLAN security. - * RadiusServerIPAddr is only applicable when ModeEnabled is an Enterprise type - * (i.e. WPA-Enterprise, WPA2-Enterprise or WPA-WPA2-Enterprise). - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_RadiusServerIPAddr(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the port number of the RADIUS server used for WLAN security. - * RadiusServerPort is only applicable when ModeEnabled is an Enterprise type - * (i.e. WPA-Enterprise, WPA2-Enterprise or WPA-WPA2-Enterprise). - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_RadiusServerPort(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief The secret used for handshaking with the RADIUS server [RFC2865]. - * When read, this parameter returns an empty string, regardless of the actual value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_Security_RadiusSecret(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ // End of Doxygen Tag TR69_HOSTIF_WIFI_AP_SECURITY -}; - - - -#endif /* DEVICE_WIFI_ACCESSPOINT_SECURITY_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.cpp b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.cpp deleted file mode 100644 index 5a049edb9..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint_AccessPoint_WPS.cpp - * - * @brief Device_WiFi_EndPoint_AccessPoint_WPS API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_AccessPoint_WPS.h" - -GHashTable* hostIf_WiFi_AccessPoint_WPS::ifHash = NULL; - -hostIf_WiFi_AccessPoint_WPS* hostIf_WiFi_AccessPoint_WPS::getInstance(int dev_id) -{ - hostIf_WiFi_AccessPoint_WPS* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_AccessPoint_WPS *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_AccessPoint_WPS(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_AccessPoint_WPS instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_AccessPoint_WPS::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_AccessPoint_WPS::closeInstance(hostIf_WiFi_AccessPoint_WPS *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_AccessPoint_WPS::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_AccessPoint_WPS* pDev = (hostIf_WiFi_AccessPoint_WPS *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - -hostIf_WiFi_AccessPoint_WPS::hostIf_WiFi_AccessPoint_WPS(int dev_id): - dev_id(0), - Enable(false) -{ - memset(ConfigMethodsSupported, 0, 100); - memset(ConfigMethodsEnabled, 0, 64); -} - -int hostIf_WiFi_AccessPoint_WPS::get_hostIf_WiFi_AccessPoint_WPS_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} -int hostIf_WiFi_AccessPoint_WPS::get_hostIf_WiFi_AccessPoint_WPS_ConfigMethodsSupported(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} - -int hostIf_WiFi_AccessPoint_WPS::get_hostIf_WiFi_AccessPoint_WPS_ConfigMethodsEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - - diff --git a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.h b/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.h deleted file mode 100644 index 58c4ff881..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_AccessPoint_WPS.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_AP_WPS TR-069 Object (Device.WiFi.AccessPoint.{i}.WPS.) Public APIs - * This module provides interface functions related to Wi-Fi Protected Setup [WPSv1.0] for this access point. - * @ingroup TR69_HOSTIF_WIFI - */ - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ACCESSPOINT_WPS_H_ -#define DEVICE_WIFI_ACCESSPOINT_WPS_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - - -class hostIf_WiFi_AccessPoint_WPS { - - static GHashTable *ifHash; - static GMutex* m_mutex; - int dev_id; - hostIf_WiFi_AccessPoint_WPS(int dev_id); - ~hostIf_WiFi_AccessPoint_WPS() {}; - -public: - static class hostIf_WiFi_AccessPoint_WPS *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_AccessPoint_WPS *); - static void closeAllInstances(); - - bool Enable; - char ConfigMethodsSupported[100]; - char ConfigMethodsEnabled[64]; - - - /** - * @ingroup TR69_HOSTIF_WIFI_AP_WPS - * @{ - */ - /** - * @brief Enables or disables WPS functionality for this access point. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_WPS_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief This function provides the comma-separated list of strings, which indicates WPS configuration - * methods supported by the device. - * - * Each list item is an enumeration of: - * - USBFlashDrive - * - Ethernet - * - ExternalNFCToken - * - IntegratedNFCToken - * - NFCInterface - * - PushButton - * - PIN - * This parameter corresponds directly to the "Config Methods" attribute of the WPS specification [WPSv1.0]. - * The PushButton and PIN methods MUST be supported. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_WPS_ConfigMethodsSupported(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief This function provides the comma-separated list of strings. - * Each list item MUST be a member of the list reported by the ConfigMethodsSupported parameter. - * Indicates WPS configuration methods enabled on the device. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_AccessPoint_WPS_ConfigMethodsEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ // End of doxygen tag TR69_HOSTIF_WIFI_AP_WPS -}; - - - -#endif /* DEVICE_WIFI_ACCESSPOINT_WPS_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp b/src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp deleted file mode 100644 index 5a5b89f0b..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp +++ /dev/null @@ -1,452 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint.cpp - * - * @brief Device_WiFi_SSID API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ - -#include "Device_WiFi_EndPoint.h" -#include -#include "safec_lib.h" -#ifdef RDKV_NM -extern "C" { -#include "wifiSrvMgrIarmIf.h" -}; -#else -#include -#include "cJSON.h" -#include "hostIf_utils.h" -#endif - -enum WiFiEndPointFetchMask { - WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES = 1 << 0, - WIFI_ENDPOINT_FETCH_CONNECTED_SSID = 1 << 1 -}; - -#ifndef RDKV_NM -static time_t endPointInterfacesFetchTime = 0; -static time_t endPointConnectedSsidFetchTime = 0; -#endif - -GHashTable* hostIf_WiFi_EndPoint::ifHash = NULL; - -hostIf_WiFi_EndPoint* hostIf_WiFi_EndPoint::getInstance(int dev_id) -{ - hostIf_WiFi_EndPoint* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_EndPoint *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_EndPoint(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_EndPoint::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_EndPoint::closeInstance(hostIf_WiFi_EndPoint *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_EndPoint::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_EndPoint* pDev = (hostIf_WiFi_EndPoint *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_EndPoint::hostIf_WiFi_EndPoint (int dev_id) : - dev_id (dev_id), - Enable(false), - ProfileNumberOfEntries(0) -{ - memset(Status, 0, 64); - memset(Alias, 0, 64); - memset(ProfileReference, 0, 256); - memset(SSIDReference, 0, 256); - stats.LastDataDownlinkRate = 0; - stats.LastDataUplinkRate = 0; - stats.SignalStrength = 0; - stats.Retransmissions = 0; -} - - -/** -* @brief Enables/disables this end point. -*/ -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Enable (HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (OK != refreshCache (WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Enable = [%d]\n", __FUNCTION__, Enable); - put_int (stMsgData->paramValue, Enable); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen = sizeof (bool); - return OK; -} - -int hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_Enable (HOSTIF_MsgData_t *stMsgData) -{ - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Status (HOSTIF_MsgData_t *stMsgData) -{ - errno_t rc = -1; - LOG_ENTRY_EXIT; - if (OK != refreshCache (WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Status = [%s]\n", __FUNCTION__, Status); - rc=strcpy_s (stMsgData->paramValue,sizeof(stMsgData->paramValue), Status); - if(rc!=EOK) - { - ERR_CHK(rc); - } - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen (Status); - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Alias (HOSTIF_MsgData_t *stMsgData) -{ - errno_t rc = -1; - LOG_ENTRY_EXIT; - if (OK != refreshCache (0)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Alias = [%s]\n", __FUNCTION__, Alias); - rc=strcpy_s (stMsgData->paramValue,sizeof(stMsgData->paramValue), Alias); - if(rc!=EOK) - { - ERR_CHK(rc); - } - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen (Alias); - return OK; -} - -int hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_Alias (HOSTIF_MsgData_t *stMsgData) -{ - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_ProfileReference (HOSTIF_MsgData_t *stMsgData) -{ - return OK; -} - -int hostIf_WiFi_EndPoint::set_Device_WiFi_EndPoint_ProfileReference (HOSTIF_MsgData_t *stMsgData) -{ - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_SSIDReference (HOSTIF_MsgData_t *stMsgData) -{ -/* - From the spec: - - The value MUST be the path name of a row in the SSID table. If the - referenced object is deleted, the parameter value MUST be set to an empty - string. SSIDReference is determined based on the Profile.{i}.SSID within the - associated ProfileReference) endpoint profile. SSIDReference MUST be an - empty string if ProfileReference is an empty string (i.e. only when an - active profile is assigned can the associated SSID interface be determined). -*/ - // not same as value of SSIDReference returned by netsrvmgr, captured in member SSIDReference - - return OK; -} - -/* - * @brief The number of entries in the Profile table. - */ -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_ProfileNumberOfEntries (HOSTIF_MsgData_t *stMsgData) -{ - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate (HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (OK != refreshCache (0)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Stats.LastDataDownlinkRate = [%lu]\n", __FUNCTION__, stats.LastDataDownlinkRate); - put_int (stMsgData->paramValue, stats.LastDataDownlinkRate); - stMsgData->paramtype = hostIf_UnsignedLongType; - stMsgData->paramLen = sizeof (unsigned long); - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate (HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (OK != refreshCache (0)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Stats.LastDataUplinkRate = [%lu]\n", __FUNCTION__, stats.LastDataUplinkRate); - put_int (stMsgData->paramValue, stats.LastDataUplinkRate); - stMsgData->paramtype = hostIf_UnsignedLongType; - stMsgData->paramLen = sizeof (unsigned long); - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_SignalStrength (HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (OK != refreshCache (WIFI_ENDPOINT_FETCH_CONNECTED_SSID)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Stats.SignalStrength = [%d]\n", __FUNCTION__, stats.SignalStrength); - put_int (stMsgData->paramValue, stats.SignalStrength); - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen = sizeof (int); - return OK; -} - -int hostIf_WiFi_EndPoint::get_Device_WiFi_EndPoint_Stats_Retransmissions (HOSTIF_MsgData_t *stMsgData) -{ - LOG_ENTRY_EXIT; - if (OK != refreshCache (0)) - return NOK; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] Stats.Retransmissions = [%lu]\n", __FUNCTION__, stats.Retransmissions); - put_int (stMsgData->paramValue, stats.Retransmissions); - stMsgData->paramtype = hostIf_UnsignedLongType; - stMsgData->paramLen = sizeof (unsigned long); - return OK; -} - -/** -* @brief Refreshes the cache of Device.WiFi.EndPoint. parameters -*/ -#ifdef RDKV_NM -int hostIf_WiFi_EndPoint::refreshCache(unsigned int fetchMask) -{ - (void)fetchMask; - LOG_ENTRY_EXIT; - static time_t time_of_last_successful_query = 0; - static int last_call_status = NOK; - static std::mutex m; - std::lock_guard lg (m); - // Using a 1-second cache. - if ((last_call_status == OK ) && (time (0) <= time_of_last_successful_query + 1)) - { - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s] Cache not stale. last call status is SUCCESS, Refresh not required.\n", __FUNCTION__); - return OK; - } - - IARM_BUS_WiFi_DiagsPropParam_t param; - IARM_Result_t retVal = IARM_Bus_Call (IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getEndPointProps, (void *) ¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Cache refresh failed. IARM_Bus_Call to netsrvmgr returned [%d]\n", __FUNCTION__, retVal); - last_call_status = NOK; - return NOK; - } - - time_of_last_successful_query = time (0); - - Enable = param.data.endPointInfo.enable; - strncpy (Status, param.data.endPointInfo.status, BUFF_LENGTH_64); - strncpy (Alias, param.data.endPointInfo.alias, BUFF_LENGTH_64); - strncpy (ProfileReference, param.data.endPointInfo.ProfileReference, BUFF_LENGTH_256); - strncpy (SSIDReference, param.data.endPointInfo.SSIDReference, BUFF_LENGTH_256); - ProfileNumberOfEntries = param.data.endPointInfo.ProfileNumberOfEntries; - stats.LastDataDownlinkRate = param.data.endPointInfo.stats.lastDataDownlinkRate; - stats.LastDataUplinkRate = param.data.endPointInfo.stats.lastDataUplinkRate; - stats.SignalStrength = param.data.endPointInfo.stats.signalStrength; - stats.Retransmissions = param.data.endPointInfo.stats.retransmissions; - - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s] Cache refreshed.\n", __FUNCTION__); - - if (false == param.data.endPointInfo.enable) // "Disabled" endpoint - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] EndPoint is disabled\n", __FUNCTION__); - last_call_status = NOK; - return OK; - } - last_call_status = OK; - return OK; -} -#else -int hostIf_WiFi_EndPoint::refreshCache(unsigned int fetchMask) -{ - LOG_ENTRY_EXIT; - - static time_t time_of_last_successful_query = 0; - static int last_call_status = NOK; - static std::mutex m; - - std::lock_guard lg (m); - - time_t now = time(0); - unsigned int refreshMask = 0; - - // Using a 1-second cache per data source group. - if (((fetchMask & WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES) != 0) && (now > endPointInterfacesFetchTime + 1)) - { - refreshMask |= WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES; - } - - if (((fetchMask & WIFI_ENDPOINT_FETCH_CONNECTED_SSID) != 0) && (now > endPointConnectedSsidFetchTime + 1)) - { - refreshMask |= WIFI_ENDPOINT_FETCH_CONNECTED_SSID; - } - - if ((refreshMask == 0) && (fetchMask == 0)) - { - return OK; - } - - if ((last_call_status == OK ) && (refreshMask == 0) && (now <= time_of_last_successful_query + 1)) - { - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s] Cache not stale. last call status is SUCCESS, Refresh not required.\n", __FUNCTION__); - return OK; - } - - if ((refreshMask & WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES) != 0) - { - std::string response; - if (!invokeThunderPluginMethod("org.rdk.NetworkManager.1.GetAvailableInterfaces", "", response)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] org.rdk.NetworkManager.1.GetAvailableInterfaces call failed\n", __FUNCTION__); - return NOK; - } - - if (!readThunderArrayItemByKey(response, "interfaces", "type", "WIFI", "enabled", Enable)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed to extract WIFI interface enabled state\n", __FUNCTION__); - return NOK; - } - - if (Enable) - { - strncpy(Status, "Enabled", BUFF_LENGTH_64); - } - else - { - strncpy(Status, "Disabled", BUFF_LENGTH_64); - } - Status[BUFF_LENGTH_64 - 1] = '\0'; - } - - if ((refreshMask & WIFI_ENDPOINT_FETCH_CONNECTED_SSID) != 0) - { - std::string connectedSsidResponse; - if (!invokeThunderPluginMethod("org.rdk.NetworkManager.GetConnectedSSID", "", connectedSsidResponse)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed to invoke GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - - std::string connectedSsid; - if (!thunderExtractResultStringField(connectedSsidResponse, "ssid", connectedSsid)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed to extract SSID from GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - strncpy(SSIDReference, connectedSsid.c_str(), BUFF_LENGTH_256); - SSIDReference[BUFF_LENGTH_256 - 1] = '\0'; - - int strength = 0; - if (!thunderExtractResultNumberField(connectedSsidResponse, "strength", strength)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] Failed to extract signal strength from GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - stats.SignalStrength = strength; - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: strength = %d\n", __FUNCTION__, stats.SignalStrength); - } - - time_of_last_successful_query = now; - if ((refreshMask & WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES) != 0) - { - endPointInterfacesFetchTime = now; - } - if ((refreshMask & WIFI_ENDPOINT_FETCH_CONNECTED_SSID) != 0) - { - endPointConnectedSsidFetchTime = now; - } - - //strncpy (Alias, param.data.endPointInfo.alias, BUFF_LENGTH_64); - //strncpy (ProfileReference, param.data.endPointInfo.ProfileReference, BUFF_LENGTH_256); - //ProfileNumberOfEntries = param.data.endPointInfo.ProfileNumberOfEntries; - - RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s] Cache refreshed.\n", __FUNCTION__); - - if (((fetchMask & WIFI_ENDPOINT_FETCH_AVAILABLE_INTERFACES) != 0) && (false == Enable)) // "Disabled" endpoint - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s] EndPoint is disabled\n", __FUNCTION__); - last_call_status = NOK; - return OK; - } - last_call_status = OK; - return OK; -} -#endif -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint.h b/src/hostif/profiles/wifi/Device_WiFi_EndPoint.h deleted file mode 100644 index e1c68fab9..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ENDPOINT_H_ -#define DEVICE_WIFI_ENDPOINT_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - -/** - * @defgroup TR69_HOSTIF_WIFI_ENDPOINT TR-069 Object (Device.WiFi.EndPoint.{i}) Public APIs - * This object models an 802.11 connection from the perspective of a wireless end point. - * Each EndPoint entry is associated with a particular SSID interface instance via the SSIDReference parameter, - * and an associated active Profile instance via the ProfileReference parameter. - * The active profile is responsible for specifying the actual SSID and security settings used by the end point. - * - * For enabled table entries, if SSIDReference or ProfileReference is not a valid reference then the table entry - * is inoperable and the CPE MUST set Status to Error_Misconfigured. - * - * Note: The EndPoint table includes a unique key parameter that is a strong reference. - * If a strongly referenced object is deleted, the CPE will set the referencing parameter to an empty string. - * However, doing so under these circumstances might cause the updated EndPoint row to then violate the table's - * unique key constraint; - * - * if this occurs, the CPE MUST set Status to Error_Misconfigured and disable the offending EndPoint row. - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value for Alias. - * On creation of a new table entry, the CPE MUST choose an initial value for Alias - * such that the new entry does not conflict with any existing entries. - * - * At most one enabled entry in this table can exist with a given value for SSIDReference. - * - * @ingroup TR69_HOSTIF_WIFI - */ -class hostIf_WiFi_EndPoint { - - static GHashTable *ifHash; - int dev_id; - hostIf_WiFi_EndPoint(int dev_id); - ~hostIf_WiFi_EndPoint() {}; - - int refreshCache (unsigned int fetchMask); - -public: - static class hostIf_WiFi_EndPoint *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_EndPoint *); - static void closeAllInstances(); - - bool Enable; - char Status[64]; - char Alias[64]; - char ProfileReference[256]; - char SSIDReference[256]; // value of WiFi_EndPoint_Diag_Params.SSIDReference returned by IARM call to netsrvmgr - unsigned int ProfileNumberOfEntries; - struct { - unsigned long LastDataDownlinkRate; - unsigned long LastDataUplinkRate; - int SignalStrength; - unsigned long Retransmissions; - } stats; - - /** - * @ingroup TR69_HOSTIF_WIFI_ENDPOINT - * @{ - */ - /** - * @brief Check wethen wifi endpoint is enabled or not. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Enables or disables this end point. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_EndPoint_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the status of the wireless end point. - * - * The status of the wifi end point could be the enumeration of: - * - Disabled - * - Enabled - * - Error_Misconfigured - * - Error (OPTIONAL) - * - * The Error_Misconfigured value indicates that a necessary configuration value is undefined or invalid. - * The Error value MAY be used by the CPE to indicate a locally defined error condition. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Status(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the alias name of the wireless endpoint. - * - * A non-volatile handle used to reference this instance. Alias provides a - * mechanism for an ACS to label this instance for future reference. - * An initial unique value MUST be assigned when the CPE creates an instance of - * this object. - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Alias(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Set the alias name for the wireless endpoint. - * - * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to - * label this instance for future reference. - * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and - * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced: - * - Its value MUST NOT be empty. - * - Its value MUST start with a letter. - * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix. - * - The CPE MUST NOT change the parameter value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_EndPoint_Alias (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief Set the alias name for the wireless endpoint. - * - * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to - * label this instance for future reference. - * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and - * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced: - * - Its value MUST NOT be empty. - * - Its value MUST start with a letter. - * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix. - * - The CPE MUST NOT change the parameter value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_ProfileReference (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief Set the value MUST be the path name of a row in the Profile table. - * If the referenced object is deleted, the parameter value MUST be set to an empty string. - * This is the currently active profile, which specifies the SSID and security settings to be used by the end point. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_EndPoint_ProfileReference (HOSTIF_MsgData_t *stMsgData); - - /* - * @brief Get the wireless endpoint reference. The value MUST be the path name of a row in the SSID table. - * If the referenced object is deleted, the parameter value MUST be set to an empty string. - * SSIDReference is determined based on the Profile.{i}.SSID within the associated ProfileReference) - * endpoint profile. SSIDReference MUST be an empty string if ProfileReference is an empty string - * (i.e. only when an active profile is assigned can the associated SSID interface be determined). - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_SSIDReference (HOSTIF_MsgData_t *stMsgData); - - /* - * @brief Get the number of entries in the wireless endpoint Profile table. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_ProfileNumberOfEntries (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief Get the data transmit rate in kbps that was most recently used for transmission from the access point - * to the end point device. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief The data transmit rate in kbps that was most recently used for transmission from the end point - * to the access point device. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief This function provide an indicator of radio signal strength of the downlink from the - * access point to the end point, measured in dBm, as an average of the last 100 packets received from the device.. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Stats_SignalStrength (HOSTIF_MsgData_t *stMsgData); - - /** - * @brief Get the number of packets that had to be re-transmitted, from the last 100 packets sent - * to the access point. Multiple re-transmissions of the same packet count as one. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_Stats_Retransmissions (HOSTIF_MsgData_t *stMsgData); - - /** @} */ //End of doxygen tag TR69_HOSTIF_WIFI_ENDPOINT -}; - -#endif /* DEVICE_WIFI_ENDPOINT_H_ */ - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.cpp b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.cpp deleted file mode 100644 index 30bd9a3a7..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint_Profile.cpp - * - * @brief Device_WiFi_EndPoint_Stats API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_EndPoint_Profile.h" - -GHashTable* hostIf_WiFi_EndPoint_Profile::ifHash = NULL; - -hostIf_WiFi_EndPoint_Profile* hostIf_WiFi_EndPoint_Profile::getInstance(int dev_id) -{ - hostIf_WiFi_EndPoint_Profile* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_EndPoint_Profile *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_EndPoint_Profile(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_Profile instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_EndPoint_Profile::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_EndPoint_Profile::closeInstance(hostIf_WiFi_EndPoint_Profile *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_EndPoint_Profile::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_EndPoint_Profile* pDev = (hostIf_WiFi_EndPoint_Profile *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} -/* - -void hostIf_WiFi_EndPoint_Profile::getLock() -{ - if(!m_mutex) - { - m_mutex = g_mutex_new(); - } - g_mutex_lock(m_mutex); -} - -void hostIf_WiFi_EndPoint_Profile::releaseLock() -{ - g_mutex_unlock(m_mutex); -} -*/ - - -hostIf_WiFi_EndPoint_Profile::hostIf_WiFi_EndPoint_Profile(int dev_id): - Enable(0) -{ - memset(Status, 0, 64); - memset(Alias, 0, 64); - memset(SSID, 0,32); - memset(Location, 0, 256); - memset(Priority, 0, 256); -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Status(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Alias(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_SSID(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Location(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_EndPoint_Profile::get_hostIf_WiFi_EndPoint_Profile_Priority(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.h b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.h deleted file mode 100644 index 8fe89c134..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_ENDPOINT_PROFILE TR-069 Object (Device.WiFi.EndPoint.{i}.Profile.{i}.) Public APIs - * This module provides the interface functions related to wireless end point profile table. - * - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given value for Alias. - * On creation of a new table entry, the CPE MUST choose an initial value for Alias such that the new entry does not - * conflict with any existing entries. - * At most one enabled entry in this table can exist with all the same values for SSID, Location and Priority. - * @ingroup TR69_HOSTIF_WIFI - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ENDPOINT_PROFILE_H_ -#define DEVICE_WIFI_ENDPOINT_PROFILE_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi_EndPoint.h" - -class hostIf_WiFi_EndPoint_Profile { - - static GHashTable *ifHash; - static GMutex* m_mutex; - int dev_id = 0; //CID:103090 - UNINIT_CTOR - hostIf_WiFi_EndPoint_Profile(int dev_id); - ~hostIf_WiFi_EndPoint_Profile() {}; - -public: - static class hostIf_WiFi_EndPoint_Profile *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_EndPoint_Profile *); - static void closeAllInstances(); - - bool Enable; - char Status[64]; - char Alias[64]; - char SSID[32]; - char Location[256]; - char Priority[256]; - - /** - * @ingroup TR69_HOSTIF_WIFI_ENDPOINT_PROFILE - * @{ - */ - /** - * @brief Enables or disables the wireless end point Profile table. - * When there are multiple WiFi EndPoint Profiles, e.g. each instance supports a different SSID - * and/or different security configuration, this parameter can be used to control which - * of the instances are currently enabled. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the status of the wireless endpoint Profile. - * - * The following enumeration of the wireless endpoint profile: - * - Active - * - Available - * - Error (OPTIONAL) - * - Disabled - * The Active value is reserved for the instance that is actively connected. The Available value represents - * an instance that is not currently active, but is also not disabled or in error. - * The Error value MAY be used by the CPE to indicate a locally defined error condition. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Status(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the alias name of the wireless end point. - * - * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to - * label this instance for future reference. - * - * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] - * and described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced: - * - Its value MUST NOT be empty. - * - Its value MUST start with a letter. - * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix. - * - The CPE MUST NOT change the parameter value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Alias(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the profile identifier in use by the connection. - * - * The SSID is an identifier that is attached to packets sent over the wireless LAN that functions - * as an ID for joining a particular radio network (BSS). - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_SSID(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the location of the profile. - * - * This value serves as a reminder from the user, describing the location of the profile. For example: "Home", - * "Office", "Neighbor House", "Airport", etc. An empty string is also valid. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Location(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the profile priority defines one of the criteria used by the End Point to automatically - * select the "best" access point when several APs with known profiles are simultaneously available - * for association. - * - * In this situation, the End Point has to select the AP with the higher priority in its profile. - * If there are several APs with the same priority, providing different SSID or the same SSID, then the wireless - * end point has to select the APs according to other criteria like signal quality, SNR, etc. - * - * @note 0 is the highest priority. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Priority(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_ENDPOINT_PROFILE -}; - - -#endif /* DEVICE_WIFI_ENDPOINT_PROFILE_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.cpp b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.cpp deleted file mode 100644 index 4489dc16d..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint_Profile_Security.cpp - * - * @brief Device_WiFi_EndPoint_Stats API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_EndPoint_Profile_Security.h" - -GHashTable* hostIf_WiFi_EndPoint_Profile_Security::ifHash = NULL; - -hostIf_WiFi_EndPoint_Profile_Security* hostIf_WiFi_EndPoint_Profile_Security::getInstance(int dev_id) -{ - hostIf_WiFi_EndPoint_Profile_Security* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_EndPoint_Profile_Security *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_EndPoint_Profile_Security(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_Profile_Security instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - - -GList* hostIf_WiFi_EndPoint_Profile_Security::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - - -void hostIf_WiFi_EndPoint_Profile_Security::closeInstance(hostIf_WiFi_EndPoint_Profile_Security *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_EndPoint_Profile_Security::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_EndPoint_Profile_Security* pDev = (hostIf_WiFi_EndPoint_Profile_Security *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_EndPoint_Profile_Security::hostIf_WiFi_EndPoint_Profile_Security(int dev_id): - dev_id(0) -{ - memset(ModeEnabled, 0, 64); - memset(WEPKey, 0, 64); - memset(PreSharedKey, 0, 64); - memset(KeyPassphrase, 0, 64); -} - -int hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} - -int hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_WEPKey(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -int hostIf_WiFi_EndPoint_Profile_Security::get_hostIf_WiFi_EndPoint_Profile_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; - -} -#endif /* #ifdef USE_WIFI_PROFILE */ - diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.h b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.h deleted file mode 100644 index bc0c8da41..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Profile_Security.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @defgroup TR69_HOSTIF_WIFI_ENDPOINT_PROFILE_SECURITY TR-069 Object (Device.WiFi.EndPoint.{i}.Profile.{i}.Security.) Public APIs - * This object contains security related parameters that apply to a WiFi End Point profile [802.11-2007]. - * @ingroup TR69_HOSTIF_WIFI - */ - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ENDPOINT_PROFILE_SECURITY_H_ -#define DEVICE_WIFI_ENDPOINT_PROFILE_SECURITY_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - -class hostIf_WiFi_EndPoint_Profile_Security { - - static GHashTable *ifHash; - static GMutex* m_mutex; - int dev_id; - hostIf_WiFi_EndPoint_Profile_Security(int dev_id); - ~hostIf_WiFi_EndPoint_Profile_Security() {}; - -public: - static class hostIf_WiFi_EndPoint_Profile_Security *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_EndPoint_Profile_Security *); - static void closeAllInstances(); - - char ModeEnabled[64]; - char WEPKey[64]; - char PreSharedKey[64]; - char KeyPassphrase[64]; - - /** - * @ingroup TR69_HOSTIF_WIFI_ENDPOINT_PROFILE_SECURITY - * @{ - */ - - /** - * @brief This function is used to get which security mode is enabled for wireless end point. - * The value MUST be a member of the list reported by the Security.ModesSupported parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Security_ModeEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get a WEP key expressed as a hexadecimal string. - * - * WEPKey is used only if ModeEnabled is set to WEP-64 or WEP-128. - * @n A 5 byte WEPKey corresponds to security mode WEP-64 and a 13 byte WEPKey corresponds to security mode WEP-128. - * @n When read, this parameter returns an empty string, regardless of the actual value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Security_WEPKey(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get a literal PreSharedKey (PSK) expressed as a hexadecimal string. - * - * PreSharedKey is only used if ModeEnabled is set to WPA-Personal or WPA2-Personal or WPA-WPA2-Personal. - * @n If KeyPassphrase is written, then PreSharedKey is immediately generated. The ACS SHOULD NOT set both - * the KeyPassphrase and the PreSharedKey directly (the result of doing this is undefined). - * @n When read, this parameter returns an empty string, regardless of the actual value. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - * - * @param[out] stMsgData TR-069 Host interface message request. - */ - int get_hostIf_WiFi_EndPoint_Profile_Security_PreSharedKey(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get a passphrase from which the PreSharedKey is to be generated, for WPA-Personal or WPA2-Personal - * or WPA-WPA2-Personal security modes. - * - * If KeyPassphrase is written, then PreSharedKey is immediately generated. The ACS SHOULD NOT set both the - * KeyPassphrase and the PreSharedKey directly (the result of doing this is undefined). The key is generated - * as specified by WPA, which uses PBKDF2 from PKCS #5: Password-based Cryptography Specification Version 2.0 [RFC2898]. - * @n When read, this parameter returns an empty string, regardless of the actual value. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Profile_Security_KeyPassphrase(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ // End of Doxygen tag TR69_HOSTIF_WIFI_ENDPOINT_PROFILE_SECURITY -}; - - -#endif /* DEVICE_WIFI_ENDPOINT_PROFILE_SECURITY_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp deleted file mode 100644 index 3be982266..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_EndPoint_Stats.cpp - * - * @brief Device_WiFi_EndPoint_Stats API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#ifdef USE_WIFI_PROFILE -#include "Device_WiFi_EndPoint_Security.h" -#ifdef RDKV_NM -extern "C" { -#include "wifiSrvMgrIarmIf.h" -}; -#else -#include -#include "cJSON.h" -#include "hostIf_utils.h" -#endif -GHashTable* hostIf_WiFi_EndPoint_Security::ifHash = NULL; - -hostIf_WiFi_EndPoint_Security* hostIf_WiFi_EndPoint_Security::getInstance(int dev_id) -{ - hostIf_WiFi_EndPoint_Security* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_EndPoint_Security *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_EndPoint_Security(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_Security instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - - -GList* hostIf_WiFi_EndPoint_Security::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - - -void hostIf_WiFi_EndPoint_Security::closeInstance(hostIf_WiFi_EndPoint_Security *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_EndPoint_Security::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_EndPoint_Security* pDev = (hostIf_WiFi_EndPoint_Security *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_EndPoint_Security::hostIf_WiFi_EndPoint_Security(int dev_id) -{ - memset(ModesSupported, 0, 64); -} -#ifdef RDKV_NM -int hostIf_WiFi_EndPoint_Security::get_hostIf_WiFi_EndPoint_Security_ModesEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering.. \n", __FUNCTION__, __FILE__); - - IARM_Result_t retVal = IARM_RESULT_IPCCORE_FAIL; - IARM_Bus_WiFiSrvMgr_Param_t param; - - if(NULL == stMsgData) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Input arg stMsgData is NULL\n", __FILE__, __FUNCTION__); - return retVal; - } - - memset(¶m, 0, sizeof(param)); - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getPairedSSIDInfo, (void *)¶m, sizeof(param)); - - if(retVal != IARM_RESULT_SUCCESS) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return retVal; - }else{ - strncpy(stMsgData->paramValue,param.data.getPairedSSIDInfo.security,sizeof(stMsgData->paramValue)); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(stMsgData->paramValue); - retVal = IARM_RESULT_SUCCESS; - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s] WiFi Security Mode : %s\n",__FUNCTION__,stMsgData->paramValue); - } - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retVal; -} -#else -int hostIf_WiFi_EndPoint_Security::get_hostIf_WiFi_EndPoint_Security_ModesEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering.. \n", __FUNCTION__, __FILE__); - - int retVal = NOK; - - if(NULL == stMsgData) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Input arg stMsgData is NULL\n", __FILE__, __FUNCTION__); - return retVal; - } - - int security = 0; - if (invokeThunderPluginMethodAndExtractNumberField("org.rdk.NetworkManager.GetConnectedSSID", "", "security", security)) - { - put_int(stMsgData->paramValue, security); - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen = sizeof(int); - - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s] WiFi Security Mode : %d\n",__FUNCTION__, security); - retVal = OK; - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch security from NetworkManager.GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retVal; -} -#endif -int hostIf_WiFi_EndPoint_Security::get_hostIf_WiFi_EndPoint_ModesSupported(HOSTIF_MsgData_t *stMsgData ) -{ - return 0; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - - diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.h b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.h deleted file mode 100644 index 6edece859..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_ENDPOINT_SECURITY TR-069 Object (Device.WiFi.EndPoint.{i}.Security.) Public APIs - * This object contains security related parameters that apply to a WiFi end point [802.11-2007]. - * @ingroup TR69_HOSTIF_WIFI - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ENDPOINT_SECURITY_H_ -#define DEVICE_WIFI_ENDPOINT_SECURITY_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - -class hostIf_WiFi_EndPoint_Security { - - static GHashTable *ifHash; - int dev_id = 0; //CID:103185 - UNINIT_CTOR - hostIf_WiFi_EndPoint_Security(int dev_id); - ~hostIf_WiFi_EndPoint_Security() {}; - -public: - static class hostIf_WiFi_EndPoint_Security *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_EndPoint_Security *); - static void closeAllInstances(); - - char ModesSupported[64]; - - /** - * @ingroup TR69_HOSTIF_WIFI_ENDPOINT_SECURITY - * @{ - */ - /** - * @brief This function provides the comma-separated list of strings contains which security modes - * the wireless EndPoint instance is capable of supporting. - * - * Each list item is an enumeration of: - * - None - * - WEP-64 - * - WEP-128 - * - WPA-Personal - * - WPA2-Personal - * - WPA-WPA2-Personal - * - WPA-Enterprise - * - WPA2-Enterprise - * - WPA-WPA2-Enterprise - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_ModesSupported(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the security mode enabled for wifi device. The value must be a member of the list - * reported by the ModesSupported parameter, indicates which security mode is enabled. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_hostIf_WiFi_EndPoint_Security_ModesEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** @ */ //End of Doxygen tag TR69_HOSTIF_WIFI_ENDPOINT_SECURITY -}; - - - - -#endif /* DEVICE_WIFI_ENDPOINT_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.cpp b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.cpp deleted file mode 100644 index 66a4c0944..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#ifdef USE_WIFI_PROFILE -#include "Device_WiFi_EndPoint_WPS.h" - -GHashTable* hostIf_WiFi_EndPoint_WPS::ifHash = NULL; - -hostIf_WiFi_EndPoint_WPS* hostIf_WiFi_EndPoint_WPS::getInstance(int dev_id) -{ - hostIf_WiFi_EndPoint_WPS* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_EndPoint_WPS *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_EndPoint_WPS(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_EndPoint_WPS instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - - -GList* hostIf_WiFi_EndPoint_WPS::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - - -void hostIf_WiFi_EndPoint_WPS::closeInstance(hostIf_WiFi_EndPoint_WPS *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_EndPoint_WPS::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_EndPoint_WPS* pDev = (hostIf_WiFi_EndPoint_WPS *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_EndPoint_WPS::hostIf_WiFi_EndPoint_WPS(int dev_id): - Enable(false) -{ - memset(ConfigMethodsSupported, 0, 64); - memset(ConfigMethodsEnabled, 0, 64); -} - -int hostIf_WiFi_EndPoint_WPS::get_Device_WiFi_EndPoint_WPS_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_EndPoint_WPS::get_Device_WiFi_EndPoint_WPS_ConfigMethodsSupported(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_EndPoint_WPS::get_Device_WiFi_EndPoint_WPS_ConfigMethodsEnabled(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.h b/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.h deleted file mode 100644 index eac292aa4..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_EndPoint_WPS.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_ENDPOINT_WPS TR-069 Object (Device.WiFi.EndPoint.{i}.WPS.) Public APIs - * This object contains parameters related to Wi-Fi Protected Setup [WPSv1.0] for this end point. - * @ingroup TR69_HOSTIF_WIFI - */ - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_ENDPOINT_WPS_H_ -#define DEVICE_WIFI_ENDPOINT_WPS_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi_EndPoint.h" - -class hostIf_WiFi_EndPoint_WPS { - - static GHashTable *ifHash; -// GMutex* m_mutex = NULL; - int dev_id = 0; //CID:102980 - UNINIT_CTOR - hostIf_WiFi_EndPoint_WPS(int dev_id); - ~hostIf_WiFi_EndPoint_WPS() {}; - -public: - static class hostIf_WiFi_EndPoint_WPS *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_EndPoint_WPS *); - static void closeAllInstances(); - - bool Enable; - char ConfigMethodsSupported[64]; - char ConfigMethodsEnabled[64]; - - /** - * @ingroup TR69_HOSTIF_WIFI_ENDPOINT_WPS - * @{ - */ - /** - * @brief Enables or disables WPS functionality for this end point. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_WPS_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the comma-separated list of strings, containing the WPS configuration methods - * supported by the device. - * - * Each list item is an enumeration of: - * - USBFlashDrive - * - Ethernet - * - ExternalNFCToken - * - IntegratedNFCToken - * - NFCInterface - * - PushButton - * - PIN - * This parameter corresponds directly to the "Config Methods" attribute of the WPS specification [WPSv1.0]. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_WPS_ConfigMethodsSupported(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Check the WPS configuration methods enabled on the device. - * - * Comma-separated list of strings. Each list item MUST be a member of the list reported - * by the ConfigMethodsSupported parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_EndPoint_WPS_ConfigMethodsEnabled(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of Doxygen Tag TR69_HOSTIF_WIFI_ENDPOINT_WPS -}; - - -#endif /* DEVICE_WIFI_ENDPOINT_WPS_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_Radio.cpp b/src/hostif/profiles/wifi/Device_WiFi_Radio.cpp deleted file mode 100644 index 0cc888fa3..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_Radio.cpp +++ /dev/null @@ -1,651 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_MoCA_Interface.cpp - * - * @brief MoCA_Interface API Implementation. - * - * This is the implementation of the MoCA_Interface API. - * - * @par Document - * TBD Relevant design or API documentation. - * - */ - -/** @addtogroup MoCA_Interface Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_Radio.h" - -#ifdef RDKV_NM -extern "C" { - /* #include "c_only_header.h"*/ -#include "wifi_client_hal.h" -#include "wifiSrvMgrIarmIf.h" -}; -#endif - -GHashTable* hostIf_WiFi_Radio::ifHash = NULL; - -/*hostIf_WiFi_Radio::hostIf_WiFi_Radio(int dev_id):dev_id(dev_id) -{ -}*/ - -hostIf_WiFi_Radio *hostIf_WiFi_Radio::getInstance(int dev_id) -{ - static hostIf_WiFi_Radio* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_Radio *)g_hash_table_lookup(ifHash, (gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_Radio(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_Radio instance..\n"); - } - g_hash_table_insert(ifHash,(gpointer)dev_id, pRet); - } - - return pRet; -} - -/*void* hostIf_WiFi_Radio::getContext() -{ - return ctxt; -}*/ - - - -GList* hostIf_WiFi_Radio::getAllAssociateDevs() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_Radio::closeInstance(hostIf_WiFi_Radio *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); -// if(pDev->ctxt) - delete pDev; - } -} - -void hostIf_WiFi_Radio::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_Radio* pDev = (hostIf_WiFi_Radio *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - -hostIf_WiFi_Radio::hostIf_WiFi_Radio(int dev_id): - dev_id(dev_id), - radioFirstExTime(0), - Enable(false), - LastChange(0), - Upstream (false), - MaxBitRate(0), - Channel(0), - AutoChannelSupported(false), - AutoChannelEnable(false), - AutoChannelRefreshPeriod (0), - mcs (0), - TransmitPower (0), - IEEE80211hSupported (false), - IEEE80211hEnabled (false) -{ - memset(Status, 0, sizeof(Status)); - memset(Alias,0,sizeof(Alias)); - memset(Name,0,sizeof(Name)); - memset(LowerLayers,0,sizeof(LowerLayers)); - memset(SupportedFrequencyBands,0,sizeof(SupportedFrequencyBands)); - memset(OperatingFrequencyBand,0,sizeof(OperatingFrequencyBand)); - memset(SupportedStandards, 0, sizeof(SupportedStandards)); - memset(OperatingStandards, 0, sizeof(OperatingStandards)); - memset(PossibleChannels, 0, sizeof(PossibleChannels)); - memset(ChannelsInUse, 0, sizeof(ChannelsInUse)); - memset(OperatingChannelBandwidth, 0, sizeof(OperatingChannelBandwidth)); - memset(ExtensionChannel, 0, sizeof(ExtensionChannel)); - memset(GuardInterval, 0,sizeof(GuardInterval)); - memset(TransmitPowerSupported, 0, sizeof(TransmitPowerSupported)); - memset(RegulatoryDomain, 0, sizeof(RegulatoryDomain)); -} - -static int wifi_getRadioOperatingChannelBandwidth(int radioIndex, char *output_buffer, size_t output_buffer_size) -{ - char resultBuff[64]; - char cmd[64]; - char interfaceName[10] = "wlan0"; - int bandWidth = 0; - FILE *fp = NULL; - int ret = NOK; - bool iw_info_failed = false; - char *bandwidth_string = NULL; - char *bandwidth_token = NULL; - bool bandwidth_found = false; - - if (!output_buffer) - return ret; - - memset(cmd, 0, sizeof(cmd)); - memset(resultBuff, 0, sizeof(resultBuff)); - - snprintf(cmd, sizeof(cmd), "iw dev %s info | grep channel | cut -f 2 -d ','", interfaceName); - - if (NULL != (fp = popen(cmd,"r"))) - { - if ((fgets(resultBuff, sizeof (resultBuff), fp) != NULL) && (resultBuff[0] != '\0')) - { - sscanf(resultBuff,"%*s%d%*s", &bandWidth); /* Expected output :- " width: 80 MHz" */ - if (bandWidth != 0) - { - snprintf(output_buffer, output_buffer_size, "%dMHz", bandWidth); - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "OperatingChannelBandwidth = %s\n", output_buffer); - ret = OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failure in getting bandwidth \n"); - } - } - else - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Unable to read Channel width from iw \n"); - iw_info_failed = true; - } - pclose(fp); - } - else - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "popen() failed. failure in getting Channel Bandwidth\n"); - iw_info_failed = true; - } - - if (iw_info_failed) // iw info fallback - { - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "iw info command failed, fall back to iw link command\n"); - - memset(cmd, 0, sizeof(cmd)); - memset(resultBuff, 0, sizeof(resultBuff)); - - snprintf(cmd, sizeof(cmd), "iw dev %s link | grep tx", interfaceName); - - if (NULL != (fp = popen(cmd,"r"))) - { - if ((fgets(resultBuff, sizeof (resultBuff), fp) != NULL) && (resultBuff[0] != '\0')) - { - char *resultBuff_P = resultBuff; - while ((bandwidth_string = strtok_r(resultBuff_P, " ", &resultBuff_P))) - { - bandwidth_token = strcasestr(bandwidth_string, "MHz"); - if (NULL != bandwidth_token) - { - snprintf(output_buffer, output_buffer_size, "%s", bandwidth_string); - bandwidth_found = true; - break; - } - } - if (!bandwidth_found) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "MHz information missing in iw link o/p \n"); - snprintf(output_buffer, output_buffer_size, "%s", "20MHz"); // assume 20MHz - } - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "OperatingChannelBandwidth = %s\n", output_buffer); - ret = OK; - } - else - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Failure in getting bandwidth \n"); - - pclose(fp); - } - else - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "popen() failed. failure in getting Channel Bandwidth\n"); - } - return ret; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Props_Fields(int radioIndex) -{ -#ifdef RDKV_NM - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - IARM_BUS_WiFi_DiagsPropParam_t param = {0}; - int ret; - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - hostIf_WiFi_Radio *pDev = hostIf_WiFi_Radio::getInstance(dev_id); - if(pDev) - { - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getRadioProps, (void *)¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - Enable = param.data.radio.params.enable; - snprintf(Status,BUFF_LENGTH_64,param.data.radio.params.status); - snprintf(Alias,BUFF_LENGTH_64,param.data.radio.params.alias); - snprintf(Name,BUFF_LENGTH_64,param.data.radio.params.name); - LastChange = param.data.radio.params.lastChange; - snprintf(LowerLayers,BUFF_LENGTH_1024,param.data.radio.params.lowerLayers); - Upstream = param.data.radio.params.upstream; - MaxBitRate = param.data.radio.params.maxBitRate; - snprintf(SupportedFrequencyBands,BUFF_LENGTH_256,param.data.radio.params.supportedFrequencyBands); - snprintf(OperatingFrequencyBand,BUFF_LENGTH_64,param.data.radio.params.operatingFrequencyBand); - snprintf(SupportedStandards,BUFF_LENGTH_64,param.data.radio.params.supportedStandards); - snprintf(OperatingStandards,BUFF_LENGTH_64,param.data.radio.params.operatingStandards); - snprintf(PossibleChannels,BUFF_LENGTH_256,param.data.radio.params.possibleChannels); - snprintf(ChannelsInUse,BUFF_LENGTH_1024,param.data.radio.params.channelsInUse); - Channel = param.data.radio.params.channel; - AutoChannelSupported = param.data.radio.params.autoChannelSupported; - AutoChannelEnable = param.data.radio.params.autoChannelEnable; - AutoChannelRefreshPeriod = param.data.radio.params.autoChannelRefreshPeriod; - snprintf(OperatingChannelBandwidth,BUFF_LENGTH_1024,param.data.radio.params.operatingChannelBandwidth); - snprintf(ExtensionChannel,BUFF_LENGTH_64,param.data.radio.params.extensionChannel); - snprintf(GuardInterval,BUFF_LENGTH_64,param.data.radio.params.guardInterval); - mcs = param.data.radio.params.mcs; - snprintf(TransmitPowerSupported,BUFF_LENGTH_64,param.data.radio.params.transmitPowerSupported); - TransmitPower = param.data.radio.params.transmitPower; -// IEEE80211hSupported = param.data.radio.params.IEEE80211hSupported; -// IEEE80211hEnabled = param.data.radio.params.IEEE80211hEnabled; - snprintf(RegulatoryDomain,BUFF_MIN_16,param.data.radio.params.regulatoryDomain); - radioFirstExTime = time (NULL); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -#else - hostIf_WiFi_Radio *pDev = hostIf_WiFi_Radio::getInstance(dev_id); - if (pDev) - { -// snprintf(OperatingChannelBandwidth, BUFF_MIN_16, "80MHz"); - wifi_getRadioOperatingChannelBandwidth(0, OperatingChannelBandwidth, sizeof (OperatingChannelBandwidth)); - // TODO: what's this for? - radioFirstExTime = time (NULL); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -#endif -} - -void hostIf_WiFi_Radio::checkWifiRadioFetch(int radioIndex) -{ - int retVal = NOK; - time_t currExTime = time (NULL); - if ((currExTime - radioFirstExTime) > QUERY_INTERVAL) - { - retVal = get_Device_WiFi_Radio_Props_Fields(radioIndex); - if (OK != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, retVal); - } - } -} - -#ifdef RDKV_NM - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Enable(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, Enable); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Upstream(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, Upstream); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_AutoChannelSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, AutoChannelSupported); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_AutoChannelEnable(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, AutoChannelEnable); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_IEEE80211hSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, IEEE80211hSupported); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_IEEE80211hEnabled(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_boolean(stMsgData->paramValue, IEEE80211hEnabled); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_LastChange(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, LastChange); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_MaxBitRate(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, MaxBitRate); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Channel(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, Channel); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_AutoChannelRefreshPeriod(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, AutoChannelRefreshPeriod); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_MCS(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, mcs); - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_TransmitPower(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - put_int(stMsgData->paramValue, TransmitPower); - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Status(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, Status,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(Status); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Alias(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, Alias,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(Alias); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Name(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, Name,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(Name); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_SupportedFrequencyBands(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, SupportedFrequencyBands,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(SupportedFrequencyBands); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_OperatingFrequencyBand(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, OperatingFrequencyBand,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(OperatingFrequencyBand); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_SupportedStandards(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, SupportedStandards,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(SupportedStandards); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_OperatingStandards(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, OperatingStandards,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(OperatingStandards); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_PossibleChannels(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, PossibleChannels,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(PossibleChannels); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_ChannelsInUse(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, ChannelsInUse,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(ChannelsInUse); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#endif - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_OperatingChannelBandwidth(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, OperatingChannelBandwidth,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(OperatingChannelBandwidth); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#ifdef RDKV_NM - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_ExtensionChannel(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, ExtensionChannel,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(ExtensionChannel); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_GuardInterval(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, GuardInterval,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(GuardInterval); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_LowerLayers(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, LowerLayers,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(LowerLayers); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_TransmitPowerSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, TransmitPowerSupported,TR69HOSTIFMGR_MAX_PARAM_LEN ); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(TransmitPowerSupported); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio::get_Device_WiFi_Radio_RegulatoryDomain(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioFetch(radioIndex); - strncpy(stMsgData->paramValue, RegulatoryDomain,TR69HOSTIFMGR_MAX_PARAM_LEN); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(RegulatoryDomain); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} -#endif - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_Radio.h b/src/hostif/profiles/wifi/Device_WiFi_Radio.h deleted file mode 100644 index 340a547a8..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_Radio.h +++ /dev/null @@ -1,641 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_Radio.h - * - * @brief TR-069 Device.WiFi.Radio object Public API. - * - * Description of Device_WiFi module. - * - * - * @par Document - * Document reference. - * - * - * @par Open Issues (in no particular order) - * -# Issue 1 - * -# Issue 2 - * - * - * @par Assumptions - * -# Assumption - * -# Assumption - * - * - * @par Abbreviations - * - ACK: Acknowledge. - * - BE: Big-Endian. - * - cb: Callback function (suffix). - * - config: Configuration. - * - desc: Descriptor. - * - dword: Double word quantity, i.e., four bytes or 32 bits in size. - * - intfc: Interface. - * - LE: Little-Endian. - * - LS: Least Significant. - * - MBZ: Must be zero. - * - MS: Most Significant. - * - _t: Type (suffix). - * - word: Two byte quantity, i.e. 16 bits in size. - * - xfer: Transfer. - * - * - * @par Implementation Notes - * -# Note - * -# Note - * - */ - - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef HOSTIF_DEVICE_WIFI_RADIO_H_ -#define HOSTIF_DEVICE_WIFI_RADIO_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi.h" - - -/***************************************************************************** - * TR069-SPECIFIC INCLUDE FILES - *****************************************************************************/ - -/** @defgroup TR_069_DEVICE_WIFI API TR-069 Device.WiFi.Radio object API. - * @ingroup TR_069_DEVICE_WIFI_RADIO_API - * - * The Device.WiFi.Radio object table. This object models an 802.11 wireless radio - * on a device (a stackable interface object as described in [Section 4.2/TR-181i2]).. - * - * If the device can establish more than one connection simultaneously (e.g. a dual radio device), - * a separate Radio instance MUST be used for each physical radio of the device. - * See [Appendix III.1/TR-181i2] for additional information. - * - * Note: A dual-band single-radio device (e.g. an 802.11a/b/g radio) can be configured to - * operate at 2.4 or 5 GHz frequency bands, but only a single frequency band is used to - * transmit/receive at a given time. Therefore, a single Radio instance is used even for a dual-band radio. - * - * At most one entry in this table can exist with a given value for Alias, or with a given value for Name. - * - * @{ - */ -class hostIf_WiFi_Radio { - - static GHashTable *ifHash; - - int dev_id; - time_t radioFirstExTime; - hostIf_WiFi_Radio(int dev_id); - ~hostIf_WiFi_Radio() {}; - -public: - static class hostIf_WiFi_Radio *getInstance(int dev_id); - static GList* getAllAssociateDevs(); - static void closeInstance(hostIf_WiFi_Radio *); - static void closeAllInstances(); - int get_Device_WiFi_Radio_Props_Fields(int radioIndex); - void checkWifiRadioFetch(int radioIndex); - bool Enable; - char Status[BUFF_LENGTH_64]; - char Alias[BUFF_LENGTH_64]; - char Name[BUFF_LENGTH_64]; - unsigned int LastChange; - char LowerLayers[BUFF_LENGTH_1024]; - bool Upstream; - unsigned int MaxBitRate; - char SupportedFrequencyBands[BUFF_LENGTH_256]; - char OperatingFrequencyBand[BUFF_LENGTH_64]; - char SupportedStandards[BUFF_LENGTH_64]; - char OperatingStandards[BUFF_LENGTH_64]; - char PossibleChannels[BUFF_LENGTH_256]; - char ChannelsInUse[BUFF_LENGTH_1024]; - unsigned int Channel; - bool AutoChannelSupported; - bool AutoChannelEnable; - unsigned int AutoChannelRefreshPeriod; - char OperatingChannelBandwidth[BUFF_MIN_16]; - char ExtensionChannel[BUFF_LENGTH_64]; - char GuardInterval[BUFF_LENGTH_64]; - int mcs; - char TransmitPowerSupported[BUFF_LENGTH_64]; - int TransmitPower; - bool IEEE80211hSupported; - bool IEEE80211hEnabled; - char RegulatoryDomain[BUFF_MIN_16]; - - /** - * @brief Enables or disables the radio. - * - * This function provides to true/false value based on the - * Device.WiFi.Radio.Enable status. - * - * This parameter is based on ifAdminStatus from [RFC2863]. - * @note This parameter is based on wifiNodeIndex from []. - */ - int get_Device_WiFi_Radio_Enable(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief set Enables/disables the radio. - * - * This function set to true/false to 'Device.WiFi.Radio.Enable status' parameter. - * - * This parameter is based on ifAdminStatus from [RFC2863]. - * See @ref get_Device_WiFi_Radio_Enable() - */ - int set_Device_WiFi_Radio_Enable(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_Status(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief A non-volatile handle used to reference this instance. - * Alias provides a mechanism for an ACS to label this instance for future reference. - * An initial unique value MUST be assigned when the CPE creates an instance of this object. - * - * This function get/set the 'Device.WiFi.Radio.Alias' parameter. - * - */ - int get_Device_WiFi_Radio_Alias(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int set_Device_WiFi_Radio_Alias(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_Name(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_LastChange(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_LowerLayers(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int set_Device_WiFi_Radio_LowerLayers(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_Upstream(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_MaxBitRate(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_SupportedFrequencyBands(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_OperatingFrequencyBand(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int set_Device_WiFi_Radio_OperatingFrequencyBand(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_SupportedStandards(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_OperatingStandards(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int set_Device_WiFi_Radio_OperatingStandards(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_PossibleChannels(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_ChannelsInUse(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_Channel(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int set_Device_WiFi_Radio_Channel(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_AutoChannelSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief get_Device_WiFi_Radio_Status - * - * The current operational state of the radio (see [Section 4.2.2/TR-181i2]). - * Enumeration of: - * Up - * Down - * Unknown - * Dormant - * NotPresent - * LowerLayerDown - * Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error - * if there is a fault condition on the interface). - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - */ - int get_Device_WiFi_Radio_AutoChannelEnable(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_AutoChannelEnable(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_AutoChannelRefreshPeriod(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_AutoChannelRefreshPeriod(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_OperatingChannelBandwidth(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_OperatingChannelBandwidth(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_ExtensionChannel(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_ExtensionChannel(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_GuardInterval(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_GuardInterval(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_MCS(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_MCS(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_TransmitPowerSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_TransmitPower(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_TransmitPower(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_IEEE80211hSupported(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_IEEE80211hEnabled(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_IEEE80211hEnabled(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_RegulatoryDomain(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - int set_Device_WiFi_Radio_RegulatoryDomain(HOSTIF_MsgData_t *stMsgData,int radioIndex ); -}; - -/* End of TR069_HOSTIF_DEVICE_WIFI_RADIO_H_ doxygen group */ -/** - * @} - */ - -#endif /* HOSTIF_DEVICE_WIFI_RADIO_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp b/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp deleted file mode 100644 index dd9bafcbe..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp +++ /dev/null @@ -1,421 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_Radio_Stats.cpp - * - * @brief Device.WiFi.Radio.Stats API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_Radio_Stats.h" -#ifdef RDKV_NM -extern "C" { -#include "wifiSrvMgrIarmIf.h" - /* #include "c_only_header.h"*/ -}; -#endif - -GHashTable* hostIf_WiFi_Radio_Stats::ifHash = NULL; -static time_t radioFirstExTime = 0; - -hostIf_WiFi_Radio_Stats *hostIf_WiFi_Radio_Stats::getInstance(int dev_id) -{ - static hostIf_WiFi_Radio_Stats* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_Radio_Stats *)g_hash_table_lookup(ifHash, (gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_Radio_Stats(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_Radio_Stats instance..\n"); - } - g_hash_table_insert(ifHash,(gpointer)dev_id, pRet); - } - return pRet; -} - -void hostIf_WiFi_Radio_Stats::closeInstance(hostIf_WiFi_Radio_Stats *pDev) -{ - if(pDev) - { -// g_hash_table_remove(devHash, (gconstpointer)pDev->dev_id); -// if(pDev->ctxt) - delete pDev; - } -} - -void hostIf_WiFi_Radio_Stats::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_Radio_Stats* pDev = (hostIf_WiFi_Radio_Stats *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_Radio_Stats::hostIf_WiFi_Radio_Stats(int dev_id): - dev_id(dev_id), - BytesSent(0), - BytesReceived(0), - PacketsSent(0), - PacketsReceived(0), - ErrorsSent(0), - ErrorsReceived(0), - DiscardPacketsSent(0), - DiscardPacketsReceived(0), - NoiseFloor(0) -{ - -} - -static bool getNoise(int &noise_value) -{ - char cmd[50]; - snprintf(cmd, sizeof(cmd), "wpa_cli -i wlan0 signal_poll"); - - FILE *fp = popen(cmd, "r"); - if (NULL == fp) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Error in popen() : signal_poll failed \n"); - return false; - } - - char line[256]; - char noise[64] = { 0 }; - - while (fgets(line, sizeof(line), fp)) - { - if (strncmp(line, "NOISE=", 6) == 0) - { - strncpy(noise, line + 6, sizeof(noise) - 1); - // Strip trailing newline if present - size_t len = strlen(noise); - if (len > 0 && noise[len - 1] == '\n') - noise[len - 1] = '\0'; - } - } - pclose(fp); - - if (noise[0] == '\0') - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "NOISE not found in signal_poll.\n"); - return false; - } - - noise_value = atoi(noise); - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "\n noise = %d ", noise_value); - - return true; -} - -struct wifi_radioTrafficStats_t -{ - unsigned long bytesSent; - unsigned long bytesReceived; - unsigned long packetsSent; - unsigned long packetsReceived; - unsigned int errorsSent; - unsigned int errorsReceived; - unsigned int discardPacketsSent; - unsigned int discardPacketsReceived; -}; - -static int wifi_getRadioTrafficStats(int radioIndex, wifi_radioTrafficStats_t *output_struct) -{ - FILE *fp = NULL; - char resultBuff[256]; - char cmd[50]; - char interfaceName[10] = "wlan0"; - long long int rx_bytes = 0,rx_packets = 0,rx_err = 0,rx_drop = 0; - long long int tx_bytes = 0,tx_packets = 0,tx_err = 0,tx_drop = 0; - int numParams = 0; - - if (!output_struct) - { - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "output struct is null"); - return NOK; - } - - memset(resultBuff, 0, sizeof(resultBuff)); - memset(cmd, 0, sizeof(cmd)); - - snprintf(cmd, sizeof(cmd), "cat /proc/net/dev | grep %s", interfaceName); - - if (NULL != (fp = popen(cmd, "r"))) - { - if (fgets(resultBuff, sizeof (resultBuff), fp) != NULL) - { - numParams = sscanf(resultBuff, " %[^:]: %lld %lld %lld %lld %*u %*u %*u %*u %lld %lld %lld %lld %*u %*u %*u %*u", - interfaceName, - &rx_bytes, &rx_packets, &rx_err, &rx_drop, - &tx_bytes, &tx_packets, &tx_err, &tx_drop); - if (numParams != 9) - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Error in parsing Radio Stats params \n"); - - output_struct->packetsSent = tx_packets; - output_struct->packetsReceived = rx_packets; - output_struct->bytesSent = tx_bytes; - output_struct->bytesReceived = rx_bytes; - output_struct->errorsReceived = rx_err; - output_struct->errorsSent = tx_err; - output_struct->discardPacketsSent = tx_drop; - output_struct->discardPacketsReceived = rx_drop; - RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, - "[tx_packets = %lld] [rx_packets = %lld] " - "[tx_bytes = %lld] [rx_bytes = %lld] " - "[rx_err = %lld] [tx_err = %lld] " - "[tx_drop = %lld] [rx_drop = %lld] \n", - tx_packets, rx_packets, tx_bytes, rx_bytes, - rx_err, tx_err, tx_drop, rx_drop); - } - else - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Error in reading /proc/net/dev file \n"); - } - pclose(fp); - } - else - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "Error in popen() : Opening /proc/net/dev failed \n"); - } - - return OK; -} - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_Props_Fields(int radioIndex) -{ -#ifdef RDKV_NM - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - IARM_BUS_WiFi_DiagsPropParam_t param = {0}; - int ret; - radioIndex=1; - - hostIf_WiFi_Radio_Stats *pDev = hostIf_WiFi_Radio_Stats::getInstance(dev_id); - if(pDev) - { - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getRadioStatsProps, (void *)¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - BytesSent = param.data.radio_stats.params.bytesSent; - BytesReceived = param.data.radio_stats.params.bytesReceived; - PacketsSent = param.data.radio_stats.params.packetsSent; - PacketsReceived = param.data.radio_stats.params.packetsReceived; - ErrorsSent = param.data.radio_stats.params.errorsSent; - ErrorsReceived = param.data.radio_stats.params.errorsReceived; - DiscardPacketsSent = param.data.radio_stats.params.discardPacketsSent; - DiscardPacketsReceived = param.data.radio_stats.params.discardPacketsReceived; - NoiseFloor = param.data.radio_stats.params.noiseFloor; - radioFirstExTime = time (NULL); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -#else - hostIf_WiFi_Radio_Stats *pDev = hostIf_WiFi_Radio_Stats::getInstance(dev_id); - if (pDev) - { - int noise; - wifi_radioTrafficStats_t stats = {0}; - wifi_getRadioTrafficStats(0, &stats); - - BytesSent = stats.bytesSent; - BytesReceived = stats.bytesReceived; - PacketsSent = stats.packetsSent; - PacketsReceived = stats.packetsReceived; - ErrorsSent = stats.errorsSent; - ErrorsReceived = stats.errorsReceived; - DiscardPacketsSent = stats.discardPacketsSent; - DiscardPacketsReceived = stats.discardPacketsReceived; - NoiseFloor = getNoise(noise) ? noise : 0; - - radioFirstExTime = time (NULL); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -#endif - -} - -void hostIf_WiFi_Radio_Stats::checkWifiRadioPropsFetch(int radioIndex) -{ - int ret = NOK; - time_t currExTime = time (NULL); - if ((currExTime - radioFirstExTime ) > QUERY_INTERVAL) - { - ret = get_Device_WiFi_Radio_Stats_Props_Fields(radioIndex); - if( OK != ret) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, ret); - } - } -} - -#ifdef RDKV_NM - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_BytesSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, BytesSent); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; - -} - - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_BytesReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, BytesReceived); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_PacketsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, PacketsSent); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#endif - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, PacketsReceived); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#ifdef RDKV_NM - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_ErrorsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, ErrorsSent); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_ErrorsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, ErrorsReceived); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, DiscardPacketsSent); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, DiscardPacketsReceived); - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#endif - -int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_NoiseFloor(HOSTIF_MsgData_t *stMsgData,int radioIndex ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiRadioPropsFetch(radioIndex); - put_int(stMsgData->paramValue, NoiseFloor); - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.h b/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.h deleted file mode 100644 index 97cdd3c09..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_Radio_Stats.h - * - * TR-069 Device.WiFi.Radio.Stats object Public API. - */ - -/** - * @defgroup TR69_HOSTIF_WIFI_RADIO_STAT TR-069 Object (Device.WiFi.Radio.{i}.Stat.) Public APIs - * Throughput statistics for this interface. - * - * The CPE MUST reset the interface's Stats parameters (unless otherwise stated in individual object or - * parameter descriptions) either when the interface becomes operationally down due to a previous - * administrative down (i.e. the interface's Status parameter transitions to a down state after the - * interface is disabled) or when the interface becomes administratively up (i.e. the interface's Enable - * parameter transitions from false to true). Administrative and operational interface status is discussed - * in [Section 4.2.2/TR-181i2]. - * - * @ingroup TR69_HOSTIF_WIFI - */ - - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_RADIO_STATS_H_ -#define DEVICE_WIFI_RADIO_STATS_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi.h" - -/** @defgroup TR_069_DEVICE_WIFI API TR-069 Device.WiFi.Radio.Stats object API. - * @ingroup TR_069_DEVICE_WIFI_RADIO_API - * - * Throughput statistics for this interface. - * - * @{ - */ - -class hostIf_WiFi_Radio_Stats { - - static GHashTable *ifHash; - int dev_id; - hostIf_WiFi_Radio_Stats(int dev_id); - ~hostIf_WiFi_Radio_Stats() {}; - -public: - static class hostIf_WiFi_Radio_Stats *getInstance(int dev_id); - static GList* getAllAssociateDevs(); - static void closeInstance(hostIf_WiFi_Radio_Stats *); - static void closeAllInstances(); - int get_Device_WiFi_Radio_Stats_Props_Fields(int radioIndex); - void checkWifiRadioPropsFetch(int radioIndex); - - unsigned long BytesSent; - unsigned long BytesReceived; - unsigned long PacketsSent; - unsigned long PacketsReceived; - unsigned int ErrorsSent; - unsigned int ErrorsReceived; - unsigned int DiscardPacketsSent; - unsigned int DiscardPacketsReceived; - int NoiseFloor; - - /** - * @ingroup TR69_HOSTIF_WIFI_RADIO_STAT - * @{ - */ - /** - * @brief Get total number of bytes transmitted out of the interface, including framing characters. - * - * This function provides the output as unsigned long value available in - * Device.WiFi.Radio.{i}.Stats.BytesSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_BytesSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of bytes received on the interface, including framing characters. - * - * This function provides the output as unsigned long value available in - * Device.WiFi.Radio.{i}.Stats.BytesReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_BytesReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the value of 'Device.WiFi.Radio.Stats.PacketsSent'. - * This function provides the total number of packets transmitted out of the interface. - */ - /** - * @brief Get the total number of packets transmitted out of the interface. - * - * - * This function provides the output as unsigned long value available in - * Device.WiFi.Radio.{i}.Stats.PacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_PacketsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of packets received on the interface. - * - * This function provides the output as unsigned long value available in - * Device.WiFi.Radio.{i}.Stats.PacketReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of outbound packets that could not be transmitted because of errors. - * - * This function provides the output as unsigned int value available in - * Device.WiFi.Radio.{i}.Stats.ErrorsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_ErrorsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of inbound packets that contained errors preventing them from being - * delivered to a higher-layer protocol. - * - * This function provides the output as unsigned int value available in - * Device.WiFi.Radio.{i}.Stats.ErrorsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_ErrorsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of outbound packets which were chosen to be discarded even though no - * errors had been detected to prevent their being transmitted. One possible reason for discarding - * such a packet could be to free up buffer space. - * - * This function provides the output as unsigned int value available in - * Device.WiFi.Radio.{i}.Stats.DiscardPacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** - * @brief Get the total number of inbound packets which were chosen to be discarded even though no errors - * had been detected to prevent their being delivered. One possible reason for discarding such a packet - * could be to free up buffer space. - * - * This function provides the output as unsigned int value available in - * Device.WiFi.Radio.{i}.Stats.DiscardPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * @param[in] radioIndex Index number. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_Radio_Stats_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - int get_Device_WiFi_Radio_Stats_NoiseFloor(HOSTIF_MsgData_t *stMsgData,int radioIndex ); - - /** @ */ //End of Doxygen tag TR69_HOSTIF_WIFI_RADIO_STAT -}; - -/* End of DEVICE_WIFI_RADIO_STATS_H_ doxygen group */ -/** - * @} - */ - -#endif /* DEVICE_WIFI_RADIO_STATS_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp b/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp deleted file mode 100644 index 8c69a4889..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_SSID.cpp +++ /dev/null @@ -1,533 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_SSID.cpp - * - * @brief Device_WiFi_SSID API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include -#include "safec_lib.h" -#ifdef USE_WIFI_PROFILE - -#include "Device_WiFi_SSID.h" -#ifdef RDKV_NM -extern "C" { - /* #include "c_only_header.h"*/ -#include "wifi_common_hal.h" -#include "wifiSrvMgrIarmIf.h" -}; -#else -#include -#include "cJSON.h" -#include "hostIf_utils.h" -#endif - -static time_t firstExTime = 0; - -#ifndef RDKV_NM -static time_t connectedSsidFetchTime = 0; -static time_t availableInterfacesFetchTime = 0; -static time_t wifiStateFetchTime = 0; -#endif - -GHashTable* hostIf_WiFi_SSID::ifHash = NULL; - -hostIf_WiFi_SSID* hostIf_WiFi_SSID::getInstance(int dev_id) -{ - static hostIf_WiFi_SSID* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_SSID *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_SSID(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_SSID instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_SSID::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_SSID::closeInstance(hostIf_WiFi_SSID *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_SSID::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_SSID* pDev = (hostIf_WiFi_SSID *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - - -hostIf_WiFi_SSID::hostIf_WiFi_SSID(int dev_id): - enable(false), - LastChange(0) -{ - memset(status,0 , sizeof(status)); //CID:103996 - OVERRUN - memset(alias, 0, sizeof(alias)); //CID:103531 - OVERRUN - memset(name,0, sizeof(name)); - memset(LowerLayers,0, sizeof(LowerLayers)); - memset(BSSID,0, sizeof(BSSID)); - memset(MACAddress,0, sizeof(MACAddress)); - memset(SSID,0, sizeof(SSID)); //CID:103108 - OVERRUN -} -#ifdef RDKV_NM -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Fields(int ssidIndex, unsigned int fetchMask) -{ - (void)fetchMask; - errno_t rc = -1; - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - IARM_BUS_WiFi_DiagsPropParam_t param = {0}; - int ret; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - - hostIf_WiFi_SSID *pDev = hostIf_WiFi_SSID::getInstance(dev_id); - if (pDev) - { - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getSSIDProps, (void *)¶m, sizeof(param)); - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - rc=strcpy_s(name,sizeof(name),param.data.ssid.params.name); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc=strcpy_s(BSSID,sizeof(BSSID),param.data.ssid.params.bssid); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc=strcpy_s(MACAddress,sizeof(MACAddress),param.data.ssid.params.macaddr); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc=strcpy_s(SSID,sizeof(SSID),param.data.ssid.params.ssid); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc=strcpy_s(status,sizeof(status),param.data.ssid.params.status); - if(rc!=EOK) - { - ERR_CHK(rc); - } - enable=param.data.ssid.params.enable; - firstExTime = time (NULL); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -} -#else -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Fields(int ssidIndex, unsigned int fetchMask) -{ - errno_t rc = -1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - - hostIf_WiFi_SSID *pDev = hostIf_WiFi_SSID::getInstance(dev_id); - if (pDev) - { - if ((fetchMask & WIFI_SSID_FETCH_CONNECTED_SSID) != 0) - { - std::string ssidResponse; - if (!invokeThunderPluginMethod("org.rdk.NetworkManager.GetConnectedSSID", "", ssidResponse)) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to invoke NetworkManager.GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - - std::string bssid; - if (!thunderExtractResultStringField(ssidResponse, "bssid", bssid)) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch bssid from NetworkManager.GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - - std::string ssid; - if (!thunderExtractResultStringField(ssidResponse, "ssid", ssid)) - { - RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch ssid from NetworkManager.GetConnectedSSID\n", __FUNCTION__); - return NOK; - } - - //ASSIGN TO OP HERE - rc=strcpy_s(BSSID,sizeof(BSSID),bssid.c_str()); - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: BSSID = %s \n", __FUNCTION__, BSSID); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc=strcpy_s(SSID,sizeof(SSID),ssid.c_str()); - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: SSID = %s \n", __FUNCTION__, SSID); - if(rc!=EOK) - { - ERR_CHK(rc); - } - rc = strcpy_s(name, sizeof(name), ssid.c_str()); - if (rc != EOK) - { - ERR_CHK(rc); - } - } - - if ((fetchMask & WIFI_SSID_FETCH_AVAILABLE_INTERFACES) != 0) - { - std::string response; - if (invokeThunderPluginMethod("org.rdk.NetworkManager.GetAvailableInterfaces", "", response)) - { - std::string macAddressValue; - if (readThunderArrayItemByKey(response, "interfaces", "type", "WIFI", "mac", macAddressValue)) - { - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: Found WiFi Interface\n", __FUNCTION__); - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: WIFI interface not found\n", __FUNCTION__); - return NOK; - } - - rc = strcpy_s(MACAddress, sizeof(MACAddress), macAddressValue.c_str()); - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: MACAddress = %s \n", __FUNCTION__, MACAddress); - if (rc != EOK) - { - ERR_CHK(rc); - } - - if (!readThunderArrayItemByKey(response, "interfaces", "type", "WIFI", "enabled", enable)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: Invalid or missing enabled for WIFI interface\n", __FUNCTION__); - return NOK; - } - - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: ENABLE = %d \n", __FUNCTION__, enable); - } - else - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch interfaces from NetworkManager.GetAvailableInterfaces\n", __FUNCTION__); - return NOK; - } - } - - if ((fetchMask & WIFI_SSID_FETCH_WIFI_STATE) != 0) - { - int res = 0; - if (!invokeThunderPluginMethodAndExtractNumberField("org.rdk.NetworkManager.GetWifiState", "", "state", res)) - { - RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "%s: failed to fetch state from NetworkManager.GetWifiState\n", __FUNCTION__); - return NOK; - } - - switch (res) { - case 0: - rc=strcpy_s(status,sizeof(status),"UNINSTALLED"); - break; - case 1: - rc=strcpy_s(status,sizeof(status),"DISABLED"); - break; - case 2: - rc=strcpy_s(status,sizeof(status),"DISCONNECTED"); - break; - case 3: - rc=strcpy_s(status,sizeof(status),"PAIRING"); - break; - case 4: - rc=strcpy_s(status,sizeof(status),"CONNECTING"); - break; - case 5: - rc=strcpy_s(status,sizeof(status),"CONNECTED"); - break; - case 6: - rc=strcpy_s(status,sizeof(status),"SSID_NOT_FOUND"); - break; - case 7: - rc=strcpy_s(status,sizeof(status),"SSID_CHANGED"); - break; - case 8: - rc=strcpy_s(status,sizeof(status),"CONNECTION_LOST"); - break; - case 9: - rc=strcpy_s(status,sizeof(status),"CONNECTION_FAILED"); - break; - case 10: - rc=strcpy_s(status,sizeof(status),"CONNECTION_INTERRUPTED"); - break; - case 11: - rc=strcpy_s(status,sizeof(status),"INVALID_CREDENTIALS"); - break; - case 12: - rc=strcpy_s(status,sizeof(status),"AUTHENTICATION_FAILED"); - break; - case 13: - rc=strcpy_s(status,sizeof(status),"ERROR"); - break; - } - RDK_LOG (RDK_LOG_INFO, LOG_TR69HOSTIF, "%s: STATUS = %s \n", __FUNCTION__, status); - if(rc!=EOK) - { - ERR_CHK(rc); - } - } - - firstExTime = time (NULL); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } -} -#endif - -void hostIf_WiFi_SSID::checkWifiSSIDFetch(int ssidIndex, unsigned int fetchMask) -{ - int ret = NOK; - time_t currExTime = time (NULL); -#ifdef RDKV_NM - if ((currExTime - firstExTime ) > QUERY_INTERVAL) - { - ret = get_Device_WiFi_SSID_Fields(ssidIndex, fetchMask); - if( OK != ret) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, ret); - } - } -#else - unsigned int refreshMask = 0; - - if (((fetchMask & WIFI_SSID_FETCH_CONNECTED_SSID) != 0) && ((currExTime - connectedSsidFetchTime) > QUERY_INTERVAL)) - { - refreshMask |= WIFI_SSID_FETCH_CONNECTED_SSID; - } - - if (((fetchMask & WIFI_SSID_FETCH_AVAILABLE_INTERFACES) != 0) && ((currExTime - availableInterfacesFetchTime) > QUERY_INTERVAL)) - { - refreshMask |= WIFI_SSID_FETCH_AVAILABLE_INTERFACES; - } - - if (((fetchMask & WIFI_SSID_FETCH_WIFI_STATE) != 0) && ((currExTime - wifiStateFetchTime) > QUERY_INTERVAL)) - { - refreshMask |= WIFI_SSID_FETCH_WIFI_STATE; - } - - if (refreshMask != 0) - { - ret = get_Device_WiFi_SSID_Fields(ssidIndex, refreshMask); - if( OK != ret) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, ret); - } - else - { - if ((refreshMask & WIFI_SSID_FETCH_CONNECTED_SSID) != 0) - { - connectedSsidFetchTime = currExTime; - } - - if ((refreshMask & WIFI_SSID_FETCH_AVAILABLE_INTERFACES) != 0) - { - availableInterfacesFetchTime = currExTime; - } - - if ((refreshMask & WIFI_SSID_FETCH_WIFI_STATE) != 0) - { - wifiStateFetchTime = currExTime; - } - } - } -#endif -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - int ssidIndex=1; - int ret=OK; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_AVAILABLE_INTERFACES); - put_boolean(stMsgData->paramValue, enable); - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} -int hostIf_WiFi_SSID::set_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Status(HOSTIF_MsgData_t *stMsgData ) -{ - int ret = OK; - int ssidIndex=1; - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_WIFI_STATE); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(status); - snprintf(stMsgData->paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN, status); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID::set_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_Name(HOSTIF_MsgData_t *stMsgData ) -{ - int ssidIndex=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_CONNECTED_SSID); - snprintf(stMsgData->paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN, name); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(name); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return OK; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_LastChange(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_SSID::set_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -int hostIf_WiFi_SSID::hostIf_WiFi_SSID::get_Device_WiFi_SSID_BSSID(HOSTIF_MsgData_t *stMsgData ) -{ - - int ssidIndex=1; - int ret=OK; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_CONNECTED_SSID); - snprintf(stMsgData->paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN, BSSID); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(BSSID); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} - -int hostIf_WiFi_SSID::hostIf_WiFi_SSID::get_Device_WiFi_SSID_MACAddress(HOSTIF_MsgData_t *stMsgData ) -{ - int ssidIndex=1; - int ret=OK; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_AVAILABLE_INTERFACES); - snprintf(stMsgData->paramValue, TR69HOSTIFMGR_MAX_PARAM_LEN, MACAddress); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(MACAddress); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return ret; -} - -int hostIf_WiFi_SSID::get_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData ) -{ - int ssidIndex=1; - int ret=OK; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - checkWifiSSIDFetch(ssidIndex, WIFI_SSID_FETCH_CONNECTED_SSID); - snprintf(stMsgData->paramValue,TR69HOSTIFMGR_MAX_PARAM_LEN, SSID); - stMsgData->paramtype = hostIf_StringType; - stMsgData->paramLen = strlen(SSID); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - - return ret; -} -int hostIf_WiFi_SSID::set_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ - diff --git a/src/hostif/profiles/wifi/Device_WiFi_SSID.h b/src/hostif/profiles/wifi/Device_WiFi_SSID.h deleted file mode 100644 index 3fdd1b813..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_SSID.h +++ /dev/null @@ -1,362 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_SSID.h - */ - -/** - * @defgroup TR69_HOSTIF_WIFI_SSID TR-069 Object (Device.WiFi.SSID.{i}.) Public APIs - * - * WiFi SSID table (a stackable interface object as described in [Section 4.2/TR-181i2]), where table - * entries model the MAC layer. A WiFi SSID entry is typically stacked on top of a Radio object. - * - * WiFi SSID is also a multiplexing layer, i.e. more than one SSID can be stacked above a single Radio. - * - * At most one entry in this table (regardless of whether or not it is enabled) can exist with a given - * value for Alias, or with a given value for Name. On creation of a new table entry, the CPE MUST choose - * initial values for Alias and Name such that the new entry does not conflict with any existing entries. - * - * At most one enabled entry in this table can exist with a given value for SSID, or with a given value for BSSID. - * - * @ingroup TR69_HOSTIF_WIFI - */ - - - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_SSID_H_ -#define DEVICE_WIFI_SSID_H_ - -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * TR069-DEVICE-WIFI API SPECIFIC INCLUDE FILES - *****************************************************************************/ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi.h" - -/* - * Fetch mask uses bit flags (1, 2, 4) so callers can request multiple - * independent Thunder data groups in one refresh call using bitwise OR. - * - * Example: - * mask = WIFI_SSID_FETCH_CONNECTED_SSID | WIFI_SSID_FETCH_WIFI_STATE; - * if (mask & WIFI_SSID_FETCH_CONNECTED_SSID) { ... } - * if (mask & WIFI_SSID_FETCH_WIFI_STATE) { ... } - * - * Sequential enum values (0, 1, 2) are not suitable here because: - * - 0 cannot behave as a settable flag. - * - OR-combined results become ambiguous for membership checks. - * - * This flag-based design is required for selective refresh and avoids - * unnecessary RPC calls for unrelated parameters. - */ -enum WiFiSSIDFetchMask { - WIFI_SSID_FETCH_CONNECTED_SSID = 1 << 0, - WIFI_SSID_FETCH_AVAILABLE_INTERFACES = 1 << 1, - WIFI_SSID_FETCH_WIFI_STATE = 1 << 2 -}; - -/** @defgroup TR_069_DEVICE_WIFI_API TR-069 Device.WiFi object API. - * @ingroup TR_069_API - * - * The The WiFi object is based on the WiFi Alliance 802.11 specifications ([802.11-2007]). - * It defines interface objects (Radio and SSID), and application objects (AccessPoint and EndPoint). - * - */ - -/** @addtogroup TR_069_DEVICE_WIFI_GETTER_API TR-069 Device.WiFi Getter API. - * @ingroup TR_069_DEVICE_WIFI_API - * - * \section TR-069 Device.WiFi Getter API - * - * This is the getter group of API for the Device.WiFi object. - * - * The interface for all functions is identical and is described here. - * - * @param[in] HOSTIF_MsgData_t This is the host IF Message Request data - * - * @param[in] bool *pChanged Data type of parameter defined for TR-069. This is same as the - * data type used in the data-model.xml file. - * - * @return The status of the operation. - * @retval OK If parameter requested was successfully fetched. (Same as NO_ERROR). - * @retval NOK If parameter requested was successfully fetched. (Same as OK). - * - * - * @{ - */ - - -class hostIf_WiFi_SSID { - - static GHashTable *ifHash; - int dev_id = 0; //CID:103919 - UNINIT_CTOR - hostIf_WiFi_SSID(int dev_id); - ~hostIf_WiFi_SSID() {}; - -public: - static class hostIf_WiFi_SSID *getInstance(int dev_id); - static GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_SSID *); - static void closeAllInstances(); - int get_Device_WiFi_SSID_Fields(int ssidIndex, unsigned int fetchMask); - void checkWifiSSIDFetch(int radioIndex, unsigned int fetchMask); - - bool enable; - char status[BUFF_LENGTH_64]; - char alias[BUFF_LENGTH_64]; - char name[BUFF_LENGTH_64]; - unsigned int LastChange; - char LowerLayers[BUFF_LENGTH_1024]; - char BSSID[BUFF_MAC]; - char MACAddress[BUFF_MAC]; - char SSID[BUFF_LENGTH_32]; - /** - * @brief Get the MAC Address of an Associated Device of a WiFi Interface. - * - * This function provides the MAC address of the WiFi interface of the device associated - * with this WiFi interface. - * - * See @ref dev_wifi_if_assocdev_getter - * - */ - - /** - * @ingroup TR69_HOSTIF_WIFI_SSID - * @{ - */ - /** - * @brief Get the status of SSID entry. - * - * This function provides true/false value based on the Device.WiFi.SSID.Enable parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Set the enable or disable status for the SSID entry. - * This parameter is based on ifAdminStatus from [RFC2863]. - * - * This function will update true/false value for the Device.WiFi.SSID.Enable parameter. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_SSID_Enable(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the current operational state of the SSID entry (see [Section 4.2.2/TR-181i2]). - * - * The enumuration for SSID entry is: - * - Up - * - Down - * - Unknown - * - Dormant - * - NotPresent - * - LowerLayerDown - * - Error (OPTIONAL) - * - * When Enable is false then Status SHOULD normally be Down (or NotPresent or Error if there is a fault - * condition on the interface). - * - * - When Enable is changed to true then Status SHOULD change to Up if and only if the interface is able - * to transmit and receive network traffic; it SHOULD change to Dormant if and only if the interface - * is operable but is waiting for external actions before it can transmit and receive network traffic - * (and subsequently change to Up if still operable when the expected actions have completed); - * - It SHOULD change to LowerLayerDown if and only if the interface is prevented from entering the Up - * state because one or more of the interfaces beneath it is down; it SHOULD remain in the Error state - * if there is an error or other fault condition detected on the interface; it SHOULD remain in the - * NotPresent state if the interface has missing (typically hardware) components; - * - It SHOULD change to Unknown if the state of the interface can not be determined for some reason. - * - * This parameter is based on ifOperStatus from [RFC2863]. - * - * This function provides the output as a string available in Device.WiFi.SSID.Status. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Status(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the Alias based addresing given for SSID. - * - * This function provides the output as string available in Device.WiFi.SSID.Alias parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Set the Alias based addresing for SSID. - * - * A non-volatile handle used to reference this instance. Alias provides a mechanism for an ACS to - * label this instance for future reference. - * - * If the CPE supports the Alias-based Addressing feature as defined in [Section 3.6.1/TR-069a4] and - * described in [Appendix II/TR-069a4], the following mandatory constraints MUST be enforced: - * - * - Its value MUST NOT be empty. - * - Its value MUST start with a letter. - * - If its value is not assigned by the ACS, it MUST start with a "cpe-" prefix. - * - The CPE MUST NOT change the parameter value. - * - * This function will update the Alias-based addresing in Device.WiFi.SSID.Alias parameter. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_SSID_Alias(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the textual name of the SSID entry as assigned by the CPE. - * - * This function provides the output as string available in Device.WiFi.SSID.Name parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Name(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the accumulated time in seconds since the SSID entered its current operational state. - * - * This function provides the output as unsigned integer value available in Device.WiFi.SSID.LastChange parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_LastChange(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get a comma-separated list (maximum list length 1024) of strings. - * Each list item MUST be the path name of an interface object that is stacked immediately below - * this interface object. - * - * This function provides the output as string available in Device.WiFi.SSID.LowerLayers parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Set a comma-separated list (maximum list length 1024) of strings. - * Each list item MUST be the path name of an interface object that is stacked immediately below - * this interface object. If the referenced object is deleted, the corresponding item MUST be - * removed from the list. - * - * @see [Section 4.2.1/TR-181i2]. - * - * This function will update the string valu the the Device.WiFi.SSID.LowerLayers parameter. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_SSID_LowerLayers(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the Basic Service Set ID. - * - * This is the MAC address of the access point, which can either be local (when this instance models an - * access point SSID) or remote (when this instance models an end point SSID). - * - * This function provides the output as string available in Device.WiFi.SSID.BSSID parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_BSSID(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the MAC address of this interface. - * - * If this instance models an access point SSID, MAC Address is the same as MAC Address. - * - * @note This is not necessarily the same as the Ethernet header source or destination MAC address, - * which is associated with the IP interface and is modeled via the Ethernet.Link.{i}.MACAddress parameter. - * - * This function provides the output as string available in Device.WiFi.SSID.MACAddress parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_MACAddress(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the current service set identifier in use by the connection. - * The SSID is an identifier that is attached to packets sent over the wireless LAN that functions as an - * ID for joining a particular radio network (BSS). - * - * This function provides the output as string available in Device.WiFi.SSID.SSID parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Set the current service set identifier in use by the connection. - * The SSID is an identifier that is attached to packets sent over the wireless LAN that functions as an - * ID for joining a particular radio network (BSS). - * - * This function will update the SSID value in string format in Device.WiFi.SSID.SSID parameter. - * - * @param[in] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int set_Device_WiFi_SSID_SSID(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_SSID -}; - -#endif /* #ifdef USE_WIFI_PROFILE */ -#endif /* DEVICE_WIFI_SSID_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.cpp b/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.cpp deleted file mode 100644 index aae25af08..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - - -/** - * @file Device_WiFi_SSID_Stats.cpp - * - * @brief Device_WiFi_SSID API Implementation. - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ - -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#ifdef USE_WIFI_PROFILE -#include "Device_WiFi_SSID_Stats.h" - -GHashTable* hostIf_WiFi_SSID_Stats::ifHash = NULL; - -hostIf_WiFi_SSID_Stats* hostIf_WiFi_SSID_Stats::getInstance(int dev_id) -{ - hostIf_WiFi_SSID_Stats* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_SSID_Stats *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_SSID_Stats(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_SSID_Stats instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - -GList* hostIf_WiFi_SSID_Stats::getAllInstances() -{ - if(ifHash) - return g_hash_table_get_keys(ifHash); - return NULL; -} - -void hostIf_WiFi_SSID_Stats::closeInstance(hostIf_WiFi_SSID_Stats *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_SSID_Stats::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_SSID_Stats* pDev = (hostIf_WiFi_SSID_Stats *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_SSID_Stats::hostIf_WiFi_SSID_Stats(int dev_id): - bytesSent(0), - bytesReceived(0), - packetsSent(0), - packetsReceived(0), - ErrorsSent(0), - ErrorsReceived(0), - UnicastPacketsSent(0), - UnicastPacketsReceived(0), - DiscardPacketsSent(0), - DiscardPacketsReceived(0), - MulticastPacketsSent(0), - MulticastPacketsReceived(0), - BroadcastPacketsSent(0), - BroadcastPacketsReceived(0), - UnknownProtoPacketsReceived(0) -{ - -} - -/** - * @brief Get the MAC Address of an Associated Device of a MoCA Interface. - * - * This function provides the MAC address of the MoCA interface of the device associated - * with this MoCA interface. - * - * See @ref dev_moca_if_assocdev_getter - * - */ - -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_BytesSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_BytesReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_PacketsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_ErrorsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_ErrorsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_UnicastPacketsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_UnicastPacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_MulticastPacketsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_MulticastPacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_BroadcastPacketsSent(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_BroadcastPacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} -int hostIf_WiFi_SSID_Stats::get_Device_WiFi_SSID_Stats_UnknownProtoPacketsReceived(HOSTIF_MsgData_t *stMsgData ) -{ - return OK; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.h b/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.h deleted file mode 100644 index e8fc409a1..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_SSID_Stats.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @defgroup TR69_HOSTIF_WIFI_SSID_STAT TR-069 Object (Device.WiFi.SSID.{i}.Stats) Public APIs - * - * Throughput statistics for this interface. - * - * The CPE MUST reset the interface's Stats parameters (unless otherwise stated in individual object or - * parameter descriptions) either when the interface becomes operationally down due to a previous - * administrative down (i.e. the interface's Status parameter transitions to a down state after the - * interface is disabled) or when the interface becomes administratively up (i.e. the interface's Enable - * parameter transitions from false to true). Administrative and operational interface status is discussed - * in [Section 4.2.2/TR-181i2]. - * - * @ingroup TR69_HOSTIF_WIFI - */ - -/** -* @defgroup tr69hostif -* @{ -* @defgroup hostif -* @{ -**/ - - -#ifndef DEVICE_WIFI_SSID_STATS_H_ -#define DEVICE_WIFI_SSID_STATS_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" - - -class hostIf_WiFi_SSID_Stats { - - static GHashTable *ifHash; - int dev_id = 0; //CID:103281 - UNINIT_CTOR - hostIf_WiFi_SSID_Stats(int dev_id); - ~hostIf_WiFi_SSID_Stats() {}; - -public: - static class hostIf_WiFi_SSID_Stats *getInstance(int dev_id); - GList* getAllInstances(); - static void closeInstance(hostIf_WiFi_SSID_Stats *); - static void closeAllInstances(); - - unsigned long bytesSent; - unsigned long bytesReceived; - unsigned long packetsSent; - unsigned long packetsReceived; - unsigned int ErrorsSent; - unsigned int ErrorsReceived; - unsigned long UnicastPacketsSent; - unsigned long UnicastPacketsReceived; - unsigned int DiscardPacketsSent; - unsigned int DiscardPacketsReceived; - unsigned long MulticastPacketsSent; - unsigned long MulticastPacketsReceived; - unsigned long BroadcastPacketsSent; - unsigned long BroadcastPacketsReceived; - unsigned int UnknownProtoPacketsReceived; - - /** - * @ingroup TR69_HOSTIF_WIFI_SSID_STAT - * @{ - */ - /** - * @brief Get the total number of bytes transmitted out of the interface, including framing characters. - * - * This function provides the output as a unsinged long value available in - * Device.WiFi.SSID.Stats.BytesSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_BytesSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of bytes received on the interface, including framing characters. - * - * This function provides the output as integer value available in Device.WiFi.SSID.Stats.BytesReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_BytesReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets transmitted out of the interface. - * - * This function provides the output as integer value available in Device.WiFi.SSID.Stats.PacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_PacketsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets received on the interface. - * - * This function provides the output as a integer value available in Device.WiFi.SSID.Stats.PacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of outbound packets that could not be transmitted because of errors. - * - * This function provides the output as a integer value available in Device.WiFi.SSID.Stats.ErrorsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_ErrorsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of inbound packets that contained errors preventing them from being delivered - * to a higher-layer protocol. - * - * This function provides the output as a integer value available in Device.WiFi.SSID.Stats.ErrorsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_ErrorsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets requested for transmission which were not addressed to a multicast - * or broadcast address at this layer, including those that were discarded or not sent. - * - * This function provides the output as integer value available in - * Device.WiFi.SSID.Stats.UnicastPacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_UnicastPacketsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of received packets, delivered by this layer to a higher layer, - * which were not addressed to a multicast or broadcast address at this layer. - * - * This function provides the output as a integer value available in - * Device.WiFi.SSID.Stats.UnicastPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_UnicastPacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of outbound packets which were chosen to be discarded even though no errors - * had been detected to prevent their being transmitted. One possible reason for discarding such a packet - * could be to free up buffer space. - * - * This function provides the output as a integer value available in - * Device.WiFi.SSID.Stats.DiscardPacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_DiscardPacketsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of inbound packets which were chosen to be discarded even though no - * errors had been detected to prevent their being delivered. One possible reason for discarding such a - * packet could be to free up buffer space. - * - * This function provides the output as a integer value available in - * Device.WiFi.SSID.Stats.DiscardPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_DiscardPacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets that higher-level protocols requested for transmission and - * which were addressed to a multicast address at this layer, including those that were discarded or not sent. - * - * This function provides the output as numeric value available in - * Device.WiFi.SSID.Stats.MulticastPacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_MulticastPacketsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of received packets, delivered by this layer to a higher layer, - * which were addressed to a multicast address at this layer. - * - * This function provides the output as a numeric value available in - * Device.WiFi.SSID.Stats.MulticastPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_MulticastPacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets that higher-level protocols requested for transmission and - * which were addressed to a broadcast address at this layer, including those that were discarded or not sent. - * - * This function provides the output as a numeric value available in - * Device.WiFi.SSID.Stats.BroadcastPacketsSent parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_BroadcastPacketsSent(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of received packets, delivered by this layer to a higher layer, - * which were addressed to a broadcast address at this layer. - * - * This function provides the output as a numeric value available in - * Device.WiFi.SSID.Stats.BroadcastPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_BroadcastPacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** - * @brief Get the total number of packets received via the interface which were discarded because - * of an unknown or unsupported protocol. - * - * This function provides the output as a numeric value available in - * Device.WiFi.SSID.Stats.UnknownProtoPacketsReceived parameter. - * - * @param[out] stMsgData TR-069 Host interface message request. - * - * @return Returns 0 on success, otherwise will return the appropriate error code. - */ - int get_Device_WiFi_SSID_Stats_UnknownProtoPacketsReceived(HOSTIF_MsgData_t *stMsgData ); - - /** @} */ //End of Doxygen tag TR69_HOSTIF_WIFI_SSID_STAT -}; - - -#endif /* DEVICE_WIFI_SSID_STATS_H_ */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp b/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp deleted file mode 100644 index 3c52abf00..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp +++ /dev/null @@ -1,778 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2018 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -/** - * @file Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp - * - * @brief Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming implementation - * - * This is the implementation of the WiFi API. - * - * @par Document - */ -/** @addtogroup TR-069 WiFi Implementation - * This is the implementation of the Device Public API. - * @{ - */ -#ifdef USE_WIFI_PROFILE -/***************************************************************************** - * STANDARD INCLUDE FILES - *****************************************************************************/ -#include "Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h" - -extern "C" { -#include "wifiSrvMgrIarmIf.h" - /* #include "c_only_header.h"*/ -}; - -#define POST_ASSN_MAX_TIME_FRAME 36000 /* Max time frame in seconds for roaming window - 10 Hours */ -#define MAX_POST_ASSN_BACKOFF 3600 /* Max BackOff Factor for PostAssociation BackOff */ - -static int get_Device_WiFi_Client_Roaming_Configs(); - -GHashTable* hostIf_WiFi_Xrdk_ClientRoaming::ifHash = NULL; -time_t radioFirstExTime = 0; -bool isParamSet = false; - -hostIf_WiFi_Xrdk_ClientRoaming* hostIf_WiFi_Xrdk_ClientRoaming::getInstance(int dev_id) -{ - hostIf_WiFi_Xrdk_ClientRoaming* pRet = NULL; - - if(ifHash) - { - pRet = (hostIf_WiFi_Xrdk_ClientRoaming *)g_hash_table_lookup(ifHash,(gpointer) dev_id); - } - else - { - ifHash = g_hash_table_new(NULL,NULL); - } - - if(!pRet) - { - try { - pRet = new hostIf_WiFi_Xrdk_ClientRoaming(dev_id); - } catch(int e) - { - RDK_LOG(RDK_LOG_WARN,LOG_TR69HOSTIF,"Caught exception, not able create hostIf_WiFi_Xrdk_ClientRoaming instance..\n"); - } - g_hash_table_insert(ifHash, (gpointer)dev_id, pRet); - } - return pRet; -} - - -void hostIf_WiFi_Xrdk_ClientRoaming::closeInstance(hostIf_WiFi_Xrdk_ClientRoaming *pDev) -{ - if(pDev) - { - g_hash_table_remove(ifHash, (gconstpointer)pDev->dev_id); - delete pDev; - } -} - -void hostIf_WiFi_Xrdk_ClientRoaming::closeAllInstances() -{ - if(ifHash) - { - GList* tmp_list = g_hash_table_get_values (ifHash); - - GList* current = tmp_list; - - while(current) - { - hostIf_WiFi_Xrdk_ClientRoaming* pDev = (hostIf_WiFi_Xrdk_ClientRoaming *)current->data; - current = current->next; - closeInstance(pDev); - } - - g_list_free(tmp_list); - } -} - - -hostIf_WiFi_Xrdk_ClientRoaming::hostIf_WiFi_Xrdk_ClientRoaming(int dev_id): - dev_id(dev_id), - roamingEnable(0), - preassnBestThreshold(-67), - preassnBestDelta(2), - postAssnLevelDeltaConnected(12), - postAssnLevelDeltaDisconnected(8), - postAssnSelfSteerThreshold(-75), - postAssnSelfSteerTimeframe(60), - //postAssnSelfSteerBeaconsMissedTime(10) - postAssnAPcontrolThresholdLevel(-75), - postAssnAPcontrolTimeframe(60), - postAssnBackOffTime(2), - postAssnSelfSteerOverrideEnable(false), - roaming80211kvrEnable(false), - roamingConfigEnable(false), - preassnProbeRetryCnt(0), - postAssnSelfSteerBeaconsMissedTime(0) //CID:103263 - UNINIT_CTOR -{ - -} - -static int get_Device_WiFi_Client_Roaming_Configs() -{ - WiFi_RoamingCtrl_t param; - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - int dev_id = 0; - int retStatus = 0; - - memset(¶m,0,sizeof(param)); - hostIf_WiFi_Xrdk_ClientRoaming *pDev = hostIf_WiFi_Xrdk_ClientRoaming::getInstance(dev_id); - if(pDev) - { - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_getRoamingCtrls, (void *)(¶m), sizeof(param)); // IARM Call to netsrvmgr - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - retStatus = param.status; - } - pDev->roamingEnable = param.roamingEnable; - pDev->preassnBestThreshold = param.preassnBestThreshold; - pDev->preassnBestDelta = param.preassnBestDelta; - pDev->postAssnLevelDeltaConnected = param.postAssnLevelDeltaConnected; - pDev->postAssnLevelDeltaDisconnected = param.postAssnLevelDeltaDisconnected; - pDev->postAssnSelfSteerThreshold = param.postAssnSelfSteerThreshold; - pDev->postAssnSelfSteerTimeframe = param.postAssnSelfSteerTimeframe; - //pDev->postAssnSelfSteerBeaconsMissedTime = param.postAssnSelfSteerBeaconsMissedTime; - pDev->postAssnAPcontrolThresholdLevel = param.postAssnAPcontrolThresholdLevel; - pDev->postAssnAPcontrolTimeframe = param.postAssnAPcontrolTimeframe; - pDev->postAssnBackOffTime = param.postAssnBackOffTime; - pDev->postAssnSelfSteerOverrideEnable = param.selfSteerOverride; - pDev->roaming80211kvrEnable = param.roaming80211kvrEnable; - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - retStatus = param.status; - } - return retStatus; -} - -static int set_Device_WiFi_Client_Roaming_Configs(WiFi_RoamingCtrl_t *param) -{ - if (param != NULL) - { - IARM_Result_t retVal = IARM_RESULT_SUCCESS; - int dev_id = 0; - hostIf_WiFi_Xrdk_ClientRoaming *pDev = hostIf_WiFi_Xrdk_ClientRoaming::getInstance(dev_id); - if(pDev) - { - retVal = IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME, IARM_BUS_WIFI_MGR_API_setRoamingCtrls, (void *)(param), sizeof(WiFi_RoamingCtrl_t)); // IARM Call to netsrvmgr - if (IARM_RESULT_SUCCESS != retVal) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] IARM BUS CALL failed with : %d.\n", __FILE__, __FUNCTION__, retVal); - return NOK; - } - pDev->roamingEnable = param->roamingEnable; - pDev->preassnBestThreshold = param->preassnBestThreshold; - pDev->preassnBestDelta = param->preassnBestDelta; - pDev->postAssnLevelDeltaConnected = param->postAssnLevelDeltaConnected; - pDev->postAssnLevelDeltaDisconnected = param->postAssnLevelDeltaDisconnected; - pDev->postAssnSelfSteerThreshold = param->postAssnSelfSteerThreshold; - pDev->postAssnSelfSteerTimeframe = param->postAssnSelfSteerTimeframe; - //pDev->postAssnSelfSteerBeaconsMissedTime = param->postAssnSelfSteerBeaconsMissedTime; - pDev->postAssnAPcontrolThresholdLevel = param->postAssnAPcontrolThresholdLevel; - pDev->postAssnAPcontrolTimeframe = param->postAssnAPcontrolTimeframe; - pDev->postAssnSelfSteerOverrideEnable = param->selfSteerOverride; - pDev->roaming80211kvrEnable = param->roaming80211kvrEnable; - pDev->postAssnBackOffTime = param->postAssnBackOffTime; - RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s] Successfully set Params - [roamingEnable=%d,preassnBestThreshold=%d,preassnBestDelta=%d \n",__FILE__, __FUNCTION__,param->roamingEnable,param->preassnBestThreshold,param->preassnBestDelta); - isParamSet = true; - return OK; - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Unable to connect to wifi instance\n", __FILE__, __FUNCTION__); - return NOK; - } - } - else - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s]Error! Invalid Argument in param \n", __FILE__, __FUNCTION__); - return NOK; - } - return OK; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::checkWifiClientRoamingropsFetch() -{ - int ret = OK; - time_t currExTime = time (NULL); - if ((currExTime - radioFirstExTime ) > QUERY_INTERVAL || isParamSet == true) - { - ret = get_Device_WiFi_Client_Roaming_Configs(); - if( OK != ret) - { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to fetch : %d.\n", __FILE__, __FUNCTION__, ret); - } - radioFirstExTime = currExTime; - isParamSet = false; - } - return ret; -} - -int update_from_local_config(WiFi_RoamingCtrl_t* param, hostIf_WiFi_Xrdk_ClientRoaming* roamInst) -{ - param->roamingEnable = roamInst->roamingEnable; - param->preassnBestThreshold = roamInst->preassnBestThreshold; - param->preassnBestDelta = roamInst->preassnBestDelta; - param->selfSteerOverride = roamInst->postAssnSelfSteerOverrideEnable; - param->postAssnLevelDeltaConnected = roamInst->postAssnLevelDeltaConnected; - param->postAssnLevelDeltaDisconnected = roamInst->postAssnLevelDeltaDisconnected; - param->postAssnSelfSteerThreshold = roamInst->postAssnSelfSteerThreshold; - param->postAssnSelfSteerTimeframe = roamInst->postAssnSelfSteerTimeframe; - //param->postAssnSelfSteerBeaconsMissedTime = roamInst->postAssnSelfSteerBeaconsMissedTime; - param->postAssnAPcontrolThresholdLevel = roamInst->postAssnAPcontrolThresholdLevel; - param->postAssnAPcontrolTimeframe = roamInst->postAssnAPcontrolTimeframe; - param->roaming80211kvrEnable = roamInst->roaming80211kvrEnable; - param->postAssnBackOffTime = roamInst->postAssnBackOffTime; - return 0; - -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get clientRoaming_Enable \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_boolean(stMsgData->paramValue, this->roamingEnable); - } - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=1; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.roamingEnable = get_int(stMsgData->paramValue); - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus == -2) - stMsgData->faultCode = fcAttemptToSetaNonWritableParameter; //RFC not enabled - else if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set clientRoaming_Enable..\n", __FUNCTION__, __FILE__); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get BestThresholdLevel \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->preassnBestThreshold); - } - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - int threshold = 0; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - threshold = get_int(stMsgData->paramValue); - if(threshold > 0 || threshold < -200) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set BestThresholdLevel - Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.preassnBestThreshold = threshold; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set BestThresholdLevel..\n", __FUNCTION__, __FILE__); - - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get getDeltaLevel \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->preassnBestDelta); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(HOSTIF_MsgData_t *stMsgData ) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int delta = get_int(stMsgData->paramValue); - if(delta < 0 || delta > 200) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PreAssn_BestDeltaLevel - Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.preassnBestDelta = delta; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PreAssn_BestDeltaLevel..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] get get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride \n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get SelfSteerOverride value \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnSelfSteerOverrideEnable); - } - stMsgData->paramtype = hostIf_BooleanType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int self_steerOverride = get_int(stMsgData->paramValue); - if(self_steerOverride != 0 && self_steerOverride != 1) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set SelfSteerOverride Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.selfSteerOverride = self_steerOverride; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set SelfSteerOverride..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_LevelDeltaConnected \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnLevelDeltaConnected); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int post_level_Delta_Connected = get_int(stMsgData->paramValue); - if(post_level_Delta_Connected < 0 || post_level_Delta_Connected > 200) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_LevelDeltaConnected Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnLevelDeltaConnected = post_level_Delta_Connected; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set postAssnLevelDeltaConnected..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_LevelDeltaDisconnected \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnLevelDeltaDisconnected); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int post_level_Delta_Disconnected = get_int(stMsgData->paramValue); - if(post_level_Delta_Disconnected < 0 || post_level_Delta_Disconnected > 200) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_LevelDeltaConnected Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnLevelDeltaDisconnected = post_level_Delta_Disconnected; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set postAssnLevelDeltaDisconnected..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_SelfSteerThreshold \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnSelfSteerThreshold); - } - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int post_Self_SteerThreshold = get_int(stMsgData->paramValue); - if(post_Self_SteerThreshold > 0 || post_Self_SteerThreshold < -200) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerThreshold Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnSelfSteerThreshold = post_Self_SteerThreshold; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerThreshold..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_SelfSteerTimeframe \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnSelfSteerTimeframe); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - get_Device_WiFi_Client_Roaming_Configs(); - int post_Self_SteerTimeframe = get_int(stMsgData->paramValue); - if(post_Self_SteerTimeframe < 0 || post_Self_SteerTimeframe > POST_ASSN_MAX_TIME_FRAME) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerTimeframe Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnSelfSteerTimeframe = post_Self_SteerTimeframe; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerTimeframe..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} -/* -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_SelfSteerBeaconsMissedTime \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnSelfSteerBeaconsMissedTime); - } - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - checkWifiClientRoamingropsFetch(); - int post_Self_SteerBeacons_MissedTime = get_int(stMsgData->paramValue); - if(post_Self_SteerBeacons_MissedTime < 0) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerBeaconsMissedTime Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnSelfSteerBeaconsMissedTime = post_Self_SteerBeacons_MissedTime; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_SelfSteerBeaconsMissedTime ..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -}*/ - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_APcontrolThresholdLevel \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnAPcontrolThresholdLevel); - } - stMsgData->paramtype = hostIf_IntegerType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - get_Device_WiFi_Client_Roaming_Configs(); - int APcontrolThresholdLevel = get_int(stMsgData->paramValue); - if(APcontrolThresholdLevel > 0 || APcontrolThresholdLevel < -200 ) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_APcontrolThresholdLevel Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnAPcontrolThresholdLevel = APcontrolThresholdLevel; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_APcontrolThresholdLevel..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get PostAssn_APcontrolTimeframe \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnAPcontrolTimeframe); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - get_Device_WiFi_Client_Roaming_Configs(); - int APcontrolTimeframe = get_int(stMsgData->paramValue); - if(APcontrolTimeframe < 0 || APcontrolTimeframe > POST_ASSN_MAX_TIME_FRAME) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_APcontrolTimeframe Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnAPcontrolTimeframe = APcontrolTimeframe; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set PostAssn_APcontrolTimeframe..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get postAssnBackOffTime \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->postAssnBackOffTime); - } - stMsgData->paramtype = hostIf_UnsignedIntType; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - get_Device_WiFi_Client_Roaming_Configs(); - int postAssnBackOffTime = get_int(stMsgData->paramValue); - if(postAssnBackOffTime < 0 || postAssnBackOffTime > MAX_POST_ASSN_BACKOFF) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set postAssnBackOffTime Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.postAssnBackOffTime = postAssnBackOffTime; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set postAssnBackOffTime..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::get_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering...\n", __FUNCTION__, __FILE__); - int retStatus = OK; - retStatus = checkWifiClientRoamingropsFetch(); - if(retStatus != OK) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to get 80211kvrEnable \n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInternalError; - } - else { - put_int(stMsgData->paramValue, this->roaming80211kvrEnable); - } - stMsgData->paramtype = hostIf_BooleanType;; - stMsgData->paramLen=4; - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting...\n", __FUNCTION__, __FILE__); - return retStatus; -} - -int hostIf_WiFi_Xrdk_ClientRoaming::set_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(HOSTIF_MsgData_t *stMsgData) -{ - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__); - int retStatus = NOK; - if( radioFirstExTime == 0) - get_Device_WiFi_Client_Roaming_Configs(); - int roaming80211kvrEnable = get_int(stMsgData->paramValue); - if(roaming80211kvrEnable < 0) { - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set 80211kvrEnable Invalid Value\n", __FUNCTION__, __FILE__); - stMsgData->faultCode = fcInvalidParameterValue; - return retStatus; - } - WiFi_RoamingCtrl_t param; - memset(¶m,0,sizeof(param)); - update_from_local_config(¶m,this); - param.roaming80211kvrEnable = roaming80211kvrEnable; - retStatus = set_Device_WiFi_Client_Roaming_Configs(¶m); - if(retStatus != OK) - RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%s] Failed to set 80211kvrEnable..\n", __FUNCTION__, __FILE__); - RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__); - return retStatus; -} - -#endif /* #ifdef USE_WIFI_PROFILE */ diff --git a/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h b/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h deleted file mode 100644 index dc69280c6..000000000 --- a/src/hostif/profiles/wifi/Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2016 RDK Management - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h - * - * @brief TR-069 Device.WiFi.Radio object Public API. - * - * Description of Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming module. - * - * - * @par Document - * Document reference. - * - * - * @par Open Issues (in no particular order) - * -# Issue 1 - * -# Issue 2 - * - * - * @par Assumptions - * -# Assumption - * -# Assumption - * - * - * @par Abbreviations - * - ACK: Acknowledge. - * - BE: Big-Endian. - * - cb: Callback function (suffix). - * - config: Configuration. - * - desc: Descriptor. - * - dword: Double word quantity, i.e., four bytes or 32 bits in size. - * - intfc: Interface. - * - LE: Little-Endian. - * - LS: Least Significant. - * - MBZ: Must be zero. - * - MS: Most Significant. - * - _t: Type (suffix). - * - word: Two byte quantity, i.e. 16 bits in size. - * - xfer: Transfer. - * - * - * @par Implementation Notes - * -# Note - * -# Note - * - */ - - - -/** - * @defgroup tr69hostif - * @{ - * @defgroup hostif - * @{ - **/ - - -#ifndef HOSTIF_DEVICE_WIFI_X_RDKCENTRAL_COM_CLIENTROAMING_H_ -#define HOSTIF_DEVICE_WIFI_X_RDKCENTRAL_COM_CLIENTROAMING_H_ - -#include "hostIf_main.h" -#include "hostIf_utils.h" -#include "hostIf_tr69ReqHandler.h" -#include "hostIf_updateHandler.h" -#include "Device_WiFi.h" - - -/***************************************************************************** - * TR069-SPECIFIC INCLUDE FILES - *****************************************************************************/ - -/** @defgroup TR_069_DEVICE_WIFI_X_RDKCENTRAL_COM_CLIENTROAMING API TR-069 Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming object API. - * @ingroup TR_069_DEVICE_WIFI_RDKCENTRAL_COM_CLIENTROAMING - * - * The Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming object table. This object models an 802.11 wireless radio - * on a device (a stackable interface object as described in [Section 4.2/TR-181i2]).. - * - * - * @{ - */ -#ifdef WIFI_CLIENT_ROAMING -class hostIf_WiFi_Xrdk_ClientRoaming { - - static GHashTable *ifHash; - - int dev_id; - hostIf_WiFi_Xrdk_ClientRoaming(int dev_id); - ~hostIf_WiFi_Xrdk_ClientRoaming() {}; - int checkWifiClientRoamingropsFetch(); - -public: - static class hostIf_WiFi_Xrdk_ClientRoaming *getInstance(int dev_id); - static void closeInstance(hostIf_WiFi_Xrdk_ClientRoaming *); - static void closeAllInstances(); - - bool roamingEnable; - bool roamingConfigEnable; - int preassnProbeRetryCnt; - int preassnBestThreshold; - int preassnBestDelta; - int postAssnLevelDeltaConnected; - int postAssnLevelDeltaDisconnected; - int postAssnSelfSteerThreshold; - int postAssnSelfSteerTimeframe; - int postAssnSelfSteerBeaconsMissedTime; - int postAssnAPcontrolThresholdLevel; - int postAssnAPcontrolTimeframe; - int postAssnBackOffTime; - bool postAssnSelfSteerOverrideEnable; - bool roaming80211kvrEnable; - - /** - * @brief Enables or disables the Client Romaing - * - * This function provides to true/false value based on the - * Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.Enable - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief set Enables/disables the Client Roaming - * - * This function set to true/false to 'Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.Enable' parameter. - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_Enable(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_ProbeRetryCnt - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_ProbeRetryCnt(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_ProbeRetryCnt - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_ProbeRetryCnt(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel - * - * - */ - - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected(HOSTIF_MsgData_t *stMsgData); - - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime - * - * - */ - //int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime - * - * - */ - //int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerBeaconsMissedTime(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime(HOSTIF_MsgData_t *stMsgData); - /** - * @brief get_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable - * - * - */ - int get_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(HOSTIF_MsgData_t *stMsgData); - /** - * @brief set_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable - * - * - */ - int set_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable(HOSTIF_MsgData_t *stMsgData); -}; - -/* End of TR069_HOSTIF_DEVICE_WIFI_X_RDKCENTRAL_COM_CLIENTROAMING_H_ doxygen group */ -/** - * @} - */ -#endif // WIFI_CLIENT_ROAMING -#endif /* HOSTIF_DEVICE_WIFI_X_RDKCENTRAL_COM_CLIENTROAMING */ - - -/** @} */ -/** @} */ diff --git a/src/hostif/profiles/wifi/Makefile.am b/src/hostif/profiles/wifi/Makefile.am deleted file mode 100644 index b3e029d51..000000000 --- a/src/hostif/profiles/wifi/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -########################################################################## -# If not stated otherwise in this file or this component's LICENSE -# file the following copyright and licenses apply: -# -# Copyright 2018 RDK Management -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -########################################################################## - -SUBDIRS = - -AM_CXXFLAGS = -I$(top_srcdir)/src/hostif/include \ - -I$(top_srcdir)/src/hostif/handlers/include \ - $(GLIB_CFLAGS) $(G_THREAD_CFLAGS) $(WIFI_PROFILE_FLAG) - -AM_CXXFLAGS += "-std=c++11" - -#AM_LDFLAGS = -lwifi_hal - -noinst_LTLIBRARIES = libhostIfWiFi.la -libhostIfWiFi_la_SOURCES = Device_WiFi.cpp \ - Device_WiFi_Radio.cpp \ - Device_WiFi_Radio_Stats.cpp \ - Device_WiFi_SSID.cpp \ - Device_WiFi_SSID_Stats.cpp \ - Device_WiFi_EndPoint.cpp \ - Device_WiFi_EndPoint_Security.cpp \ - Device_WiFi_EndPoint_WPS.cpp \ - Device_WiFi_EndPoint_Profile.cpp \ - Device_WiFi_EndPoint_Profile_Security.cpp \ - Device_WiFi_AccessPoint.cpp \ - Device_WiFi_AccessPoint_WPS.cpp \ - Device_WiFi_AccessPoint_Security.cpp \ - Device_WiFi_AccessPoint_AssociatedDevice.cpp - -if WIFI_CLIENT_ROAMING -AM_CXXFLAGS += -DWIFI_CLIENT_ROAMING -libhostIfWiFi_la_SOURCES += Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp -endif - diff --git a/src/hostif/profiles/wifi/docs/README.md b/src/hostif/profiles/wifi/docs/README.md deleted file mode 100644 index 9075a8f8a..000000000 --- a/src/hostif/profiles/wifi/docs/README.md +++ /dev/null @@ -1,345 +0,0 @@ -# WiFi Profile - -## Overview - -The WiFi profile implements the TR-181 `Device.WiFi.*` object tree, covering the complete 802.11 management hierarchy: top-level counts, radio configuration and statistics, SSID interface state, access point management (WPS, security, associated clients), and client endpoint profiles. On RDK-V builds (`RDKV_NM`), all data comes from the `IARM_BUS_NM_SRV_MGR_NAME` WiFi manager via IARM Bus calls. On non-RDKV builds, data is fetched from the WPEFramework Thunder plugin via libcurl JSON-RPC calls (`cJSON`). The entire profile is guarded by `USE_WIFI_PROFILE`. - ---- - -## Directory Structure - -``` -src/hostif/profiles/wifi/ -├── Device_WiFi.cpp # Top-level WiFi container -├── Device_WiFi.h -├── Device_WiFi_Radio.cpp # Radio physical layer config -├── Device_WiFi_Radio.h -├── Device_WiFi_Radio_Stats.cpp # Radio statistics -├── Device_WiFi_Radio_Stats.h -├── Device_WiFi_SSID.cpp # SSID interface state -├── Device_WiFi_SSID.h -├── Device_WiFi_SSID_Stats.cpp # SSID-level statistics -├── Device_WiFi_SSID_Stats.h -├── Device_WiFi_AccessPoint.cpp # AP configuration -├── Device_WiFi_AccessPoint.h -├── Device_WiFi_AccessPoint_AssociatedDevice.cpp # Per-client entries -├── Device_WiFi_AccessPoint_AssociatedDevice.h -├── Device_WiFi_AccessPoint_Security.cpp # AP security settings -├── Device_WiFi_AccessPoint_Security.h -├── Device_WiFi_AccessPoint_WPS.cpp # AP WPS configuration -├── Device_WiFi_AccessPoint_WPS.h -├── Device_WiFi_EndPoint.cpp # Client endpoint -├── Device_WiFi_EndPoint.h -├── Device_WiFi_EndPoint_Profile.cpp # EndPoint connection profile -├── Device_WiFi_EndPoint_Profile.h -├── Device_WiFi_EndPoint_Profile_Security.cpp # EndPoint security -├── Device_WiFi_EndPoint_Profile_Security.h -├── Device_WiFi_EndPoint_Security.cpp # EndPoint security modes -├── Device_WiFi_EndPoint_Security.h -├── Device_WiFi_EndPoint_WPS.cpp # EndPoint WPS -├── Device_WiFi_EndPoint_WPS.h -├── Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp # Band-steering/roaming -├── Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.h -└── Makefile.am -``` - -> **Note**: There is no `gtest/` subdirectory. The WiFi profile has no unit tests. - ---- - -## Architecture - -```mermaid -graph TB - ACS[ACS / WebPA / RBUS] -->|GET/SET Device.WiFi.*| DISP[hostIf_msgHandler] - - DISP --> WIFI["hostIf_WiFi
Device.WiFi top-level"] - DISP --> RADIO["hostIf_WiFi_Radio
Device.WiFi.Radio.(i).*"] - DISP --> RADSTA["hostIf_WiFi_Radio_Stats
Device.WiFi.Radio.(i).Stats.*"] - DISP --> SSID["hostIf_WiFi_SSID
Device.WiFi.SSID.(i).*"] - DISP --> SSISTAT["hostIf_WiFi_SSID_Stats
Device.WiFi.SSID.(i).Stats.*"] - DISP --> AP["hostIf_WiFi_AccessPoint
Device.WiFi.AccessPoint.(i).*"] - DISP --> ASSOC["hostIf_WiFi_AccessPoint_AssociatedDevice
Device.WiFi.AccessPoint.(i).AssociatedDevice.(j)"] - DISP --> APSEC["hostIf_WiFi_AccessPoint_Security
Device.WiFi.AccessPoint.(i).Security.*"] - DISP --> APWPS["hostIf_WiFi_AccessPoint_WPS
Device.WiFi.AccessPoint.(i).WPS.*"] - DISP --> EP["hostIf_WiFi_EndPoint
Device.WiFi.EndPoint.(i).*"] - DISP --> ROAM["hostIf_WiFi_X_RDKCENTRAL_COM_ClientRoaming
Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.*"] - - subgraph RDKVNM[RDKV_NM build path] - IARM["IARM Bus
IARM_BUS_NM_SRV_MGR_NAME
IARM_BUS_WIFI_MGR_API_*"] - end - subgraph NONRDKV[Non-RDKV build path] - CURL["libcurl + cJSON
JSON-RPC to WPEFramework"] - end - - RADIO --> RDKVNM - RADIO --> NONRDKV - SSID --> RDKVNM - AP --> RDKVNM -``` - ---- - -## TR-181 Parameter Coverage - -### `Device.WiFi` - -| Parameter | GET (RDKV_NM) | GET (non-RDKV) | Notes | -|-----------|:---:|:---:|-------| -| `RadioNumberOfEntries` | ✅ | ❌ | IARM `IARM_BUS_WIFI_MGR_RadioEntry` | -| `SSIDNumberOfEntries` | ✅ | ❌ | IARM `IARM_BUS_WIFI_MGR_SSIDEntry` | -| `AccessPointNumberOfEntries` | ✅ | ✅ | Hardcoded `1` (non-RDKV) | -| `EndPointNumberOfEntries` | ✅ | ✅ | Hardcoded `1` | - -### `Device.WiFi.Radio.{i}` - -| Parameter | GET | Notes | -|-----------|-----|-------| -| `Enable` | ✅ | `wifi_getRadioEnable` / IARM | -| `Status` | ✅ | `wifi_getRadioEnable` → "Up"/"Down" | -| `Name` | ✅ | `wifi_getRadioIfName` | -| `SupportedFrequencyBands` | ✅ | "2.4GHz" / "5GHz" | -| `OperatingFrequencyBand` | ✅ | `wifi_getRadioOperatingFrequencyBand` | -| `SupportedStandards` | ✅ | Comma-separated list (a/b/g/n/ac) | -| `OperatingStandards` | ✅ | `wifi_getRadioStandard` | -| `PossibleChannels` | ✅ | `wifi_getRadioPossibleChannels` | -| `AutoChannelEnable` | ✅ | `wifi_getRadioAutoChannelEnable` | -| `Channel` | ✅ | `wifi_getRadioChannel` | -| `TransmitPower` | ✅ | `wifi_getRadioTransmitPower` | -| `MACAddress` | ✅ | `wifi_getRadioBaseBSSID` | -| `MaxBitRate` | ✅ | `wifi_getRadioMaxBitRate` | - -### `Device.WiFi.SSID.{i}` - -| Parameter | GET | Notes | -|-----------|-----|-------| -| `Enable` | ✅ | `wifi_getSSIDEnable` | -| `Status` | ✅ | `wifi_getSSIDStatus` | -| `Name` | ✅ | `wifi_getSSIDIfName` | -| `BSSID` | ✅ | `wifi_getBaseBSSID` | -| `MACAddress` | ✅ | `wifi_getBaseBSSID` | -| `SSID` | ✅ | `wifi_getSSIDName` | - -### `Device.WiFi.AccessPoint.{i}` - -| Parameter | GET | SET | Notes | -|-----------|-----|-----|-------| -| `Enable`, `Status` | ✅ | ✅ | IARM / HAL | -| `SSIDReference` | ✅ | ❌ | Resolved from SSID instance | -| `SSIDAdvertisementEnabled` | ✅ | ✅ | Beacon SSID visibility | -| `WMMEnable` | ✅ | ✅ | WMM QoS | -| `AssociatedDeviceNumberOfEntries` | ✅ | ❌ | Count of connected clients | - -### `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming` - -| Parameter | GET | SET | Notes | -|-----------|-----|-----|-------| -| `Enable` | ✅ | ✅ | Band-steering global enable | -| `PreAssn5GProbeRetryLimit` | ✅ | ✅ | Pre-association retries before steering | -| `PreAssn5GProbeMinRSSI` | ✅ | ✅ | Min RSSI threshold to steer to 5GHz | -| `PostAssnLevelDeltaConnected` | ✅ | ✅ | Signal delta to trigger roam | -| `PostAssnLevelDeltaDisconnected` | ✅ | ✅ | Signal delta after disconnect | -| And many more 5G/2G roaming parameters | ✅ | ✅ | Full band-steering configuration set | - ---- - -## How Operations Work - -### RDKV_NM Build Path (IARM) - -```mermaid -sequenceDiagram - participant ACS - participant Dispatch - participant Radio as hostIf_WiFi_Radio - participant IARM as IARM Bus (WiFi Mgr) - - ACS->>Dispatch: GET Device.WiFi.Radio.1.Channel - Dispatch->>Radio: get_Device_WiFi_Radio_Channel(stMsgData) - Radio->>IARM: IARM_Bus_Call(IARM_BUS_NM_SRV_MGR_NAME,\n IARM_BUS_WIFI_MGR_API_getSSIDProps, param) - IARM-->>Radio: param.data.radioChannel - Radio->>Radio: put_uint(stMsgData->paramValue, channel) - Radio-->>Dispatch: OK - Dispatch-->>ACS: channel number -``` - -### Non-RDKV Build Path (JSON-RPC via WPEFramework) - -```mermaid -sequenceDiagram - participant ACS - participant Dispatch - participant Radio as hostIf_WiFi_Radio - participant CURL as libcurl - participant Thunder as WPEFramework Thunder - - ACS->>Dispatch: GET Device.WiFi.Radio.1.Channel - Dispatch->>Radio: get_Device_WiFi_Radio_Channel(stMsgData) - Radio->>CURL: getJsonRPCData(JSONRPC_URL, method="getChannel") - CURL->>Thunder: HTTP POST JSON-RPC request - Thunder-->>CURL: JSON response - CURL-->>Radio: parsed channel value - Radio->>Radio: put_uint(stMsgData->paramValue, channel) - Radio-->>Dispatch: OK - Dispatch-->>ACS: channel number -``` - ---- - -## Instance Lifecycle - -```mermaid -flowchart LR - GET["GET request
dev_id"] --> IFHASH[("ifHash
GHashTable")] - IFHASH -->|hit| RET[return cached instance] - IFHASH -->|miss| NEW["new hostIf_WiFi_*
dev_id"] - NEW --> IFHASH - RET --> HAL["Call IARM / JSON-RPC
per parameter"] -``` - ---- - -## Error Handling - -| Condition | Behavior | -|-----------|----------| -| `USE_WIFI_PROFILE` not defined | Entire profile excluded from build | -| IARM Bus call fails | Logs with IARM result code, returns `NOK` | -| JSON-RPC returns empty string | Returns `NOK`; paramValue empty | -| `cJSON_Parse` fails | Returns `NOK` | -| WiFi HAL function not available | Returns `NOK` | -| `WiFiDevice` constructor throws 1 | `getInstance()` catches, logs, returns `NULL` | - ---- - -## Known Issues and Gaps - -### Gap 1 — Critical: `WiFiDevice::ctxt` is uninitialized — constructor always throws - -**File**: `Device_WiFi.cpp` - -**Observation**: The `WiFiDevice` constructor: - -```cpp -WiFiDevice::WiFiDevice(int dev_id):dev_id(dev_id) -{ - // ctxt = WiFiCtl_Open(interface); // COMMENTED OUT - - if(!ctxt) // ctxt is uninitialized — always NULL - { - RDK_LOG(RDK_LOG_ERROR, ..., "Error! Unable to connect to WiFi Device instance %d\n", dev_id); - throw 1; - } -} -``` - -`ctxt` is never assigned (the initialization call is commented out). Since an uninitialized pointer is non-NULL on some platforms, this may or may not throw. But the subsequent `getContext()` returns the garbage pointer, which is then passed to the HAL. On platforms that zero-initialize global/static data, `ctxt == NULL`, and the constructor always throws, making `WiFiDevice` completely unusable. - -**Impact**: `WiFiDevice::getInstance()` catches the exception and inserts `NULL` into `devHash`. Any caller that dereferences the returned `WiFiDevice*` will crash. - -**Note**: The actual WiFi data path in many builds bypasses `WiFiDevice` entirely and goes directly via IARM or JSON-RPC. But `WiFiDevice` is still created during initialization. - ---- - -### Gap 2 — High: `WiFiDevice::init()` returns 1 for success, conflicting with its own comment - -**File**: `Device_WiFi.cpp` - -**Observation**: - -```cpp -//------------------------------------------------------------------------------ -// init: Returns 0 on success, -1 on failure. -//------------------------------------------------------------------------------ -int WiFiDevice::init() -{ - // Initialise the WiFi HAL - // ... (commented out) ... - return 1; // BUG: returns 1, comment says 0 is success -} -``` - -The comment documents `0` as success and `-1` as failure, but the function returns `1`. Callers that check `if (ret != 0) → error` would treat this successful return as an error. - ---- - -### Gap 3 — High: Non-RDKV build path relies on `getJsonRPCData()` which always returns an empty string - -**Observation**: The non-`RDKV_NM` build path uses `getJsonRPCData()` from `hostIf_utils.cpp` for retrieving WiFi parameters from WPEFramework. As documented in [src/hostif/docs/README.md](../../../docs/README.md#gap-8), `getJsonRPCData()` always returns an empty string because `writeCurlResponse()` takes its accumulation buffer by value. All non-RDKV WiFi GET parameters return empty or `NOK`. - ---- - -### Gap 4 — Medium: `AccessPointNumberOfEntries` and `EndPointNumberOfEntries` are hardcoded to 1 - -**File**: `Device_WiFi.cpp` (non-`RDKV_NM` build) - -**Observation**: In the `#ifndef RDKV_NM` path: - -```cpp -int hostIf_WiFi::get_Device_WiFi_AccessPointNumberOfEntries(HOSTIF_MsgData_t *stMsgData) -{ - unsigned int accessPointNumOfEntries = 1; // Always 1 - put_int(stMsgData->paramValue, accessPointNumOfEntries); - return OK; -} -``` - -Dual-band platforms with one 2.4 GHz and one 5 GHz access point (two SSIDs, two APs) return `1` instead of `2`. - ---- - -### Gap 5 — Medium: No unit tests - -**Observation**: There is no `gtest/` directory. The WiFi profile has 28 source files and 4,597+ lines of C++ with no automated test coverage. The dual build path (`RDKV_NM` vs. non-RDKV) makes testing complex. - ---- - -### Gap 6 — Medium: `ClientRoaming` SET parameters are written to HAL but the HAL API is not verified to persist them - -**File**: `Device_WiFi_X_RDKCENTRAL_COM_ClientRoaming.cpp` - -**Observation**: All SET handlers call `wifi_steering_setBandUtilizationThreshold()` or equivalent HAL functions. These functions write to an in-memory HAL state. On some RDK builds the HAL does not persist roaming parameters across reboots, and the values must be re-applied from the RFC store on every startup. If the RFC store is not also updated during the SET call, roaming configuration reverts after reboot. - ---- - -### Gap 7 — Low: `Security.PreSharedKey` and `Security.KeyPassphrase` are both exposed as readable parameters - -**File**: `Device_WiFi_AccessPoint_Security.cpp` - -**Observation**: Both `PreSharedKey` (raw hex PSK) and `KeyPassphrase` (WPA2 passphrase) are exposed via GET. Under the TR-181 specification, PSK and passphrase are write-only credentials that should not be returned to an ACS. Returning these values to any management system that can read TR-181 parameters exposes the network access credentials. - -**Recommended fix**: Return an empty string or a fixed placeholder on GET for all security credential parameters. - ---- - -## Platform Notes - -### Build Guard - -The entire WiFi profile is disabled when `USE_WIFI_PROFILE` is not defined. When disabled, `Device.WiFi.*` returns `NOT_HANDLED` for all parameters. - -### Dual Backend - -| Build Flag | Backend | Data Source | -|-----------|---------|-------------| -| `RDKV_NM` defined | IARM Bus | NM Service Manager WiFi Manager | -| `RDKV_NM` not defined | libcurl + cJSON | WPEFramework Thunder `DeviceInfo`/`WiFiManager` plugin JSON-RPC | - ---- - -## Testing - -There are currently no unit tests. When adding coverage: -1. Create IARM Bus stubs (`IARM_Bus_Call` mock). -2. Test Radio channel/frequency enumeration with multiple radio instances. -3. Test SSID enable/disable sequence. -4. Test AssociatedDevice table population with mock client list. -5. Test ClientRoaming parameter round-trip (SET then GET). - ---- - -## See Also - -- [src/hostif/docs/README.md](../../../docs/README.md) — Core daemon overview and `getJsonRPCData()` bug (Gap 8) -- [Device/docs/README.md](../../Device/docs/README.md) — WebPA server URL management -- [handlers/docs/README.md](../../../handlers/docs/README.md) — Dispatch layer diff --git a/src/hostif/src/hostIf_main.cpp b/src/hostif/src/hostIf_main.cpp index 432c1c82a..7db55c73e 100644 --- a/src/hostif/src/hostIf_main.cpp +++ b/src/hostif/src/hostIf_main.cpp @@ -41,10 +41,6 @@ #include "hostIf_updateHandler.h" #include "XrdkCentralComBSStore.h" -#if defined(USE_WIFI_PROFILE) -#include "Device_WiFi.h" -#endif - #include "libpd.h" #include #include @@ -368,10 +364,6 @@ int main(int argc, char *argv[]) } #endif - #if defined(USE_WIFI_PROFILE) - /* Perform the necessary operations to initialise the WiFi device */ - (void)WiFiDevice::init(); - #endif // g_get_current_time(&timeval); // char* logoutfile = (char *)LOG_FILE; #if 0 @@ -600,10 +592,6 @@ void exit_gracefully (int sig_received) #ifdef T2_EVENT_ENABLED t2_uninit(); #endif -#if defined(USE_WIFI_PROFILE) - /* Perform the necessary operations to shut down the WiFi device */ - WiFiDevice::shutdown(); -#endif #if defined(PARODUS_ENABLE) // Kill Parodus Thread diff --git a/src/integrationtest/conf/mgrlist.conf b/src/integrationtest/conf/mgrlist.conf index 41ad467fb..3a162b07d 100644 --- a/src/integrationtest/conf/mgrlist.conf +++ b/src/integrationtest/conf/mgrlist.conf @@ -6,7 +6,6 @@ Device.X_COMCAST-COM_Xcalibur xreMgr Device.Ethernet ethernetMgr Device.IP ipMgr Device.Time timeMgr -Device.WiFi wifiMgr Device.DHCPv4 dhcpv4Mgr Device.InterfaceStack ifStackMgr Device.X_RDK_WebConfig webConfigMgr diff --git a/test/functional-tests/features/tr69hostif_negative_tests.feature b/test/functional-tests/features/tr69hostif_negative_tests.feature index d8b66906a..7e09f3919 100644 --- a/test/functional-tests/features/tr69hostif_negative_tests.feature +++ b/test/functional-tests/features/tr69hostif_negative_tests.feature @@ -85,11 +85,6 @@ Feature: Negative and Edge Case Tests # Data Type Mismatches on SET # ========================================================================= - Scenario: SET boolean parameter with non-boolean string value - When I SET "Device.WiFi.Enable" to "notaboolean" as string via rbus - Then the rbus response should contain an error - # Expected: boolean type; provided string is not "true"/"false"/"0"/"1" - Scenario: SET integer parameter with alpha string When I SET "Device.Time.NTPMinpoll" to "abc" as integer via rbus Then the rbus response should contain an error @@ -156,12 +151,6 @@ Feature: Negative and Edge Case Tests # Thunder Plugin Unavailability # ========================================================================= - Scenario: GET Thunder-backed parameter when plugin is deactivated - Given the Thunder plugin "org.rdk.NetworkManager" is not activated - When I GET "Device.WiFi.SSID.1.BSSID" via rbus - Then the rbus response should contain an error or empty value - # Thunder invocation fails; handler should return error gracefully - Scenario: GET Thunder-backed parameter when Thunder is unreachable Given the Thunder service is not running on localhost:9998 When I GET "Device.DeviceInfo.X_RDKCENTRAL-COM_Experience" via rbus diff --git a/test/functional-tests/features/tr69hostif_thunder_plugins.feature b/test/functional-tests/features/tr69hostif_thunder_plugins.feature index 749283f8d..243a8c359 100644 --- a/test/functional-tests/features/tr69hostif_thunder_plugins.feature +++ b/test/functional-tests/features/tr69hostif_thunder_plugins.feature @@ -17,14 +17,6 @@ # limitations under the License. #################################################################################### -# Source: src/hostif/profiles/wifi/Device_WiFi.cpp -# Source: src/hostif/profiles/wifi/Device_WiFi_SSID.cpp -# Source: src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp -# Source: src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp -# Source: src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp -# Backing: Thunder JSON-RPC plugins (org.rdk.NetworkManager, org.rdk.AuthService, org.rdk.Account, org.rdk.MigrationPreparer) -# Build: WiFi conditional (WITH_WIFI_PROFILE); DeviceInfo always compiled - Feature: Thunder Plugin-Backed TR-181 Parameter Handlers Background: @@ -32,91 +24,6 @@ Feature: Thunder Plugin-Backed TR-181 Parameter Handlers And rbuscli is available on the system And Thunder plugins are activated and responding - # ========================================================================= - # org.rdk.NetworkManager — WiFi SSID parameters - # ========================================================================= - - Scenario: GET WiFi SSID BSSID via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.BSSID" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a valid MAC address format - # Thunder: org.rdk.NetworkManager.GetConnectedSSID → field "bssid" - - Scenario: GET WiFi SSID name via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.SSID" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a non-empty string - # Thunder: org.rdk.NetworkManager.GetConnectedSSID → field "ssid" - - Scenario: GET WiFi SSID.Name via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.Name" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a non-empty string - # Thunder: org.rdk.NetworkManager.GetConnectedSSID → field "ssid" - - Scenario: GET WiFi SSID MACAddress via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.MACAddress" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a valid MAC address format - # Thunder: org.rdk.NetworkManager.GetAvailableInterfaces → WIFI entry "mac" - - Scenario: GET WiFi SSID Enable via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.Enable" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a boolean value - # Thunder: org.rdk.NetworkManager.GetAvailableInterfaces → WIFI entry "enabled" - - Scenario: GET WiFi SSID Status via Thunder NetworkManager - When I GET "Device.WiFi.SSID.1.Status" via rbus - Then the rbus response should not contain an error - And the rbus response should contain one of "Up", "Down", "Error", "Disabled" - # Thunder: org.rdk.NetworkManager.GetWifiState → field "state" - - # ========================================================================= - # org.rdk.NetworkManager — WiFi EndPoint parameters - # ========================================================================= - - Scenario: GET WiFi EndPoint Enable via Thunder NetworkManager - When I GET "Device.WiFi.EndPoint.1.Enable" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a boolean value - # Thunder: org.rdk.NetworkManager.GetAvailableInterfaces → WIFI entry "enabled" - - Scenario: GET WiFi EndPoint Status via Thunder NetworkManager - When I GET "Device.WiFi.EndPoint.1.Status" via rbus - Then the rbus response should not contain an error - And the rbus response should contain one of "Enabled" or "Disabled" - # Thunder: org.rdk.NetworkManager.GetAvailableInterfaces → derived string - - Scenario: GET WiFi EndPoint SignalStrength via Thunder NetworkManager - When I GET "Device.WiFi.EndPoint.1.Stats.SignalStrength" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a numeric value - # Thunder: org.rdk.NetworkManager.GetConnectedSSID → field "strength" - - Scenario: GET WiFi EndPoint Security ModesEnabled via Thunder NetworkManager - When I GET "Device.WiFi.EndPoint.1.Security.ModesEnabled" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a non-empty string - # Thunder: org.rdk.NetworkManager.GetConnectedSSID → field "security" - - # ========================================================================= - # org.rdk.NetworkManager — WiFi top-level Enable - # ========================================================================= - - Scenario: GET WiFi Enable via Thunder NetworkManager - When I GET "Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable" via rbus - Then the rbus response should not contain an error - And the rbus response should contain a boolean value - # Thunder: org.rdk.NetworkManager.GetAvailableInterfaces → WIFI entry "enabled" - - Scenario: SET and GET WiFi Enable via Thunder NetworkManager - When I SET "Device.WiFi.Enable" to "false" as boolean via rbus - And I GET "Device.WiFi.Enable" via rbus - Then the rbus response should not contain an error - And the rbus response should contain "false" - # Thunder: org.rdk.NetworkManager.SetInterfaceState - # ========================================================================= # org.rdk.NetworkManager — DeviceInfo STB IP # ========================================================================= @@ -201,15 +108,3 @@ Feature: Thunder Plugin-Backed TR-181 Parameter Handlers | Device.DeviceInfo.X_RDKCENTRAL-COM_xAccount.HotelCheckout.Status | org.rdk.Account.getLastCheckoutResetTime | Device_DeviceInfo.cpp | | Device.DeviceInfo.X_RDKCENTRAL-COM_Migration.MigrationReady | org.rdk.MigrationPreparer.getComponentReadiness | Device_DeviceInfo.cpp | | Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.ReverseSSH.xOpsReverseSshTrigger | org.rdk.UserSettings.getPrivacyMode | Device_DeviceInfo.cpp | - | Device.WiFi.Enable | org.rdk.NetworkManager.SetInterfaceState | Device_WiFi.cpp | - | Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable | org.rdk.NetworkManager.GetAvailableInterfaces | Device_WiFi.cpp | - | Device.WiFi.SSID.{i}.BSSID | org.rdk.NetworkManager.GetConnectedSSID | Device_WiFi_SSID.cpp | - | Device.WiFi.SSID.{i}.SSID | org.rdk.NetworkManager.GetConnectedSSID | Device_WiFi_SSID.cpp | - | Device.WiFi.SSID.{i}.Name | org.rdk.NetworkManager.GetConnectedSSID | Device_WiFi_SSID.cpp | - | Device.WiFi.SSID.{i}.MACAddress | org.rdk.NetworkManager.GetAvailableInterfaces | Device_WiFi_SSID.cpp | - | Device.WiFi.SSID.{i}.Enable | org.rdk.NetworkManager.GetAvailableInterfaces | Device_WiFi_SSID.cpp | - | Device.WiFi.SSID.{i}.Status | org.rdk.NetworkManager.GetWifiState | Device_WiFi_SSID.cpp | - | Device.WiFi.EndPoint.{i}.Enable | org.rdk.NetworkManager.GetAvailableInterfaces | Device_WiFi_EndPoint.cpp | - | Device.WiFi.EndPoint.{i}.Status | org.rdk.NetworkManager.GetAvailableInterfaces | Device_WiFi_EndPoint.cpp | - | Device.WiFi.EndPoint.{i}.Stats.SignalStrength | org.rdk.NetworkManager.GetConnectedSSID | Device_WiFi_EndPoint.cpp | - | Device.WiFi.EndPoint.{i}.Security.ModesEnabled | org.rdk.NetworkManager.GetConnectedSSID | Device_WiFi_EndPoint_Security.cpp | diff --git a/test/functional-tests/tests/tr69hostif_networkmanager_endpoint_thunder_plugin.py b/test/functional-tests/tests/tr69hostif_networkmanager_endpoint_thunder_plugin.py deleted file mode 100644 index 04de917fd..000000000 --- a/test/functional-tests/tests/tr69hostif_networkmanager_endpoint_thunder_plugin.py +++ /dev/null @@ -1,113 +0,0 @@ -#################################################################################### -# If not stated otherwise in this file or this component's Licenses file the -# following copyright and licenses apply: -# -# Copyright 2024 RDK Management -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#################################################################################### - - -import pytest -from time import sleep - -from helper_functions import * - - -@pytest.mark.run(order=57) -def test_ThunderPlugin_WiFi_EndPoint_SignalStrength_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.EndPoint.1.Stats.SignalStrength" - WIFI_SIGNAL_STRENGTH_MSG = "67" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - SIGNAL_STRENGTH_MSG = "Stats.SignalStrength = [67]" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert SIGNAL_STRENGTH_MSG in grep_tr69hostiflogs(SIGNAL_STRENGTH_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_SIGNAL_STRENGTH_MSG in rstdout - -@pytest.mark.run(order=58) -def test_ThunderPlugin_WiFi_EndPoint_Security_ModesEnabled_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.EndPoint.1.Security.ModesEnabled" - WIFI_MODES_ENABLED_MSG = "1" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - SECURITY_MODE_MSG = "WiFi Security Mode : 1" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert SECURITY_MODE_MSG in grep_tr69hostiflogs(SECURITY_MODE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_MODES_ENABLED_MSG in rstdout - -@pytest.mark.run(order=59) -def test_ThunderPlugin_EndPoint_Status_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.EndPoint.1.Status" - STATUS_MSG = "Enabled" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert STATUS_MSG in rstdout - -@pytest.mark.run(order=60) -def test_ThunderPlugin_EndPoint_Enable_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.EndPoint.1.Enable" - WIFI_ENDPOINT_ENABLE_MSG = "true" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_ENDPOINT_ENABLE_MSG in rstdout - -@pytest.mark.run(order=61) -def test_ThunderPlugin_WiFiEnable_Set_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable" - WIFI_ENABLE_MSG = "false" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_set_data(DATA_ELEMENT_NAME, "boolean", WIFI_ENABLE_MSG) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_SUCCESS_STRING in rstdout - -@pytest.mark.run(order=62) -def test_ThunderPlugin_EndPoint_Disable_Status_Get_Handler(): - #clear_tr69hostiflogs() - sleep(2) - DATA_ELEMENT_NAME = "Device.WiFi.EndPoint.1.Status" - STATUS_MSG = "Disabled" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - ENDPOINT_DISABLED_MSG = "EndPoint is disabled" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert ENDPOINT_DISABLED_MSG in grep_tr69hostiflogs(ENDPOINT_DISABLED_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert STATUS_MSG in rstdout - -@pytest.mark.run(order=63) -def test_ThunderPlugin_WiFiEnable_Restore_Set_Handler(): - # Cleanup: restore WiFi state for any subsequent tests - DATA_ELEMENT_NAME = "Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable" - WIFI_ENABLE_MSG = "true" - - rstdout = rbus_set_data(DATA_ELEMENT_NAME, "boolean", WIFI_ENABLE_MSG) - assert RBUS_SUCCESS_STRING in rstdout - diff --git a/test/functional-tests/tests/tr69hostif_networkmanager_ssid_thunder_plugin.py b/test/functional-tests/tests/tr69hostif_networkmanager_ssid_thunder_plugin.py deleted file mode 100644 index ef4302a11..000000000 --- a/test/functional-tests/tests/tr69hostif_networkmanager_ssid_thunder_plugin.py +++ /dev/null @@ -1,115 +0,0 @@ -#################################################################################### -# If not stated otherwise in this file or this component's Licenses file the -# following copyright and licenses apply: -# -# Copyright 2024 RDK Management -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#################################################################################### - - -import pytest - -from helper_functions import * - -@pytest.mark.run(order=49) -def test_ThunderPlugin_WiFi_SSID_SSID_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.SSID" - WIFI_SSID_MSG = "WiFi_2.4G" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_SSID_MSG in rstdout - - -@pytest.mark.run(order=50) -def test_ThunderPlugin_WiFi_SSID_BSSID_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.BSSID" - WIFI_BSSID_MSG = "AA:BB:CC:DD:EE:FF" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_BSSID_MSG in rstdout - -@pytest.mark.run(order=51) -def test_ThunderPlugin_WiFi_SSID_Name_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.Name" - WIFI_NAME_MSG = "WiFi_2.4G" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_NAME_MSG in rstdout - -@pytest.mark.run(order=52) -def test_ThunderPlugin_WiFi_SSID_Enable_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.Enable" - WIFI_ENABLE_MSG = "true" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - ENABLE_MSG = "ENABLE = 1" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert ENABLE_MSG in grep_tr69hostiflogs(ENABLE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_ENABLE_MSG in rstdout - -@pytest.mark.run(order=53) -def test_ThunderPlugin_WiFi_SSID_MACAddress_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.MACAddress" - WIFI_MAC_MSG = "AA:BB:CC:DD:EE:01" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_MAC_MSG in rstdout - -@pytest.mark.run(order=54) -def test_ThunderPlugin_WiFi_SSID_Status_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.SSID.1.Status" - WIFI_STATUS_MSG = "CONNECTED" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - STATUS_MSG = "STATUS = CONNECTED" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert STATUS_MSG in grep_tr69hostiflogs(STATUS_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_STATUS_MSG in rstdout - - -@pytest.mark.run(order=55) -def test_ThunderPlugin_WiFiEnable_Get_Handler(): - #clear_tr69hostiflogs() - DATA_ELEMENT_NAME = "Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable" - WIFI_ENABLE_MSG = "true" - CURL_RESPONSE_MSG = "curl response : 0 http response code: 200" - - rstdout = rbus_get_data(DATA_ELEMENT_NAME) - assert CURL_RESPONSE_MSG in grep_tr69hostiflogs(CURL_RESPONSE_MSG) - assert RBUS_EXCEPTION_STRING not in rstdout - assert WIFI_ENABLE_MSG in rstdout - From 939df02601618f890fe42674b462d83a4e628179 Mon Sep 17 00:00:00 2001 From: Anand Date: Sat, 1 Aug 2026 15:28:15 +0000 Subject: [PATCH 2/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- cov_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cov_build.sh b/cov_build.sh index d66a1a6a8..ac438acec 100644 --- a/cov_build.sh +++ b/cov_build.sh @@ -92,9 +92,9 @@ cd $WORKDIR sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure.ac autoreconf -i -./configure --enable-IPv6=yes --enable-wifi=yes --enable-thunder=yes +./configure --enable-IPv6=yes --enable-thunder=yes -make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I$WORKDIR/src/hostif/profiles/wifi -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT -DUSE_WIFI_PROFILE -DMEDIA_CLIENT -DPRIVACYMODES_CONTROL" \ +make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT -DMEDIA_CLIENT -DPRIVACYMODES_CONTROL" \ AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER -DUSE_THUNDER_CLIENT" \ install From 3bb80e7591758b3f399686db52121fc8c81308e2 Mon Sep 17 00:00:00 2001 From: Anand Date: Sat, 1 Aug 2026 16:27:50 +0000 Subject: [PATCH 3/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- src/hostif/handlers/Makefile.am | 1 - src/hostif/handlers/include/hostIf_msgHandler.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/hostif/handlers/Makefile.am b/src/hostif/handlers/Makefile.am index d0fa76594..99014af4f 100644 --- a/src/hostif/handlers/Makefile.am +++ b/src/hostif/handlers/Makefile.am @@ -35,7 +35,6 @@ AM_CXXFLAGS = -I$(top_srcdir)/src/hostif/include \ -I$(top_srcdir)/src/hostif/profiles/StorageService \ -I$(PKG_CONFIG_SYSROOT_DIR)$(includedir)/rdk/iarmmgrs/sysmgr \ -I$(top_srcdir)/src/hostif/profiles/moca \ - -I$(top_srcdir)/src/hostif/profiles/wifi \ -I./include $(GLIB_CFLAGS) $(G_THREAD_CFLAGS) \ $(XREMGR_FLAGS) $(MOCAMGR_FLAGS) $(SOUP_CFLAGS) $(MOCA2_FLAG) \ $(XRDK_SDCARD_PROFILE_FLAG) $(XRDK_EMMC_PROFILE_FLAG) \ diff --git a/src/hostif/handlers/include/hostIf_msgHandler.h b/src/hostif/handlers/include/hostIf_msgHandler.h index 1852f8d00..a683406db 100644 --- a/src/hostif/handlers/include/hostIf_msgHandler.h +++ b/src/hostif/handlers/include/hostIf_msgHandler.h @@ -69,7 +69,6 @@ typedef enum _HostIf_ParamMgr HOSTIF_EthernetMgr, HOSTIF_IPMgr, HOSTIF_TimeMgr, - HOSTIF_WiFiMgr, HOSTIF_DHCPv4, HOSTIF_InterfaceStack, HOSTIF_TelemetryMgr, From 2bd4accc07cbd4dfbc0da7547e5907407612fb36 Mon Sep 17 00:00:00 2001 From: Anand Date: Sat, 1 Aug 2026 16:41:07 +0000 Subject: [PATCH 4/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- configure.ac | 4 ---- 1 file changed, 4 deletions(-) diff --git a/configure.ac b/configure.ac index 3cf4e6e61..6b4d1d47b 100644 --- a/configure.ac +++ b/configure.ac @@ -33,9 +33,7 @@ LT_INIT XREMGR_FLAGS=" " MOCAMGR_FLAGS=" " SUBDIRS_MOCA=" " -SUBDIRS_WIFI=" " MOCA2_FLAG=" " -WIFI_PROFILE_FLAGS=" " XRDK_SDCARD_PROFILE_FLAG=" " XRDK_EMMC_PROFILE_FLAG=" " SUBDIRS_STORAGESERVICE=" " @@ -429,12 +427,10 @@ AC_SUBST(PROFILE_SRC) AC_SUBST(XREMGR_FLAGS) AC_SUBST(MOCAMGR_FLAGS) AC_SUBST(SUBDIRS_MOCA) -AC_SUBST(SUBDIRS_WIFI) AC_SUBST(SUBDIRS_STORAGESERVICE) AC_SUBST(SUBDIRS_DHCPv4) AC_SUBST(SUBDIRS_INTFSTACK) AC_SUBST(MOCA2_FLAG) -AC_SUBST(WIFI_PROFILE_FLAG) AC_SUBST(XRDK_SDCARD_PROFILE_FLAG) AC_SUBST(XRDK_EMMC_PROFILE_FLAG) AC_SUBST(DHCPv4_PROFILE_FLAG) From a1a6bbed7c56e510f30967a6d06810ca88980d6a Mon Sep 17 00:00:00 2001 From: Anand Date: Mon, 3 Aug 2026 16:14:29 +0000 Subject: [PATCH 5/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- .github/README.md | 3 - README.md | 3 - conf/mgrlist.conf | 1 - conf/tr69hostIf.conf | 1 - docs/README.md | 1 - docs/api/dml_parameter_list.md | 223 +++++------------- docs/api/thunder-plugin-interfaces.md | 130 ---------- docs/architecture/data-flow.md | 1 - src/hostif/handlers/docs/README.md | 3 +- src/hostif/parodusClient/gtest/dm_test.cpp | 32 --- src/hostif/parodusClient/waldb/waldb.cpp | 4 +- src/hostif/src/gtest/gtest_src.cpp | 18 -- .../stubs/rbus/src/rbus/rbus_subscriptions.h | 8 +- .../stubs/rbus/src/rbus/rbus_tokenchain.h | 2 +- .../stubs/rbus/src/rtmessage/rtRoutingTree.h | 4 +- test/docs/L2_Test_Coverage.md | 138 +---------- 16 files changed, 71 insertions(+), 501 deletions(-) diff --git a/.github/README.md b/.github/README.md index dce9e48cf..c682e6d50 100644 --- a/.github/README.md +++ b/.github/README.md @@ -118,7 +118,6 @@ sequenceDiagram | Handler | IARM Bus Manager Token | TR-181 Subtree | |---------|----------------------|----------------| | `hostIf_DeviceClient_ReqHandler` | `deviceMgr` | `Device.DeviceInfo.*` | -| `hostIf_WiFi_ReqHandler` | `wifiMgr` | `Device.WiFi.*` | | `hostIf_EthernetClient_ReqHandler` | `ethernetMgr` | `Device.Ethernet.*` | | `hostIf_IPClient_ReqHandler` | `ipMgr` | `Device.IP.*` | | `hostIf_MoCAClient_ReqHandler` | `mocaMgr` | `Device.MoCA.*` | @@ -140,7 +139,6 @@ Each subdirectory implements one or more TR-181 objects. Profiles contain the bu | Profile Directory | TR-181 Object | Key Dependencies | |-------------------|---------------|-----------------| | `DeviceInfo/` | `Device.DeviceInfo` | IARM, rfcapi, rfcdefaults, partners\_defaults.json | -| `wifi/` | `Device.WiFi` | wifihal (libwifi) | | `Ethernet/` | `Device.Ethernet` | sysfs, IARM | | `IP/` | `Device.IP` | netlink / sysfs | | `moca/` | `Device.MoCA` | IARM mocaMgr | @@ -263,7 +261,6 @@ Device.MoCA=mocaMgr Device.Ethernet=ethernetMgr Device.IP=ipMgr Device.Time=timeMgr -Device.WiFi=wifiMgr [HOSTIF_JSON_CONFIG] PORT=10999 diff --git a/README.md b/README.md index cc9b382d2..a5aca8d7a 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,6 @@ sequenceDiagram | Handler | IARM Bus Manager Token | TR-181 Subtree | |---------|----------------------|----------------| | `hostIf_DeviceClient_ReqHandler` | `deviceMgr` | `Device.DeviceInfo.*` | -| `hostIf_WiFi_ReqHandler` | `wifiMgr` | `Device.WiFi.*` | | `hostIf_EthernetClient_ReqHandler` | `ethernetMgr` | `Device.Ethernet.*` | | `hostIf_IPClient_ReqHandler` | `ipMgr` | `Device.IP.*` | | `hostIf_MoCAClient_ReqHandler` | `mocaMgr` | `Device.MoCA.*` | @@ -151,7 +150,6 @@ Each subdirectory implements one or more TR-181 objects. Profiles contain the bu | Profile Directory | TR-181 Object | Key Dependencies | |-------------------|---------------|-----------------| | `DeviceInfo/` | `Device.DeviceInfo` | IARM, rfcapi, rfcdefaults, partners\_defaults.json | -| `wifi/` | `Device.WiFi` | wifihal (libwifi) | | `Ethernet/` | `Device.Ethernet` | sysfs, IARM | | `IP/` | `Device.IP` | netlink / sysfs | | `moca/` | `Device.MoCA` | IARM mocaMgr | @@ -274,7 +272,6 @@ Device.MoCA=mocaMgr Device.Ethernet=ethernetMgr Device.IP=ipMgr Device.Time=timeMgr -Device.WiFi=wifiMgr [HOSTIF_JSON_CONFIG] PORT=10999 diff --git a/conf/mgrlist.conf b/conf/mgrlist.conf index 460444df1..2513af850 100644 --- a/conf/mgrlist.conf +++ b/conf/mgrlist.conf @@ -6,7 +6,6 @@ Device.X_COMCAST-COM_Xcalibur xreMgr Device.Ethernet ethernetMgr Device.IP ipMgr Device.Time timeMgr -Device.WiFi wifiMgr Device.DHCPv4 dhcpv4Mgr Device.InterfaceStack ifStackMgr Device.X_RDK_WebConfig webConfigMgr diff --git a/conf/tr69hostIf.conf b/conf/tr69hostIf.conf index 08c317648..b550e758e 100644 --- a/conf/tr69hostIf.conf +++ b/conf/tr69hostIf.conf @@ -8,7 +8,6 @@ Device.X_COMCAST-COM_Xcalibur.TRM=xreMgr Device.Ethernet=ethernetMgr Device.IP=ipMgr Device.Time=timeMgr -Device.WiFi=wifiMgr [HOSTIF_JSON_CONFIG] PORT=10999 [HOSTIF_CONFIG] diff --git a/docs/README.md b/docs/README.md index 29df3fe08..c9c5ade8f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -62,7 +62,6 @@ The `tr69hostif` module depends on a mix of middleware services, platform-facing | WebPA gateway | Remote management plane that uses the Parodus integration path | | Parodus daemon | Local broker service required for WebPA request and notification exchange | | Device Settings / DS HAL | Backing implementation for `STBService` and selected device state queries | -| WiFi HAL / WiFi manager | Backing implementation for the `Device.WiFi.*` profile | | MoCA HAL | Backing implementation for the `Device.MoCA.*` profile when enabled | | systemd notify | Optional readiness signaling for service startup integration | diff --git a/docs/api/dml_parameter_list.md b/docs/api/dml_parameter_list.md index aa62bf98e..a4edbcdab 100755 --- a/docs/api/dml_parameter_list.md +++ b/docs/api/dml_parameter_list.md @@ -753,165 +753,64 @@ | 739 | `Device.Time.NTPServer5Directive` | readWrite | string | Chrony directive used for the numbered NTP server slot. | | 740 | `Device.Time.Status` | readWrite | string | Current status of the system time service. | | 741 | `Device.Time.X_RDK_CurrentUTCTime` | readOnly | string | Current UTC time reported by the device. | -| 742 | `Device.WiFi.AccessPoint.{i}.Alias` | readWrite | string | User-assigned alias for this Wi-Fi access point. | -| 743 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.Active` | readOnly | boolean | Indicates whether the related entry is currently active. | -| 744 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.AuthenticationState` | readOnly | boolean | Configuration or status value for this associated Wi-Fi client. | -| 745 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.LastDataDownlinkRate` | readOnly | unsignedInt | Configuration or status value for this associated Wi-Fi client. | -| 746 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.LastDataUplinkRate` | readOnly | unsignedInt | Configuration or status value for this associated Wi-Fi client. | -| 747 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.MACAddress` | readOnly | string | MAC address associated with this associated Wi-Fi client. | -| 748 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.Retransmissions` | readOnly | unsignedInt | Configuration or status value for this associated Wi-Fi client. | -| 749 | `Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.SignalStrength` | readOnly | int | Signal strength reported for the related entry. | -| 750 | `Device.WiFi.AccessPoint.{i}.AssociatedDeviceNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this Wi-Fi access point. | -| 751 | `Device.WiFi.AccessPoint.{i}.Enable` | readWrite | boolean | Enables or disables this Wi-Fi access point. | -| 752 | `Device.WiFi.AccessPoint.{i}.RetryLimit` | readWrite | unsignedInt | Configuration or status value for this Wi-Fi access point. | -| 753 | `Device.WiFi.AccessPoint.{i}.SSIDAdvertisementEnabled` | readWrite | boolean | Controls whether this access point advertises its SSID. | -| 754 | `Device.WiFi.AccessPoint.{i}.SSIDReference` | readWrite | string | Reference to the SSID object used by this entry. | -| 755 | `Device.WiFi.AccessPoint.{i}.Security.KeyPassphrase` | readWrite | string | Passphrase configured for the related Wi-Fi profile. | -| 756 | `Device.WiFi.AccessPoint.{i}.Security.ModeEnabled` | readWrite | string | Security mode currently enabled for the related Wi-Fi object. | -| 757 | `Device.WiFi.AccessPoint.{i}.Security.ModesSupported` | readOnly | string | Security modes supported by the related Wi-Fi object. | -| 758 | `Device.WiFi.AccessPoint.{i}.Security.PreSharedKey` | readWrite | hexBinary | Pre-shared key configured for the related Wi-Fi object. | -| 759 | `Device.WiFi.AccessPoint.{i}.Security.RadiusSecret` | readWrite | string | Shared secret or password used by this Wi-Fi access point. | -| 760 | `Device.WiFi.AccessPoint.{i}.Security.RadiusServerIPAddr` | readWrite | string | RADIUS server IP address used by this access point. | -| 761 | `Device.WiFi.AccessPoint.{i}.Security.RadiusServerPort` | readWrite | unsignedInt | Port value used by this Wi-Fi access point. | -| 762 | `Device.WiFi.AccessPoint.{i}.Security.RekeyingInterval` | readWrite | unsignedInt | Key rekey interval for this Wi-Fi security profile. | -| 763 | `Device.WiFi.AccessPoint.{i}.Security.WEPKey` | readWrite | hexBinary | WEP key configured for the related Wi-Fi object. | -| 764 | `Device.WiFi.AccessPoint.{i}.Status` | readOnly | string | Current status of this Wi-Fi access point. | -| 765 | `Device.WiFi.AccessPoint.{i}.UAPSDCapability` | readOnly | boolean | U-APSD capability or enable state for this access point. | -| 766 | `Device.WiFi.AccessPoint.{i}.UAPSDEnable` | readWrite | boolean | U-APSD capability or enable state for this access point. | -| 767 | `Device.WiFi.AccessPoint.{i}.WMMCapability` | readOnly | boolean | WMM capability or enable state for this access point. | -| 768 | `Device.WiFi.AccessPoint.{i}.WMMEnable` | readWrite | boolean | WMM capability or enable state for this access point. | -| 769 | `Device.WiFi.AccessPoint.{i}.WPS.ConfigMethodsEnabled` | readWrite | string | WPS configuration methods enabled or supported for the related Wi-Fi object. | -| 770 | `Device.WiFi.AccessPoint.{i}.WPS.ConfigMethodsSupported` | readOnly | string | WPS configuration methods enabled or supported for the related Wi-Fi object. | -| 771 | `Device.WiFi.AccessPoint.{i}.WPS.Enable` | readWrite | boolean | Enables or disables this Wi-Fi access point. | -| 772 | `Device.WiFi.AccessPointNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this object. | -| 773 | `Device.WiFi.EndPoint.{i}.Alias` | readWrite | string | User-assigned alias for this Wi-Fi endpoint. | -| 774 | `Device.WiFi.EndPoint.{i}.Enable` | readWrite | boolean | Enables or disables this Wi-Fi endpoint. | -| 775 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Alias` | readWrite | string | User-assigned alias for this Wi-Fi endpoint profile. | -| 776 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Enable` | readWrite | boolean | Enables or disables this Wi-Fi endpoint profile. | -| 777 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Location` | readWrite | string | Location hint associated with this Wi-Fi endpoint profile. | -| 778 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Priority` | readWrite | unsignedInt | Scheduling priority for this Wi-Fi endpoint profile. | -| 779 | `Device.WiFi.EndPoint.{i}.Profile.{i}.SSID` | readWrite | string | SSID string used by the related Wi-Fi object. | -| 780 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Security.KeyPassphrase` | readWrite | string | Passphrase configured for the related Wi-Fi profile. | -| 781 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Security.ModeEnabled` | readWrite | string | Security mode currently enabled for the related Wi-Fi object. | -| 782 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Security.PreSharedKey` | readWrite | hexBinary | Pre-shared key configured for the related Wi-Fi object. | -| 783 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Security.WEPKey` | readWrite | hexBinary | WEP key configured for the related Wi-Fi object. | -| 784 | `Device.WiFi.EndPoint.{i}.Profile.{i}.Status` | readOnly | string | Current status of this Wi-Fi endpoint profile. | -| 785 | `Device.WiFi.EndPoint.{i}.ProfileNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this Wi-Fi endpoint. | -| 786 | `Device.WiFi.EndPoint.{i}.ProfileReference` | readWrite | string | Reference to the active Wi-Fi endpoint profile. | -| 787 | `Device.WiFi.EndPoint.{i}.SSIDReference` | readOnly | string | Reference to the SSID object used by this entry. | -| 788 | `Device.WiFi.EndPoint.{i}.Security.ModesEnabled` | readOnly | string | Security mode currently enabled for the related Wi-Fi object. | -| 789 | `Device.WiFi.EndPoint.{i}.Security.ModesSupported` | readOnly | string | Security modes supported by the related Wi-Fi object. | -| 790 | `Device.WiFi.EndPoint.{i}.Stats.LastDataDownlinkRate` | readOnly | unsignedInt | Most recent downlink data rate for this Wi-Fi endpoint. | -| 791 | `Device.WiFi.EndPoint.{i}.Stats.LastDataUplinkRate` | readOnly | unsignedInt | Most recent uplink data rate for this Wi-Fi endpoint. | -| 792 | `Device.WiFi.EndPoint.{i}.Stats.Retransmissions` | readOnly | unsignedInt | Retransmission count observed for this Wi-Fi endpoint. | -| 793 | `Device.WiFi.EndPoint.{i}.Stats.SignalStrength` | readOnly | int | Reported signal strength for this Wi-Fi endpoint. | -| 794 | `Device.WiFi.EndPoint.{i}.Status` | readOnly | string | Current status of this Wi-Fi endpoint. | -| 795 | `Device.WiFi.EndPoint.{i}.WPS.ConfigMethodsEnabled` | readWrite | string | WPS configuration methods enabled or supported for the related Wi-Fi object. | -| 796 | `Device.WiFi.EndPoint.{i}.WPS.ConfigMethodsSupported` | readOnly | string | WPS configuration methods enabled or supported for the related Wi-Fi object. | -| 797 | `Device.WiFi.EndPoint.{i}.WPS.Enable` | readWrite | boolean | Enables or disables this Wi-Fi endpoint. | -| 798 | `Device.WiFi.EndPointNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this object. | -| 799 | `Device.WiFi.Radio.{i}.OperatingChannelBandwidth` | readOnly | string | Current operating channel bandwidth of this Wi-Fi radio. | -| 800 | `Device.WiFi.Radio.{i}.Stats.Noise` | readOnly | int | Reported noise floor for this Wi-Fi radio. | -| 801 | `Device.WiFi.Radio.{i}.Stats.PacketsReceived` | readOnly | unsignedLong | Total packets received on this Wi-Fi radio. | -| 802 | `Device.WiFi.RadioNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this object. | -| 803 | `Device.WiFi.SSID.{i}.Alias` | readWrite | string | User-assigned alias for this SSID interface. | -| 804 | `Device.WiFi.SSID.{i}.BSSID` | readOnly | string | BSSID reported for this SSID interface. | -| 805 | `Device.WiFi.SSID.{i}.Enable` | readWrite | boolean | Enables or disables this SSID interface. | -| 806 | `Device.WiFi.SSID.{i}.LastChange` | readOnly | unsignedInt | Seconds since this SSID interface last changed state. | -| 807 | `Device.WiFi.SSID.{i}.LowerLayers` | readWrite | string | Lower-layer interface references for this SSID interface. | -| 808 | `Device.WiFi.SSID.{i}.MACAddress` | readOnly | string | MAC address associated with this SSID interface. | -| 809 | `Device.WiFi.SSID.{i}.Name` | readOnly | string | Name reported for this SSID interface. | -| 810 | `Device.WiFi.SSID.{i}.SSID` | readWrite | string | SSID string used by the related Wi-Fi object. | -| 811 | `Device.WiFi.SSID.{i}.Stats.BroadcastPacketsReceived` | readOnly | unsignedLong | Broadcast packets received on this SSID interface. | -| 812 | `Device.WiFi.SSID.{i}.Stats.BroadcastPacketsSent` | readOnly | unsignedLong | Broadcast packets sent on this SSID interface. | -| 813 | `Device.WiFi.SSID.{i}.Stats.BytesReceived` | readOnly | unsignedLong | Total bytes received on this SSID interface. | -| 814 | `Device.WiFi.SSID.{i}.Stats.BytesSent` | readOnly | unsignedLong | Total bytes sent on this SSID interface. | -| 815 | `Device.WiFi.SSID.{i}.Stats.DiscardPacketsReceived` | readOnly | unsignedInt | Received packets discarded on this SSID interface. | -| 816 | `Device.WiFi.SSID.{i}.Stats.DiscardPacketsSent` | readOnly | unsignedInt | Outbound packets discarded on this SSID interface. | -| 817 | `Device.WiFi.SSID.{i}.Stats.ErrorsReceived` | readOnly | unsignedInt | Receive errors seen on this SSID interface. | -| 818 | `Device.WiFi.SSID.{i}.Stats.ErrorsSent` | readOnly | unsignedInt | Transmit errors seen on this SSID interface. | -| 819 | `Device.WiFi.SSID.{i}.Stats.MulticastPacketsReceived` | readOnly | unsignedLong | Multicast packets received on this SSID interface. | -| 820 | `Device.WiFi.SSID.{i}.Stats.MulticastPacketsSent` | readOnly | unsignedLong | Multicast packets sent on this SSID interface. | -| 821 | `Device.WiFi.SSID.{i}.Stats.PacketsReceived` | readOnly | unsignedLong | Total packets received on this SSID interface. | -| 822 | `Device.WiFi.SSID.{i}.Stats.PacketsSent` | readOnly | unsignedLong | Total packets sent on this SSID interface. | -| 823 | `Device.WiFi.SSID.{i}.Stats.UnicastPacketsReceived` | readOnly | unsignedLong | Unicast packets received on this SSID interface. | -| 824 | `Device.WiFi.SSID.{i}.Stats.UnicastPacketsSent` | readOnly | unsignedLong | Unicast packets sent on this SSID interface. | -| 825 | `Device.WiFi.SSID.{i}.Stats.UnknownProtoPacketsReceived` | readOnly | unsignedInt | Packets with unknown protocol received on this SSID interface. | -| 826 | `Device.WiFi.SSID.{i}.Status` | readOnly | string | Current status of this SSID interface. | -| 827 | `Device.WiFi.SSIDNumberOfEntries` | readOnly | unsignedInt | Reports the number of entries in this object. | -| 828 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.80211kvrEnable` | readWrite | boolean | Enables or disables 802.11k/v/r roaming support. | -| 829 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.Enable` | readWrite | boolean | Enables or disables the Wi-Fi client roaming policy. | -| 830 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolBeaconsMissedTime` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 831 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolThresholdLevel` | readWrite | int | Band-steering threshold or control used by the client roaming policy. | -| 832 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_APcontrolTimeframe` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 833 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BackOffTime` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 834 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelConnected` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 835 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_BestDeltaLevelDisconnected` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 836 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerBeaconsMissedTime` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 837 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerThresholdLevel` | readWrite | int | Band-steering threshold or control used by the client roaming policy. | -| 838 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PostAssn_SelfSteerTimeframe` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 839 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestDeltaLevel` | readWrite | unsignedInt | Band-steering threshold or control used by the client roaming policy. | -| 840 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.PreAssn_BestThresholdLevel` | readWrite | int | Band-steering threshold or control used by the client roaming policy. | -| 841 | `Device.WiFi.X_RDKCENTRAL-COM_ClientRoaming.SelfSteer_OverrideEnable` | readWrite | boolean | Band-steering threshold or control used by the client roaming policy. | -| 842 | `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | readWrite | boolean | Master enable for the Wi-Fi subsystem. | -| 843 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssDeviceId` | readOnly | string | Security system device identifier. | -| 844 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssDeviceReg` | readOnly | dateTime | Security system device registration time. | -| 845 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssErrorCnt` | readOnly | unsignedInt | Security system error count. | -| 846 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssRegTs` | readOnly | boolean | Indicates whether a security system registration timestamp is available. | -| 847 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreAppId` | readOnly | string | Application identifier for this XRE connection entry. | -| 848 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnEstTs` | readOnly | string | Connection establishment timestamp for this XRE connection entry. | -| 849 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnIfName` | readOnly | string | Interface name used by this XRE connection entry. | -| 850 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnRetryAttempts` | readOnly | unsignedInt | Retry attempts recorded for this XRE connection entry. | -| 851 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnStatus` | readOnly | string | Current status of this XRE connection entry. | -| 852 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnURL` | readOnly | string | Connection URL used by this XRE connection entry. | -| 853 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreAvgCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | -| 854 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreChannelMapId` | readOnly | string | Channel map identifier currently used by the XRE client. | -| 855 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreCommandCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 856 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreControllerId` | readOnly | string | Controller identifier reported by the XRE client. | -| 857 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreEnable` | readWrite | boolean | Enables or disables the XRE client. | -| 858 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreErrorCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 859 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreFlushLocalCache` | readWrite | boolean | Triggers an XRE local cache flush when set. | -| 860 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreGatewaySTBMAC` | readOnly | string | Gateway STB MAC address reported by the XRE client. | -| 861 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreGetTWPDiags` | readOnly | string | Diagnostic payload returned by XRE TWP diagnostics. | -| 862 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLastURLAccessed` | readOnly | string | Last URL accessed by the XRE client. | -| 863 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLastVideoUrl` | readOnly | string | Last video URL accessed by the XRE client. | -| 864 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLogLevel` | readWrite | string | Logging level used by the XRE client. | -| 865 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreMaxCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | -| 866 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreMinCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | -| 867 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xrePlantId` | readOnly | string | Plant identifier reported by the XRE client. | -| 868 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreReceiverId` | readOnly | string | Receiver identifier reported by the XRE client. | -| 869 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreRefreshXreSession` | readWrite | boolean | Triggers XRE session refresh behavior. | -| 870 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreRefreshXreSessionWithRR` | readWrite | int | Controls refresh-with-RR behavior for the XRE session. | -| 871 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionId` | readOnly | string | Active XRE session identifier reported by the client. | -| 872 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionLastModTs` | readOnly | string | Timestamp of the last XRE session update. | -| 873 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionUptime` | readOnly | string | Uptime of the current XRE session. | -| 874 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreStatus` | readOnly | string | Configuration or status value for the XRE client. | -| 875 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotAnimCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 876 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotAppCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 877 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotFlashCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 878 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotFontCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 879 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotHtmlTxtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 880 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotImgCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 881 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotNineSliceImgCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 882 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotRectCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 883 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotSoundCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 884 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotStyleshtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 885 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotTxtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 886 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotTxtIpCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 887 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotVideoCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 888 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotViewCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | -| 889 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreVersion` | readOnly | string | Version string reported by the XRE client. | -| 890 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreVodId` | readOnly | string | VOD identifier reported by the XRE client. | -| 891 | `Device.X_COMCAST-COM_Xcalibur.Client.xconfCheckNow` | readWrite | string | Triggers an immediate Xconf check for the Xcalibur client. | -| 892 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppNumAps` | readOnly | unsignedInt | Number of DevApp application entries reported by the platform. | -| 893 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppTable.{i}.devAppId` | readOnly | string | Application identifier for this DevApp entry. | -| 894 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppTable.{i}.devAppRestartCapability` | readOnly | string | Restart capability reported for this DevApp entry. | -| 895 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayDeviceFriendlyName` | readOnly | string | Gateway identification value reported by TRM. | -| 896 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayMoCAIP` | readOnly | string | Gateway identification value reported by TRM. | -| 897 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayMoCAMAC` | readOnly | string | Gateway identification value reported by TRM. | -| 898 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewaySTBMAC` | readOnly | string | Gateway identification value reported by TRM. | -| 899 | `Device.X_RDKCENTRAL-COM_T2.ReportProfiles` | readWrite | string | Telemetry 2.0 report profiles payload. | -| 900 | `Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack` | readWrite | string | Telemetry 2.0 report profiles payload. | -| 901 | `Device.X_RDK_WebPA_DNSText.URL` | readWrite | string | Bootstrap URL used to retrieve WebPA DNS text records. | -| 902 | `Device.X_RDK_WebPA_Server.URL` | readOnly | string | Current WebPA server URL from the bootstrap store. | -| 903 | `Device.X_RDK_WebPA_TokenServer.URL` | readOnly | string | Current WebPA token server URL from the bootstrap store. | +| 742 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssDeviceId` | readOnly | string | Security system device identifier. | +| 743 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssDeviceReg` | readOnly | dateTime | Security system device registration time. | +| 744 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssErrorCnt` | readOnly | unsignedInt | Security system error count. | +| 745 | `Device.X_COMCAST-COM_Xcalibur.Client.SecuritySystem.ssRegTs` | readOnly | boolean | Indicates whether a security system registration timestamp is available. | +| 746 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreAppId` | readOnly | string | Application identifier for this XRE connection entry. | +| 747 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnEstTs` | readOnly | string | Connection establishment timestamp for this XRE connection entry. | +| 748 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnIfName` | readOnly | string | Interface name used by this XRE connection entry. | +| 749 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnRetryAttempts` | readOnly | unsignedInt | Retry attempts recorded for this XRE connection entry. | +| 750 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnStatus` | readOnly | string | Current status of this XRE connection entry. | +| 751 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.ConnectionTable.xreConnURL` | readOnly | string | Connection URL used by this XRE connection entry. | +| 752 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreAvgCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | +| 753 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreChannelMapId` | readOnly | string | Channel map identifier currently used by the XRE client. | +| 754 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreCommandCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 755 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreControllerId` | readOnly | string | Controller identifier reported by the XRE client. | +| 756 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreEnable` | readWrite | boolean | Enables or disables the XRE client. | +| 757 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreErrorCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 758 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreFlushLocalCache` | readWrite | boolean | Triggers an XRE local cache flush when set. | +| 759 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreGatewaySTBMAC` | readOnly | string | Gateway STB MAC address reported by the XRE client. | +| 760 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreGetTWPDiags` | readOnly | string | Diagnostic payload returned by XRE TWP diagnostics. | +| 761 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLastURLAccessed` | readOnly | string | Last URL accessed by the XRE client. | +| 762 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLastVideoUrl` | readOnly | string | Last video URL accessed by the XRE client. | +| 763 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreLogLevel` | readWrite | string | Logging level used by the XRE client. | +| 764 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreMaxCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | +| 765 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreMinCmdProcTime` | readOnly | int | Command processing time statistic reported by XRE. | +| 766 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xrePlantId` | readOnly | string | Plant identifier reported by the XRE client. | +| 767 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreReceiverId` | readOnly | string | Receiver identifier reported by the XRE client. | +| 768 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreRefreshXreSession` | readWrite | boolean | Triggers XRE session refresh behavior. | +| 769 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreRefreshXreSessionWithRR` | readWrite | int | Controls refresh-with-RR behavior for the XRE session. | +| 770 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionId` | readOnly | string | Active XRE session identifier reported by the client. | +| 771 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionLastModTs` | readOnly | string | Timestamp of the last XRE session update. | +| 772 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreSessionUptime` | readOnly | string | Uptime of the current XRE session. | +| 773 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreStatus` | readOnly | string | Configuration or status value for the XRE client. | +| 774 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotAnimCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 775 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotAppCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 776 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotFlashCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 777 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotFontCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 778 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotHtmlTxtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 779 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotImgCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 780 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotNineSliceImgCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 781 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotRectCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 782 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotSoundCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 783 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotStyleshtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 784 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotTxtCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 785 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotTxtIpCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 786 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotVideoCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 787 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreTotViewCnt` | readOnly | unsignedInt | Count metric reported by the XRE client. | +| 788 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreVersion` | readOnly | string | Version string reported by the XRE client. | +| 789 | `Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreVodId` | readOnly | string | VOD identifier reported by the XRE client. | +| 790 | `Device.X_COMCAST-COM_Xcalibur.Client.xconfCheckNow` | readWrite | string | Triggers an immediate Xconf check for the Xcalibur client. | +| 791 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppNumAps` | readOnly | unsignedInt | Number of DevApp application entries reported by the platform. | +| 792 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppTable.{i}.devAppId` | readOnly | string | Application identifier for this DevApp entry. | +| 793 | `Device.X_COMCAST-COM_Xcalibur.DevApp.devAppTable.{i}.devAppRestartCapability` | readOnly | string | Restart capability reported for this DevApp entry. | +| 794 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayDeviceFriendlyName` | readOnly | string | Gateway identification value reported by TRM. | +| 795 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayMoCAIP` | readOnly | string | Gateway identification value reported by TRM. | +| 796 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewayMoCAMAC` | readOnly | string | Gateway identification value reported by TRM. | +| 797 | `Device.X_COMCAST-COM_Xcalibur.TRM.trmGatewaySTBMAC` | readOnly | string | Gateway identification value reported by TRM. | +| 798 | `Device.X_RDKCENTRAL-COM_T2.ReportProfiles` | readWrite | string | Telemetry 2.0 report profiles payload. | +| 799 | `Device.X_RDKCENTRAL-COM_T2.ReportProfilesMsgPack` | readWrite | string | Telemetry 2.0 report profiles payload. | +| 800 | `Device.X_RDK_WebPA_DNSText.URL` | readWrite | string | Bootstrap URL used to retrieve WebPA DNS text records. | +| 801 | `Device.X_RDK_WebPA_Server.URL` | readOnly | string | Current WebPA server URL from the bootstrap store. | +| 802 | `Device.X_RDK_WebPA_TokenServer.URL` | readOnly | string | Current WebPA token server URL from the bootstrap store. | diff --git a/docs/api/thunder-plugin-interfaces.md b/docs/api/thunder-plugin-interfaces.md index c84d1669b..40e84a6c8 100644 --- a/docs/api/thunder-plugin-interfaces.md +++ b/docs/api/thunder-plugin-interfaces.md @@ -206,21 +206,6 @@ string getJsonRPCData(std::string postData); |------------------|-----|-----------------|----------------|----------------| | `Device.DeviceInfo.X_COMCAST-COM_STB_IP` | GET | `get_Device_DeviceInfo_X_COMCAST_COM_STB_IP()` | `GetPrimaryInterface` → `GetIPSettings` | `result.interface` → `result.ipaddress` | | `Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.ReverseSSH.xOpsReverseSshArgs` | SET | `set_xOpsReverseSshArgs()` | `GetPrimaryInterface` → `GetIPSettings` | `result.ipaddress` | -| `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | GET | `get_Device_WiFi_EnableWiFi()` | `GetAvailableInterfaces` | `interfaces[WIFI].enabled` | -| `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | SET | `set_Device_WiFi_EnableWiFi()` | `EnableInterface` / `DisableInterface` | `result.success` | -| `Device.WiFi.SSID.{i}.BSSID` | GET | `get_Device_WiFi_SSID_BSSID()` | `GetConnectedSSID` | `result.bssid` | -| `Device.WiFi.SSID.{i}.SSID` | GET | `get_Device_WiFi_SSID_SSID()` | `GetConnectedSSID` | `result.ssid` | -| `Device.WiFi.SSID.{i}.Name` | GET | `get_Device_WiFi_SSID_Name()` | `GetConnectedSSID` | `result.ssid` | -| `Device.WiFi.SSID.{i}.Enable` | GET | `get_Device_WiFi_SSID_Enable()` | `GetAvailableInterfaces` | `interfaces[WIFI].enabled` | -| `Device.WiFi.SSID.{i}.MACAddress` | GET | `get_Device_WiFi_SSID_MACAddress()` | `GetAvailableInterfaces` | `interfaces[WIFI].mac` | -| `Device.WiFi.SSID.{i}.Status` | GET | `get_Device_WiFi_SSID_Status()` | `GetWifiState` | `result.state` (mapped to string) | -| `Device.WiFi.Endpoint.{i}.Enable` | GET | `get_Device_WiFi_EndPoint_Enable()` | `GetAvailableInterfaces` ¹ | `interfaces[WIFI].enabled` | -| `Device.WiFi.Endpoint.{i}.Status` | GET | `get_Device_WiFi_EndPoint_Status()` | `GetAvailableInterfaces` ¹ | derived from `enabled` | -| `Device.WiFi.Endpoint.{i}.SSIDReference` | GET | `get_Device_WiFi_EndPoint_SSIDReference()` | `GetConnectedSSID` | `result.ssid` | -| `Device.WiFi.Endpoint.{i}.Stats.SignalStrength` | GET | `get_Device_WiFi_EndPoint_Stats_SignalStrength()` | `GetConnectedSSID` | `result.strength` | -| `Device.WiFi.Endpoint.{i}.Security.ModesEnabled` | GET | `get_hostIf_WiFi_EndPoint_Security_ModesEnabled()` | `GetConnectedSSID` | `result.securityMode` | - -> ¹ `Device_WiFi_EndPoint.cpp` calls the versioned form `org.rdk.NetworkManager.1.GetAvailableInterfaces`. #### GetPrimaryInterface @@ -263,104 +248,6 @@ Returns IP configuration for a named interface. --- -#### GetAvailableInterfaces - -Returns all network interfaces with type, MAC, and enabled state. - -**Request:** -```json -{ - "jsonrpc": "2.0", - "id": "42", - "method": "org.rdk.NetworkManager.GetAvailableInterfaces" -} -``` - -**Response fields used (WIFI array element):** - -| Field | Type | Description | -|-------|------|-------------| -| `type` | string | Interface type — match on `"WIFI"` | -| `mac` | string | MAC address | -| `enabled` | bool/int | Whether the interface is active | - -**TR-181 use:** -- `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` GET -- `Device.WiFi.SSID.{i}.Enable`, `Device.WiFi.SSID.{i}.MACAddress` -- `Device.WiFi.Endpoint.{i}.Enable`, `Device.WiFi.Endpoint.{i}.Status` - ---- - -#### GetConnectedSSID - -Returns details of the currently associated Wi-Fi network. - -**Request:** -```json -{ - "jsonrpc": "2.0", - "id": "42", - "method": "org.rdk.NetworkManager.GetConnectedSSID" -} -``` - -**Response fields used:** - -| Field | Type | Description | -|-------|------|-------------| -| `ssid` | string | Connected SSID name | -| `bssid` | string | Access point BSSID | -| `strength` | number | Signal strength | -| `securityMode` | string | Security mode (e.g. `"WPA2"`) | - -**TR-181 use:** -- `Device.WiFi.SSID.{i}.SSID`, `Device.WiFi.SSID.{i}.BSSID`, `Device.WiFi.SSID.{i}.Name` -- `Device.WiFi.Endpoint.{i}.SSIDReference`, `Device.WiFi.Endpoint.{i}.Stats.SignalStrength` -- `Device.WiFi.Endpoint.{i}.Security.ModesEnabled` - ---- - -#### GetWifiState - -Returns an integer state code for the Wi-Fi subsystem. - -**Request:** -```json -{ - "jsonrpc": "2.0", - "id": "42", - "method": "org.rdk.NetworkManager.GetWifiState" -} -``` - -**Response fields used:** `result.state` (number — mapped to string status) - -**TR-181 use:** `Device.WiFi.SSID.{i}.Status` - ---- - -#### EnableInterface / DisableInterface - -Enables or disables the Wi-Fi interface. - -**Request (enable):** -```json -{ - "jsonrpc": "2.0", - "id": "42", - "method": "org.rdk.NetworkManager.EnableInterface", - "params": { "type": "WIFI" } -} -``` - -**Request (disable):** same with `"DisableInterface"`. - -**Response fields used:** `result.success` (bool) - -**TR-181 use:** `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` SET handler. - ---- - ### org.rdk.AuthService **Used in:** [Device_DeviceInfo.cpp](../../src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp) @@ -584,11 +471,6 @@ sequenceDiagram |--------|--------|---------------------|-----| | `org.rdk.NetworkManager` | `GetPrimaryInterface` | `Device.DeviceInfo.X_COMCAST-COM_STB_IP` *(intermediate)* | GET | | `org.rdk.NetworkManager` | `GetIPSettings` | `Device.DeviceInfo.X_COMCAST-COM_STB_IP`
`…xOpsReverseSshArgs` | GET | -| `org.rdk.NetworkManager` | `GetAvailableInterfaces` | `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable`
`Device.WiFi.SSID.{i}.Enable`
`Device.WiFi.SSID.{i}.MACAddress`
`Device.WiFi.Endpoint.{i}.Enable`
`Device.WiFi.Endpoint.{i}.Status` | GET | -| `org.rdk.NetworkManager` | `GetConnectedSSID` | `Device.WiFi.SSID.{i}.SSID`
`Device.WiFi.SSID.{i}.BSSID`
`Device.WiFi.SSID.{i}.Name`
`Device.WiFi.Endpoint.{i}.SSIDReference`
`Device.WiFi.Endpoint.{i}.Stats.SignalStrength`
`Device.WiFi.Endpoint.{i}.Security.ModesEnabled` | GET | -| `org.rdk.NetworkManager` | `GetWifiState` | `Device.WiFi.SSID.{i}.Status` | GET | -| `org.rdk.NetworkManager` | `EnableInterface` | `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | SET | -| `org.rdk.NetworkManager` | `DisableInterface` | `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | SET | | `org.rdk.AuthService` | `setPartnerId` | `Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.PartnerId` | SET | | `org.rdk.AuthService` | `getServiceAccountId` | `Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AccountInfo.AccountID` | GET | | `org.rdk.AuthService` | `getExperience` | `Device.DeviceInfo.X_RDKCENTRAL-COM_Experience` | GET | @@ -609,18 +491,6 @@ sequenceDiagram | 7 | `Device.DeviceInfo.MigrationPreparer.MigrationReady` | MigrationPreparer | getComponentReadiness | GET | — | | 8 | `Device.DeviceInfo.X_RDKCENTRAL-COM_xAccount.HotelCheckout.LastResetTime` | Account | getLastCheckoutResetTime | GET | — | | 9 | `Device.DeviceInfo.X_RDKCENTRAL-COM_xAccount.HotelCheckout.Status` | Account | getLastCheckoutResetTime | GET | — | -| 10 | `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | NetworkManager | GetAvailableInterfaces / Enable\|DisableInterface | GET+SET | `!RDKV_NM` | -| 11 | `Device.WiFi.SSID.{i}.BSSID` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | -| 12 | `Device.WiFi.SSID.{i}.SSID` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | -| 13 | `Device.WiFi.SSID.{i}.Name` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | -| 14 | `Device.WiFi.SSID.{i}.Enable` | NetworkManager | GetAvailableInterfaces | GET | `!RDKV_NM` | -| 15 | `Device.WiFi.SSID.{i}.MACAddress` | NetworkManager | GetAvailableInterfaces | GET | `!RDKV_NM` | -| 16 | `Device.WiFi.SSID.{i}.Status` | NetworkManager | GetWifiState | GET | `!RDKV_NM` | -| 17 | `Device.WiFi.Endpoint.{i}.Enable` | NetworkManager | GetAvailableInterfaces ¹ | GET | `!RDKV_NM` | -| 18 | `Device.WiFi.Endpoint.{i}.Status` | NetworkManager | GetAvailableInterfaces ¹ | GET | `!RDKV_NM` | -| 19 | `Device.WiFi.Endpoint.{i}.SSIDReference` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | -| 20 | `Device.WiFi.Endpoint.{i}.Stats.SignalStrength` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | -| 21 | `Device.WiFi.Endpoint.{i}.Security.ModesEnabled` | NetworkManager | GetConnectedSSID | GET | `!RDKV_NM` | > ¹ Uses versioned method `org.rdk.NetworkManager.1.GetAvailableInterfaces`. diff --git a/docs/architecture/data-flow.md b/docs/architecture/data-flow.md index 6c2400f98..b4afb40fe 100644 --- a/docs/architecture/data-flow.md +++ b/docs/architecture/data-flow.md @@ -32,7 +32,6 @@ The manager map is configured in `conf/tr69hostIf.conf` and test environments co | `Device.Ethernet` | `ethernetMgr` | | `Device.IP` | `ipMgr` | | `Device.Time` | `timeMgr` | -| `Device.WiFi` | `wifiMgr` | If no manager owns the parameter path, the request fails through the normal fault-code path and the caller sees an invalid-parameter-style result. diff --git a/src/hostif/handlers/docs/README.md b/src/hostif/handlers/docs/README.md index 6b57eca63..fdf60e333 100644 --- a/src/hostif/handlers/docs/README.md +++ b/src/hostif/handlers/docs/README.md @@ -84,7 +84,7 @@ At runtime, the dispatcher builds a prefix-to-manager map from the configured ho - `hostIf_initalize_ConfigManger()` parses a whitespace-delimited mapping file. - `hostIf_ConfigProperties_Init()` parses grouped key/value configuration using GLib `GKeyFile`. -Both paths populate `paramMgrhash`, which maps parameter prefixes such as `Device.DeviceInfo.` or `Device.WiFi.` to a `HostIf_ParamMgr_t` enum. `HostIf_GetMgr()` then scans the configured prefixes and returns the singleton manager that owns the requested subtree. +Both paths populate `paramMgrhash`, which maps parameter prefixes such as `Device.DeviceInfo.` to a `HostIf_ParamMgr_t` enum. `HostIf_GetMgr()` then scans the configured prefixes and returns the singleton manager that owns the requested subtree. ### Request Flow @@ -190,7 +190,6 @@ These classes own specific TR-181 areas or integration namespaces and are the ob | `EthernetClientReqHandler` | `Device.Ethernet.Interface.*` and `Device.Ethernet.Interface.{i}.Stats.*` | Handles Ethernet interface state, alias, lower-layer relationships, bitrate, duplex mode, and per-interface statistics; also tracks interface count changes for event reporting | | `IPClientReqHandler` | `Device.IP.*`, `Device.IP.Interface.*`, `IPv4Address`, optional `IPv6Address`, `ActivePort`, and diagnostics | Dispatches IP stack, interface, address, and active-port reads; when built with optional flags it also covers IPv6 and speed-test related objects; maintains cached entry counts for update detection | | `TimeClientReqHandler` | `Device.Time.*` | Handles time enablement, Chrony/NTP settings, NTP directive parameters, and bootstrap-sensitive time parameters through `hostIf_Time` | -| `WiFiReqHandler` | `Device.WiFi.*` including Radio, SSID, AccessPoint, EndPoint, WPS, Security, Stats, and optional client roaming | Manages the broad WiFi subtree, supports WiFi global enable and roaming-related SETs, closes all WiFi object instances on shutdown, and tracks object counts for radios, SSIDs, and endpoints | | `MoCAClientReqHandler` | `Device.MoCA.Interface.*`, QoS, associated devices, stats, and mesh-table related objects | Handles MoCA interface configuration such as enable, alias, privacy, keying, power limits, QoS-related objects, and mesh-entry tracking when the MoCA profile is enabled | | `DHCPv4ClientReqHandler` | `Device.DHCPv4.Client.*` | Read-only handler in practice for the current code path; returns client interface references, routers, and DNS servers, and reports the client entry count | | `InterfaceStackClientReqHandler` | `Device.InterfaceStack.*` | Read-only handler that exposes higher-layer and lower-layer relationships between interfaces and reports `InterfaceStackNumberOfEntries` | diff --git a/src/hostif/parodusClient/gtest/dm_test.cpp b/src/hostif/parodusClient/gtest/dm_test.cpp index 9439ef873..d97ad81c5 100644 --- a/src/hostif/parodusClient/gtest/dm_test.cpp +++ b/src/hostif/parodusClient/gtest/dm_test.cpp @@ -286,11 +286,6 @@ TEST(datamodelTest, isParamEndsWithInstance_NullInput) { EXPECT_EQ(instance, 1); } -TEST(datamodelTest, getNumberOfDigitsInInstanceNumber) { - int instance = getNumberOfDigitsInInstanceNumber("Device.WiFi.SSID.123.Name", 17); - EXPECT_EQ(instance, 3); -} - TEST(datamodelTest, getNumberOfDigitsInInstanceNumber_NullInput) { int instance = getNumberOfDigitsInInstanceNumber(NULL, 0); EXPECT_EQ(instance, 0); @@ -1125,16 +1120,6 @@ TEST(palTest, set_AttribValues_tr69hostIf) { EXPECT_EQ(status, WAL_SUCCESS); } -TEST(palTest, getParamAttributes) { - - const char *paramName = "Device.WiFi.SSID.1.SSID"; - AttrVal **attributes = NULL; - int totalParams = 0; - - WAL_STATUS status = getParamAttributesFunc()(paramName, &attributes, &totalParams); - EXPECT_EQ(status, WAL_ERR_INVALID_PARAM); -} - TEST(palTest, getParamAttributes_NullInputs) { AttrVal **attributes = NULL; int totalParams = 0; @@ -1144,15 +1129,6 @@ TEST(palTest, getParamAttributes_NullInputs) { EXPECT_EQ(getParamAttributesFunc()("Device.DeviceInfo.ModelName", &attributes, NULL), WAL_ERR_INVALID_PARAM); } -TEST(palTest, setParamAttributes) { - - const char *paramName = "Device.WiFi.SSID.1.SSID"; - AttrVal attr; - - WAL_STATUS status = setParamAttributesFunc()(paramName, &attr); - EXPECT_EQ(status, WAL_SUCCESS); -} - TEST(palTest, setParamAttributes_notifyList) { std::remove("/tmp/notify.conf"); const char* json_data = R"({"Notify":["Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.Enable","Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.TopSpeed"]})"; @@ -1306,14 +1282,6 @@ TEST(palTest, replaceWithInstanceNumber) { EXPECT_STREQ(paramName, "Device.DeviceInfo.XXXX.{i}"); } -TEST(palTest, appendNextObject) { - char currentParam[100] = "Device.WiFi.{i}.SSID."; - const char* pAttparam = "Device.WiFi.{i}.SSID.Enable"; - appendNextObject(currentParam, pAttparam); - - EXPECT_STREQ(currentParam, "Device.WiFi.{i}.SSID.Enable"); -} - TEST(palTest, test_get_complete_param_list) { test_get_complete_param_list(); EXPECT_EQ(0, 0); diff --git a/src/hostif/parodusClient/waldb/waldb.cpp b/src/hostif/parodusClient/waldb/waldb.cpp index a3a666434..184ad0d56 100644 --- a/src/hostif/parodusClient/waldb/waldb.cpp +++ b/src/hostif/parodusClient/waldb/waldb.cpp @@ -808,7 +808,7 @@ int getParamInfoFromDataModel(void *dbhandle,const char *paramName, DataModelPar doc = (XMLDocument *) dbhandle; - /* Check if Parameter is one of {i} entriesi ex:Device.WiFi.Radio.1.Status should become Device.WiFi.Radio.{i}.Status */ + /* Check if Parameter is one of {i} entries */ std::string str(paramName); std::size_t found = str.find_first_of("0123456789"); if(found != std::string::npos) @@ -1091,7 +1091,7 @@ void test_get_complete_param_list() RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"======================================================================\n"); DataModelParam dmParam = {0}; - const char *pParameterName = "Device.WiFi.EndPoint.1.Profile.1.Status"; + const char *pParameterName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.DistributedTracing.Enable"; if (getParamInfoFromDataModel(g_dbhandle, pParameterName, &dmParam)) { diff --git a/src/hostif/src/gtest/gtest_src.cpp b/src/hostif/src/gtest/gtest_src.cpp index 989cbff9f..5ec9eb4e8 100644 --- a/src/hostif/src/gtest/gtest_src.cpp +++ b/src/hostif/src/gtest/gtest_src.cpp @@ -271,15 +271,6 @@ TEST(srcTest, set_get_LegacyRFCEnabled) { EXPECT_EQ(status, true); } -TEST(srcTest, matchComponent) { - const char* param = "Device.WiFi.SSID.3.SSID"; - const char* key = "Device.WiFi.SSID"; - const char* setting = nullptr; - int instance = 0; - bool matched = matchComponent(param, key, &setting, instance); - EXPECT_EQ(matched, true); -} - TEST(srcTest, getJsonRPCData) { std::string jsonRequest = "{\"jsonrpc\":\"2.0\",\"method\":\"getTime\",\"params\":{},\"id\":1}"; string result = getJsonRPCData(jsonRequest); @@ -665,15 +656,6 @@ TEST(srcTest, getenvOrDefaultReturnsDefaultWhenUnset) EXPECT_STREQ(result, "fallback"); } -TEST(srcTest, matchComponentInvalidPaths) -{ - const char* setting = nullptr; - int instance = 0; - - EXPECT_FALSE(matchComponent("Device.WiFi.SSID", "Device.WiFi.SSID", &setting, instance)); - EXPECT_FALSE(matchComponent("Device.WiFi.SSID.12345678901.SSID", "Device.WiFi.SSID", &setting, instance)); -} - TEST(srcTest, thunderFieldExtractorsRejectNullFieldName) { std::string strVal; diff --git a/src/unittest/stubs/rbus/src/rbus/rbus_subscriptions.h b/src/unittest/stubs/rbus/src/rbus/rbus_subscriptions.h index 48120a90f..fc5d00d5e 100644 --- a/src/unittest/stubs/rbus/src/rbus/rbus_subscriptions.h +++ b/src/unittest/stubs/rbus/src/rbus/rbus_subscriptions.h @@ -35,17 +35,15 @@ typedef struct _rbusSubscriptions *rbusSubscriptions_t; typedef struct _rbusSubscription { char* listener; /* the subscriber's address to publish to*/ - char* eventName; /* the event name subscribed to e.g. Device.WiFi.AccessPoint.1.AssociatedDevice.*.SignalStrength */ + char* eventName; /* the event name subscribed */ int32_t componentId; /* the id known by the subscriber and unique per listener/process */ rbusFilter_t filter; /* optional filter */ int32_t interval; /* optional interval */ int32_t duration; /* optional duration */ bool autoPublish; /* auto publishing */ TokenChain* tokens; /* tokenized eventName for pattern matching */ - elementNode* element; /* the registation element e.g. Device.WiFi.AccessPoint.{i}.AssociatedDevice.{i}.SignalStrength */ - rtList instances; /* the instance elements e.g. Device.WiFi.AccessPoint.1.AssociatedDevice.1.SignalStrength - Device.WiFi.AccessPoint.1.AssociatedDevice.2.SignalStrength - Device.WiFi.AccessPoint.2.AssociatedDevice.1.SignalStrength */ + elementNode* element; /* the registation element */ + rtList instances; /* the instance elements */ } rbusSubscription_t; /*create a new subscriptions registry for an rbus handle*/ diff --git a/src/unittest/stubs/rbus/src/rbus/rbus_tokenchain.h b/src/unittest/stubs/rbus/src/rbus/rbus_tokenchain.h index 6fbd075e4..b700ab24d 100644 --- a/src/unittest/stubs/rbus/src/rbus/rbus_tokenchain.h +++ b/src/unittest/stubs/rbus/src/rbus/rbus_tokenchain.h @@ -36,7 +36,7 @@ typedef enum TokenType typedef struct Token { - char* text; /* text of token. e.g. the 'WiFi' in 'Device.WiFi.Radio.1' */ + char* text; /* text of token. */ elementNode* node; /* the corresponding registration node in the element tree */ TokenType type; /* type of expression used to identify a row instance*/ struct Token* prev; /* the previous token in list */ diff --git a/src/unittest/stubs/rbus/src/rtmessage/rtRoutingTree.h b/src/unittest/stubs/rbus/src/rtmessage/rtRoutingTree.h index 1ba21a1f9..7594a258d 100644 --- a/src/unittest/stubs/rbus/src/rtmessage/rtRoutingTree.h +++ b/src/unittest/stubs/rbus/src/rtmessage/rtRoutingTree.h @@ -87,10 +87,10 @@ rbus_getExt is called with parameter = "Device.". This is a partial path query. rbus_resolveWildcardDestinations ("Device.") is called which leads to rtrouted calling rtree_get_uniquely_resolvable_endpoints_for_expression("Device.") - Assume Component A has Device.WiFi and a bunch of stuff under it. + Assume Component A has Device.IP and a bunch of stuff under it. Assume Component B has Device.Moca and a bunch of stuff under it. rbus_resolveWildcardDestinations should return 2 topic names. - One topic name for Component A, which could be Device.WiFi or any topic name under Device.WiFi (e.g. Device.WiFi.A.B.C) as it + One topic name for Component A, which could be Device.IP or any topic name under Device.IP (e.g. Device.IP.A.B.C) as it doesn't matter. And a second topic for component B being Device.Moca or something inside that. Lets call these returned topics, destinationTopics. diff --git a/test/docs/L2_Test_Coverage.md b/test/docs/L2_Test_Coverage.md index 6155e615e..d3a972e1f 100644 --- a/test/docs/L2_Test_Coverage.md +++ b/test/docs/L2_Test_Coverage.md @@ -445,139 +445,6 @@ All 15 handlers are now covered by `tr69hostif_storageservice.py` (orders 344– --- -### Gap 6 — Device.WiFi (zero coverage — build flag `WITH_WIFI_PROFILE`) - -Source: `src/hostif/profiles/wifi/Device_WiFi*.h` - -#### Device.WiFi top-level - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.RadioNumberOfEntries` | `get_Device_WiFi_RadioNumberOfEntries` | GET | -| `Device.WiFi.SSIDNumberOfEntries` | `get_Device_WiFi_SSIDNumberOfEntries` | GET | -| `Device.WiFi.AccessPointNumberOfEntries` | `get_Device_WiFi_AccessPointNumberOfEntries` | GET | -| `Device.WiFi.EndPointNumberOfEntries` | `get_Device_WiFi_EndPointNumberOfEntries` | GET | -| `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | `get_Device_WiFi_EnableWiFi` | GET | -| `Device.WiFi.X_RDKCENTRAL-COM_WiFiEnable` | `set_Device_WiFi_EnableWiFi` | SET | - -#### Device.WiFi.Radio.{i} - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.Radio.{i}.Enable` | `get_Device_WiFi_Radio_Enable` / `set_Device_WiFi_Radio_Enable` | GET+SET | -| `Device.WiFi.Radio.{i}.Status` | `get_Device_WiFi_Radio_Status` | GET | -| `Device.WiFi.Radio.{i}.Alias` | `get_Device_WiFi_Radio_Alias` / `set_Device_WiFi_Radio_Alias` | GET+SET | -| `Device.WiFi.Radio.{i}.Name` | `get_Device_WiFi_Radio_Name` | GET | -| `Device.WiFi.Radio.{i}.LastChange` | `get_Device_WiFi_Radio_LastChange` | GET | -| `Device.WiFi.Radio.{i}.LowerLayers` | `get_Device_WiFi_Radio_LowerLayers` / `set_Device_WiFi_Radio_LowerLayers` | GET+SET | -| `Device.WiFi.Radio.{i}.Upstream` | `get_Device_WiFi_Radio_Upstream` | GET | -| `Device.WiFi.Radio.{i}.MaxBitRate` | `get_Device_WiFi_Radio_MaxBitRate` | GET | -| `Device.WiFi.Radio.{i}.SupportedFrequencyBands` | `get_Device_WiFi_Radio_SupportedFrequencyBands` | GET | -| `Device.WiFi.Radio.{i}.OperatingFrequencyBand` | `get_Device_WiFi_Radio_OperatingFrequencyBand` / `set_Device_WiFi_Radio_OperatingFrequencyBand` | GET+SET | -| `Device.WiFi.Radio.{i}.SupportedStandards` | `get_Device_WiFi_Radio_SupportedStandards` | GET | -| `Device.WiFi.Radio.{i}.OperatingStandards` | `get_Device_WiFi_Radio_OperatingStandards` / `set_Device_WiFi_Radio_OperatingStandards` | GET+SET | -| `Device.WiFi.Radio.{i}.PossibleChannels` | `get_Device_WiFi_Radio_PossibleChannels` | GET | -| `Device.WiFi.Radio.{i}.ChannelsInUse` | `get_Device_WiFi_Radio_ChannelsInUse` | GET | -| `Device.WiFi.Radio.{i}.Channel` | `get_Device_WiFi_Radio_Channel` / `set_Device_WiFi_Radio_Channel` | GET+SET | -| `Device.WiFi.Radio.{i}.AutoChannelSupported` | `get_Device_WiFi_Radio_AutoChannelSupported` | GET | -| `Device.WiFi.Radio.{i}.AutoChannelEnable` | `get_Device_WiFi_Radio_AutoChannelEnable` / `set_Device_WiFi_Radio_AutoChannelEnable` | GET+SET | -| `Device.WiFi.Radio.{i}.AutoChannelRefreshPeriod` | `get_Device_WiFi_Radio_AutoChannelRefreshPeriod` / `set_Device_WiFi_Radio_AutoChannelRefreshPeriod` | GET+SET | -| `Device.WiFi.Radio.{i}.OperatingChannelBandwidth` | `get_Device_WiFi_Radio_OperatingChannelBandwidth` / `set_Device_WiFi_Radio_OperatingChannelBandwidth` | GET+SET | -| `Device.WiFi.Radio.{i}.ExtensionChannel` | `get_Device_WiFi_Radio_ExtensionChannel` / `set_Device_WiFi_Radio_ExtensionChannel` | GET+SET | -| `Device.WiFi.Radio.{i}.GuardInterval` | `get_Device_WiFi_Radio_GuardInterval` / `set_Device_WiFi_Radio_GuardInterval` | GET+SET | -| `Device.WiFi.Radio.{i}.MCS` | `get_Device_WiFi_Radio_MCS` / `set_Device_WiFi_Radio_MCS` | GET+SET | -| `Device.WiFi.Radio.{i}.TransmitPowerSupported` | `get_Device_WiFi_Radio_TransmitPowerSupported` | GET | -| `Device.WiFi.Radio.{i}.TransmitPower` | `get_Device_WiFi_Radio_TransmitPower` / `set_Device_WiFi_Radio_TransmitPower` | GET+SET | -| `Device.WiFi.Radio.{i}.IEEE80211hSupported` | `get_Device_WiFi_Radio_IEEE80211hSupported` | GET | -| `Device.WiFi.Radio.{i}.IEEE80211hEnabled` | `get_Device_WiFi_Radio_IEEE80211hEnabled` / `set_Device_WiFi_Radio_IEEE80211hEnabled` | GET+SET | -| `Device.WiFi.Radio.{i}.RegulatoryDomain` | `get_Device_WiFi_Radio_RegulatoryDomain` / `set_Device_WiFi_Radio_RegulatoryDomain` | GET+SET | - -#### Device.WiFi.Radio.{i}.Stats - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.Radio.{i}.Stats.BytesSent` | `get_Device_WiFi_Radio_Stats_BytesSent` | GET | -| `Device.WiFi.Radio.{i}.Stats.BytesReceived` | `get_Device_WiFi_Radio_Stats_BytesReceived` | GET | -| `Device.WiFi.Radio.{i}.Stats.PacketsSent` | `get_Device_WiFi_Radio_Stats_PacketsSent` | GET | -| `Device.WiFi.Radio.{i}.Stats.PacketsReceived` | `get_Device_WiFi_Radio_Stats_PacketsReceived` | GET | -| `Device.WiFi.Radio.{i}.Stats.ErrorsSent` | `get_Device_WiFi_Radio_Stats_ErrorsSent` | GET | -| `Device.WiFi.Radio.{i}.Stats.ErrorsReceived` | `get_Device_WiFi_Radio_Stats_ErrorsReceived` | GET | -| `Device.WiFi.Radio.{i}.Stats.DiscardPacketsSent` | `get_Device_WiFi_Radio_Stats_DiscardPacketsSent` | GET | -| `Device.WiFi.Radio.{i}.Stats.DiscardPacketsReceived` | `get_Device_WiFi_Radio_Stats_DiscardPacketsReceived` | GET | -| `Device.WiFi.Radio.{i}.Stats.NoiseFloor` | `get_Device_WiFi_Radio_Stats_NoiseFloor` | GET | - -#### Device.WiFi.SSID.{i} - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.SSID.{i}.Enable` | `get_Device_WiFi_SSID_Enable` / `set_Device_WiFi_SSID_Enable` | GET+SET | -| `Device.WiFi.SSID.{i}.Status` | `get_Device_WiFi_SSID_Status` | GET | -| `Device.WiFi.SSID.{i}.Alias` | `get_Device_WiFi_SSID_Alias` / `set_Device_WiFi_SSID_Alias` | GET+SET | -| `Device.WiFi.SSID.{i}.Name` | `get_Device_WiFi_SSID_Name` | GET | -| `Device.WiFi.SSID.{i}.LastChange` | `get_Device_WiFi_SSID_LastChange` | GET | -| `Device.WiFi.SSID.{i}.LowerLayers` | `get_Device_WiFi_SSID_LowerLayers` / `set_Device_WiFi_SSID_LowerLayers` | GET+SET | -| `Device.WiFi.SSID.{i}.BSSID` | `get_Device_WiFi_SSID_BSSID` | GET | -| `Device.WiFi.SSID.{i}.MACAddress` | `get_Device_WiFi_SSID_MACAddress` | GET | -| `Device.WiFi.SSID.{i}.SSID` | `get_Device_WiFi_SSID_SSID` / `set_Device_WiFi_SSID_SSID` | GET+SET | - -#### Device.WiFi.SSID.{i}.Stats - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.SSID.{i}.Stats.BytesSent` | `get_Device_WiFi_SSID_Stats_BytesSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.BytesReceived` | `get_Device_WiFi_SSID_Stats_BytesReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.PacketsSent` | `get_Device_WiFi_SSID_Stats_PacketsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.PacketsReceived` | `get_Device_WiFi_SSID_Stats_PacketsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.ErrorsSent` | `get_Device_WiFi_SSID_Stats_ErrorsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.ErrorsReceived` | `get_Device_WiFi_SSID_Stats_ErrorsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.UnicastPacketsSent` | `get_Device_WiFi_SSID_Stats_UnicastPacketsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.UnicastPacketsReceived` | `get_Device_WiFi_SSID_Stats_UnicastPacketsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.DiscardPacketsSent` | `get_Device_WiFi_SSID_Stats_DiscardPacketsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.DiscardPacketsReceived` | `get_Device_WiFi_SSID_Stats_DiscardPacketsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.MulticastPacketsSent` | `get_Device_WiFi_SSID_Stats_MulticastPacketsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.MulticastPacketsReceived` | `get_Device_WiFi_SSID_Stats_MulticastPacketsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.BroadcastPacketsSent` | `get_Device_WiFi_SSID_Stats_BroadcastPacketsSent` | GET | -| `Device.WiFi.SSID.{i}.Stats.BroadcastPacketsReceived` | `get_Device_WiFi_SSID_Stats_BroadcastPacketsReceived` | GET | -| `Device.WiFi.SSID.{i}.Stats.UnknownProtoPacketsReceived` | `get_Device_WiFi_SSID_Stats_UnknownProtoPacketsReceived` | GET | - -#### Device.WiFi.EndPoint.{i} - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `Device.WiFi.EndPoint.{i}.Enable` | `get_Device_WiFi_EndPoint_Enable` / `set_Device_WiFi_EndPoint_Enable` | GET+SET | -| `Device.WiFi.EndPoint.{i}.Status` | `get_Device_WiFi_EndPoint_Status` | GET | -| `Device.WiFi.EndPoint.{i}.Alias` | `get_Device_WiFi_EndPoint_Alias` / `set_Device_WiFi_EndPoint_Alias` | GET+SET | -| `Device.WiFi.EndPoint.{i}.ProfileReference` | `get_Device_WiFi_EndPoint_ProfileReference` / `set_Device_WiFi_EndPoint_ProfileReference` | GET+SET | -| `Device.WiFi.EndPoint.{i}.SSIDReference` | `get_Device_WiFi_EndPoint_SSIDReference` | GET | -| `Device.WiFi.EndPoint.{i}.ProfileNumberOfEntries` | `get_Device_WiFi_EndPoint_ProfileNumberOfEntries` | GET | -| `Device.WiFi.EndPoint.{i}.Stats.LastDataDownlinkRate` | `get_Device_WiFi_EndPoint_Stats_LastDataDownlinkRate` | GET | -| `Device.WiFi.EndPoint.{i}.Stats.LastDataUplinkRate` | `get_Device_WiFi_EndPoint_Stats_LastDataUplinkRate` | GET | -| `Device.WiFi.EndPoint.{i}.Stats.SignalStrength` | `get_Device_WiFi_EndPoint_Stats_SignalStrength` | GET | -| `Device.WiFi.EndPoint.{i}.Stats.Retransmissions` | `get_Device_WiFi_EndPoint_Stats_Retransmissions` | GET | -| `Device.WiFi.EndPoint.{i}.WPS.Enable` | `get_Device_WiFi_EndPoint_WPS_Enable` | GET | -| `Device.WiFi.EndPoint.{i}.WPS.ConfigMethodsSupported` | `get_Device_WiFi_EndPoint_WPS_ConfigMethodsSupported` | GET | -| `Device.WiFi.EndPoint.{i}.WPS.ConfigMethodsEnabled` | `get_Device_WiFi_EndPoint_WPS_ConfigMethodsEnabled` | GET | - -#### Device.WiFi.X_RDKCENTRAL-COM.ClientRoaming - -| TR-181 Parameter | Handler Function | Dir | -|---|---|---| -| `...ClientRoaming.Enable` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_Enable` | GET+SET | -| `...PreAssn.ProbeRetryCnt` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_ProbeRetryCnt` | GET+SET | -| `...PreAssn.BestThresholdLevel` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestThresholdLevel` | GET+SET | -| `...PreAssn.BestDeltaLevel` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PreAssn_BestDeltaLevel` | GET+SET | -| `...SelfSteerOverride` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_SelfSteerOverride` | GET+SET | -| `...PostAssn.BestDeltaLevelConnected` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelConnected` | GET+SET | -| `...PostAssn.BestDeltaLevelDisconnected` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_BestDeltaLevelDisconnected` | GET+SET | -| `...PostAssn.SelfSteerThreshold` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerThreshold` | GET+SET | -| `...PostAssn.SelfSteerTimeframe` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_SelfSteerTimeframe` | GET+SET | -| `...PostAssn.APcontrolThresholdLevel` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolThresholdLevel` | GET+SET | -| `...PostAssn.APcontrolTimeframe` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_PostAssn_APcontrolTimeframe` | GET+SET | -| `...postAssnBackOffTime` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_postAssnBackOffTime` | GET+SET | -| `...80211kvrEnable` | `get/set_Device_WiFi_X_Rdkcentral_clientRoaming_80211kvrEnable` | GET+SET | - ---- - ### Gap 7 — Device.Time (SET-side gaps) Source: `src/hostif/profiles/Time/Device_Time.h` @@ -690,8 +557,7 @@ runnable test functions to known handler surfaces. | 7 | **STBService** | `Device.Services.STBService.*` | 71 | 14 | **85** | ~1 | ~84 | ~1% | | 8 | **StorageService** | `Device.StorageService.*` | 15 | 0 | **15** | 15 | 0 | 100% | | 9 | **Time** | `Device.Time.*` | 20 | 17 | **37** | ~20 | ~17 | ~54% | -| 10 | **WiFi** | `Device.WiFi.*` | 132 | 21 | **153** | ~14 | ~139 | ~9% | -| 11 | **Device** | `Device.*` (misc) | 3 | 1 | **4** | 0 | 4 | 0% | +| 10 | **Device** | `Device.*` (misc) | 3 | 1 | **4** | 0 | 4 | 0% | | | **Parameter subtotal** | | **545** | **163** | **707** | **~336** | **~371** | **~48%** | --- @@ -756,7 +622,6 @@ planning baseline. Values remain approximate and are used for gap planning again | STBService | 71 | 14 | 85 | Partial | | StorageService | 15 | 0 | 15 | **Fully covered** | | Time | 20 | 17 | 37 | Improved | -| WiFi | 132 | 21 | 153 | Improved, still large surface | | Device (misc) | 3 | 1 | 4 | Partial | | Parameter subtotal | 545 | 163 | 707 | Planning baseline | @@ -777,7 +642,6 @@ Quick-reference table showing how much of each profile is still untested. | Profile | Tests Needed | Have | Missing | Primary Gap Areas | |---|:---:|:---:|:---:|---| -| `Device.WiFi.*` | 153 | ~14 | **~139** | Radio (27 params), SSID (9), SSID.Stats (15), EndPoint (13), ClientRoaming (13), AccessPoint (~20) | | `Device.MoCA.*` | 99 | 53 | **46** | AssociatedDevice (17), QoS (10), MeshTable (4), remaining interface params | | `Device.DeviceInfo.*` | 172 | ~151 | **~21** | RDKRemoteDebugger, Canary, MemoryStatus, UpTime, Description, ProductClass, ProcessorNumberOfEntries | | `Device.IP.*` | 106 | ~51 | **~55** | IPv4 SETs (6), IPv6Address/Prefix non-tested params, Interface.Stats SETs | From b8d1f76dc5c4c08dbc94fe0568e1eab9038870c7 Mon Sep 17 00:00:00 2001 From: Anand Date: Mon, 3 Aug 2026 16:45:34 +0000 Subject: [PATCH 6/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- .github/README.md | 2 -- README.md | 1 - docs/api/thunder-plugin-interfaces.md | 12 ------------ docs/architecture/json-usage.md | 8 +------- docs/architecture/threading-model.md | 21 ++++++++++----------- src/hostif/docs/README.md | 1 - src/hostif/parodusClient/waldb/waldb.cpp | 2 +- 7 files changed, 12 insertions(+), 35 deletions(-) diff --git a/.github/README.md b/.github/README.md index c682e6d50..7e54a8d66 100644 --- a/.github/README.md +++ b/.github/README.md @@ -293,7 +293,6 @@ The `[HOSTIF_DM_PROFILE_MGR]` section defines which manager handles each TR-181 | `--enable-t2` | `T2_EVENT_ENABLED` | Telemetry 2.0 markers | | `--enable-webconfig` | `WEB_CONFIG_ENABLED` | WebConfig multipart support | | `--enable-webconfig-lite` | `WEBCONFIG_LITE_ENABLE` | WebConfig Lite | -| `--enable-wifi` | `USE_WIFI_PROFILE` | WiFi profile handlers | | `--enable-moca` | *(moca linkage)* | MoCA profile handlers | ## Build & Install @@ -322,7 +321,6 @@ autoreconf -iv ./configure \ --enable-parodus \ --enable-rbus \ - --enable-wifi \ --enable-moca \ --enable-t2 diff --git a/README.md b/README.md index a5aca8d7a..26bda8d15 100644 --- a/README.md +++ b/README.md @@ -304,7 +304,6 @@ The `[HOSTIF_DM_PROFILE_MGR]` section defines which manager handles each TR-181 | `--enable-t2` | `T2_EVENT_ENABLED` | Telemetry 2.0 markers | | `--enable-webconfig` | `WEB_CONFIG_ENABLED` | WebConfig multipart support | | `--enable-webconfig-lite` | `WEBCONFIG_LITE_ENABLE` | WebConfig Lite | -| `--enable-wifi` | `USE_WIFI_PROFILE` | WiFi profile handlers | | `--enable-moca` | *(moca linkage)* | MoCA profile handlers | ## Build & Install diff --git a/docs/api/thunder-plugin-interfaces.md b/docs/api/thunder-plugin-interfaces.md index 40e84a6c8..7ecaae868 100644 --- a/docs/api/thunder-plugin-interfaces.md +++ b/docs/api/thunder-plugin-interfaces.md @@ -60,10 +60,6 @@ Representative handlers follow the same pattern: This pattern is present in multiple places, including: - [src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp](../../src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp) -- [src/hostif/profiles/wifi/Device_WiFi.cpp](../../src/hostif/profiles/wifi/Device_WiFi.cpp) -- [src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp) -- [src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp) -- [src/hostif/profiles/wifi/Device_WiFi_SSID.cpp](../../src/hostif/profiles/wifi/Device_WiFi_SSID.cpp) ### Review of Current Implementation @@ -192,10 +188,6 @@ string getJsonRPCData(std::string postData); ### org.rdk.NetworkManager **Used in:** [Device_DeviceInfo.cpp](../../src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp), -[Device_WiFi.cpp](../../src/hostif/profiles/wifi/Device_WiFi.cpp), -[Device_WiFi_EndPoint.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp), -[Device_WiFi_EndPoint_Security.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp), -[Device_WiFi_SSID.cpp](../../src/hostif/profiles/wifi/Device_WiFi_SSID.cpp) > **Build flags:** WiFi Thunder paths are active only when `RDKV_NM` is **not** defined. > The DeviceInfo IP path requires `MEDIA_CLIENT` defined and `RDKV_TR69` **not** defined. @@ -512,9 +504,5 @@ sequenceDiagram - [hostIf_utils.h](../../src/hostif/include/hostIf_utils.h) — `getJsonRPCData()` and `JSONRPC_URL` - [hostIf_utils.cpp](../../src/hostif/src/hostIf_utils.cpp) — curl implementation - [Device_DeviceInfo.cpp](../../src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp) — DeviceInfo profile handlers -- [Device_WiFi.cpp](../../src/hostif/profiles/wifi/Device_WiFi.cpp) — WiFi enable/disable -- [Device_WiFi_SSID.cpp](../../src/hostif/profiles/wifi/Device_WiFi_SSID.cpp) — SSID profile -- [Device_WiFi_EndPoint.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp) — EndPoint profile -- [Device_WiFi_EndPoint_Security.cpp](../../src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp) — Security profile - [public-api.md](public-api.md) — Overall public API reference - [data-flow.md](../architecture/data-flow.md) — System-level data flow diff --git a/docs/architecture/json-usage.md b/docs/architecture/json-usage.md index 1176f5599..f14dd3305 100644 --- a/docs/architecture/json-usage.md +++ b/docs/architecture/json-usage.md @@ -63,7 +63,7 @@ flowchart LR | Current WDMP HTTP server | `src/hostif/httpserver/src/http_server.cpp` | `cJSON` | inbound + outbound | | Parodus and startup config files | `src/hostif/parodusClient/startParodus/startParodus.cpp`, `src/hostif/parodusClient/pal/libpd.cpp`, `src/hostif/parodusClient/pal/webpa_notification.cpp` | `cJSON` | inbound | | Device defaults and bootstrap data | `src/hostif/profiles/DeviceInfo/XrdkCentralComBSStore.cpp` | `cJSON` | inbound | -| Thunder JSON-RPC consumers | `src/hostif/src/hostIf_utils.cpp`, `src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp`, `src/hostif/profiles/wifi/*.cpp` | `cJSON` | outbound request + inbound response | +| Thunder JSON-RPC consumers | `src/hostif/src/hostIf_utils.cpp`, `src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp` | `cJSON` | outbound request + inbound response | | Parodus notifications | `src/hostif/handlers/src/hostIf_NotificationHandler.cpp` | `cJSON` | outbound | ## Request And Response Contracts @@ -164,10 +164,6 @@ This is the newer local HTTP interface. It accepts JSON request bodies, converts - `src/hostif/src/hostIf_utils.cpp` - `src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp` -- `src/hostif/profiles/wifi/Device_WiFi.cpp` -- `src/hostif/profiles/wifi/Device_WiFi_SSID.cpp` -- `src/hostif/profiles/wifi/Device_WiFi_EndPoint.cpp` -- `src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp` `getJsonRPCData()` sends JSON-RPC POST bodies to the Thunder endpoint and returns a response string which is then parsed by profile code. @@ -205,8 +201,6 @@ This is the newer local HTTP interface. It accepts JSON request bodies, converts | DeviceInfo checkout reset time | `result` as number | | DeviceInfo experience | `result.experience` | | WiFi interface list | `result.interfaces[]` | -| WiFi endpoint security | `result.securityMode` | -| WiFi enable or disable result | `result.success` | ### 4. JSON File Inputs diff --git a/docs/architecture/threading-model.md b/docs/architecture/threading-model.md index dd6ce763b..7097814e3 100644 --- a/docs/architecture/threading-model.md +++ b/docs/architecture/threading-model.md @@ -111,17 +111,16 @@ Signal path: `SIGINT / SIGTERM / SIGHUP` → `quit_handler()` → `sem_post(&shu 2. `pthread_mutex_trylock(&graceful_exit_mutex)` — **mutex is never initialized; this is undefined behavior** 3. Set `isShutdownTriggered = 1` 4. `t2_uninit()` (conditional on `T2_EVENT_ENABLED`) -5. `WiFiDevice::shutdown()` (conditional on `USE_WIFI_PROFILE`) -6. `stop_parodus_recv_wait()` — sets `exit_parodus_recv = true` and calls `pthread_cond_signal()` **without holding `parodus_lock`** -7. `hostIf_HttpServerStop()` — stops HTTP and JSON handler threads -8. `updateHandler::stop()` — sets `stopped = true` only; thread is not joined; may still be sleeping -9. `XBSStore::getInstance()->stop()` — sets `m_stopped = true` and calls `cv.notify_one()` -10. `fclose(logfile)` -11. `g_hash_table_destroy(paramMgrhash)` — destroyed while handler threads are possibly still live -12. `hostIf_IARM_IF_Stop()` -13. `g_main_loop_quit(main_loop)` — unblocks `g_main_loop_run()` in `main()` -14. `HttpServerStop()` (conditional, legacy HTTP) -15. `pthread_mutex_unlock(&graceful_exit_mutex)` +5. `stop_parodus_recv_wait()` — sets `exit_parodus_recv = true` and calls `pthread_cond_signal()` **without holding `parodus_lock`** +6. `hostIf_HttpServerStop()` — stops HTTP and JSON handler threads +7. `updateHandler::stop()` — sets `stopped = true` only; thread is not joined; may still be sleeping +8. `XBSStore::getInstance()->stop()` — sets `m_stopped = true` and calls `cv.notify_one()` +9. `fclose(logfile)` +10. `g_hash_table_destroy(paramMgrhash)` — destroyed while handler threads are possibly still live +11. `hostIf_IARM_IF_Stop()` +12. `g_main_loop_quit(main_loop)` — unblocks `g_main_loop_run()` in `main()` +13. `HttpServerStop()` (conditional, legacy HTTP) +14. `pthread_mutex_unlock(&graceful_exit_mutex)` Back in `main()` after `g_main_loop_run` returns: diff --git a/src/hostif/docs/README.md b/src/hostif/docs/README.md index 5d672c929..944a75437 100644 --- a/src/hostif/docs/README.md +++ b/src/hostif/docs/README.md @@ -349,7 +349,6 @@ The daemon's compiled feature set is controlled by a set of build-time macros. T | `WEB_CONFIG_ENABLED` | Enables WebConfig multipart task (`initWebConfigMultipartTask`) | | `WEBCONFIG_LITE_ENABLE` | Enables lightweight WebConfig thread (`initWebConfigTask`) | | `T2_EVENT_ENABLED` | Enables Telemetry 2 via `t2_event_d` / `t2_event_s` | -| `USE_WIFI_PROFILE` | Compiles in WiFi profile; calls `WiFiDevice::init/shutdown` | | `IS_YOCTO_ENABLED` | Links `libsecure_wrapper` explicitly | | `RDK_DEVICE_EMU` | Selects `eth0` instead of `eth1` as the Ethernet interface | diff --git a/src/hostif/parodusClient/waldb/waldb.cpp b/src/hostif/parodusClient/waldb/waldb.cpp index 184ad0d56..1748f1682 100644 --- a/src/hostif/parodusClient/waldb/waldb.cpp +++ b/src/hostif/parodusClient/waldb/waldb.cpp @@ -1091,7 +1091,7 @@ void test_get_complete_param_list() RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"======================================================================\n"); DataModelParam dmParam = {0}; - const char *pParameterName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.DistributedTracing.Enable"; + const char *pParameterName = "Device.WiFi.EndPoint.1.Profile.1.Status"; if (getParamInfoFromDataModel(g_dbhandle, pParameterName, &dmParam)) { From 178a8be837822b0c31f1c1ef7bf48a5e5d857cf2 Mon Sep 17 00:00:00 2001 From: Anand Date: Mon, 3 Aug 2026 17:06:43 +0000 Subject: [PATCH 7/7] RDKEMW-22811: Remove WiFi DML from tr69hostIf Reason for change: WiFi DMLs for RDK-E have been added to the WiFiMetrics component. Therefore, they are being removed from tr69hostif. Test procedure: Flash the build and ensure tr69hostif works without any issues. Risks: low Priority: P1 Signed-off-by: Anand N Anand_N@comcast.com --- README.md | 1 - docs/architecture/data-flow.md | 1 - docs/architecture/json-usage.md | 3 +-- docs/integration/build-setup.md | 3 +-- src/hostif/handlers/docs/README.md | 4 +--- src/hostif/parodusClient/waldb/waldb.cpp | 2 +- 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 26bda8d15..54dc2fef6 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,6 @@ autoreconf -iv ./configure \ --enable-parodus \ --enable-rbus \ - --enable-wifi \ --enable-moca \ --enable-t2 diff --git a/docs/architecture/data-flow.md b/docs/architecture/data-flow.md index b4afb40fe..8e130ff9f 100644 --- a/docs/architecture/data-flow.md +++ b/docs/architecture/data-flow.md @@ -11,7 +11,6 @@ Local JSON request -+--> HOSTIF request envelope --> Match parameter prefix RBUS DML provider --+ Match parameter prefix --> deviceMgr ----------+ -Match parameter prefix --> wifiMgr ------------+ Match parameter prefix --> ipMgr --------------+--> Profile get/set handler Match parameter prefix --> ethernetMgr --------+ Match parameter prefix --> timeMgr ------------+ diff --git a/docs/architecture/json-usage.md b/docs/architecture/json-usage.md index f14dd3305..6beeb1444 100644 --- a/docs/architecture/json-usage.md +++ b/docs/architecture/json-usage.md @@ -328,7 +328,7 @@ The following items are the main input for the planned robustness story. | Gap | Affected files | Why it matters | |-----|----------------|----------------| | `getJsonRPCData()` does not accumulate the HTTP response body because the curl write callback takes the output string by value | `src/hostif/src/hostIf_utils.cpp` | Most Thunder JSON-RPC consumers effectively parse an empty string, which breaks the central JSON-RPC integration path | -| Nested JSON members are dereferenced without consistent null and type checks | `src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp`, `src/hostif/profiles/wifi/Device_WiFi_EndPoint_Security.cpp` | Malformed or changed JSON can cause crashes or invalid reads | +| Nested JSON members are dereferenced without consistent null and type checks | `src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp` | Malformed or changed JSON can cause crashes or invalid reads | | Parsed JSON roots are not deleted on many success and error paths | `src/hostif/parodusClient/startParodus/startParodus.cpp`, `src/hostif/parodusClient/pal/libpd.cpp`, `src/hostif/parodusClient/pal/webpa_notification.cpp`, `src/hostif/profiles/DeviceInfo/XrdkCentralComBSStore.cpp` | Long-running service code accumulates avoidable leaks | | The notify config parser dereferences `notify_cfg` before verifying parse success | `src/hostif/parodusClient/pal/webpa_notification.cpp` | Invalid JSON can turn into null dereference or inconsistent startup behavior | @@ -383,7 +383,6 @@ The following items are the main input for the planned robustness story. - `src/hostif/handlers/docs/README.md` documents the legacy JSON request handler and notification flow. - `src/hostif/parodusClient/docs/README.md` documents WebPA orchestration and JSON config files. - `src/hostif/docs/README.md` already records the `getJsonRPCData()` response handling defect. -- `src/hostif/profiles/wifi/docs/README.md` documents the non-RDKV WiFi JSON-RPC path. - `src/hostif/profiles/DeviceInfo/docs/README.md` documents partner-default JSON and bootstrap behavior. ## See Also diff --git a/docs/integration/build-setup.md b/docs/integration/build-setup.md index 1051ecbb8..f2d0e1d76 100644 --- a/docs/integration/build-setup.md +++ b/docs/integration/build-setup.md @@ -28,7 +28,6 @@ The top-level `configure.ac` currently exposes feature toggles including: |------|--------| | `--enable-xre` | Enable XRE-related profile support | | `--enable-moca` / `--enable-moca2` | Enable MoCA profile support | -| `--enable-wifi` | Enable WiFi profile support | | `--enable-DHCPv4` | Enable DHCPv4 profile support | | `--enable-StorageService` | Enable StorageService profile support | | `--enable-InterfaceStack` | Enable InterfaceStack profile support | @@ -87,7 +86,7 @@ Choose the unit that matches the build-time feature set and deployment model. ```sh autoreconf --install -./configure --enable-wifi --enable-DHCPv4 --enable-notification --enable-systemd-notify +./configure --enable-DHCPv4 --enable-notification --enable-systemd-notify make -j4 ``` diff --git a/src/hostif/handlers/docs/README.md b/src/hostif/handlers/docs/README.md index fdf60e333..53a8fb43f 100644 --- a/src/hostif/handlers/docs/README.md +++ b/src/hostif/handlers/docs/README.md @@ -17,7 +17,7 @@ This layer does not implement the full device logic for every TR-181 object. Its | `src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp` | RBUS-facing DML provider integration | | `src/hostif/handlers/src/hostIf_updateHandler.cpp` | Periodic polling for value-change events | | `src/hostif/handlers/src/hostIf_NotificationHandler.cpp` | Parodus/WebPA notification enqueue and delivery support | -| `src/hostif/handlers/src/hostIf_*ReqHandler.cpp` | Concrete manager classes for Device, DS, Ethernet, IP, WiFi, DHCPv4, and other profiles | +| `src/hostif/handlers/src/hostIf_*ReqHandler.cpp` | Concrete manager classes for Device, DS, Ethernet, IP, DHCPv4, and other profiles | ## Architecture @@ -52,7 +52,6 @@ graph TB DS[DSClientReqHandler] ETH[EthernetClientReqHandler] IP[IPClientReqHandler] - WIFI[WiFiReqHandler] TIME[TimeClientReqHandler] DHCP[DHCPv4ClientReqHandler] IFS[InterfaceStackClientReqHandler] @@ -210,7 +209,6 @@ The handlers library is assembled in `src/hostif/handlers/Makefile.am` as `libMs Common feature gates include: -- `WITH_WIFI_PROFILE` for WiFi handler support - `WITH_MOCA_PROFILE` for MoCA manager support - `WITH_DHCP_PROFILE` for DHCPv4 support - `WITH_INTFSTACK_PROFILE` for InterfaceStack support diff --git a/src/hostif/parodusClient/waldb/waldb.cpp b/src/hostif/parodusClient/waldb/waldb.cpp index 1748f1682..184ad0d56 100644 --- a/src/hostif/parodusClient/waldb/waldb.cpp +++ b/src/hostif/parodusClient/waldb/waldb.cpp @@ -1091,7 +1091,7 @@ void test_get_complete_param_list() RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"======================================================================\n"); DataModelParam dmParam = {0}; - const char *pParameterName = "Device.WiFi.EndPoint.1.Profile.1.Status"; + const char *pParameterName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.DistributedTracing.Enable"; if (getParamInfoFromDataModel(g_dbhandle, pParameterName, &dmParam)) {