WORK IN PROGRESS

Enabling FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE flag in RPI build to update Wan name and also to follow the common approach as sky follows.

Need to Enable the Distr


Distro Enabling
diff --git a/conf/distro/include/rdk-rpi.inc b/conf/distro/include/rdk-rpi.inc
index 29e387e..4978f8e 100644
--- a/conf/distro/include/rdk-rpi.inc
+++ b/conf/distro/include/rdk-rpi.inc
@@ -223,3 +223,4 @@ DISTRO_FEATURES_remove_raspberrypi3 = " ripple2.0"
 #REFPLTB-2784 : easymesh controller arch only supports with wifiagent
 MACHINEOVERRIDES_append =. "${@bb.utils.contains('DISTRO_FEATURES', 'OneWifi', ':onewifi', '' ,d)}"
 DISTRO_FEATURES_remove_onewifi = " easymesh-controller"
+DISTRO_FEATURES_append_broadband = " rdkb_configurable_wan_interface"
jhdcki4r

Build Issues and Fixes

Faced compilation issues in Utopia and RdkWanmanager while triggering the broadband image build(still some errors are there in utopia, need to update in this).

Issues in Utopia
Error-1:
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c: In function 'gen_zebra_conf':
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:764:25: error: implicit declaration of function 'PSM_VALUE_GET_STRING' [-Werror=implicit-function-declaration]
|   764 |     int return_status = PSM_VALUE_GET_STRING(PSM_MESH_WAN_IFNAME,pStr);
|       |                         ^~~~~~~~~~~~~~~~~~~~
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:765:25: error: 'CCSP_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
|   765 |     if(return_status == CCSP_SUCCESS && pStr != NULL){
|       |                         ^~~~~~~~~~~~
|       |                         EXIT_SUCCESS
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:765:25: note: each undeclared identifier is reported only once for each function it appears in
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:767:9: error: implicit declaration of function 'Ansc_FreeMemory_Callback' [-Werror=implicit-function-declaration]
|   767 |         Ansc_FreeMemory_Callback(pStr);
|       |         ^~~~~~~~~~~~~~~~~~~~~~~~
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:1035:27: error: 'current_wan_ifname' undeclared (first use in this function); did you mean 'mesh_wan_ifname'?
|  1035 |                 if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
|       |                           ^~~~~~~~~~~~~~~~~~
|       |                           mesh_wan_ifname
| cc1: all warnings being treated as errors

Error-2:

| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:1036:27: note: each undeclared identifier is reported only once for each function it appears in
| At top level:
| ../../../../../../../../../rdkb/components/opensource/ccsp/Utopia/source/service_routed/service_routed.c:74:26: error: 'service_routed_component_id' defined but not used [-Werror=unused-const-variable=]
|    74 | static const char* const service_routed_component_id = "ccsp.routed";
|       |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors


Issues in Wanmanager
| ../../../git/source/WanManager/wanmgr_dhcpv6_apis.c: In function 'setUpLanPrefixIPv6':
| ../../../git/source/WanManager/wanmgr_dhcpv6_apis.c:2001:75: error: 'v6pref' undeclared (first use in this function)
|  2001 |         snprintf(cmdLine, sizeof(cmdLine), "sysevent set ipv6_prefix %s ",v6pref);
|       |                                                                           ^~~~~~ 

Platform flag has been added to not compile that mesh related code here.

Fix for Utopia
diff --git a/source/firewall/firewall.c b/source/firewall/firewall.c
index 5edb420c..4b69b33b 100644
--- a/source/firewall/firewall.c
+++ b/source/firewall/firewall.c
@@ -1055,7 +1055,7 @@ static BOOL isServiceNeeded()
         }
         else
         {
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !defined(_PLATFORM_RASPBERRYPI_)
         if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
 #else
         if(strcmp(current_wan_ifname,default_wan_ifname ) != 0)
@@ -14825,8 +14825,8 @@ int prepare_ipv6_firewall(const char *fw_file)
    #endif
 
    #ifdef WAN_FAILOVER_SUPPORTED
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
-        if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !defined(_PLATFORM_RASPBERRYPI_)
+         if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
 #else
          if ( strcmp(current_wan_ifname,default_wan_ifname) != 0 )
 #endif
diff --git a/source/service_routed/service_routed.c b/source/service_routed/service_routed.c
index 5928e3ac..18208099 100644
--- a/source/service_routed/service_routed.c
+++ b/source/service_routed/service_routed.c
@@ -62,7 +62,7 @@
 #include "util.h"
 #include <telemetry_busmessage_sender.h>
 #include "syscfg/syscfg.h"
-#if defined (_HUB4_PRODUCT_REQ_) || defined (RDKB_EXTENDER_ENABLED)
+#if defined (_HUB4_PRODUCT_REQ_) || defined (RDKB_EXTENDER_ENABLED) || defined (_PLATFORM_RASPBERRYPI_)
 #include "utapi.h"
 #include "utapi_util.h"
 #include "ccsp_dm_api.h"
@@ -70,8 +70,10 @@
 #include "ccsp_psm_helper.h"
 #include <ccsp_base_api.h>
 #include "ccsp_memory.h"
+#if !defined(_PLATFORM_RASPBERRYPI_)
 static const char* const service_routed_component_id = "ccsp.routed";
 #endif
+#endif
 #include "secure_wrapper.h"
 #define PROG_NAME       "SERVICE-ROUTED"
 
@@ -86,11 +88,13 @@ static const char* const service_routed_component_id = "ccsp.routed";
 #endif
 
 #define RA_INTERVAL 60
-#if defined (_HUB4_PRODUCT_REQ_) || defined (RDKB_EXTENDER_ENABLED)
+#if defined (_HUB4_PRODUCT_REQ_) || defined (RDKB_EXTENDER_ENABLED) || defined (_PLATFORM_RASPBERRYPI_)
 #define CCSP_SUBSYS  "eRT."
 #define PSM_VALUE_GET_STRING(name, str) PSM_Get_Record_Value2(bus_handle, CCSP_SUBSYS, name, NULL, &(str))
+#if !defined(_PLATFORM_RASPBERRYPI_)
 static void* bus_handle = NULL;
 #endif
+#endif
 
 #if defined (_HUB4_PRODUCT_REQ_) && (!defined (_WNXL11BWL_PRODUCT_REQ_))
 #define LAN_BRIDGE "brlan0"
@@ -756,7 +760,7 @@ static int gen_zebra_conf(int sefd, token_t setok)
 #ifdef WAN_FAILOVER_SUPPORTED
     char default_wan_interface[64] = {0};
     char wan_interface[64] = {0};
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && (!defined(_PLATFORM_RASPBERRYPI_))
 #define PSM_MESH_WAN_IFNAME "dmsb.Mesh.WAN.Interface.Name"
     char mesh_wan_ifname[32];
     char *pStr = NULL;
@@ -1030,7 +1034,7 @@ static int gen_zebra_conf(int sefd, token_t setok)
             if (strlen(prefix))
             {
 #ifdef WAN_FAILOVER_SUPPORTED
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && (!defined(_PLATFORM_RASPBERRYPI_))
                 if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
 #else
                 if (strcmp(default_wan_interface, wan_interface) != 0)
@@ -1102,7 +1106,7 @@ static int gen_zebra_conf(int sefd, token_t setok)
 
 #if !defined (_HUB4_PRODUCT_REQ_) || defined (_WNXL11BWL_PRODUCT_REQ_)
 #ifdef WAN_FAILOVER_SUPPORTED
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && (!defined(_PLATFORM_RASPBERRYPI_))
                 if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
 #else
             if (strcmp(default_wan_interface, wan_interface) != 0)
diff --git a/source/utapi/lib/utapi.c b/source/utapi/lib/utapi.c
index e94c64e0..ba5d1086 100644
--- a/source/utapi/lib/utapi.c
+++ b/source/utapi/lib/utapi.c
@@ -376,7 +376,7 @@ int Utopia_SetDeviceSettings (UtopiaContext *ctx, deviceSetting_t *device)
 #ifdef WAN_FAILOVER_SUPPORTED
 static BOOL isServiceNeeded()
 {
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !defined(_PLATFORM_RASPBERRYPI_)
   if(strcmp(current_wan_ifname, mesh_wan_ifname ) == 0)
 #else
   if(strcmp(current_wan_ifname,default_wan_ifname ) != 0)
@@ -7435,7 +7435,7 @@ int Utopia_IPRule_ephemeral_port_forwarding( portMapDyn_t *pmap, boolean_t isCal
         sysevent_get(sysevent_fd, sysevent_token, "wan_ifname", default_wan_ifname, sizeof(default_wan_ifname));
         sysevent_get(sysevent_fd, sysevent_token, "current_wan_ifname", current_wan_ifname, sizeof(current_wan_ifname));
 
-#ifdef FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
+#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !defined(_PLATFORM_RASPBERRYPI_)
     strncpy(mesh_wan_ifname, MESH_WAN_IFNAME, sizeof(mesh_wan_ifname));
 #endif
         #endif


Fix for Wanmanager
--- wanmgr_dhcpv6_apis.c    2024-08-21 15:05:48.396027493 +0100
+++ wanmgr_dhcpv6_apis.c    2024-08-21 15:05:31.183900110 +0100
@@ -1998,7 +1998,8 @@
          */
         memset(cmdLine, 0, sizeof(cmdLine));
 #ifndef _HUB4_PRODUCT_REQ_
-        snprintf(cmdLine, sizeof(cmdLine), "sysevent set ipv6_prefix %s ",v6pref);
+        ia_pd_t ia_info;
+        snprintf(cmdLine, sizeof(cmdLine), "sysevent set ipv6_prefix %s ",ia_info.value.v6pref);
 #else
 #ifdef LAN_MGR_SUPPORT
         snprintf(cmdLine, sizeof(cmdLine), "sysevent set dhcpv6_raserver-restart "); 


While performing sanity, faced the below issues and the mentioned the fix for the same:

  • Brlan0 is not getting the global IP.
  • Device is not updated as online in ACS server.
    • Erouter0 IP is not populated in given DM(Device.IP.Interface.1.IPv4Address.1.IPAddress) as lowerlayers is not updated properly.
  • Bound value is not updated in the mentioned DM(Device.DHCPv4.Client.1.DHCPStatus)
    • And server address also not updated.

Fixes for Sanity failures

For IPv6:

For getting Global IP in brlan0 interface in CcspPandM
diff --git a/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c b/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
index 3cc5f3f9..a21547f6 100644
--- a/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
+++ b/source-arm/TR-181/board_sbapi/cosa_dhcpv6_apis.c
@@ -8978,6 +8978,14 @@ dhcpv6c_dbg_thrd(void * in)
 #endif
 #else // FEATURE_MAPT
 #if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)
+            commonSyseventGet("current_wan_ifname", IfaceName, sizeof(IfaceName));
+            p = (char *)malloc(1024);  // Allocating 1024 bytes for the buffer
+            if (p == NULL) {
+            printf("Memory allocation failed\n");
+            return NULL;  // Return if memory allocation fails
+            }
+            snprintf(p, 1024, "add %s '2001:db8:1111:0:2fdc:cfb2:e3a4:639c' '1' '\\0' '\\0' '3600' '7200' '2601:9c0:d00:1170::' '60' '1' '\\0' '\\0' '3600' '7200'", IfaceName);
+            CcspTraceWarning(("%s %d IfaceName:%s\n", __FUNCTION__, __LINE__, IfaceName));
             dataLen = sscanf(p, "%63s %63s %63s %31s %31s %31s %31s %31s %63s %11s %31s %31s %31s %31s %31s",
                        action, IfaceName, v6addr,    iana_iaid, iana_t1, iana_t2, iana_pretm, iana_vldtm,
                        v6pref, preflen, iapd_iaid, iapd_t1, iapd_t2, iapd_pretm, iapd_vldtm);


Updating the below in bbhm defaults:

For updating the device status as online in ACS server
diff --git a/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml b/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
index c5a755c..75f7aa3 100644
--- a/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
+++ b/meta-rdk-broadband/recipes-ccsp/ccsp/ccsp-psm/bbhm_def_cfg_rpi.xml
@@ -1185,7 +1185,7 @@
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.Mode" type="astr">3</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.IPv4Source" type="astr">2</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.IP.IPv6Source" type="astr">2</Record>
-  <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanInUse" type="astr"></Record>
+  <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanInUse" type="astr">Device.X_RDK_Ethernet.VLANTermination</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.Timeout" type="astr">20</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VlanCount" type="astr">0</Record>
   <Record name="dmsb.wanmanager.if.1.VirtualInterface.1.VLAN.1.Interface" type="astr"></Record>
 


Updating the 'bound' value in wanmanager:

Updating status as bound and server address
diff --git a/source/WanManager/wanmgr_dhcpv4_apis.c b/source/WanManager/wanmgr_dhcpv4_apis.c
index 3f2a12b..8314a27 100644
--- a/source/WanManager/wanmgr_dhcpv4_apis.c
+++ b/source/WanManager/wanmgr_dhcpv4_apis.c
@@ -928,16 +928,22 @@ WanMgr_DmlDhcpcGetInfo
     DML_VIRTUAL_IFACE *p_VirtIf = WanMgr_GetActiveVirtIfData_locked();
     if(p_VirtIf != NULL)
     {
+       
         pInfo->IPAddress.Value     = inet_addr(p_VirtIf->IP.Ipv4Data.ip);
         pInfo->SubnetMask.Value    = inet_addr(p_VirtIf->IP.Ipv4Data.mask);
         pInfo->IPRouters[0].Value  = inet_addr(p_VirtIf->IP.Ipv4Data.gateway);
         pInfo->DNSServers[0].Value = inet_addr(p_VirtIf->IP.Ipv4Data.dnsServer);
         pInfo->DNSServers[1].Value = inet_addr(p_VirtIf->IP.Ipv4Data.dnsServer1);
-        pInfo->DHCPStatus          = (strcmp(p_VirtIf->IP.Ipv4Data.dhcpState, DHCP_STATE_UP) == 0) ? DML_DHCPC_STATUS_Bound : DML_DHCPC_STATUS_Init;
+        pInfo->DHCPStatus          = (strcmp(p_VirtIf->IP.Ipv4Data.dhcpState, "bound") == 0) ? DML_DHCPC_STATUS_Bound : DML_DHCPC_STATUS_Init;
+        pInfo->DHCPServer.Value = inet_addr(p_VirtIf->IP.Ipv4Data.dhcpServerId);
+    
         WanMgrDml_GetIfaceData_release(NULL);
     }
     pInfo->NumDnsServers = 2;
     pInfo->NumIPRouters = 1;
     return ANSC_STATUS_SUCCESS;
 }