diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4e29ed9af..9863dcd46 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -2,4 +2,4 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
-* @rdkcentral/rdke_ghec_tr69_maintainer @rdkcentral/rdke_ghec_tr69_admin
+* @rdkcentral/tr69hostif-maintainers
diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml
new file mode 100644
index 000000000..c58b1b0b1
--- /dev/null
+++ b/.github/workflows/cla.yml
@@ -0,0 +1,20 @@
+name: "CLA"
+
+permissions:
+ contents: read
+ pull-requests: write
+ actions: write
+ statuses: write
+
+on:
+ issue_comment:
+ types: [created]
+ pull_request_target:
+ types: [opened, closed, synchronize]
+
+jobs:
+ CLA-Lite:
+ name: "Signature"
+ uses: rdkcentral/cmf-actions/.github/workflows/cla.yml@v1
+ secrets:
+ PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_ASSISTANT }}
diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
new file mode 100644
index 000000000..2e29b0b79
--- /dev/null
+++ b/.github/workflows/code-coverage.yml
@@ -0,0 +1,52 @@
+name: Code Coverage
+
+on:
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ execute-unit-code-coverage-report-on-release:
+ name: Test coverage report for release
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/rdkcentral/docker-rdk-ci:latest
+
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ - name: Run unit tests with coverage flags enabled
+ run: |
+ sh run_ut.sh --enable-cov
+ - name: Caculate the code coverage summary
+ run: |
+ lcov --list tr69hostif_coverage.info | grep "Lines\|Total" > /tmp/coverage_summary.txt
+ cd -
+
+ - name: Update the coverage report to Pull request using actions
+ uses: actions/github-script@v4
+ with:
+ script: |
+ const fs = require('fs');
+ const lcov_result = fs.readFileSync('/tmp/coverage_summary.txt', 'utf8');
+
+ github.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body:
+ '## Code Coverage Summary \n' +
+ ' ' +
+ '```' +
+ lcov_result +
+ '```'
+ });
+ - name: Generate the html report
+ run: |
+ genhtml tr69hostif_coverage.info --output-directory /tmp/coverage_report
+ cd -
+ - name: Upload the coverage report to Pull request using actions
+ uses: actions/upload-artifact@v4
+ with:
+ name: coverage-report
+ path: /tmp/coverage_report
diff --git a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml
index da02b8b4f..7b8c1cba1 100644
--- a/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml
+++ b/.github/workflows/fossid_integration_stateless_diffscan_target_repo.yml
@@ -1,11 +1,18 @@
name: Fossid Stateless Diff Scan
-on: pull_request
+on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+ pull-requests: read
jobs:
call-fossid-workflow:
- uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@develop
- secrets:
+ if: ${{ ! github.event.pull_request.head.repo.fork }}
+ uses: rdkcentral/build_tools_workflows/.github/workflows/fossid_integration_stateless_diffscan.yml@1.0.0
+ secrets:
FOSSID_CONTAINER_USERNAME: ${{ secrets.FOSSID_CONTAINER_USERNAME }}
FOSSID_CONTAINER_PASSWORD: ${{ secrets.FOSSID_CONTAINER_PASSWORD }}
FOSSID_HOST_USERNAME: ${{ secrets.FOSSID_HOST_USERNAME }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index abdab8f40..9872a17ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,74 +4,341 @@ All notable changes to this project will be documented in this file. Dates are d
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
-#### [1.0.12](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.11...1.0.12)
+#### [1.3.0](https://github.com/rdkcentral/tr69hostif/compare/1.2.9...1.3.0)
-- RDKEMW-2308: Secure wrapper API fixes [`#53`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/53)
-- Rebase with develop [`#55`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/55)
-- RDKEMW-1803: Add debugs for Mutex issue [`#54`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/54)
-- Fix libsyswrapper to run in background [`033ce3c`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/033ce3c77f38e3c0b8b80b98b9a8184d942ca0ba)
-- Fix libsyswrapper calls [`969dc69`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/969dc69d2bd1ad05f8597b009c91846cee3d7ea1)
-- Update Device_IP_Interface_IPv4Address.cpp [`c53c0b8`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/c53c0b8c1b7fb05b9d1d21b7fa1d91222933dcdb)
+- RDKEMW-8175:Segmented global/system-wide profile for rdke [`#316`](https://github.com/rdkcentral/tr69hostif/pull/316)
+- RDK-60387-[tr69hostif] Reduce repetitive logging [`#334`](https://github.com/rdkcentral/tr69hostif/pull/334)
+- RDKEMW-10786: Add new parameter for screencapture api [`#329`](https://github.com/rdkcentral/tr69hostif/pull/329)
+- Merge tag '1.2.9' into develop [`3fbb483`](https://github.com/rdkcentral/tr69hostif/commit/3fbb483212448f1b10d3539eca96188930d4bc0f)
-#### [1.0.11](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.10...1.0.11)
+#### [1.2.9](https://github.com/rdkcentral/tr69hostif/compare/1.2.8...1.2.9)
+
+> 5 December 2025
+
+- RDK-59250-RDKE-tr69hostif-100% L2 coverage [`#319`](https://github.com/rdkcentral/tr69hostif/pull/319)
+- RDKEMW-10639: Convert memcapture tool as RDM downloadable package [`#320`](https://github.com/rdkcentral/tr69hostif/pull/320)
+- RDKTV-39100 : [SECVULN] migrate configuration files from /opt to /opt/secure [`#318`](https://github.com/rdkcentral/tr69hostif/pull/318)
+- RDKEMW-6128: Update hostIf_IARM_ReqHandler.cpp [`#312`](https://github.com/rdkcentral/tr69hostif/pull/312)
+- Fixing the bug for ethernet interface [`#309`](https://github.com/rdkcentral/tr69hostif/pull/309)
+- 1.2.9 release changelog updates [`79e3a45`](https://github.com/rdkcentral/tr69hostif/commit/79e3a45f1b02b45bb50154f50f29ae5c2550141c)
+- Merge tag '1.2.8' into develop [`77b380c`](https://github.com/rdkcentral/tr69hostif/commit/77b380c1c7e64e5326e3357bbe6b9a35d7d51189)
+
+#### [1.2.8](https://github.com/rdkcentral/tr69hostif/compare/1.2.7...1.2.8)
+
+> 30 October 2025
+
+- RDKEMW-9754: DAC bundle config parameter as RFC [`#304`](https://github.com/rdkcentral/tr69hostif/pull/304)
+- ES1-2915-[ES1]: xPKI cert creation is failed due to unable to retrieve tr181 parameters [`#303`](https://github.com/rdkcentral/tr69hostif/pull/303)
+- RDK-59202-[RDK-V/E] Data Model Federation For tr69hostif [`#295`](https://github.com/rdkcentral/tr69hostif/pull/295)
+- 1.2.8 release changelog updates [`0717da2`](https://github.com/rdkcentral/tr69hostif/commit/0717da2a067cd28a9a13a6112599f30e5f40557f)
+- Merge tag '1.2.7' into develop [`37a3e76`](https://github.com/rdkcentral/tr69hostif/commit/37a3e7649a2d01b2edcf805006ff562a2aa5aeea)
+
+#### [1.2.7](https://github.com/rdkcentral/tr69hostif/compare/1.2.6...1.2.7)
+
+> 13 October 2025
+
+- RDK-59587 : RFC feature to support Downloadable IUI Fallback [`#291`](https://github.com/rdkcentral/tr69hostif/pull/291)
+- RDKE-900 RDKEMW-4899: Default to MTLS connection on all endpoints [`#270`](https://github.com/rdkcentral/tr69hostif/pull/270)
+- Rebase with develop [`#290`](https://github.com/rdkcentral/tr69hostif/pull/290)
+- Update CODEOWNERS [`#289`](https://github.com/rdkcentral/tr69hostif/pull/289)
+- RDKEMW-8971: fix retry logic [`#288`](https://github.com/rdkcentral/tr69hostif/pull/288)
+- Rebase with develop [`#274`](https://github.com/rdkcentral/tr69hostif/pull/274)
+- Rebase with develop [`#272`](https://github.com/rdkcentral/tr69hostif/pull/272)
+- 1.2.7 release changelog updates [`107fae2`](https://github.com/rdkcentral/tr69hostif/commit/107fae207def673e965d97899c82fe71b70f510f)
+- Merge tag '1.2.6' into develop [`2e546d5`](https://github.com/rdkcentral/tr69hostif/commit/2e546d5de878a5c8ee7a3558099cdcddc28f10a4)
+
+#### [1.2.6](https://github.com/rdkcentral/tr69hostif/compare/1.2.5...1.2.6)
+
+> 7 October 2025
+
+- RDKEMW-7921:Enable network isolation to deny SSH from Dev Jump VM to Prod VM using SHORTS [`#278`](https://github.com/rdkcentral/tr69hostif/pull/278)
+- RDK-41133 : New RFC to force maintenance every X mins [`#281`](https://github.com/rdkcentral/tr69hostif/pull/281)
+- Build error due to L1 changes [`#279`](https://github.com/rdkcentral/tr69hostif/pull/279)
+- RDK-58220 : [RDKE] Migrate Functionality In TR-69Hostif And NTP Scripts To Core Modules [`#276`](https://github.com/rdkcentral/tr69hostif/pull/276)
+- RDKEMW-6455: separate Blacklist RFC, and enabled by default [`#273`](https://github.com/rdkcentral/tr69hostif/pull/273)
+- Deploy fossid_integration_stateless_diffscan_target_repo action [`#271`](https://github.com/rdkcentral/tr69hostif/pull/271)
+- RDK-58962 [ tr69hostif ] : L1 Functional Coverage from 56% to 75-80% [`#252`](https://github.com/rdkcentral/tr69hostif/pull/252)
+- Deploy cla action [`#186`](https://github.com/rdkcentral/tr69hostif/pull/186)
+- SERXIONE-7905: Device is not accessible via SSH after DRI execution [`#267`](https://github.com/rdkcentral/tr69hostif/pull/267)
+- 1.2.6 release changelog updates [`382af71`](https://github.com/rdkcentral/tr69hostif/commit/382af7197b338cc4ec379d14fa742f160a66caca)
+- Potential fix for code scanning alert no. 10: Too few arguments to formatting function [`9e00c40`](https://github.com/rdkcentral/tr69hostif/commit/9e00c401c8a3901d0c22efaf5b06c34ecfa438ba)
+- Merge tag '1.2.5' into develop [`4be75e7`](https://github.com/rdkcentral/tr69hostif/commit/4be75e7d29ebdd31980a202d103a63d8d941d5d6)
+
+#### [1.2.5](https://github.com/rdkcentral/tr69hostif/compare/1.2.4...1.2.5)
+
+> 24 September 2025
+
+- RDK-58963-[RDK-V/E] Federated Source Code For tr69hostif - Phase 2 [`#250`](https://github.com/rdkcentral/tr69hostif/pull/250)
+- RDKEMW-8367: Add Valid Public NTP servers for community [`#255`](https://github.com/rdkcentral/tr69hostif/pull/255)
+- DELIA-68569 - WebPA Query fails for RRD Enabled command [`#235`](https://github.com/rdkcentral/tr69hostif/pull/235)
+- rebase [`#244`](https://github.com/rdkcentral/tr69hostif/pull/244)
+- RDK-57737 [ tr69hostif ] : L1 Functional Coverage from 31.2% to 75-80% [`#225`](https://github.com/rdkcentral/tr69hostif/pull/225)
+- Rebase [`#237`](https://github.com/rdkcentral/tr69hostif/pull/237)
+- Rebase [`#234`](https://github.com/rdkcentral/tr69hostif/pull/234)
+- rebase [`#231`](https://github.com/rdkcentral/tr69hostif/pull/231)
+- 1.2.5 release changelog updates [`a787aa4`](https://github.com/rdkcentral/tr69hostif/commit/a787aa4866e769fad654d2ee89f16afa21204ede)
+- Update webpa_parameter.cpp [`7b12e1f`](https://github.com/rdkcentral/tr69hostif/commit/7b12e1f3b1790899806f41f1144c17435905d450)
+- Merge tag '1.2.4' into develop [`364c312`](https://github.com/rdkcentral/tr69hostif/commit/364c312c2c7cc15d94350692024cb5142336e3e6)
+
+#### [1.2.4](https://github.com/rdkcentral/tr69hostif/compare/1.2.3...1.2.4)
+
+> 27 August 2025
+
+- RDKEMW-4759 - Review and Analyze the RRD Static Profiles for RDK devices [`#198`](https://github.com/rdkcentral/tr69hostif/pull/198)
+- RDKEMW-7135 : Gamepad RFC is not enabled by default [`#228`](https://github.com/rdkcentral/tr69hostif/pull/228)
+- RDKTV-38130-[RDKE_Trials][8.2p2s2]: Increase in "tr69hostif" crash with function "hostIf_WiFi_SSID::get_Device_WiFi_SSID_Fields" and "81598460" fingerprint [`#223`](https://github.com/rdkcentral/tr69hostif/pull/223)
+- Fix tr69hostif native build failure [`#232`](https://github.com/rdkcentral/tr69hostif/pull/232)
+- Rebase [`#209`](https://github.com/rdkcentral/tr69hostif/pull/209)
+- 1.2.4 release changelog updates [`b112be6`](https://github.com/rdkcentral/tr69hostif/commit/b112be6f22ab852b37604562d3a4341d94160cdb)
+- Merge tag '1.2.3' into develop [`84c45dd`](https://github.com/rdkcentral/tr69hostif/commit/84c45dd1c8bac75d25f06fbbc14575c02d8a153a)
+- Update Device_DeviceInfo.cpp [`5441b70`](https://github.com/rdkcentral/tr69hostif/commit/5441b702ad40eb9523499670b9254ea3fcbda0cc)
+
+#### [1.2.3](https://github.com/rdkcentral/tr69hostif/compare/1.2.2...1.2.3)
+
+> 21 August 2025
+
+- RDK-56291 - [RDKE] Increase L2 Test Coverage For Remote Debugger : Target 80% [ Phase 2 ] [`#227`](https://github.com/rdkcentral/tr69hostif/pull/227)
+- [RDKEMW-5582] -[RDKE] tr69hostif.log contains any garbage data for the paramValue field [`#219`](https://github.com/rdkcentral/tr69hostif/pull/219)
+- RDKEMW-6520: tr69hostif service starts before iarmbusd [`#218`](https://github.com/rdkcentral/tr69hostif/pull/218)
+- RDKEMW-4344 : Include the missed RFCs in RDKE. [`#216`](https://github.com/rdkcentral/tr69hostif/pull/216)
+- Update hostIf_msgHandler.cpp [`05c52c6`](https://github.com/rdkcentral/tr69hostif/commit/05c52c6c5bb363bb3f56eb62e20f766efb795bfb)
+- Update hostIf_msgHandler.cpp [`61a1355`](https://github.com/rdkcentral/tr69hostif/commit/61a1355641b0ca47ae0d24b65f6a66b80210a9d5)
+- Update hostIf_msgHandler.cpp [`b273a3a`](https://github.com/rdkcentral/tr69hostif/commit/b273a3a8f9cb9a3d570fcbc20a09b7ca97c88daf)
+
+#### [1.2.2](https://github.com/rdkcentral/tr69hostif/compare/1.2.1...1.2.2)
+
+> 29 July 2025
+
+- RDKEMW-6193 Code Coverage support for tr69hostif [`#211`](https://github.com/rdkcentral/tr69hostif/pull/211)
+- RDKEMW-6328: set AVHijack rfc to false [`#208`](https://github.com/rdkcentral/tr69hostif/pull/208)
+- RDK-58323: Canary firmware updates [`#199`](https://github.com/rdkcentral/tr69hostif/pull/199)
+- Changelog updates for release 1.2.2 [`d3eda52`](https://github.com/rdkcentral/tr69hostif/commit/d3eda5205f0cb00c7ab8bbcccb70a31a7ce29a45)
+- Merge tag '1.2.1' into develop [`17d019b`](https://github.com/rdkcentral/tr69hostif/commit/17d019b0bed5e8cc9c1f4fe68520c08fc530ff00)
+
+#### [1.2.1](https://github.com/rdkcentral/tr69hostif/compare/1.2.0...1.2.1)
+
+> 18 July 2025
+
+- RDK-58526 : Default IPControl RFC for EU partners [`#203`](https://github.com/rdkcentral/tr69hostif/pull/203)
+- RDK-57868 : Default IPControl RFC for EU partners [`#200`](https://github.com/rdkcentral/tr69hostif/pull/200)
+- RDK-57867 : Default the IUI layer separation RFC globally for EntOS [`#193`](https://github.com/rdkcentral/tr69hostif/pull/193)
+- 1.2.1 release changelog updates [`fe9e71f`](https://github.com/rdkcentral/tr69hostif/commit/fe9e71f712ffef234215145461d767ae7d1691a4)
+- Merge tag '1.2.0' into develop [`9b98df0`](https://github.com/rdkcentral/tr69hostif/commit/9b98df0330008138a47b6f18a4314df6f0a7adc1)
+
+#### [1.2.0](https://github.com/rdkcentral/tr69hostif/compare/1.1.9...1.2.0)
+
+> 27 June 2025
+
+- RDK-57649 [RDKE] - TR69HostIf Performance Monitoring and Optimized Logging [`#185`](https://github.com/rdkcentral/tr69hostif/pull/185)
+- 1.2.0 release changelog updates [`0e68c7e`](https://github.com/rdkcentral/tr69hostif/commit/0e68c7e79ca5b155a93fa1ac6a11db218486504d)
+- Merge tag '1.1.9' into develop [`083a042`](https://github.com/rdkcentral/tr69hostif/commit/083a042ce2eb4bcfc24bf95f24e8f04e897fe7c4)
+
+#### [1.1.9](https://github.com/rdkcentral/tr69hostif/compare/1.1.8...1.1.9)
+
+> 18 June 2025
+
+- RDKTV-36715: Logs flooding issue observed in tr69hostif.log [`#181`](https://github.com/rdkcentral/tr69hostif/pull/181)
+- 1.1.9 release changelog updates [`4e8c53e`](https://github.com/rdkcentral/tr69hostif/commit/4e8c53e7592386bd584e4b528e207b5931aa880b)
+- Update hostIf_IPClient_ReqHandler.cpp [`1e6bff6`](https://github.com/rdkcentral/tr69hostif/commit/1e6bff6c3773dbf6665a68ed952f687553fe6cef)
+- Merge tag '1.1.8' into develop [`39c4fc6`](https://github.com/rdkcentral/tr69hostif/commit/39c4fc61311cad2a685cb7ac15e9321fdbddc6fe)
+
+#### [1.1.8](https://github.com/rdkcentral/tr69hostif/compare/1.1.7...1.1.8)
+
+> 17 June 2025
+
+- RDKEMW-4029 Hard stop for tr69hostif service during cleanup [`#175`](https://github.com/rdkcentral/tr69hostif/pull/175)
+- RDKTV-36715: Logs flooding issue observed in tr69hostif.log "refreshInterfaceName:" [`#176`](https://github.com/rdkcentral/tr69hostif/pull/176)
+- RDK-49251 [RDK-E] L2 Test In CI Loops For Firewall [`#170`](https://github.com/rdkcentral/tr69hostif/pull/170)
+- RDKTV-36715: Logs flooding issue observed in tr69hostif.log "refreshInterfaceName:" [`#169`](https://github.com/rdkcentral/tr69hostif/pull/169)
+- RDKEMW-3396:Default AV Hijack RFC to true [`#174`](https://github.com/rdkcentral/tr69hostif/pull/174)
+- Rdkemw 4383 remove dsmgr dependency [`#168`](https://github.com/rdkcentral/tr69hostif/pull/168)
+- RDKEMW-2629 [RDKE] Review and Cleanup tr69hostif module debug and error logs [`#167`](https://github.com/rdkcentral/tr69hostif/pull/167)
+- RDKEMW-4334-InactiveApplications- tr181 parameter does not exist in data model [`#160`](https://github.com/rdkcentral/tr69hostif/pull/160)
+- RDKEMW-3656 : tr69hostif Crash in mutex unlock (#156) [`#161`](https://github.com/rdkcentral/tr69hostif/pull/161)
+- RDKEMW-3656 : tr69hostif Crash in mutex unlock [`#156`](https://github.com/rdkcentral/tr69hostif/pull/156)
+- RDK-57360 [RDK-E] L2 test framework for tr69hostif - webpa path [`#147`](https://github.com/rdkcentral/tr69hostif/pull/147)
+- 1.1.8 release changelog updates [`f762c8b`](https://github.com/rdkcentral/tr69hostif/commit/f762c8b689547f90328af5a628cd3fb4ca627eba)
+- Update data-model-generic.xml [`84456dd`](https://github.com/rdkcentral/tr69hostif/commit/84456ddcb78733197fc7737796f4053b58ac900c)
+- Hard stop for tr69hostif service during cleanup [`25a1451`](https://github.com/rdkcentral/tr69hostif/commit/25a14512db9b26453a4e9fd2e97ddf2cb9e36f59)
+
+#### [1.1.7](https://github.com/rdkcentral/tr69hostif/compare/1.1.6...1.1.7)
+
+> 14 May 2025
+
+- REFPLTV-2816: Update xconf server to golang based [`#150`](https://github.com/rdkcentral/tr69hostif/pull/150)
+- RDKEMW-3401: fetch failure in telemetry2_0 [`#148`](https://github.com/rdkcentral/tr69hostif/pull/148)
+- RDK-56291 L2 Tests And Integration With CI for Remote Debugger Dynamic Updates [`#141`](https://github.com/rdkcentral/tr69hostif/pull/141)
+- 1.1.7 release changelog updates [`4ad981f`](https://github.com/rdkcentral/tr69hostif/commit/4ad981f01d57a3a65e7aca2791b5d490be524e3b)
+- Merge tag '1.1.6' into develop [`244c520`](https://github.com/rdkcentral/tr69hostif/commit/244c520c41af34b50a4d62fdffb1ff7bce04f309)
+
+#### [1.1.6](https://github.com/rdkcentral/tr69hostif/compare/1.1.5...1.1.6)
+
+> 30 April 2025
+
+- RDK-56124-RDKE-Fix coverity issues in tr69hostif and profiles [`#105`](https://github.com/rdkcentral/tr69hostif/pull/105)
+- RDKEMW-3545: Modified MigrationStatus Default value to NOT_NEEDED [`#127`](https://github.com/rdkcentral/tr69hostif/pull/127)
+- 1.1.6 release changelog updates [`b6a0b0b`](https://github.com/rdkcentral/tr69hostif/commit/b6a0b0bd54e8593a77433b0f1b4dfb808a535cb7)
+- Merge tag '1.1.5' into develop [`852cc26`](https://github.com/rdkcentral/tr69hostif/commit/852cc26965e03dbd20a5f3b0b55782126a45b87b)
+
+#### [1.1.5](https://github.com/rdkcentral/tr69hostif/compare/1.1.4...1.1.5)
+
+> 27 April 2025
+
+- Revert "RDK-31923 : Added Enable parameter for Telemetry RFC. (#123)" [`#129`](https://github.com/rdkcentral/tr69hostif/pull/129)
+- RDK-48829 [RDK-E] L2 test framework for tr69hostif [`#124`](https://github.com/rdkcentral/tr69hostif/pull/124)
+- RDK-31923 : Added Enable parameter for Telemetry RFC. [`#123`](https://github.com/rdkcentral/tr69hostif/pull/123)
+- RDKE-778: Add logs to rdmagent [`#121`](https://github.com/rdkcentral/tr69hostif/pull/121)
+- 1.1.5 release changelog updates [`580f18d`](https://github.com/rdkcentral/tr69hostif/commit/580f18dfe6ffc25e4b6eabb889f118428cea8fc6)
+- Merge tag '1.1.4' into develop [`7b0f8e0`](https://github.com/rdkcentral/tr69hostif/commit/7b0f8e0521d97021556f7e97c7cc8e22d9cfa137)
+
+#### [1.1.4](https://github.com/rdkcentral/tr69hostif/compare/1.1.3...1.1.4)
+
+> 8 April 2025
+
+- RDK-51094 : XIONE-16968 : Add the new RFC config to data-model-generi⦠[`#115`](https://github.com/rdkcentral/tr69hostif/pull/115)
+- Tr69hostif Sync [`#114`](https://github.com/rdkcentral/tr69hostif/pull/114)
+- 1.1.4 release changelog updates [`5fbfe43`](https://github.com/rdkcentral/tr69hostif/commit/5fbfe431cd0d4a69033bdd136cf4637f32b4b9c0)
+- RDK-51094 : XIONE-16968 : Add the new RFC config to data-model-generic.xml [`8196aaa`](https://github.com/rdkcentral/tr69hostif/commit/8196aaacc5a229cf1516d69a5dc8376f7cfb122e)
+- Merge tag '1.1.3' into develop [`00f6a70`](https://github.com/rdkcentral/tr69hostif/commit/00f6a701419ca6c21563e485ecfe9a4543186af2)
+
+#### [1.1.3](https://github.com/rdkcentral/tr69hostif/compare/1.1.2...1.1.3)
+
+> 3 April 2025
+
+- [RDKE] L2 Tests And Integration With CI for Remote Debugger Dynamic Updates [`#109`](https://github.com/rdkcentral/tr69hostif/pull/109)
+- RDK-56451 [RDKE] Move tr69hostif L2 binary into common docker repo [`#106`](https://github.com/rdkcentral/tr69hostif/pull/106)
+- RDKEMW-2234: Updated MigrationStatus to persistent dir [`#103`](https://github.com/rdkcentral/tr69hostif/pull/103)
+- 1.1.3 release changelog updates [`fe5d15d`](https://github.com/rdkcentral/tr69hostif/commit/fe5d15ddda835fb13fc8bd163815a6edc360abeb)
+- Update cov_build.sh [`a47d3a4`](https://github.com/rdkcentral/tr69hostif/commit/a47d3a45f626fe914eb235beb4c4dacf88731de2)
+- Merge tag '1.1.2' into develop [`22fd47f`](https://github.com/rdkcentral/tr69hostif/commit/22fd47f6b9f069fed6121af9eac0319788f6d659)
+
+#### [1.1.2](https://github.com/rdkcentral/tr69hostif/compare/1.1.1...1.1.2)
+
+> 1 April 2025
+
+- RDKEMW-2503 : Add RFC to data model- tr69hostif [`#79`](https://github.com/rdkcentral/tr69hostif/pull/79)
+- rebase [`#100`](https://github.com/rdkcentral/tr69hostif/pull/100)
+- RDKEMW-2234: Updated MigrationStatus tr181 param [`#96`](https://github.com/rdkcentral/tr69hostif/pull/96)
+- 1.1.2 release changelog updates [`4697e26`](https://github.com/rdkcentral/tr69hostif/commit/4697e266261fb23b00b44a814b3d89d4ad3656ef)
+- Merge tag '1.1.1' into develop [`2e87e9f`](https://github.com/rdkcentral/tr69hostif/commit/2e87e9f85e3c46957dd59927fce3637175736b3c)
+
+#### [1.1.1](https://github.com/rdkcentral/tr69hostif/compare/1.1.0...1.1.1)
+
+> 27 March 2025
+
+- RDK-55702: Update the MW clients to use Power Manager Plugin [`#47`](https://github.com/rdkcentral/tr69hostif/pull/47)
+- sync to develop [`#58`](https://github.com/rdkcentral/tr69hostif/pull/58)
+- 1.1.1 release changelog updates [`1db7900`](https://github.com/rdkcentral/tr69hostif/commit/1db790041e0af21131182dd3d5c9d911253a83e2)
+- Merge tag '1.1.0' into develop [`6f7faef`](https://github.com/rdkcentral/tr69hostif/commit/6f7faef0a12bd75bbd9a1f126f60610b278b70e4)
+
+#### [1.1.0](https://github.com/rdkcentral/tr69hostif/compare/1.0.14...1.1.0)
+
+> 27 March 2025
+
+- RDK-52635 [RDKE-MW][tr69hostif] Remove all product/platform/region specific build time configs/variables/distro features [`#91`](https://github.com/rdkcentral/tr69hostif/pull/91)
+- Revert "RDK-52635 [RDKE-MW][tr69hostif] Remove all product/platform/region specific build time configs/variables/distro features" [`#90`](https://github.com/rdkcentral/tr69hostif/pull/90)
+- RDK-52635 [RDKE-MW][tr69hostif] Remove all product/platform/region specific build time configs/variables/distro features [`#69`](https://github.com/rdkcentral/tr69hostif/pull/69)
+- Feature/rdk52635 [`#78`](https://github.com/rdkcentral/tr69hostif/pull/78)
+- Merge [`#74`](https://github.com/rdkcentral/tr69hostif/pull/74)
+- Merge [`#72`](https://github.com/rdkcentral/tr69hostif/pull/72)
+- rebase [`#66`](https://github.com/rdkcentral/tr69hostif/pull/66)
+- merge [`#59`](https://github.com/rdkcentral/tr69hostif/pull/59)
+- Merge [`#52`](https://github.com/rdkcentral/tr69hostif/pull/52)
+- Revert "Revert "RDK-52635 [RDKE-MW][tr69hostif] Remove all product/platform/region specific build time configs/variables/distro features"" [`93dccdf`](https://github.com/rdkcentral/tr69hostif/commit/93dccdfb662a00c113d909488be04e98cfcd3c20)
+- Update hostIf_main.cpp [`df05ebd`](https://github.com/rdkcentral/tr69hostif/commit/df05ebdbffedbfd129ae68b32122a2b7d1280635)
+- Update hostIf_main.cpp [`42d4d33`](https://github.com/rdkcentral/tr69hostif/commit/42d4d336432611ff5b9aba5871622558919e3010)
+
+#### [1.0.14](https://github.com/rdkcentral/tr69hostif/compare/1.0.13...1.0.14)
+
+> 26 March 2025
+
+- RDK-56550 : Add new RFC value for LaunchDarkly env key [`#84`](https://github.com/rdkcentral/tr69hostif/pull/84)
+- RDK-56451 [RDKE] Move tr69hostif L2 binary into common docker repo [`#82`](https://github.com/rdkcentral/tr69hostif/pull/82)
+- RDK-56084 : Replace Script with rdm-agent for RRD Dynamic Profile [`#65`](https://github.com/rdkcentral/tr69hostif/pull/65)
+- 1.0.14 release changelog updates [`6ffeb93`](https://github.com/rdkcentral/tr69hostif/commit/6ffeb93932575399dc910e74230d69999d4017f7)
+- Merge tag '1.0.13' into develop [`0cf30c0`](https://github.com/rdkcentral/tr69hostif/commit/0cf30c03ebae0f3cab8041551b2b2b299d5e128f)
+- RDK-56082: Addressing Review Comments [`89bf58a`](https://github.com/rdkcentral/tr69hostif/commit/89bf58aeea8828adde28a4ff8bf858bbfc642e27)
+
+#### [1.0.13](https://github.com/rdkcentral/tr69hostif/compare/1.0.12...1.0.13)
+
+> 25 March 2025
+
+- RDK-56451 [RDKE] Move tr69hostif L2 binary into common docker repo [`#60`](https://github.com/rdkcentral/tr69hostif/pull/60)
+- rebase topic branch [`#73`](https://github.com/rdkcentral/tr69hostif/pull/73)
+- RDKEMW-2621:Default ReserveTTS RFC to true [`#68`](https://github.com/rdkcentral/tr69hostif/pull/68)
+- 1.0.13 release changelog updates [`f56c066`](https://github.com/rdkcentral/tr69hostif/commit/f56c066f49c0f97be48efd3d011ac42136f609dd)
+- Merge tag '1.0.12' into develop [`97eb199`](https://github.com/rdkcentral/tr69hostif/commit/97eb19993dc0220d362ea5c4602f292397d221ef)
+
+#### [1.0.12](https://github.com/rdkcentral/tr69hostif/compare/1.0.11...1.0.12)
+
+> 13 March 2025
+
+- RDKEMW-2308: Secure wrapper API fixes [`#53`](https://github.com/rdkcentral/tr69hostif/pull/53)
+- Rebase with develop [`#55`](https://github.com/rdkcentral/tr69hostif/pull/55)
+- RDKEMW-1803: Add debugs for Mutex issue [`#54`](https://github.com/rdkcentral/tr69hostif/pull/54)
+- Fix libsyswrapper to run in background [`033ce3c`](https://github.com/rdkcentral/tr69hostif/commit/033ce3c77f38e3c0b8b80b98b9a8184d942ca0ba)
+- Fix libsyswrapper calls [`969dc69`](https://github.com/rdkcentral/tr69hostif/commit/969dc69d2bd1ad05f8597b009c91846cee3d7ea1)
+- 1.0.12 release changelog updates [`4bd638b`](https://github.com/rdkcentral/tr69hostif/commit/4bd638ba5afb4a88143c18e2452694d14b6703ba)
+
+#### [1.0.11](https://github.com/rdkcentral/tr69hostif/compare/1.0.10...1.0.11)
> 11 March 2025
-- RDK-56444: Define tr181 parameter and handlers for the IUI Version [`#44`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/44)
-- Rebase from develop [`#49`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/49)
-- RDKEMW-1524: Upgrade tr69hostif to libsoup-3.0 [`#48`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/48)
-- Migrate tr69hostif to libsoup3 [`b5d1732`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/b5d173213a18e77e85efd4963af15b00442c701e)
-- RDK-56444: Add IUI version as mandatory field [`017f1ee`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/017f1ee6acb556ba6c93b9c60cb3dd993196f32e)
-- RDK-56444: Add IUI version as mandatory field [`4c04b1d`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/4c04b1d0ddc61cd292ec4eda19ce543f4d7c41b0)
+- RDK-56444: Define tr181 parameter and handlers for the IUI Version [`#44`](https://github.com/rdkcentral/tr69hostif/pull/44)
+- Rebase from develop [`#49`](https://github.com/rdkcentral/tr69hostif/pull/49)
+- RDKEMW-1524: Upgrade tr69hostif to libsoup-3.0 [`#48`](https://github.com/rdkcentral/tr69hostif/pull/48)
+- Migrate tr69hostif to libsoup3 [`b5d1732`](https://github.com/rdkcentral/tr69hostif/commit/b5d173213a18e77e85efd4963af15b00442c701e)
+- RDK-56444: Add IUI version as mandatory field [`017f1ee`](https://github.com/rdkcentral/tr69hostif/commit/017f1ee6acb556ba6c93b9c60cb3dd993196f32e)
+- RDK-56444: Add IUI version as mandatory field [`4c04b1d`](https://github.com/rdkcentral/tr69hostif/commit/4c04b1d0ddc61cd292ec4eda19ce543f4d7c41b0)
-#### [1.0.10](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.9...1.0.10)
+#### [1.0.10](https://github.com/rdkcentral/tr69hostif/compare/1.0.9...1.0.10)
> 6 March 2025
-- RDKEMW-1524: Upgrade tr69hostif to libsoup-3.0 [`#16`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/16)
-- Rebase from develop [`#37`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/37)
-- Rebase from develop [`#24`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/24)
-- Rebase with develop [`#17`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/17)
-- 1.0.10 release changelog updates [`edd483e`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/edd483ee04648fb081bff93ccc0d0b882653c6ce)
-- Merge tag '1.0.9' into develop [`763605c`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/763605c3a2489875062e530327aa801e20ea81ab)
-- Update http_server.cpp [`80a5044`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/80a5044813baeea57db9b9d505ac9522226d575d)
+- RDKEMW-1524: Upgrade tr69hostif to libsoup-3.0 [`#16`](https://github.com/rdkcentral/tr69hostif/pull/16)
+- Rebase from develop [`#37`](https://github.com/rdkcentral/tr69hostif/pull/37)
+- Rebase from develop [`#24`](https://github.com/rdkcentral/tr69hostif/pull/24)
+- Rebase with develop [`#17`](https://github.com/rdkcentral/tr69hostif/pull/17)
+- 1.0.10 release changelog updates [`edd483e`](https://github.com/rdkcentral/tr69hostif/commit/edd483ee04648fb081bff93ccc0d0b882653c6ce)
+- Merge tag '1.0.9' into develop [`763605c`](https://github.com/rdkcentral/tr69hostif/commit/763605c3a2489875062e530327aa801e20ea81ab)
+- Update http_server.cpp [`80a5044`](https://github.com/rdkcentral/tr69hostif/commit/80a5044813baeea57db9b9d505ac9522226d575d)
-#### [1.0.9](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.8...1.0.9)
+#### [1.0.9](https://github.com/rdkcentral/tr69hostif/compare/1.0.8...1.0.9)
> 5 March 2025
-- RDKEMW-1803: Add debugs for Mutex issue [`#32`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/32)
-- 1.0.9 release changelog updates [`2b1264e`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/2b1264ea3141e3a43165a6371fa363bfc6330696)
-- Merge tag '1.0.8' into develop [`6c47ac4`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/6c47ac49bc702139b011cd44eb8e0c68d8a7ea2b)
+- RDKEMW-1803: Add debugs for Mutex issue [`#32`](https://github.com/rdkcentral/tr69hostif/pull/32)
+- 1.0.9 release changelog updates [`2b1264e`](https://github.com/rdkcentral/tr69hostif/commit/2b1264ea3141e3a43165a6371fa363bfc6330696)
+- Merge tag '1.0.8' into develop [`6c47ac4`](https://github.com/rdkcentral/tr69hostif/commit/6c47ac49bc702139b011cd44eb8e0c68d8a7ea2b)
-#### [1.0.8](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.7...1.0.8)
+#### [1.0.8](https://github.com/rdkcentral/tr69hostif/compare/1.0.7...1.0.8)
> 5 March 2025
-- RDKEMW-2015 Reboot is not happening when initiating reboot using RPC.RebootNow [`f76d8b0`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/f76d8b0dd44f37faa9f4f097e3c8d179948d9ccd)
-- 1.0.8 release changelog updates [`fd82254`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/fd82254dbb56648e41ee1cf39dc3724ba6416159)
-- Merge tag '1.0.7' into develop [`48cac37`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/48cac376d46d1796963e5b6e563b719b7ffa95f0)
+- RDKEMW-2015 Reboot is not happening when initiating reboot using RPC.RebootNow [`f76d8b0`](https://github.com/rdkcentral/tr69hostif/commit/f76d8b0dd44f37faa9f4f097e3c8d179948d9ccd)
+- 1.0.8 release changelog updates [`fd82254`](https://github.com/rdkcentral/tr69hostif/commit/fd82254dbb56648e41ee1cf39dc3724ba6416159)
+- Merge tag '1.0.7' into develop [`48cac37`](https://github.com/rdkcentral/tr69hostif/commit/48cac376d46d1796963e5b6e563b719b7ffa95f0)
-#### [1.0.7](https://github.com-venkat0557/rdkcentral/tr69hostif/compare/1.0.6...1.0.7)
+#### [1.0.7](https://github.com/rdkcentral/tr69hostif/compare/1.0.6...1.0.7)
> 3 March 2025
-- RDKVREFPLT-4470:Enable https for webpa.rdkcentral.com [`#21`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/21)
-- RDK-55468 : tr69hsotif L2 test framework [`#5`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/5)
-- rebase from develop [`#20`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/20)
-- DELIA-65776 : Removal of unused attributes [`#14`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/14)
-- RDKE-697: [MEMCR] AppHibernate RFC XML tags are missed in data-model.xml [`#11`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/11)
-- RDK-55339: Add debug services RFC [`#10`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/10)
-- 1.0.7 release changelog updates [`41777d2`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/41777d2466b09db9a975a5c7ccf25ab1496d651c)
-- RDKE-697: [RDKE][MEMCR] AppHibernate RFC XML tags are missed in data-model.xml. [`28d01fd`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/28d01fd31d0dd2493126936521567190ea83b077)
-- Merge tag '1.0.6' into develop [`0b3f03f`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/0b3f03f65014dea97c4d64c71fd184f974cbf642)
+- RDKVREFPLT-4470:Enable https for webpa.rdkcentral.com [`#21`](https://github.com/rdkcentral/tr69hostif/pull/21)
+- RDK-55468 : tr69hsotif L2 test framework [`#5`](https://github.com/rdkcentral/tr69hostif/pull/5)
+- rebase from develop [`#20`](https://github.com/rdkcentral/tr69hostif/pull/20)
+- DELIA-65776 : Removal of unused attributes [`#14`](https://github.com/rdkcentral/tr69hostif/pull/14)
+- RDKE-697: [MEMCR] AppHibernate RFC XML tags are missed in data-model.xml [`#11`](https://github.com/rdkcentral/tr69hostif/pull/11)
+- RDK-55339: Add debug services RFC [`#10`](https://github.com/rdkcentral/tr69hostif/pull/10)
+- 1.0.7 release changelog updates [`41777d2`](https://github.com/rdkcentral/tr69hostif/commit/41777d2466b09db9a975a5c7ccf25ab1496d651c)
+- RDKE-697: [RDKE][MEMCR] AppHibernate RFC XML tags are missed in data-model.xml. [`28d01fd`](https://github.com/rdkcentral/tr69hostif/commit/28d01fd31d0dd2493126936521567190ea83b077)
+- Merge tag '1.0.6' into develop [`0b3f03f`](https://github.com/rdkcentral/tr69hostif/commit/0b3f03f65014dea97c4d64c71fd184f974cbf642)
#### 1.0.6
> 30 January 2025
-- RDKECMF-216 Fix names in native_full_build workflow [`#2`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/2)
-- RDKE-622 Fix warnings in tr69hostif [`#1`](https://github.com-venkat0557/rdkcentral/tr69hostif/pull/1)
-- Import of source (develop) [`db913d7`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/db913d7e78c379f68c2743350abf00b185314946)
-- 1.0.6 release changelog updates [`67c968f`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/67c968f937dc7680bfd7f48196a6e0438d7faba6)
-- Fix comments in native_full_build workflow [`b7e46af`](https://github.com-venkat0557/rdkcentral/tr69hostif/commit/b7e46af54c78bba2dd9fecfd8fb75766756aedd8)
+- RDKECMF-216 Fix names in native_full_build workflow [`#2`](https://github.com/rdkcentral/tr69hostif/pull/2)
+- RDKE-622 Fix warnings in tr69hostif [`#1`](https://github.com/rdkcentral/tr69hostif/pull/1)
+- Import of source (develop) [`db913d7`](https://github.com/rdkcentral/tr69hostif/commit/db913d7e78c379f68c2743350abf00b185314946)
+- 1.0.6 release changelog updates [`67c968f`](https://github.com/rdkcentral/tr69hostif/commit/67c968f937dc7680bfd7f48196a6e0438d7faba6)
+- Fix comments in native_full_build workflow [`b7e46af`](https://github.com/rdkcentral/tr69hostif/commit/b7e46af54c78bba2dd9fecfd8fb75766756aedd8)
diff --git a/configure.ac b/configure.ac
index 2800a2fae..25ca20954 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,30 @@ AC_ARG_ENABLE([notification],
],
[echo "Notification support is disabled"])
+AC_ARG_ENABLE([t2api],
+ AS_HELP_STRING([--enable-t2api],[enables telemetry]),
+ [
+ case "${enableval}" in
+ yes) IS_TELEMETRY2_ENABLED=true
+ T2_EVENT_FLAG=" -DT2_EVENT_ENABLED ";;
+ no) IS_TELEMETRY2_ENABLED=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-t2enable]) ;;
+ esac
+ ],
+ [echo "telemetry is disabled"])
+AM_CONDITIONAL([IS_TELEMETRY2_ENABLED], [test x$IS_TELEMETRY2_ENABLED = xtrue])
+AC_SUBST(T2_EVENT_FLAG)
+
+AC_ARG_ENABLE([powercontroller],
+[ --enable-powercontroller Enable linking WPEFrameworkPowerController],
+[case "${enableval}" in
+ yes) powercontroller=true ;;
+ no) powercontroller=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-powercontroller]) ;;
+esac],[powercontroller=false])
+AM_CONDITIONAL([POWERCONTROLLER_ENABLE], [test x$powercontroller = xtrue])
+
+
AC_ARG_ENABLE([rf4ce],
AS_HELP_STRING([--enable-rf4ce],[enable X_RDKCENTRAL_COM RF4CE profile (default is no)]),
diff --git a/cov_build.sh b/cov_build.sh
index e1e4fdb6c..a9e92048b 100644
--- a/cov_build.sh
+++ b/cov_build.sh
@@ -9,10 +9,16 @@ cd $ROOT
git clone https://github.com/rdkcentral/rfc.git
cd rfc
autoreconf -i
-./configure --enable-rfctool=yes --enable-tr181set=yes
+./configure --enable-rfctool=yes --enable-tr181set=yes --enable-tr69hostif=yes
cd rfcapi
-make librfcapi_la_CPPFLAGS="-I/usr/include/cjson"
+make librfcapi_la_CPPFLAGS="-I/usr/include/cjson -DUSE_IARMBUS"
make install
+cd ../tr181api
+cp /usr/include/cjson/cJSON.h ./
+cp /usr/local/include/wdmp-c/wdmp-c.h ./
+make AM_CXXFLAGS="-DUSE_TR69HOSTIF" && make install
+cd ../utils
+make && make install
#Build yajl - tr69 alone needs this specific version
cd $ROOT
@@ -28,10 +34,11 @@ cd $ROOT
rm -rf rdk-halif-device_settings
rm -rf rdkvhal-devicesettings-raspberrypi4
rm -rf iarmbus
+rm -rf remote_debugger
git clone https://github.com/rdkcentral/rdk-halif-device_settings.git
git clone https://github.com/rdkcentral/rdkvhal-devicesettings-raspberrypi4.git
git clone https://github.com/rdkcentral/iarmbus.git
-
+git clone https://github.com/rdkcentral/remote_debugger.git
# Build devicesettings version with fixes for native build and use that as a stub
# TODO This is not present in mainline versions. Component maintainers will have to provide this in future.
@@ -51,18 +58,26 @@ echo "Building IARMBus stubs"
cd $WORKDIR
cd ./src/unittest/stubs
g++ -fPIC -shared -o libIARMBus.so iarm_stubs.cpp -I$WORKDIR/src/hostif/parodusClient/pal -I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/parodusClient/waldb -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/include -I$WORKDIR/src/hostif/profiles/DeviceInfo -I$WORKDIR/src/hostif/parodusClient/pal -fpermissive
+g++ -fPIC -shared -o libWPEFrameworkPowerController.so powerctrl_stubs.cpp -I$WORKDIR/src/unittest/stubs -fpermissive
cp libIARMBus.so /usr/local/lib
cp libIBus.h /usr/local/include
cp libIARM.h /usr/local/include
+cp libWPEFrameworkPowerController.so /usr/local/lib/libWPEFrameworkPowerController.so
+
echo "##### Building tr69hostif module"
cd $WORKDIR
sed -i '/PKG_CHECK_MODULES(\[PROCPS\], \[libproc >= 3.2.8\])/s/^/#/' ./configure.ac
rm -f ./src/unittest/stubs/rdk_debug.h
autoreconf -i
-./configure --enable-libsoup3=yes
+./configure --enable-IPv6=yes
-make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -DLIBSOUP3_ENABLE" \
-AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lnanomsg -lIARMBus -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE"
+make AM_CXXFLAGS="-I$WORKDIR/src/unittest/stubs -I$WORKDIR/src/hostif/include -I/usr/include/cjson -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$WORKDIR/src/hostif/handlers/include -I$WORKDIR/src/hostif/parodusClient/waldb -I$WORKDIR/src/hostif/profiles/DeviceInfo -I/usr/include/cjson -I$WORKDIR/src/hostif/profiles/Time -I$WORKDIR/src/hostif/profiles/Device -I/usr/include/libsoup-3.0 -I/usr/include/yajl -I$WORKDIR/src/hostif/profiles/STBService -I$WORKDIR/src/unittest/stubs/ds -I/usr/devicesettings/ds -I/usr/local/include -I$WORKDIR/src/hostif/profiles/IP -I$WORKDIR/src/hostif/profiles/Ethernet -I/usr/local/include/rbus -I$WORKDIR/src/hostif/parodusClient/pal -I/usr/rdk-halif-device_settings/include -I/usr/local/include/libparodus -I/usr/local/include -I/usr/rdkvhal-devicesettings-raspberrypi4 -I/usr/local/include/ -I/usr/include/yajl -I/usr/tinyxml2 -I/usr/devicesettings/ds -I/$WORKDIR/src/hostif/httpserver/include -I/usr/remote_debugger/src/ -DIPV6_SUPPORT" \
+AM_LDFLAGS="-L/usr/local/lib -lrbus -lsecure_wrapper -lcurl -lrfcapi -lrdkloggers -llibparodus -lglib-2.0 -lnanomsg -lIARMBus -lWPEFrameworkPowerController -lds -ldshalcli -ldshalsrv -lwrp-c -lwdmp-c -lprocps -ltrower-base64 -lcimplog -lsoup-3.0 -L/usr/lib/x86_64-linux-gnu -lyajl -L/usr/local/lib/x86_64-linux-gnu -ltinyxml2" CXXFLAGS="-fpermissive -DPARODUS_ENABLE -DUSE_REMOTE_DEBUGGER"
make install
+cd ./src/hostif/parodusClient/pal/mock-parodus/
+sh mock_parodus_build.sh
+
+ln -sf /usr/local/bin/tr181 /usr/bin/tr181Set
+rbuscli set Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable boolean true
diff --git a/dependent_rdk_pkg_installer.sh b/dependent_rdk_pkg_installer.sh
new file mode 100644
index 000000000..d4bc1afd4
--- /dev/null
+++ b/dependent_rdk_pkg_installer.sh
@@ -0,0 +1,111 @@
+##########################################################################
+# If not stated otherwise in this file or this component's LICENSE
+# file the following copyright and licenses apply:
+#
+# Copyright 2024 RDK Management
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##########################################################################
+
+# Clone and build rbus
+export RBUS_ROOT=/usr
+export RBUS_INSTALL_DIR=${RBUS_ROOT}/local
+mkdir -p $RBUS_INSTALL_DIR
+cd $RBUS_ROOT
+
+
+WORKDIR=/opt/WORKDIR
+mkdir -p $WORKDIR
+
+cd $WORKDIR
+git clone https://github.com/xmidt-org/trower-base64.git
+cd trower-base64
+meson setup build
+ninja -C build
+ninja -C build install
+cd $WORKDIR
+rm -rf trower-base64
+
+# cJson flavor used in RDK stack
+cd $WORKDIR
+git clone https://github.com/DaveGamble/cJSON.git
+cd cJSON
+mkdir build
+cd build
+cmake ..
+make && make install
+cd $WORKDIR
+rm -rf cJSON
+
+# Include WDMP package
+cd $WORKDIR
+git clone https://github.com/xmidt-org/wdmp-c.git
+cd wdmp-c
+sed -i '/WDMP_ERR_SESSION_IN_PROGRESS/a\ WDMP_ERR_INTERNAL_ERROR,\n WDMP_ERR_DEFAULT_VALUE,' src/wdmp-c.h
+cmake -H. -Bbuild -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug
+make -C build && make -C build install
+cd $WORKDIR
+rm -rf wdmp-c
+
+# Install dependencies of libparodus
+cd $WORKDIR
+git clone https://github.com/nanomsg/nanomsg.git
+cd nanomsg
+mkdir build
+cd build
+cmake ..
+cmake --build .
+cmake --build . --target install
+cd $WORKDIR
+rm -rf nanomsg
+
+git clone https://github.com/xmidt-org/cimplog.git
+cd cimplog
+git checkout 8a5fb3c2f182241d17f5342bea5b7688c28cd1fd
+mkdir build
+cd build
+cmake ..
+make && make install
+cd $WORKDIR
+rm -rf cimplog
+
+
+cd $WORKDIR
+git clone https://github.com/xmidt-org/wrp-c.git
+cd wrp-c
+git checkout 9587e8db33dbbfcd9b78ef66cc2eaf16dfb9afcf
+# replace 7a98138f27f27290e680bf8fbf1f8d1b089bf138 with 445880108a1d171f755ff6ac77e03fbebbb23729 in CMakeLists.txt
+# Message pack revision used in libparadous is not buildable with latest gcc versions
+sed -i 's/7a98138f27f27290e680bf8fbf1f8d1b089bf138/445880108a1d171f755ff6ac77e03fbebbb23729/g' CMakeLists.txt
+mkdir build
+cd build
+cmake ..
+make && make install
+cd $WORKDIR
+rm -rf wrp-c
+
+cd $WORKDIR
+git clone https://github.com/xmidt-org/libparodus.git
+cd libparodus
+# replace 7a98138f27f27290e680bf8fbf1f8d1b089bf138 with 445880108a1d171f755ff6ac77e03fbebbb23729 in CMakeLists.txt
+# Message pack revision used in libparadous is not buildable with latest gcc versions
+sed -i 's/7a98138f27f27290e680bf8fbf1f8d1b089bf138/445880108a1d171f755ff6ac77e03fbebbb23729/g' CMakeLists.txt
+mkdir build
+cd build
+cmake ..
+make && make install
+cd $WORKDIR
+rm -rf libparodus
+
+
+#rtrouted -f -l DEBUG
diff --git a/partners_defaults.json b/partners_defaults.json
index 8693518bb..1d9396de9 100644
--- a/partners_defaults.json
+++ b/partners_defaults.json
@@ -38,15 +38,15 @@
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.DefaultSupportedLocales" : ""
},
"community" : {
- "Device.Time.NTPServer1" : "time.com",
- "Device.Time.NTPServer2" : "time1.com",
- "Device.Time.NTPServer3" : "time2.com",
- "Device.Time.NTPServer4" : "time3.com",
- "Device.Time.NTPServer5" : "time4.com",
+ "Device.Time.NTPServer1" : "time.google.com",
+ "Device.Time.NTPServer2" : "time1.google.com",
+ "Device.Time.NTPServer3" : "time2.google.com",
+ "Device.Time.NTPServer4" : "time3.google.com",
+ "Device.Time.NTPServer5" : "time4.google.com",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.PartnerName" : "community",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.PartnerProductName" : "",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.NetflixESNprefix" : "",
- "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.XconfUrl" : "https://xconf.rdkcentral.com:19092",
+ "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.XconfUrl" : "https://xconf.rdkcentral.com",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.XconfRecoveryUrl" : "",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.SsrUrl" : "",
"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.LSA.Enable" : "False",
diff --git a/run_l2.sh b/run_l2.sh
index 0669d99b8..b9610cc2a 100644
--- a/run_l2.sh
+++ b/run_l2.sh
@@ -23,7 +23,28 @@ export top_srcdir=`pwd`
RESULT_DIR="/tmp/l2_test_report"
mkdir -p "$RESULT_DIR"
-cp ./src/integrationtest/conf/data-model-generic.xml /tmp/data-model.xml
+apt-get update && apt-get install -y iproute2
+
+
+ cp ./src/hostif/parodusClient/waldb/data-model/data-model-tv.xml /etc/data-model-tv.xml
+ cp ./src/hostif/parodusClient/waldb/data-model/data-model-generic.xml /etc/data-model-generic.xml
+ cp ./src/hostif/parodusClient/waldb/data-model/data-model-stb.xml /etc/data-model-stb.xml
+
+sed -i '/ModelName/ {n; n; a\
+
+}' /etc/data-model-stb.xml
+
+dos2unix /etc/data-model-stb.xml
+
+echo "RDK_PROFILE=STB" > /etc/device.properties
+
+echo "VERSION=99.99.15.07" >> /version.txt
+echo "Proto|http" >> /opt/fwdnldstatus.txt
+echo "Status|Download In Progress" >> /opt/fwdnldstatus.txt
+echo "DnldFile|TESTIMAGE_DEV.bin" >> /opt/fwdnldstatus.txt
+echo "DnldURL|https://mockserver.tv/Images" >> /opt/fwdnldstatus.txt
+echo "FwUpdateState|Download complete" >> /opt/fwdnldstatus.txt
+
cp ./src/integrationtest/conf/mgrlist.conf /etc/
mkdir -p /opt/secure/RFC/
@@ -41,8 +62,10 @@ if [ ! -z "$pid" ]; then
kill -9 `pidof tr69hostif`
fi
-/usr/local/bin/tr69hostif -c /etc/mgrlist.conf -d /etc/debug.ini -p 10999 -s 11999 | tee /opt/logs/tr69hostIf.log.0 &
+/usr/local/bin/tr69hostif -c /etc/mgrlist.conf -p 10999 -s 11999 | tee /opt/logs/tr69hostIf.log.0 &
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/bootup_sequence.json test/functional-tests/tests/test_bootup_sequence.py
pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/handlers_communications.json test/functional-tests/tests/test_handlers_communications.py
+pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/deviceip.json test/functional-tests/tests/tr69hostif_deviceip.py
+pytest --json-report --json-report-summary --json-report-file $RESULT_DIR/webpa.json test/functional-tests/tests/tr69hostif_webpa.py
diff --git a/run_ut.sh b/run_ut.sh
index c6143381c..23a4b3e65 100644
--- a/run_ut.sh
+++ b/run_ut.sh
@@ -18,10 +18,36 @@
# SPDX-License-Identifier: Apache-2.0
############################################################################
+WORKDIR=`pwd`
+sh dependent_rdk_pkg_installer.sh
+export ROOT=/usr
+
+cd $ROOT
+rm -rf remote_debugger
+rm -rf rdk-halif-device_settings
+rm -rf rdkvhal-devicesettings-raspberrypi4
+git clone https://github.com/rdkcentral/remote_debugger.git
+git clone https://github.com/rdkcentral/rdk-halif-device_settings.git
+git clone https://github.com/rdkcentral/rdkvhal-devicesettings-raspberrypi4.git
+
+cd $WORKDIR
+ls -l /usr/local/include/libparodus/
+ENABLE_COV=false
+
+if [ "x$1" = "x--enable-cov" ]; then
+ echo "Enabling coverage options"
+ export CXXFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
+ export CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
+ export LDFLAGS="-lgcov --coverage"
+ ENABLE_COV=true
+fi
+
apt-get update
apt-get -y install libtinyxml2-dev
apt-get -y install libsoup-3.0-dev
-
+apt-get -y install libprocps-dev
+apt-get -y install libnanomsg-dev
+apt-get -y install iproute2
sed '/<\/model>/d; /<\/dm:document>/d' ./src/hostif/parodusClient/waldb/data-model/data-model-tv.xml > ./src/hostif/parodusClient/waldb/data-model/data-model-merged.xml
sed '/> ./src/hostif/parodusClient/waldb/data-model/data-model-merged.xml
@@ -32,12 +58,34 @@ cp ./src/unittest/stubs/rfcdefaults.ini /tmp/rfcdefaults.ini
mkdir /opt/secure
mkdir /opt/secure/RFC
+mkdir -p /opt/secure/reboot/
+mkdir -p /opt/www/authService/
+mkdir -p /tmp/webpa
+mkdir -p /opt/persistent/
+mkdir -p /etc/rfcdefaults
+mkdir -p /etc/apparmor.d
+mkdir -p /opt/secure/persistent/
+mkdir -p /etc/rrd/
cp ./src/unittest/stubs/tr181store.ini /opt/secure/RFC/tr181store.ini
+cp ./src/integrationtest/conf/bootstrap.ini /opt/secure/RFC/
+cp ./src/integrationtest/conf/rfcVariable.ini /opt/secure/RFC/
cp partners_defaults.json /etc/partners_defaults.json
cp ./src/unittest/stubs/partners_defaults_device.json /etc/partners_defaults_device.json
cp ./src/unittest/stubs/fwdnldstatus.txt /opt/fwdnldstatus.txt
-
-export TOP_DIR=`pwd`
+cp ./src/integrationtest/conf/mgrlist.conf /etc/mgrlist.conf
+cp ./src/unittest/stubs/remote_debugger.json /etc/rrd/remote_debugger.json
+touch /tmp/timeReceivedNTP
+touch /tmp/webpa/start_time
+touch /opt/persistent/firstNtpTime
+touch /etc/rfcdefaults/rfcdefaults.ini
+touch /opt/XRE_container_enable /opt/dab-enable
+touch /opt/.ntpEnabled
+touch /var/tmp/rssh.pid
+cat /version.txt
+rm -rf /version.txt
+echo "Method|" >> /opt/fwdnldstatus.txt
+
+export TOP_DIR=$WORKDIR
cd ./src/
automake --add-missing
@@ -50,27 +98,85 @@ make clean
echo "TOP_DIR = $TOP_DIR"
+echo "**** Compiling handlers gtest ****"
+cd $TOP_DIR/src/hostif/handlers/src/gtest
+rm handlers_gtest
+sed -i '/getCurrentTime/,/^ *}/d' ../../../src/hostIf_utils.cpp
+make clean
+make
+./handlers_gtest
+echo "********************"
+
+
echo "**** Compiling data model gtest ****"
cd $TOP_DIR/src/hostif/parodusClient/gtest
rm dm_gtest
+#sed -i '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
make
./dm_gtest
echo "********************"
+echo "**** Compiling httpserver gtest ****"
+cd $TOP_DIR/src/hostif/httpserver/src/gtest
+rm httpserver_gtest
+#sed -i '$a void getCurrentTime(struct timespec *timer)\n{\n clock_gettime(CLOCK_REALTIME, timer);\n}' ../../../src/hostIf_utils.cpp
+#sed -i '/getCurrentTime/,/^ *}/d' ../../src/hostIf_utils.cpp
+make clean
+make
+./httpserver_gtest
+echo "********************"
-lcov --capture --directory . --output-file coverage.info
-lcov --remove coverage.info '/usr/*' --output-file coverage.filtered.info
-genhtml coverage.filtered.info --output-directory out
+echo "**** Compiling src gtest ****"
+cd $TOP_DIR/src/hostif/src/gtest
+rm src_gtest
+sed -i '$a void getCurrentTime(struct timespec *timer)\n{\n clock_gettime(CLOCK_REALTIME, timer);\n}' ../hostIf_utils.cpp
+make clean
+make
+./src_gtest
+echo "********************"
+
+echo "**** Compiling DHCPv4 gtest ****"
+cd $TOP_DIR/src/hostif/profiles/DHCPv4/gtest
+rm dhcpv4_gtest
+make
+./dhcpv4_gtest
+echo "********************"
+
+echo "**** Compiling Device gtest ****"
+cd $TOP_DIR/src/hostif/profiles/Device/gtest
+rm device_gtest
+make
+./device_gtest
+echo "********************"
+
+echo "**** Compiling Ethernet gtest ****"
+cd $TOP_DIR/src/hostif/profiles/Ethernet/gtest
+rm ethernet_gtest
+make
+./ethernet_gtest
+echo "********************"
+echo "**** Compiling Time gtest ****"
+cd $TOP_DIR/src/hostif/profiles/Time/gtest
+rm time_gtest
+make
+./time_gtest
+echo "********************"
echo "**** Compiling DeviceInfo gtest ****"
cd $TOP_DIR/src/hostif/profiles/DeviceInfo/gtest
-rm devieInfo_gtest
+cp ../../../../unittest/stubs/rfc.properties /etc/rfc.properties
+rm devieInfo_gtest /opt/www/authService/partnerId3.dat
make
./devieInfo_gtest
echo "********************"
+cd $TOP_DIR
-lcov --capture --directory . --output-file coverage.info
-lcov --remove coverage.info '/usr/*' --output-file coverage.filtered.info
-genhtml coverage.filtered.info --output-directory out
+if [ "$ENABLE_COV" = true ]; then
+ lcov --capture --directory . --output-file coverage.info
+ lcov --remove coverage.info '/usr/*' '*/gtest/*' '*/mocks/*' --output-file filtered.info
+ lcov --extract filtered.info '*/src/hostif/httpserver/*' '*/src/hostif/parodusClient/*' '*/src/hostif/src/*' '*/src/hostif/profiles/DHCPv4/*' '*/src/hostif/profiles/Device/*' '*/src/hostif/profiles/DeviceInfo/*' '*/src/hostif/profiles/Ethernet/*' '*/src/hostif/profiles/Time/*' --output-file tr69hostif_coverage.info
+ lcov --list tr69hostif_coverage.info
+fi
+
diff --git a/src/Makefile.am b/src/Makefile.am
index 18ce02e94..21fef82e9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -56,6 +56,8 @@ else
NEXUS_LIB =
endif
+
+
if WITH_WIFI_PROFILE
AM_CXXFLAGS += -DUSE_WIFI_PROFILE
AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/profiles/wifi
@@ -98,6 +100,9 @@ AM_LDFLAGS = $(GLIB_LDFLAGS) $(GLIB_LIBS) \
-lds -ldshalcli
endif
+if POWERCONTROLLER_ENABLE
+AM_LDFLAGS += -lWPEFrameworkPowerController
+endif
AM_CFLAGS = $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
AM_CPPFLAGS = $(GLIB_CFLAGS) $(GTHREAD_CFLAGS)
@@ -115,6 +120,11 @@ else
AM_LDFLAGS += $(SYSTEMD_SDNOTIFY_LDFLAGS)
endif
+if IS_TELEMETRY2_ENABLED
+AM_CXXFLAGS += $(T2_EVENT_FLAG)
+AM_LDFLAGS += -ltelemetry_msgsender -lt2utils
+endif
+
bin_PROGRAMS = tr69hostif backgroundrun
tr69hostif_SOURCES = $(top_srcdir)/src/hostif/src/hostIf_main.cpp $(top_srcdir)/src/hostif/src/hostIf_utils.cpp
tr69hostif_SOURCES += $(top_srcdir)/src/hostif/src/IniFile.cpp
diff --git a/src/configure.ac b/src/configure.ac
index fc5a6577a..5a4d58d68 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -42,20 +42,35 @@ AC_FUNC_REALLOC
# Check for GLib 2.0
PKG_CHECK_MODULES([GLIB], [glib-2.0])
-# This enables libsoup-3 support
-AC_ARG_ENABLE([libsoup3],
-[ --enable-libsoup3 Turn on libsoup-3 support],
-[case "${enableval}" in
- yes) libsoup3=true ;;
- no) libsoup3=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-libsoup3]) ;;
-esac],[libsoup3=false])
-AM_CONDITIONAL([LIBSOUP3_ENABLE], [test x$libsoup3 = xtrue])
+
+
+AC_ARG_ENABLE([t2api],
+ AS_HELP_STRING([--enable-t2api],[enables telemetry]),
+ [
+ case "${enableval}" in
+ yes) IS_TELEMETRY2_ENABLED=true
+ T2_EVENT_FLAG=" -DT2_EVENT_ENABLED ";;
+ no) IS_TELEMETRY2_ENABLED=false ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-t2enable]) ;;
+ esac
+ ],
+ [echo "telemetry is disabled"])
+AM_CONDITIONAL([IS_TELEMETRY2_ENABLED], [test x$IS_TELEMETRY2_ENABLED = xtrue])
+AC_SUBST(T2_EVENT_FLAG)
+
# Generate the Makefile
AC_CONFIG_FILES([
- hostif/parodusClient/gtest/Makefile \
- hostif/profiles/DeviceInfo/gtest/Makefile])
+ hostif/parodusClient/gtest/Makefile
+ hostif/httpserver/src/gtest/Makefile
+ hostif/src/gtest/Makefile
+ hostif/profiles/DHCPv4/gtest/Makefile
+ hostif/profiles/Device/gtest/Makefile
+ hostif/profiles/Ethernet/gtest/Makefile
+ hostif/profiles/Time/gtest/Makefile
+ hostif/profiles/DeviceInfo/gtest/Makefile
+ hostif/handlers/src/gtest/Makefile
+ ])
# Generate the configure script
AC_OUTPUT
diff --git a/src/hostif/handlers/Makefile.am b/src/hostif/handlers/Makefile.am
index 155cae827..3f73b9d7b 100644
--- a/src/hostif/handlers/Makefile.am
+++ b/src/hostif/handlers/Makefile.am
@@ -44,13 +44,8 @@ AM_CXXFLAGS = -I$(top_srcdir)/src/hostif/include \
-I=/usr/include/rdk/ds/ \
-I=/usr/include/rdk/ds-hal/ \
$(XRDK_RF4CE_PROFILE_FLAG) \
- -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/rbus/
-
-if LIBSOUP3_ENABLE
-AM_CXXFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/libsoup-3.0 -DLIBSOUP3_ENABLE
-else
-AM_CXXFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/libsoup-2.4
-endif
+ -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/rbus/ \
+ -I=/usr/include/libsoup-3.0/
AM_CXXFLAGS += "-std=c++11" $(PROCPS_CFLAGS)
@@ -84,6 +79,8 @@ AM_CXXFLAGS += -DBTMGR_ENABLE_IARM_INTERFACE
AM_CXXFLAGS += -I$(top_srcdir)/src/hostif/profiles/DeviceInfo
endif
+
+
if WITH_HWSELFTEST_PROFILE
AM_CXXFLAGS += $(HWSELFTEST_PROFILE_FLAG)
endif
@@ -92,11 +89,17 @@ if WITH_SNMP_ADAPTER
AM_CXXFLAGS += -DSNMP_ADAPTER_ENABLED -I$(top_srcdir)/src/hostif/snmpAdapter
endif
-AM_LDFLAGS = $(GLIB_LIBS) $(G_THREAD_LIBS) $(SOUP_LIBS) $(PROCPS_LIBS) -lIARMBus -lyajl -lds -ldshalcli -ldbus-1
+AM_LDFLAGS = $(GLIB_LIBS) $(G_THREAD_LIBS) $(SOUP_LIBS) $(PROCPS_LIBS) -lIARMBus -lyajl -lds -ldshalcli -ldbus-1 -lsoup-3.0 -lgobject-2.0 -lsecure_wrapper
if WIFI_CLIENT_ROAMING
AM_CXXFLAGS += -DWIFI_CLIENT_ROAMING
endif
+if IS_TELEMETRY2_ENABLED
+AM_CXXFLAGS += $(T2_EVENT_FLAG)
+AM_LDFLAGS += -ltelemetry_msgsender -lt2utils
+endif
+
+
noinst_LTLIBRARIES = libMsgHandlers.la
libMsgHandlers_la_SOURCES = src/hostIf_IARM_ReqHandler.cpp \
src/hostIf_msgHandler.cpp \
diff --git a/src/hostif/handlers/include/hostIf_XREClient_ReqHandler.h b/src/hostif/handlers/include/hostIf_XREClient_ReqHandler.h
index 64f922c2f..2f4cb38c0 100755
--- a/src/hostif/handlers/include/hostIf_XREClient_ReqHandler.h
+++ b/src/hostif/handlers/include/hostIf_XREClient_ReqHandler.h
@@ -50,6 +50,7 @@
#include "hostIf_msgHandler.h"
#include "hostIf_updateHandler.h"
#include "hostIf_main.h"
+#include "secure_wrapper.h"
/**
* @brief This class provides the interface for getting XRE request handler information.
@@ -78,6 +79,8 @@ class XREClientReqHandler : public msgHandler
static msgHandler* getInstance();
};
+int set_Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow(HOSTIF_MsgData_t *stMsgData);
+int get_Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow(HOSTIF_MsgData_t *stMsgData);
#endif /* HOSTIF_XRECLIENT_REQHANDLER_H_ */
/* End of HOSTIF_XRECLIENT_REQHANDLER_H_ doxygen group */
/**
diff --git a/src/hostif/handlers/include/hostIf_msgHandler.h b/src/hostif/handlers/include/hostIf_msgHandler.h
index cc9512838..a385cf586 100644
--- a/src/hostif/handlers/include/hostIf_msgHandler.h
+++ b/src/hostif/handlers/include/hostIf_msgHandler.h
@@ -98,6 +98,8 @@ void hostIf_Print_msgData(HOSTIF_MsgData_t *stMsgData);
void hostIf_Free_stMsgData (HOSTIF_MsgData_t *stMsgData);
+void paramValueToString(const HOSTIF_MsgData_t *stMsgData, char *paramValueStr, size_t strSize);
+
bool hostIf_initalize_ConfigManger();
bool hostIf_ConfigProperties_Init();
class msgHandler {
diff --git a/src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h b/src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h
index 2cb9f5cf1..322e6766c 100644
--- a/src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h
+++ b/src/hostif/handlers/include/hostIf_rbus_Dml_Provider.h
@@ -48,11 +48,22 @@
#ifndef HOSTIF_RBUS_DML_PROVIDER_H_
#define HOSTIF_RBUS_DML_PROVIDER_H_
+#ifdef GTEST_ENABLE
+#include "rbus_value.h"
+#include "rbus.h"
+#endif
+
void init_rbus_dml_provider();
int setRbusStringParam(const char *paramName, char* paramValue);
int getRbusStringParam(const char *paramName, char** paramValue);
+#ifdef GTEST_ENABLE
+rbusError_t TR_Dml_EventSubHandler(rbusHandle_t handle, rbusEventSubAction_t action, const char* eventName, rbusFilter_t filter, int32_t interval, bool* autoPublish);
+rbusError_t TR_Dml_GetHandler(rbusHandle_t handle, rbusProperty_t inProperty, rbusGetHandlerOptions_t* opts);
+rbusError_t TR_Dml_SetHandler(rbusHandle_t handle, rbusProperty_t inProperty, rbusSetHandlerOptions_t* opts);
+#endif
+
#endif /* HOSTIF_RBUS_DML_PROVIDER_H_ */
/* End of HOSTIF_RBUS_DML_PROVIDER_H_ API doxygen group */
diff --git a/src/hostif/handlers/src/gtest/Makefile.am b/src/hostif/handlers/src/gtest/Makefile.am
new file mode 100644
index 000000000..279fb4966
--- /dev/null
+++ b/src/hostif/handlers/src/gtest/Makefile.am
@@ -0,0 +1,39 @@
+################################################################################
+# Copyright 2024 Comcast Cable Communications Management, LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+################################################################################
+
+AUTOMAKE_OPTIONS = subdir-objects
+
+# Define the program name and the source files
+bin_PROGRAMS = handlers_gtest
+
+# Define the include directories
+
+COMMON_CPPFLAGS = -std=c++11 -DGTEST_ENABLE -DYOCTO_BUILD -DUSE_DEV_PROPERTIES_CONF -DUSE_REMOTE_DEBUGGER -I/usr/include -I/usr/include/cjson -I$(TOP_DIR)/src/hostif/include -I$(TOP_DIR)/src/hostif/profiles/DeviceInfo -I$(TOP_DIR)/src/unittest/stubs -I$(TOP_DIR)/src/unittest/stubs/ds -I$(TOP_DIR)/src/unittest/stubs/rbus/include -I$(TOP_DIR)/src/hostif/handlers/include -I$(TOP_DIR)/src/hostif/parodusClient/pal -I$(TOP_DIR)/src/hostif/parodusClient/waldb -I$(TOP_DIR)/src/hostif/httpserver/include -I$(TOP_DIR)/src/hostif/handlers/src -I/usr/include/rbus -I/usr/local/include/rbus -Isrc/unittest/stubs/rbus/include/ -I$(TOP_DIR)/src/hostif/profiles/Time -I$(TOP_DIR)/src/hostif/profiles/Device -I$(TOP_DIR)/src/hostif/profiles/IP -I$(TOP_DIR)/src/hostif/profiles/STBService -I/usr/rdk-halif-device_settings/include/ -I/usr/rdkvhal-devicesettings-raspberrypi4/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$(TOP_DIR)/src/hostif/profiles/Ethernet -I/usr/remote_debugger/src/ -I/usr/local/include/libparodus/ -I/usr/local/include/wrp-c/ -I$(TOP_DIR)/src/hostif/parodusClient/startParodus/ -I$(TOP_DIR)/src/hostif/profiles/DHCPv4 -I/usr/include/libsoup-3.0
+
+# Define the libraries to link against
+COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lgcov $(GLIB_LIBS) -ltinyxml2 -lcjson -lcurl -lglib-2.0 -llibparodus -lwrp-c -lnanomsg -lmsgpackc -ltrower-base64 -lcimplog -lsoup-3.0
+
+# Define the compiler flags
+COMMON_CXXFLAGS = -frtti $(GLIB_CFLAGS) -fprofile-arcs -ftest-coverage
+
+handlers_gtest_SOURCES = handlers_test.cpp $(TOP_DIR)/src/hostif/parodusClient/startParodus/startParodus.cpp $(TOP_DIR)/src/hostif/src/hostIf_utils.cpp $(TOP_DIR)/src/hostif/src/IniFile.cpp $(TOP_DIR)/src/unittest/stubs/secure_wrapper.c $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFCStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFC.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStoreJournal.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_NotificationHandler.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_notification.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_attribute.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_parameter.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/libpd.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_adapter.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_msgHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_XrdkCentralT2_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus_Process.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_DisplayDevice.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_EthernetClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface_Stats.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_TimeClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface.cpp $(TOP_DIR)/src/hostif/profiles/Time/Device_Time.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_updateHandler.cpp $(TOP_DIR)/src/hostif/profiles/Device/x_rdk_profile.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Capabilities.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_SPDIF.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoDecoder.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_AudioOutput.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_HDMI.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoOutput.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_Stats.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_ActivePort.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Diagnostics_IPPing.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_IPv4Address.cpp $(TOP_DIR)/src/hostif/handlers/src/x_rdk_req_handler.cpp $(TOP_DIR)/src/unittest/stubs/dm_stubs.cpp $(TOP_DIR)/src/hostif/parodusClient/waldb/waldb.cpp $(TOP_DIR)/src/unittest/stubs/wdmp-c.c $(TOP_DIR)/src/unittest/stubs/wdmp_internal.c $(TOP_DIR)/src/hostif/httpserver/src/http_server.cpp $(TOP_DIR)/src/hostif/httpserver/src/request_handler.cpp $(TOP_DIR)/src/hostif/httpserver/src/XrdkCentralComRFCVar.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_Processor.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus.cpp $(TOP_DIR)/src/unittest/stubs/ds/libprocps.cpp $(TOP_DIR)/src/unittest/stubs/file_writer.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_DHCPv4Client_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/DHCPv4/Device_DHCPv4_Client.cpp
+
+# Apply common properties to each program
+handlers_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
+handlers_gtest_LDADD = $(COMMON_LDADD)
+handlers_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
diff --git a/src/hostif/handlers/src/gtest/handlers_test.cpp b/src/hostif/handlers/src/gtest/handlers_test.cpp
new file mode 100644
index 000000000..11faa7765
--- /dev/null
+++ b/src/hostif/handlers/src/gtest/handlers_test.cpp
@@ -0,0 +1,1530 @@
+/*
+ * Copyright 2024 Comcast Cable Communications Management, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+#include
+#include
+#include
+#include "dm_stubs.h"
+#include "startParodus.h"
+#include "file_writer.h"
+#include "webpa_notification.h"
+#include "webpa_parameter.h"
+#include "webpa_adapter.h"
+#include "libpd.h"
+#include "webpa_attribute.h"
+#include "rbus_value.h"
+#include "hostIf_tr69ReqHandler.h"
+#include "hostIf_utils.h"
+#include "wrp-c.h"
+#include "x_rdk_req_handler.h"
+#include "hostIf_rbus_Dml_Provider.h"
+#include "rbus_value.h"
+#include "rbus.h"
+#include "hostIf_XrdkCentralT2_ReqHandler.h"
+#include "hostIf_TimeClient_ReqHandler.h"
+#include "hostIf_DeviceClient_ReqHandler.h"
+#include "hostIf_EthernetClient_ReqHandler.h"
+#include "hostIf_IPClient_ReqHandler.h"
+#include "hostIf_DHCPv4Client_ReqHandler.h"
+
+
+#include "waldb.h"
+#include "wdmp-c.h"
+
+using namespace std;
+
+
+#include
+#include
+
+
+#define GTEST_DEFAULT_RESULT_FILEPATH "/tmp/Gtest_Report/"
+#define GTEST_DEFAULT_RESULT_FILENAME "datamodel_gtest_report.json"
+#define GTEST_REPORT_FILEPATH_SIZE 128
+
+extern GHashTable* paramMgrhash;
+
+std::mutex mtx_httpServerThreadDone;
+std::condition_variable cv_httpServerThreadDone;
+bool httpServerThreadDone = false;
+GThread *HTTPServerThread = NULL;
+char *HTTPServerName = (char *)"HTTPServerThread";
+GError *httpError = NULL;
+GHashTable* paramMgrhash = NULL;
+T_ARGLIST argList = {{'\0'}, 0};
+
+extern int (*convertRbus2hostIfDataTypeFunc()) (rbusValueType_t type, HostIf_ParamType_t* pParamType);
+
+
+TEST(handlersTest, handleGetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.X_RDK_WebPA_DNSText.URL", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ X_rdk_req_hdlr* reqHandler = static_cast(X_rdk_req_hdlr::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, handleSetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.X_RDK_WebPA_DNSText.URL", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ strncpy(param.paramValue, "fabric.xmidt.comcast.net", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ X_rdk_req_hdlr* reqHandler = static_cast(X_rdk_req_hdlr::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, convertRbus2hostIfDataType) {
+ HostIf_ParamType_t paramType;
+
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_BOOLEAN, ¶mType), 0);
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_INT8, ¶mType), 0);
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_UINT8, ¶mType), 0);
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_INT64, ¶mType), 0);
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_STRING, ¶mType), 0);
+ EXPECT_EQ(convertRbus2hostIfDataTypeFunc()(RBUS_DATETIME, ¶mType), 0);
+}
+
+TEST(handlersTest, TR_Dml_EventSubHandler) {
+ HostIf_ParamType_t paramType;
+ rbusHandle_t handle;
+ rbusEventSubAction_t action;
+ const char* eventName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType";
+ rbusFilter_t filter;
+ int32_t interval = 60;
+ bool autoPublish = false;
+
+ rbusError_t rc = TR_Dml_EventSubHandler(handle, action, eventName, filter, interval, &autoPublish);
+ EXPECT_EQ(rc, RBUS_ERROR_SUCCESS);
+}
+
+TEST(handlersTest, TR_Dml_GetHandler) {
+ //MockRbusProperty mockProp = { "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.Enable" };
+ //rbusProperty_t testProp = (rbusProperty_t)&mockProp;
+ rbusProperty_t testProp;
+
+ rbusHandle_t handle;
+ rbusGetHandlerOptions_t opts = {};
+
+ rbusError_t rc = TR_Dml_GetHandler(handle, testProp, &opts);
+ EXPECT_EQ(rc, 2);
+}
+
+TEST(handlersTest, setRbusStringParam) {
+ const char *paramName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType";
+ char* paramValue = "testdata";
+
+ int rc = setRbusStringParam(paramName, paramValue);
+ EXPECT_EQ(rc, -1);
+}
+
+TEST(handlersTest, getRbusStringParam) {
+ const char *paramName = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType";
+ char* paramValue = nullptr;
+
+ int rc = getRbusStringParam(paramName, ¶mValue);
+ EXPECT_EQ(rc, -1);
+}
+
+TEST(handlersTest, XrdkCentralT2handleSetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.X_RDKCENTRAL-COM_T2.ReportProfiles", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ strncpy(param.paramValue, "testprofile", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ XRdkCentralT2* reqHandler = static_cast(XRdkCentralT2::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, XrdkCentralT2handleGetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.X_RDKCENTRAL-COM_T2.ReportProfiles", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ XRdkCentralT2* reqHandler = static_cast(XRdkCentralT2::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleGetMsg_Enable) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.Enable", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+
+TEST(handlersTest, TimeClientReqHandler_handleGetMsg_Status) {
+ write_on_file("/tmp/ntp_status", "ntp status");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.Status", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ EXPECT_STREQ(param.paramValue, "ntp status");
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleGetMsg_LocalTimeZone) {
+ write_on_file("/tmp/ntp_status", "ntp status");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.LocalTimeZone", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleGetMsg_CurrentLocalTime) {
+ write_on_file("/tmp/ntp_status", "ntp status");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.CurrentLocalTime", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleGetMsg_X_RDK_CurrentUTCTime) {
+ write_on_file("/tmp/ntp_status", "ntp status");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.X_RDK_CurrentUTCTime", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleSetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.Time.NTPServer5", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_SRC_RFC;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "override_time4.com", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+
+TEST(handlersTest, TimeClientReqHandler_handleGetAttributesMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.Time.Enable", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetAttributesMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, TimeClientReqHandler_handleSetAttributesMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.Time.NTPServer4", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "override_time3.com", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = sizeof(hostIf_StringType);
+
+ TimeClientReqHandler* reqHandler = static_cast(TimeClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetAttributesMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.SsrUrl", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_SRC_RFC;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "https://ssr.ccp.xcal.tv", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_FirmwareDownloadStatus) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "Download Started", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_FirmwareDownloadProtocol) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "http", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_FirmwareDownloadURL) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "https://xconf.xdp.eu-1.xcal.tv", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_PreferredGatewayType) {
+ write_on_file("/opt/prefered-gateway", "192.168.1.1");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_set_xOpsDMUploadLogsNow) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.Logging.xOpsDMUploadLogsNow", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "true", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_ForwardSSHEnable) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.ForwardSSH.Enable", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ put_boolean(param.paramValue, true);
+ param.paramtype = hostIf_BooleanType;
+ param.paramLen = sizeof(hostIf_BooleanType);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_DownloadStatus) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RDKDownloadManager.DownloadStatus", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ put_boolean(param.paramValue, true);
+ param.paramtype = hostIf_BooleanType;
+ param.paramLen = sizeof(hostIf_BooleanType);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_IPRemoteSupportEnable) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_IPRemoteSupport.Enable", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ put_boolean(param.paramValue, true);
+ param.paramtype = hostIf_BooleanType;
+ param.paramLen = sizeof(hostIf_BooleanType);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleSetMsg_PartnerId) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.PartnerId", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+ strncpy(param.paramValue, "global", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleSetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.SsrUrl", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_SRC_RFC;
+ param.requestor = HOSTIF_SRC_RFC;
+
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_PreferredGatewayType) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_Manufacturer) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.Manufacturer", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_ManufacturerOUI) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.ManufacturerOUI", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+
+
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, -2);
+ }
+}
+
+
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_ModelName) {
+ write_on_file("/tmp/.model", "SKY");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.ModelName", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ EXPECT_STREQ(param.paramValue, "SKY");
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_Description) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.Description", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_HardwareVersion) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.HardwareVersion", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, NOK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_SoftwareVersion) {
+ writeToTr181storeFile("VERSION", "99.99.15.07", "/version.txt", Plain);
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.SoftwareVersion", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+ std::remove("/version.txt");
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_MigrationStatus) {
+ write_on_file("/opt/secure/persistent/MigrationStatus", "NEEDED");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.Migration.MigrationStatus", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ EXPECT_STREQ(param.paramValue, "NEEDED");
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_IUI_Version) {
+ write_on_file("/tmp/.iuiVersion", "4.4");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM.IUI.Version", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ EXPECT_STREQ(param.paramValue, "4.4");
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_UpTime) {
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.UpTime", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_FirstUseDate) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.FirstUseDate", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ }
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_FirmwareFilename) {
+ write_on_file("/tmp/currently_running_image_name", "ELTE11MWR_DEV_develop_20250808222826_NG");
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareFilename", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ EXPECT_EQ(ret, OK);
+ EXPECT_STREQ(param.paramValue, "ELTE11MWR_DEV_develop_20250808222826_NG");
+ }
+ std::remove("/tmp/currently_running_image_name");
+}
+
+TEST(handlersTest, DeviceClientReqHandler_handleGetMsg_FirmwareDownloadStatus) {
+ int instanceNumber = 0;
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_GET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_RFC;
+ DeviceClientReqHandler* reqHandler = static_cast(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler)
+ {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DeviceClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleSetAttributesMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleSetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(EthernetClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleSetAttributesMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(IPClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(IPClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleSetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleSetAttributesMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <(DHCPv4ClientReqHandler::getInstance());
+ if(reqHandler) {
+ int ret = reqHandler->handleGetAttributesMsg(¶m);
+ cout << "msgData.paramValue = " << param.paramValue <set_xRDKDownloadManager_InstallPackage(stMsgData);
}
+ else if (strcasecmp(stMsgData->paramName,X_RDKDownloadManager_DownloadStatus) == 0)
+ {
+ ret = pIface->set_xRDKDownloadManager_DownloadStatus(stMsgData);
+ }
else if (strcasecmp(stMsgData->paramName,IPREMOTE_SUPPORT) == 0)
{
ret = pIface->set_Device_DeviceInfo_X_RDKCENTRAL_COM_IPRemoteSupportEnable(stMsgData);
@@ -486,6 +490,11 @@ int DeviceClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
{
ret = pIface->get_Device_DeviceInfo_X_RDKCENTRAL_COM_BootStatus(stMsgData);
}
+
+ else if(strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.getProfileData") == 0)
+ {
+ ret = pIface->get_Device_DeviceInfo_X_RDKCENTRAL_COM_RDKRemoteDebuggergetProfileData(stMsgData);
+ }
else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.X_RDKCENTRAL-COM_PreferredGatewayType") == 0)
{
ret = pIface->get_Device_DeviceInfo_X_RDKCENTRAL_COM_PreferredGatewayType(stMsgData);
@@ -522,6 +531,14 @@ int DeviceClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
{
ret = pIface->get_Device_DeviceInfo_SoftwareVersion(stMsgData);
}
+ else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.MigrationPreparer.MigrationReady") == 0)
+ {
+ ret = pIface->get_Device_DeviceInfo_MigrationPreparer_MigrationReady(stMsgData);
+ }
+ else if (strcasecmp(stMsgData->paramName,"Device.DeviceInfo.Migration.MigrationStatus") == 0)
+ {
+ ret = pIface->get_Device_DeviceInfo_Migration_MigrationStatus(stMsgData);
+ }
else if (strcasecmp(stMsgData->paramName,IUI_VERSION) == 0)
{
ret = pIface->get_Device_DeviceInfo_IUI_Version(stMsgData);
diff --git a/src/hostif/handlers/src/hostIf_IARM_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_IARM_ReqHandler.cpp
index 76dd14c55..049c037c8 100644
--- a/src/hostif/handlers/src/hostIf_IARM_ReqHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_IARM_ReqHandler.cpp
@@ -36,7 +36,12 @@
#include "libIBus.h"
#include "libIARM.h"
#include "sysMgr.h"
+#ifdef RDKV_TR69
#include "pwrMgr.h"
+#else
+#include "power_controller.h"
+#include
+#endif
#ifdef SNMP_ADAPTER_ENABLED
#include "hostIf_SNMPClient_ReqHandler.h"
#endif
@@ -46,7 +51,10 @@
#include "safec_lib.h"
#define X_RDK_RFC_DEEPSLEEP_ENABLE "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Power.DeepSleepNotification.Enable"
-
+#define RETRYSLEEP (300 * 1000) //Retry sleep
+#ifndef RDKV_TR69
+static bool IsPwrCtlInt = false;
+#endif
static bool TR69_HostIf_Mgr_Init();
static bool TR69_HostIf_Mgr_Connect();
static bool TR69_HostIf_Mgr_Get_RegisterCall();
@@ -56,7 +64,12 @@ static IARM_Result_t _Settr69HostIfMgr(void *arg);
static IARM_Result_t _SetAttributestr69HostIfMgr(void *arg);
static IARM_Result_t _GetAttributestr69HostIfMgr(void *arg);
static IARM_Result_t _RegisterForEventstr69HostIfMgr(void *arg);
+#ifdef RDKV_TR69
static void _hostIf_EventHandler(const char *, IARM_EventId_t, void *, size_t);
+#else
+static void _hostIf_EventHandler(const PowerController_PowerState_t currentState,
+ const PowerController_PowerState_t newState, void* userdata);
+#endif
//----------------------------------------------------------------------
// hostIf_IARM_IF_Start: This shall be use to initialize and register
// the hostIf application to IARM bus.
@@ -73,10 +86,13 @@ bool hostIf_IARM_IF_Start()
ret = true;
/* Initialize Managers */
msgHandler *pMsgHandler;
+ #ifdef RDKV_TR69
pMsgHandler = DSClientReqHandler::getInstance();
pMsgHandler->init();
+ #endif
pMsgHandler = DeviceClientReqHandler::getInstance();
pMsgHandler->init();
+
#ifdef SNMP_ADAPTER_ENABLED
pMsgHandler = SNMPClientReqHandler::getInstance();
@@ -88,6 +104,40 @@ bool hostIf_IARM_IF_Start()
return ret;
}
+#ifndef RDKV_TR69
+void hostIf_getPwrContInterface()
+{
+ RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
+
+ /*TODO: remove this sleep after fix METROL-1045*/
+ sleep(10);//added sleep wait for the WPEframework active.
+ msgHandler *pMsgHandler;
+ pMsgHandler = DSClientReqHandler::getInstance();
+ pMsgHandler->init();
+
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s:%d]: start PowerController_Init().. \n", __FUNCTION__, __LINE__);
+ PowerController_Init();
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s:%d]: completed PowerController_Init().. \n", __FUNCTION__, __LINE__);
+ while(true)
+ {
+ if(POWER_CONTROLLER_ERROR_NONE == PowerController_Connect())
+ {
+ hostIf_DeviceInfo::getInstance(0)->setPowerConInterface(true);
+ IsPwrCtlInt = true;
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Got the powercontroller interface.. IsPwrCtlInt = %s\n", __FUNCTION__, __FILE__ , (IsPwrCtlInt?"true":"false"));
+ break;
+ }
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Retry after %d usec..\n", __FUNCTION__, __FILE__, RETRYSLEEP);
+ usleep(RETRYSLEEP); //retry after RETRYSLEEP milli seconds.
+
+ }
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Registering power mode change callback..\n", __FUNCTION__, __FILE__);
+ PowerController_RegisterPowerModeChangedCallback(_hostIf_EventHandler, nullptr);
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Registered power mode change callback..\n", __FUNCTION__, __FILE__);
+
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
+}
+#endif
//----------------------------------------------------------------------
//Initialization: This shall be initialized tr69 application to IARM bus.
@@ -106,6 +156,19 @@ RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"##########################################
return false;
}
RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s()] Success 'IARM_Bus_Init(%s)'.\n", __FUNCTION__, IARM_BUS_TR69HOSTIFMGR_NAME);
+ #ifndef RDKV_TR69
+ // Get powercontroller thunder client interface in separate thread
+ std::thread pwrThread(hostIf_getPwrContInterface);
+ if(pwrThread.joinable())
+ {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s:%d]: created getPwrContInterface thread.. \n", __FUNCTION__, __LINE__);
+ pwrThread.detach(); // Detach the thread to run independently
+ }
+ else
+ {
+ RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%d]: Failed to create getPwrContInterface thread.. \n", __FUNCTION__, __LINE__);
+ }
+ #endif
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return true;
@@ -161,8 +224,9 @@ static bool TR69_HostIf_Mgr_Get_RegisterCall()
/* Notification RPC:*/
IARM_Bus_RegisterEvent(IARM_BUS_TR69HOSTIFMGR_EVENT_MAX);
- IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME,IARM_BUS_PWRMGR_EVENT_MODECHANGED, _hostIf_EventHandler);
-
+ #ifdef RDKV_TR69
+ IARM_Bus_RegisterEventHandler(IARM_BUS_PWRMGR_NAME,IARM_BUS_PWRMGR_EVENT_MODECHANGED, _hostIf_EventHandler);
+ #endif
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return ret;
}
@@ -274,6 +338,26 @@ static IARM_Result_t tr69hostIfMgr_Stop(void)
{
RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s] Failed to IARM_Bus_Term(), return with Error code: %d\n", __FUNCTION__, err);
}
+ #ifndef RDKV_TR69
+ if (IsPwrCtlInt)
+ {
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] UnRegistering power mode change callback..\n", __FUNCTION__, __FILE__);
+ PowerController_UnRegisterPowerModeChangedCallback(_hostIf_EventHandler);
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] UnRegistered power mode change callback..\n", __FUNCTION__, __FILE__);
+
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s:%d]: start PowerController_Term().. \n", __FUNCTION__, __LINE__);
+ PowerController_Term();
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF, "[%s:%d]: completed PowerController_Term().. \n", __FUNCTION__, __LINE__);
+ hostIf_DeviceInfo::getInstance(0)->setPowerConInterface(false);
+ IsPwrCtlInt = false;
+ RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%d]: setPowerConInterface flag to false. and IsPwrCtlInt=%s\n", __FUNCTION__, __LINE__, (IsPwrCtlInt?"true":"false"));
+
+ }
+ else
+ {
+ RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%d]: No PowerController interface .. IsPwrCtlInt = %d\n", __FUNCTION__, __LINE__, IsPwrCtlInt);
+ }
+ #endif
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return err;
}
@@ -392,6 +476,8 @@ static IARM_Result_t _Gettr69HostIfMgr(void *arg)
//----------------------------------------------------------------------
//_hostIf_EventHandler: This is to listen the IARM events and handles.
//----------------------------------------------------------------------
+
+#ifdef RDKV_TR69
static void _hostIf_EventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
{
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
@@ -434,6 +520,46 @@ static void _hostIf_EventHandler(const char *owner, IARM_EventId_t eventId, void
}
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
}
+#else
+static void _hostIf_EventHandler(const PowerController_PowerState_t currentState,
+ const PowerController_PowerState_t newState, void* userdata)
+{
+ RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
+ errno_t rc = -1;
+ HOSTIF_MsgData_t stRfcData = {0};
+ rc=strcpy_s(stRfcData.paramName,sizeof(stRfcData.paramName), X_RDK_RFC_DEEPSLEEP_ENABLE);
+ if(rc!=EOK)
+ {
+ ERR_CHK(rc);
+ }
+ if((hostIf_DeviceInfo::getInstance(0)->get_xRDKCentralComRFC(&stRfcData) == OK) && (strncmp(stRfcData.paramValue, "true", sizeof("true")) == 0))
+ {
+ const char *event_time = NULL;
+
+ if((newState == POWER_STATE_STANDBY_DEEP_SLEEP) &&
+ (currentState != POWER_STATE_STANDBY_DEEP_SLEEP))
+ {
+ std::string event_time_string = std::to_string(std::time(nullptr));
+ event_time = event_time_string.c_str();
+ NotificationHandler::getInstance()->push_device_deepsleep_notifications("device-enter-deepsleep-state", event_time);
+ }
+ else if((newState != POWER_STATE_STANDBY_DEEP_SLEEP) &&
+ (currentState == POWER_STATE_STANDBY_DEEP_SLEEP))
+ {
+ std::string event_time_string = std::to_string(std::time(nullptr));
+ event_time = event_time_string.c_str();
+ NotificationHandler::getInstance()->push_device_deepsleep_notifications("device-exit-deepsleep-state", event_time);
+ }
+ }
+ else
+ {
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s] RFC Parameter (%s) is disabled, so not sending DeepSleep notification. \n",
+ __FUNCTION__, X_RDK_RFC_DEEPSLEEP_ENABLE );
+ }
+
+ RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
+}
+#endif
/** @} */
/** @} */
diff --git a/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp
index 614086b16..9f5a0cb7a 100644
--- a/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp
@@ -1,3 +1,4 @@
+
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
@@ -46,8 +47,11 @@
#include "Device_IP.h"
#include "Device_IP_Diagnostics_IPPing.h"
#include "safec_lib.h"
+#include "secure_wrapper.h"
#include
+#define MAX_IFCS 256
+
std::mutex IPClientReqHandler::m_mutex;
IPClientReqHandler* IPClientReqHandler::pInstance = NULL;
updateCallback IPClientReqHandler::mUpdateCallback = NULL;
@@ -425,6 +429,34 @@ void IPClientReqHandler::registerUpdateCallback(updateCallback cb)
mUpdateCallback = cb;
}
+void getIPIfcIDs(unsigned int *ifindexes) {
+ int count = 0;
+ FILE *fp = v_secure_popen("r", "ls /sys/class/net");
+ if (!fp) {
+ perror("popen");
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"%s:%d Failed to open /sys/class/net contents\n", __FILE__, __LINE__);
+ return;
+ }
+
+ char iface[256];
+ while (fgets(iface, sizeof(iface), fp)) {
+ iface[strcspn(iface, "\n")] = 0;
+
+ //char command[512];
+ //snprintf(command, sizeof(command), "cat /sys/class/net/%s/ifindex", iface);
+
+ FILE *ifindex_fp = v_secure_popen("r", "cat /sys/class/net/%s/ifindex", iface);
+ if (ifindex_fp) {
+ char buffer[64];
+ if (fgets(buffer, sizeof(buffer), ifindex_fp)) {
+ ifindexes[count++] = atoi(buffer);
+ }
+ v_secure_pclose(ifindex_fp);
+ }
+ }
+ v_secure_pclose(fp);
+}
+
void IPClientReqHandler::checkForUpdates()
{
if (mUpdateCallback == 0)
@@ -449,28 +481,34 @@ void IPClientReqHandler::checkForUpdates()
sendAddRemoveEvents (mUpdateCallback, interfaceNumberOfEntries, curNumOfIPInterface, objectPath);
}
- for (int i = 1; i <= interfaceNumberOfEntries; i++)
+ unsigned int ifindexes[MAX_IFCS];
+ getIPIfcIDs(ifindexes);
+ for (int i = 0; i < interfaceNumberOfEntries && i < MAX_IFCS; i++)
{
- int ipv4AddressNumberOfEntries = hostIf_IPInterface::getInstance (i)->getIPv4AddressNumberOfEntries ();
- RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv4AddressNumberOfEntries = %d, curNumOfInterfaceIPv4Addresses[%d] = %d\n",
- __FILE__, __FUNCTION__, __LINE__, ipv4AddressNumberOfEntries, i, curNumOfInterfaceIPv4Addresses[i]);
- sprintf (objectPath, "Device.IP.Interface.%d.IPv4Address.", i);
- sendAddRemoveEvents (mUpdateCallback, ipv4AddressNumberOfEntries, curNumOfInterfaceIPv4Addresses[i], objectPath);
+
+ if (ifindexes[i] > 0 && ifindexes[i] < sizeof(curNumOfInterfaceIPv4Addresses)/sizeof(curNumOfInterfaceIPv4Addresses[0])) {
+ int ipv4AddressNumberOfEntries = hostIf_IPInterface::getInstance (ifindexes[i])->getIPv4AddressNumberOfEntries ();
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv4AddressNumberOfEntries = %d, curNumOfInterfaceIPv4Addresses[%d] = %d\n",
+ __FILE__, __FUNCTION__, __LINE__, ipv4AddressNumberOfEntries, ifindexes[i], curNumOfInterfaceIPv4Addresses[ifindexes[i]]);
+ sprintf (objectPath, "Device.IP.Interface.%d.IPv4Address.", ifindexes[i]);
+ sendAddRemoveEvents (mUpdateCallback, ipv4AddressNumberOfEntries, curNumOfInterfaceIPv4Addresses[ifindexes[i]], objectPath);
#ifdef IPV6_SUPPORT
- int ipv6AddressNumberOfEntries = hostIf_IPInterface::getInstance (i)->getIPv6AddressNumberOfEntries ();
- RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv6AddressNumberOfEntries = %d, curNumOfInterfaceIPv6Addresses[%d] = %d\n",
- __FILE__, __FUNCTION__, __LINE__, ipv6AddressNumberOfEntries, i, curNumOfInterfaceIPv6Addresses[i]);
- sprintf (objectPath, "Device.IP.Interface.%d.IPv6Address.", i);
- sendAddRemoveEvents (mUpdateCallback, ipv6AddressNumberOfEntries, curNumOfInterfaceIPv6Addresses[i], objectPath);
-
- int ipv6PrefixNumberOfEntries = hostIf_IPInterface::getInstance (i)->getIPv6PrefixNumberOfEntries ();
- RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv6PrefixNumberOfEntries = %d, curNumOfInterfaceIPv6Prefixes[%d] = %d\n",
- __FILE__, __FUNCTION__, __LINE__, ipv6PrefixNumberOfEntries, i, curNumOfInterfaceIPv6Prefixes[i]);
- sprintf (objectPath, "Device.IP.Interface.%d.IPv6Prefix.", i);
- sendAddRemoveEvents (mUpdateCallback, ipv6PrefixNumberOfEntries, curNumOfInterfaceIPv6Prefixes[i], objectPath);
-
+ if (ifindexes[i] < sizeof(curNumOfInterfaceIPv6Addresses)/sizeof(curNumOfInterfaceIPv6Addresses[0])) {
+ int ipv6AddressNumberOfEntries = hostIf_IPInterface::getInstance (ifindexes[i])->getIPv6AddressNumberOfEntries ();
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv6AddressNumberOfEntries = %d, curNumOfInterfaceIPv6Addresses[%d] = %d\n",
+ __FILE__, __FUNCTION__, __LINE__, ipv6AddressNumberOfEntries, ifindexes[i], curNumOfInterfaceIPv6Addresses[ifindexes[i]]);
+ sprintf (objectPath, "Device.IP.Interface.%d.IPv6Address.", ifindexes[i]);
+ sendAddRemoveEvents (mUpdateCallback, ipv6AddressNumberOfEntries, curNumOfInterfaceIPv6Addresses[ifindexes[i]], objectPath);
+
+ int ipv6PrefixNumberOfEntries = hostIf_IPInterface::getInstance (ifindexes[i])->getIPv6PrefixNumberOfEntries ();
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s:%d] ipv6PrefixNumberOfEntries = %d, curNumOfInterfaceIPv6Prefixes[%d] = %d\n",
+ __FILE__, __FUNCTION__, __LINE__, ipv6PrefixNumberOfEntries, ifindexes[i], curNumOfInterfaceIPv6Prefixes[ifindexes[i]]);
+ sprintf (objectPath, "Device.IP.Interface.%d.IPv6Prefix.", ifindexes[i]);
+ sendAddRemoveEvents (mUpdateCallback, ipv6PrefixNumberOfEntries, curNumOfInterfaceIPv6Prefixes[ifindexes[i]], objectPath);
+ }
#endif // IPV6_SUPPORT
+ }
}
hostIf_IP::releaseLock();
diff --git a/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp
index 33c48e292..1b4be8168 100644
--- a/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp
@@ -255,6 +255,44 @@ int WiFiReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
const char *pSetting;
const int maxSSID_Instances = 1;
int instanceNum = 0;
+ #ifdef RDKV_TR69
+ const int maxRadioInstances = 1;
+ int radioIndex = 1;
+ if (strcasecmp(stMsgData->paramName,"Device.WiFi.RadioNumberOfEntries") == 0)
+ {
+ stMsgData->instanceNum = maxRadioInstances;
+ hostIf_WiFi *pIface = hostIf_WiFi::getInstance(maxRadioInstances);
+
+ if(!pIface)
+ {
+ return NOK;
+ }
+
+ ret = pIface->get_Device_WiFi_RadioNumberOfEntries(stMsgData);
+ }
+ else if (strcasecmp(stMsgData->paramName,"Device.WiFi.SSIDNumberOfEntries") == 0)
+ {
+ stMsgData->instanceNum = maxSSID_Instances;
+ hostIf_WiFi *pIface = hostIf_WiFi::getInstance(maxSSID_Instances);
+
+ if(!pIface)
+ {
+ return NOK;
+ }
+
+ ret = pIface->get_Device_WiFi_SSIDNumberOfEntries(stMsgData);
+ }
+ else if (strcasecmp(stMsgData->paramName,"Device.WiFi.AccessPointNumberOfEntries") == 0)
+ {
+ stMsgData->instanceNum = 0;
+ hostIf_WiFi *pIface = hostIf_WiFi::getInstance(stMsgData->instanceNum);
+ if(!pIface)
+ {
+ return NOK;
+ }
+ ret = pIface->get_Device_WiFi_AccessPointNumberOfEntries(stMsgData);
+ }
+ #else
if (strcasecmp(stMsgData->paramName,"Device.WiFi.AccessPointNumberOfEntries") == 0)
{
@@ -268,6 +306,7 @@ int WiFiReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
ret = pIface->get_Device_WiFi_AccessPointNumberOfEntries(stMsgData);
}
+ #endif
else if (strcasecmp(stMsgData->paramName,"Device.WiFi.EndPointNumberOfEntries") == 0)
{
hostIf_WiFi *pIface = hostIf_WiFi::getInstance (1);
@@ -288,6 +327,179 @@ int WiFiReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
}
ret = pIface->get_Device_WiFi_EnableWiFi(stMsgData);
}
+ #ifdef RDKV_TR69
+ else if (matchComponent(stMsgData->paramName, "Device.WiFi.Radio", &pSetting, instanceNum))
+ {
+ if ((instanceNum <= 0) || (instanceNum > maxRadioInstances))
+ {
+ return NOK;
+ }
+
+ stMsgData->instanceNum = instanceNum;
+ hostIf_WiFi_Radio *pWifiRadio = hostIf_WiFi_Radio::getInstance(stMsgData->instanceNum);
+ hostIf_WiFi_Radio_Stats *pWifiRadioStats = hostIf_WiFi_Radio_Stats::getInstance(stMsgData->instanceNum);
+
+ if ((!pWifiRadio) || (!pWifiRadioStats))
+ {
+ return NOK;
+ }
+
+ if (strcasecmp(pSetting,"Enable") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Enable(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Status") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Status(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Alias") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Alias(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Name") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Name(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"LastChange") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_LastChange(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"LowerLayers") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_LowerLayers(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Upstream") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Upstream(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"MaxBitRate") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_MaxBitRate(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"SupportedFrequencyBands") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_SupportedFrequencyBands(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"OperatingFrequencyBand") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_OperatingFrequencyBand(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"SupportedStandards") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_SupportedStandards(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"OperatingStandards") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_OperatingStandards(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"PossibleChannels") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_PossibleChannels(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"ChannelsInUse") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_ChannelsInUse(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Channel") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_Channel(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"AutoChannelSupported") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelSupported(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"AutoChannelEnable") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelEnable(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"AutoChannelRefreshPeriod") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_AutoChannelRefreshPeriod(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"OperatingChannelBandwidth") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_OperatingChannelBandwidth(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"ExtensionChannel") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_ExtensionChannel(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"GuardInterval") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_GuardInterval(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"MCS") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_MCS(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"MCS") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_MCS(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"TransmitPowerSupported") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_TransmitPowerSupported(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"TransmitPower") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_TransmitPower(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"IEEE80211hSupported") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_IEEE80211hSupported(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"IEEE80211hEnabled") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_IEEE80211hEnabled(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"RegulatoryDomain") == 0)
+ {
+ ret = pWifiRadio->get_Device_WiFi_Radio_RegulatoryDomain(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.BytesSent") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_BytesSent(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.BytesReceived") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_BytesReceived(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.PacketsSent") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_PacketsSent(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.PacketsReceived") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_PacketsReceived(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.ErrorsSent") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_ErrorsSent(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.ErrorsReceived") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_ErrorsReceived(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.DiscardPacketsSent") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_DiscardPacketsSent(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.DiscardPacketsReceived") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_DiscardPacketsReceived(stMsgData,radioIndex);
+ }
+ else if (strcasecmp(pSetting,"Stats.Noise") == 0)
+ {
+ ret = pWifiRadioStats->get_Device_WiFi_Radio_Stats_NoiseFloor(stMsgData,radioIndex);
+ }
+ else
+ {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"[%s:%d] Parameter : \'%s\' is Not Supported \n", __FUNCTION__, __LINE__, stMsgData->paramName);
+ stMsgData->faultCode = fcInvalidParameterName;
+ ret = NOK;
+ }
+ }
+ #endif
else if (matchComponent(stMsgData->paramName, "Device.WiFi.Endpoint", &pSetting, instanceNum))
{
stMsgData->instanceNum = instanceNum;
@@ -557,6 +769,34 @@ void WiFiReqHandler::checkForUpdates()
RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%s] hostIf_WiFi::getInstance(1) returned NULL\n", __FILE__, __FUNCTION__);
return;
}
+ #ifdef RDKV_TR69
+ HOSTIF_MsgData_t stMsgData;
+
+ if (OK == pIface->get_Device_WiFi_SSIDNumberOfEntries(&stMsgData))
+ {
+ int currentSSIDNumberOfEntries = get_int (stMsgData.paramValue);
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentSSIDNumberOfEntries = %d, savedSSIDNumberOfEntries = %d\n",
+ __FILE__, __FUNCTION__, currentSSIDNumberOfEntries, savedSSIDNumberOfEntries);
+ sendAddRemoveEvents (mUpdateCallback, currentSSIDNumberOfEntries, savedSSIDNumberOfEntries, (char *)DEVICE_WIFI_SSID_PROFILE);
+ }
+
+ if (!bfirstInstance && (OK == pIface->get_Device_WiFi_RadioNumberOfEntries (&stMsgData)))
+ {
+ bfirstInstance = true;
+ int currentRadioNumberOfEntries = get_int (stMsgData.paramValue);
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentRadioNumberOfEntries = %d, savedRadioNumberOfEntries = %d\n",
+ __FILE__, __FUNCTION__, currentRadioNumberOfEntries, savedRadioNumberOfEntries);
+ sendAddRemoveEvents (mUpdateCallback, currentRadioNumberOfEntries, savedRadioNumberOfEntries, (char *)DEVICE_WIFI_RADIO_PROFILE);
+ }
+
+ if (OK == pIface->get_Device_WiFi_EndPointNumberOfEntries (&stMsgData))
+ {
+ int currentEndPointNumberOfEntries = get_int (stMsgData.paramValue);
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s:%s] currentEndPointNumberOfEntries = %d, savedEndPointNumberOfEntries = %d\n",
+ __FILE__, __FUNCTION__, currentEndPointNumberOfEntries, savedEndPointNumberOfEntries);
+ sendAddRemoveEvents (mUpdateCallback, currentEndPointNumberOfEntries, savedEndPointNumberOfEntries, (char *)DEVICE_WIFI_ENDPOINT_PROFILE);
+ }
+ #endif
}
#endif /* #ifdef USE_WIFI_PROFILE */
diff --git a/src/hostif/handlers/src/hostIf_XREClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_XREClient_ReqHandler.cpp
index e4add2545..3f67b39a4 100644
--- a/src/hostif/handlers/src/hostIf_XREClient_ReqHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_XREClient_ReqHandler.cpp
@@ -45,6 +45,8 @@ updateCallback XREClientReqHandler::mUpdateCallback = NULL;
GMutex XREClientReqHandler::m_mutex;
int XREClientReqHandler::numOfEntries = 0;
+#define XCONF_CHECKNOW_SCRIPT_CMD "backgroundrun /usr/bin/rdkvfwupgrader 0 3 >> /opt/logs/swupdate.log"
+
msgHandler* XREClientReqHandler::getInstance()
{
@@ -160,6 +162,17 @@ int XREClientReqHandler::handleSetMsg(HOSTIF_MsgData_t *stMsgData)
{
ret = set_Device_X_COMCAST_COM_Xcalibur_Client_XRE_xreLogLevel(stMsgData);
}
+ #ifdef RDKV_TR69
+ else if(strcasecmp(stMsgData->paramName,"Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreReceiverRestart") == 0)
+ {
+ ret = setXreReceiverRestart(stMsgData);
+ }
+ else if(strcasecmp(stMsgData->paramName,"Device.X_COMCAST-COM_Xcalibur.DevApp.devAppRestartRequest") == 0)
+ {
+ // xreReceiverRestart uses /lib/rdk/restartReceiver.sh, which sometimes doesn't start receiver back
+ ret = setDevAppRestartRequest(stMsgData);
+ }
+ #endif
else
{
stMsgData->faultCode = fcInvalidParameterName;
@@ -199,6 +212,10 @@ int XREClientReqHandler::handleGetMsg(HOSTIF_MsgData_t *stMsgData)
{
ret = get_Device_X_COMCAST_COM_Xcalibur_Client_XRE_xreEnable(stMsgData);
}
+ else if(strcasecmp(stMsgData->paramName,"Device.X_COMCAST-COM_Xcalibur.Client.xconfCheckNow") == 0)
+ {
+ ret = get_Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow(stMsgData);
+ }
else if(strcasecmp(stMsgData->paramName,"Device.X_COMCAST-COM_Xcalibur.Client.XRE.xreStatus") == 0)
{
ret = get_Device_X_COMCAST_COM_Xcalibur_Client_XRE_xreStatus(stMsgData);
@@ -469,6 +486,48 @@ void XREClientReqHandler::registerUpdateCallback(updateCallback cb)
mUpdateCallback = cb;
}
+int set_Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow(HOSTIF_MsgData_t *stMsgData)
+{
+ FILE *file = fopen("/tmp/xconfchecknow_val", "w");
+ if (file == NULL) {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF, "[%s:%s:%d]Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Error opening file for write.\n",__FILE__,__FUNCTION__,__LINE__);
+ return NOK;
+ }
+ fprintf(file, "%s", stMsgData->paramValue);
+ fclose(file);
+ if(0 == strncasecmp("TRUE",stMsgData->paramValue ,strlen("TRUE")) || 0 == strncasecmp("CANARY",stMsgData->paramValue ,strlen("CANARY")))
+ {
+ /*On setting xconfCheckNow,results the device to connect with the XCONF server
+ for the purpose of firmware and configuration checks.*/
+ if(-1 == v_secure_system(XCONF_CHECKNOW_SCRIPT_CMD))
+ {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF, "[%s:%s:%d]Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Running checkNow script failed.\n",__FILE__,__FUNCTION__,__LINE__);
+
+ return NOK;
+ }
+
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF, "[%s:%s:%d]Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: CheckNow Running... \n",__FILE__,__FUNCTION__,__LINE__);
+ }
+ else
+ {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF, "[%s:%s:%d]Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: \"%s\" Invalid Input. Valid Input is \"TRUE or CANARY\" \n",__FILE__,__FUNCTION__,__LINE__,stMsgData->paramValue);
+ return NOK;
+ }
+ return OK;
+}
+
+int get_Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow(HOSTIF_MsgData_t *stMsgData)
+{
+ FILE *file = fopen("/tmp/xconfchecknow_val", "r");
+ if (file == NULL) {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF, "[%s:%s:%d]Device_X_COMCAST_COM_Xcalibur_Client_xconfCheckNow: Error opening file for read.\n",__FILE__,__FUNCTION__,__LINE__);
+ return NOK;
+ }
+ fscanf(file, "%9s", stMsgData->paramValue);
+ fclose(file);
+ return OK;
+}
+
void XREClientReqHandler::checkForUpdates()
{
HOSTIF_MsgData_t msgData;
diff --git a/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp b/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp
index d3db9e82f..3783b6549 100644
--- a/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp
@@ -82,15 +82,22 @@ bool DSClientReqHandler::init()
{
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"[%s()] Device manager Initializing\n", __FUNCTION__);
- try
+ while(true)
{
- device::Manager::Initialize();
+ try
+ {
+ device::Manager::Initialize();
+ }
+ catch(const std::exception &e)
+ {
+ RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Exception thrown while initializing device manager %s\n", e.what());
+ sleep(3);
+ continue;
+ }
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s()] Device manager Initialized success break loop \n", __FUNCTION__);
+ break;
}
- catch(const std::exception &e)
- {
- RDK_LOG(RDK_LOG_ERROR,LOG_TR69HOSTIF,"Exception thrown while initializing device manager %s\n", e.what());
- }
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
+ RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return true;
}
diff --git a/src/hostif/handlers/src/hostIf_jsonReqHandlerThread.cpp b/src/hostif/handlers/src/hostIf_jsonReqHandlerThread.cpp
index 8ca599b7c..66eb2a43b 100644
--- a/src/hostif/handlers/src/hostIf_jsonReqHandlerThread.cpp
+++ b/src/hostif/handlers/src/hostIf_jsonReqHandlerThread.cpp
@@ -34,11 +34,7 @@
#include "hostIf_msgHandler.h"
#include "hostIf_utils.h"
#include
-#ifdef LIBSOUP3_ENABLE
#include "libsoup-3.0/libsoup/soup.h"
-#else
-#include "libsoup-2.4/libsoup/soup.h"
-#endif
#include
#include
extern T_ARGLIST argList;
@@ -222,7 +218,6 @@ hostIf_HTTPJsonParse(const unsigned char *message, int length)
return context.list;
}
-#ifdef LIBSOUP3_ENABLE
void hostIf_HTTPJsonMsgHandler(
SoupServer *server,
SoupServerMessage *msg,
@@ -338,123 +333,6 @@ void hostIf_HTTPJsonMsgHandler(
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return;
}
-#else
-void hostIf_HTTPJsonMsgHandler(
- SoupServer *server,
- SoupMessage *msg,
- const gchar *path,
- GHashTable *query,
- SoupClientContext *client,
- gpointer user_data)
-{
- GList *params;
-
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
-
- if (!msg->request_body ||
- !msg->request_body->data ||
- !msg->request_body->length)
- {
- soup_message_set_status_full (msg, SOUP_STATUS_BAD_REQUEST, "No request data.");
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting.. Failed due to no message data.\n", __FUNCTION__, __FILE__);
- return;
- }
-
- params = hostIf_HTTPJsonParse((const unsigned char *) msg->request_body->data, msg->request_body->length);
- if (!params)
- {
- soup_message_set_status_full (msg, SOUP_STATUS_BAD_REQUEST, "No request data.");
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting... Failed due to Parse HTTP Json messages. \n", __FUNCTION__, __FILE__);
- return;
- }
-
- yajl_gen json;
-#ifndef YAJL_V2
- json = yajl_gen_alloc(/* &allocFuncs */ NULL, NULL);
-#else
- json = yajl_gen_alloc(NULL);
-#endif
- if (!json)
- {
- soup_message_set_status_full (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR, "Cannot create return object");
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting.. Failed to create json object\n", __FUNCTION__, __FILE__);
- return;
- }
-
- yajl_gen_map_open(json);
- yajl_gen_string(json, (const unsigned char *) "paramList", 9);
- yajl_gen_array_open(json);
-
- GList *l = params;
- while (l)
- {
- HOSTIF_MsgData_t *param = (HOSTIF_MsgData_t *) g_malloc0(sizeof(HOSTIF_MsgData_t));
- strncpy( param->paramName,(char *) l->data,TR69HOSTIFMGR_MAX_PARAM_LEN );
- // requestList = g_list_append(requestList, param);
-
- if (hostIf_GetMsgHandler(param) == OK) //We are expecting on Get call from JSON
- {
- yajl_gen_map_open(json);
- yajl_gen_string(json, (const unsigned char *) "name", 4);
- yajl_gen_string(json, (const unsigned char *) param->paramName, strlen(param->paramName));
-
- yajl_gen_string(json, (const unsigned char *) "value", 5);
- switch (param->paramtype) {
- case hostIf_StringType:
- yajl_gen_string(json, (const unsigned char*) param->paramValue, strlen((char*)param->paramValue));
- break;
- case hostIf_IntegerType:
- case hostIf_UnsignedIntType:
- yajl_gen_integer(json, get_int(param->paramValue));
- break;
- case hostIf_UnsignedLongType:
- yajl_gen_integer(json, get_ulong(param->paramValue));
- break;
- case hostIf_BooleanType:
- yajl_gen_bool(json, get_boolean(param->paramValue));
- break;
- case hostIf_DateTimeType:
- // TODO: What to do here? What is the actual data representation?
- yajl_gen_string(json, (const unsigned char *) "Unknown", 7);
- break;
- default:
- RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,"Unknown data type: %d", param->paramtype);
- break;
- }
-
- yajl_gen_map_close(json);
- }
- hostIf_Free_stMsgData(param);
-
-
- l = l->next;
- }
- // Free the list, but do NOT deallocate the strings. They're now in the requestList
- g_list_free_full(params, g_free);
- params = NULL;
-
- // Close out the structures
- yajl_gen_array_close(json);
- yajl_gen_map_close(json);
-
- // Get the string
- const unsigned char *buf;
- unsigned int len;
- yajl_gen_get_buf(json, &buf, &len);
-
- // TODO: What is the correct MIME type?
- soup_message_set_response(msg, (const char *) "application/json", SOUP_MEMORY_COPY, (const char *) buf, len);
- soup_message_set_status (msg, SOUP_STATUS_OK);
-
- yajl_gen_free(json);
-
- //json_t* incommingReq = NULL;
- //json_t* outRes = NULL;
- // ret = hostIf_JsonReqResHandler (incommingReq, outRes);
- RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
- return;
-}
-#endif
/**
* @brief This API is used to initialize and start the HTTP server process. It use to serve the
@@ -471,11 +349,7 @@ void hostIf_HttpServerStart()
#endif
if(server == NULL)
-#ifdef LIBSOUP3_ENABLE
server = soup_server_new("server-header", "hostif", NULL);
-#else
- server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "hostif", NULL);
-#endif
if (!server)
{
diff --git a/src/hostif/handlers/src/hostIf_msgHandler.cpp b/src/hostif/handlers/src/hostIf_msgHandler.cpp
index 8e35c75f8..a73572299 100644
--- a/src/hostif/handlers/src/hostIf_msgHandler.cpp
+++ b/src/hostif/handlers/src/hostIf_msgHandler.cpp
@@ -30,6 +30,9 @@
**/
#include
+#include
+#include
+#include
#include "hostIf_main.h"
#include "hostIf_msgHandler.h"
#include "hostIf_utils.h"
@@ -68,20 +71,143 @@ extern GHashTable* paramMgrhash;
extern T_ARGLIST argList;
static std::mutex get_handler_mutex;
static std::mutex set_handler_mutex;
+static int getCount = 0;
+static int setCount = 0;
+static std::atomic getCountSinceBoot{0};
+static time_t bootTimeSec = 0;
+static std::atomic setCountSinceBoot{0};
+static time_t bootTimeSecSet =0;
+static std::atomic loggedGet200Within1Min {false};
+static std::atomic loggedGet1000Within5Min {false};
+static std::atomic loggedSet200Within1Min {false};
+static std::atomic loggedSet1000Within5Min {false};
+
+#define PARAM_VALUE_STR_SIZE 128
+
+
+void paramValueToString(const HOSTIF_MsgData_t *stMsgData, char *paramValueStr, size_t strSize)
+{
+ if (!stMsgData || !paramValueStr || strSize == 0) {
+ if (paramValueStr && strSize > 0)
+ snprintf(paramValueStr, strSize, "");
+ return;
+ }
+
+ switch (stMsgData->paramtype) {
+ case hostIf_StringType:
+ case hostIf_DateTimeType:
+ snprintf(paramValueStr, strSize, "%s", (const char*)stMsgData->paramValue);
+ break;
+ case hostIf_IntegerType: {
+ int val = 0;
+ memcpy(&val, stMsgData->paramValue, sizeof(val));
+ snprintf(paramValueStr, strSize, "%d", val);
+ break;
+ }
+ case hostIf_UnsignedIntType: {
+ unsigned int val = 0;
+ memcpy(&val, stMsgData->paramValue, sizeof(val));
+ snprintf(paramValueStr, strSize, "%u", val);
+ break;
+ }
+ case hostIf_BooleanType: {
+ bool val = false;
+ memcpy(&val, stMsgData->paramValue, sizeof(val));
+ snprintf(paramValueStr, strSize, "%s", val ? "true" : "false");
+ break;
+ }
+ case hostIf_UnsignedLongType: {
+ unsigned long val = 0;
+ memcpy(&val, stMsgData->paramValue, sizeof(val));
+ snprintf(paramValueStr, strSize, "%lu", val);
+ break;
+ }
+ default:
+ snprintf(paramValueStr, strSize, "");
+ break;
+ }
+}
int hostIf_GetMsgHandler(HOSTIF_MsgData_t *stMsgData)
{
LOG_ENTRY_EXIT;
int ret = NOK;
+ getCount++;
+ if (getCount % 10 == 0) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"[%s:%d] GET called %d times\n",__FUNCTION__, __LINE__, getCount);
+ }
std::lock_guard lock(get_handler_mutex);
+ // On first call, record boot time
+ if (bootTimeSec == 0) {
+ struct timespec ts;
+ clock_gettime(CLOCK_BOOTTIME, &ts);
+ bootTimeSec = ts.tv_sec;
+ }
+ getCountSinceBoot++;
+
+ // Calculate seconds since boot
+ struct timespec now;
+ clock_gettime(CLOCK_BOOTTIME, &now);
+ long secondsSinceBoot = now.tv_sec - bootTimeSec;
+
+ // Log if getCount reaches 200 before 1 minute from boot
+ if ( !loggedGet200Within1Min && getCountSinceBoot >= 200 && secondsSinceBoot <= 60) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] GET count reached 200 within 1 minute after boot (actual: %ld seconds)\n",
+ __FUNCTION__, __LINE__, secondsSinceBoot);
+ #ifdef T2_EVENT_ENABLED
+ t2CountNotify("TR69HOSTIF_GET_200_WITHIN_1MIN", 1);
+ #endif
+ loggedGet200Within1Min = true;
+ }
+
+ // Log if getCount reaches 1000 before 5 minutes from boot
+ if ( !loggedGet1000Within5Min && getCountSinceBoot >= 1000 && secondsSinceBoot <= 300) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] GET count reached 1000 within 5 minutes after boot (actual: %ld seconds)\n",
+ __FUNCTION__, __LINE__, secondsSinceBoot);
+ #ifdef T2_EVENT_ENABLED
+ t2CountNotify("TR69HOSTIF_GET_1000_WITHIN_5MIN", 1);
+ #endif
+ loggedGet1000Within5Min =true;
+ }
try
{
/* Find the respective manager and forward the request*/
msgHandler *pMsgHandler = HostIf_GetMgr(stMsgData);
if(pMsgHandler)
+ {
+ auto startTime = std::chrono::high_resolution_clock::now();
ret = pMsgHandler->handleGetMsg(stMsgData);
+ auto endTime = std::chrono::high_resolution_clock::now();
+ auto timeTaken = std::chrono::duration_cast(endTime - startTime).count();
+ char paramValueStr[PARAM_VALUE_STR_SIZE] = {0};
+ paramValueToString(stMsgData, paramValueStr, sizeof(paramValueStr));
+
+
+ // Calculate time taken in microseconds
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] ret: %d, paramName: %s, paramValue: %s, timeTaken: %lld us\n",
+ __FUNCTION__, __LINE__, ret,
+ stMsgData->paramName,
+ paramValueStr,
+ timeTaken);
+ // Telemetry and debug log if processing time > 5 second (1,000,000 us)
+ if (timeTaken > 5000000) {
+ // Debug log
+ RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
+ "[%s:%d] Slow GET detected: paramName: %s, timeTaken: %lld ms\n",
+ __FUNCTION__, __LINE__, stMsgData->paramName, timeTaken/1000);
+ #ifdef T2_EVENT_ENABLED
+ // Telemetry: report paramName
+ t2ValNotify("TR69HOSTIF_GET_TIMEOUT_PARAM", stMsgData->paramName);
+ #endif
+
+ }
+ }
+
}
catch (const std::exception& e)
{
@@ -94,15 +220,79 @@ int hostIf_GetMsgHandler(HOSTIF_MsgData_t *stMsgData)
int hostIf_SetMsgHandler(HOSTIF_MsgData_t *stMsgData)
{
int ret = NOK;
+ setCount++;
+ if (setCount % 10 == 0) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,"[%s:%d] SET called %d times\n",__FUNCTION__, __LINE__, setCount);
+ }
std::lock_guard lock(set_handler_mutex);
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
+ if (bootTimeSecSet == 0) {
+ struct timespec ts;
+ clock_gettime(CLOCK_BOOTTIME, &ts);
+ bootTimeSecSet = ts.tv_sec;
+ }
+ setCountSinceBoot++;
+
+ // Calculate seconds since boot for SET
+ struct timespec now;
+ clock_gettime(CLOCK_BOOTTIME, &now);
+ long secondsSinceBoot = now.tv_sec - bootTimeSecSet;
+
+ // Log if setCount reaches 200 before 1 minute from boot
+ if (!loggedSet200Within1Min && setCountSinceBoot >= 200 && secondsSinceBoot <= 60) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] SET count reached 200 within 1 minute after boot (actual: %ld seconds)\n",
+ __FUNCTION__, __LINE__, secondsSinceBoot);
+ #ifdef T2_EVENT_ENABLED
+ t2CountNotify("TR69HOSTIF_SET_200_WITHIN_1MIN", 1);
+ #endif
+ loggedSet200Within1Min = true ;
+ }
+
+ // Log if setCount reaches 1000 before 5 minutes from boot
+ if (!loggedSet1000Within5Min && setCountSinceBoot >= 1000 && secondsSinceBoot <= 300) {
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] SET count reached 1000 within 5 minutes after boot (actual: %ld seconds)\n",
+ __FUNCTION__, __LINE__, secondsSinceBoot);
+ #ifdef T2_EVENT_ENABLED
+ t2CountNotify("TR69HOSTIF_SET_1000_WITHIN_5MIN", 1);
+ #endif
+ loggedSet1000Within5Min = true;
+ }
+
+
/* Find the respective manager and forward the request*/
msgHandler *pMsgHandler = HostIf_GetMgr(stMsgData);
if(pMsgHandler)
+ {
+ auto startTime = std::chrono::high_resolution_clock::now();
ret = pMsgHandler->handleSetMsg(stMsgData);
+ auto endTime = std::chrono::high_resolution_clock::now();
+ auto timeTakenset = std::chrono::duration_cast(endTime - startTime).count();
+
+ char paramValueStr[128] = {0};
+ paramValueToString(stMsgData, paramValueStr, sizeof(paramValueStr));
+
+ RDK_LOG(RDK_LOG_INFO, LOG_TR69HOSTIF,
+ "[%s:%d] ret: %d, paramName: %s, paramValue: %s, timeTaken: %lld us\n",
+ __FUNCTION__, __LINE__, ret,
+ stMsgData->paramName,
+ paramValueStr,
+ timeTakenset);
+ // Telemetry and debug log if processing time > 5 seconds (5,000,000 us)
+ if (timeTakenset > 5000000) {
+ RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,
+ "[%s:%d] Slow SET detected: paramName: %s, timeTaken: %lld ms\n",
+ __FUNCTION__, __LINE__, stMsgData->paramName, timeTakenset/1000);
+ #ifdef T2_EVENT_ENABLED
+ t2ValNotify("TR69HOSTIF_SET_TIMEOUT_PARAM", stMsgData->paramName);
+ #endif
+
+ }
+ }
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return ret;
diff --git a/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp b/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp
index 0cdc2147f..314290852 100644
--- a/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp
+++ b/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp
@@ -514,7 +514,7 @@ void init_rbus_dml_provider()
DataModelParam dmParam = {0};
if (getParamInfoFromDataModel(dataBaseHandle, dataElements[rbus_param_counter].name, &dmParam) == 0)
{
- RDK_LOG (RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s][rbusdml] Parameter not found. \n ", __FUNCTION__);
+ RDK_LOG (RDK_LOG_DEBUG, LOG_TR69HOSTIF, "[%s][rbusdml] Parameter not found: %s\n", __FUNCTION__, dataElements[rbus_param_counter].name);
}
else
{
@@ -633,3 +633,10 @@ int getRbusStringParam(const char *rbusParamName, char **rbusParamValue) {
return OK ;
}
+
+#ifdef GTEST_ENABLE
+int (*convertRbus2hostIfDataTypeFunc()) (rbusValueType_t type, HostIf_ParamType_t* pParamType)
+{
+ return &convertRbus2hostIfDataType;
+}
+#endif
diff --git a/src/hostif/httpserver/Makefile.am b/src/hostif/httpserver/Makefile.am
index 2fe67f71a..2e8769a34 100644
--- a/src/hostif/httpserver/Makefile.am
+++ b/src/hostif/httpserver/Makefile.am
@@ -21,12 +21,8 @@ noinst_LTLIBRARIES=libhttpserver.la
libhttpserver_la_SOURCES=src/http_server.cpp src/request_handler.cpp src/XrdkCentralComRFCVar.cpp
-libhttpserver_la_LDFLAGS = -lrdkloggers -lwdmp-c $(SOUP_LIBS) -lcjson
-if LIBSOUP3_ENABLE
-libhttpserver_la_LDFLAGS += -lsoup-3.0
-else
-libhttpserver_la_LDFLAGS += -lsoup-2.4
-endif
+libhttpserver_la_LDFLAGS = -lrdkloggers -lwdmp-c $(SOUP_LIBS) -lcjson -lsoup-3.0
+
AM_CXXFLAGS = "-std=c++11" $(SOUP_CFLAGS) -I$(top_srcdir)/src/hostif/httpserver/include \
-I$(top_srcdir)/src/hostif/include \
@@ -37,13 +33,10 @@ AM_CXXFLAGS = "-std=c++11" $(SOUP_CFLAGS) -I$(top_srcdir)/src/hostif/httpserver/
-I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/glib-2.0 \
-I${PKG_CONFIG_SYSROOT_DIR}$(libdir)/glib-2.0/include \
-I$(top_srcdir)/src/hostif/parodusClient/waldb \
- -I$(top_srcdir)/src/hostif/parodusClient/pal
+ -I$(top_srcdir)/src/hostif/parodusClient/pal \
+ -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/libsoup-3.0
+
-if LIBSOUP3_ENABLE
-AM_CXXFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/libsoup-3.0 -DLIBSOUP3_ENABLE
-else
-AM_CXXFLAGS += -I$(PKG_CONFIG_SYSROOT_DIR)/usr/include/libsoup-2.4
-endif
libhttpserver_la_LIBADD = $(top_builddir)/src/hostif/parodusClient/waldb/libwaldb.la \
$(top_builddir)/src/hostif/handlers/libMsgHandlers.la
diff --git a/src/hostif/httpserver/include/XrdkCentralComRFCVar.h b/src/hostif/httpserver/include/XrdkCentralComRFCVar.h
index 590ba90a8..6143bc9e4 100644
--- a/src/hostif/httpserver/include/XrdkCentralComRFCVar.h
+++ b/src/hostif/httpserver/include/XrdkCentralComRFCVar.h
@@ -23,6 +23,10 @@
#include
#include
+#if defined(GTEST_ENABLE)
+#include
+#endif
+
using namespace std;
#define XRFC_VAR_STORE_RELOADCACHE "RFC_CONTROL_RELOADCACHE"
@@ -49,6 +53,11 @@ class XRFCVarStore
void initRFCVarFileName();
bool loadRFCVarIntoCache();
+#if defined(GTEST_ENABLE)
+ FRIEND_TEST(httpserverTest, initRFCVarFileName);
+ FRIEND_TEST(httpserverTest, loadRFCVarIntoCache);
+ FRIEND_TEST(httpserverTest, Invalid_RFC_filename);
+#endif
};
#endif // XRDKCENTRALCOMRFCVARSTORE_H
diff --git a/src/hostif/httpserver/include/request_handler.h b/src/hostif/httpserver/include/request_handler.h
index 9b8814433..657e94b9e 100644
--- a/src/hostif/httpserver/include/request_handler.h
+++ b/src/hostif/httpserver/include/request_handler.h
@@ -65,7 +65,7 @@
#include "waldb.h"
-#define MAX_PARAMETER_LEN 512
+#define MAX_PARAMETER_LEN 512
#define MAX_PARAMETERNAME_LEN 256
#ifdef __cplusplus
diff --git a/src/hostif/httpserver/src/gtest/Makefile.am b/src/hostif/httpserver/src/gtest/Makefile.am
new file mode 100644
index 000000000..54c1abfc8
--- /dev/null
+++ b/src/hostif/httpserver/src/gtest/Makefile.am
@@ -0,0 +1,37 @@
+################################################################################
+# Copyright 2024 Comcast Cable Communications Management, LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+################################################################################
+
+AUTOMAKE_OPTIONS = subdir-objects
+# Define the program name and the source files
+bin_PROGRAMS = httpserver_gtest
+
+# Define the include directories
+COMMON_CPPFLAGS = -std=c++11 -DGTEST_ENABLE -DUSE_DEV_PROPERTIES_CONF -DUSE_REMOTE_DEBUGGER -I/usr/include -I/usr/include/cjson -I$(TOP_DIR)/src/hostif/include -I$(TOP_DIR)/src/hostif/profiles/DeviceInfo -I$(TOP_DIR)/src/unittest/stubs -I$(TOP_DIR)/src/unittest/stubs/ds -I$(TOP_DIR)/src/unittest/stubs/rbus/include -I$(TOP_DIR)/src/hostif/handlers/include -I$(TOP_DIR)/src/hostif/parodusClient/pal -I$(TOP_DIR)/src/hostif/parodusClient/waldb -I$(TOP_DIR)/src/hostif/httpserver/include -I$(TOP_DIR)/src/hostif/handlers/src -I/usr/include/rbus -I/usr/local/include/rbus -Isrc/unittest/stubs/rbus/include/ -I$(TOP_DIR)/src/hostif/profiles/Time -I$(TOP_DIR)/src/hostif/profiles/Device -I$(TOP_DIR)/src/hostif/profiles/IP -I$(TOP_DIR)/src/hostif/profiles/STBService -I/usr/rdk-halif-device_settings/include/ -I/usr/rdkvhal-devicesettings-raspberrypi4/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I$(TOP_DIR)/src/hostif/profiles/Ethernet -I/usr/remote_debugger/src/ -I/usr/local/include/libparodus/ -I/usr/local/include/wrp-c/ -I$(TOP_DIR)/src/hostif/parodusClient/startParodus/ -I/usr/include/libsoup-3.0
+
+# Define the libraries to link against
+COMMON_LDADD = -lgtest -lgtest_main -lgmock_main -lgmock -lgcov $(GLIB_LIBS) -ltinyxml2 -lcjson -lcurl -lglib-2.0 -llibparodus -lwrp-c -lnanomsg -lmsgpackc -ltrower-base64 -lcimplog -lgio-2.0 -lsoup-3.0
+
+# Define the compiler flags
+COMMON_CXXFLAGS = -frtti $(GLIB_CFLAGS) $(SOUP_LIBS) -fprofile-arcs -ftest-coverage
+
+httpserver_gtest_SOURCES = $(TOP_DIR)/src/hostif/src/hostIf_utils.cpp $(TOP_DIR)/src/hostif/src/IniFile.cpp $(TOP_DIR)/src/unittest/stubs/secure_wrapper.c $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFCStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComRFC.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStore.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/XrdkCentralComBSStoreJournal.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_NotificationHandler.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_notification.cpp $(TOP_DIR)/src/unittest/stubs/dm_stubs.cpp $(TOP_DIR)/src/hostif/parodusClient/waldb/waldb.cpp $(TOP_DIR)/src/unittest/stubs/wdmp-c.c $(TOP_DIR)/src/unittest/stubs/wdmp_internal.c $(TOP_DIR)/src/hostif/httpserver/src/http_server.cpp $(TOP_DIR)/src/hostif/httpserver/src/request_handler.cpp $(TOP_DIR)/src/hostif/httpserver/src/XrdkCentralComRFCVar.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_Processor.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_attribute.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_parameter.cpp $(TOP_DIR)/src/unittest/stubs/file_writer.cpp $(TOP_DIR)/src/hostif/httpserver/src/gtest/gtest_httpserver.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/libpd.cpp $(TOP_DIR)/src/hostif/parodusClient/pal/webpa_adapter.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_msgHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_XrdkCentralT2_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_IPClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_DeviceClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/DeviceInfo/Device_DeviceInfo_ProcessStatus_Process.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_DisplayDevice.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_EthernetClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/Ethernet/Device_Ethernet_Interface_Stats.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_TimeClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface.cpp $(TOP_DIR)/src/hostif/profiles/Time/Device_Time.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_updateHandler.cpp $(TOP_DIR)/src/hostif/profiles/Device/x_rdk_profile.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_dsClient_ReqHandler.cpp $(TOP_DIR)/src/hostif/handlers/src/hostIf_rbus_Dml_Provider.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Capabilities.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_SPDIF.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoDecoder.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_AudioOutput.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_HDMI.cpp $(TOP_DIR)/src/hostif/profiles/STBService/Components_VideoOutput.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_Stats.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_ActivePort.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Diagnostics_IPPing.cpp $(TOP_DIR)/src/hostif/profiles/IP/Device_IP_Interface_IPv4Address.cpp $(TOP_DIR)/src/hostif/handlers/src/x_rdk_req_handler.cpp $(TOP_DIR)/src/unittest/stubs/ds/libprocps.cpp
+
+# Apply common properties to each program
+httpserver_gtest_CPPFLAGS = $(COMMON_CPPFLAGS)
+httpserver_gtest_CXXFLAGS = $(COMMON_CXXFLAGS)
+httpserver_gtest_LDADD = $(COMMON_LDADD)
diff --git a/src/hostif/httpserver/src/gtest/gtest_httpserver.cpp b/src/hostif/httpserver/src/gtest/gtest_httpserver.cpp
new file mode 100644
index 000000000..20993fdd7
--- /dev/null
+++ b/src/hostif/httpserver/src/gtest/gtest_httpserver.cpp
@@ -0,0 +1,726 @@
+#include
+#include
+#include
+#include "hostIf_tr69ReqHandler.h"
+#include "hostIf_utils.h"
+#include "XrdkCentralComRFCStore.h"
+#include "XrdkCentralComBSStore.h"
+#include "XrdkCentralComBSStoreJournal.h"
+#include "Device_DeviceInfo_Processor.h"
+#include "Device_DeviceInfo_ProcessStatus.h"
+#include "XrdkCentralComRFCVar.h"
+#include "request_handler.h"
+#include "IniFile.h"
+#include "hostIf_utils.h"
+#include "hostIf_main.h"
+#include "webpa_notification.h"
+#include "webpa_parameter.h"
+#include "rbus_value.h"
+#include "libsoup/soup.h"
+#include
+#include
+
+#include "rdk_debug.h"
+#include "waldb.h"
+#include "file_writer.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+#include
+#include
+#ifdef __cplusplus
+}
+#endif
+
+#include "Device_DeviceInfo.h"
+
+#include
+#include "cJSON.h"
+
+#include
+#include
+
+#define GTEST_DEFAULT_RESULT_FILEPATH "/tmp/Gtest_Report/"
+#define GTEST_DEFAULT_RESULT_FILENAME "hostif_gtest_report.json"
+#define GTEST_REPORT_FILEPATH_SIZE 128
+
+using namespace std;
+
+XRFCStore* m_rfcStore;
+XBSStore* m_bsStore;
+XBSStoreJournal* m_bsStoreJournal;
+XRFCVarStore* m_varStore;
+
+extern GHashTable* paramMgrhash;
+
+std::mutex mtx_httpServerThreadDone;
+std::condition_variable cv_httpServerThreadDone;
+bool httpServerThreadDone = false;
+GThread *HTTPServerThread = NULL;
+char *HTTPServerName = (char *)"HTTPServerThread";
+GError *httpError = NULL;
+GHashTable* paramMgrhash = NULL;
+T_ARGLIST argList = {{'\0'}, 0};
+static SoupServer *http_server = NULL;
+
+
+#ifdef GTEST_ENABLE
+extern DATA_TYPE (*getWdmpDataTypeFunc())(char * );
+extern HostIf_ParamType_t (*getHostIfParamTypeFunc())(DATA_TYPE wdmpDataType);
+bool (*validateParamValueFunc())(const string ¶mValue, HostIf_ParamType_t dataType);
+WDMP_STATUS (*handleRFCRequestFunc())(REQ_TYPE reqType, param_t *param);
+WDMP_STATUS (*invokeHostIfAPIFunc())(REQ_TYPE reqType, param_t *param, HostIf_Source_Type_t bsUpdate, const char *pcCallerID);
+WDMP_STATUS (*validateAgainstDataModelFunc())(REQ_TYPE reqType, char* paramName, const char* paramValue, DATA_TYPE *dataType, char **defaultValue, HostIf_Source_Type_t *bsUpdate);
+extern void (*HTTPRequestHandlerFunc()) (
+ SoupServer *server,
+ SoupServerMessage *msg,
+ const char *path,
+ GHashTable *query,
+ void *user_data);
+extern void (*convertAndAssignParamValueFunc()) (HOSTIF_MsgData_t *param, char *value);
+extern char* (*getStringValueFunc()) (HostIf_ParamType_t paramType, char *value);
+#endif
+
+TEST(httpserverTest,initRFCVarFileName){
+ m_varStore=XRFCVarStore::getInstance();
+ if(m_varStore)
+ {
+ m_varStore->initRFCVarFileName();
+ m_varStore->m_filename.erase(std::remove(m_varStore->m_filename.begin(),m_varStore->m_filename.end(),'"'),m_varStore->m_filename.end());
+ EXPECT_EQ(m_varStore->m_filename,"/opt/secure/RFC/rfcVariable.ini");
+ }
+}
+
+TEST(httpserverTest, loadRFCVarIntoCache) {
+ m_varStore = XRFCVarStore::getInstance();
+ if(m_varStore)
+ {
+ bool ret = m_varStore->loadRFCVarIntoCache();
+ EXPECT_EQ(ret, true);
+ }
+}
+
+TEST(httpserverTest, getValue) {
+ m_varStore = XRFCVarStore::getInstance();
+ const string key = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.WebCfgData";
+ if(m_varStore)
+ {
+ string value = m_varStore->getValue(key);
+ EXPECT_EQ(value, "testCfg");
+ }
+}
+
+
+TEST(httpserverTest, getWdmpDataType) {
+ EXPECT_EQ(getWdmpDataTypeFunc()("string"), WDMP_STRING);
+ EXPECT_EQ(getWdmpDataTypeFunc()("boolean"), WDMP_BOOLEAN);
+ EXPECT_EQ(getWdmpDataTypeFunc()("unsignedInt"), WDMP_UINT);
+ EXPECT_EQ(getWdmpDataTypeFunc()("int"), WDMP_INT);
+ EXPECT_EQ(getWdmpDataTypeFunc()("unsignedLong"), WDMP_ULONG);
+ EXPECT_EQ(getWdmpDataTypeFunc()("dataTime"), WDMP_DATETIME);
+ EXPECT_EQ(getWdmpDataTypeFunc()("float"), WDMP_NONE);
+}
+
+TEST(httpserverTest, getHostIfParamType) {
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_STRING), hostIf_StringType);
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_INT), hostIf_IntegerType);
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_UINT), hostIf_UnsignedIntType);
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_BOOLEAN), hostIf_BooleanType);
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_DATETIME), hostIf_DateTimeType);
+ EXPECT_EQ(getHostIfParamTypeFunc()(WDMP_BASE64), hostIf_StringType);
+}
+
+TEST(httpserverTest, validateParamValue) {
+ const string sparamValue = "testimage";
+ HostIf_ParamType_t dataType = hostIf_StringType;
+ EXPECT_EQ(validateParamValueFunc()(sparamValue, dataType), true);
+
+ const string bparamValue = "0";
+ dataType = hostIf_BooleanType;
+ EXPECT_EQ(validateParamValueFunc()(bparamValue, dataType), true);
+
+ const string iparamValue = "12800";
+ dataType = hostIf_IntegerType;
+ EXPECT_EQ(validateParamValueFunc()(iparamValue, dataType), true);
+
+ const string uiparamValue = "12";
+ dataType = hostIf_UnsignedIntType;
+ EXPECT_EQ(validateParamValueFunc()(uiparamValue, dataType), true);
+
+ const string paramValue = "flase";
+ dataType = hostIf_BooleanType;
+ EXPECT_EQ(validateParamValueFunc()(paramValue, dataType), false);
+
+ const string invalidIntValue = "123abc";
+ dataType = hostIf_IntegerType;
+ EXPECT_EQ(validateParamValueFunc()(invalidIntValue, dataType), false);
+
+ const string invalidLongValue = "123dab";
+ dataType = hostIf_UnsignedLongType;
+ EXPECT_EQ(validateParamValueFunc()(invalidLongValue, dataType), false);
+}
+
+TEST(httpserverTest, handleRFCRequest_GET) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType");
+
+ REQ_TYPE reqType = GET;
+ WDMP_STATUS status = handleRFCRequestFunc()(reqType, ¶m);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+
+ EXPECT_STREQ(param.value, "testtype");
+ free(param.name);
+}
+
+TEST(httpserverTest, handleRFCRequest_SET) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup(XRFC_VAR_STORE_RELOADCACHE);
+ param.value = strdup("true");
+
+ REQ_TYPE reqType = SET;
+ WDMP_STATUS status = handleRFCRequestFunc()(reqType, ¶m);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+ free(param.name);
+ free(param.value);
+}
+
+TEST(httpserverTest, InvalidReqtype) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup(XRFC_VAR_STORE_RELOADCACHE);
+ param.value = strdup("true");
+
+ REQ_TYPE reqType = DELETE_ROW;
+ WDMP_STATUS status = handleRFCRequestFunc()(reqType, ¶m);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+ free(param.name);
+ free(param.value);
+}
+
+TEST(httpserverTest, handleRFCInvalidRequest) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.Control.ClearDB");
+ param.value = strdup("true");
+
+ REQ_TYPE reqType = SET;
+ WDMP_STATUS status = handleRFCRequestFunc()(reqType, ¶m);
+ EXPECT_EQ(status, WDMP_ERR_METHOD_NOT_SUPPORTED);
+ free(param.name);
+ free(param.value);
+}
+
+TEST(httpserverTest, invokeHostIfAPI_SET_FAILURE) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable");
+ param.value = strdup("true");
+
+ const char *pcCallerID = "rfc";
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ REQ_TYPE reqType = SET;
+ WDMP_STATUS status = invokeHostIfAPIFunc()(reqType, ¶m, msgData.bsUpdate, pcCallerID);
+ EXPECT_EQ(status, 37);
+}
+
+
+TEST(httpserverTest, invokeHostIfAPI) {
+ strcpy(argList.confFile, "/etc/mgrlist.conf");
+ bool ret = hostIf_initalize_ConfigManger();
+
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable");
+ writeToTr181storeFile("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable", "true", "/opt/secure/RFC/tr181store.ini", Plain);
+ const char *pcCallerID = "rfc";
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ REQ_TYPE reqType = GET;
+ WDMP_STATUS status = invokeHostIfAPIFunc()(reqType, ¶m, msgData.bsUpdate, pcCallerID);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+
+}
+
+TEST(httpserverTest, invokeHostIfAPI_SET) {
+ strcpy(argList.confFile, "/etc/mgrlist.conf");
+ bool ret = hostIf_initalize_ConfigManger();
+
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.SsrUrl");
+ param.value = strdup("https://ssr.ccp.xcal.tv");
+
+ const char *pcCallerID = "rfc";
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ REQ_TYPE reqType = SET;
+ WDMP_STATUS status = invokeHostIfAPIFunc()(reqType, ¶m, msgData.bsUpdate, pcCallerID);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+}
+
+TEST(httpserverTest, invokeHostIfAPI_InvalidReq) {
+ param_t param;
+ memset(¶m,0,sizeof(param_t));
+ param.name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.XconfUrl");
+ const char *pcCallerID = "webpa";
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ strncpy(msgData.paramValue, "https://ssr.ccp.xcal.tv", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ msgData.paramtype = hostIf_StringType;
+ msgData.paramLen = strlen(msgData.paramValue);
+
+ REQ_TYPE reqType = REPLACE_ROWS;
+ WDMP_STATUS status = invokeHostIfAPIFunc()(reqType, ¶m, msgData.bsUpdate, pcCallerID);
+ EXPECT_EQ(status, WDMP_ERR_INTERNAL_ERROR);
+}
+
+TEST(httpserverTest, validateAgainstDataModel_GET) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ char paramName [] = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.Enable";
+ const char* paramValue = NULL;
+ DATA_TYPE dataType = WDMP_BOOLEAN;
+
+ REQ_TYPE reqType = GET;
+ char defaultValue[66];
+ char* defaultValuePtr = defaultValue;
+ WDMP_STATUS status = validateAgainstDataModelFunc()(reqType, paramName, paramValue, &dataType, &defaultValuePtr, &msgData.bsUpdate);
+ EXPECT_EQ(status, WDMP_SUCCESS);
+ EXPECT_STREQ(defaultValuePtr, "false");
+
+}
+
+TEST(httpserverTest, validateAgainstDataModel_SET_NullParam) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ char paramName [] = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.PartnerName";
+ const char* paramValue = NULL;
+ DATA_TYPE dataType = WDMP_BOOLEAN;
+
+ REQ_TYPE reqType = SET;
+ char defaultValue[66];
+ char* defaultValuePtr = defaultValue;
+ WDMP_STATUS status = validateAgainstDataModelFunc()(SET, paramName, paramValue, &dataType, &defaultValuePtr, &msgData.bsUpdate);
+ EXPECT_EQ(status, WDMP_ERR_VALUE_IS_NULL);
+}
+
+TEST(httpserverTest, validateAgainstDataModel_SET_ReadOnly) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ char paramName [] = "Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.ReverseSSH.xOpsReverseSshStatus";
+ const char* paramValue = "reverseSsh";
+ DATA_TYPE dataType = WDMP_BOOLEAN;
+
+ REQ_TYPE reqType = SET;
+ char defaultValue[66];
+ char* defaultValuePtr = defaultValue;
+ WDMP_STATUS status = validateAgainstDataModelFunc()(SET, paramName, paramValue, &dataType, &defaultValuePtr, &msgData.bsUpdate);
+ EXPECT_EQ(status, WDMP_ERR_NOT_WRITABLE);
+}
+
+TEST(httpserverTest, validateAgainstDataModel_INVALID_PARAMETER_NAME) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ HOSTIF_MsgData_t msgData = { 0 };
+ memset(&msgData,0,sizeof(HOSTIF_MsgData_t));
+ msgData.bsUpdate = HOSTIF_NONE;
+
+ char paramName [] = "Device.DeviceInfoTest.FriendlyName";
+ const char* paramValue = "reverseSsh";
+ DATA_TYPE dataType = WDMP_BOOLEAN;
+
+ REQ_TYPE reqType = SET;
+ char defaultValue[66];
+ char* defaultValuePtr = defaultValue;
+ WDMP_STATUS status = validateAgainstDataModelFunc()(SET, paramName, paramValue, &dataType, &defaultValuePtr, &msgData.bsUpdate);
+ EXPECT_EQ(status, WDMP_ERR_INVALID_PARAMETER_NAME);
+}
+
+TEST(httpserverTest, handleRequest_GET) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 1;
+ getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable");
+ //getReq->paramNames[1] = strdup("Device.DeviceInfo.");
+ req_struct reqSt;
+ reqSt.reqType = GET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], WDMP_ERR_DEFAULT_VALUE);
+}
+
+TEST(httpserverTest, handlewildRequest_GET) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 1;
+ getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Canary.");
+ //getReq->paramNames[1] = strdup("Device.DeviceInfo.");
+ req_struct reqSt;
+ reqSt.reqType = GET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ //EXPECT_EQ(respSt->retStatus[0], WDMP_ERR_DEFAULT_VALUE);
+ EXPECT_EQ(respSt->retStatus[0], 0);
+
+}
+
+TEST(httpserverTest, handlewildRequestINVALIDPARAM_GET) {
+
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 1;
+ getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.SystemServices.FriendlyName");
+ req_struct reqSt;
+ reqSt.reqType = GET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], 22);
+}
+
+/* TEST(httpserverTest, paramCount_GET) {
+
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 0;
+ // getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.SystemServices.FriendlyName");
+ req_struct reqSt;
+ reqSt.reqType = GET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], NULL);
+}
+
+
+TEST(httpserverTest, paramCount_SET) {
+
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 0;
+ // getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.SystemServices.FriendlyName");
+ req_struct reqSt;
+ reqSt.reqType = SET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], NULL);
+}
+*/
+
+/* TEST(httpserverTest, paramCount_InvalidParamName) {
+
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+ get_req_t *getReq = (get_req_t *)malloc(sizeof(get_req_t));
+ getReq->paramCnt = 1;
+ getReq->paramNames[0] = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable.Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable.Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable.Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable.Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.Airplay.Enable");
+ req_struct reqSt;
+ reqSt.reqType = SET; // Replace with actual enum value if it's defined
+ reqSt.u.getReq = getReq;
+
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], WDMP_ERR_INVALID_PARAMETER_NAME);
+} */
+
+TEST(httpserverTest, handleRequest_SET) {
+ /* Load the data model xml file*/
+ DB_STATUS dbStatus = loadDataModel();
+ if(dbStatus != DB_SUCCESS)
+ {
+ std::cout << "Error in Data Model Initialization" << std::endl;
+ }
+ else
+ {
+ std::cout << "Successfully initialize Data Model." << std::endl;
+ }
+ EXPECT_EQ(dbStatus, DB_SUCCESS);
+
+ const char* pcCallerID = "rfc";
+
+ param_t *params = (param_t *) malloc(sizeof(param_t) * 3);
+ params[0].name = strdup("Device.X_CISCO_COM_DeviceControl.RebootDevice");
+ params[0].value = strdup("true");
+ params[0].type = WDMP_BOOLEAN;
+
+ params[1].name = strdup("Device.DeviceInfo.");
+ params[1].value = strdup("true");
+ params[1].type = WDMP_BOOLEAN;
+
+ params[2].name = strdup("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable");
+ params[2].value = NULL;
+ params[2].type = WDMP_BOOLEAN;
+
+ set_req_t *setReq = (set_req_t *)malloc(sizeof(set_req_t));
+ setReq->param = params;
+ setReq->paramCnt = 3;
+
+ req_struct reqSt;
+ reqSt.reqType = SET; // Replace with actual enum value
+ reqSt.u.setReq = setReq;
+
+ res_struct* respSt = handleRequest(pcCallerID, &reqSt);
+ EXPECT_EQ(respSt->retStatus[0], WDMP_FAILURE);
+ EXPECT_EQ(respSt->retStatus[1], WDMP_ERR_WILDCARD_NOT_SUPPORTED);
+ EXPECT_EQ(respSt->retStatus[2], WDMP_ERR_VALUE_IS_NULL);
+}
+
+
+TEST(httpserverTest, convertAndAssignParamValue_BooleanType) {
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.MOCASSH.Enable", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ param.paramtype = hostIf_BooleanType;
+ param.paramLen = sizeof(hostIf_BooleanType);
+
+ convertAndAssignParamValueFunc()(¶m, "true");
+ EXPECT_EQ(0, 0);
+}
+
+TEST(httpserverTest, convertAndAssignParamValue_StringType) {
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.RDKRemoteDebugger.IssueType", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ param.paramtype = hostIf_StringType;
+ param.paramLen = strlen(param.paramValue);
+
+ convertAndAssignParamValueFunc()(¶m, "Testtype");
+ EXPECT_EQ(0, 0);
+}
+
+TEST(httpserverTest, convertAndAssignParamValue_IntegerType) {
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.SWDLSpLimit.TopSpeed", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ param.paramtype = hostIf_IntegerType;
+ param.paramLen = sizeof(hostIf_IntegerType);
+
+ convertAndAssignParamValueFunc()(¶m, "1180000");
+ EXPECT_EQ(0, 0);
+}
+
+TEST(httpserverTest, convertAndAssignParamValue_UnsignedLongType) {
+ HOSTIF_MsgData_t param = { 0 };
+ memset(¶m,0,sizeof(HOSTIF_MsgData_t));
+ param.reqType = HOSTIF_SET;
+ strncpy (param.paramName, "Device.Ethernet.Interface.1.Stats.BytesReceived", TR69HOSTIFMGR_MAX_PARAM_LEN - 1);
+ param.bsUpdate = HOSTIF_NONE;
+ param.requestor = HOSTIF_SRC_WEBPA;
+
+ param.paramtype = hostIf_UnsignedLongType;
+ param.paramLen = sizeof(hostIf_UnsignedLongType);
+
+ convertAndAssignParamValueFunc()(¶m, "123456789");
+ EXPECT_EQ(0, 0);
+}
+
+TEST(httpserverTest, getStringValue) {
+ EXPECT_STREQ(getStringValueFunc()(hostIf_StringType, "global"), "global");
+ EXPECT_STREQ(getStringValueFunc()(hostIf_IntegerType, "100"), "3158065");
+ EXPECT_STREQ(getStringValueFunc()(hostIf_BooleanType, "true"), "false");
+ EXPECT_STREQ(getStringValueFunc()(hostIf_BooleanType, "false"), "false");
+ EXPECT_STREQ(getStringValueFunc()(hostIf_UnsignedLongType, "123456789"), "4050765991979987505");
+}
+
+TEST(httpserverTest, Invalid_RFC_filename) {
+ m_varStore = XRFCVarStore::getInstance();
+ m_varStore->m_filename = "/opt/secure/RFC1/rfctest_Variable.ini";
+ std::ofstream file("/opt/secure/RFC1/rfctest_Variable.ini");
+ file.close();
+ if(m_varStore)
+ {
+ bool ret = m_varStore->loadRFCVarIntoCache();
+ EXPECT_EQ(ret, false);
+ }
+}
+
+TEST(httpserverTest, HTTPRequestHandler_GET) {
+
+ // Create a SoupMessage for POST
+ SoupServer *server = soup_server_new(nullptr, nullptr);
+ SoupMessage *msg = soup_message_new("POST", "http://localhost/api/status");
+ const char *json_body = "{\"action\":\"ping\"}";
+ GBytes *body_bytes = g_bytes_new_static(json_body, strlen(json_body));
+ soup_message_set_request_body_from_bytes(msg, "application/json", body_bytes);
+ SoupMessageHeaders *headers = soup_message_get_request_headers(msg);
+ soup_message_headers_append(headers, "CallerID", "unittest");
+
+ HTTPRequestHandlerFunc()(server, reinterpret_cast(msg), "/api/status", nullptr, nullptr);
+ EXPECT_EQ(0, 0);
+}
+
+
+GTEST_API_ int main(int argc, char *argv[]){
+ char testresults_fullfilepath[GTEST_REPORT_FILEPATH_SIZE];
+ char buffer[GTEST_REPORT_FILEPATH_SIZE];
+
+ memset( testresults_fullfilepath, 0, GTEST_REPORT_FILEPATH_SIZE );
+ memset( buffer, 0, GTEST_REPORT_FILEPATH_SIZE );
+ snprintf( testresults_fullfilepath, GTEST_REPORT_FILEPATH_SIZE, "json:%s%s" , GTEST_DEFAULT_RESULT_FILEPATH , GTEST_DEFAULT_RESULT_FILENAME);
+
+ ::testing::GTEST_FLAG(output) = testresults_fullfilepath;
+ ::testing::InitGoogleMock(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/src/hostif/httpserver/src/http_server.cpp b/src/hostif/httpserver/src/http_server.cpp
index 47479fbb5..d7ae0c1e1 100644
--- a/src/hostif/httpserver/src/http_server.cpp
+++ b/src/hostif/httpserver/src/http_server.cpp
@@ -48,7 +48,7 @@ extern bool httpServerThreadDone;
extern T_ARGLIST argList;
static SoupServer *http_server = NULL;
-#ifdef LIBSOUP3_ENABLE
+
static void HTTPRequestHandler(
SoupServer *server,
SoupServerMessage *msg,
@@ -220,177 +220,7 @@ static void HTTPRequestHandler(
RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
return;
}
-#else
-static void HTTPRequestHandler(
- SoupServer *server,
- SoupMessage *msg,
- const char *path,
- GHashTable *query,
- SoupClientContext *client,
- void *user_data)
-{
- cJSON *jsonRequest = NULL;
- cJSON *jsonResponse = NULL;
- req_struct *reqSt = NULL;
- res_struct *respSt = NULL;
-
- struct timespec start,end,*startPtr,*endPtr;
- startPtr = &start;
- endPtr = &end;
-
- RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
- getCurrentTime(startPtr);
- if (!msg->request_body ||
- !msg->request_body->data ||
- !msg->request_body->length)
- {
- soup_message_set_status_full (msg, SOUP_STATUS_BAD_REQUEST, "No request data.");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Failed due to no message data.\n", __FUNCTION__, __FILE__);
- return;
- }
-
- const char *pcCallerID = (char *)soup_message_headers_get_one(msg->request_headers, "CallerID");
-
- jsonRequest = cJSON_Parse((const char *) msg->request_body->data);
-
- if(jsonRequest)
- {
- reqSt = (req_struct *)malloc(sizeof(req_struct));
- if(reqSt == NULL)
- {
- soup_message_set_status_full (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR, "Cannot create return object");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Failed to create req_struct\n", __FUNCTION__, __FILE__);
- return;
- }
- memset(reqSt, 0, sizeof(req_struct));
-
- if(!strcmp(msg->method, "GET"))
- {
- if(!pcCallerID || !strlen(pcCallerID))
- {
- pcCallerID = "Unknown";
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF, "[%s:%s] Unknown Caller ID, GET is allowed by default\n", __FUNCTION__, __FILE__);
- }
- else
- RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,"[%s:%s] GET with CallerID : %s..\n", __FUNCTION__, __FILE__, pcCallerID);
- parse_get_request(jsonRequest, &reqSt, WDMP_TR181);
- respSt = handleRequest(pcCallerID, reqSt);
- if(respSt)
- {
- jsonResponse = cJSON_CreateObject();
- wdmp_form_get_response(respSt, jsonResponse);
-
- // WDMP Code sets a generic statusCode, the following lines replace it with an actual error code.
- int new_st_code = 0;
-
- for(size_t paramIndex = 0; paramIndex < respSt->paramCnt; paramIndex++)
- {
- if(respSt->retStatus[paramIndex] != 0 || paramIndex == respSt->paramCnt-1)
- {
- new_st_code = respSt->retStatus[paramIndex];
- break;
- }
- }
- cJSON * stcode = cJSON_GetObjectItem(jsonResponse, "statusCode");
- if( NULL != stcode)
- {
- cJSON_SetIntValue(stcode, new_st_code);
- }
- }
- else
- {
- soup_message_set_status_full (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR, "Invalid request format");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Request couldn't be processed\n", __FUNCTION__, __FILE__);
- return;
- }
- }
- else if(!strcmp(msg->method, "POST"))
- {
- if(!pcCallerID || !strlen(pcCallerID))
- {
- soup_message_set_status_full (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR, "POST Not Allowed without CallerID");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. POST operation not allowed with unknown CallerID\n", __FUNCTION__, __FILE__);
- wdmp_free_req_struct(reqSt);
- reqSt = NULL;
- return;
- }
- else
- RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,"[%s:%s] POST with CallerID : %s..\n", __FUNCTION__, __FILE__, pcCallerID);
- parse_set_request(jsonRequest, &reqSt, WDMP_TR181);
- RDK_LOG(RDK_LOG_DEBUG, LOG_TR69HOSTIF,"Calling handleRequest...\n");
- respSt = handleRequest(pcCallerID, reqSt);
- if(respSt)
- {
- jsonResponse = cJSON_CreateObject();
- wdmp_form_set_response(respSt, jsonResponse);
- // WDMP Code sets a generic statusCode, the following lines replace it with an actual error code.
- int new_st_code = 0;
-
- for(size_t paramIndex = 0; paramIndex < respSt->paramCnt; paramIndex++)
- {
- if(respSt->retStatus[paramIndex] != 0 || paramIndex == respSt->paramCnt-1)
- {
- new_st_code = respSt->retStatus[paramIndex];
- break;
- }
- }
- cJSON * stcode = cJSON_GetObjectItem(jsonResponse, "statusCode");
- if( NULL != stcode)
- {
- cJSON_SetIntValue(stcode, new_st_code);
- }
- }
- else
- {
- soup_message_set_status_full (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR, "Invalid request format");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Request couldn't be processed\n", __FUNCTION__, __FILE__);
- wdmp_free_req_struct(reqSt);
- reqSt = NULL;
- return;
- }
- }
- else
- {
- soup_message_set_status_full (msg, SOUP_STATUS_NOT_IMPLEMENTED, "Method not implemented");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Unsupported operation \n", __FUNCTION__, __FILE__);
- wdmp_free_req_struct(reqSt);
- reqSt = NULL;
- return;
- }
-
- char *buf = cJSON_Print(jsonResponse);
-
- if(buf) {
- soup_message_set_response(msg, (const char *) "application/json", SOUP_MEMORY_COPY, buf, strlen(buf));
- soup_message_set_status (msg, SOUP_STATUS_OK);
- }
-
- wdmp_free_req_struct(reqSt);
- reqSt = NULL;
- cJSON_Delete(jsonRequest);
- cJSON_Delete(jsonResponse);
- wdmp_free_res_struct(respSt);
- respSt = NULL;
-
- if(buf != NULL) {
- free(buf);
- buf = NULL;
- }
- }
- else
- {
- soup_message_set_status_full (msg, SOUP_STATUS_BAD_REQUEST, "Bad Request");
- RDK_LOG(RDK_LOG_ERROR, LOG_TR69HOSTIF,"[%s:%s] Exiting.. Failed to parse JSON Message \n", __FUNCTION__, __FILE__);
- return;
- }
-
- getCurrentTime(endPtr);
- RDK_LOG(RDK_LOG_DEBUG,LOG_TR69HOSTIF,"Curl Request Processing Time : %lu ms\n", timeValDiff(startPtr, endPtr));
- RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);
- return;
-}
-#endif
void *HTTPServerStartThread(void *msg)
{
@@ -413,11 +243,7 @@ void *HTTPServerStartThread(void *msg)
}
if(http_server == NULL)
-#ifdef LIBSOUP3_ENABLE
http_server = soup_server_new("server-header", "HTTPServer", NULL);
-#else
- http_server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "HTTPServer", NULL);
-#endif
if (!http_server)
{
@@ -463,3 +289,15 @@ void HttpServerStop()
RDK_LOG(RDK_LOG_TRACE1, LOG_TR69HOSTIF,"SERVER: Stopped server successfully.\n");
}
}
+
+#ifdef GTEST_ENABLE
+void (*HTTPRequestHandlerFunc()) (
+ SoupServer *server,
+ SoupServerMessage *msg,
+ const char *path,
+ GHashTable *query,
+ void *user_data)
+{
+ return &HTTPRequestHandler;
+}
+#endif
diff --git a/src/hostif/httpserver/src/request_handler.cpp b/src/hostif/httpserver/src/request_handler.cpp
index 20cf518f8..a324f5f23 100644
--- a/src/hostif/httpserver/src/request_handler.cpp
+++ b/src/hostif/httpserver/src/request_handler.cpp
@@ -738,3 +738,46 @@ res_struct* handleRequest(const char* pcCallerID, req_struct *reqSt)
RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"Leaving... %s\n", __FUNCTION__);
return respSt;
}
+
+#ifdef GTEST_ENABLE
+DATA_TYPE (*getWdmpDataTypeFunc())(char * )
+{
+ return &getWdmpDataType;
+}
+
+HostIf_ParamType_t (*getHostIfParamTypeFunc())(DATA_TYPE wdmpDataType)
+{
+ return &getHostIfParamType;
+}
+
+bool (*validateParamValueFunc())(const string ¶mValue, HostIf_ParamType_t dataType)
+{
+ return &validateParamValue;
+}
+
+WDMP_STATUS (*handleRFCRequestFunc())(REQ_TYPE reqType, param_t *param)
+{
+ return &handleRFCRequest;
+}
+
+WDMP_STATUS (*invokeHostIfAPIFunc())(REQ_TYPE reqType, param_t *param, HostIf_Source_Type_t bsUpdate, const char *pcCallerID)
+{
+ return &invokeHostIfAPI;
+}
+
+WDMP_STATUS (*validateAgainstDataModelFunc())(REQ_TYPE reqType, char* paramName, const char* paramValue, DATA_TYPE *dataType, char **
+defaultValue, HostIf_Source_Type_t *bsUpdate)
+{
+ return &validateAgainstDataModel;
+}
+
+void (*convertAndAssignParamValueFunc()) (HOSTIF_MsgData_t *param, char *value)
+{
+ return &convertAndAssignParamValue;
+}
+
+char* (*getStringValueFunc()) (HostIf_ParamType_t paramType, char *value)
+{
+ return &getStringValue;
+}
+#endif
diff --git a/src/hostif/include/IniFile.h b/src/hostif/include/IniFile.h
index 013a7cecc..1bff86c3c 100644
--- a/src/hostif/include/IniFile.h
+++ b/src/hostif/include/IniFile.h
@@ -23,6 +23,10 @@
#include
#include