Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8fb5aa9
SHARMAN-4012: Add auto publish sub DHCPv4/v6 with current lease type
aadhithan01 Apr 8, 2026
9d449c7
Fix: Return NULL instead of void in WanMgr Subscribe/UnSubscribe DHCP…
aadhithan01 Apr 9, 2026
63d5b6b
Adding Debug message
aadhithan01 Apr 13, 2026
e8c87bb
Handle missing DHCP event fields safely
aadhithan01 Apr 13, 2026
dc5e8c2
Fix DHCP client event null handling
aadhithan01 Apr 13, 2026
33c4450
Remove debug logs from DHCP client events
aadhithan01 Apr 13, 2026
235bdba
Merge branch 'main' into Sharman-4012
aadhithan01 Apr 13, 2026
06953a0
RDKB-64443: Fix order of interface set before subscribing Events and …
aadhithan01 Apr 15, 2026
c7a260e
Add DHCP client event debug logging
aadhithan01 Apr 15, 2026
5e38c82
Correcting CMStatus Path
aadhithan01 Apr 16, 2026
f89cfd5
Fix DHCP RBUS event IfName fallback handling
aadhithan01 Apr 27, 2026
bab5a66
Handle wrapped RBUS DHCP event payloads
aadhithan01 Apr 28, 2026
9e533b8
Revert DHCP RBUS event handler to baseline
aadhithan01 Apr 28, 2026
0b97786
Add event->data diagnostic dump before IfName lookup
aadhithan01 Apr 29, 2026
bd26274
Print rbus event type in diagnostic dump
aadhithan01 Apr 29, 2026
33b9f6e
Unwrap RBUS initialValue/value wrapper in DHCP event handler
aadhithan01 Apr 29, 2026
0bed0f5
Update DHCP RBUS event handler logic
aadhithan01 Apr 29, 2026
c3e2f71
chore: update wan manager changes
aadhithan01 Apr 30, 2026
d05cecc
chore: update wan manager changes
aadhithan01 Apr 30, 2026
e6f43fb
missing parenthesis added
aadhithan01 Apr 30, 2026
3d2fa74
resolving copilot comments
aadhithan01 Apr 30, 2026
c397978
Resolving comments
aadhithan01 May 4, 2026
0542bea
Addressing comments
aadhithan01 May 4, 2026
a06f405
Merge branch 'main' into Sharman-4012
aadhithan01 May 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 71 additions & 7 deletions source/TR-181/middle_layer_src/wanmgr_rbus_dhcp_client_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,86 @@ static void WanMgr_DhcpClientEventsHandler(rbusHandle_t handle, rbusEvent_t cons
CcspTraceError(("%s : FAILED , value is NULL\n",__FUNCTION__));
return;
}

//CcspTraceInfo(("%s %d: Received %s\n", __FUNCTION__, __LINE__, eventName));
CcspTraceInfo(("%s %d: Received %s\n", __FUNCTION__, __LINE__, eventName));
Comment thread
aadhithan01 marked this conversation as resolved.
if (strstr(eventName, DHCP_MGR_DHCPv4_TABLE) || strstr(eventName, DHCP_MGR_DHCPv6_TABLE) )
{
DhcpEventThreadArgs *eventData = malloc(sizeof(DhcpEventThreadArgs));
Comment thread
aadhithan01 marked this conversation as resolved.
Comment thread
aadhithan01 marked this conversation as resolved.
if(eventData == NULL)
{
CcspTraceError(("%s %d: Failed to allocate memory for DHCP event data\n", __FUNCTION__, __LINE__));
return;
}
memset(eventData, 0, sizeof(DhcpEventThreadArgs));
eventData->version = strstr(eventName, DHCP_MGR_DHCPv4_TABLE) ? DHCPV4 : DHCPV6;

/* Resolve the object that holds IfName/MsgType/LeaseInfo.
* RBUS wraps the payload under "initialValue" for subscribe-GET
* responses; fall back to "value" for other auto-publish shapes. */
rbusObject_t dataObj = event->data;
rbusValue_t wrappedVal = rbusObject_GetValue(event->data, "initialValue");
if ((wrappedVal != NULL) && (rbusValue_GetType(wrappedVal) == RBUS_OBJECT))
{
rbusObject_t nestedObj = rbusValue_GetObject(wrappedVal);
if (nestedObj != NULL)
{
dataObj = nestedObj;
CcspTraceInfo(("%s %d: Unwrapped payload from initialValue\n", __FUNCTION__, __LINE__));
}
}
else
{
wrappedVal = rbusObject_GetValue(event->data, "value");
if ((wrappedVal != NULL) && (rbusValue_GetType(wrappedVal) == RBUS_OBJECT))
{
rbusObject_t nestedObj = rbusValue_GetObject(wrappedVal);
if (nestedObj != NULL)
{
dataObj = nestedObj;
CcspTraceInfo(("%s %d: Unwrapped payload from value\n", __FUNCTION__, __LINE__));
}
}
}

rbusValue_t value;
value = rbusObject_GetValue(event->data, "IfName");
strncpy(eventData->ifName , rbusValue_GetString(value, NULL), sizeof(eventData->ifName)-1);
value = rbusObject_GetValue(dataObj, "IfName");
if(value == NULL)
Comment thread
aadhithan01 marked this conversation as resolved.
{
CcspTraceError(("%s %d: Failed to get IfName from event data\n", __FUNCTION__, __LINE__));
free(eventData);
return;
}

const char* ifName = rbusValue_GetString(value, NULL);
if (ifName == NULL)
{
CcspTraceError(("%s %d: IfName string is NULL in event data\n", __FUNCTION__, __LINE__));
free(eventData);
return;
}

strncpy(eventData->ifName , ifName, sizeof(eventData->ifName)-1);
CcspTraceInfo(("%s-%d : DHCP client event %s received for %s\n", __FUNCTION__, __LINE__, eventName, eventData->ifName));

value = rbusObject_GetValue(event->data, "MsgType");
value = rbusObject_GetValue(dataObj, "MsgType");
if(value == NULL)
{
CcspTraceError(("%s %d: Failed to get MsgType from event data\n", __FUNCTION__, __LINE__));
free(eventData);
return;
}
eventData->type = rbusValue_GetUInt32(value);

if(eventData->type == DHCP_LEASE_UPDATE)
{
int bytes_len=0;
value = rbusObject_GetValue(event->data, "LeaseInfo");
value = rbusObject_GetValue(dataObj, "LeaseInfo");
Comment thread
aadhithan01 marked this conversation as resolved.
if(value == NULL)
{
CcspTraceError(("%s %d: Failed to get LeaseInfo from event data\n", __FUNCTION__, __LINE__));
free(eventData);
return;
}
uint8_t const* ptr = rbusValue_GetBytes(value, &bytes_len);
if(eventData->version == DHCPV4)
{
Expand Down Expand Up @@ -185,8 +246,11 @@ void WanMgr_SubscribeDhcpClientEvents(const char *DhcpInterface)
{
rbusError_t rc = RBUS_ERROR_SUCCESS;
char eventName[64] = {0};

snprintf(eventName, sizeof(eventName), "%s.Events", DhcpInterface);
rc = rbusEvent_Subscribe(rbusHandle, eventName, WanMgr_DhcpClientEventsHandler, NULL, 60);
rbusEventSubscription_t subscription = {eventName, NULL, 0, 0, WanMgr_DhcpClientEventsHandler, NULL, NULL, NULL, true};

rc = rbusEvent_SubscribeEx(rbusHandle, &subscription, 1, 60);
if(rc != RBUS_ERROR_SUCCESS)
{
CcspTraceError(("%s %d - Failed to Subscribe %s, Error=%s \n", __FUNCTION__, __LINE__, eventName, rbusError_ToString(rc)));
Comment thread
aadhithan01 marked this conversation as resolved.
Expand Down
2 changes: 1 addition & 1 deletion source/TR-181/middle_layer_src/wanmgr_rdkbus_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ extern token_t sysevent_token;
#define CMAGENT_COMPONENT_NAME "eRT.com.cisco.spvtg.ccsp.cm"
#define CMAGENT_COMP_NAME_WITHOUTSUBSYSTEM "com.cisco.spvtg.ccsp.cm"
#define CMAGENT_COMPONENT_PATH "/com/cisco/spvtg/ccsp/cm"
#define CMAGENT_PHY_STATUS_DM_SUFFIX "CMStatus"
#define CMAGENT_PHY_STATUS_DM_SUFFIX ".CMStatus"

//Cellular Manager
#define CELLULAR_COMPONENT_NAME "eRT.com.cisco.spvtg.ccsp.cellularmanager"
Expand Down
6 changes: 6 additions & 0 deletions source/WanManager/wanmgr_interface_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3961,6 +3961,12 @@ static eWanState_t wan_state_standby(WanMgr_IfaceSM_Controller_t* pWanIfaceCtrl)
ret = wan_transition_ipv6_up(pWanIfaceCtrl);
CcspTraceInfo((" %s %d - IPv6 Address Assigned to Bridge Yet.\n", __FUNCTION__, __LINE__));
}
else
{
/* IPv6 address not ready yet, stay in standby to retry */
CcspTraceInfo((" %s %d - IPv6 address not ready, waiting...\n", __FUNCTION__, __LINE__));
return WAN_STATE_STANDBY;
Comment thread
aadhithan01 marked this conversation as resolved.
}
}
if (p_VirtIf->IP.Ipv4Status == WAN_IFACE_IPV4_STATE_UP)
{
Expand Down
7 changes: 3 additions & 4 deletions source/WanManager/wanmgr_net_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,8 @@ int WanManager_Ipv6PrefixUtil(char *ifname, Ipv6OperType opr, int preflft, int v
CcspTraceError(("%s-%d: bridge_mode sysevent get failed. \n", __FUNCTION__, __LINE__));
}
BridgeMode = atoi(Output);
CcspTraceInfo(("%s-%d: <<DEBUG>> bridge_mode sysevent value set to =%d \n", __FUNCTION__, __LINE__, BridgeMode));
CcspTraceInfo(("%s-%d: bridge_mode sysevent value set to =%d \n", __FUNCTION__, __LINE__, BridgeMode));
}

/*TODO:
*Below Code should be removed once V6 Prefix/IP is assigned on erouter0 Instead of brlan0 for sky Devices.
*/
Expand Down Expand Up @@ -515,10 +514,10 @@ int WanManager_StartDhcpv6Client(DML_VIRTUAL_IFACE* pVirtIf, IFACE_TYPE IfaceTyp

#if defined( FEATURE_RDKB_DHCP_MANAGER )
char dmlName[256] = {0};
WanMgr_SubscribeDhcpClientEvents(pVirtIf->IP.DHCPv6Iface);
snprintf( dmlName, sizeof(dmlName), "%s.Interface", pVirtIf->IP.DHCPv6Iface );
WanMgr_RdkBus_SetParamValues(DHCPMGR_COMPONENT_NAME, DHCPMGR_DBUS_PATH, dmlName, pVirtIf->Name, ccsp_string, TRUE);
Comment thread
aadhithan01 marked this conversation as resolved.
memset(dmlName, 0, sizeof(dmlName));
WanMgr_SubscribeDhcpClientEvents(pVirtIf->IP.DHCPv6Iface);

snprintf( dmlName, sizeof(dmlName), "%s.Enable", pVirtIf->IP.DHCPv6Iface );

Expand Down Expand Up @@ -634,10 +633,10 @@ int WanManager_StartDhcpv4Client(DML_VIRTUAL_IFACE* pVirtIf, char* baseInterface
}
#if defined( FEATURE_RDKB_DHCP_MANAGER )
char dmlName[256] = {0};
WanMgr_SubscribeDhcpClientEvents(pVirtIf->IP.DHCPv4Iface);
snprintf( dmlName, sizeof(dmlName), "%s.Interface", pVirtIf->IP.DHCPv4Iface );
WanMgr_RdkBus_SetParamValues(DHCPMGR_COMPONENT_NAME, DHCPMGR_DBUS_PATH, dmlName, pVirtIf->Name, ccsp_string, TRUE);
memset(dmlName, 0, sizeof(dmlName));
WanMgr_SubscribeDhcpClientEvents(pVirtIf->IP.DHCPv4Iface);
snprintf( dmlName, sizeof(dmlName), "%s.Enable", pVirtIf->IP.DHCPv4Iface );
Comment thread
aadhithan01 marked this conversation as resolved.
if (ANSC_STATUS_SUCCESS == WanMgr_RdkBus_SetParamValues(DHCPMGR_COMPONENT_NAME, DHCPMGR_DBUS_PATH, dmlName, "true", ccsp_boolean, TRUE))
{
Expand Down
Loading