Skip to content

RDK-55826: Implement T2 Eventing in Network Manager Plugin#282

Open
gururaajar wants to merge 33 commits intodevelopfrom
topic/RDK-55826
Open

RDK-55826: Implement T2 Eventing in Network Manager Plugin#282
gururaajar wants to merge 33 commits intodevelopfrom
topic/RDK-55826

Conversation

@gururaajar
Copy link
Contributor

Reason for Change: Added T2 marker for the identified T1 telemetry markers
Test Procedure: Check whether the T2 events are received.
Priority: P1
Risks: Medium
Signed-off-by: Gururaaja ESRGururaja_ErodeSriranganRamlingham@comcast.com

Reason for Change: Added T2 marker for the identified T1 telemetry markers
Test Procedure: Check whether the T2 events are received in the elk.
Priority: P1
Risks: Medium
Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
Reason for Change: Added T2 marker for the identified T1 telemetry markers
Test Procedure: Check whether the T2 events are received in the elk.
Priority: P1
Risks: Medium
Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
@gururaajar gururaajar requested a review from a team as a code owner March 2, 2026 01:49
Copilot AI review requested due to automatic review settings March 2, 2026 01:49
Copy link
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

Adds T2 telemetry (eventing) support to the NetworkManager plugin to emit additional markers for key connectivity/WiFi lifecycle signals and related diagnostics.

Changes:

  • Introduces T2 initialization and a logTelemetry() helper, and emits new T2 events for public IP, interface changes, internet status, WiFi state, and error scenarios.
  • Adds gateway MAC discovery utilities (via NetworkManager active connection + /proc/net/arp) and reports the MAC when IP is acquired.
  • Extends CMake to optionally enable and link against the T2 telemetry dependency.

Reviewed changes

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

Show a summary per file
File Description
plugin/gnome/NetworkManagerGnomeWIFI.cpp Emits telemetry when SSID input is empty.
plugin/gnome/NetworkManagerGnomeUtils.h Declares new helper APIs for resolving gateway MAC.
plugin/gnome/NetworkManagerGnomeUtils.cpp Implements gateway MAC resolution and retrieval from active connections.
plugin/gnome/NetworkManagerGnomeEvents.cpp Hooks gateway MAC telemetry emission after IPv4 acquisition with caching.
plugin/NetworkManagerImplementation.h Declares telemetry helper and adds conditional telemetry include.
plugin/NetworkManagerImplementation.cpp Initializes T2 and emits multiple new telemetry events across state transitions.
plugin/CMakeLists.txt Adds T2 dependency discovery/defines/linking for plugin targets.
CMakeLists.txt Adds top-level USE_TELEMETRY option and T2 discovery/defines.

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

Copilot AI review requested due to automatic review settings March 2, 2026 20:22
Copy link
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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.


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

Copilot AI review requested due to automatic review settings March 3, 2026 03:04
Copy link
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

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


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

#if USE_TELEMETRY
if(ipversion == "IPv4")
{
NMLOG_INFO("****** GURU: sending T2 event for NM_PUBLIC_IPV4 = %s ******", ipaddress.c_str());
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This INFO log prints the device public IPv4 address, which can be sensitive/PII in production logs. Consider removing the IP from the log (or redact it) and/or lowering to DEBUG; the telemetry event already carries the value.

Suggested change
NMLOG_INFO("****** GURU: sending T2 event for NM_PUBLIC_IPV4 = %s ******", ipaddress.c_str());
NMLOG_INFO("****** GURU: sending T2 event for NM_PUBLIC_IPV4 ******");

Copilot uses AI. Check for mistakes.
if (iss >> ip >> hwType >> flags >> hwAddr) {
if (ip == gatewayIp && hwAddr != "00:00:00:00:00:00") {
mac = hwAddr;
NMLOG_INFO("Resolved gateway IP %s to MAC %s", gatewayIp.c_str(), mac.c_str());
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This function logs the resolved gateway MAC at INFO level. MAC addresses are typically treated as sensitive identifiers; consider lowering this to DEBUG and/or avoid logging the full MAC unless needed for diagnostics.

Suggested change
NMLOG_INFO("Resolved gateway IP %s to MAC %s", gatewayIp.c_str(), mac.c_str());
NMLOG_DEBUG("Resolved gateway IP %s to MAC %s", gatewayIp.c_str(), mac.c_str());

Copilot uses AI. Check for mistakes.
NMLOG_INFO("******** GURU: gatewayMacCache[%s] : %s ********", ifname.c_str(), gatewayMacCache[ifname].c_str());
#if USE_TELEMETRY
NMLOG_INFO("******** GURU: connected - Gateway MAC: %s ********", gatewayMac.c_str());
_instance->logTelemetry("NM_GW_MAC", gatewayMac);
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

_instance->logTelemetry(...) is called without checking _instance != nullptr, while other callbacks in this file guard _instance first. During shutdown _instance is set to nullptr (see other uses below), so this can dereference null from the event thread. Add the same _instance != nullptr guard before calling logTelemetry.

Suggested change
_instance->logTelemetry("NM_GW_MAC", gatewayMac);
if (_instance != nullptr) {
_instance->logTelemetry("NM_GW_MAC", gatewayMac);
}

Copilot uses AI. Check for mistakes.
_notificationLock.Lock();
NMLOG_INFO("Posting onWiFiStateChange (%d)", state);
#if USE_TELEMETRY
string stateStr = Core::EnumerateType<Exchange::INetworkManager::WiFiState>(state).Data();
Copy link

Choose a reason for hiding this comment

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

log always, dont need to check for state.

prevState != Exchange::INetworkManager::INTERNET_NOT_AVAILABLE)
{
NMLOG_INFO("NM_ETHERNET_FAILED = Ethernet is down, no internet");
logTelemetry("NM_ETHERNET_FAILED", "Ethernet is down, no internet");
Copy link

Choose a reason for hiding this comment

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

change the marker name to clearly indicate ethernet connectivity failed.

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.

3 participants