Skip to content

Commit

Permalink
Sync NetworkManager plugin with 24Q2 branch (#5475)
Browse files Browse the repository at this point in the history
* DELIA-64891 - Network failed to connect after Reset (#5117)

* DELIA-64891 - Network failed to connect after Reset

Reason for change: Added the missing changes from Network
Test Procedure: Build and verified with curl commands
Risks: Low
Priority: P0
Signed-off-by: Gururaaja ESR <[email protected]>

* DELIA-64891 - Network failed to connect after Reset

Reason for change: Added the missing changes from Network
Test Procedure: Build and verified with curl commands
Risks: Low
Priority: P0
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 1e2fc60)

* DELIA-64891, ES1-1048 : Network failed to connect after Reset (#5139)

* DELIA-64891, ES1-1048 : Network failed to connect after Reset

Reason for change: Avoided posting event when the interface state is empty.
Posting the event only when there is a valid interface state.PSB the details
of the interface state for posting event.
Event name : state
onInterfaceStatusChanged : INTERFACE_REMOVED or INTERFACE_ADDED
onConnectionStatusChanged : INTERFACE_LINK_DOWN or INTERFACE_LINK_UP
Test Procedure: Test and verified with GUI
Risks: Medium
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 9840031)

* connectivty monitor updated (#5184)

Connectivty monitor synced up with Network plugin

(cherry picked from commit 751fce0)

* Posting the events only for the eth0 and wlan0 interface (#5189)

(cherry picked from commit 854992e)

* RDK-46636 - NetworkManager backward compatibility (#5203)

Reason for change: Added handler2 support for initiateWPSPairing
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit fcb8eb7)

* DELIA-65168 - Observed telemetry marker "SYST_ERR_ThunderSrvNotReady" (#5223)

Reason for change: Removed the getenv from NetworkManagerLogger as it is
not required
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 66a41a0)

* DELIA-65185 - NetworkManager unified plugin - always returns 128.0.0.0 (#5235)

* DELIA-65185 - NetworkManager unified plugin - always returns 128.0.0.0

Reason for change: Added the changes to get the prefix value from netsrvmgr and converting
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR [email protected]
(cherry picked from commit ea1485b)

* DELIA-65170 - NetworkManager unified plugin getIPSettings prefix returns 0 (#5242)

* DELIA-65170 - NetworkManager unified plugin getIPSettings prefix returns 0

Reason for change: Added the changes to get the prefix value from IP/Prefix
and added check for NULL prefix
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
Co-authored-by: Karunakaran A <[email protected]>
(cherry picked from commit 673ed3b)

* DELIA-65229 - InterfaceStateChanged Event not posting In NetworkManager plugin (#5249)

* DELIA-65229 - InterfaceStateChanged Event not posting In NetwrokManger plugin

Reason for change: Changed the comparison between string and char array to
proper string to string comparison
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 7d3dd07)

* DELIA-65238 - Network failure retry logic timeout remains as 5 sec (#5259)

* DELIA-65238 - Network failure retry logic timeout remains as 5 sec

Reason for change: Added logic to change the notification count and timeout
to default value, when the global internet state is equal to InternetConnectionState
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
Co-authored-by: Karunakaran A <[email protected]>
(cherry picked from commit b4a44b4)

* DELIA-65341 - getPublicIP is not returning proper value (#5331)

getPublicIP is not returning proper value

Reason for change: Without checking the null check, the config stun endpoint
and port value is being set. Added null condition check so that config value
is taken when it is non empty and default value will be taken when config
value is empty
Test Procedure: Build and verified
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 6644f86)

* DELIA-65343, RDK-48562 : Refactor NetworkManager Plugin (#5345)

* Restructure the whole NetworkManager code to be single component & updated COMRPC Proxy Implementation

Signed-off-by: Karunakaran A <[email protected]>
(cherry picked from commit b57ba00)

* RDKTV-30981 - Devices went to offline plui state (#5366)

* RDKTV-30981 - Devices went to offline plui state

Reason for change: Created authorization token and passed the same for
json RPC call to networkmanager from network plugin.
Also added timer logic to subscribe for events.
Corrected SetInterfaceState and GetInterfaceState function calls.
Updated logger to print file name instead of function name.
Test Procedure: Do CDL and confirm the device boots up in online state
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>

* Update NetworkManagerPlugin.md
Co-authored-by: Karunakaran A <[email protected]>

(cherry picked from commit 2bda9e6)

* DELIA-65343 : Devices went to offline plui state after the initial change (#5375)

* DELIA-65343 : Devices went to offline plui state after the initial change

Reason for change: Updated with review comments
Test Procedure: Do CDL and confirm the device boots up in online state
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 98c2984)

* DELIA-65419: Delay in providing 'oninternetstatuschange' event from Network Thunder Plugin (#5374)

DELIA-65419: Update no internet event logic in both Network and NetworkManager
(cherry picked from commit 3237958)

* DELIA-65343 - Fixing the trace method of network manager (#5383)

Reason for change: Added the trace ouput details in the Json response object
Test Procedure: Run Trace method curl and check
Risks: Low
Priority: P1
Signed-off-by: Gururaaja ESR <[email protected]>
(cherry picked from commit 3d2b6b6)

* RDKTV-31166 posting internet event when interface connection changes (#5407)

* RDKTV-31166 internetStatus Event posting updated

* modefiy the same change in network manager

(cherry picked from commit 00a6207)

* DELIA-65343 : Updated the trace results (#5410)

Updated the trace results
Signed-off-by: kamirt573_comcast <[email protected]>
(cherry picked from commit af758c3)

* Fixed the setStunEndpoint API and the Subscription Timeout error (#5422)

* Fixed the setStunEndpoint API and the Subscription Timeout error

Signed-off-by: Karunakaran A <[email protected]>
(cherry picked from commit 5c7a0f6)

* Fix the ClearSSID method (#5430)

* Fix the ClearSSID method

Fix the ClearSSID method

(cherry picked from commit c18ce92)

* Updated the version infomation of NetworkManager Plugin (#5431)

Signed-off-by: Karunakaran A <[email protected]>
(cherry picked from commit c1b939c)

* RDK-49088 Enhanced connectivity monitors (#5427)

* Enhanced connectivity monitor intial commit

* configuration read code changed

* remove log lines and event posting modified

retry logic start value changed

(cherry picked from commit d4ec80d)

* Enhanced connectivity monitor error fix (#5449)

* Enahanced Connectivity monitor

* ip address change event not coming when wifi reconnect happense

(cherry picked from commit c4d1e81)

* Updated Network Manger plugin Version updated (#5452)

* Updated NetworkManger plugin version

* Update NetworkManager.json

* Update NetworkManagerPlugin.md

(cherry picked from commit c871677)

* [DELIA-65505 DELIA-65521: WiFi connection stuck at connecting screen after entering wrong password and another same wifi issue during FSR process (#5445)

* [DELIA-65505 DELIA-65521: WiFi connection stuck at connecting screen after entering wrong password and another same wifi issue during FSR process

Reason for change: onError EventHandling has been added to NetworkManagerInternalEventHandler, allowing us to obtain the WiFi error codes
Test Procedure: Verify in Jenkin Build
Risks: High
Signed-off-by: Thamim Razith [email protected]
(cherry picked from commit ca8f610)

* Updated Network Manger plugin Version updated (#5453)

(cherry picked from commit d9da07c)

---------

Co-authored-by: gururaajar <[email protected]>
Co-authored-by: Karunakaran A <[email protected]>
Co-authored-by: tabbas651 <[email protected]>
  • Loading branch information
4 people authored Jul 2, 2024
1 parent 32a05fb commit 4cdce62
Show file tree
Hide file tree
Showing 52 changed files with 3,424 additions and 2,044 deletions.
6 changes: 6 additions & 0 deletions Network/NetworkConnectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,12 @@ namespace WPEFramework {
LOGINFO("notification count change to default %d ...", notifyWaitCount);
}
}
else
{
notifyWaitCount = DEFAULT_MONITOR_RETRY_COUNT;
tempTimeout = timeout.load();
}


if(!isContinuesMonitoringNeeded && (g_internetState.load() == FULLY_CONNECTED))
{
Expand Down
7 changes: 7 additions & 0 deletions NetworkManager/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [0.2.0] - 2024-05-27
### Added
- Restructured the NetworkManager folder organization
- Refactored Legacy Network & WiFiManager Plugin as JSONRPC
- Built COMRPC Proxy Implementation as part of NetworkManager Plugin itself
- Built out-of-process class as part of main library itself.

## [0.1.0] - 2024-03-28
### Added
- Added NetworkManager plugin. A Unified `NetworkManager` plugin that allows you to manage Ethernet and Wifi interfaces on the device.
126 changes: 122 additions & 4 deletions NetworkManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ find_package(WPEFramework)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
set(VERSION_MINOR 2)
set(VERSION_PATCH 7)

add_compile_definitions(NETWORKMANAGER_MAJOR_VERSION=${VERSION_MAJOR})
add_compile_definitions(NETWORKMANAGER_MINOR_VERSION=${VERSION_MINOR})
Expand All @@ -20,6 +20,124 @@ include(CmakeHelperFunctions)
string(TOLOWER ${NAMESPACE} STORAGE_DIRECTORY)
get_directory_property(SEVICES_DEFINES COMPILE_DEFINITIONS)

add_subdirectory(interface)
add_subdirectory(service)
set(PLUGIN_NAME NetworkManager)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})
set(PLUGIN_LEGACY_DEPRECATED_NETWORK ${NAMESPACE}Network)
set(PLUGIN_LEGACY_DEPRECATED_WIFI ${NAMESPACE}WiFiManager)

find_package(${NAMESPACE}Core REQUIRED)
find_package(${NAMESPACE}Plugins REQUIRED)
find_package(CURL)
if(ENABLE_GNOME_NETWORKMANAGER)
pkg_check_modules(GLIB REQUIRED glib-2.0)
pkg_check_modules(LIBNM REQUIRED libnm)
else()
find_package(IARMBus REQUIRED)
endif ()


message("Setup ProxyStub for INetworkManager.h")
find_package(CompileSettingsDebug CONFIG REQUIRED)
find_package(ProxyStubGenerator REQUIRED)

set(ProxyStubGenerator_DIR ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/tools/cmake ${ProxyStubGenerator_DIR})

if(NOT GENERATOR_SEARCH_PATH)
set(GENERATOR_SEARCH_PATH ${CMAKE_SYSROOT}${CMAKE_INSTALL_PREFIX}/include/${NAMESPACE})
endif()

message("The Search path is, ${GENERATOR_SEARCH_PATH}")
ProxyStubGenerator(INPUT "${CMAKE_CURRENT_SOURCE_DIR}" OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/generated" INCLUDE_PATH ${GENERATOR_SEARCH_PATH})

file(GLOB PROXY_STUB_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/generated/ProxyStubs*.cpp")

message("Setup ${PROJECT_NAME} v${PROJECT_VERSION}")

set(PLUGIN_NETWORKMANAGER_LOGLEVEL "5" CACHE STRING "To configure default loglevel NetworkManager plugin")


include_directories(${PROJECT_SOURCE_DIR})
# Build the main plugin that runs inside the WPEFramework daemon
add_library(${MODULE_NAME} SHARED
NetworkManager.cpp
NetworkManagerJsonRpc.cpp
NetworkManagerLogger.cpp
NetworkManagerImplementation.cpp
NetworkManagerConnectivity.cpp
NetworkManagerStunClient.cpp
WiFiSignalStrengthMonitor.cpp
Module.cpp
${PROXY_STUB_SOURCES})

target_link_libraries(${MODULE_NAME} PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
)

set_target_properties(${MODULE_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES
FRAMEWORK FALSE)

include_directories(${PROJECT_SOURCE_DIR}/interface)
include_directories(${PROJECT_SOURCE_DIR}/service)
include_directories(${PROJECT_SOURCE_DIR}/../helpers)

install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)


# Build the implementation that runs out-of-process behind a COM-RPC interface

if(ENABLE_GNOME_NETWORKMANAGER)
target_sources(${MODULE_NAME} PRIVATE NetworkManagerGnomeProxy.cpp NetworkManagerGnomeWIFI.cpp)
target_include_directories(${MODULE_NAME} PRIVATE ${GLIB_INCLUDE_DIRS} ${LIBNM_INCLUDE_DIRS})
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBNM_LIBRARIES})
else()
target_sources(${MODULE_NAME} PRIVATE NetworkManagerRDKProxy.cpp)
target_include_directories(${MODULE_NAME} PRIVATE ${IARMBUS_INCLUDE_DIRS})
target_link_libraries(${MODULE_NAME} PRIVATE ${IARMBUS_LIBRARIES})
endif()


target_link_libraries(${MODULE_NAME} PRIVATE ${CURL_LIBRARIES})
target_include_directories(${MODULE_NAME} PRIVATE ${CURL_INCLUDE_DIRS})


add_library(${PLUGIN_LEGACY_DEPRECATED_NETWORK} SHARED
LegacyPlugin_NetworkAPIs.cpp
NetworkManagerLogger.cpp
Module.cpp
)

target_link_libraries(${PLUGIN_LEGACY_DEPRECATED_NETWORK} PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
)

set_target_properties(${PLUGIN_LEGACY_DEPRECATED_NETWORK} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)

install(TARGETS ${PLUGIN_LEGACY_DEPRECATED_NETWORK} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)

add_library(${PLUGIN_LEGACY_DEPRECATED_WIFI} SHARED
LegacyPlugin_WiFiManagerAPIs.cpp
NetworkManagerLogger.cpp
Module.cpp
)

target_link_libraries(${PLUGIN_LEGACY_DEPRECATED_WIFI} PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
)

set_target_properties(${PLUGIN_LEGACY_DEPRECATED_WIFI} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)

install(TARGETS ${PLUGIN_LEGACY_DEPRECATED_WIFI} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)

write_config()
write_config(PLUGINS LegacyPlugin_NetworkAPIs CLASSNAME Network LOCATOR lib${PLUGIN_LEGACY_DEPRECATED_NETWORK}.so)
write_config(PLUGINS LegacyPlugin_WiFiManagerAPIs CLASSNAME WiFiManager LOCATOR lib${PLUGIN_LEGACY_DEPRECATED_WIFI}.so)

Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ namespace WPEFramework
/* @brief Set the Primary Interface used for external world communication */
virtual uint32_t SetPrimaryInterface (const string& interface/* @in */) = 0;

/* @brief Enable the active Interface used for external world communication */
virtual uint32_t EnableInterface (const string& interface/* @in */) = 0;
/* @brief Disable the Interface passed */
virtual uint32_t DisableInterface (const string& interface/* @in */) = 0;
/* @brief Enable/Disable the given interface */
virtual uint32_t SetInterfaceState (const string& interface /* @in */, const bool& enabled /* @in */) = 0;
/* @brief Get the state of given interface */
virtual uint32_t GetInterfaceState (const string& interface /* @in */, bool& isEnabled /* @out */) = 0;

/* @brief Get IP Address Of the Interface */
virtual uint32_t GetIPSettings(const string& interface /* @in */, const string &ipversion /* @in */, IPAddressInfo& result /* @out */) = 0;
Expand Down
3 changes: 3 additions & 0 deletions NetworkManager/LegacyPlugin_NetworkAPIs.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
precondition = ["Platform"]
callsign = "org.rdk.Network"
autostart = "true"
3 changes: 3 additions & 0 deletions NetworkManager/LegacyPlugin_NetworkAPIs.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set (autostart true)
set (preconditions Platform)
set (callsign "org.rdk.Network")
Loading

0 comments on commit 4cdce62

Please sign in to comment.