Skip to content

RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin#323

Open
gururaajar wants to merge 2 commits into
support/1.12.0from
topic/RDKEMW-21456
Open

RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin#323
gururaajar wants to merge 2 commits into
support/1.12.0from
topic/RDKEMW-21456

Conversation

@gururaajar

Copy link
Copy Markdown
Contributor

RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin (#282)

RDK-55826: Implement T2 Eventing in Network Manager Plugin

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 ESRGururaja_ErodeSriranganRamlingham@comcast.com

* RDK-55826: Implement T2 Eventing in Network Manager Plugin

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>

* RDK-55826: Implement T2 Eventing in Network Manager Plugin

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>

---------

Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
* RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin

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>

* RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin

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>

---------

Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
Copilot AI review requested due to automatic review settings July 10, 2026 18:46
@gururaajar gururaajar requested a review from a team as a code owner July 10, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds T2 telemetry eventing to the NetworkManager plugin and related tooling/tests, aiming to emit T2 markers for existing telemetry points (e.g., public IP, interface/internet/WiFi status, gateway MAC).

Changes:

  • Introduces USE_TELEMETRY CMake option and wires T2 (include dirs/libs + compile define) across the build.
  • Adds T2 event emission in NetworkManagerImplementation and gateway-MAC telemetry in GNOME event handling.
  • Updates L2 tests/mocks to wrap new libnm and curl symbols used by the updated code paths.

Reviewed changes

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

Show a summary per file
File Description
CMakeLists.txt Adds USE_TELEMETRY option, finds T2, and sets compile definition.
plugin/CMakeLists.txt Adds T2 include paths and links T2 libs for plugin targets when enabled.
plugin/NetworkManagerImplementation.h Declares logTelemetry() helper for T2 emission.
plugin/NetworkManagerImplementation.cpp Initializes T2 and emits new T2 events (public IP, interface/internet/WiFi status).
plugin/gnome/NetworkManagerGnomeEvents.cpp Emits gateway MAC telemetry on WiFi/Ethernet activation and minor brace cleanup.
plugin/gnome/NetworkManagerGnomeUtils.h Adds gateway MAC resolution helpers to the utils API.
plugin/gnome/NetworkManagerGnomeUtils.cpp Implements gateway IP→MAC resolution via /proc/net/arp and NM IPv4 config.
plugin/gnome/NetworkManagerGnomeWIFI.cpp Removes a stray blank line.
tools/upnp/CMakeLists.txt Switches telemetry include usage to T2_INCLUDE_DIRS and relies on top-level T2 discovery.
tools/plugincli/CMakeLists.txt Links GDBUS CLI tool against libnm libraries.
tests/mocks/LibnmWrapsMock.h Adds nm_device_get_ip4_config real symbol declaration for wrapping.
tests/mocks/LibnmWraps.h Adds wrapper interface + static entry for nm_device_get_ip4_config.
tests/mocks/LibnmWraps.cpp Adds __wrap_nm_device_get_ip4_config and forwards through mock impl.
tests/l2Test/libnm/CMakeLists.txt Wraps curl_multi_* and nm_device_get_ip4_config; links curl/libnm in L2 test.
tests/l2Test/libnm/l2_test_libnmproxyEvent.cpp Adds Curl wraps mock setup/teardown; improves NMDevice lifecycle in tests; adds eth0 activated test.

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

Comment on lines +1297 to +1306
void NetworkManagerImplementation::logTelemetry(const std::string& eventName, const std::string& message)
{
#if USE_TELEMETRY
T2ERROR t2error = t2_event_s(eventName.c_str(), const_cast<char*>(message.c_str()));
if (t2error != T2ERROR_SUCCESS) {
NMLOG_ERROR("t2_event_s(\"%s\", \"%s\") failed with error %d",
eventName.c_str(), message.c_str(), t2error);
}
#endif
}
Comment on lines 736 to 744
for (const auto callback : _notificationCallbacks) {
callback->onActiveInterfaceChange(prevActiveInterface, currentActiveinterface);
}
#if USE_TELEMETRY
NMLOG_INFO("NM_INTERFACE_STATUS = Interface changed to %s", currentActiveinterface.c_str());
logTelemetry("NM_INTERFACE_STATUS", "Interface changed to " + currentActiveinterface);
#endif
_notificationLock.Unlock();
}
Comment on lines 786 to 809
{
_notificationLock.Lock();
NMLOG_INFO("Posting onInternetStatusChange with current state as %u", (unsigned)currState);
#if USE_TELEMETRY
// Log error only when ethernet is up and there's no internet
if(currState == Exchange::INetworkManager::INTERNET_NOT_AVAILABLE &&
m_ethConnected.load() &&
interface == "eth0" &&
prevState != Exchange::INetworkManager::INTERNET_NOT_AVAILABLE)
{
NMLOG_INFO("NM_ETHERNET_CONNECTIVITY = Ethernet connectivity failed");
logTelemetry("NM_ETHERNET_CONNECTIVITY", "Ethernet connectivity failed");
}
#endif
for (const auto callback : _notificationCallbacks) {
callback->onInternetStatusChange(prevState, currState, interface);
}
#if USE_TELEMETRY
string stateStr = Core::EnumerateType<Exchange::INetworkManager::InternetStatus>(currState).Data();
NMLOG_INFO("NM_INTERNET_STATUS = %s", stateStr.c_str());
logTelemetry("NM_INTERNET_STATUS", stateStr);
#endif
_notificationLock.Unlock();
}
Comment on lines +1156 to +1160
#if USE_TELEMETRY
string stateStr = Core::EnumerateType<Exchange::INetworkManager::WiFiState>(state).Data();
NMLOG_INFO("NM_WIFI_STATUS = %s", stateStr.c_str());
logTelemetry("NM_WIFI_STATUS", stateStr);
#endif
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.

2 participants