You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RDKBDEV-3490: common-library support for IP Diagnostics upload/download test
Reason for change: Add common-library dependencies required by RDKBDEV-3490 IP Diagnostics upload/download speedtest improvements in test-and-diagnostic: microsecond precision in UserGetSystemTime, TR-143 diagnostic struct defaults with Canceled/Error_Internal states, TR-181 unsignedLong datatype support end-to-end across DSLH, SLAP, and message-bus layers, and Notify_change() in ccsp_base_api (USE_NOTIFY_COMPONENT) so test-and-diagnostic can publish UploadDownloadSpeedStatus and DiagnosticsState via Device.NotifyComponent.SetNotifi_ParamName through notify_comp to WebPA/PAM.
Test Procedure: Build and deploy with matching test-and-diagnostic PR. Trigger upload/download speed tests and verify TimeBasedTestDuration reports millisecond precision, byte counters handle values above 32-bit range, Error_Internal diagnostic state is available when interface counters are invalid, and notify_comp receives UploadDownloadSpeedStatus / DiagnosticsState updates.
Risks: Low — datatype, timing, and notify-component helper changes are shared library updates; must be merged before or with test-and-diagnostic PR.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new unsignedLong path is currently vulnerable to incorrect/truncated value rendering and there are correctness issues in the new notify/time helpers that should be fixed before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates common-library to support IP Diagnostics upload/download speedtest enhancements by improving timestamp precision, adding TR-143 diagnostic defaults/states, and enabling TR-181 unsignedLong propagation through DSLH/SLAP/message-bus layers (including an optional notify-component helper).
Changes:
Add microsecond precision to UserGetSystemTime() and extend USER_SYSTEM_TIME with a MicroSecond field.
Introduce TR-181 unsignedLong datatype support end-to-end via new CWMP datatype + SLAP ContentType tagging and message-bus handling.
Add optional Notify_change() helper (guarded by USE_NOTIFY_COMPONENT) to publish notify-component updates.
File summaries
File
Description
source/util_api/ccsp_msg_bus/ccsp_base_api.c
Adds optional Notify_change() helper using CCSP base set-parameter API.
source/ccsp/include/ccsp_base_api.h
Exposes Notify_change() API in public header.
source/util_api/ansc/include/user_time.h
Extends USER_SYSTEM_TIME with MicroSecond.
source/cosa/include/linux/user_time.h
Mirrors USER_SYSTEM_TIME update for Linux COSA include.
source/util_api/ansc/AnscPlatform/user_time.c
Implements sub-second timing in UserGetSystemTime() using clock_gettime.
source/util_api/ansc/AnscPlatform/user_runtime.c
Adds _ansc_ultoa() utility for ULONG to string conversion.
newValue is always rendered via SlapVcoUint32ToString(), which truncates to 32-bit; for SLAP_CONTENT_TYPE_UNSIGNED_LONG this defeats the purpose of advertising ccsp_unsignedLong. Render unsigned-long values with a 64-bit-capable format/buffer.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new unsignedLong plumbing currently formats values via a 32-bit string conversion path (truncating >2^32 values) and there are additional correctness/API issues in the newly added helpers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
SLAP_CONTENT_TYPE_UNSIGNED_LONG values are converted with SlapVcoUint32ToString(), which truncates to 32 bits (casts to unsigned int) and cannot represent values > 2^32-1 correctly; this breaks the new unsignedLong/StatsCounter64 plumbing.
UserGetSystemTime() mixes seconds from UserGetNtpTime(time()) with sub-second data from clock_gettime(); if the second rolls over between calls, the returned (Second, MilliSecond/MicroSecond) can be inconsistent. Use a single clock_gettime() result for both seconds and nanoseconds.
For SLAP_CONTENT_TYPE_UNSIGNED_LONG, oldValue is converted via SlapVcoUint32ToString(), which truncates to 32 bits; notifications will publish the wrong value for counters > 2^32-1.
For SLAP_CONTENT_TYPE_UNSIGNED_LONG, newValue is converted via SlapVcoUint32ToString(), which truncates to 32 bits; value-change signals will carry incorrect values for counters > 2^32-1.
if ( pNewValue->Syntax == SLAP_VAR_SYNTAX_uint32 )
{
pParamSignal->newValue = SlapVcoUint32ToString(NULL, pNewValue->Variant.varUint32);
if ( pNewValue->ContentType == SLAP_CONTENT_TYPE_UNSIGNED_LONG )
{
_ansc_ultoa() divides/modulos by radix without validating it (radix<=1 can crash), and maps digits by adding '0' which produces incorrect output for radix>10 (e.g., hex digits 10-15 become ':'..'?' instead of 'a'..'f').
while ( result )
{
result = result / radix;
counter++;
}
source/util_api/ccsp_msg_bus/ccsp_base_api.c:1046
Notify_change() takes new_value as void* but formats it with "%s" (string), so non-string callers will crash; also the sprintf_s() return handling is not robust across safeclib vs SAFEC_DUMMY_API implementations (positive error codes in real safeclib won’t be caught).
pradeeptakdas
changed the title
RDKBDEV-3490: common-library support for IP Diagnostics upload download speedtest
RDKCOM-5638: RDKBDEV-3490 common-library support for IP Diagnostics upload download speedtest
Sep 4, 2026
Summary: Align USER_SYSTEM_TIME MicroSecond copies, use one clock sample
for system time, initialize LocalTime MicroSecond, radix-guard _ansc_ultoa,
and provide Notify_change stub when USE_NOTIFY_COMPONENT is off.
Problem Description: Copilot review on common-library PR rdkcentral#134 flagged ABI
mismatch on duplicate USER_SYSTEM_TIME headers, second-boundary skew in
UserGetSystemTime, uninitialized MicroSecond in UserGetLocalTime,
Notify_change declared without a non-notify definition, and unsafe
_ansc_ultoa radix handling.
Root Cause: MicroSecond was added only in util/cosa headers; time helpers
mixed two clock samples; Notify_change was ifdef-only; _ansc_ultoa did not
validate radix.
Fix Description:
- Add MicroSecond to debug_api USER_SYSTEM_TIME headers
- Use one clock_gettime sample for calendar + sub-second fields
- Initialize MicroSecond in UserGetLocalTime
- Provide no-op Notify_change stub when USE_NOTIFY_COMPONENT is off
- Reject non-decimal radix in _ansc_ultoa
- Keep Notify_change sprintf_s check as rc < EOK (SAFEC_DUMMY / file style)
Testing Performed: Local code review against callers and safec_lib_common.h;
no functional impact for decimal ULONG path or USE_NOTIFY_COMPONENT builds.
Risk/Known Limitations: Low.
Dependencies/Prerequisites: None beyond existing RDKBDEV-3490 stack.
Security Impact: None.
Jira/References: RDKBDEV-3490, RDKCOM-5638,
rdkcentral#134
MR Link: rdkcentral#134
CcspCcMbi_ValidateINT(..., 0) is used for ccsp_unsignedInt, and the later set path still stores a 32-bit SLAP_VAR_SYNTAX_uint32. Parsing through ULONG therefore rejects valid values above LONG_MAX on ILP32, while accepting values above UINT32_MAX on LP64 and letting the subsequent uint32 conversion truncate them. Validate against the 32-bit unsigned range before this conversion.
The new getter now produces SLAP_VAR_SYNTAX_uint64, but SlapDslhParamtoSetParamValue still has no SLAP_VAR_SYNTAX_uint64 case and returns its failure status for that value. Consequently, writable unsignedLong parameters sent through this DSLH parameter-tree path cannot be set. Add a uint64/ccsp_unsignedLong serialization case to the setter switch as well.
…ad speedtest
Reason for change:
Add common-library dependencies required by RDKBDEV-3490 IP Diagnostics
upload/download speedtest improvements in test-and-diagnostic, and complete
the TR-181 unsignedLong → uint64 path so byte counters and related
unsignedLong parameters do not truncate above 4 GB (ILP32) and stay correct
on LP64.
Includes:
- Microsecond precision in UserGetSystemTime
- TR-143 diagnostic struct defaults with Canceled/Error_Internal states
- End-to-end unsignedLong via SLAP uint64 / ULONG64 across DSLH, SLAP,
and message-bus (StringToUint64 / uint64 set validation where required)
- dm_pack Uint64 accessors (Get/Set/TestParamUint64Value as 30/31/32)
- Notify_change() in ccsp_base_api (USE_NOTIFY_COMPONENT) for
UploadDownloadSpeedStatus / DiagnosticsState via notify_comp
Conflict resolution (onto RDKBDEV-3490):
Kept RDKBDEV-3490 speedtest helpers; applied datatype/path widening only.
No new product features and no removal of existing speedtest support.
Test Procedure:
Build and deploy with matching test-and-diagnostic and PandM changes.
Trigger upload/download speed tests; verify millisecond TimeBasedTestDuration,
byte counters above 32-bit range, Error_Internal when interface counters are
invalid, and notify_comp receives status updates. dm_pack XML referencing
Uint64 funcs regenerates without KeyError.
Risks:
Low to Medium — shared library datatype/timing/notify updates; must merge
with matching TAD and PandM PRs.
Priority: P2
Signed-off-by: Satish Kaluvalapalli <kaluvalapalli.satish@telekom-digital.com>
Summary: Align USER_SYSTEM_TIME MicroSecond copies, use one clock sample
for system time, initialize LocalTime MicroSecond, radix-guard _ansc_ultoa,
and provide Notify_change stub when USE_NOTIFY_COMPONENT is off.
Problem Description: Copilot review on common-library PR rdkcentral#134 flagged ABI
mismatch on duplicate USER_SYSTEM_TIME headers, second-boundary skew in
UserGetSystemTime, uninitialized MicroSecond in UserGetLocalTime,
Notify_change declared without a non-notify definition, and unsafe
_ansc_ultoa radix handling.
Root Cause: MicroSecond was added only in util/cosa headers; time helpers
mixed two clock samples; Notify_change was ifdef-only; _ansc_ultoa did not
validate radix.
Fix Description:
- Add MicroSecond to debug_api USER_SYSTEM_TIME headers
- Use one clock_gettime sample for calendar + sub-second fields
- Initialize MicroSecond in UserGetLocalTime
- Provide no-op Notify_change stub when USE_NOTIFY_COMPONENT is off
- Reject non-decimal radix in _ansc_ultoa
- Keep Notify_change sprintf_s check as rc < EOK (SAFEC_DUMMY / file style)
Testing Performed: Local code review against callers and safec_lib_common.h;
no functional impact for decimal ULONG path or USE_NOTIFY_COMPONENT builds.
Risk/Known Limitations: Low.
Dependencies/Prerequisites: None beyond existing RDKBDEV-3490 stack.
Security Impact: None.
Jira/References: RDKBDEV-3490, RDKCOM-5638,
rdkcentral#134
MR Link: rdkcentral#134
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
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.
RDKBDEV-3490: common-library support for IP Diagnostics upload/download test
Reason for change: Add common-library dependencies required by RDKBDEV-3490 IP Diagnostics upload/download speedtest improvements in test-and-diagnostic: microsecond precision in UserGetSystemTime, TR-143 diagnostic struct defaults with Canceled/Error_Internal states, TR-181 unsignedLong datatype support end-to-end across DSLH, SLAP, and message-bus layers, and Notify_change() in ccsp_base_api (USE_NOTIFY_COMPONENT) so test-and-diagnostic can publish UploadDownloadSpeedStatus and DiagnosticsState via Device.NotifyComponent.SetNotifi_ParamName through notify_comp to WebPA/PAM.
Test Procedure: Build and deploy with matching test-and-diagnostic PR. Trigger upload/download speed tests and verify TimeBasedTestDuration reports millisecond precision, byte counters handle values above 32-bit range, Error_Internal diagnostic state is available when interface counters are invalid, and notify_comp receives UploadDownloadSpeedStatus / DiagnosticsState updates.
Risks: Low — datatype, timing, and notify-component helper changes are shared library updates; must be merged before or with test-and-diagnostic PR.
Dependency:
rdkcentral/test-and-diagnostic#242
rdkcentral/provisioning-and-management#355
Priority: P2