RDKB-64184, RDKB-64546 : RFC implementation and NI CPU, Memory monitoring for CUJO 26.1 release#80
Merged
Merged
Conversation
…nd memory monitoring (#53) Reason for change: Add network intelligence (NI) support, WDA fix and NI CPU and memory monitoring Test Procedure: 1) advsec agent and network intelligence process should work as designed. Risks: Low Priority: P1 Signed-off-by: Santhosh_GujulvaJagadeesh@comcast.com
…cujo-ni.service not loaded. (#54) Reason for change: Added platform check to stop cujo-ni service only on XB8 where NI feature is supported to avoid service control errors on other platforms. Test Procedure: Flashed image, checked console logs and confirmed no "cujo-ni.service not loaded" error. Risks: Low Priority: P1 Signed-off-by: Sowmiya_Chelliah@comcast.com
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds Network Intelligence and DNS blocking RFC support to Advanced Security, including TR-181 exposure, DML handlers, startup scripting, and CPU/memory/log monitoring updates.
Changes:
- Adds new RFC data model objects and DML registration/handlers for Network Intelligence, DoH blocking, and DNS ECH blocking.
- Adds Network Intelligence startup/shutdown handling and CPU/memory recovery logic.
- Refactors supporting scripts and hardens several existing C helpers and tests.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
configure.ac |
Adds --enable-networkintel build option. |
config/TR181-AdvSecurity.xml |
Adds TR-181 objects for NI, DoH blocking, and DNS ECH blocking. |
source/AdvSecurityDml/Makefile.am |
Adds NI build flags and libev/pthread linkage. |
source/AdvSecurityDml/plugin_main.c |
Registers new RFC DML callbacks. |
source/AdvSecurityDml/cosa_adv_security_internal.h |
Adds NI/DoH/DNS ECH structs and declarations. |
source/AdvSecurityDml/cosa_adv_security_internal.c |
Adds NI init/deinit, log monitoring, syscfg hardening, and cleanup fixes. |
source/AdvSecurityDml/cosa_adv_security_dml.h |
Declares new RFC DML APIs. |
source/AdvSecurityDml/cosa_adv_security_dml.c |
Implements new RFC get/set handlers and related guard logic. |
source/AdvSecurityDml/cujoagent_dcl_api.h |
Updates CUJO socket/group constants. |
source/AdvSecurityDml/cujoagent_dcl_api.c |
Reworks CUJO socket directory creation and ownership setup. |
source/AdvSecurityDml/cosa_adv_security_webconfig.c |
Improves version parsing and frees blob data on error. |
scripts/advsec.sh |
Adds NI/DoH/DNS ECH environment, telemetry, and script refactors. |
scripts/start_adv_security.sh |
Adds enable/disable paths for NI, DoH blocking, and DNS ECH blocking. |
scripts/advsec_log_fp_status.sh |
Logs status telemetry for new RFCs and restricts command dispatch. |
scripts/advsec_cpu_mem_recovery.sh |
Adds NI memory/CPU monitoring and refactors CPU/memory collection. |
source/test/CcspAdvSecurityDmlTest/Makefile.am |
Links libev for tests. |
source/test/CcspAdvSecurityDmlTest/CcspAdvSecurityDmlTest.cpp |
Adds tests for HTTP endpoint rejection and NI memory limit APIs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| gtest_main.cpp | ||
|
|
||
| CcspAdvSecurityDmlTest_gtest_bin_LDFLAGS = -lgtest -lgmock -lgcov -pthread | ||
| CcspAdvSecurityDmlTest_gtest_bin_LDFLAGS = -lgtest -lgmock -lgcov -pthread -lev |
| MAX_MEM_HARD_LIMIT=$max_rss | ||
| fi | ||
|
|
||
| NI_ENABLE=$(dmcli eRT retv Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.NetworkIntelligence.Enable) |
Comment on lines
+159
to
+162
| if [ ${ni_rss} -eq 0 ]; then | ||
| ni_rss=$rss | ||
| ni_pss=$pss | ||
| fi |
apattu200
previously approved these changes
May 27, 2026
Comment on lines
185
to
189
| ipt4=$(grep -c CUJO /tmp/.ipt) | ||
| ipt6=$(grep -c CUJO /tmp/.ipt_v6) | ||
| ip4=$(iptables-save | grep -c CUJO) | ||
| ip6=$(ip6tables-save | grep -c CUJO) | ||
| if [ ${ipt4} != ${ip4} ] || [ ${ipt6} != ${ip6} ]; then |
Comment on lines
+159
to
+162
| if [ ${ni_rss} -eq 0 ]; then | ||
| ni_rss=$rss | ||
| ni_pss=$pss | ||
| fi |
| g_pAdvSecAgent->pAdvNetworkIntelligence_RFC = (COSA_DATAMODEL_ADVSECNETWORKINTELLIGENCE_RFC *)malloc(sizeof(COSA_DATAMODEL_ADVSECNETWORKINTELLIGENCE_RFC)); | ||
| ASSERT_NE(g_pAdvSecAgent->pAdvNetworkIntelligence_RFC, nullptr); | ||
|
|
||
| g_pAdvSecAgent->pAdvNetworkIntelligence_RFC->uMemoryLimit = 100; |
Comment on lines
+710
to
733
| X_RDKCENTRAL-COM_RFC.Feature.AdvSecDNSECHBlocking. | ||
|
|
||
| * AdvSecDNSECHBlocking_RFC_GetParamBoolValue | ||
| * AdvSecDNSECHBlocking_RFC_SetParamBoolValue | ||
|
|
||
| ***********************************************************************/ | ||
| BOOL | ||
| AdvSecDNSECHBlocking_RFC_GetParamBoolValue | ||
| ( | ||
| ANSC_HANDLE hInsContext, | ||
| char* ParamName, | ||
| BOOL* pBool | ||
| ); | ||
| BOOL | ||
| AdvSecDNSECHBlocking_RFC_SetParamBoolValue | ||
| ( | ||
| ANSC_HANDLE hInsContext, | ||
| char* ParamName, | ||
| BOOL bValue | ||
| ); | ||
| /*********************************************************************** | ||
|
|
||
| APIs for Object: | ||
|
|
apattu200
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for change:
Implemented RFCs,
Implemented CPU and Memory monitoring for cujo-qosd process.
Shell script refactoring
Test Procedure:
Risks: Low
Priority: P1
Signed-off-by: Santhosh_GujulvaJagadeesh@comcast.com