Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 18 additions & 39 deletions source/dmlxdns/cosa_xdns_apis.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,14 +533,9 @@ void RefreshResolvConfEntry()
}

#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
if (strstr(resolvConfEntry, "XDNS_Multi_Profile"))
{
if (strstr(resolvConfEntry, "XDNS_Multi_Profile"))
{
continue;
}
continue;
}
#endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_

Expand Down Expand Up @@ -607,23 +602,20 @@ void RefreshResolvConfEntry()
}

#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
{
char multiprofile_flag[5] = {0};
syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag));
if (multiprofile_flag[0] == '1' && multiprofile_flag[1] == '\0')
{
char multiprofile_flag[5] = {0};
syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag));
if (multiprofile_flag[0] == '1' && multiprofile_flag[1] == '\0')
{
fprintf(fp2, "XDNS_Multi_Profile Enabled\n");
fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is Enabled\n");
}
else
{
fprintf(fp2, "XDNS_Multi_Profile Disabled\n");
fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is disabled\n");
}
fprintf(fp2, "XDNS_Multi_Profile Enabled\n");
fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is Enabled\n");
}
else
{
fprintf(fp2, "XDNS_Multi_Profile Disabled\n");
fprintf(stderr, "## CcspXDNS #### Multi Profile XDNS feature is disabled\n");
Comment on lines +610 to +616
}
}
#endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_

// at this point the temp file has entries from resolv.conf and dnsmasq_server.conf
Expand Down Expand Up @@ -1633,14 +1625,9 @@ int SetXdnsConfig()
}

#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
if (strstr(confEntry, "XDNS_Multi_Profile"))
{
if (strstr(confEntry, "XDNS_Multi_Profile"))
{
continue;
}
continue;
}
#endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_

Expand Down Expand Up @@ -1738,9 +1725,6 @@ int SetXdnsConfig()
}

#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
{
char multiprofile_flag[5] = {0};
syscfg_get(NULL, "MultiProfileXDNS", multiprofile_flag, sizeof(multiprofile_flag));
Comment on lines 1727 to 1730
Expand Down Expand Up @@ -1865,14 +1849,9 @@ int UnsetXdnsConfig()
}

#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
if (strstr(confEntry, "XDNS_Multi_Profile"))
{
if (strstr(confEntry, "XDNS_Multi_Profile"))
{
continue;
}
continue;
}
#endif // _COSA_FOR_BCI_ || _ONESTACK_PRODUCT_REQ_

Expand Down
31 changes: 6 additions & 25 deletions source/dmlxdns/cosa_xdns_dml.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,13 @@ CcspXdnsConsoleTrace(("RDK_LOG_DEBUG, Xdns %s : ENTER \n", __FUNCTION__ ));
else
{
#if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0)
{
if (syscfg_set(NULL, "XDNS_DNSSecEnable", bval) != 0)
{
CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n"));
}
else
{
fprintf(stderr, "%s [XDNS] XDNS_DNSSecEnable value is set to %s in DB\n", __FUNCTION__, bval);
}
CcspTraceError(("[XDNS] syscfg_set XDNS_DNSSecEnable failed!\n"));
}
Comment on lines 292 to +296
else
{
fprintf(stderr, "%s [XDNS] XDNS_DNSSecEnable value is set to %s in DB\n", __FUNCTION__, bval);
}
#endif // _CBR_PRODUCT_REQ_ || _ONESTACK_PRODUCT_REQ_
Comment on lines 292 to 301
if (syscfg_commit() != 0)
Expand Down Expand Up @@ -637,9 +632,6 @@ XDNS_GetParamBoolValue
if((!ind) && (rc == EOK))
{
#if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
{
char buf[5] = {0};
if (syscfg_get(NULL, "XDNS_DNSSecEnable", buf, sizeof(buf)) == 0)
Expand Down Expand Up @@ -682,9 +674,6 @@ XDNS_SetParamBoolValue
if((!ind) && (rc == EOK))
{
#if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
{
char bval[2] = {0};
if (bValue == TRUE)
Expand Down Expand Up @@ -714,14 +703,6 @@ XDNS_SetParamBoolValue
}
return TRUE;
}
#if defined(_ONESTACK_PRODUCT_REQ_)
if (!is_devicemode_business())
{
CcspTraceInfo(("[XDNS] DNSSec feature not supported in residential mode\n"));
t2_event_d("XDNS_DNSSec_NotSupported", 1);
return FALSE;
}
#endif // _ONESTACK_PRODUCT_REQ_
#endif // _CBR_PRODUCT_REQ_ || _ONESTACK_PRODUCT_REQ_
}

Expand Down
31 changes: 6 additions & 25 deletions source/dmlxdns/cosa_xdns_webconfig_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,18 +632,13 @@ int apply_XDNS_cache_ToDB(xdns_cache *tmp_xdns_cache)
else
{
#if defined(_CBR_PRODUCT_REQ_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
if (is_devicemode_business())
#endif // _ONESTACK_PRODUCT_REQ_
if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0)
{
if (syscfg_set(NULL, "XDNS_DNSSecEnable", setval) != 0)
{
fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable);
}
else
{
fprintf(stderr, "%s XDNS_DNSSecEnable value is set to %d in DB\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable);
}
fprintf(stderr, "%s syscfg_set XDNS_DNSSecEnable failed %d !!!\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable);
}
Comment on lines 634 to +638
else
{
fprintf(stderr, "%s XDNS_DNSSecEnable value is set to %d in DB\n", __FUNCTION__, tmp_xdns_cache->XdnsEnable);
}
#endif // _CBR_PRODUCT_REQ_ || _ONESTACK_PRODUCT_REQ_
Comment on lines 634 to 643
if (syscfg_commit() != 0)
Expand Down Expand Up @@ -690,16 +685,9 @@ int set_xdns_conf(xdnsdoc_t *xd, xdns_cache *tmp_xdns_cache)
}
}
#if !defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
else if (!is_devicemode_business() &&
((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->default_ipv6))) ||
((INVALID_IP != CheckIfIpIsValid(xd->default_ipv4)) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) ||
((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))))))
#else // _ONESTACK_PRODUCT_REQ_
else if ((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->default_ipv6))) ||
((INVALID_IP != CheckIfIpIsValid(xd->default_ipv4)) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) ||
((!strncmp(xd->default_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->default_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))))
#endif // _ONESTACK_PRODUCT_REQ_
{
ret = xdns_read_load_dns_ip(xd->default_ipv4, xd->default_ipv6, tmp_xdns_cache->DefaultDeviceDnsIPv4, tmp_xdns_cache->DefaultDeviceDnsIPv6);
if (0 != ret)
Expand Down Expand Up @@ -777,17 +765,10 @@ int set_xdns_conf(xdnsdoc_t *xd, xdns_cache *tmp_xdns_cache)
}
}
#if defined(_COSA_FOR_BCI_) || defined(_ONESTACK_PRODUCT_REQ_)
#if defined(_ONESTACK_PRODUCT_REQ_)
else if (is_devicemode_business() &&
((!strncmp(xd->table_param->entries[i].dns_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->table_param->entries[i].dns_ipv6))) ||
((INVALID_IP != CheckIfIpIsValid(xd->table_param->entries[i].dns_ipv4)) && (!strncmp(xd->table_param->entries[i].dns_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) ||
((!strncmp(xd->table_param->entries[i].dns_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->table_param->entries[i].dns_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))))))
#else // _ONESTACK_PRODUCT_REQ_
else if (
(!strncmp(xd->table_param->entries[i].dns_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)) && (INVALID_IP != CheckIfIpIsValid(xd->table_param->entries[i].dns_ipv6))) ||
((INVALID_IP != CheckIfIpIsValid(xd->table_param->entries[i].dns_ipv4)) && (!strncmp(xd->table_param->entries[i].dns_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))) ||
((!strncmp(xd->table_param->entries[i].dns_ipv4, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING))) && (!strncmp(xd->table_param->entries[i].dns_ipv6, USE_RDK_DEFAULT_STRING, sizeof(USE_RDK_DEFAULT_STRING)))))
#endif // _ONESTACK_PRODUCT_REQ_
{
ret = xdns_read_load_dns_ip(xd->table_param->entries[i].dns_ipv4, xd->table_param->entries[i].dns_ipv6, tmp_xdns_cache->XDNSTableList[i].DnsIPv4, tmp_xdns_cache->XDNSTableList[i].DnsIPv6);
if (0 != ret)
Expand Down
Loading