From 9b58ce0a42811b692bb1d2b6c7f026c816659174 Mon Sep 17 00:00:00 2001 From: aishwarya_natarajan2 Date: Wed, 9 Oct 2024 14:47:57 +0000 Subject: [PATCH 1/2] RDKBACCL-275 : Review generic rdk-b code and introduce platform specific flags Reason for change : Changes for Rdk-wan manager for BananaPi R4 Test Procedure: Build and flash the image.erouter0 should get ip Risks: None Signed-off-by: aishwarya_natarajan2 --- .../middle_layer_src/wanmgr_dml_iface_apis.c | 12 ++++++------ .../middle_layer_src/wanmgr_dml_iface_v2_apis.c | 12 ++++++------ source/WanManager/wanmgr_data.c | 4 ++-- source/WanManager/wanmgr_dhcp_legacy_apis.c | 2 +- source/WanManager/wanmgr_dhcpv6_apis.c | 16 ++++++++-------- source/WanManager/wanmgr_interface_sm.c | 8 ++++---- source/WanManager/wanmgr_main.c | 2 +- source/WanManager/wanmgr_net_utils.c | 2 +- source/WanManager/wanmgr_policy_auto_impl.c | 6 +++--- source/WanManager/wanmgr_sysevents.c | 4 ++-- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c b/source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c index cc859d7e..b7c5edf1 100644 --- a/source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c +++ b/source/TR-181/middle_layer_src/wanmgr_dml_iface_apis.c @@ -40,7 +40,7 @@ #include "wanmgr_dhcpv4_apis.h" #include "wanmgr_dhcpv6_apis.h" #include "wanmgr_data.h" -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) #include "wanmgr_utils.h" #endif @@ -337,7 +337,7 @@ BOOL WanIf_SetParamStringValue(ANSC_HANDLE hInsContext, char* ParamName, char* p if (strcmp(ParamName, "CustomConfigPath") == 0) { AnscCopyString(pWanDmlIface->CustomConfigPath, pString); -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_CUSTOM_CONFIG_PATH_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pString); #endif ret = TRUE; @@ -451,7 +451,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "ConfigureWanEnable") == 0) { pWanDmlIface->WanConfigEnabled = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_CONFIGURE_WAN_ENABLE_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->WanConfigEnabled?"true":"false"); #endif ret = TRUE; @@ -460,7 +460,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "EnableCustomConfig") == 0) { pWanDmlIface->CustomConfigEnable = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_ENABLE_CUSTOM_CONFIG_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->CustomConfigEnable?"true":"false"); #endif ret = TRUE; @@ -468,7 +468,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "EnableOperStatusMonitor") == 0) { pWanDmlIface->MonitorOperStatus = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_ENABLE_OPER_STATUS_MONITOR_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->MonitorOperStatus?"true":"false"); #endif ret = TRUE; @@ -1187,7 +1187,7 @@ BOOL WanIfCfg_SetParamStringValue(ANSC_HANDLE hInsContext, char* ParamName, char if (strcmp(ParamName, "Name") == 0) { AnscCopyString(pWanDmlIface->VirtIfList->Name, pString); -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_NAME_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pString); #endif ret = TRUE; diff --git a/source/TR-181/middle_layer_src/wanmgr_dml_iface_v2_apis.c b/source/TR-181/middle_layer_src/wanmgr_dml_iface_v2_apis.c index 39a43e2b..535f3bac 100644 --- a/source/TR-181/middle_layer_src/wanmgr_dml_iface_v2_apis.c +++ b/source/TR-181/middle_layer_src/wanmgr_dml_iface_v2_apis.c @@ -40,7 +40,7 @@ #include "wanmgr_dhcpv4_apis.h" #include "wanmgr_dhcpv6_apis.h" #include "wanmgr_data.h" -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) #include "wanmgr_utils.h" #endif @@ -417,7 +417,7 @@ BOOL WanIf_SetParamStringValue(ANSC_HANDLE hInsContext, char* ParamName, char* p if (strcmp(ParamName, "CustomConfigPath") == 0) { AnscCopyString(pWanDmlIface->CustomConfigPath, pString); -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_CUSTOM_CONFIG_PATH_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pString); #endif ret = TRUE; @@ -573,7 +573,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "ConfigureWanEnable") == 0) { pWanDmlIface->WanConfigEnabled = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_CONFIGURE_WAN_ENABLE_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->WanConfigEnabled?"true":"false"); #endif ret = TRUE; @@ -582,7 +582,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "EnableCustomConfig") == 0) { pWanDmlIface->CustomConfigEnable = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_ENABLE_CUSTOM_CONFIG_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->CustomConfigEnable?"true":"false"); #endif ret = TRUE; @@ -590,7 +590,7 @@ BOOL WanIf_SetParamBoolValue(ANSC_HANDLE hInsContext, char* ParamName, BOOL bVal if (strcmp(ParamName, "EnableOperStatusMonitor") == 0) { pWanDmlIface->MonitorOperStatus = bValue; -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_ENABLE_OPER_STATUS_MONITOR_PARAM_NAME, pWanDmlIface->uiIfaceIdx, pWanDmlIface->MonitorOperStatus?"true":"false"); #endif ret = TRUE; @@ -1737,7 +1737,7 @@ BOOL WanVirtualIf_SetParamStringValue(ANSC_HANDLE hInsContext, char* ParamName, if (strcmp(ParamName, "Name") == 0) { AnscCopyString(p_VirtIf->Name, pString); -#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) +#if defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_) WanMgr_SetRestartWanInfo(WAN_NAME_PARAM_NAME, p_VirtIf->VirIfIdx, pString); #endif ret = TRUE; diff --git a/source/WanManager/wanmgr_data.c b/source/WanManager/wanmgr_data.c index 779ee299..5c5d36d8 100644 --- a/source/WanManager/wanmgr_data.c +++ b/source/WanManager/wanmgr_data.c @@ -21,7 +21,7 @@ #include "wanmgr_data.h" #include "wanmgr_rdkbus_apis.h" -#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) extern ANSC_STATUS WanMgr_CheckAndResetV2PSMEntries(UINT IfaceCount); #endif @@ -246,7 +246,7 @@ ANSC_STATUS WanMgr_WanIfaceConfInit(WanMgr_IfaceCtrl_Data_t* pWanIfaceCtrl) } pWanIfaceCtrl->ulTotalNumbWanInterfaces = uiTotalIfaces; -#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) WanMgr_CheckAndResetV2PSMEntries(uiTotalIfaces); #endif diff --git a/source/WanManager/wanmgr_dhcp_legacy_apis.c b/source/WanManager/wanmgr_dhcp_legacy_apis.c index c8c4cf6a..d17eb6aa 100644 --- a/source/WanManager/wanmgr_dhcp_legacy_apis.c +++ b/source/WanManager/wanmgr_dhcp_legacy_apis.c @@ -1561,7 +1561,7 @@ void wanmgr_setSharedCGNAddress(char *IpAddress) } #endif//_DT_WAN_Manager_Enable_ -#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if defined(WAN_MANAGER_UNIFICATION_ENABLED) && (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) #define DEFAULT_PSM_FILE "/usr/ccsp/config/bbhm_def_cfg.xml" /* TODO : This is a function to recover v2 PSM entries if it is written with wrong values in older builds. * This should be removed after successful migration to unification builds diff --git a/source/WanManager/wanmgr_dhcpv6_apis.c b/source/WanManager/wanmgr_dhcpv6_apis.c index 120b3a62..e56b35e5 100644 --- a/source/WanManager/wanmgr_dhcpv6_apis.c +++ b/source/WanManager/wanmgr_dhcpv6_apis.c @@ -1642,7 +1642,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) { CcspTraceInfo(("assigned IPv6 address \n")); connected = TRUE; -#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM /* TODO: Assign IPv6 address on Wan Interface when received, if dhcpv6 client didn't assign on the ineterface. * Currently dibbler client will assign IA_NA to the interface. * VISM will assign the prefix on LAN interface. @@ -1672,7 +1672,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) connected = TRUE; /* Update the WAN prefix validity time in the persistent storage */ -#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM if (pDhcp6cInfoCur->prefixVltime != pNewIpcMsg->prefixVltime) { snprintf(set_value, sizeof(set_value), "%d", pNewIpcMsg->prefixVltime); @@ -1727,7 +1727,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) if (strcmp(pDhcp6cInfoCur->sitePrefix, pNewIpcMsg->sitePrefix) == 0) { CcspTraceInfo(("remove prefix \n")); -#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) && !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM syscfg_set(NULL, SYSCFG_FIELD_IPV6_PREFIX, ""); syscfg_set(NULL, SYSCFG_FIELD_PREVIOUS_IPV6_PREFIX, ""); syscfg_set_commit(NULL, SYSCFG_FIELD_IPV6_PREFIX_ADDRESS, ""); @@ -1737,7 +1737,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) } } -#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)&& !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)&& !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM /* dhcp6c receives domain name information */ if (pNewIpcMsg->domainNameAssigned && !IS_EMPTY_STRING(pNewIpcMsg->domainName)) { @@ -1771,7 +1771,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) if (strcmp(pDhcp6cInfoCur->address, guAddrPrefix)) { -#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM strncpy(pVirtIf->IP.Ipv6Data.address,guAddrPrefix, sizeof(pVirtIf->IP.Ipv6Data.address)); pNewIpcMsg->addrAssigned = true; #else @@ -1795,7 +1795,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) WANMGR_IPV6_DATA Ipv6DataTemp; wanmgr_dchpv6_get_ipc_msg_info(&(Ipv6DataTemp), pNewIpcMsg); -#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_))//Do not compare if pdIfAddress and sitePrefix is empty. pdIfAddress Will be calculated while configuring LAN prefix. //TODO: V6 handled in PAM +#if defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE) || (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_))//Do not compare if pdIfAddress and sitePrefix is empty. pdIfAddress Will be calculated while configuring LAN prefix. //TODO: V6 handled in PAM if ((strlen(Ipv6DataTemp.address) > 0 && strcmp(Ipv6DataTemp.address, pDhcp6cInfoCur->address)) || ((Ipv6DataTemp.pdIfAddress) && (strlen(Ipv6DataTemp.pdIfAddress) > 0)&& (strcmp(Ipv6DataTemp.pdIfAddress, pDhcp6cInfoCur->pdIfAddress))) || @@ -1826,7 +1826,7 @@ ANSC_STATUS wanmgr_handle_dhcpv6_event_data(DML_VIRTUAL_IFACE * pVirtIf) /*TODO: Revisit this*/ //call function for changing the prlft and vallft // FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE : Handle Ip renew in handler thread. -#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM if ((WanManager_Ipv6AddrUtil(pVirtIf->Name, SET_LFT, pNewIpcMsg->prefixPltime, pNewIpcMsg->prefixVltime) < 0)) { CcspTraceError(("Life Time Setting Failed")); @@ -1906,7 +1906,7 @@ int setUpLanPrefixIPv6(DML_VIRTUAL_IFACE* pVirtIf) CcspTraceInfo(("%s %d Updating SYSEVENT_CURRENT_WAN_IFNAME %s\n", __FUNCTION__, __LINE__,pVirtIf->IP.Ipv6Data.ifname)); sysevent_set(sysevent_fd, sysevent_token, SYSEVENT_CURRENT_WAN_IFNAME, pVirtIf->IP.Ipv6Data.ifname, 0); -#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: V6 handled in PAM +#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: V6 handled in PAM /* Enable accept ra */ WanMgr_Configure_accept_ra(pVirtIf, TRUE); diff --git a/source/WanManager/wanmgr_interface_sm.c b/source/WanManager/wanmgr_interface_sm.c index 85ee62ee..0d82f1b1 100644 --- a/source/WanManager/wanmgr_interface_sm.c +++ b/source/WanManager/wanmgr_interface_sm.c @@ -1023,7 +1023,7 @@ static int checkIpv6AddressAssignedToBridge(char *IfaceName) char lanPrefix[BUFLEN_128] = {0}; int ret = RETURN_ERR; -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) && !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)//TODO: V6 handled in PAM +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) && !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)//TODO: V6 handled in PAM CcspTraceWarning(("%s %d Ipv6 handled in PAM. No need to check here. \n",__FUNCTION__, __LINE__)); return RETURN_OK; #endif @@ -1262,7 +1262,7 @@ static int wan_tearDownIPv4(WanMgr_IfaceSM_Controller_t * pWanIfaceCtrl) DML_WAN_IFACE * pInterface = pWanIfaceCtrl->pIfaceData; DML_VIRTUAL_IFACE* p_VirtIf = WanMgr_getVirtualIfaceById(pInterface->VirtIfList, pWanIfaceCtrl->VirIfIdx); -#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: XB devices use the DNS of primary for backup. +#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: XB devices use the DNS of primary for backup. /** Reset IPv4 DNS configuration. */ if (RETURN_OK != wan_updateDNS(pWanIfaceCtrl, FALSE, (p_VirtIf->IP.Ipv6Status == WAN_IFACE_IPV6_STATE_UP))) { @@ -1386,7 +1386,7 @@ static int wan_setUpIPv6(WanMgr_IfaceSM_Controller_t * pWanIfaceCtrl) } wanmgr_services_restart(); -#if !defined (_XB6_PRODUCT_REQ_) && !defined (_CBR2_PRODUCT_REQ_) && !defined(_PLATFORM_RASPBERRYPI_) //parodus uses cmac for xb platforms +#if !defined (_XB6_PRODUCT_REQ_) && !defined (_CBR2_PRODUCT_REQ_) && !defined(_PLATFORM_RASPBERRYPI_) && !defined(_PLATFORM_BANANAPI_R4_) //parodus uses cmac for xb platforms // set wan mac because parodus depends on it to start. if(ANSC_STATUS_SUCCESS == WanManager_get_interface_mac(p_VirtIf->IP.Ipv6Data.ifname, ifaceMacAddress, sizeof(ifaceMacAddress))) { @@ -1415,7 +1415,7 @@ static int wan_tearDownIPv6(WanMgr_IfaceSM_Controller_t * pWanIfaceCtrl) DML_WAN_IFACE * pInterface = pWanIfaceCtrl->pIfaceData; DML_VIRTUAL_IFACE* p_VirtIf = WanMgr_getVirtualIfaceById(pInterface->VirtIfList, pWanIfaceCtrl->VirIfIdx); -#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: XB devices use the DNS of primary for backup. +#if !(defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: XB devices use the DNS of primary for backup. /** Reset IPv6 DNS configuration. */ if (RETURN_OK == wan_updateDNS(pWanIfaceCtrl, (p_VirtIf->IP.Ipv4Status == WAN_IFACE_IPV4_STATE_UP), FALSE)) { diff --git a/source/WanManager/wanmgr_main.c b/source/WanManager/wanmgr_main.c index 0083f0ba..7f5c6170 100644 --- a/source/WanManager/wanmgr_main.c +++ b/source/WanManager/wanmgr_main.c @@ -64,7 +64,7 @@ #include "ccsp_dm_api.h" #include "webconfig_framework.h" -#if defined (_HUB4_PRODUCT_REQ_) +#if defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_BANANAPI_R4_) #include "wanmgr_rbus_handler_apis.h" #endif #define DEBUG_INI_NAME "/etc/debug.ini" diff --git a/source/WanManager/wanmgr_net_utils.c b/source/WanManager/wanmgr_net_utils.c index 83bc9e05..4f51d96b 100644 --- a/source/WanManager/wanmgr_net_utils.c +++ b/source/WanManager/wanmgr_net_utils.c @@ -558,7 +558,7 @@ uint32_t WanManager_StartDhcpv6Client(DML_VIRTUAL_IFACE* pVirtIf, IFACE_TYPE Ifa CcspTraceInfo(("Enter WanManager_StartDhcpv6Client for %s \n", pVirtIf->Name)); -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) //TODO: ipv6 handled in PAM +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: ipv6 handled in PAM //Enable accept_ra while starting dhcpv6 for comcast devices. WanMgr_Configure_accept_ra(pVirtIf, TRUE); usleep(500000); //sleep for 500 milli seconds diff --git a/source/WanManager/wanmgr_policy_auto_impl.c b/source/WanManager/wanmgr_policy_auto_impl.c index db1fb388..c8097d1e 100644 --- a/source/WanManager/wanmgr_policy_auto_impl.c +++ b/source/WanManager/wanmgr_policy_auto_impl.c @@ -120,7 +120,7 @@ static int WanMgr_RdkBus_AddAllIntfsToLanBridge (WanMgr_Policy_Controller_t * pW return ANSC_STATUS_SUCCESS; } -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: this is a workaround to support upgarde from Comcast autowan policy to Unification build #define MAX_WanModeToIfaceMap 2 static const int lastWanModeToIface_map[MAX_WanModeToIfaceMap] = {2, 1}; @@ -270,7 +270,7 @@ static void WanMgr_Policy_Auto_GetHighPriorityIface(WanMgr_Policy_Controller_t * } // pWanIfaceData - is Wan-Enabled & has valid Priority if(pWanIfaceData->Selection.Priority < iSelPriority -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) //TODO: this is a workaround to support upgarde from Comcast autowan policy to Unification build || isLastActiveLinkFromSysCfg(pWanIfaceData) #endif @@ -1261,7 +1261,7 @@ static WcAwPolicyState_t State_InterfaceReconfiguration (WanMgr_Policy_Controlle return STATE_AUTO_WAN_ERROR; } -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) // HW configuration already done using SelectedOperationalMode for XB platforms. Skipping this state. CcspTraceInfo(("%s %d: HW configuration already done using SelectedOperationalMode.\n", __FUNCTION__, __LINE__)); return Transition_ActivatingInterface (pWanController); diff --git a/source/WanManager/wanmgr_sysevents.c b/source/WanManager/wanmgr_sysevents.c index 2629d296..fd111dfe 100644 --- a/source/WanManager/wanmgr_sysevents.c +++ b/source/WanManager/wanmgr_sysevents.c @@ -216,7 +216,7 @@ ANSC_STATUS wanmgr_set_Ipv4Sysevent(const WANMGR_IPV4_DATA* dhcp4Info, DEVICE_NE } sysevent_set(sysevent_fd, sysevent_token,name, dhcp4Info->ip, 0); -#if !defined (_XB6_PRODUCT_REQ_) && !defined (_CBR2_PRODUCT_REQ_) && !defined(_PLATFORM_RASPBERRYPI_) //parodus uses cmac for xb platforms +#if !defined (_XB6_PRODUCT_REQ_) && !defined (_CBR2_PRODUCT_REQ_) && !defined(_PLATFORM_RASPBERRYPI_) && !defined(_PLATFORM_BANANAPI_R4_) //parodus uses cmac for xb platforms // set wan mac because parodus depends on it to start. if(ANSC_STATUS_SUCCESS == WanManager_get_interface_mac(dhcp4Info->ifname, ifaceMacAddress, sizeof(ifaceMacAddress))) { @@ -1208,7 +1208,7 @@ int Force_IPv6_toggle (char* wanInterface) void wanmgr_Ipv6Toggle (void) { char v6Toggle[BUFLEN_128] = {0}; -#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_)) && !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)//TODO: V6 handled in PAM +#if (defined (_XB6_PRODUCT_REQ_) || defined (_CBR2_PRODUCT_REQ_) || defined(_PLATFORM_RASPBERRYPI_) || defined(_PLATFORM_BANANAPI_R4_)) && !defined(FEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE)//TODO: V6 handled in PAM /*Ipv6 handled in PAM. No Toggle Needed. */ return; #endif From ae6d02d50e2d4198572634fc6283db18e420b581 Mon Sep 17 00:00:00 2001 From: anatar818 <151121941+anatar818@users.noreply.github.com> Date: Sat, 12 Oct 2024 18:46:55 +0530 Subject: [PATCH 2/2] Update wanmgr_main.c --- source/WanManager/wanmgr_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/WanManager/wanmgr_main.c b/source/WanManager/wanmgr_main.c index 7f5c6170..0083f0ba 100644 --- a/source/WanManager/wanmgr_main.c +++ b/source/WanManager/wanmgr_main.c @@ -64,7 +64,7 @@ #include "ccsp_dm_api.h" #include "webconfig_framework.h" -#if defined (_HUB4_PRODUCT_REQ_) || defined(_PLATFORM_BANANAPI_R4_) +#if defined (_HUB4_PRODUCT_REQ_) #include "wanmgr_rbus_handler_apis.h" #endif #define DEBUG_INI_NAME "/etc/debug.ini"