Skip to content

RDKEMW-17624 : NetworkconnectionRecovery.sh migration to C/C++ Module#301

Open
gururaajar wants to merge 140 commits intodevelopfrom
topic/RDK-61067_new
Open

RDKEMW-17624 : NetworkconnectionRecovery.sh migration to C/C++ Module#301
gururaajar wants to merge 140 commits intodevelopfrom
topic/RDK-61067_new

Conversation

@gururaajar
Copy link
Copy Markdown
Contributor

Reason for Change: Added outofprocess networkconnectionstats plugin, which is the replacement for NetworkconnectionRecovery.sh script.
Test Procedure: Required to check all the functionality done by the script is covered with the plugin.
Priority: P1
Signed-off-by: Gururaaja ESRGururaja_ErodeSriranganRamlingham@comcast.com

Garpathi, Uday Krishna and others added 30 commits December 10, 2025 11:37
Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
Signed-off-by: Garpathi, Uday Krishna <UdayKrishna_GARPATHI@comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new out-of-process NetworkConnectionStats Thunder plugin intended to replace the legacy NetworkconnectionRecovery.sh behavior, while also improving NetworkManager’s internal state handling and resource cleanup paths.

Changes:

  • Added the networkstats submodule implementing NetworkConnectionStats (in-process plugin + out-of-process implementation) with COM-RPC/JSON-RPC provider options, periodic diagnostics, and event-driven reporting.
  • Improved NetworkManager thread-safety and robustness (mutex-protected default-interface access, additional iterator null checks, some GLib/libnm context isolation + cleanup work).
  • Minor fixes/cleanups in existing tests and log/error handling paths.

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Minor whitespace cleanup in WiFi connect test.
tests/l2Test/libnm/l2_test_libnmproxy.cpp Fix duplicate mock expectation and formatting.
plugin/rdk/NetworkManagerRDKProxy.cpp Default interface access switched to locked getters/setters; adds platform_deinit stub and iterator null checks.
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Uses locked default interface access; adds iterator null checks.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Fix log typo and improve GLib context cleanup + scan error handling.
plugin/gnome/NetworkManagerGnomeProxy.cpp Replaces global NMClient with members; adds isolated GMainContext strategy and platform_deinit cleanup; adds iterator null checks.
plugin/NetworkManagerJsonRpc.cpp Adds null checks after iterator creation for endpoints/SSIDs.
plugin/NetworkManagerImplementation.h Adds mutex-protected default interface accessors; adds platform_deinit declaration; forward-declares GLib/libnm types.
plugin/NetworkManagerImplementation.cpp Calls platform_deinit on shutdown; uses default interface accessors; adds iterator null checks; adjusts connectivity-trigger logic.
plugin/NetworkManagerConnectivity.cpp Uses default interface accessor; refactors initial/ideal connectivity logic and logging.
legacy/LegacyWiFiManagerAPIs.cpp Adds null check after iterator creation.
legacy/LegacyNetworkAPIs.cpp Adds null check after iterator creation.
networkstats/plugin/ThunderJsonRPCProvider.h Declares JSON-RPC-based provider for NetworkManager data.
networkstats/plugin/ThunderJsonRPCProvider.cpp Implements JSON-RPC provider calls to NetworkManager (GetIPSettings, Ping, event subscribe, etc.).
networkstats/plugin/ThunderComRPCProvider.h Declares COM-RPC provider for NetworkManager data.
networkstats/plugin/ThunderComRPCProvider.cpp Implements COM-RPC provider calls to NetworkManager.
networkstats/plugin/NetworkDataProviderFactory.h Factory to choose COM-RPC vs JSON-RPC provider at runtime.
networkstats/plugin/NetworkConnectionStatsLogger.h Adds standalone logger interface/macros for networkstats module.
networkstats/plugin/NetworkConnectionStatsLogger.cpp Implements logger backend (stdout or RDK logger).
networkstats/plugin/NetworkConnectionStatsImplementation.h Declares out-of-process implementation: state machine, queues, periodic threads, subscriptions.
networkstats/plugin/NetworkConnectionStatsImplementation.cpp Implements diagnostics/reporting, subscriptions, message queue + state machine, WiFi reassociation trigger.
networkstats/plugin/NetworkConnectionStats.h Declares in-process Thunder plugin wrapper (IPlugin) aggregating the COM-RPC interface.
networkstats/plugin/NetworkConnectionStats.cpp Implements plugin lifecycle, spawns out-of-process implementation, configures it.
networkstats/plugin/NetworkConnectionStats.config Adds plugin configuration template (cmake config generator format).
networkstats/plugin/NetworkConnectionStats.conf.in Adds plugin configuration template (conf.in).
networkstats/plugin/Module.h Adds module declarations/includes for NetworkConnectionStats.
networkstats/plugin/Module.cpp Adds module registration entry point.
networkstats/plugin/INetworkData.h Adds provider interface for retrieving network data via NetworkManager.
networkstats/plugin/CMakeLists.txt Builds in-process and out-of-process libraries; adds config variables.
networkstats/interface/INetworkConnectionStats.h Adds COM-RPC interface definition (Configure/Register/Unregister).
networkstats/interface/CMakeLists.txt Adds ProxyStub generation and install rules for the interface.
networkstats/definition/NetworkConnectionStats.json Adds JSON-RPC API definition (currently not built by default in subproject).
networkstats/definition/CMakeLists.txt Adds JSON-RPC documentation/code generation step.
networkstats/THUNDER_PLUGIN_QUICK_REFERENCE.md Adds architectural quick reference documentation.
networkstats/THUNDER_PLUGIN_CONVERSION.md Adds conversion notes/doc for standalone-to-plugin migration.
networkstats/README_INTERNAL_PLUGIN.md Adds internal-only plugin documentation.
networkstats/NetworkStatsDesign_ver1.md Adds design document and diagrams for the module.
networkstats/CMakeLists.txt Adds networkstats build entry (currently structured as a nested project).
CMakeLists.txt Adds add_subdirectory(networkstats) to the root build.
.DS_Store Adds macOS metadata file (should not be committed).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread networkstats/plugin/ThunderComRPCProvider.h
Comment thread CMakeLists.txt
Comment thread plugin/rdk/NetworkManagerRDKProxy.cpp
Comment thread plugin/gnome/NetworkManagerGnomeProxy.cpp
Comment thread plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp
Comment thread networkstats/plugin/NetworkConnectionStatsImplementation.cpp
Comment thread plugin/NetworkManagerConnectivity.cpp
Comment thread networkstats/CMakeLists.txt
bpunnuru
bpunnuru previously approved these changes Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 20:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an out-of-process NetworkConnectionStats Thunder plugin intended to replace the legacy NetworkconnectionRecovery.sh behavior, while also tightening robustness in the existing NetworkManager plugin (thread-safe default-interface access, safer iterator creation, and improved GLib/libnm lifecycle handling).

Changes:

  • Added a new networkstats/ module implementing an out-of-process NetworkConnectionStats plugin with COM-RPC interface, providers (COM-RPC / JSON-RPC), config, and build integration.
  • Made NetworkManager default-interface access thread-safe and added platform-specific deinitialization hooks.
  • Added null checks for iterator creation across several APIs and improved error handling / cleanup in gnome WiFi flows.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
CMakeLists.txt Adds networkstats as a subdirectory in the main build.
legacy/LegacyNetworkAPIs.cpp Adds nullptr check after creating RPC string iterator for endpoints.
legacy/LegacyWiFiManagerAPIs.cpp Adds nullptr check after creating RPC string iterator for SSIDs.
plugin/NetworkManagerConnectivity.cpp Uses thread-safe default-interface getter in connectivity monitor logic.
plugin/NetworkManagerImplementation.cpp Calls new platform_deinit() during shutdown/cleanup.
plugin/NetworkManagerImplementation.h Adds mutex-protected default-interface getters/setters; forward-declares NMClient/GMainContext; declares platform_deinit().
plugin/NetworkManagerJsonRpc.cpp Adds nullptr checks for created iterators in JSON-RPC endpoints/SSIDs flows.
plugin/gnome/NetworkManagerGnomeProxy.cpp Introduces isolated GMainContext + m_nmClient member usage and context-drain iterations for safer libnm access.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Improves WPS error-path cleanup and adds scan request error handling; fixes log typo.
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Switches default-interface handling to the new thread-safe accessors and adds iterator nullptr checks.
plugin/rdk/NetworkManagerRDKProxy.cpp Switches default-interface handling to thread-safe accessors; adds iterator nullptr checks; adds stub platform_deinit().
tests/l2Test/libnm/l2_test_libnmproxy.cpp Fixes a duplicated/malformed mock .WillOnce(...) chain; minor formatting.
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Removes stray whitespace-only lines; no behavior change.
networkstats/CMakeLists.txt Adds a standalone-style CMake entry for NetworkConnectionStats (interface + plugin).
networkstats/NetworkStatsDesign_ver1.md Adds design documentation for the network stats module.
networkstats/README_INTERNAL_PLUGIN.md Adds internal-plugin documentation and operational notes.
networkstats/THUNDER_PLUGIN_CONVERSION.md Adds conversion notes/documentation for Thunder plugin integration.
networkstats/THUNDER_PLUGIN_QUICK_REFERENCE.md Adds quick reference documentation for the plugin pattern.
networkstats/definition/CMakeLists.txt Adds JSON-RPC documentation generation CMake (currently not wired in main networkstats/CMakeLists.txt).
networkstats/definition/NetworkConnectionStats.json Adds a JSON-RPC API definition document for NetworkConnectionStats.
networkstats/interface/CMakeLists.txt Adds ProxyStub generation build for INetworkConnectionStats.
networkstats/interface/INetworkConnectionStats.h Adds COM-RPC interface for NetworkConnectionStats (Configure + Register/Unregister).
networkstats/plugin/CMakeLists.txt Adds build rules for in-process plugin + out-of-process implementation and providers.
networkstats/plugin/INetworkData.h Defines provider interface used by NetworkConnectionStats implementation.
networkstats/plugin/Module.cpp Adds module declaration for NetworkConnectionStats.
networkstats/plugin/Module.h Adds module header for NetworkConnectionStats.
networkstats/plugin/NetworkConnectionStats.config Adds plugin configuration template (CMake config generator format).
networkstats/plugin/NetworkConnectionStats.conf.in Adds plugin configuration .conf.in template.
networkstats/plugin/NetworkConnectionStats.cpp Adds in-process Thunder plugin shell spawning out-of-process implementation.
networkstats/plugin/NetworkConnectionStats.h Adds plugin class declaration (IPlugin + interface aggregation).
networkstats/plugin/NetworkConnectionStatsImplementation.cpp Adds out-of-process implementation: diagnostics, event subscription, state machine, periodic reporting.
networkstats/plugin/NetworkConnectionStatsImplementation.h Adds implementation header: state machine + worker threads + provider integration.
networkstats/plugin/NetworkConnectionStatsLogger.cpp Adds logging backend for the NetworkConnectionStats module.
networkstats/plugin/NetworkConnectionStatsLogger.h Adds logging macros and logger API for the NetworkConnectionStats module.
networkstats/plugin/NetworkDataProviderFactory.h Adds provider factory (COM-RPC vs JSON-RPC).
networkstats/plugin/ThunderComRPCProvider.cpp Adds COM-RPC provider implementation for NetworkManager interactions.
networkstats/plugin/ThunderComRPCProvider.h Adds COM-RPC provider header.
networkstats/plugin/ThunderJsonRPCProvider.cpp Adds JSON-RPC provider implementation for NetworkManager interactions.
networkstats/plugin/ThunderJsonRPCProvider.h Adds JSON-RPC provider header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugin/NetworkManagerJsonRpc.cpp
Comment thread CMakeLists.txt
Comment thread plugin/gnome/NetworkManagerGnomeProxy.cpp
Comment thread plugin/NetworkManagerImplementation.cpp
Comment thread plugin/rdk/NetworkManagerRDKProxy.cpp
Comment thread plugin/NetworkManagerConnectivity.cpp Outdated
Comment thread plugin/NetworkManagerJsonRpc.cpp
@gururaajar gururaajar changed the title RDK-61007 : NetworkconnectionRecovery.sh migration to C/C++ Module RDKEMW-17624 : NetworkconnectionRecovery.sh migration to C/C++ Module Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 21:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an out-of-process NetworkConnectionStats Thunder plugin intended to replace functionality previously handled by NetworkconnectionRecovery.sh, and also hardens parts of the existing NetworkManager plugin around default-interface handling, iterator creation, and libnm client lifecycle.

Changes:

  • Add new networkstats out-of-process plugin (providers, state machine, logging, build + config scaffolding).
  • Make NetworkManager default-interface access thread-safe and add platform_deinit() hooks across platform backends.
  • Improve stability checks (null iterator returns, GLib context cleanup paths, minor log/error handling and test tidy-ups).

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Minor whitespace cleanup in a WiFi connect test.
tests/l2Test/libnm/l2_test_libnmproxy.cpp Fix duplicated mock expectation and formatting.
plugin/rdk/NetworkManagerRDKProxy.cpp Use locked default-interface accessors; add platform deinit stub; iterator null-check.
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Use locked default-interface accessors; add platform deinit stub; iterator null-check.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Fix typo and add GLib context cleanup + scan-error handling.
plugin/gnome/NetworkManagerGnomeProxy.cpp Replace global NMClient with per-instance client/context; add platform_deinit; iterator null-checks.
plugin/NetworkManagerJsonRpc.cpp Add null checks after iterator creation for endpoints/SSIDs.
plugin/NetworkManagerImplementation.h Introduce mutex-protected default-interface getters/setters; add NMClient/GMainContext members; declare platform_deinit.
plugin/NetworkManagerImplementation.cpp Call platform_deinit at shutdown; use locked default-interface accessors; add iterator null-check.
plugin/NetworkManagerConnectivity.cpp Use locked default-interface accessor instead of direct member access.
networkstats/plugin/ThunderJsonRPCProvider.h Add JSON-RPC-based NetworkManager client provider interface.
networkstats/plugin/ThunderJsonRPCProvider.cpp Implement JSON-RPC provider for IP settings, ping, events, and WiFi reconnect.
networkstats/plugin/ThunderComRPCProvider.h Add COM-RPC LinkType-based NetworkManager client provider interface.
networkstats/plugin/ThunderComRPCProvider.cpp Implement COM-RPC provider for IP settings, ping, events, and WiFi reconnect.
networkstats/plugin/NetworkDataProviderFactory.h Add factory to select provider type (comrpc/jsonrpc).
networkstats/plugin/NetworkConnectionStatsLogger.h Add logger API/macros for networkstats plugin.
networkstats/plugin/NetworkConnectionStatsLogger.cpp Implement logger backend (RDK logger or stdout).
networkstats/plugin/NetworkConnectionStatsImplementation.h Define out-of-process implementation (state machine, threads, queue).
networkstats/plugin/NetworkConnectionStatsImplementation.cpp Implement event-driven + periodic diagnostics and WiFi reassociation logic.
networkstats/plugin/NetworkConnectionStats.h Define in-process plugin wrapper that spawns OOP implementation.
networkstats/plugin/NetworkConnectionStats.cpp Implement plugin lifecycle + OOP instantiation and teardown.
networkstats/plugin/NetworkConnectionStats.config Add plugin config template inputs (interval/providerType/OOP locator).
networkstats/plugin/NetworkConnectionStats.conf.in Add Thunder config generation template.
networkstats/plugin/Module.h Add networkstats module header for Thunder build integration.
networkstats/plugin/Module.cpp Add module declaration for networkstats.
networkstats/plugin/INetworkData.h Define abstract provider interface used by NetworkConnectionStatsImplementation.
networkstats/plugin/CMakeLists.txt Add build rules for plugin + OOP implementation, options for telemetry/RFC.
networkstats/interface/INetworkConnectionStats.h Add COM-RPC interface definition for NetworkConnectionStats.
networkstats/interface/CMakeLists.txt Add ProxyStub generation and install rules for the interface.
networkstats/definition/NetworkConnectionStats.json Add JSON-RPC API definition (currently not built by top-level CMake).
networkstats/definition/CMakeLists.txt Add JsonGenerator docs generation for the definition (currently not built).
networkstats/THUNDER_PLUGIN_QUICK_REFERENCE.md Add quick-reference documentation for plugin architecture/usage.
networkstats/THUNDER_PLUGIN_CONVERSION.md Add conversion notes documenting migration to Thunder plugin structure.
networkstats/README_INTERNAL_PLUGIN.md Add internal-only plugin README (runtime behavior/config).
networkstats/NetworkStatsDesign_ver1.md Add design document describing architecture/sequence diagrams.
networkstats/CMakeLists.txt Add networkstats subproject build entrypoint.
legacy/LegacyWiFiManagerAPIs.cpp Add null-check after iterator creation.
legacy/LegacyNetworkAPIs.cpp Add null-check after iterator creation.
CMakeLists.txt Add add_subdirectory(networkstats) to top-level build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread networkstats/CMakeLists.txt
Comment thread networkstats/plugin/ThunderJsonRPCProvider.cpp
Comment thread networkstats/README_INTERNAL_PLUGIN.md
Comment thread networkstats/plugin/NetworkConnectionStatsImplementation.cpp
Comment thread plugin/gnome/NetworkManagerGnomeProxy.cpp
Comment thread plugin/rdk/NetworkManagerRDKProxy.cpp
Copilot AI review requested due to automatic review settings April 24, 2026 21:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the functionality previously handled by NetworkconnectionRecovery.sh into a new out-of-process Thunder plugin/module (NetworkConnectionStats), and updates NetworkManager internals for safer default-interface handling and lifecycle cleanup across backends.

Changes:

  • Added a new networkstats/ Thunder plugin (in-process wrapper + out-of-process implementation) that subscribes to NetworkManager events, performs periodic diagnostics, emits telemetry, and triggers WiFi reassociation on gateway packet-loss thresholds.
  • Refactored NetworkManager default-interface state to use mutex-protected accessors and updated multiple backends/callers accordingly.
  • Improved lifecycle/robustness in several places (platform deinit hooks, iterator null checks, GLib context cleanup paths, minor test fixes).

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Minor test formatting cleanup (whitespace removal).
tests/l2Test/libnm/l2_test_libnmproxy.cpp Fixes a duplicated EXPECT_CALL chain line and normalizes closing brace formatting.
plugin/rdk/NetworkManagerRDKProxy.cpp Uses locked default-interface accessors; adds platform deinit stub; adds iterator null check.
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Adds platform deinit stub; switches to locked default-interface setter/getter; adds iterator null check.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Fixes log typo; ensures GMainContext cleanup on error paths; logs scan request failures.
plugin/gnome/NetworkManagerGnomeProxy.cpp Replaces global NMClient with per-instance client/context; adds platform_deinit cleanup; drains isolated context before reads; improves IP address handling; adds iterator null check.
plugin/NetworkManagerJsonRpc.cpp Adds null checks after creating iterators in JSON-RPC handlers.
plugin/NetworkManagerImplementation.h Adds platform_deinit(), adds mutex-protected default-interface accessors, and stores NMClient/GMainContext for GNOME backend.
plugin/NetworkManagerImplementation.cpp Calls platform_deinit() during shutdown; switches default-interface access to accessor methods; adds iterator creation null checks.
plugin/NetworkManagerConnectivity.cpp Switches default-interface usage to accessor; threads default iface through connectivity monitor logic.
networkstats/plugin/ThunderJsonRPCProvider.h Introduces JSON-RPC-based NetworkManager provider interface for networkstats.
networkstats/plugin/ThunderJsonRPCProvider.cpp Implements JSON-RPC NetworkManager calls for IP settings, interface, ping, and event subscription.
networkstats/plugin/ThunderComRPCProvider.h Introduces COM-RPC-based NetworkManager provider interface for networkstats.
networkstats/plugin/ThunderComRPCProvider.cpp Implements COM-RPC NetworkManager calls for IP settings, interface, ping, and event subscription.
networkstats/plugin/NetworkDataProviderFactory.h Adds factory for selecting COM-RPC vs JSON-RPC provider at runtime.
networkstats/plugin/NetworkConnectionStatsLogger.h Adds logging API/macros for the new networkstats plugin.
networkstats/plugin/NetworkConnectionStatsLogger.cpp Implements logging backend (stdout/RDK logger) used by networkstats.
networkstats/plugin/NetworkConnectionStatsImplementation.h Declares out-of-process implementation: diagnostics, state machine, threads, subscriptions.
networkstats/plugin/NetworkConnectionStatsImplementation.cpp Implements periodic diagnostics, event subscription/retry, packet-loss reassociation logic, and telemetry.
networkstats/plugin/NetworkConnectionStats.h Adds in-process plugin wrapper to spawn/own out-of-process implementation.
networkstats/plugin/NetworkConnectionStats.cpp Implements plugin lifecycle for NetworkConnectionStats and configuration forwarding.
networkstats/plugin/NetworkConnectionStats.config Adds plugin config template (callsign/out-of-process locator + reporting interval/provider type).
networkstats/plugin/NetworkConnectionStats.conf.in Adds config generation template for build-time substitution.
networkstats/plugin/Module.h Adds module header for NetworkConnectionStats plugin build.
networkstats/plugin/Module.cpp Adds module declaration for NetworkConnectionStats plugin.
networkstats/plugin/INetworkData.h Adds provider abstraction used by NetworkConnectionStatsImplementation.
networkstats/plugin/CMakeLists.txt Adds build/install rules for in-process + out-of-process NetworkConnectionStats libraries and config variables.
networkstats/interface/INetworkConnectionStats.h Adds COM-RPC interface definition for NetworkConnectionStats.
networkstats/interface/CMakeLists.txt Adds ProxyStub generation/build for NetworkConnectionStats COM-RPC interface.
networkstats/definition/NetworkConnectionStats.json Adds JSON definition file for NetworkConnectionStats (documentation/spec generation).
networkstats/definition/CMakeLists.txt Adds JsonGenerator invocation for the NetworkConnectionStats definition.
networkstats/THUNDER_PLUGIN_QUICK_REFERENCE.md Adds architecture/reference documentation for the new plugin.
networkstats/THUNDER_PLUGIN_CONVERSION.md Adds conversion notes describing migration into Thunder plugin architecture.
networkstats/README_INTERNAL_PLUGIN.md Adds internal-only plugin design/readme for NetworkConnectionStats.
networkstats/NetworkStatsDesign_ver1.md Adds design document describing networkstats behavior/sequence flows.
networkstats/CMakeLists.txt Adds subproject CMake entry for networkstats.
legacy/LegacyWiFiManagerAPIs.cpp Adds iterator null check in legacy WiFi path.
legacy/LegacyNetworkAPIs.cpp Adds iterator null check in legacy network path.
CMakeLists.txt Adds add_subdirectory(networkstats) to build the new plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread networkstats/CMakeLists.txt
Comment thread networkstats/plugin/NetworkConnectionStatsImplementation.cpp
Comment thread plugin/rdk/NetworkManagerRDKProxy.cpp
Comment thread plugin/gnome/NetworkManagerGnomeProxy.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an out-of-process NetworkConnectionStats Thunder plugin intended to replace the legacy NetworkconnectionRecovery.sh behavior, while also hardening NetworkManager internals (default-interface thread safety, iterator null checks, and platform cleanup hooks) to better support event-driven network diagnostics.

Changes:

  • Added new networkstats/ out-of-process Thunder plugin (providers, state machine, config, build integration) to gather network stats and trigger WiFi recovery via NetworkManager.
  • Updated NetworkManager implementations to use locked default-interface accessors, add platform_deinit(), and add null checks around iterator creation.
  • Minor fixes/cleanup in existing libnm L2 tests and some gnome/libnm paths (log typo, additional error handling).

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/l2Test/libnm/l2_test_libnmproxyWifi.cpp Removes stray blank lines in a unit test.
tests/l2Test/libnm/l2_test_libnmproxy.cpp Fixes a duplicated mock expectation and formatting.
plugin/rdk/NetworkManagerRDKProxy.cpp Switches to locked default-interface accessor; adds iterator null checks and platform_deinit().
plugin/gnome/gdbus/NetworkManagerGdbusProxy.cpp Adds platform_deinit(), default-interface accessors, and iterator null checks.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Fixes log typo and adds additional GLib context cleanup + scan error handling.
plugin/gnome/NetworkManagerGnomeProxy.cpp Replaces global NMClient* with instance state, isolates GLib context, adds deinit and iterator null checks.
plugin/NetworkManagerJsonRpc.cpp Adds nullptr checks after iterator creation for endpoints/SSID lists.
plugin/NetworkManagerImplementation.h Adds mutex-protected default-interface accessors + forward decls for libnm/GLib types.
plugin/NetworkManagerImplementation.cpp Calls new platform_deinit() during shutdown; uses default-interface accessor.
plugin/NetworkManagerConnectivity.cpp Uses default-interface accessor for connectivity checks and reporting.
legacy/LegacyWiFiManagerAPIs.cpp Adds nullptr check after SSID iterator creation.
legacy/LegacyNetworkAPIs.cpp Adds nullptr check after endpoints iterator creation.
networkstats/plugin/ThunderJsonRPCProvider.h Adds JSON-RPC provider interface for NetworkManager data access.
networkstats/plugin/ThunderJsonRPCProvider.cpp Implements JSON-RPC provider calls to NetworkManager (GetIPSettings, Ping, events, WiFiConnect).
networkstats/plugin/ThunderComRPCProvider.h Adds COM-RPC provider interface for NetworkManager data access.
networkstats/plugin/ThunderComRPCProvider.cpp Implements COM-RPC provider calls to NetworkManager (GetIPSettings, Ping, events, WiFiConnect).
networkstats/plugin/NetworkDataProviderFactory.h Adds factory to choose COM-RPC vs JSON-RPC provider based on config.
networkstats/plugin/NetworkConnectionStatsLogger.h Adds logger API/macros for the networkstats plugin.
networkstats/plugin/NetworkConnectionStatsLogger.cpp Implements logger backend (stdout / optional RDK logger).
networkstats/plugin/NetworkConnectionStatsImplementation.h Adds out-of-process implementation with diagnostics, event subscription, and state machine.
networkstats/plugin/NetworkConnectionStatsImplementation.cpp Implements diagnostics logic, subscription retry, queue/consumer thread, timer thread, and WiFi reassociation trigger.
networkstats/plugin/NetworkConnectionStats.h Adds in-process plugin that spawns and aggregates the out-of-process implementation.
networkstats/plugin/NetworkConnectionStats.cpp Implements plugin lifecycle and out-of-process startup/teardown.
networkstats/plugin/NetworkConnectionStats.config Adds Thunder plugin config template (CMake-generated).
networkstats/plugin/NetworkConnectionStats.conf.in Adds conf.in for generating the plugin config.
networkstats/plugin/Module.h Adds module header for the networkstats plugin.
networkstats/plugin/Module.cpp Adds module declaration for the networkstats plugin.
networkstats/plugin/INetworkData.h Adds provider abstraction used by the implementation.
networkstats/plugin/CMakeLists.txt Adds build rules for in-process and out-of-process networkstats libraries.
networkstats/interface/INetworkConnectionStats.h Adds COM-RPC interface definition for NetworkConnectionStats.
networkstats/interface/CMakeLists.txt Adds ProxyStub generation/build rules for the interface.
networkstats/definition/NetworkConnectionStats.json Adds a JSON-RPC API definition file (currently not built by default).
networkstats/definition/CMakeLists.txt Adds JSON generator invocation for docs/codegen (definition build currently commented out).
networkstats/THUNDER_PLUGIN_QUICK_REFERENCE.md Adds quick reference documentation for the plugin/module architecture.
networkstats/THUNDER_PLUGIN_CONVERSION.md Adds conversion/migration documentation to Thunder plugin architecture.
networkstats/README_INTERNAL_PLUGIN.md Adds internal-only usage/design documentation.
networkstats/NetworkStatsDesign_ver1.md Adds a design document describing behavior and sequencing.
networkstats/CMakeLists.txt Adds the networkstats subproject build wiring.
CMakeLists.txt Adds add_subdirectory(networkstats) to build the new plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread networkstats/plugin/ThunderComRPCProvider.h
Comment thread networkstats/plugin/NetworkConnectionStatsImplementation.cpp
Comment thread networkstats/plugin/NetworkConnectionStatsImplementation.cpp
Comment thread CMakeLists.txt
Comment thread plugin/rdk/NetworkManagerRDKProxy.cpp
Comment thread plugin/gnome/NetworkManagerGnomeWIFI.cpp
Comment thread plugin/gnome/NetworkManagerGnomeWIFI.cpp
Comment thread networkstats/plugin/ThunderJsonRPCProvider.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants