diff --git a/.devcontainer/raspi/Dockerfile b/.devcontainer/raspi/Dockerfile index e462e3f5..dca356ad 100644 --- a/.devcontainer/raspi/Dockerfile +++ b/.devcontainer/raspi/Dockerfile @@ -58,7 +58,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get clean -y\ && update-alternatives --install /usr/bin/python python /usr/bin/python3 50 -RUN echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \ +RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \ curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \ apt-get update && apt-get install -y --no-install-recommends \ clang-format-${LLVM_VERSION} \ diff --git a/.devcontainer/ubuntu/Dockerfile b/.devcontainer/ubuntu/Dockerfile index 6eef9917..bb6bfb31 100644 --- a/.devcontainer/ubuntu/Dockerfile +++ b/.devcontainer/ubuntu/Dockerfile @@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Remove this once stdeb is fully released for ubuntu:24.04 (python3.12) RUN pip3 install git+https://github.com/astraw/stdeb.git --break-system-packages -RUN echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \ +RUN echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \ curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \ apt-get update && apt-get install -y --no-install-recommends \ clang-format-${LLVM_VERSION} \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..28e275ac --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,189 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +on: + workflow_call: + inputs: + builder-tag: + description: The builder tag to be used + default: latest + required: false + type: string + package-namespace: + description: The package namespace for docker images + default: ${{ github.repository }} + required: false + type: string + ref: + type: string + required: true + +jobs: + build-agent: + name: Agent (${{ matrix.name }}, ${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + container: + image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }} + credentials: + username: ${{ github.actor }} + password: ${{ github.token }} + options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }} + timeout-minutes: 8 # the worst case is 3 minutes + strategy: + fail-fast: false + matrix: + include: + - name: raspios-bookworm + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }} + platform: amd64 + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Build + run: bear -- make -j$((`nproc` * 2)) CFLAGS="-g -Werror" + + - name: Generate SBOM + run: | + ./scripts/sources bin/evp_agent > sources.lst + ./scripts/mk-sbom -d -c `dpkg -l libc6 | awk '/libc6/ {print $3}'` sources.lst + + - name: Agent Debian Package + run: make dist + + - name: Upload agent debian package + uses: actions/upload-artifact@v4 + with: + name: agent-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: evp-agent*.deb + + - name: Upload sdk debian package + uses: actions/upload-artifact@v4 + with: + name: libevp-app-sdk-dev-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: libevp-app-sdk-dev*.deb + + - name: Upload SBOM + uses: actions/upload-artifact@v4 + with: + name: sbom-agent-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: | + compile_commands.json + sources.lst + sbom.tsv + sbom-files.txt + sbom-tmp.txt + + build-sdk: + name: SDK (${{ matrix.name }}, ${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + container: + image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }} + credentials: + username: ${{ github.actor }} + password: ${{ github.token }} + options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }} + timeout-minutes: 8 # the worst case is 3 minutes + strategy: + fail-fast: false + matrix: + include: + - name: raspios-bookworm + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }} + platform: amd64 + + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Build SDK + run: make -j$((`nproc` * 2)) sdk \ + CFLAGS="-O2 -Werror" \ + KBUILD_DEFCONFIG=configs/linux-docker.config + + - name: Install python test dependencies + working-directory: src/python-evp-app-sdk + run: | + python3 -m venv .venv + . .venv/bin/activate + pip install \ + -e . \ + -r requirements.test.txt + + - name: Run python SDK tests + working-directory: src/python-evp-app-sdk + run: | + . .venv/bin/activate + python -m pytest \ + --cov=evp.app \ + --cov-report="xml:pysdk-cov.xml" \ + --junit-xml="pysdk-test-res.xml" \ + -v + + - name: Publish pytest coverage + id: pysdk-cov + uses: MishaKav/pytest-coverage-comment@main + if: always() + with: + title: EVP Python Application SDK coverage report + badge-title: Python Application SDK + coverage-path-prefix: src/python-evp-app-sdk/evp/app/ + pytest-xml-coverage-path: src/python-evp-app-sdk/pysdk-cov.xml + junitxml-path: src/python-evp-app-sdk/pysdk-test-res.xml + junitxml-title: Python Application SDK test report + + - name: Publish pytest results to summary + if: steps.pysdk-cov.outputs.summaryReport + run: echo ${{ steps.pysdk-cov.outputs.summaryReport }} >> $GITHUB_STEP_SUMMARY + + - name: Build Python package + working-directory: src/python-evp-app-sdk + run: python3 -m build + + - name: SDK Debian package + working-directory: src/python-evp-app-sdk + run: python setup.py --command-packages=stdeb.command bdist_deb + + - uses: actions/upload-artifact@v4 + with: + name: python-sdk-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: src/python-evp-app-sdk/dist/* + + - uses: actions/upload-artifact@v4 + with: + name: python-sdk-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: src/python-evp-app-sdk/deb_dist/*.deb + + run-static-analysis: + name: Static Code Analysis + runs-on: ubuntu-24.04 + container: + image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag }} + options: --user 1001:127 + timeout-minutes: 8 # the worst case is 3 minutes + + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Run cppcheck analysis + run: make -j$((`nproc` * 2)) CFLAGS="-Werror" TOOL=cppcheck analysis diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml new file mode 100644 index 00000000..e8fbea3b --- /dev/null +++ b/.github/workflows/builder.yml @@ -0,0 +1,163 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +name: Build and push builders (if necessary) + +on: + workflow_dispatch: + inputs: + ref: + description: The ref sha to checkout evp-agent + type: string + required: false + default: main + package-namespace: + description: The package namespace for docker images + required: true + type: string + workflow_call: + inputs: + ref: + type: string + required: false + package-namespace: + description: The package namespace for docker images + default: ${{ github.repository }} + required: false + type: string + outputs: + builder-tag: + description: tag + value: ${{ jobs.builder-necessary.outputs.builder-tag }} + +concurrency: + group: ${{ github.workflow }} @ build-builders-${{ github.ref }} + cancel-in-progress: true + +jobs: + builder-necessary: + name: Is builder necessary? + runs-on: ubuntu-24.04 + outputs: + build: ${{ steps.changed-files.outputs.all_changed_and_modified_files != '' }} + builder-tag: ${{ steps.builder-tag.outputs.tag }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ inputs.ref }} + + - uses: tj-actions/changed-files@v41 + id: changed-files + with: + files: | + .devcontainer/ubuntu/Dockerfile + .devcontainer/raspi/Dockerfile + .github/workflows/builder.yml + + - name: Set builder tag + id: builder-tag + run: | + echo "Modified: ${{ steps.changed-files.outputs.all_changed_and_modified_files != '' }}" + tag=${{ steps.changed-files.outputs.all_changed_and_modified_files != '' && github.ref != 'refs/heads/main' && github.sha || 'latest' }} + echo "github.ref is: ${{ github.ref }}" + echo "Is not main branch? ${{ github.ref != 'refs/heads/main' }}" + echo "github.sha is: ${{ github.sha }}" + echo "Tag: $tag" + echo "tag=$tag" >> $GITHUB_OUTPUT + echo Modified file list: + for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do + echo "$file" + done + + build-push-raspi: + name: Build and push raspios bookworm builder + if: ${{ needs.builder-necessary.outputs.build == 'true' }} + needs: + - builder-necessary + runs-on: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Github Registry + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ github.token }} + registry: ghcr.io + + - name: Build and push raspios bookworm builder + uses: docker/build-push-action@v5 + with: + context: .devcontainer/raspi + file: .devcontainer/raspi/Dockerfile + push: true + tags: ghcr.io/${{ inputs.package-namespace }}/builder-raspios-bookworm:${{ needs.builder-necessary.outputs.builder-tag }} + + build-push-ubuntu: + name: Build and push ubuntu noble (${{ matrix.platform }}) + if: ${{ needs.builder-necessary.outputs.build == 'true' }} + needs: + - builder-necessary + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + include: + - platform: amd64 + runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-24.04' }} + - platform: arm64 + runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Github Registry + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ github.token }} + registry: ghcr.io + + - name: Build and push ubuntu builder + uses: docker/build-push-action@v5 + with: + context: .devcontainer/ubuntu + file: .devcontainer/ubuntu/Dockerfile + push: true + provenance: false + tags: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-${{ matrix.platform }} + + manifest-ubuntu: + if: ${{ needs.builder-necessary.outputs.build == 'true' }} + needs: + - builder-necessary + - build-push-ubuntu + name: Docker manifest + runs-on: ubuntu-24.04 + + steps: + - name: Login to Github Registry + uses: docker/login-action@v3 + with: + username: ${{ github.actor }} + password: ${{ github.token }} + registry: ghcr.io + + - name: Create and push multiarch manifests + run: | + docker manifest create \ + ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }} \ + ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-amd64 \ + ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-arm64 + docker manifest push ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..4b58923b --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +on: + workflow_call: + inputs: + builder-tag: + description: The builder tag to be used + default: latest + required: false + type: string + ref: + type: string + required: true + package-namespace: + description: The package namespace for docker images + default: ${{ github.repository }} + required: false + type: string + +jobs: + check: + name: Formatting + runs-on: ubuntu-24.04 + container: + image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag}} + options: --user 1001:127 + timeout-minutes: 3 # the worst case is < 1 minute + steps: + - name: Checkout source + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Prepare venv + run: | + python3 -m venv .venv + . .venv/bin/activate && \ + pip install -r docs/requirements.txt + + - name: Check formatting + run: | + . .venv/bin/activate && \ + make -f check.mk check check-docs -j diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..1654e9d3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,104 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +name: Main + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + push: + branches: + - main + workflow_dispatch: + inputs: + ref: + description: The ref sha to checkout evp-agent-oss + type: string + required: false + default: main + package-namespace: + description: The package namespace for docker images + required: true + type: string + + schedule: + - cron: 0 0 * * 1-5 + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}@main-${{ github.ref }} + cancel-in-progress: true + +jobs: + infos: + name: Infos + runs-on: ubuntu-24.04 + outputs: + package-namespace: ${{ steps.infos.outputs.namespace }} + steps: + - name: Some infos + id: infos + run: | + echo github.ref is ${{ github.ref }} + echo github.head_ref is ${{ github.head_ref }} + echo github.sha is ${{ github.sha }} + echo github.event_name is ${{ github.event_name }} + echo github.event.pull_request.user.login is ${{ github.event.pull_request.user.login }} + echo github.event.action is ${{ github.event.action }} + echo github.event.repository_owner is ${{ github.repository_owner }} + NAMESPACE=${{ github.repository || github.event.repository }} + NAMESPACE_LC=${NAMESPACE@L} + echo "namespace=${NAMESPACE_LC}" >> $GITHUB_OUTPUT + echo namespace is ${NAMESPACE_LC} + + builder: + name: Builder + needs: + - infos + uses: ./.github/workflows/builder.yml + secrets: inherit + with: + ref: ${{ inputs.ref || github.sha }} + package-namespace: ${{ needs.infos.outputs.package-namespace }} + + checks: + name: Checks + needs: + - builder + - infos + uses: ./.github/workflows/check.yml + secrets: inherit + with: + builder-tag: ${{ needs.builder.outputs.builder-tag }} + ref: ${{ inputs.ref || github.sha }} + package-namespace: ${{ needs.infos.outputs.package-namespace }} + + test-modules: + name: Test-modules + needs: + - checks + - builder + - infos + uses: ./.github/workflows/test-modules.yml + secrets: inherit + with: + builder-tag: ${{ needs.builder.outputs.builder-tag }} + ref: ${{ inputs.ref || github.sha }} + package-namespace: ${{ needs.infos.outputs.package-namespace }} + + build: + name: Build + needs: + - checks + - builder + - infos + uses: ./.github/workflows/build.yml + secrets: inherit + with: + builder-tag: ${{ needs.builder.outputs.builder-tag }} + ref: ${{ inputs.ref || github.sha }} + package-namespace: ${{ needs.infos.outputs.package-namespace }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f169695c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,153 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +name: Release Artifacts + +on: + release: + types: + - published + +jobs: + release-artifacts: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Get last successful run id + id: run-id + env: + GH_TOKEN: ${{ github.token }} + run: | + last_run_id=$(gh run list -w main.yml -c ${{ github.sha }} -b main -s completed --json databaseId -L 1 | jq -r .[].databaseId) + test -z $last_run_id && echo "cannot find last successful run_id" && exit 1 || echo "last_run_id=$last_run_id" && echo "last_run_id=$last_run_id" >> $GITHUB_OUTPUT + + - name: Download Python SDK (RaspiOS bookworm ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-raspios-bookworm-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-raspios-bookworm-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Python SDK deb (RaspiOS bookworm ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-deb-raspios-bookworm-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-raspios-bookworm-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Agent deb (RaspiOS bookworm ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: agent-deb-raspios-bookworm-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-raspios-bookworm-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Python SDK (Ubuntu noble ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-ubuntu-noble-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Python SDK deb (Ubuntu noble ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-deb-ubuntu-noble-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Agent deb (Ubuntu noble ARM64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: agent-deb-ubuntu-noble-arm64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-arm64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Python SDK (Ubuntu noble AMD64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-ubuntu-noble-amd64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-amd64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Python SDK deb (Ubuntu noble AMD64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: python-sdk-deb-ubuntu-noble-amd64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-amd64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Download Agent deb (Ubuntu noble AMD64) + uses: actions/download-artifact@v4 + env: + LAST_RUN_ID: ${{ steps.run-id.outputs.last_run_id }} + with: + name: agent-deb-ubuntu-noble-amd64-${{ env.LAST_RUN_ID }} + run-id: ${{ env.LAST_RUN_ID }} + path: dist-ubuntu-noble-amd64 + github-token: ${{ github.event.repository.private && secrets.MIDOJENKINS_ARTIFACT_READ_EVP_AGENT_OSS || github.token }} + + - name: Rename deb artifacts + run: | + set -x + for deb in dist-ubuntu-noble-*/*.deb; do + mv $deb $(echo $deb | sed -E 's/(.*)_([^_]*).deb/\1-ubuntu-noble_\2.deb/'); + done + + for deb in dist-raspios-bookworm-*/*.deb; do + mv $deb $(echo $deb | sed -E 's/(.*)_([^_]*).deb/\1-raspios-bookworm_\2.deb/'); + done + + - name: Rename whl artifacts + run: | + set -x + for whl in dist-ubuntu-noble-*/*.whl; do + mv $whl $(echo $whl | sed -E 's/(.*)-([^-]*).whl/\1-ubuntu_noble-\2.whl/'); + done + + for whl in dist-raspios-bookworm-*/*.whl; do + mv $whl $(echo $whl | sed -E 's/(.*)-([^-]*).whl/\1-raspios_bookworm-\2.whl/'); + done + + - name: List files in dist-ubuntu-noble-amd64 + run: ls -la dist-ubuntu-noble-amd64 + + - name: List files in dist-ubuntu-noble-arm64 + run: ls -la dist-ubuntu-noble-arm64 + + - name: List files in dist-raspios-bookworm-arm64 + run: ls -la dist-raspios-bookworm-arm64 + + - name: Push artifacts to release + uses: softprops/action-gh-release@v2 + with: + prerelease: false + files: | + dist-*/*.deb + dist-*/*.whl diff --git a/.github/workflows/test-modules.yml b/.github/workflows/test-modules.yml new file mode 100644 index 00000000..93151085 --- /dev/null +++ b/.github/workflows/test-modules.yml @@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +# 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. +# +name: "WASM and native modules" +on: + workflow_call: + inputs: + ref: + type: string + required: true + builder-tag: + description: The builder tag to be used + default: latest + required: false + type: string + package-namespace: + description: The package namespace for docker images + default: ${{ github.repository }} + required: false + type: string + +jobs: + build-modules: + name: Build modules (${{ matrix.name }}, ${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + container: + image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }} + credentials: + username: ${{ github.actor }} + password: ${{ github.token }} + options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }} + strategy: + fail-fast: false + matrix: + include: + - name: raspios-bookworm + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-22.04-arm' }} + platform: arm64 + - name: ubuntu-noble + runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }} + platform: amd64 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref }} + + - name: Build all modules + run: | + make -j$((`nproc` * 2)) \ + KBUILD_DEFCONFIG=configs/unit-test-all-hubs-wasm.config \ + wasm_test_modules + make -j$((`nproc` * 2)) -C test_modules/python + + - uses: actions/upload-artifact@v4 + with: + name: test-modules-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }} + path: | + test_modules/*.elf + test_modules/*.wasm + test_modules/*.wasm.* + test_modules/python/*.zip diff --git a/.gitignore b/.gitignore index ccaf2468..8736aeea 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__ *.a *.so *.d +*.su /*.tar.gz /*.deb *.whl @@ -52,3 +53,6 @@ analysis.txt .venv/ *.core /dist +/src/sdkenc/stamp +/src/sdkenc/*.h +/include/sdkenc/*.h diff --git a/.gitmodules b/.gitmodules index d442db6f..f14d4c33 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,9 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -[submodule "src/nng"] - path = src/nng - url = https://github.com/nanomsg/nng.git [submodule "src/mbedtls"] path = src/mbedtls url = https://github.com/Mbed-TLS/mbedtls.git diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d7803d2b..336f54dd 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,7 +5,7 @@ version: "2" build: - os: "ubuntu-22.04" + os: "ubuntu-24.04" tools: python: "3.10" diff --git a/Makefile b/Makefile index 2685088e..cc8efc2c 100644 --- a/Makefile +++ b/Makefile @@ -70,12 +70,14 @@ deps.mk: .config dist: all $(SCRIPTDIR)/mk-agent-deb.sh -V $(VERSION) -a $(ARCH) + $(SCRIPTDIR)/mk-sdk-deb.sh -V $(SDK_VERSION) -a $(ARCH) clean: cd test && $(MAKE) clean rm -rf bin lib - rm -rf include/nng include/psa + rm -rf include/psa rm -rf include/flatcc include/mbedtls + rm -rf include/sdkenc rm -rf include/lib_export.h include/version.h include/parson.h rm -f include/wasm_c_api.h include/wasm_export.h rm -f libevp-app-sdk-*.tar.gz libevp-app-sdk-*.deb diff --git a/configs/linux-multi-privman-keylog.config b/configs/linux-multi-privman-keylog.config index 51e060fa..01e46d89 100644 --- a/configs/linux-multi-privman-keylog.config +++ b/configs/linux-multi-privman-keylog.config @@ -1,6 +1,5 @@ CONFIG_EVP_AGENT_BOARD_SUPPORT="configs/defaults.mk" CONFIG_EVP_AGENT_EXPERIMENTAL=y -CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS=y CONFIG_EVP_AGENT_MODULE_IMPL_DOCKER_NO_IMAGE_PRUNE=y CONFIG_EVP_AGENT_MODULE_IMPL_DOCKER_RAW_CONTAINER_SPEC=y CONFIG_EVP_AGENT_TLS_KEYLOG=y diff --git a/configs/nuttx.config b/configs/nuttx.config index 38761fc4..d9822616 100644 --- a/configs/nuttx.config +++ b/configs/nuttx.config @@ -313,8 +313,6 @@ CONFIG_INIT_ENTRY=y CONFIG_INIT_ARGS="" CONFIG_INIT_STACKSIZE=8192 CONFIG_INIT_PRIORITY=100 -# TODO when midokura repo is up to date, this line should be removed -CONFIG_USER_ENTRYPOINT="nsh_main" CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INIT_ENTRYNAME="nsh_main" CONFIG_RR_INTERVAL=200 @@ -1398,7 +1396,6 @@ CONFIG_EVP_AGENT_MODULE_LOG_REPORT_LEN=4096 CONFIG_EVP_AGENT_MODULE_LOG_REPORT_PERIOD=1000 CONFIG_EXTERNALS_MBEDTLS=y CONFIG_EVP_AGENT_BOARD_SUPPORT="configs/defaults.mk" -CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS=y CONFIG_EVP_BLOB_GET_UPLOAD_URL=y # @@ -1780,5 +1777,3 @@ CONFIG_READLINE_MAX_EXTCMDS=64 # CONFIG_IEEE802154_I8SAK is not set # CONFIG_IEEE802154_LIBMAC is not set # CONFIG_IEEE802154_LIBUTILS is not set - -CONFIG_NETUTILS_NNG=y diff --git a/configs/sdk-linux.config b/configs/sdk-linux.config index 7e92fb73..96ca4549 100644 --- a/configs/sdk-linux.config +++ b/configs/sdk-linux.config @@ -1,3 +1,2 @@ CONFIG_EVP_AGENT_BOARD_SUPPORT="configs/defaults.mk" -CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS=y CONFIG_EVP_SDK_SOCKET=y diff --git a/configs/unit-test-all-hubs-wasm.config b/configs/unit-test-all-hubs-wasm.config index 92f6c97b..7f68843d 100644 --- a/configs/unit-test-all-hubs-wasm.config +++ b/configs/unit-test-all-hubs-wasm.config @@ -3,7 +3,6 @@ CONFIG_EVP_AGENT_BOARD_SUPPORT="configs/defaults.mk" CONFIG_EVP_AGENT_EXPERIMENTAL=y -CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS=y CONFIG_EVP_AGENT_MAX_LIVE_BLOBS_PER_INSTANCE=3 CONFIG_EVP_AGENT_MODULE_IMPL_DOCKER_RAW_CONTAINER_SPEC=y CONFIG_EVP_BLOB_GET_UPLOAD_URL=y diff --git a/docs/README.md b/docs/README.md index ce4a92fa..29fbd6f4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -13,7 +13,7 @@ Edge Virtualization Platform (EVP) project. ## Building the documentation The latest documentation of EVP -can always be found in [Midokura EVP Agent documentation], +can always be found in [EVP Agent documentation], built automatically through [Read the Docs] for every update of any branch. Additionally, the documentation @@ -121,7 +121,7 @@ under the Apache-2.0 License. See `LICENSE` in repository root for details. [Sphinx]: https://www.sphinx-doc.org/en/master -[Midokura EVP Agent documentation]: https://midokura-edge-virtualization-platform.readthedocs-hosted.com/en/latest/about/agent_features.html +[EVP Agent documentation]: https://evp-agent.docs.midokura.com/en/latest/ [Read the Docs]: https://readthedocs.com [Python Developer’s Guide for documenting]: https://devguide.python.org/documentation/markup/#sections [Semantic Linefeeds]: https://rhodesmill.org/brandon/2012/one-sentence-per-line diff --git a/docs/about/release_process.rst b/docs/about/release_process.rst index 07d13385..1c8501ce 100644 --- a/docs/about/release_process.rst +++ b/docs/about/release_process.rst @@ -22,7 +22,7 @@ In order to create a new release, firstly it is necessary to bump the version of the different relevant artifacts: -- ``scripts/rules.mk`` (agent) +- ``scripts/rules.mk`` (agent and C SDK) - ``version.mk`` (agent deprecated) - ``src/python-evp-app-sdk/setup.py`` (Python App SDK) @@ -31,7 +31,7 @@ targetting the ``main`` branch. The tag ``releases/v`` with the same value from ``scripts/rules.mk`` must be created. The field version is the value defined in ``rules.mk`` -where ``version`` must following `semantic versioning`_. +where ``version`` must follow `semantic versioning`_. The release process is thoroughly documented by `GitHub`_. diff --git a/docs/conf.py b/docs/conf.py index 75b51b52..0dd71bb7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,10 +9,7 @@ import re project = "EVP Agent" -copyright = ( - "2025, Sony Semiconductor Solutions Corporation. " - + "Sony Semiconductor Solutions Confidential" -) +copyright = "2025, Sony Semiconductor Solutions Corporation." author = "Sony Semiconductor Solutions Corporation" version = "unknown-dev" version_re = re.compile(r"^VERSION\s*=\s*(.*)\s*$") @@ -35,6 +32,7 @@ "sphinx.ext.doctest", "sphinx.ext.autodoc", "sphinx.ext.autosummary", + "sphinx_copybutton", "sphinx.ext.intersphinx", ] diff --git a/docs/design/architecture.rst b/docs/design/architecture.rst index 7e2ff581..ea81a372 100644 --- a/docs/design/architecture.rst +++ b/docs/design/architecture.rst @@ -2,6 +2,8 @@ .. .. SPDX-License-Identifier: Apache-2.0 +.. _design/architecture: + Architecture of the agent ######################### @@ -95,7 +97,7 @@ Config The agent supports definining key/value pairs to configure EVP module instances. Module instances can subscribe to configurations -via ``EVP_setConfigurationCallback``. +via :c:func:`EVP_setConfigurationCallback`. Module instance configuration is implemented by ``src/libevp-agent/instance_config.c``, and is processed according to the configured version of the EVP protocol. diff --git a/docs/design/index.rst b/docs/design/index.rst index f28dc832..705fc6e4 100644 --- a/docs/design/index.rst +++ b/docs/design/index.rst @@ -5,6 +5,103 @@ System Design ############# +Introduction +============ + +The Edge Virtualization Platform Agent +is designed as a series of loosely coupled components +that interact with each other to allow the orchestration +and management of workloads in the Edge device. + +Controller interface (HUB) +========================== + +The agent connects to a controller hub, which can send +deployment manifests and other messages to instantiate +and control modules and module instances. + +The module instances' lifecycles +are always managed by the Agent as +behavioral response +to a new deployment manifest from the Hub. +The Hub is the source of truth +about the desired deployment that runs on the device. + +Whenever the Agent receives a new desired deployment from the hub, +It will "reconcile" the current and desired deployments, +and ultimately start/stop the relevant modules, +that were added or removed, +while maintaining the state of the modules and instances +that did not change. + +The hub interface is designed as a common interface, +so that different onwire-schemas and protocols +can be easily added. + +The agent supports +the deprecated EVP1 +and the new EVP2 hub interfaces, +which is the default, +MQTT-based schema +that is used by the hub +to control the Agent. + +More information can be found in :ref:`design/architecture`. + +Applications, module instances types and APIs +============================================= + +There are two implementations to communicate with module instances: +the local implementation (sometimes called Local SDK) and the remote +implementation (sometiems called Remote SDK). +Although, these offer the same interface, +the underlying communication mechanisms are different. + +The local implementation is to be used +with modules and instances +that share the same process as the agent. +These are usually run in a pthread inside the agent task. +This is essentially used for wasm modules, since we include the +WAMR runtime in the Agent, we start WASM modules in a thread, and +they can communicate with the agent by direct function calls and pointers. + +The remote implementation is to be used +with modules and instances +that run in a separate process from the Agent. +This is the case for docker, spawn and python modules. +Since for these modules, the runtime is not embedded in the agent, +a RPC-like flatbuffer interface over a UNIX domain socket is used. + +These full featured interfaces offer +a variety of networking functionalities +to the module instances. +More information can be found in :ref:`application_sdk`. + +System Application Interfaces +============================= + +In some devices, +it is desirable +to have applications that control the system, +to handle workflows like reboot, OTA, configuration management, etc. + +Since these applications lifecycle are not managed by the hub, +these are not Modules or Module instances. +They are not tracked in the deployment manifest or status. + +These applications are started by the agent executable, +especially when a custom main program is linked using :ref:`embedding`. +and usually run in a pthread. + +The SystemApps can use the EVP features +available in :ref:`evp-systemapp_sdk`, +on behalf of the device. + +Also since they do not have module instances IDs, +all the operations are done on behalf of the device. + +More information can be found in :ref:`evp-systemapp_sdk` + .. toctree:: :maxdepth: 1 diff --git a/docs/getting_started/build_sys/rules.mk.rst b/docs/getting_started/build_sys/rules.mk.rst index b9c1950f..a1607cf3 100644 --- a/docs/getting_started/build_sys/rules.mk.rst +++ b/docs/getting_started/build_sys/rules.mk.rst @@ -396,7 +396,6 @@ that enables actions such as: wasm-micro-runtime: wasm-micro-runtime/build/Makefile flatcc: flatcc/build/Makefile mbedtls: mbedtls/build/Makefile - nng: nng/build/Makefile that will generate a chain of dependencies which will compile correctly a `CMake`_ project diff --git a/docs/getting_started/prerequisites.rst b/docs/getting_started/prerequisites.rst index 229b6086..f6dff637 100644 --- a/docs/getting_started/prerequisites.rst +++ b/docs/getting_started/prerequisites.rst @@ -62,7 +62,6 @@ It also requires the following libraries: * `WAMR`_ 2.1.2 * `MbedTLS`_ 3.6.2 - * `Nanomsg-ng`_ 1.7.3 * `Flatcc`_ 0.6.1 All these libraries are shipped as :ref:`git_submodules` within @@ -144,7 +143,6 @@ repository, that can be cloned using: .. _Python3: https://www.python.org .. _WAMR: https://bytecodealliance.github.io/wamr.dev .. _MbedTLS: https://www.trustedfirmware.org/projects/mbed-tls -.. _Nanomsg-ng: https://nng.nanomsg.org .. _Flatcc: https://github.com/dvidelabs/flatcc .. _Github: https://www.github.com .. _WASI-SDK: https://github.com/WebAssembly/wasi-sdk diff --git a/docs/getting_started/source_tree.rst b/docs/getting_started/source_tree.rst index ae78746b..48dfb8c7 100644 --- a/docs/getting_started/source_tree.rst +++ b/docs/getting_started/source_tree.rst @@ -51,7 +51,6 @@ Key directories and files - ``libevp-app-sdk/``: EVP Application SDK for modules. - ``libevp-utils/``: Utility functions for the EVP project. - ``mbedtls/``: Lightweight cryptographic library (git module). - - ``nng/``: Lightweight messaging library (git module). - ``python-evp-app-sdk/``: Python version sources of the EVP Application SDK. - ``wasm-micro-runtime/``: WebAssembly Micro Runtime integration (git module). - ``evp-agent/``: The runtime of the default EVP Agent. diff --git a/docs/interfaces/application_sdk/base.rst b/docs/interfaces/application_sdk/base.rst new file mode 100644 index 00000000..05c6b8b7 --- /dev/null +++ b/docs/interfaces/application_sdk/base.rst @@ -0,0 +1,923 @@ +.. SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +.. +.. SPDX-License-Identifier: Apache-2.0 + +Base +#### + +Types +***** + +.. c:struct:: EVP_client + + An opaque structure + to represent an EVP client. + + This client is used + by EVP module instances + to communicate with + the EVP agent running locally + on the same device. + + An EVP module instance + can obtain the pointer + to the client + by calling :c:func:`EVP_initialize`. + + The majority of SDK API functions + take a pointer to this structure. + + +.. c:type:: EVP_RESULT + + The type to represent either + a success or an error. + Used as the return value of + several of the functions in this SDK. + + :values: + + .. c:enumerator:: EVP_OK + + :value: 0 + + At least one event has been processed. + + .. c:enumerator:: EVP_SHOULDEXIT + + :value: 1 + + The module instance is requested to stop. + It should exit performing cleanup + as soon as possible. + + .. c:enumerator:: EVP_TIMEDOUT + + :value: 2 + + The specified period has elapsed without any events. + + .. c:enumerator:: EVP_ERROR + + :value: 3 + + An error ocurred. + + .. c:enumerator:: EVP_INVAL + + :value: 4 + + Invalid parameter. + + .. c:enumerator:: EVP_NOMEM + + :value: 5 + + Memory allocation failed. + + .. c:enumerator:: EVP_TOOBIG + + :value: 6 + + Too big payload. + + .. c:enumerator:: EVP_AGAIN + + :value: 7 + + Failure because of temporary conditions. + + .. c:enumerator:: EVP_AGENT_PROTOCOL_ERROR + + :value: 8 + + Protocol error when communicating with the agent. + + .. c:enumerator:: EVP_EXIST + + :value: 9 + + The request failed bacause of + conflicting existing entries. + + + .. c:enumerator:: EVP_FAULT + + :value: 10 + + Invalid address was detected. + + .. note:: + + An application should not rely on such a detection. + It's the responsibility of applications to always specify + vaild addresses. + + .. c:enumerator:: EVP_DENIED + + :value: 11 + + A request was denied. + It could mean the agent cannot be + transmitting due to a full queue. + + + .. c:enumerator:: EVP_NOTSUP + + :value: 12 + + The request is still not supported by + the implementation. + +.. c:type:: uint64_t EVP_RPC_ID + + The integer request ID used for RPCs. + +Reasons +======= + +Each callback type have its associated +``EVP_*_CALLBACK_REASON`` enum. + +They share some common definitions: + +.. c:enumerator:: CALLBACK_REASON_SENT + + The request has been received by + the next hop entity. + (Typically the agent within the device. + It will try its best to + deliver the State to + the Cloud reliably.) + + .. note:: + + This doesn't mean the State has reached the Cloud. + +.. c:enumerator:: CALLBACK_REASON_EXIT + + The request has been cancelled because + the module instance is going to exit. + This gives the module instance + a chance to cleanup + the associated resources before exiting. + + Users must not send any more requests + to the agent when this code is received, + and instead must call + :c:func:`EVP_processEvent` until + all events are flushed. + +.. c:enumerator:: CALLBACK_REASON_ERROR + + The request has not been processed + because it is invalid. + +.. c:enumerator:: CALLBACK_REASON_DENIED + + A request was denied for transmission. + This means the agent could not enqueue + the request due to a full queue. + +.. c:type:: EVP_STATE_CALLBACK_REASON + + The type to represent the reason of the callback invocation. + + :values: + + .. c:enumerator:: EVP_STATE_CALLBACK_REASON_SENT + + :value: 0 + + See :c:enumerator:`CALLBACK_REASON_SENT`. + + .. c:enumerator:: EVP_STATE_CALLBACK_REASON_OVERWRITTEN + + :value: 1 + + The State has been overwritten by + another :c:func:`EVP_sendState` call with + the same topic. + + .. note:: + + The SDK only cares about + the latest State for a topic. + + .. c:enumerator:: EVP_STATE_CALLBACK_REASON_EXIT + + :value: 2 + + See :c:enumerator:`CALLBACK_REASON_EXIT`. + + .. c:enumerator:: EVP_STATE_CALLBACK_REASON_DENIED + + :value: 3 + + See :c:enumerator:`CALLBACK_REASON_DENIED`. + +.. c:type:: EVP_MESSAGE_SENT_CALLBACK_REASON + + The type to represent the reason of the callback invocation. + + :values: + + .. c:enumerator:: EVP_MESSAGE_SENT_CALLBACK_REASON_SENT + + :value: 0 + + See :c:enumerator:`CALLBACK_REASON_SENT`. + + .. c:enumerator:: EVP_MESSAGE_SENT_CALLBACK_REASON_ERROR + + :value: 1 + + See :c:enumerator:`CALLBACK_REASON_ERROR`. + + + .. c:enumerator:: EVP_MESSAGE_SENT_CALLBACK_REASON_EXIT + + :value: 2 + + See :c:enumerator:`CALLBACK_REASON_EXIT`. + +.. c:type:: EVP_TELEMETRY_CALLBACK_REASON + + The type to represent the reason of the callback invocation. + + :values: + + .. c:enumerator:: EVP_TELEMETRY_CALLBACK_REASON_SENT + + :value: 0 + + See :c:enumerator:`CALLBACK_REASON_SENT`. + + .. c:enumerator:: EVP_TELEMETRY_CALLBACK_REASON_ERROR + + :value: 1 + + See :c:enumerator:`CALLBACK_REASON_ERROR`. + + .. c:enumerator:: EVP_TELEMETRY_CALLBACK_REASON_EXIT + + :value: 2 + + See :c:enumerator:`CALLBACK_REASON_EXIT`. + + .. c:enumerator:: EVP_TELEMETRY_CALLBACK_REASON_DENIED + + :value: 3 + + See :c:enumerator:`CALLBACK_REASON_DENIED`. + +.. c:type:: EVP_RPC_RESPONSE_CALLBACK_REASON + + The type to represent the reason of the callback invocation. + + :values: + + .. c:enumerator:: EVP_RPC_RESPONSE_CALLBACK_REASON_SENT + + :value: 0 + + See :c:enumerator:`CALLBACK_REASON_SENT`. + + .. c:enumerator:: EVP_RPC_RESPONSE_CALLBACK_REASON_ERROR + + :value: 1 + + See :c:enumerator:`CALLBACK_REASON_ERROR`. + + .. c:enumerator:: EVP_RPC_RESPONSE_CALLBACK_REASON_EXIT + + :value: 2 + + See :c:enumerator:`CALLBACK_REASON_EXIT`. + + .. c:enumerator:: EVP_RPC_RESPONSE_CALLBACK_REASON_DENIED + + :value: 3 + + See :c:enumerator:`CALLBACK_REASON_DENIED`. + + +.. c:type:: EVP_RPC_RESPONSE_STATUS + + The type to specify a status condition for a RPC response to the Hub. + + :values: + + .. c:enumerator:: EVP_RPC_RESPONSE_STATUS_OK + + :value: 0 + + The RPC request executed successfully and the response + contains the results of the execution. + + .. c:enumerator:: EVP_RPC_RESPONSE_STATUS_METHOD_NOT_FOUND + + :value: 1 + + The originating RPC request specified a method that is not + implemented, so it is reported back as not found. + + .. c:enumerator:: EVP_RPC_RESPONSE_STATUS_ERROR + + :value: 2 + + The RPC request executed with error and the response + contains the error message + +.. c:type:: EVP_WORKSPACE_TYPE + + + The type to represent a workspace type. + + :values: + + .. c:enumerator:: EVP_WORKSPACE_TYPE_DEFAULT + + :value: 0 + + Default type of Workspace. + +.. c:type:: int EVP_STREAM + + The type used to represent a stream. + +.. c:type:: unsigned long EVP_STREAM_PEER_ID + + The type used to represent a peer identifier. + +Callbacks +========= + +.. c:type:: void (*EVP_CONFIGURATION_CALLBACK)(const char *topic, const void *config, size_t configlen, void *userData) + + Function prototype for the callback passed to the function + :c:func:`EVP_setConfigurationCallback`. + + **Parameters**: + - **topic** - Destination topic. + - **config** - The buffer to pass as configuration. + - **configlen** - The size of the configuration data for sending. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_STATE_CALLBACK)(EVP_STATE_CALLBACK_REASON reason, void *userData) + + Function prototype for the callback passed to State message-dealing + functions such as :c:func:`EVP_sendState`. + + **Parameters**: + - **reason** - The cause code for executing the callback. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_MESSAGE_SENT_CALLBACK)(EVP_MESSAGE_SENT_CALLBACK_REASON reason, void *userData) + + Function prototype for the callback passed to generic message-dealing + functions such as :c:func:`EVP_sendMessage`. + + **Parameters**: + - **reason** - The cause code for executing the callback. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_MESSAGE_RECEIVED_CALLBACK)(const char *topic, const void *msgPayload, size_t msgPayloadLen, void *userData) + + Function prototype for the callback passed to the function + :c:func:`EVP_setMessageCallback`. Executed when a message is received + on the configured ``topic``. + + **Parameters**: + - **topic** - Destination topic. + - **msgPayload** - The buffer to pass as configuration. + - **msgPayloadLen** - The size of the configuration data for sending. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_TELEMETRY_CALLBACK)(EVP_TELEMETRY_CALLBACK_REASON reason, void *userData) + + Function prototype for the callback passed to :c:func:`EVP_sendTelemetry`. + + **Parameters**: + - **reason** - The cause code for executing the callback. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_RPC_REQUEST_CALLBACK)(EVP_RPC_ID id, const char *methodName, const char *params, void *userData) + + Function prototype for the callback passed to :c:func:`EVP_setRpcCallback`. + + **Parameters**: + - **id** - The request Id for :c:func:`EVP_sendRpcResponse`. + - **methodName** - The name of method. + - **params** - The call parameters. A string representation of + a JSON value. + +.. c:type:: void (*EVP_RPC_RESPONSE_CALLBACK)(EVP_RPC_RESPONSE_CALLBACK_REASON reason, void *userData) + + Function prototype for the callback passed to :c:func:`EVP_sendRpcResponse`. + + **Parameters**: + - **reason** - The cause code for executing the callback. + - **userData** - An arbitrary blob of data to pass to the callback. + +.. c:type:: void (*EVP_STREAM_READ_CALLBACK)(EVP_STREAM_PEER_ID id, const void *buf, size_t n, void *userData) + + The callback type used to represent a read-available stream + operation. + + **Parameters**: + - **id** - Peer identifier. Whereas this remains as an + opaque type, applications can rely on + different identifiers meaning different connections to a given stream. + - **buf** - Buffer containing the input data. + - **n** - Buffer length. + - **userData** - An opaque pointer to user-defined data, + as defined by :c:func:`EVP_streamInputOpen` . + +Functions +********* + +.. c:function:: struct EVP_client *EVP_initialize(void) + + Initialize the SDK. + + Performs the required initialization operations + for the module instance. + + This should be called by the main thread + of the module instance. + Otherwise, the behaviour is undefined. + + This should not be called more than once + for a module instance. + Otherwise, the behaviour is undefined. + + :returns: Client object pointer for the calling module instance. + +.. c:function:: const char EVP_getWorkspaceDirectory(struct EVP_client *h, EVP_WORKSPACE_TYPE type) + + Returns the absolute path of the workspace directory + for the calling Module Instance. + + The workspace directory with the default type + (:c:enumerator:`~EVP_WORKSPACE_TYPE.EVP_WORKSPACE_TYPE_DEFAULT`) + has the following characteristics: + + - Initially, the workspace directory is empty. + + - The workspace directory is left intact + across a reboot of the Module + Instace and/or the device. + It can contain the contents left by the + Module Instance before a reboot. + + - The Module Instance has an exclusive access + to its workspace directory + during its lifetime. + + - The Module Instance can access + the workspace directory directly, + using the OS interfaces like + :c:func:`open` and :c:func:`mkdir`. + + - The Module Instance can request file operations + on the workspace directory via the SDK. + For example, + upload from/download to a file + on the workspace directory. + + - The Module Instance should only use + regular files and directories on + the workspace directory. + If it attempts to create other file types, + the behavior is undefined. + + - The agent will remove files + in the workspace directory after + the corresponding Module Instance has gone away. + That is, + at some point + after a successful deployment + of a new Deployment which doesn't contain + the Module Instance anymore. + + :param h: Client object pointer. + :param type: Workspace type + + :returns: The absolute path to the workspace directory. + +.. c:function:: EVP_RESULT EVP_setConfigurationCallback(struct EVP_client *h, EVP_CONFIGURATION_CALLBACK cb, void *userData) + + Register a callback function for Configuration. + + This should not be called more than once for + a :c:struct:`EVP_client` object. + Otherwise, the behaviour is undefined. + + The callback :c:var:`cb` will be called in + the context of this function or of + :c:func:`EVP_processEvent`. + + The callback will be called + on the following events at least: + + - When the callback function is registered. + - When the SDK received the latest Configuration. + + The SDK might coalesce multiple events into one. + In that case, + the callback will be called with + the latest Configuration. + + The SDK might choose to invoke + this callback more frequently than necessary. + The callback function should not assume that + the given Configuration was updated. + + All pointers given to the callback, + including topic and Configuration, + are only valid until the callback function returns. + The callback function should make a copy if necessary. + + :param h: Client object pointer. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` on Success. + +.. c:function:: EVP_RESULT EVP_sendState(struct EVP_client *h, const char *topic, const void *state, size_t statelen, EVP_STATE_CALLBACK cb, void *userData) + + Schedule to send the specified State for the specified topic. + + The callback :c:var:`cb` will be called + in the context of this function or of + :c:func:`EVP_processEvent`, + when the request has been sent or cancelled. + It will be invoked with one of + the reasons defined by + :c:enum:`EVP_STATE_CALLBACK_REASON`. + + .. warning:: + + It's the caller's responsibility + to keep the specified :c:var:`topic` and :c:var:`state` + valid until the callback is called. + Otherwise, the behaviour is undefined. + (The SDK implementation might choose + to keep pointers of them + without making copies.) + + :param h: Client object pointer. + :param topic: Destination topic. + :param state: State data. + :param statelen: State size in bytes. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_sendMessage(struct EVP_client *h, const char *topic, const void *state, size_t statelen, EVP_MESSAGE_SENT_CALLBACK cb, void *userData) + + Schedule to send the specified message. + + The callback will be called + in the context of this function or of + :c:func:`EVP_processEvent`, + when the request has been sent or cancelled. + It will be invoked with one of + the reasons defined by + :c:enum:`EVP_MESSAGE_SENT_CALLBACK_REASON`. + + .. warning:: + + It's the caller's responsibility + to keep the specified :c:var:`topic` and :c:var:`state` + valid until the callback is called. + Otherwise, the behaviour is undefined. + (The SDK implementation might choose + to keep pointers of them + without making copies.) + + :param h: Client object pointer. + :param topic: Destination topic. + :param state: State data. + :param statelen: State size in bytes. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + + +.. c:struct:: EVP_telemetry_entry + + Describe a telemetry data + + A Key-Value pair to be sent as a telemetry. + Both of the key and value should be a valid UTF-8 string. + The value should be a string representation of a valid JSON value. + + .. c:member:: const char *key + + A key + + .. c:member:: const char *value + + A JSON value + +.. c:function:: EVP_RESULT EVP_sendTelemetry(struct EVP_client *h, const struct EVP_telemetry_entry *entries, size_t nentries, EVP_TELEMETRY_CALLBACK cb, void *userData) + + Schedule to send the telemetry. + + The callback will be called + in the context of this function or of + :c:func:`EVP_processEvent`, + when the request has been sent or cancelled. + It will be invoked with one + of the reasons defined by + :c:enum:`EVP_TELEMETRY_CALLBACK_REASON`. + + .. warning:: + + It's the caller's responsibility + to keep the specified :c:var:`entries` + valid until the callback is called. + Otherwise, the behaviour is undefined. + (The SDK implementation might choose + to keep pointers of them + without making copies.) + + :param h: Client object pointer. + :param entries: The array of the telemetry data. + :param nentries: The size of the array. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_processEvent(struct EVP_client *h, int timeout_ms) + + Wait for an event and process it. + + This function is intended to be called in the main loop of + the module instance. + It waits for an event (e.g. Configuration update) and process it. + It processes one pending event per call. + + :param h: Client object pointer. + + :param milliseconds: + - 0 means immediate. + - -1 means forever. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` + When at least one event has been processed. + - :c:enumerator:`~EVP_RESULT.EVP_TIMEDOUT` + When the period specified by `timeout_ms` + has elapsed without any events. + - :c:enumerator:`~EVP_RESULT.EVP_SHOULDEXIT` + When the module instance is requested to stop + and all events have been already dispatched. + It should exit performing cleanup as soon as + possible. + + See + :c:enumerator:`~EVP_STATE_CALLBACK_REASON.EVP_STATE_CALLBACK_REASON_EXIT`, + :c:enumerator:`~EVP_MESSAGE_SENT_CALLBACK_REASON.EVP_MESSAGE_SENT_CALLBACK_REASON_EXIT`, + :c:enumerator:`~EVP_TELEMETRY_CALLBACK_REASON.EVP_TELEMETRY_CALLBACK_REASON_EXIT`, + :c:enumerator:`~EVP_RPC_RESPONSE_CALLBACK_REASON.EVP_RPC_RESPONSE_CALLBACK_REASON_EXIT`, + :c:enumerator:`~EVP_BLOB_CALLBACK_REASON.EVP_BLOB_CALLBACK_REASON_EXIT` + +.. c:function:: EVP_RESULT EVP_setMessageCallback(struct EVP_client *h, EVP_MESSAGE_RECEIVED_CALLBACK incoming_cb, void *userData) + + Specifies a callback to invoke + on every incoming message. + + This should not be called more than once + for a :c:struct:`EVP_client`. + Otherwise, the behaviour is undefined. + + The callback will be called + in the context of :c:func:`EVP_processEvent`, + upon reception of a message + on any of the subscribed topics. + + .. note:: + + Messages which have arrived + before a successful call to + this function might or might not be + delivered to the specified callback. + + :param h: Client object pointer. + :param incoming_cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_setRpcCallback(struct EVP_client *h, EVP_RPC_REQUEST_CALLBACK cb, void *userData) + + Specifies a callback to invoke on every incoming RPC call. + + This should not be called more than once for a :c:struct:`EVP_client`. + Otherwise, the behaviour is undefined. + + The callback will be called + in the context of :c:func:`EVP_processEvent`, + upon reception of a RPC request. + + .. note:: + + RPC calls which have arrived + before a successful call of + this function might or might not be delivered + to the specified callback. + + For each invocation of the specified callback, + :c:func:`EVP_sendRpcResponse` should be called + exactly once with the ID given by the callback + and Client object pointer specified to + this function. + It's the caller's responsibility to ensure that. + Otherwise, the behaviour is undefined. + + :param h: Client object pointer. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_sendRpcResponse(struct EVP_client *h, EVP_RPC_ID id, const char *response, EVP_RPC_RESPONSE_STATUS status, EVP_RPC_RESPONSE_CALLBACK cb, void *userData) + + Schedule to send the specified RPC response. + + This function can be used within the context of + :c:type:`EVP_RPC_REQUEST_CALLBACK`. + + The callback will be called + in the context of this function or + of :c:func:`EVP_processEvent`, + when the request has been sent or cancelled. + It will be invoked with one + of the reasons defined by + :c:enum:`EVP_RPC_RESPONSE_CALLBACK_REASON`. + + For implementing named methods, + the SDK provides a method-not-found response + by setting the status flag to + :c:enumerator:`~EVP_RPC_RESPONSE_STATUS.EVP_RPC_RESPONSE_STATUS_METHOD_NOT_FOUND`. + In that case, + the value of :c:var:`response` + will be ignored. + + See the entire set of values + of :c:enum:`EVP_RPC_RESPONSE_STATUS` + to use in other situations. + + It's the caller's responsibility + to keep the specified parameters valid + until the callback is called. + Otherwise, the behavior is undefined + (The SDK implementation might choose + to keep pointers of them + without making copies). + + :param h: Client object pointer. + :param id: The request ID from :c:enum:`EVP_RPC_REQUEST_CALLBACK`, + to which you want to reply. + :param response: The response. + It should be a string representation of + a valid JSON value. + :param status: Response status. + :param cb: User callback function. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` + in case of success. + - :c:enumerator:`~EVP_RESULT.EVP_TOOBIG` + when the payload is larger than the agent + can handle (i.e. due to device constraints). + - :c:enumerator:`~EVP_RESULT.EVP_INVAL` + if the response is NULL. + +.. c:function:: EVP_RESULT EVP_streamOutputOpen(struct EVP_client *h, const char *name, EVP_STREAM *stream) + + Opens an output stream. + + Streams allow for device-to-device + and module-to-module communication, + using an interface somewhat similar + to BSD sockets. + However, the actual implementation depends on + which stream type has been selected + from the deployment manifest. + + :param h: Client object pointer. + :param name: Null-terminated string with the stream name. + This must match the name of one + of the streams defined on the deployment manifest. + :param stream: *[OUT]* + On success, it shall be assigned to a non-negative integer. + Otherwise, it shall be assigned to a negative integer. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + - :c:enumerator:`~EVP_RESULT.EVP_INVAL` + if the stream was not defined by the + deployment manifest or the stream was not defined for output. + - :c:enumerator:`~EVP_RESULT.EVP_EXIST` + if a stream with the same :c:var:`name` has already been opened. + - :c:enumerator:`~EVP_RESULT.EVP_NOMEM` + if memory could not be allocated. + - :c:enumerator:`~EVP_RESULT.EVP_ERROR` + if an unexpected error occurred. + +Streams +======= + +.. c:function:: EVP_RESULT EVP_streamInputOpen(struct EVP_client *h, const char *name, EVP_STREAM_READ_CALLBACK cb, void *userData, EVP_STREAM *stream) + + Opens an input stream. + + Streams allow for device-to-device + and module-to-module communication, + using an interface somewhat similar + to BSD sockets. + However, the actual implementation depends on + which stream type has been selected + from the deployment manifest. + + :param h: Client object pointer. + :param name: Null-terminated string with the stream name. + This must match the name of one + of the streams defined on the deployment manifest. + :param cb: User callback + that shall be executed + when input data becomes available. + :param userData: Opaque pointer to user-defined data that shall + be passed to :c:var:`cb`. + :param stream: *[OUT]* + On success, it shall be asssigned to a non-negative integer. + Otherwise, it shall be assigned to a negative integer. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + - :c:enumerator:`~EVP_RESULT.EVP_INVAL` + if the stream was not defined by the + deployment manifest or the stream was not defined for input. + - :c:enumerator:`~EVP_RESULT.EVP_EXIST` + if a stream with the same :c:var:`name` has already been opened. + - :c:enumerator:`~EVP_RESULT.EVP_NOMEM` + if memory could not be allocated. + - :c:enumerator:`~EVP_RESULT.EVP_ERROR` + if an unexpected error occurred. + +.. c:function:: EVP_RESULT EVP_streamClose(struct EVP_client *h, EVP_STREAM stream) + + Closes a stream previously opened with + :c:func:`EVP_streamInputOpen` or + :c:func:`EVP_streamOutputOpen`. + + :param h: Client object pointer. + :param stream: Stream identifier. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + - :c:enumerator:`~EVP_RESULT.EVP_INVAL` + if the stream was not defined by the deployment manifest. + - :c:enumerator:`~EVP_RESULT.EVP_ERROR` + if an unexpected error occurred. + +.. c:function:: EVP_RESULT EVP_streamWrite(struct EVP_client *h, EVP_STREAM stream, const void *buf, size_t n) + + Sends a buffer over a stream + previously opened with + :c:func:`EVP_streamInputOpen` or + :c:func:`EVP_streamOutputOpen`. + + :param h: Client object pointer. + :param stream: Stream identifier. + :param buf: Buffer to send. + :param n: Buffer length. + + :returns: + + - :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + - :c:enumerator:`~EVP_RESULT.EVP_INVAL` + if the stream was not defined by the + deployment manifest or was not configured for output. + - :c:enumerator:`~EVP_RESULT.EVP_ERROR` + if an unexpected error occurred. diff --git a/docs/interfaces/application_sdk/blob.rst b/docs/interfaces/application_sdk/blob.rst new file mode 100644 index 00000000..96ecb49c --- /dev/null +++ b/docs/interfaces/application_sdk/blob.rst @@ -0,0 +1,532 @@ +.. SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +.. +.. SPDX-License-Identifier: Apache-2.0 + +Blob +#### + +Types +***** + +Enumerates +========== + +.. c:type:: EVP_BLOB_TYPE + + An integer constant for specifying the type of storage service. + + :values: + + .. c:enumerator:: EVP_BLOB_TYPE_AZURE_BLOB + + :value: 0 + + A blob stored in an Azure storage container. + + .. c:enumerator:: EVP_BLOB_TYPE_EVP + + :value: 1 + + [deprecated] A blob stored in the EVP storage provider. + EVP_BLOB_TYPE_EVP_EXT can be used instead of this type. + + .. c:enumerator:: EVP_BLOB_TYPE_HTTP + + :value: 2 + + A blob provided by an ordinary HTTP server. + Only EVP_BLOB_OP_GET operation is supported. + + .. c:enumerator:: EVP_BLOB_TYPE_EVP_EXT + + :value: 3 + + A blob stored in the EVP storage provider. + User can select the storage based on data type. + + .. c:enumerator:: EVP_BLOB_TYPE_HTTP_EXT + + :value: 4 + + A blob provided by an ordinary HTTP server. + Only EVP_BLOB_OP_GET operation is supported. + Allows to pass extra headers for the HTTP + request. + +.. c:type:: EVP_BLOB_OPERATION + + An integer constant for specifying the blob operation. + + :values: + + .. c:enumerator:: EVP_BLOB_OP_GET + + :value: 0 + + Operation GET a blob from the storage service. + + .. c:enumerator:: EVP_BLOB_OP_PUT + + :value: 1 + + Operation PUT a blob into the storage service. + +.. c:type:: EVP_BLOB_IO_RESULT + + The type to represent an outcome of a blob IO callback. + + :values: + + .. c:enumerator:: EVP_BLOB_IO_RESULT_SUCCESS + + :value: 0 + + The operation completed successfully. + + .. c:enumerator:: EVP_BLOB_IO_RESULT_ERROR + + :value: 1 + + The operation failed. + +.. c:type:: EVP_BLOB_RESULT + + The type to represent an outcome of a blob operation. + + :values: + + .. c:enumerator:: EVP_BLOB_RESULT_SUCCESS + + :value: 0 + + The operation completed successfully. + + .. c:enumerator:: EVP_BLOB_RESULT_ERROR + + :value: 1 + + The operation failed. + + .. c:enumerator:: EVP_BLOB_RESULT_ERROR_HTTP + + :value: 2 + + The operation failed with a valid HTTP status. + +.. c:type:: EVP_BLOB_CALLBACK_REASON + + The type to represent the reason of the callback invocation. + + :values: + + .. c:enumerator:: EVP_BLOB_CALLBACK_REASON_DONE + + :value: 0 + + I/O completion, either success or error. + + .. c:enumerator:: EVP_BLOB_CALLBACK_REASON_EXIT + + :value: 1 + + Cancelled or rejected because the requesting Module Instance is + going to exit. + Users must not send any more requests to the agent when this code is + received, and instead users must call \ref EVP_processEvent until + all events are flushed. + + .. c:enumerator:: EVP_BLOB_CALLBACK_REASON_DENIED + + :value: 2 + + A request was denied for transmission. This means the agent could + not enqueue the request due to a full queue. + +Structures +========== + +.. c:struct:: EVP_BlobLocalStore + + A blob operation local store: file or memory + + .. c:member:: const char *filename + + An absolute path of a local file to operate on. + There are restrictions on the filename: + + - It should be in the workspace directory + for the module instance + with type :c:enumerator:`~EVP_BLOB_TYPE.EVP_WORKSPACE_TYPE_DEFAULT`. + - It shouldn't contain parent directory + references. (``..``) + - It shouldn't involve symbolic links. + - It shouldn't end with a slash. + - It shouldn't contain redundant consecutive slashes. + (E.g. ``//path///like////this``) + + .. c:member:: EVP_BLOB_IO_CALLBACK io_cb + + Callback to process partial IO data. + + .. warning:: + + This functionality is provided as a solution for a particular + use case. + + .. warning:: + + Right now, this functionality is available only for NuttX. + + This field is ignored if `filename` is not NULL. + + The callback is invoked for each chunk in the blob. + The chunk sizes are decided by the SDK automatically. + The callback should not assume any specific sizes. + + The callback is called sequentionally from the start of the blob + (smaller offset) to the end of the blob. + If a callback needs to know the current offset in the blob, + the callback should keep track of it by itself, probably using + `userData`. + + .. warning:: + + The callback should return as soon as possible because + otherwise it would interfere the entire device, not only the + calling module instance. + It's recommended for the callback to copy the data to some + application specific buffer and return without any extra + processing. + + .. c:member:: size_t blob_len + + The length of the blob to upload + This field is only used when all conditions below are satisfied: + + - filename is NULL + - PUT operations (type = EVP_BLOB_OP_PUT) + +Azure blobs +----------- + +.. c:struct:: EVP_BlobRequestAzureBlob + + A blob operation request for Azure Blob Storage. + + .. c:member:: const char *url + + Shared Access Signature URL for the blob. + + - :c:enumerator:`~EVP_BLOB_OP.EVP_BLOB_OP_GET` + requires `Read (r)` permission. + - :c:enumerator:`~EVP_BLOB_OP.EVP_BLOB_OP_PUT` + requires `Create (c)` and/or `Write (w)` permission. + + See `Create Storage Service`_. + +.. c:struct:: EVP_BlobResultAzureBlob + + A blob operation result for Azure Blob Storage. + + .. c:member:: EVP_BLOB_RESULT result + + The result of the blob operation. + + .. c:member:: unsigned int http_status + + An HTTP status code. + + .. c:member:: int error + + An errno value. + Only valid for :c:enumerator:`~EVP_BLOB_RESULT.EVP_BLOB_RESULT_ERROR`. + +EVP blobs +--------- + +.. c:struct:: EVP_BlobRequestEvp + + .. deprecated:: 1.0.0 + + A blob operation request for EVP Storage Provider. + + .. c:member:: const char *remote_name + + The unique string to identify this blob. + + Consult the documentation of the EVP Storage Provider + how this string is actually used. + +.. c:struct:: EVP_BlobRequestEvpExt + + A blob operation request for EVP Storage Provider. + + .. c:member:: const char *remote_name + + The unique string to identify file name to upload. + + Consult the documentation of the EVP Storage Provider + how this string is actually used. + + .. c:member:: const char *storage_name + + The unique string to identify + the blob storage based on data type. + + This parameter must be :c:var:`NULL` + to use the default STP or the same string + as configured in EVP Hub + when user create storage. + + When this parameter is :c:var:`NULL`, + a file will be uploaded + to the default EVP storage. + This will be same behavior as + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_EVP`. + + Consult the documentation of the EVP Storage Provider + how this string is actually used. + + .. note:: + + This member corresponds to the :c:var:`key` field of the target STP + configured in the Cloud API. + + +.. c:struct:: EVP_BlobResultEvp + + A blob operation result for EVP Storage Provider. + + .. c:member:: EVP_BLOB_RESULT result + + The result of the blob operation. + + .. c:member:: unsigned int http_status + + An HTTP status code. + + .. c:member:: int error + + An errno value. + Only valid for + :c:enumerator:`~EVP_BLOB_RESULT.EVP_BLOB_RESULT_ERROR`. + +HTTP blobs +---------- + +.. c:struct:: EVP_BlobRequestHttp + + A blob operation request for ordinary HTTP server. + + .. c:member:: const char *url + + URL for the blob. + +.. c:struct:: EVP_BlobResultHttp + + A blob operation result for HTTP server. + + .. c:member:: EVP_BLOB_RESULT result + + The result of the blob operation. + + .. c:member:: unsigned int http_status + + An HTTP status code. + + .. c:member:: int error + + An errno value. + Only valid for + :c:enumerator:`~EVP_BLOB_RESULT.EVP_BLOB_RESULT_ERROR`. + + +HTTP Extended blobs +------------------- + + + +.. c:struct:: EVP_BlobRequestHttpExt + + A blob operation request for ordinary HTTP server, supporting extra + headers. + + +.. c:struct:: EVP_BlobResultHttpExt + + A blob operation result for HTTP server. + + .. c:member:: EVP_BLOB_RESULT result + + The result of the blob operation. + + .. c:member:: unsigned int http_status + + An HTTP status code. + + .. c:member:: int error + + An errno value. + Only valid for + :c:enumerator:`~EVP_BLOB_RESULT.EVP_BLOB_RESULT_ERROR`. + + +Callbacks +========= + +.. c:type:: EVP_BLOB_IO_RESULT (*EVP_BLOB_IO_CALLBACK)(void *buf, size_t buflen, void *userData) + + Function prototype for the callback passed to + :c:struct:`EVP_BlobLocalStore` + + **parameters**: + + - **buf** - The buffer with the contents. + - **buflen** - The length of the buffer. + - **userData** - The userData value specified for :c:func:`EVP_blobOperation`. + + +.. c:type:: void (*EVP_BLOB_CALLBACK)(EVP_BLOB_CALLBACK_REASON reason, const void *result, void *userData) + + Function prototype for the callback passed to the function + :c:func:`EVP_blobOperation`. + + **parameters**: + + - **reason** - One of :c:enum:`EVP_BLOB_CALLBACK_REASON` values. + - **result** - The result of the operation. + Valid only when :c:var:`reason` is :c:enumerator:`~EVP_BLOB_CALLBACK_REASON.EVP_BLOB_CALLBACK_REASON_DONE`. + The type of the :c:var:`result` depends on the + request's :c:var:`type` and :c:var:`op`. + + It is a pointer to: + + - :c:struct:`EVP_BlobResultAzureBlob` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_AZURE_BLOB`. + - :c:struct:`EVP_BlobResultEvp` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_EVP`. + - :c:struct:`EVP_BlobResultEvp` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_EVP_EXT`. + - **userData** - The userData value specified for :c:func:`EVP_blobOperation`. + +Functions +********* + +.. c:function:: EVP_RESULT EVP_blobOperation(struct EVP_client *h, EVP_BLOB_TYPE type, EVP_BLOB_OPERATION op, const void *request, struct EVP_BlobLocalStore *localStore, EVP_BLOB_CALLBACK cb, void *userData) + + Schedule a blob operation + + Enqueues the specified operation :c:var:`op` on a blob of the given :c:var:`type` + which is described by :c:var:`request`, linking it to the given data specified + by :c:var:`localStore` + + :param h: Client object pointer. + :param type: Blob type + :param op: Whether to GET or PUT the blob. + :param request: A pointer to a structure to specify request parameters. + + It is a pointer to: + + - :c:struct:`EVP_BlobRequestAzureBlob` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_AZURE_BLOB` + - :c:struct:`EVP_BlobRequestEvp` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_EVP` + - :c:struct:`EVP_BlobRequestEvpExt` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_EVP_EXT` + - :c:struct:`EVP_BlobRequestHttp` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_HTTP` + - :c:struct:`EVP_BlobRequestHttpExt` for + :c:enumerator:`~EVP_BLOB_TYPE.EVP_BLOB_TYPE_HTTP_EXT` + :param localStore: The info about the local store for the data. + The pointed info is copied as needed, so it is + responsibility of the caller to free it. + :param cb: The callback function. It can not be :c:var:`NULL`. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_blobGetUploadURL(struct EVP_client *h, const charstorageName, const charremoteName, EVP_BLOB_CALLBACK cb, void *userData) + + Get the upload URL + This API is only available from native. + It cannot be used from the WASM module. + + .. warning:: + + This is an experimental option and will be + removed in future releases. + + :param h: struct EVP_client. + :param storageName: The unique string to identify the blob storage based + on data type. + :param remoteName: The unique string to identify file name to upload. + Set "" to get container UploadURL. + Set other than "" to get Blob UploadURL. + + :param cb: The callback function. It can not be NULL. + :param userData: The SDK passes this value to the callback as it is. + The SDK doesn't care if it's a valid pointer. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +HTTP Extended +============= + +.. c:function:: struct EVP_BlobRequestHttpExt *EVP_BlobRequestHttpExt_initialize(void) + + Initializes an :c:struct:`EVP_BlobRequestHttpExt` + + This function must be called when instantiating an :c:struct:`EVP_BlobRequestHttpExt`. + It returns a pointer to a new request that must be later freed using + :c:func:`EVP_BlobRequestHttpExt_free` + + :returns: Pointer to a newly allocated request struct. :c:var:`NULL` on failure. + +.. c:function:: void EVP_BlobRequestHttpExt_free(struct EVP_BlobRequestHttpExt *request) + + Frees an :c:struct:`EVP_BlobRequestHttpExt` + + This function must be called when freeing an :c:struct:`EVP_BlobRequestHttpExt` + + :param request: A pointer to a :c:struct:`EVP_BlobRequestHttpExt` structure. + +.. c:function:: EVP_RESULT EVP_BlobRequestHttpExt_addHeader(struct EVP_BlobRequestHttpExt *request, const char *name, const char *value) + + Inserts an extra header to :c:struct:`EVP_BlobRequestHttpExt` + + This helper function inserts an extra header into the request. + + :param request: A pointer to a :c:struct:`EVP_BlobRequestHttpExt` structure. + :param name: A pointer to a null-terminated string containing the + name of the header. + :param value: A pointer to a null-terminated string containing the value + of the header. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_BlobRequestHttpExt_addAzureHeader(struct EVP_BlobRequestHttpExt *request) + + Inserts an extra header to :c:struct:`EVP_BlobRequestHttpExt` + + This helper function inserts the azure specific headers in the request. + + :param request: A pointer to a :c:struct:`EVP_BlobRequestHttpExt` structure. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + +.. c:function:: EVP_RESULT EVP_BlobRequestHttpExt_setUrl(struct EVP_BlobRequestHttpExt *request, char *url) + + Sets the url of :c:struct:`EVP_BlobRequestHttpExt` + + This function sets the url of the request. + + :param request: A pointer to a :c:struct:`EVP_BlobRequestHttpExt` structure. + :param url: The destination URL of the request. + + :returns: :c:enumerator:`~EVP_RESULT.EVP_OK` Success. + + +------- + +.. _Create Storage Service: https://docs.microsoft.com/en-us/rest/api/storageservices/create-service-sas \ No newline at end of file diff --git a/docs/interfaces/application_sdk/experimental.rst b/docs/interfaces/application_sdk/experimental.rst index 327be5af..972c51bc 100644 --- a/docs/interfaces/application_sdk/experimental.rst +++ b/docs/interfaces/application_sdk/experimental.rst @@ -38,7 +38,7 @@ provides the semantics required by its public interface, described below: Where: * - ``EVP_streamInputOpen`` sets up a stream that must be configured with direction + :c:func:`EVP_streamInputOpen` sets up a stream that must be configured with direction ``in`` and name ``name`` from the ``deploymentManifest``. ``cb`` refers to a user-defined callback that will be triggered by the implementation as soon as input data is available. ``user`` is an opaque pointer that is passed to the @@ -47,27 +47,27 @@ Where: pointer. * - ``EVP_streamOutputOpen`` sets up a stream that must be configured with + :c:func:`EVP_streamOutputOpen` sets up a stream that must be configured with direction ``out`` and name ``name`` from the ``deploymentManifest``. * - ``EVP_streamClose`` releases the resources allocated by a stream opened - with ``EVP_streamInputOpen`` or ``EVP_streamOutputOpen``. For streams opened with - ``EVP_streamOutputOpen``\ , ``EVP_streamClose`` shall flush any pending outgoing + :c:func:`EVP_streamClose` releases the resources allocated by a stream opened + with :c:func:`EVP_streamInputOpen` or :c:func:`EVP_streamOutputOpen`. For streams opened with + :c:func:`EVP_streamOutputOpen`\ , :c:func:`EVP_streamClose` shall flush any pending outgoing messages before closing the stream. * - ``EVP_streamWrite`` must queue the request defined by the ``const void *``\ , + :c:func:`EVP_streamWrite` must queue the request defined by the ``const void *``\ , which is the user payload, and the ``size_t``\ , which defines its size. This function must return immediately, and therefore is not required to send data over the network. This should be done asynchronously, for example, via a separate thread. This function can only be used with streams previously opened with - ``EVP_streamOutputOpen``. + :c:func:`EVP_streamOutputOpen`. Another significant difference between POSIX sockets and EVP streams is their direction: while POSIX sockets can be bidirectional, EVP streams are *only* unidirectional. In other words, EVP streams can be either ``in`` or -``out``\ , but never both. As a consequence, using ``EVP_streamWrite`` on an +``out``\ , but never both. As a consequence, using :c:func:`EVP_streamWrite` on an ``in`` stream will return an error. Bidirectional streams are currently not planned, but it should still be @@ -116,15 +116,9 @@ might as well not exist if the stream type does not require it. The following stream types are supported: -* ``nng``\ : based on the `nng`_ library. In - the case of an agent using a local SDK implementation, ``nng`` streams are - only available if ``EVP_AGENT_LOCAL_SDK_NNG_STREAMS`` is defined. Moreover, - ``nng`` are known to have issues on NuttX + ESP32; issues that have not been - investigated. * ``null``\ : a placeholder implementation only meant for testing purposes. ``null`` streams are always supported by the agent. -* ``posix``\ : only uses the POSIX C standard library, which makes it a more - lightweight and convenient choice, compared to ``nng`` streams. +* ``posix``\ : only uses the POSIX C standard library. Take into account that, if a module does not use any stream, the ``streams`` object must not exist. @@ -133,7 +127,7 @@ Open the stream from the module instance ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When a module instance has been started with a set of configured streams, a -call to ``EVP_streamInputOpen`` or ``EVP_streamOutputOpen`` will look up the +call to :c:func:`EVP_streamInputOpen` or :c:func:`EVP_streamOutputOpen` will look up the current ``deploymentManifest`` to check whether the stream was defined accordingly. @@ -157,14 +151,14 @@ The example module below shows how to open an output stream called } If ``my-stream`` could not be found on the ``streams`` JSON object belonging to -the calling module instance, ``EVP_INVAL`` will be returned. See the -documentation for ``EVP_streamInputOpen`` and ``EVP_streamOutputOpen`` for a list of possible error values. +the calling module instance, :c:enumerator:`~EVP_RESULT.EVP_INVAL` will be returned. See the +documentation for :c:func:`EVP_streamInputOpen` and :c:func:`EVP_streamOutputOpen` for a list of possible error values. Once a stream has been opened successfully: * Input streams shall get their user-defined callback triggered once input data is available. -* Output streams can call ``EVP_streamWrite``. +* Output streams can call :c:func:`EVP_streamWrite`. High-level design ----------------- @@ -199,7 +193,6 @@ However, this implementation must be complemented with: * Stream type-specific implementation: - * `nng.c `_. * `null.c `_. * `posix.c `_. @@ -251,7 +244,7 @@ where: * ``init`` performs the required type-specific initialization of a stream. The desired stream configuration is contained inside the ``cfg`` member on the ``struct stream_impl`` passed to this function. A status code as defined - by ``EVP_RESULT`` must be returned. If not ``EVP_OK``\ , the status code shall be + by :c:enum:`~EVP_RESULT` must be returned. If not ``EVP_OK``\ , the status code shall be propagated to the user. * ``close`` must deallocate any resources previously allocated by a call to ``init``. Returns zero if successful, non-zero otherwise. @@ -269,9 +262,6 @@ where: standard ``atexit(3)`` function. It can be a null pointer if no actions are required. - * Note: ``atexit`` was required by ``nng`` streams so as to avoid a false - positive from ``valgrind(1)`` when closing the agent. - Input streams ------------- @@ -336,7 +326,7 @@ how the event should be stored in the event queue. Local SDK ^^^^^^^^^ -Since ``EVP_client`` was already designed to be accessed from multiple threads +Since :c:struct:`EVP_client` was already designed to be accessed from multiple threads in the case of local SDK, the implementation for ``stream_insert_read_event`` was relatively straightforward: the ``struct sdk_event_stream_read_available`` instance can be safely appended into the queue as long as the ``sdk_{un}lock`` @@ -406,7 +396,7 @@ are never meant to be available to users in any case. As a consequence of this, ``process_stream_in`` has no way to retrieve the ``struct EVP_client`` related to the stream, since its caller is only limited -to a ``struct sdk_client`` instance. This forces ``EVP_initialize`` to set up +to a ``struct sdk_client`` instance. This forces :c:func:`EVP_initialize` to set up a callback/opaque-pointer pair that allows `sdk.c`_ to insert the new event into ``struct EVP_client`` member ``events``, which must be assigned to its ``struct sdk_transport`` instance, which is the only data @@ -447,7 +437,6 @@ users. -------- -.. _nng: https://github.com/nanomsg/nng .. _streams: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform/tree/main/src/libevp-agent/stream .. _stream.c: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform/tree/main/src/libevp-agent/stream/stream.c .. _stream.h: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform/tree/main/src/libevp-agent/stream/stream.h diff --git a/docs/interfaces/application_sdk/features.rst b/docs/interfaces/application_sdk/features.rst index acd47e79..3d63eb39 100644 --- a/docs/interfaces/application_sdk/features.rst +++ b/docs/interfaces/application_sdk/features.rst @@ -9,7 +9,7 @@ Most of the features described below are available to module instances via the use of an opaque handle. In the C EVP Application SDK, -``struct EVP_client`` is the opaque pointer type +:c:struct:`EVP_client` is the opaque pointer type exposed to users. In the Python EVP SDK, the ``evp.client`` module @@ -38,11 +38,7 @@ whenever a given configuration topic is received. In the C EVP Application SDK, module instances can subscribe to a given configuration -via the ``EVP_setConfigurationCallback`` function: - -.. code:: C - - EVP_RESULT EVP_setConfigurationCallback(struct EVP_client *h, EVP_CONFIGURATION_CALLBACK cb, void *userData); +via the :c:func:`EVP_setConfigurationCallback` function. In the Python EVP SDK, module instances can subscribe @@ -86,11 +82,7 @@ by the EVP Agent. In the C EVP SDK, states can be sent -using the ``EVP_sendState`` function: - -.. code:: C - - EVP_RESULT EVP_sendState(struct EVP_client *h, const char *topic, const void *state, size_t statelen, EVP_STATE_CALLBACK cb, void *userData); +using the :c:func:`EVP_sendState` function. In the Python EVP SDK, the ``evp.state`` module @@ -115,7 +107,7 @@ using the ``State.send`` method: The ``State.send`` method shall raise an exception -if the underlying call to ``EVP_sendState`` fails. +if the underlying call to :c:func:`EVP_sendState` fails. Telemetries =========== @@ -136,11 +128,7 @@ where all telemetries for each module instance are defined. blob operations should be used instead. In the C EVP SDK, telemetries can be sent -using the ``EVP_sendTelemetry`` function: - -.. code:: C - - EVP_RESULT EVP_sendTelemetry(struct EVP_client *h, const struct EVP_telemetry_entry *entries, size_t nentries, EVP_TELEMETRY_CALLBACK cb, void *userData); +using the :c:func:`EVP_sendTelemetry` function. Where ``entries`` refers to an arbitrary number of telemetry entries, @@ -150,7 +138,7 @@ is defined by the ``nentries`` parameter. .. note:: - Since ``EVP_sendTelemetry`` takes + Since :c:func:`EVP_sendTelemetry` takes a read-only pointer to such entries, it is advisable that the user-defined callback pointed to by ``user`` @@ -207,29 +195,17 @@ which are both defined as strings. In the C EVP SDK, a module can subscribe to module direct command requests -via the ``EVP_setRpcCallback`` function: - -.. code:: C - - EVP_RESULT EVP_setRpcCallback(struct EVP_client *h, EVP_RPC_REQUEST_CALLBACK cb, void *userData); +via the :c:func:`EVP_setRpcCallback` function. All module direct commands are then mapped to a single, user-defined callback -with the following signature: - -.. code:: C - - typedef void (*EVP_RPC_REQUEST_CALLBACK)(EVP_RPC_ID id, const char *methodName, const char *params, void *userData); +with the :c:type:`EVP_RPC_REQUEST_CALLBACK` signature. ``id`` is an opaque identifier dedicated to match a request against a response, which is passed -via the ``EVP_sendRpcResponse``: - -.. code:: C - - EVP_RESULT EVP_sendRpcResponse(struct EVP_client *h, EVP_RPC_ID id, const char *response, EVP_RPC_RESPONSE_STATUS status, EVP_RPC_RESPONSE_CALLBACK cb, void *userData); +via the :c:func:`EVP_sendRpcResponse`. In the Python EVP SDK, modules can subscribe @@ -274,11 +250,7 @@ using a variety of protocols. In the C EVP SDK, all these operations are performed -by the :c:func:`EVP_blobOperation` function: - -.. code:: C - - EVP_RESULT EVP_blobOperation(struct EVP_client *h, EVP_BLOB_TYPE type, EVP_BLOB_OPERATION op, const void *request, struct EVP_BlobLocalStore *localStore, EVP_BLOB_CALLBACK cb, void *userData); +by the :c:func:`EVP_blobOperation` function. Every blob operation consumes a user-defined callback that will be executed by the agent diff --git a/docs/interfaces/application_sdk/index.rst b/docs/interfaces/application_sdk/index.rst index e2130265..0e8899a5 100644 --- a/docs/interfaces/application_sdk/index.rst +++ b/docs/interfaces/application_sdk/index.rst @@ -19,3 +19,6 @@ for building EVP applications. features usage experimental + base + blob + \ No newline at end of file diff --git a/docs/interfaces/application_sdk/usage.rst b/docs/interfaces/application_sdk/usage.rst index 68fa5fa9..b34e73ce 100644 --- a/docs/interfaces/application_sdk/usage.rst +++ b/docs/interfaces/application_sdk/usage.rst @@ -17,32 +17,32 @@ if the module did not exit gracefully the agent will forcefully stop and kill the module. This is implemented within the module instance “supervisor”. -All events in a module instance are processed by ``EVP_processEvent``. +All events in a module instance are processed by :c:func:`EVP_processEvent`. If the agent wants the module instance to exit, -``EVP_processEvent`` would still dispatch any pending events. +:c:func:`EVP_processEvent` would still dispatch any pending events. The agent would then notify the module via the event callback when an event is generated by: -- ``EVP_sendState`` would have ``EVP_STATE_CALLBACK_REASON_EXIT`` +- :c:func:`EVP_sendState` would have :c:enumerator:`~EVP_STATE_CALLBACK_REASON.EVP_STATE_CALLBACK_REASON_EXIT` as its ``reason`` on the event callback. -- ``EVP_sendTelemetry`` would have ``EVP_TELEMETRY_CALLBACK_REASON_EXIT`` +- :c:func:`EVP_sendTelemetry` would have :c:enumerator:`~EVP_TELEMETRY_CALLBACK_REASON.EVP_TELEMETRY_CALLBACK_REASON_EXIT` as its ``reason`` on the event callback. -- ``EVP_sendMessage`` would have ``EVP_MESSAGE_SENT_CALLBACK_REASON_EXIT`` +- :c:func:`EVP_sendMessage` would have :c:enumerator:`~EVP_MESSAGE_SENT_CALLBACK_REASON.EVP_MESSAGE_SENT_CALLBACK_REASON_EXIT` as its ``reason`` on the event callback. -- ``EVP_sendRpcResponse`` would have ``EVP_RPC_RESPONSE_CALLBACK_REASON_EXIT`` +- :c:func:`EVP_sendRpcResponse` would have :c:enumerator:`~EVP_RPC_RESPONSE_CALLBACK_REASON.EVP_RPC_RESPONSE_CALLBACK_REASON_EXIT` as its ``reason`` on the event callback. -- ``EVP_blobOperation`` would have ``EVP_BLOB_CALLBACK_REASON_EXIT`` +- :c:func:`EVP_blobOperation` would have :c:enumerator:`~EVP_BLOB_CALLBACK_REASON.EVP_BLOB_CALLBACK_REASON_EXIT` as its ``reason`` on the event callback. -``EVP_processEvent`` would still return ``EVP_SHOULD_EXIT`` +:c:func:`EVP_processEvent` would still return ``EVP_SHOULD_EXIT`` only if there are no more events pending on the input queue to the module. When any of the ``*_REASON_EXIT`` error codes is received, the module instance must stop generating any new events, -and keep calling ``EVP_processEvent`` until ``EVP_SHOULD_EXIT`` is returned. +and keep calling :c:func:`EVP_processEvent` until ``EVP_SHOULD_EXIT`` is returned. This is done for the module to be able to process all the pending events before it actually exits. Some examples of functions that generate events are -``EVP_sendState``, ``EVP_sendTelemetry`` and ``EVP_sendMessage``. +:c:func:`EVP_sendState`, :c:func:`EVP_sendTelemetry` and :c:func:`EVP_sendMessage`. Sample module ------------- @@ -89,10 +89,10 @@ A correct implementation of the module would be } When the module instance is requested to stop, -``EVP_TELEMETRY_CALLBACK_REASON_EXIT`` is signalled by ``telemetry_cb``, -so that the module instance does not call ``EVP_sendTelemetry`` anymore. +:c:enumerator:`~EVP_TELEMETRY_CALLBACK_REASON.EVP_TELEMETRY_CALLBACK_REASON_EXIT` is signalled by ``telemetry_cb``, +so that the module instance does not call :c:func:`EVP_sendTelemetry` anymore. Then, the module instance flushes all the events in the queue, -until ``EVP_processEvent`` returns ``EVP_SHOULD_EXIT``, +until :c:func:`EVP_processEvent` returns ``EVP_SHOULD_EXIT``, so the module instance ``break``s and finally ``return``s from ``main``. diff --git a/docs/license.rst b/docs/license.rst index c7621967..577ca318 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -40,12 +40,6 @@ MQTT-C Copyright (c) 2018 Liam Bindle -nng ---- - -Copyright 2021 Staysail Systems, Inc. -Copyright 2018 Capitar IT Group BV - BSD-3-Clause License ******************** diff --git a/docs/requirements.txt b/docs/requirements.txt index 2e7434dc..418c2e1a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -6,3 +6,4 @@ sphinx==7.1.2 sphinx-rtd-theme==1.3.0rc1 myst_parser==3.0.0 rstcheck==6.2.4 +sphinx-copybutton==0.5.2 diff --git a/include/evp_mbedtls_config.h b/include/evp_mbedtls_config.h index 0b99f7be..b9d2c24b 100644 --- a/include/evp_mbedtls_config.h +++ b/include/evp_mbedtls_config.h @@ -5,3 +5,5 @@ */ #undef MBEDTLS_DEBUG_C +#define MBEDTLS_THREADING_C +#define MBEDTLS_THREADING_PTHREAD diff --git a/scripts/build/sys/posix.mk b/scripts/build/sys/posix.mk index ee16b94d..0c166723 100644 --- a/scripts/build/sys/posix.mk +++ b/scripts/build/sys/posix.mk @@ -5,3 +5,4 @@ SYS_CFLAGS = -pthread -DMBEDTLS_USER_CONFIG_FILE="" SYS_LDFLAGS = -pthread SYS_LDLIBS = -lpthread -lrt -ldl +MBEDTLS_USER_CONFIG_FILE = $(PWD)/$(INCDIR)/evp_mbedtls_config.h diff --git a/scripts/cmake-flatcc.sh b/scripts/cmake-flatcc.sh index 87e5c069..39914d01 100755 --- a/scripts/cmake-flatcc.sh +++ b/scripts/cmake-flatcc.sh @@ -24,7 +24,6 @@ cmake \ -DCMAKE_C_COMPILER="${CC:-cc}" \ -DCMAKE_C_FLAGS="${CFLAGS} -DFLATCC_DEBUG_VERIFY=0" \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DFLATCC_RTONLY=ON \ -DFLATCC_CXX_TEST=OFF \ -DFLATCC_INSTALL=ON \ -DFLATCC_DEBUG_CLANG_SANITIZE=OFF \ diff --git a/scripts/cmake-mbedtls.sh b/scripts/cmake-mbedtls.sh index 2c41cc0e..301b251a 100755 --- a/scripts/cmake-mbedtls.sh +++ b/scripts/cmake-mbedtls.sh @@ -27,6 +27,7 @@ cmake \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DENABLE_TESTING=OFF \ -DENABLE_PROGRAMS=OFF \ + ${MBEDTLS_USER_CONFIG_FILE:+-DMBEDTLS_USER_CONFIG_FILE="$MBEDTLS_USER_CONFIG_FILE"} \ .. trap "" EXIT INT TERM HUP diff --git a/scripts/cmake-nng.sh b/scripts/cmake-nng.sh deleted file mode 100755 index 97680e68..00000000 --- a/scripts/cmake-nng.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -prefix="${1-$PWD}" -mkdir -p "$prefix" - -build=$PWD/nng/build -trap "rm -rf $build" EXIT INT TERM HUP - -rm -rf nng/build -mkdir nng/build -cd nng/build - -# TODO: -# -DCMAKE_BUILD_TYPE=$(LIB_BUILD) \ - -cmake \ - -DCMAKE_INSTALL_PREFIX="$prefix" \ - -DCMAKE_C_COMPILER="${CC:-cc}" \ - -DCMAKE_C_FLAGS="${CFLAGS}" \ - -DCMAKE_INSTALL_LIBDIR=lib \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DNNG_TESTS=OFF \ - .. - -trap "" EXIT INT TERM HUP diff --git a/scripts/evp-agent-generate-certificates.sh b/scripts/evp-agent-generate-certificates.sh deleted file mode 100755 index a5d224cd..00000000 --- a/scripts/evp-agent-generate-certificates.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -set -e - -CERTS=/etc/ssl/evp-agent -EVP_MQTT_TLS_CLIENT_CERT=${EVP_MQTT_TLS_CLIENT_CERT:-${CERTS}/client.crt} -EVP_MQTT_TLS_CLIENT_KEY=${EVP_MQTT_TLS_CLIENT_KEY:-${CERTS}/client.key} - -if ! [ -e ${EVP_MQTT_TLS_CLIENT_CERT} -a -e ${EVP_MQTT_TLS_CLIENT_KEY} ]; then - mkdir -p ${CERTS} - echo "TLS key not found. Will generate one for you." - openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 \ - -keyout ${EVP_MQTT_TLS_CLIENT_KEY} -out ${EVP_MQTT_TLS_CLIENT_CERT} \ - -subj "/C=ES/ST=Barcelona/L=Barcelona/O=Midokura/OU=EVP Device/CN=$(openssl rand -hex 16)" -else - echo "Identity files already exist: ${EVP_MQTT_TLS_CLIENT_CERT} and ${EVP_MQTT_TLS_CLIENT_KEY}" -fi - -echo "Certificate for \"$(openssl x509 -noout -subject -in ${EVP_MQTT_TLS_CLIENT_CERT})\":" -cat ${EVP_MQTT_TLS_CLIENT_CERT} -echo "Make sure it is added to the broker configuration." diff --git a/scripts/formatter-python.sh b/scripts/formatter-python.sh index 2af99b00..0725fd9b 100755 --- a/scripts/formatter-python.sh +++ b/scripts/formatter-python.sh @@ -30,7 +30,6 @@ EXCLUDE_NAMES="${EXCLUDE_NAMES},build" # Exclude submodules files EXCLUDE_NAMES="${EXCLUDE_NAMES},src/flatcc" EXCLUDE_NAMES="${EXCLUDE_NAMES},src/mbedtls" -EXCLUDE_NAMES="${EXCLUDE_NAMES},src/nng" EXCLUDE_NAMES="${EXCLUDE_NAMES},src/nuttx" EXCLUDE_NAMES="${EXCLUDE_NAMES},src/nuttx-apps" EXCLUDE_NAMES="${EXCLUDE_NAMES},src/wasm-micro-runtime" diff --git a/scripts/mk-agent-deb.sh b/scripts/mk-agent-deb.sh index 87cc26fa..216ad666 100755 --- a/scripts/mk-agent-deb.sh +++ b/scripts/mk-agent-deb.sh @@ -52,7 +52,7 @@ Section: contrib/misc Version: $version Priority: optional Architecture: $arch -Maintainer: Midokura +Maintainer: Sony Semiconductor Solutions Depends: libc6 (>= 2.35), ca-certificates Vcs-Browser: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform Vcs-Git: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform @@ -64,8 +64,8 @@ EOF cat > dist/DEBIAN/copyright < +Upstream-Contact: Sony Semiconductor Solutions +Source: Files: * Copyright: 2024 Sony Semiconductor Solutions Corporation diff --git a/scripts/mk-sbom b/scripts/mk-sbom index 070d8d67..7e20388c 100755 --- a/scripts/mk-sbom +++ b/scripts/mk-sbom @@ -127,7 +127,6 @@ apply_exceptions() s@(.*/src/flatcc/[^ ]*).*@\1 APACHE-2.0@ s@(.*/src/wasm-micro-runtime/.*/sandboxed-system-primitives/[^ ]*).*@\1 APACHE-2.0_WITH_LLVM-EXCEPTION@ s@(.*/src/wasm-micro-runtime/core/iwasm/include/wasm_c_api.h).*@\1 APACHE-2.0_WITH_LLVM-EXCEPTION@ - s@(.*/src/nng/[^ ]*).*@\1 MIT@ s@(/usr/include/[^ ]*).*@\1 LPGL-2.1-OR-LATER@ s@(/usr/lib/gcc/[^ ]*).*@\1 LPGL-2.1-OR-LATER@ s@(/usr/lib/linux/[^ ]*).*@\1 GPL-2.0_WITH_LINUX-SYSCALL-NOTE@ diff --git a/scripts/mk-sdk-deb.sh b/scripts/mk-sdk-deb.sh new file mode 100755 index 00000000..a607053e --- /dev/null +++ b/scripts/mk-sdk-deb.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +set -e + +arch=amd64 +version=0.0.0 + +usage() +{ + echo "usage: mk-sdk-deb [-a arch] [-V version]" >&2 + exit 1 +} + +while test $# -gt 0; do + case "$1" in + -a) + arch=${2?`usage`} + shift 2 + ;; + -V) + version=${2?`usage`} + shift 2 + ;; + *) + usage + ;; + esac +done + +rm -rf dist +trap "rm -rf dist $$.tmp" EXIT HUP INT TERM + +case $arch in +aarch64) + debarch=arm64 + ;; +x86_64) + debarch=amd64 + ;; +esac + +# create deb package +mkdir -p dist/DEBIAN + +cat > dist/DEBIAN/control < +Depends: libc6 (>= 2.35) +Recommends: evp-agent +Vcs-Browser: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform +Vcs-Git: https://github.com/SonySemiconductorSolutions/edge-virtualization-platform +Description: Software Development Kit for EVP applications + This package provides the required interfaces and libraries + to build EVP applications. +EOF + +cat > dist/DEBIAN/copyright < + +Files: * +Copyright: 2024 Sony Semiconductor Solutions Corporation +License: Apache-2.0 + +Files: src/flatcc +Copyright: 2015 Mikkel F. Jørgensen, dvide.com +License: Apache-2.0 + +Files: include/internal/queue.h +Copyright: (c) 1991, 1993 The Regents of the University of California. +License: BSD-3-Clause +EOF + +mkdir -p dist/usr/lib/$arch-linux-gnu +mkdir -p dist/usr/include/evp + +cp lib/libevp-app-sdk.a dist/usr/lib/$arch-linux-gnu/ +cp \ + include/evp/sdk_base.h\ + include/evp/sdk_blob_azure.h\ + include/evp/sdk_blob_evp.h\ + include/evp/sdk_blob.h\ + include/evp/sdk_blob_http_ext.h\ + include/evp/sdk_blob_http.h\ + include/evp/sdk.h\ + include/evp/sdk_sys.h\ + include/evp/sdk_types.h\ + dist/usr/include/evp/ + +dpkg-deb --build dist libevp-app-sdk-dev-${version}_$debarch.deb diff --git a/scripts/mkdeps.sh b/scripts/mkdeps.sh index 0666b0b2..65f39f67 100755 --- a/scripts/mkdeps.sh +++ b/scripts/mkdeps.sh @@ -30,18 +30,6 @@ then git submodule update --init --recursive src/mbedtls fi -# In the NuttX build, NNG is not built by us but is included and built -# by nuttx build system. In those cases, CONFIG_NETUTILS_NNG is selected, -# so we skip our build -if test "$CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS" = y && - test "$CONFIG_NETUTILS_NNG" != y -then - libs="$libs -lnng" - dirs="$dirs nng" - files="$files \$(LIBDIR)/libnng.a" - git submodule update --init src/nng -fi - # In the NuttX build, WAMR is not built by us but is included and built by # nuttx build system. In those cases, CONFIG_INTERPRETERS_WAMR is selected, # so we skip our build @@ -57,7 +45,7 @@ fi if test "$CONFIG_EVP_SDK_SOCKET" = y then libs="$libs -lflatccrt" - dirs="$dirs flatcc" + dirs="$dirs flatcc sdkenc" files="$files \$(LIBDIR)/libflatccrt.a" git submodule update --init src/flatcc fi diff --git a/scripts/rules.mk b/scripts/rules.mk index 798664f7..6d379936 100644 --- a/scripts/rules.mk +++ b/scripts/rules.mk @@ -7,7 +7,8 @@ all: # Macros related to the version of the agent -VERSION = 1.42.0 +VERSION = 1.43.0 +SDK_VERSION = 1.0.0 # Default value for configuration macros O = o @@ -198,6 +199,7 @@ distclean-dirs: FORCE ARCH=$(ARCH) \ CFLAGS='$(CFLAGS)' \ MBEDTLS_CFLAGS='$(MBEDTLS_CFLAGS)' \ + MBEDTLS_USER_CONFIG_FILE='$(MBEDTLS_USER_CONFIG_FILE)' \ $(SCRIPTDIR)/cmake-$*.sh $(PWD)/$(PROJECTDIR) %: %/build/Makefile FORCE diff --git a/sources.mk b/sources.mk index 95b8c447..1a3a38a8 100644 --- a/sources.mk +++ b/sources.mk @@ -179,7 +179,3 @@ endif ifeq ($(CONFIG_EVP_AGENT_MODULE_IMPL_DOCKER_RAW_CONTAINER_SPEC),y) CSRCS += container_spec.c endif - -ifeq ($(CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS),y) -CSRCS += stream/nng.c -endif diff --git a/src/Makefile b/src/Makefile index 5c053593..65da3f77 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,6 +12,7 @@ EVP_LIBS = \ DIRS = \ evp_agent\ libparson\ + sdkenc\ $(EVP_LIBS) include $(PROJECTDIR)/scripts/rules.mk @@ -32,8 +33,9 @@ libevp-agent: libevp-utils evp_agent: libevp-agent libevp-utils +sdkenc: flatcc + # cmake dependencies wasm-micro-runtime: wasm-micro-runtime/build/Makefile flatcc: flatcc/build/Makefile mbedtls: mbedtls/build/Makefile -nng: nng/build/Makefile diff --git a/src/libevp-agent/Kconfig b/src/libevp-agent/Kconfig index edd2e091..5c15fb70 100644 --- a/src/libevp-agent/Kconfig +++ b/src/libevp-agent/Kconfig @@ -36,7 +36,6 @@ config EXTERNALS_EVP_AGENT # * CONFIG_LIBM # * CONFIG_ARCH_MATH_H # * toolchain-provided math.h - # * CONFIG_LIBNEWLIBM (midokura/incubator-nuttx specific) # It's the responsibility of the user to enable one of them. # For JSON number serialization in parson diff --git a/src/libevp-agent/Kconfig.common b/src/libevp-agent/Kconfig.common index 606bb694..fdd16c0e 100644 --- a/src/libevp-agent/Kconfig.common +++ b/src/libevp-agent/Kconfig.common @@ -209,18 +209,6 @@ config EVP_BLOB_GET_UPLOAD_URL ---help--- Retrieve STP access token. -config EVP_AGENT_LOCAL_SDK_NNG_STREAMS - bool "Enables EVP_stream type nng on local SDK builds" - default n - ---help--- - This option allows the use of EVP_streams of type nng when local - SDK is enabled. When not set, calls to EVP_streamInputOpen or - EVP_streamOutputOpen shall return EVP_NOTSUP. This can help reduce - the additional memory footprint required by the nng library. - - Since nng is bundled separately from the agent on remote SDK - builds, this option does not affect builds using remote SDK builds. - config EVP_MODULE_INSTANCE_STOP_TIMEOUT int "Maximum time before force stopping spawed instance after stop request" depends on EVP_MODULE_IMPL_SPAWN diff --git a/src/libevp-agent/Makefile b/src/libevp-agent/Makefile index 2881f23a..8327ab23 100644 --- a/src/libevp-agent/Makefile +++ b/src/libevp-agent/Makefile @@ -156,7 +156,6 @@ obj-$(CONFIG_EVP_MODULE_IMPL_OBJ) += module_impl_obj.o obj-$(CONFIG_EVP_MODULE_IMPL_SPAWN) += module_impl_spawn.o module_instance_impl_spawn.o obj-$(CONFIG_EVP_MODULE_IMPL_PYTHON) += module_impl_python.o module_instance_impl_python.o obj-$(CONFIG_EVP_AGENT_MODULE_IMPL_DOCKER_RAW_CONTAINER_SPEC) += container_spec.o -obj-$(CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS) += stream/nng.o obj-$(CONFIG_EVP_TWINS_PERSISTENCE) += persist.o obj-$(CONFIG_EVP_TWINS_NO_PERSISTANCE) += nopersist.o diff --git a/src/libevp-agent/device_state.h b/src/libevp-agent/device_state.h index 2ecd1187..1be7a449 100644 --- a/src/libevp-agent/device_state.h +++ b/src/libevp-agent/device_state.h @@ -10,8 +10,6 @@ * @brief This function fills a @c JSON_Object with device state data, * as defined by the following JSON schema: * - * https://github.com/midokura/evp-onwire-schema/blob/main/schema/device-state.schema.json - * * @param o JSON object to fill with device state data. * * @return Returns 0 if successful, -1 otherwise. diff --git a/src/libevp-agent/docker.c b/src/libevp-agent/docker.c index ec6fcaaa..07ca8bfe 100644 --- a/src/libevp-agent/docker.c +++ b/src/libevp-agent/docker.c @@ -40,18 +40,16 @@ /* * Labels for docker containers. */ -#define EVP_LABEL_MANAGED "com.midokura.evp.managed-by-evp-agent" +#define EVP_LABEL_MANAGED "com.sss.evp.managed-by-evp-agent" /* - * XXX the filters is hardcoded because I don't want to implement - * url quoting. * - * >>> d={'label':['com.midokura.evp.managed-by-evp-agent']} + * >>> d={'label':['com.sss.evp.managed-by-evp-agent']} * >>> urllib.parse.quote(json.dumps(d)) - * '%7B%22label%22%3A%20%5B%22com.midokura.evp.managed-by-evp-agent%22%5D%7D' + * '%7B%22label%22%3A%20%5B%22com.sss.evp.managed-by-evp-agent%22%5D%7D' */ static const char *evp_label_managed_filters = - "%7B%22label%22%3A%20%5B%22com.midokura.evp.managed-by-evp-agent%22%" + "%7B%22label%22%3A%20%5B%22" EVP_LABEL_MANAGED "%22%" "5D%7D"; struct docker { @@ -417,7 +415,7 @@ docker_get_registry_auth_var_name(const char *fromImage) * for the image "xxx/yyy:zzz", * look at the "EVP_REGISTRY_AUTH_xxx" environment variable. * - * e.g. for the image "ghcr.io/midokura/sdktest:latest", + * e.g. for the image "ghcr.io/aaa/bbb:latest", * use "EVP_REGISTRY_AUTH_ghcr.io". * * REVISIT: maybe it's simpler to reject non-fully-qualified names. diff --git a/src/libevp-agent/evp_agent.c b/src/libevp-agent/evp_agent.c index 1ba9fd21..b1642279 100644 --- a/src/libevp-agent/evp_agent.c +++ b/src/libevp-agent/evp_agent.c @@ -188,6 +188,9 @@ evp_agent_start(struct evp_agent_context *ctxt) /* initialize the https singleton */ https_ssl_config_init(&ctxt->tls_context->https.ssl_conf); + /* initialize state len lock */ + xpthread_mutex_init(&g_evp_global.instance_states_lock); + /* Configure data directory paths */ path_init(getenv("EVP_DATA_DIR")); @@ -357,6 +360,7 @@ evp_agent_stop(struct evp_agent_context *ctxt) module_instance_deinit(); + xpthread_mutex_destroy(&g_evp_global.instance_states_lock); path_free(); deinit_local_twins_db(); module_log_cap_stop(); diff --git a/src/libevp-agent/global.h b/src/libevp-agent/global.h index ff1f791e..9c693b78 100644 --- a/src/libevp-agent/global.h +++ b/src/libevp-agent/global.h @@ -7,6 +7,7 @@ #include #include "path.h" +#include "xpthread.h" struct map; @@ -29,7 +30,8 @@ struct global { JSON_Value *desired; // shared attributes JSON_Value *current; // client attributes (our current state) JSON_Value *instance_states; // Module instance states - + size_t instance_states_len; + struct evp_lock instance_states_lock; /* * Reconcile status */ diff --git a/src/libevp-agent/manifest.c b/src/libevp-agent/manifest.c index b8f69096..165313a6 100644 --- a/src/libevp-agent/manifest.c +++ b/src/libevp-agent/manifest.c @@ -323,133 +323,6 @@ convert_topic_list(JSON_Object *o, struct TopicList **resultp) return ret; } -static int -get_nng_stream_mode(const JSON_Object *o, const struct Stream *stream, - struct StreamNng *snng) -{ - const char *mode = json_object_get_string(o, "mode"); - if (mode == NULL) { - xlog_error("could not find stream mode"); - return -1; - } - - if (!strcmp(mode, "dial")) { - if (stream->direction != STREAM_DIRECTION_OUT) { - xlog_error( - "dial mode can only work with output streams"); - return -1; - } - snng->mode = STREAM_NNG_MODE_DIAL; - } else if (!strcmp(mode, "listen")) { - if (stream->direction != STREAM_DIRECTION_IN) { - xlog_error("listen mode can only work with input " - "streams"); - return -1; - } - snng->mode = STREAM_NNG_MODE_LISTEN; - } else { - xlog_error("invalid stream mode %s", mode); - return -1; - } - - return 0; -} - -static int -get_nng_stream_protocol(const JSON_Object *o, const struct Stream *stream, - struct StreamNng *snng) -{ - const char *protocol = json_object_get_string(o, "protocol"); - if (protocol == NULL) { - xlog_error("could not find stream protocol"); - return EINVAL; - } - - if (!strcmp(protocol, "push")) { - if (stream->direction != STREAM_DIRECTION_OUT) { - xlog_error("push protocol can only work with output " - "streams"); - return EINVAL; - } - snng->protocol = STREAM_NNG_PROTOCOL_PUSH; - } else if (!strcmp(protocol, "pull")) { - if (stream->direction != STREAM_DIRECTION_IN) { - xlog_error("pull protocol can only work with input " - "streams"); - return EINVAL; - } - snng->protocol = STREAM_NNG_PROTOCOL_PULL; - } else { - xlog_error("invalid stream protocol %s", protocol); - return EINVAL; - } - - return 0; -} - -static int -get_nng_stream_connection(const JSON_Object *o, const struct Stream *stream, - struct StreamNng *snng) -{ - const char *connection = - json_object_get_string(o, "connection_string"); - if (connection == NULL) { - xlog_error("could not find stream connection string"); - return EINVAL; - } - - snng->connection = strdup(connection); - if (snng->connection == NULL) { - xlog_error("strdup(3) failed with errno %d", errno); - return ENOMEM; - } - - return 0; -} - -static int -convert_nng_stream(const JSON_Object *o, struct Stream *s) -{ - int ret = EINVAL; - const JSON_Value *v = json_object_get_value(o, "parameters"); - struct StreamNng snng = {0}; - - if (v == NULL) { - xlog_error("unexpected null parameters"); - goto end; - } - - const JSON_Object *nobj = json_value_get_object(v); - if (nobj == NULL) { - xlog_error("unexpected null parameters object"); - goto end; - } - - static int (*const params[])(const JSON_Object *, - const struct Stream *, - struct StreamNng *) = { - get_nng_stream_mode, get_nng_stream_protocol, - get_nng_stream_connection}; - - for (size_t i = 0; i < __arraycount(params); i++) { - ret = params[i](nobj, s, &snng); - if (ret != 0) { - goto end; - } - } - - s->type = STREAM_TYPE_NNG; - s->params.nng = snng; - ret = 0; - -end: - if (ret != 0) { - free(snng.connection); - } - - return ret; -} - static int get_posix_stream_hostname(const JSON_Object *o, const struct Stream *stream, struct StreamPosix *posix) @@ -611,12 +484,7 @@ convert_stream(const JSON_Object *o, const char *name, struct Stream *stream) goto end; } - if (!strcmp(type, "nng")) { - ret = convert_nng_stream(o, &s); - if (ret != 0) { - goto end; - } - } else if (!strcmp(type, "null")) { + if (!strcmp(type, "null")) { s.type = STREAM_TYPE_NULL; } else if (!strcmp(type, "posix")) { ret = convert_posix_stream(o, &s); diff --git a/src/libevp-agent/report_refresh.c b/src/libevp-agent/report_refresh.c index 7ebe8fe5..a409e2ae 100644 --- a/src/libevp-agent/report_refresh.c +++ b/src/libevp-agent/report_refresh.c @@ -127,6 +127,7 @@ report_refresh_instance_state(const struct evp_agent_context *agent, const struct evp_hub_context *hub, void *cb_data, intmax_t *qos, enum req_priority *priority) { + size_t len; JSON_Object *states_obj = json_value_get_object(g_evp_global.instance_states); bool *state_updated = cb_data; @@ -139,6 +140,12 @@ report_refresh_instance_state(const struct evp_agent_context *agent, sys_collect_states(agent->sys, convert_state, &args); *state_updated = args.states_updated; + len = json_serialization_size(g_evp_global.instance_states); + + xpthread_mutex_lock(&g_evp_global.instance_states_lock); + g_evp_global.instance_states_len = len; + xpthread_mutex_unlock(&g_evp_global.instance_states_lock); + *qos = 0; *priority = REQ_PRIORITY_LOW; return json_serialize_to_string(g_evp_global.instance_states); diff --git a/src/libevp-agent/sdk.c b/src/libevp-agent/sdk.c index e7450b36..fd3b1947 100644 --- a/src/libevp-agent/sdk.c +++ b/src/libevp-agent/sdk.c @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -990,12 +991,9 @@ EVP_impl_sendState(struct EVP_client *h, const void *rawbuf, const char *topic, void *userData) { EVP_RESULT ret; - char *name = NULL, *base64 = NULL; size_t len, base64len; bool needs_main_wakeup = false; struct sdk_event_state *state = NULL; - JSON_Value *v = NULL; - JSON_Object *o; /* * FIXME: We check that this new state inserted in the current object @@ -1005,30 +1003,15 @@ EVP_impl_sendState(struct EVP_client *h, const void *rawbuf, const char *topic, * The check is done using a base64 encoding because it is the worst * case between EVP1 and EVP2 way of encoding the state. */ - xasprintf(&name, "state/%s/%s", h->name, topic); - int iret = base64_encode(blob, bloblen, &base64, &base64len); - if (iret != 0) { - xlog_error("Failed to base64-encode blob of length %zu", - bloblen); - free(name); - return EVP_ERROR; - } - v = json_value_deep_copy(g_evp_global.instance_states); - if (v == NULL) { - ret = EVP_NOMEM; - goto end; - } - o = json_value_get_object(v); - if (o == NULL) { - ret = EVP_ERROR; - goto end; - } - if (json_object_set_string(o, name, base64) != JSONSuccess) { - ret = EVP_ERROR; - goto end; - } + base64len = 0; + len = snprintf(NULL, 0, "{ \"state/%s/%s\" : \"\" },\n", h->name, + topic); + mbedtls_base64_encode(NULL, 0, &base64len, blob, bloblen); + len += base64len; - len = json_serialization_size(v); + xpthread_mutex_lock(&g_evp_global.instance_states_lock); + len += g_evp_global.instance_states_len; + xpthread_mutex_unlock(&g_evp_global.instance_states_lock); if (g_mqtt_client == NULL) { ret = EVP_ERROR; @@ -1096,9 +1079,6 @@ EVP_impl_sendState(struct EVP_client *h, const void *rawbuf, const char *topic, ret = EVP_OK; sdk_unlock(); end: - free(base64); - free(name); - json_value_free(v); if (ret) { free(state); } diff --git a/src/libevp-agent/sdk_remote.c b/src/libevp-agent/sdk_remote.c index 3a5b6a5f..1a00c7f7 100644 --- a/src/libevp-agent/sdk_remote.c +++ b/src/libevp-agent/sdk_remote.c @@ -6,6 +6,9 @@ #include #include +#include +#include +#include #include #include @@ -16,9 +19,6 @@ #include "main_loop.h" #include "module_instance.h" #include "sdk_impl.h" -#include "sdkenc/sdk_builder.h" -#include "sdkenc/sdk_reader.h" -#include "sdkenc/sdk_verifier.h" #include "xlog.h" #include "xpthread.h" @@ -752,35 +752,6 @@ add_null_stream_params(const struct Stream *stream, flatcc_builder_t *b) return 0; } -static int -add_nng_stream_params(const struct Stream *stream, flatcc_builder_t *b) -{ - const struct StreamNng *nng = &stream->params.nng; - flatbuffers_ref_t connection = 0; - - connection = flatcc_builder_create_string_str(b, nng->connection); - if (connection == 0) { - xlog_error("flatcc_builder_create_string_str failed"); - return -1; - } - - EVP_SDK_StreamNng_ref_t ref = - ns(StreamNng_create(b, nng->mode, nng->protocol, connection)); - if (ref == 0) { - xlog_warning("StreamNng_create failed"); - return -1; - } - - int error = ns(StreamParamsResponse_params_nng_add(b, ref)); - if (error != 0) { - xlog_warning("StreamParamsResponse_params_add failed: %s", - flatcc_verify_error_string(error)); - return -1; - } - - return 0; -} - static int add_stream_params(const struct Stream *stream, flatcc_builder_t *b) { @@ -801,7 +772,6 @@ add_stream_params(const struct Stream *stream, flatcc_builder_t *b) static int (*const f[])(const struct Stream *, flatcc_builder_t *) = { [STREAM_TYPE_NULL] = add_null_stream_params, - [STREAM_TYPE_NNG] = add_nng_stream_params, }; return f[stream->type](stream, b); diff --git a/src/libevp-agent/sdkenc/Makefile b/src/libevp-agent/sdkenc/Makefile deleted file mode 100644 index fe13adde..00000000 --- a/src/libevp-agent/sdkenc/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -GENERATED_HEADERS=sdk_reader.h -GENERATED_HEADERS+=sdk_builder.h -GENERATED_HEADERS+=sdk_verifier.h -GENERATED_HEADERS+=flatbuffers_common_reader.h -GENERATED_HEADERS+=flatbuffers_common_builder.h - -FLATCC=flatcc - -all: $(GENERATED_HEADERS) -.PHONY: all - -$(GENERATED_HEADERS): sdk.fbs - $(FLATCC) \ - -a \ - --json-printer \ - $< - -_clean: - rm -f $(GENERATED_HEADERS) -.PHONY: _clean diff --git a/src/libevp-agent/sdkenc/decode/Makefile b/src/libevp-agent/sdkenc/decode/Makefile deleted file mode 100644 index e589aef2..00000000 --- a/src/libevp-agent/sdkenc/decode/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation -# -# SPDX-License-Identifier: Apache-2.0 - -FLATCC = ../flatcc -FLATCC_INCLUDE = $(FLATCC)/include -FLATCC_LIB = $(FLATCC)/lib - -PROGNAME = decode - -CSRCS = decode.c -COBJS = $(CSRCS:.c=.o) - -CFLAGS += -I.. -I$(FLATCC_INCLUDE) -CFLAGS += -Os -CFLAGS += -Wall -CFLAGS += -Werror - -LIBS += -L$(FLATCC_LIB) -lflatccrt - -all: $(PROGNAME) - -clean: - rm -rf $(PROGNAME) - rm -rf $(COBJS) - -$(PROGNAME): $(COBJS) - $(CC) $(CLINKFLAGS) -o $@ $(COBJS) $(LIBS) - -$(COBJS): %.o: %.c - $(CC) $(CFLAGS) -c -o $@ $< - -# See issue: EVP-551 -# -# an equivalent with flatc: -# printf "%s" "CAAAAAAAAADY////AQAAAAQAAADs////jBh4YQAAAACEvdMNAAAAAAgAFAAEAAwACAAMAAQACAA=" | openssl enc -a -A -d > req.bin -# flatc --json --raw-binary --root-type Request ../sdk.fbs -- req.bin -# cat req.json -test: $(PROGNAME) - printf "%s" "CAAAAAAAAADY////AQAAAAQAAADs////jBh4YQAAAACEvdMNAAAAAAgAFAAEAAwACAAMAAQACAA=" | openssl enc -a -A -d | ./$(PROGNAME) request - printf "%s" "BAAAAOz///8BAAAABAAAAPz///8EAAQACAAMAAQACAA=" | openssl enc -a -A -d | ./$(PROGNAME) response diff --git a/src/libevp-agent/sdkenc/decode/decode.c b/src/libevp-agent/sdkenc/decode/decode.c deleted file mode 100644 index 049e48c2..00000000 --- a/src/libevp-agent/sdkenc/decode/decode.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include - -#include "sdk_json_printer.h" -#include "sdk_verifier.h" - -#undef ns -#define ns(a) FLATBUFFERS_WRAP_NAMESPACE(EVP_SDK, a) - -void -malloc_and_read_stdin(void **bufp, size_t *sizep) -{ - const size_t chunksize = 1024; - char *buf = NULL; - size_t bufsize = 0; - size_t offset = 0; - ssize_t n; - - do { - if (offset == bufsize) { - bufsize += chunksize; - buf = realloc(buf, bufsize); - // TODO: Replace assert (runtime error) - assert(buf != NULL); - } - n = read(STDIN_FILENO, buf + offset, bufsize - offset); - // TODO: Replace assert (runtime error) - assert(n >= 0); - offset += n; - } while (n > 0); - - *bufp = buf; - *sizep = offset; -} - -int -main(int argc, char *argv[]) -{ - enum type { - REQUEST, - RESPONSE, - } type; - - if (argc != 2) { - exit(2); - } - if (!strcmp(argv[1], "request")) { - type = REQUEST; - } else if (!strcmp(argv[1], "response")) { - type = RESPONSE; - } else { - exit(2); - } - - void *buffer; - size_t n; - malloc_and_read_stdin(&buffer, &n); - - /* verify flatbuffers */ - - int ret; - switch (type) { - case REQUEST: - ret = ns(Request_verify_as_root(buffer, n)); - break; - case RESPONSE: - ret = ns(Response_verify_as_root(buffer, n)); - break; - default: - exit(1); - } - if (ret != 0) { - printf("verify failed: %s\n", flatcc_verify_error_string(ret)); - exit(1); - } - - /* flatbuffers -> json */ - - flatcc_json_printer_t ctx0, *ctx = &ctx0; - flatcc_json_printer_init(ctx, stdout); - switch (type) { - case REQUEST: - ns(Request_print_json_as_root(ctx, buffer, n, NULL)); - break; - case RESPONSE: - ns(Response_print_json_as_root(ctx, buffer, n, NULL)); - break; - default: - exit(1); - } - flatcc_json_printer_flush(ctx); - if (flatcc_json_printer_get_error(ctx)) { - printf("failed to json print\n"); - } - printf("\n"); -} diff --git a/src/libevp-agent/sdkenc/flatbuffers_common_builder.h b/src/libevp-agent/sdkenc/flatbuffers_common_builder.h deleted file mode 100644 index a4eab755..00000000 --- a/src/libevp-agent/sdkenc/flatbuffers_common_builder.h +++ /dev/null @@ -1,691 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef FLATBUFFERS_COMMON_BUILDER_H -#define FLATBUFFERS_COMMON_BUILDER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -/* Common FlatBuffers build functionality for C. */ - -#include "flatcc/flatcc_prologue.h" -#ifndef FLATBUILDER_H -#include "flatcc/flatcc_builder.h" -#endif -typedef flatcc_builder_t flatbuffers_builder_t; -typedef flatcc_builder_ref_t flatbuffers_ref_t; -typedef flatcc_builder_ref_t flatbuffers_vec_ref_t; -typedef flatcc_builder_union_ref_t flatbuffers_union_ref_t; -typedef flatcc_builder_union_vec_ref_t flatbuffers_union_vec_ref_t; -/* integer return code (ref and ptr always fail on 0) */ -#define flatbuffers_failed(x) ((x) < 0) -typedef flatbuffers_ref_t flatbuffers_root_t; -#define flatbuffers_root(ref) ((flatbuffers_root_t)(ref)) - -#define __flatbuffers_memoize_begin(B, src)\ -do { flatcc_builder_ref_t _ref; if ((_ref = flatcc_builder_refmap_find((B), (src)))) return _ref; } while (0) -#define __flatbuffers_memoize_end(B, src, op) do { return flatcc_builder_refmap_insert((B), (src), (op)); } while (0) -#define __flatbuffers_memoize(B, src, op) do { __flatbuffers_memoize_begin(B, src); __flatbuffers_memoize_end(B, src, op); } while (0) - -#define __flatbuffers_build_buffer(NS)\ -typedef NS ## ref_t NS ## buffer_ref_t;\ -static inline int NS ## buffer_start(NS ## builder_t *B, const NS ##fid_t fid)\ -{ return flatcc_builder_start_buffer(B, fid, 0, 0); }\ -static inline int NS ## buffer_start_with_size(NS ## builder_t *B, const NS ##fid_t fid)\ -{ return flatcc_builder_start_buffer(B, fid, 0, flatcc_builder_with_size); }\ -static inline int NS ## buffer_start_aligned(NS ## builder_t *B, NS ##fid_t fid, uint16_t block_align)\ -{ return flatcc_builder_start_buffer(B, fid, block_align, 0); }\ -static inline int NS ## buffer_start_aligned_with_size(NS ## builder_t *B, NS ##fid_t fid, uint16_t block_align)\ -{ return flatcc_builder_start_buffer(B, fid, block_align, flatcc_builder_with_size); }\ -static inline NS ## buffer_ref_t NS ## buffer_end(NS ## builder_t *B, NS ## ref_t root)\ -{ return flatcc_builder_end_buffer(B, root); } - -#define __flatbuffers_build_table_root(NS, N, FID, TFID)\ -static inline int N ## _start_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, FID) ? -1 : N ## _start(B); }\ -static inline int N ## _start_as_root_with_size(NS ## builder_t *B)\ -{ return NS ## buffer_start_with_size(B, FID) ? -1 : N ## _start(B); }\ -static inline int N ## _start_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, TFID) ? -1 : N ## _start(B); }\ -static inline int N ## _start_as_typed_root_with_size(NS ## builder_t *B)\ -{ return NS ## buffer_start_with_size(B, TFID) ? -1 : N ## _start(B); }\ -static inline NS ## buffer_ref_t N ## _end_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end(B)); }\ -static inline NS ## buffer_ref_t N ## _end_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end(B)); }\ -static inline NS ## buffer_ref_t N ## _create_as_root(NS ## builder_t *B __ ## N ## _formal_args)\ -{ if (NS ## buffer_start(B, FID)) return 0; return NS ## buffer_end(B, N ## _create(B __ ## N ## _call_args)); }\ -static inline NS ## buffer_ref_t N ## _create_as_root_with_size(NS ## builder_t *B __ ## N ## _formal_args)\ -{ if (NS ## buffer_start_with_size(B, FID)) return 0; return NS ## buffer_end(B, N ## _create(B __ ## N ## _call_args)); }\ -static inline NS ## buffer_ref_t N ## _create_as_typed_root(NS ## builder_t *B __ ## N ## _formal_args)\ -{ if (NS ## buffer_start(B, TFID)) return 0; return NS ## buffer_end(B, N ## _create(B __ ## N ## _call_args)); }\ -static inline NS ## buffer_ref_t N ## _create_as_typed_root_with_size(NS ## builder_t *B __ ## N ## _formal_args)\ -{ if (NS ## buffer_start_with_size(B, TFID)) return 0; return NS ## buffer_end(B, N ## _create(B __ ## N ## _call_args)); }\ -static inline NS ## buffer_ref_t N ## _clone_as_root(NS ## builder_t *B, N ## _table_t t)\ -{ if (NS ## buffer_start(B, FID)) return 0; return NS ## buffer_end(B, N ## _clone(B, t)); }\ -static inline NS ## buffer_ref_t N ## _clone_as_root_with_size(NS ## builder_t *B, N ## _table_t t)\ -{ if (NS ## buffer_start_with_size(B, FID)) return 0; return NS ## buffer_end(B, N ## _clone(B, t)); }\ -static inline NS ## buffer_ref_t N ## _clone_as_typed_root(NS ## builder_t *B, N ## _table_t t)\ -{ if (NS ## buffer_start(B, TFID)) return 0;return NS ## buffer_end(B, N ## _clone(B, t)); }\ -static inline NS ## buffer_ref_t N ## _clone_as_typed_root_with_size(NS ## builder_t *B, N ## _table_t t)\ -{ if (NS ## buffer_start_with_size(B, TFID)) return 0; return NS ## buffer_end(B, N ## _clone(B, t)); } - -#define __flatbuffers_build_table_prolog(NS, N, FID, TFID)\ -__flatbuffers_build_table_vector_ops(NS, N ## _vec, N)\ -__flatbuffers_build_table_root(NS, N, FID, TFID) - -#define __flatbuffers_build_struct_root(NS, N, A, FID, TFID)\ -static inline N ## _t *N ## _start_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, FID) ? 0 : N ## _start(B); }\ -static inline N ## _t *N ## _start_as_root_with_size(NS ## builder_t *B)\ -{ return NS ## buffer_start_with_size(B, FID) ? 0 : N ## _start(B); }\ -static inline N ## _t *N ## _start_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, TFID) ? 0 : N ## _start(B); }\ -static inline N ## _t *N ## _start_as_typed_root_with_size(NS ## builder_t *B)\ -{ return NS ## buffer_start_with_size(B, TFID) ? 0 : N ## _start(B); }\ -static inline NS ## buffer_ref_t N ## _end_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end(B)); }\ -static inline NS ## buffer_ref_t N ## _end_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end(B)); }\ -static inline NS ## buffer_ref_t N ## _end_pe_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end_pe(B)); }\ -static inline NS ## buffer_ref_t N ## _end_pe_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_end(B, N ## _end_pe(B)); }\ -static inline NS ## buffer_ref_t N ## _create_as_root(NS ## builder_t *B __ ## N ## _formal_args)\ -{ return flatcc_builder_create_buffer(B, FID, 0,\ - N ## _create(B __ ## N ## _call_args), A, 0); }\ -static inline NS ## buffer_ref_t N ## _create_as_root_with_size(NS ## builder_t *B __ ## N ## _formal_args)\ -{ return flatcc_builder_create_buffer(B, FID, 0,\ - N ## _create(B __ ## N ## _call_args), A, flatcc_builder_with_size); }\ -static inline NS ## buffer_ref_t N ## _create_as_typed_root(NS ## builder_t *B __ ## N ## _formal_args)\ -{ return flatcc_builder_create_buffer(B, TFID, 0,\ - N ## _create(B __ ## N ## _call_args), A, 0); }\ -static inline NS ## buffer_ref_t N ## _create_as_typed_root_with_size(NS ## builder_t *B __ ## N ## _formal_args)\ -{ return flatcc_builder_create_buffer(B, TFID, 0,\ - N ## _create(B __ ## N ## _call_args), A, flatcc_builder_with_size); }\ -static inline NS ## buffer_ref_t N ## _clone_as_root(NS ## builder_t *B, N ## _struct_t p)\ -{ return flatcc_builder_create_buffer(B, FID, 0, N ## _clone(B, p), A, 0); }\ -static inline NS ## buffer_ref_t N ## _clone_as_root_with_size(NS ## builder_t *B, N ## _struct_t p)\ -{ return flatcc_builder_create_buffer(B, FID, 0, N ## _clone(B, p), A, flatcc_builder_with_size); }\ -static inline NS ## buffer_ref_t N ## _clone_as_typed_root(NS ## builder_t *B, N ## _struct_t p)\ -{ return flatcc_builder_create_buffer(B, TFID, 0, N ## _clone(B, p), A, 0); }\ -static inline NS ## buffer_ref_t N ## _clone_as_typed_root_with_size(NS ## builder_t *B, N ## _struct_t p)\ -{ return flatcc_builder_create_buffer(B, TFID, 0, N ## _clone(B, p), A, flatcc_builder_with_size); } - -#define __flatbuffers_build_nested_table_root(NS, N, TN, FID, TFID)\ -static inline int N ## _start_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, FID) ? -1 : TN ## _start(B); }\ -static inline int N ## _start_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, TFID) ? -1 : TN ## _start(B); }\ -static inline int N ## _end_as_root(NS ## builder_t *B)\ -{ return N ## _add(B, NS ## buffer_end(B, TN ## _end(B))); }\ -static inline int N ## _end_as_typed_root(NS ## builder_t *B)\ -{ return N ## _add(B, NS ## buffer_end(B, TN ## _end(B))); }\ -static inline int N ## _nest(NS ## builder_t *B, void *data, size_t size, uint16_t align)\ -{ return N ## _add(B, flatcc_builder_create_vector(B, data, size, 1,\ - align ? align : 8, FLATBUFFERS_COUNT_MAX(1))); }\ -static inline int N ## _typed_nest(NS ## builder_t *B, void *data, size_t size, uint16_t align)\ -{ return N ## _add(B, flatcc_builder_create_vector(B, data, size, 1,\ - align ? align : 8, FLATBUFFERS_COUNT_MAX(1))); }\ -static inline int N ## _clone_as_root(NS ## builder_t *B, TN ## _table_t t)\ -{ return N ## _add(B, TN ## _clone_as_root(B, t)); }\ -static inline int N ## _clone_as_typed_root(NS ## builder_t *B, TN ## _table_t t)\ -{ return N ## _add(B, TN ## _clone_as_typed_root(B, t)); } - -#define __flatbuffers_build_nested_struct_root(NS, N, TN, A, FID, TFID)\ -static inline TN ## _t *N ## _start_as_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, FID) ? 0 : TN ## _start(B); }\ -static inline TN ## _t *N ## _start_as_typed_root(NS ## builder_t *B)\ -{ return NS ## buffer_start(B, FID) ? 0 : TN ## _start(B); }\ -static inline int N ## _end_as_root(NS ## builder_t *B)\ -{ return N ## _add(B, NS ## buffer_end(B, TN ## _end(B))); }\ -static inline int N ## _end_as_typed_root(NS ## builder_t *B)\ -{ return N ## _add(B, NS ## buffer_end(B, TN ## _end(B))); }\ -static inline int N ## _end_pe_as_root(NS ## builder_t *B)\ -{ return N ## _add(B, NS ## buffer_end(B, TN ## _end_pe(B))); }\ -static inline int N ## _create_as_root(NS ## builder_t *B __ ## TN ## _formal_args)\ -{ return N ## _add(B, flatcc_builder_create_buffer(B, FID, 0,\ - TN ## _create(B __ ## TN ## _call_args), A, flatcc_builder_is_nested)); }\ -static inline int N ## _create_as_typed_root(NS ## builder_t *B __ ## TN ## _formal_args)\ -{ return N ## _add(B, flatcc_builder_create_buffer(B, TFID, 0,\ - TN ## _create(B __ ## TN ## _call_args), A, flatcc_builder_is_nested)); }\ -static inline int N ## _nest(NS ## builder_t *B, void *data, size_t size, uint16_t align)\ -{ return N ## _add(B, flatcc_builder_create_vector(B, data, size, 1,\ - align < A ? A : align, FLATBUFFERS_COUNT_MAX(1))); }\ -static inline int N ## _typed_nest(NS ## builder_t *B, void *data, size_t size, uint16_t align)\ -{ return N ## _add(B, flatcc_builder_create_vector(B, data, size, 1,\ - align < A ? A : align, FLATBUFFERS_COUNT_MAX(1))); }\ -static inline int N ## _clone_as_root(NS ## builder_t *B, TN ## _struct_t p)\ -{ return N ## _add(B, TN ## _clone_as_root(B, p)); }\ -static inline int N ## _clone_as_typed_root(NS ## builder_t *B, TN ## _struct_t p)\ -{ return N ## _add(B, TN ## _clone_as_typed_root(B, p)); } - -#define __flatbuffers_build_vector_ops(NS, V, N, TN, T)\ -static inline T *V ## _extend(NS ## builder_t *B, size_t len)\ -{ return (T *)flatcc_builder_extend_vector(B, len); }\ -static inline T *V ## _append(NS ## builder_t *B, const T *data, size_t len)\ -{ return (T *)flatcc_builder_append_vector(B, data, len); }\ -static inline int V ## _truncate(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_truncate_vector(B, len); }\ -static inline T *V ## _edit(NS ## builder_t *B)\ -{ return (T *)flatcc_builder_vector_edit(B); }\ -static inline size_t V ## _reserved_len(NS ## builder_t *B)\ -{ return flatcc_builder_vector_count(B); }\ -static inline T *V ## _push(NS ## builder_t *B, const T *p)\ -{ T *_p; return (_p = (T *)flatcc_builder_extend_vector(B, 1)) ? (memcpy(_p, p, TN ## __size()), _p) : 0; }\ -static inline T *V ## _push_copy(NS ## builder_t *B, const T *p)\ -{ T *_p; return (_p = (T *)flatcc_builder_extend_vector(B, 1)) ? TN ## _copy(_p, p) : 0; }\ -static inline T *V ## _push_clone(NS ## builder_t *B, const T *p)\ -{ T *_p; return (_p = (T *)flatcc_builder_extend_vector(B, 1)) ? TN ## _copy(_p, p) : 0; }\ -static inline T *V ## _push_create(NS ## builder_t *B __ ## TN ## _formal_args)\ -{ T *_p; return (_p = (T *)flatcc_builder_extend_vector(B, 1)) ? TN ## _assign(_p __ ## TN ## _call_args) : 0; } - -#define __flatbuffers_build_vector(NS, N, T, S, A)\ -typedef NS ## ref_t N ## _vec_ref_t;\ -static inline int N ## _vec_start(NS ## builder_t *B)\ -{ return flatcc_builder_start_vector(B, S, A, FLATBUFFERS_COUNT_MAX(S)); }\ -static inline N ## _vec_ref_t N ## _vec_end_pe(NS ## builder_t *B)\ -{ return flatcc_builder_end_vector(B); }\ -static inline N ## _vec_ref_t N ## _vec_end(NS ## builder_t *B)\ -{ if (!NS ## is_native_pe()) { size_t i, n; T *p = (T *)flatcc_builder_vector_edit(B);\ - for (i = 0, n = flatcc_builder_vector_count(B); i < n; ++i)\ - { N ## _to_pe(N ## __ptr_add(p, i)); }} return flatcc_builder_end_vector(B); }\ -static inline N ## _vec_ref_t N ## _vec_create_pe(NS ## builder_t *B, const T *data, size_t len)\ -{ return flatcc_builder_create_vector(B, data, len, S, A, FLATBUFFERS_COUNT_MAX(S)); }\ -static inline N ## _vec_ref_t N ## _vec_create(NS ## builder_t *B, const T *data, size_t len)\ -{ if (!NS ## is_native_pe()) { size_t i; T *p; int ret = flatcc_builder_start_vector(B, S, A, FLATBUFFERS_COUNT_MAX(S)); if (ret) { return ret; }\ - p = (T *)flatcc_builder_extend_vector(B, len); if (!p) return 0;\ - for (i = 0; i < len; ++i) { N ## _copy_to_pe(N ## __ptr_add(p, i), N ## __const_ptr_add(data, i)); }\ - return flatcc_builder_end_vector(B); } else return flatcc_builder_create_vector(B, data, len, S, A, FLATBUFFERS_COUNT_MAX(S)); }\ -static inline N ## _vec_ref_t N ## _vec_clone(NS ## builder_t *B, N ##_vec_t vec)\ -{ __flatbuffers_memoize(B, vec, flatcc_builder_create_vector(B, vec, N ## _vec_len(vec), S, A, FLATBUFFERS_COUNT_MAX(S))); }\ -static inline N ## _vec_ref_t N ## _vec_slice(NS ## builder_t *B, N ##_vec_t vec, size_t index, size_t len)\ -{ size_t n = N ## _vec_len(vec); if (index >= n) index = n; n -= index; if (len > n) len = n;\ - return flatcc_builder_create_vector(B, N ## __const_ptr_add(vec, index), len, S, A, FLATBUFFERS_COUNT_MAX(S)); }\ -__flatbuffers_build_vector_ops(NS, N ## _vec, N, N, T) - -#define __flatbuffers_build_union_vector_ops(NS, V, N, TN)\ -static inline TN ## _union_ref_t *V ## _extend(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_extend_union_vector(B, len); }\ -static inline TN ## _union_ref_t *V ## _append(NS ## builder_t *B, const TN ## _union_ref_t *data, size_t len)\ -{ return flatcc_builder_append_union_vector(B, data, len); }\ -static inline int V ## _truncate(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_truncate_union_vector(B, len); }\ -static inline TN ## _union_ref_t *V ## _edit(NS ## builder_t *B)\ -{ return (TN ## _union_ref_t *) flatcc_builder_union_vector_edit(B); }\ -static inline size_t V ## _reserved_len(NS ## builder_t *B)\ -{ return flatcc_builder_union_vector_count(B); }\ -static inline TN ## _union_ref_t *V ## _push(NS ## builder_t *B, const TN ## _union_ref_t ref)\ -{ return flatcc_builder_union_vector_push(B, ref); }\ -static inline TN ## _union_ref_t *V ## _push_clone(NS ## builder_t *B, TN ## _union_t u)\ -{ return TN ## _vec_push(B, TN ## _clone(B, u)); } - -#define __flatbuffers_build_union_vector(NS, N)\ -static inline int N ## _vec_start(NS ## builder_t *B)\ -{ return flatcc_builder_start_union_vector(B); }\ -static inline N ## _union_vec_ref_t N ## _vec_end(NS ## builder_t *B)\ -{ return flatcc_builder_end_union_vector(B); }\ -static inline N ## _union_vec_ref_t N ## _vec_create(NS ## builder_t *B, const N ## _union_ref_t *data, size_t len)\ -{ return flatcc_builder_create_union_vector(B, data, len); }\ -__flatbuffers_build_union_vector_ops(NS, N ## _vec, N, N)\ -/* Preserves DAG structure separately for type and value vector, so a type vector could be shared for many value vectors. */\ -static inline N ## _union_vec_ref_t N ## _vec_clone(NS ## builder_t *B, N ##_union_vec_t vec)\ -{ N ## _union_vec_ref_t _uvref, _ret = { 0, 0 }; NS ## union_ref_t _uref; size_t _i, _len;\ - if (vec.type == 0) return _ret;\ - _uvref.type = flatcc_builder_refmap_find(B, vec.type); _uvref.value = flatcc_builder_refmap_find(B, vec.value);\ - _len = N ## _union_vec_len(vec); if (_uvref.type == 0) {\ - _uvref.type = flatcc_builder_refmap_insert(B, vec.type, (flatcc_builder_create_type_vector(B, vec.type, _len))); }\ - if (_uvref.type == 0) return _ret; if (_uvref.value == 0) {\ - if (flatcc_builder_start_offset_vector(B)) return _ret;\ - for (_i = 0; _i < _len; ++_i) { _uref = N ## _clone(B, N ## _union_vec_at(vec, _i));\ - if (!_uref.value || !(flatcc_builder_offset_vector_push(B, _uref.value))) return _ret; }\ - _uvref.value = flatcc_builder_refmap_insert(B, vec.value, flatcc_builder_end_offset_vector(B));\ - if (_uvref.value == 0) return _ret; } return _uvref; } - -#define __flatbuffers_build_string_vector_ops(NS, N)\ -static inline int N ## _push_start(NS ## builder_t *B)\ -{ return NS ## string_start(B); }\ -static inline NS ## string_ref_t *N ## _push_end(NS ## builder_t *B)\ -{ return NS ## string_vec_push(B, NS ## string_end(B)); }\ -static inline NS ## string_ref_t *N ## _push_create(NS ## builder_t *B, const char *s, size_t len)\ -{ return NS ## string_vec_push(B, NS ## string_create(B, s, len)); }\ -static inline NS ## string_ref_t *N ## _push_create_str(NS ## builder_t *B, const char *s)\ -{ return NS ## string_vec_push(B, NS ## string_create_str(B, s)); }\ -static inline NS ## string_ref_t *N ## _push_create_strn(NS ## builder_t *B, const char *s, size_t max_len)\ -{ return NS ## string_vec_push(B, NS ## string_create_strn(B, s, max_len)); }\ -static inline NS ## string_ref_t *N ## _push_clone(NS ## builder_t *B, NS ## string_t string)\ -{ return NS ## string_vec_push(B, NS ## string_clone(B, string)); }\ -static inline NS ## string_ref_t *N ## _push_slice(NS ## builder_t *B, NS ## string_t string, size_t index, size_t len)\ -{ return NS ## string_vec_push(B, NS ## string_slice(B, string, index, len)); } - -#define __flatbuffers_build_table_vector_ops(NS, N, TN)\ -static inline int N ## _push_start(NS ## builder_t *B)\ -{ return TN ## _start(B); }\ -static inline TN ## _ref_t *N ## _push_end(NS ## builder_t *B)\ -{ return N ## _push(B, TN ## _end(B)); }\ -static inline TN ## _ref_t *N ## _push_create(NS ## builder_t *B __ ## TN ##_formal_args)\ -{ return N ## _push(B, TN ## _create(B __ ## TN ## _call_args)); } - -#define __flatbuffers_build_offset_vector_ops(NS, V, N, TN)\ -static inline TN ## _ref_t *V ## _extend(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_extend_offset_vector(B, len); }\ -static inline TN ## _ref_t *V ## _append(NS ## builder_t *B, const TN ## _ref_t *data, size_t len)\ -{ return flatcc_builder_append_offset_vector(B, data, len); }\ -static inline int V ## _truncate(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_truncate_offset_vector(B, len); }\ -static inline TN ## _ref_t *V ## _edit(NS ## builder_t *B)\ -{ return (TN ## _ref_t *)flatcc_builder_offset_vector_edit(B); }\ -static inline size_t V ## _reserved_len(NS ## builder_t *B)\ -{ return flatcc_builder_offset_vector_count(B); }\ -static inline TN ## _ref_t *V ## _push(NS ## builder_t *B, const TN ## _ref_t ref)\ -{ return ref ? flatcc_builder_offset_vector_push(B, ref) : 0; } - -#define __flatbuffers_build_offset_vector(NS, N)\ -typedef NS ## ref_t N ## _vec_ref_t;\ -static inline int N ## _vec_start(NS ## builder_t *B)\ -{ return flatcc_builder_start_offset_vector(B); }\ -static inline N ## _vec_ref_t N ## _vec_end(NS ## builder_t *B)\ -{ return flatcc_builder_end_offset_vector(B); }\ -static inline N ## _vec_ref_t N ## _vec_create(NS ## builder_t *B, const N ## _ref_t *data, size_t len)\ -{ return flatcc_builder_create_offset_vector(B, data, len); }\ -__flatbuffers_build_offset_vector_ops(NS, N ## _vec, N, N)\ -static inline N ## _vec_ref_t N ## _vec_clone(NS ## builder_t *B, N ##_vec_t vec)\ -{ int _ret; N ## _ref_t _e; size_t _i, _len; __flatbuffers_memoize_begin(B, vec);\ - _len = N ## _vec_len(vec); if (flatcc_builder_start_offset_vector(B)) return 0;\ - for (_i = 0; _i < _len; ++_i) { if (!(_e = N ## _clone(B, N ## _vec_at(vec, _i)))) return 0;\ - if (!flatcc_builder_offset_vector_push(B, _e)) return 0; }\ - __flatbuffers_memoize_end(B, vec, flatcc_builder_end_offset_vector(B)); }\ - -#define __flatbuffers_build_string_ops(NS, N)\ -static inline char *N ## _append(NS ## builder_t *B, const char *s, size_t len)\ -{ return flatcc_builder_append_string(B, s, len); }\ -static inline char *N ## _append_str(NS ## builder_t *B, const char *s)\ -{ return flatcc_builder_append_string_str(B, s); }\ -static inline char *N ## _append_strn(NS ## builder_t *B, const char *s, size_t len)\ -{ return flatcc_builder_append_string_strn(B, s, len); }\ -static inline size_t N ## _reserved_len(NS ## builder_t *B)\ -{ return flatcc_builder_string_len(B); }\ -static inline char *N ## _extend(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_extend_string(B, len); }\ -static inline char *N ## _edit(NS ## builder_t *B)\ -{ return flatcc_builder_string_edit(B); }\ -static inline int N ## _truncate(NS ## builder_t *B, size_t len)\ -{ return flatcc_builder_truncate_string(B, len); } - -#define __flatbuffers_build_string(NS)\ -typedef NS ## ref_t NS ## string_ref_t;\ -static inline int NS ## string_start(NS ## builder_t *B)\ -{ return flatcc_builder_start_string(B); }\ -static inline NS ## string_ref_t NS ## string_end(NS ## builder_t *B)\ -{ return flatcc_builder_end_string(B); }\ -static inline NS ## ref_t NS ## string_create(NS ## builder_t *B, const char *s, size_t len)\ -{ return flatcc_builder_create_string(B, s, len); }\ -static inline NS ## ref_t NS ## string_create_str(NS ## builder_t *B, const char *s)\ -{ return flatcc_builder_create_string_str(B, s); }\ -static inline NS ## ref_t NS ## string_create_strn(NS ## builder_t *B, const char *s, size_t len)\ -{ return flatcc_builder_create_string_strn(B, s, len); }\ -static inline NS ## string_ref_t NS ## string_clone(NS ## builder_t *B, NS ## string_t string)\ -{ __flatbuffers_memoize(B, string, flatcc_builder_create_string(B, string, NS ## string_len(string))); }\ -static inline NS ## string_ref_t NS ## string_slice(NS ## builder_t *B, NS ## string_t string, size_t index, size_t len)\ -{ size_t n = NS ## string_len(string); if (index >= n) index = n; n -= index; if (len > n) len = n;\ - return flatcc_builder_create_string(B, string + index, len); }\ -__flatbuffers_build_string_ops(NS, NS ## string)\ -__flatbuffers_build_offset_vector(NS, NS ## string) - -#define __flatbuffers_copy_from_pe(P, P2, N) (*(P) = N ## _read_from_pe(P2), (P)) -#define __flatbuffers_from_pe(P, N) (*(P) = N ## _read_from_pe(P), (P)) -#define __flatbuffers_copy_to_pe(P, P2, N) (N ## _write_to_pe((P), *(P2)), (P)) -#define __flatbuffers_to_pe(P, N) (N ## _write_to_pe((P), *(P)), (P)) -#define __flatbuffers_define_fixed_array_primitives(NS, N, T)\ -static inline T *N ## _array_copy(T *p, const T *p2, size_t n)\ -{ memcpy(p, p2, n * sizeof(T)); return p; }\ -static inline T *N ## _array_copy_from_pe(T *p, const T *p2, size_t n)\ -{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\ - for (i = 0; i < n; ++i) N ## _copy_from_pe(&p[i], &p2[i]); return p; }\ -static inline T *N ## _array_copy_to_pe(T *p, const T *p2, size_t n)\ -{ size_t i; if (NS ## is_native_pe()) memcpy(p, p2, n * sizeof(T)); else\ - for (i = 0; i < n; ++i) N ## _copy_to_pe(&p[i], &p2[i]); return p; } -#define __flatbuffers_define_scalar_primitives(NS, N, T)\ -static inline T *N ## _from_pe(T *p) { return __ ## NS ## from_pe(p, N); }\ -static inline T *N ## _to_pe(T *p) { return __ ## NS ## to_pe(p, N); }\ -static inline T *N ## _copy(T *p, const T *p2) { *p = *p2; return p; }\ -static inline T *N ## _copy_from_pe(T *p, const T *p2)\ -{ return __ ## NS ## copy_from_pe(p, p2, N); }\ -static inline T *N ## _copy_to_pe(T *p, const T *p2) \ -{ return __ ## NS ## copy_to_pe(p, p2, N); }\ -static inline T *N ## _assign(T *p, const T v0) { *p = v0; return p; }\ -static inline T *N ## _assign_from_pe(T *p, T v0)\ -{ *p = N ## _read_from_pe(&v0); return p; }\ -static inline T *N ## _assign_to_pe(T *p, T v0)\ -{ N ## _write_to_pe(p, v0); return p; } -#define __flatbuffers_build_scalar(NS, N, T)\ -__ ## NS ## define_scalar_primitives(NS, N, T)\ -__ ## NS ## define_fixed_array_primitives(NS, N, T)\ -__ ## NS ## build_vector(NS, N, T, sizeof(T), sizeof(T)) -/* Depends on generated copy_to/from_pe functions, and the type. */ -#define __flatbuffers_define_struct_primitives(NS, N)\ -static inline N ## _t *N ##_to_pe(N ## _t *p)\ -{ if (!NS ## is_native_pe()) { N ## _copy_to_pe(p, p); }; return p; }\ -static inline N ## _t *N ##_from_pe(N ## _t *p)\ -{ if (!NS ## is_native_pe()) { N ## _copy_from_pe(p, p); }; return p; }\ -static inline N ## _t *N ## _clear(N ## _t *p) { return (N ## _t *)memset(p, 0, N ## __size()); } - -/* Depends on generated copy/assign_to/from_pe functions, and the type. */ -#define __flatbuffers_build_struct(NS, N, S, A, FID, TFID)\ -__ ## NS ## define_struct_primitives(NS, N)\ -typedef NS ## ref_t N ## _ref_t;\ -static inline N ## _t *N ## _start(NS ## builder_t *B)\ -{ return (N ## _t *)flatcc_builder_start_struct(B, S, A); }\ -static inline N ## _ref_t N ## _end(NS ## builder_t *B)\ -{ if (!NS ## is_native_pe()) { N ## _to_pe((N ## _t *)flatcc_builder_struct_edit(B)); }\ - return flatcc_builder_end_struct(B); }\ -static inline N ## _ref_t N ## _end_pe(NS ## builder_t *B)\ -{ return flatcc_builder_end_struct(B); }\ -static inline N ## _ref_t N ## _create(NS ## builder_t *B __ ## N ## _formal_args)\ -{ N ## _t *_p = N ## _start(B); if (!_p) return 0; N ##_assign_to_pe(_p __ ## N ## _call_args);\ - return N ## _end_pe(B); }\ -static inline N ## _ref_t N ## _clone(NS ## builder_t *B, N ## _struct_t p)\ -{ N ## _t *_p; __flatbuffers_memoize_begin(B, p); _p = N ## _start(B); if (!_p) return 0;\ - N ## _copy(_p, p); __flatbuffers_memoize_end(B, p, N ##_end_pe(B)); }\ -__flatbuffers_build_vector(NS, N, N ## _t, S, A)\ -__flatbuffers_build_struct_root(NS, N, A, FID, TFID)\ - -#define __flatbuffers_struct_clear_field(p) memset((p), 0, sizeof(*(p))) -#define __flatbuffers_build_table(NS, N, K)\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return flatcc_builder_start_table(B, K); }\ -static inline N ## _ref_t N ## _end(NS ## builder_t *B)\ -{ FLATCC_ASSERT(flatcc_builder_check_required(B, __ ## N ## _required,\ - sizeof(__ ## N ## _required) / sizeof(__ ## N ## _required[0]) - 1));\ - return flatcc_builder_end_table(B); }\ -__flatbuffers_build_offset_vector(NS, N) - -#define __flatbuffers_build_table_field(ID, NS, N, TN, TT)\ -static inline int N ## _add(NS ## builder_t *B, TN ## _ref_t ref)\ -{ TN ## _ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ?\ - ((*_p = ref), 0) : -1; }\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return TN ## _start(B); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ return N ## _add(B, TN ## _end(B)); }\ -static inline TN ## _ref_t N ## _create(NS ## builder_t *B __ ## TN ##_formal_args)\ -{ return N ## _add(B, TN ## _create(B __ ## TN ## _call_args)); }\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _table_t p)\ -{ return N ## _add(B, TN ## _clone(B, p)); }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _table_t _p = N ## _get(t); return _p ? N ## _clone(B, _p) : 0; } - -#define __flatbuffers_build_union_field(ID, NS, N, TN, TT)\ -static inline int N ## _add(NS ## builder_t *B, TN ## _union_ref_t uref)\ -{ NS ## ref_t *_p; TN ## _union_type_t *_pt; if (uref.type == TN ## _NONE) return 0; if (uref.value == 0) return -1;\ - if (!(_pt = (TN ## _union_type_t *)flatcc_builder_table_add(B, ID - 1, sizeof(*_pt), sizeof(*_pt)))) return -1;\ - *_pt = uref.type; if (!(_p = flatcc_builder_table_add_offset(B, ID))) return -1; *_p = uref.value; return 0; }\ -static inline int N ## _add_type(NS ## builder_t *B, TN ## _union_type_t type)\ -{ TN ## _union_type_t *_pt; if (type == TN ## _NONE) return 0; return (_pt = (TN ## _union_type_t *)flatcc_builder_table_add(B, ID - 1,\ - sizeof(*_pt), sizeof(*_pt))) ? ((*_pt = type), 0) : -1; }\ -static inline int N ## _add_value(NS ## builder_t *B, TN ## _union_ref_t uref)\ -{ NS ## ref_t *p; if (uref.type == TN ## _NONE) return 0; return (p = flatcc_builder_table_add_offset(B, ID)) ?\ - ((*p = uref.value), 0) : -1; }\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _union_t p)\ -{ return N ## _add(B, TN ## _clone(B, p)); }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _union_t _p = N ## _union(t); return _p.type ? N ## _clone(B, _p) : 0; } - -/* M is the union value name and T is its type, i.e. the qualified name. */ -#define __flatbuffers_build_union_table_value_field(NS, N, NU, M, T)\ -static inline int N ## _ ## M ## _add(NS ## builder_t *B, T ## _ref_t ref)\ -{ return N ## _add(B, NU ## _as_ ## M (ref)); }\ -static inline int N ## _ ## M ## _start(NS ## builder_t *B)\ -{ return T ## _start(B); }\ -static inline int N ## _ ## M ## _end(NS ## builder_t *B)\ -{ T ## _ref_t ref = T ## _end(B);\ - return ref ? N ## _ ## M ## _add(B, ref) : -1; }\ -static inline int N ## _ ## M ## _create(NS ## builder_t *B __ ## T ##_formal_args)\ -{ T ## _ref_t ref = T ## _create(B __ ## T ## _call_args);\ - return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }\ -static inline int N ## _ ## M ## _clone(NS ## builder_t *B, T ## _table_t t)\ -{ T ## _ref_t ref = T ## _clone(B, t);\ - return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; } - -/* M is the union value name and T is its type, i.e. the qualified name. */ -#define __flatbuffers_build_union_struct_value_field(NS, N, NU, M, T)\ -static inline int N ## _ ## M ## _add(NS ## builder_t *B, T ## _ref_t ref)\ -{ return N ## _add(B, NU ## _as_ ## M (ref)); }\ -static inline T ## _t *N ## _ ## M ## _start(NS ## builder_t *B)\ -{ return T ## _start(B); }\ -static inline int N ## _ ## M ## _end(NS ## builder_t *B)\ -{ T ## _ref_t ref = T ## _end(B);\ - return ref ? N ## _ ## M ## _add(B, ref) : -1; }\ -static inline int N ## _ ## M ## _create(NS ## builder_t *B __ ## T ##_formal_args)\ -{ T ## _ref_t ref = T ## _create(B __ ## T ## _call_args);\ - return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }\ -static inline int N ## _ ## M ## _end_pe(NS ## builder_t *B)\ -{ T ## _ref_t ref = T ## _end_pe(B);\ - return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; }\ -static inline int N ## _ ## M ## _clone(NS ## builder_t *B, T ## _struct_t p)\ -{ T ## _ref_t ref = T ## _clone(B, p);\ - return ref ? N ## _add(B, NU ## _as_ ## M(ref)) : -1; } -#define __flatbuffers_build_union_string_value_field(NS, N, NU, M)\ -static inline int N ## _ ## M ## _add(NS ## builder_t *B, NS ## string_ref_t ref)\ -{ return N ## _add(B, NU ## _as_ ## M (ref)); }\ -__flatbuffers_build_string_field_ops(NS, N ## _ ## M) - -/* NS: common namespace, ID: table field id (not offset), TN: name of type T, TT: name of table type - * S: sizeof of scalar type, A: alignment of type T, default value V of type T. */ -#define __flatbuffers_build_scalar_field(ID, NS, N, TN, T, S, A, V, TT)\ -static inline int N ## _add(NS ## builder_t *B, const T v)\ -{ T *_p; if (v == V) return 0; if (!(_p = (T *)flatcc_builder_table_add(B, ID, S, A))) return -1;\ - TN ## _assign_to_pe(_p, v); return 0; }\ -static inline int N ## _force_add(NS ## builder_t *B, const T v)\ -{ T *_p; if (!(_p = (T *)flatcc_builder_table_add(B, ID, S, A))) return -1;\ - TN ## _assign_to_pe(_p, v); return 0; }\ -/* Clone does not skip default values and expects pe endian content. */\ -static inline int N ## _clone(NS ## builder_t *B, const T *p)\ -{ return 0 == flatcc_builder_table_add_copy(B, ID, p, S, A) ? -1 : 0; }\ -/* Transferring a missing field is a nop success with 0 as result. */\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ const T *_p = N ## _get_ptr(t); return _p ? N ## _clone(B, _p) : 0; } - -/* NS: common namespace, ID: table field id (not offset), TN: name of type T, TT: name of table type - * S: sizeof of scalar type, A: alignment of type T. */ -#define __flatbuffers_build_scalar_optional_field(ID, NS, N, TN, T, S, A, TT)\ -static inline int N ## _add(NS ## builder_t *B, const T v)\ -{ T *_p; if (!(_p = (T *)flatcc_builder_table_add(B, ID, S, A))) return -1;\ - TN ## _assign_to_pe(_p, v); return 0; }\ -/* Clone does not skip default values and expects pe endian content. */\ -static inline int N ## _clone(NS ## builder_t *B, const T *p)\ -{ return 0 == flatcc_builder_table_add_copy(B, ID, p, S, A) ? -1 : 0; }\ -/* Transferring a missing field is a nop success with 0 as result. */\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ const T *_p = N ## _get_ptr(t); return _p ? N ## _clone(B, _p) : 0; } - -#define __flatbuffers_build_struct_field(ID, NS, N, TN, S, A, TT)\ -static inline TN ## _t *N ## _start(NS ## builder_t *B)\ -{ return (TN ## _t *)flatcc_builder_table_add(B, ID, S, A); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ if (!NS ## is_native_pe()) { TN ## _to_pe((TN ## _t *)flatcc_builder_table_edit(B, S)); } return 0; }\ -static inline int N ## _end_pe(NS ## builder_t *B) { return 0; }\ -static inline int N ## _create(NS ## builder_t *B __ ## TN ## _formal_args)\ -{ TN ## _t *_p = N ## _start(B); if (!_p) return -1; TN ##_assign_to_pe(_p __ ## TN ## _call_args);\ - return 0; }\ -static inline int N ## _add(NS ## builder_t *B, const TN ## _t *p)\ -{ TN ## _t *_p = N ## _start(B); if (!_p) return -1; TN ##_copy_to_pe(_p, p); return 0; }\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _struct_t p)\ -{ return 0 == flatcc_builder_table_add_copy(B, ID, p, S, A) ? -1 : 0; }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _struct_t _p = N ## _get(t); return _p ? N ## _clone(B, _p) : 0; } - -#define __flatbuffers_build_vector_field(ID, NS, N, TN, T, TT)\ -static inline int N ## _add(NS ## builder_t *B, TN ## _vec_ref_t ref)\ -{ TN ## _vec_ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ? ((*_p = ref), 0) : -1; }\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return TN ## _vec_start(B); }\ -static inline int N ## _end_pe(NS ## builder_t *B)\ -{ return N ## _add(B, TN ## _vec_end_pe(B)); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ return N ## _add(B, TN ## _vec_end(B)); }\ -static inline int N ## _create_pe(NS ## builder_t *B, const T *data, size_t len)\ -{ return N ## _add(B, TN ## _vec_create_pe(B, data, len)); }\ -static inline int N ## _create(NS ## builder_t *B, const T *data, size_t len)\ -{ return N ## _add(B, TN ## _vec_create(B, data, len)); }\ -static inline int N ## _slice(NS ## builder_t *B, TN ## _vec_t vec, size_t index, size_t len)\ -{ return N ## _add(B, TN ## _vec_slice(B, vec, index, len)); }\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _vec_t vec)\ -{ return N ## _add(B, TN ## _vec_clone(B, vec)); }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _vec_t _p = N ## _get(t); return _p ? N ## _clone(B, _p) : 0; }\ -__flatbuffers_build_vector_ops(NS, N, N, TN, T)\ - -#define __flatbuffers_build_offset_vector_field(ID, NS, N, TN, TT)\ -static inline int N ## _add(NS ## builder_t *B, TN ## _vec_ref_t ref)\ -{ TN ## _vec_ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ? ((*_p = ref), 0) : -1; }\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return flatcc_builder_start_offset_vector(B); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ return N ## _add(B, flatcc_builder_end_offset_vector(B)); }\ -static inline int N ## _create(NS ## builder_t *B, const TN ## _ref_t *data, size_t len)\ -{ return N ## _add(B, flatcc_builder_create_offset_vector(B, data, len)); }\ -__flatbuffers_build_offset_vector_ops(NS, N, N, TN)\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _vec_t vec)\ -{ return N ## _add(B, TN ## _vec_clone(B, vec)); }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _vec_t _p = N ## _get(t); return _p ? N ## _clone(B, _p) : 0; } - -/* depends on N ## _add which differs for union member fields and ordinary fields */\ -#define __flatbuffers_build_string_field_ops(NS, N)\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return flatcc_builder_start_string(B); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ return N ## _add(B, flatcc_builder_end_string(B)); }\ -static inline int N ## _create(NS ## builder_t *B, const char *s, size_t len)\ -{ return N ## _add(B, flatcc_builder_create_string(B, s, len)); }\ -static inline int N ## _create_str(NS ## builder_t *B, const char *s)\ -{ return N ## _add(B, flatcc_builder_create_string_str(B, s)); }\ -static inline int N ## _create_strn(NS ## builder_t *B, const char *s, size_t max_len)\ -{ return N ## _add(B, flatcc_builder_create_string_strn(B, s, max_len)); }\ -static inline int N ## _clone(NS ## builder_t *B, NS ## string_t string)\ -{ return N ## _add(B, NS ## string_clone(B, string)); }\ -static inline int N ## _slice(NS ## builder_t *B, NS ## string_t string, size_t index, size_t len)\ -{ return N ## _add(B, NS ## string_slice(B, string, index, len)); }\ -__flatbuffers_build_string_ops(NS, N) - -#define __flatbuffers_build_string_field(ID, NS, N, TT)\ -static inline int N ## _add(NS ## builder_t *B, NS ## string_ref_t ref)\ -{ NS ## string_ref_t *_p; return (ref && (_p = flatcc_builder_table_add_offset(B, ID))) ? ((*_p = ref), 0) : -1; }\ -__flatbuffers_build_string_field_ops(NS, N)\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ NS ## string_t _p = N ## _get(t); return _p ? N ## _clone(B, _p) : 0; } - -#define __flatbuffers_build_table_vector_field(ID, NS, N, TN, TT)\ -__flatbuffers_build_offset_vector_field(ID, NS, N, TN, TT)\ -__flatbuffers_build_table_vector_ops(NS, N, TN) - -#define __flatbuffers_build_union_vector_field(ID, NS, N, TN, TT)\ -static inline int N ## _add(NS ## builder_t *B, TN ## _union_vec_ref_t uvref)\ -{ NS ## vec_ref_t *_p; if (!uvref.type || !uvref.value) return uvref.type == uvref.value ? 0 : -1;\ - if (!(_p = flatcc_builder_table_add_offset(B, ID - 1))) return -1; *_p = uvref.type;\ - if (!(_p = flatcc_builder_table_add_offset(B, ID))) return -1; *_p = uvref.value; return 0; }\ -static inline int N ## _start(NS ## builder_t *B)\ -{ return flatcc_builder_start_union_vector(B); }\ -static inline int N ## _end(NS ## builder_t *B)\ -{ return N ## _add(B, flatcc_builder_end_union_vector(B)); }\ -static inline int N ## _create(NS ## builder_t *B, const TN ## _union_ref_t *data, size_t len)\ -{ return N ## _add(B, flatcc_builder_create_union_vector(B, data, len)); }\ -__flatbuffers_build_union_vector_ops(NS, N, N, TN)\ -static inline int N ## _clone(NS ## builder_t *B, TN ## _union_vec_t vec)\ -{ return N ## _add(B, TN ## _vec_clone(B, vec)); }\ -static inline int N ## _pick(NS ## builder_t *B, TT ## _table_t t)\ -{ TN ## _union_vec_t _p = N ## _union(t); return _p.type ? N ## _clone(B, _p) : 0; } - -#define __flatbuffers_build_union_table_vector_value_field(NS, N, NU, M, T)\ -static inline int N ## _ ## M ## _push_start(NS ## builder_t *B)\ -{ return T ## _start(B); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M (T ## _end(B))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, T ## _ref_t ref)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B __ ## T ##_formal_args)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _create(B __ ## T ## _call_args))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_clone(NS ## builder_t *B, T ## _table_t t)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _clone(B, t))); } - -#define __flatbuffers_build_union_struct_vector_value_field(NS, N, NU, M, T)\ -static inline T ## _t *N ## _ ## M ## _push_start(NS ## builder_t *B)\ -{ return T ## _start(B); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M (T ## _end(B))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, T ## _ref_t ref)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B __ ## T ##_formal_args)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _create(B __ ## T ## _call_args))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_clone(NS ## builder_t *B, T ## _struct_t p)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(T ## _clone(B, p))); } - -#define __flatbuffers_build_union_string_vector_value_field(NS, N, NU, M)\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push(NS ## builder_t *B, NS ## string_ref_t ref)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M (ref)); }\ -static inline int N ## _ ## M ## _push_start(NS ## builder_t *B)\ -{ return NS ## string_start(B); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_end(NS ## builder_t *B)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_end(B))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_create(NS ## builder_t *B, const char *s, size_t len)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create(B, s, len))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_create_str(NS ## builder_t *B, const char *s)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create_str(B, s))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_create_strn(NS ## builder_t *B, const char *s, size_t max_len)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_create_strn(B, s, max_len))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_clone(NS ## builder_t *B, NS ## string_t string)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_clone(B, string))); }\ -static inline NU ## _union_ref_t *N ## _ ## M ## _push_slice(NS ## builder_t *B, NS ## string_t string, size_t index, size_t len)\ -{ return NU ## _vec_push(B, NU ## _as_ ## M(NS ## string_slice(B, string, index, len))); } - -#define __flatbuffers_build_string_vector_field(ID, NS, N, TT)\ -__flatbuffers_build_offset_vector_field(ID, NS, N, NS ## string, TT)\ -__flatbuffers_build_string_vector_ops(NS, N) - -#define __flatbuffers_char_formal_args , char v0 -#define __flatbuffers_char_call_args , v0 -#define __flatbuffers_uint8_formal_args , uint8_t v0 -#define __flatbuffers_uint8_call_args , v0 -#define __flatbuffers_int8_formal_args , int8_t v0 -#define __flatbuffers_int8_call_args , v0 -#define __flatbuffers_bool_formal_args , flatbuffers_bool_t v0 -#define __flatbuffers_bool_call_args , v0 -#define __flatbuffers_uint16_formal_args , uint16_t v0 -#define __flatbuffers_uint16_call_args , v0 -#define __flatbuffers_uint32_formal_args , uint32_t v0 -#define __flatbuffers_uint32_call_args , v0 -#define __flatbuffers_uint64_formal_args , uint64_t v0 -#define __flatbuffers_uint64_call_args , v0 -#define __flatbuffers_int16_formal_args , int16_t v0 -#define __flatbuffers_int16_call_args , v0 -#define __flatbuffers_int32_formal_args , int32_t v0 -#define __flatbuffers_int32_call_args , v0 -#define __flatbuffers_int64_formal_args , int64_t v0 -#define __flatbuffers_int64_call_args , v0 -#define __flatbuffers_float_formal_args , float v0 -#define __flatbuffers_float_call_args , v0 -#define __flatbuffers_double_formal_args , double v0 -#define __flatbuffers_double_call_args , v0 - -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_char, char) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_uint8, uint8_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_int8, int8_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_bool, flatbuffers_bool_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_uint16, uint16_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_uint32, uint32_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_uint64, uint64_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_int16, int16_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_int32, int32_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_int64, int64_t) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_float, float) -__flatbuffers_build_scalar(flatbuffers_, flatbuffers_double, double) - -__flatbuffers_build_string(flatbuffers_) - -__flatbuffers_build_buffer(flatbuffers_) -#include "flatcc/flatcc_epilogue.h" -#endif /* FLATBUFFERS_COMMON_BUILDER_H */ diff --git a/src/libevp-agent/sdkenc/flatbuffers_common_reader.h b/src/libevp-agent/sdkenc/flatbuffers_common_reader.h deleted file mode 100644 index b4e145a2..00000000 --- a/src/libevp-agent/sdkenc/flatbuffers_common_reader.h +++ /dev/null @@ -1,584 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef FLATBUFFERS_COMMON_READER_H -#define FLATBUFFERS_COMMON_READER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -/* Common FlatBuffers read functionality for C. */ - -#include "flatcc/flatcc_prologue.h" -#include "flatcc/flatcc_flatbuffers.h" - - -#define __flatbuffers_read_scalar_at_byteoffset(N, p, o) N ## _read_from_pe((uint8_t *)(p) + (o)) -#define __flatbuffers_read_scalar(N, p) N ## _read_from_pe(p) -#define __flatbuffers_read_vt(ID, offset, t)\ -flatbuffers_voffset_t offset = 0;\ -{ flatbuffers_voffset_t id__tmp, *vt__tmp;\ - FLATCC_ASSERT(t != 0 && "null pointer table access");\ - id__tmp = ID;\ - vt__tmp = (flatbuffers_voffset_t *)((uint8_t *)(t) -\ - __flatbuffers_soffset_read_from_pe(t));\ - if (__flatbuffers_voffset_read_from_pe(vt__tmp) >= sizeof(vt__tmp[0]) * (id__tmp + 3u)) {\ - offset = __flatbuffers_voffset_read_from_pe(vt__tmp + id__tmp + 2);\ - }\ -} -#define __flatbuffers_field_present(ID, t) { __flatbuffers_read_vt(ID, offset__tmp, t) return offset__tmp != 0; } -#define __flatbuffers_scalar_field(T, ID, t)\ -{\ - __flatbuffers_read_vt(ID, offset__tmp, t)\ - if (offset__tmp) {\ - return (const T *)((uint8_t *)(t) + offset__tmp);\ - }\ - return 0;\ -} -#define __flatbuffers_define_scalar_field(ID, N, NK, TK, T, V)\ -static inline T N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -{ __flatbuffers_read_vt(ID, offset__tmp, t__tmp)\ - return offset__tmp ? __flatbuffers_read_scalar_at_byteoffset(TK, t__tmp, offset__tmp) : V;\ -}\ -static inline T N ## _ ## NK(N ## _table_t t__tmp)\ -{ __flatbuffers_read_vt(ID, offset__tmp, t__tmp)\ - return offset__tmp ? __flatbuffers_read_scalar_at_byteoffset(TK, t__tmp, offset__tmp) : V;\ -}\ -static inline const T *N ## _ ## NK ## _get_ptr(N ## _table_t t__tmp)\ -__flatbuffers_scalar_field(T, ID, t__tmp)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__flatbuffers_field_present(ID, t__tmp)\ -__flatbuffers_define_scan_by_scalar_field(N, NK, T) -#define __flatbuffers_define_scalar_optional_field(ID, N, NK, TK, T, V)\ -__flatbuffers_define_scalar_field(ID, N, NK, TK, T, V)\ -static inline TK ## _option_t N ## _ ## NK ## _option(N ## _table_t t__tmp)\ -{ TK ## _option_t ret; __flatbuffers_read_vt(ID, offset__tmp, t__tmp)\ - ret.is_null = offset__tmp == 0; ret.value = offset__tmp ?\ - __flatbuffers_read_scalar_at_byteoffset(TK, t__tmp, offset__tmp) : V;\ - return ret; } -#define __flatbuffers_struct_field(T, ID, t, r)\ -{\ - __flatbuffers_read_vt(ID, offset__tmp, t)\ - if (offset__tmp) {\ - return (T)((uint8_t *)(t) + offset__tmp);\ - }\ - FLATCC_ASSERT(!(r) && "required field missing");\ - return 0;\ -} -#define __flatbuffers_offset_field(T, ID, t, r, adjust)\ -{\ - flatbuffers_uoffset_t *elem__tmp;\ - __flatbuffers_read_vt(ID, offset__tmp, t)\ - if (offset__tmp) {\ - elem__tmp = (flatbuffers_uoffset_t *)((uint8_t *)(t) + offset__tmp);\ - /* Add sizeof so C api can have raw access past header field. */\ - return (T)((uint8_t *)(elem__tmp) + adjust +\ - __flatbuffers_uoffset_read_from_pe(elem__tmp));\ - }\ - FLATCC_ASSERT(!(r) && "required field missing");\ - return 0;\ -} -#define __flatbuffers_vector_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, sizeof(flatbuffers_uoffset_t)) -#define __flatbuffers_table_field(T, ID, t, r) __flatbuffers_offset_field(T, ID, t, r, 0) -#define __flatbuffers_define_struct_field(ID, N, NK, T, r)\ -static inline T N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -__flatbuffers_struct_field(T, ID, t__tmp, r)\ -static inline T N ## _ ## NK(N ## _table_t t__tmp)\ -__flatbuffers_struct_field(T, ID, t__tmp, r)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__flatbuffers_field_present(ID, t__tmp) -#define __flatbuffers_define_vector_field(ID, N, NK, T, r)\ -static inline T N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -__flatbuffers_vector_field(T, ID, t__tmp, r)\ -static inline T N ## _ ## NK(N ## _table_t t__tmp)\ -__flatbuffers_vector_field(T, ID, t__tmp, r)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__flatbuffers_field_present(ID, t__tmp) -#define __flatbuffers_define_table_field(ID, N, NK, T, r)\ -static inline T N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -__flatbuffers_table_field(T, ID, t__tmp, r)\ -static inline T N ## _ ## NK(N ## _table_t t__tmp)\ -__flatbuffers_table_field(T, ID, t__tmp, r)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__flatbuffers_field_present(ID, t__tmp) -#define __flatbuffers_define_string_field(ID, N, NK, r)\ -static inline flatbuffers_string_t N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -__flatbuffers_vector_field(flatbuffers_string_t, ID, t__tmp, r)\ -static inline flatbuffers_string_t N ## _ ## NK(N ## _table_t t__tmp)\ -__flatbuffers_vector_field(flatbuffers_string_t, ID, t__tmp, r)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__flatbuffers_field_present(ID, t__tmp)\ -__flatbuffers_define_scan_by_string_field(N, NK) -#define __flatbuffers_vec_len(vec)\ -{ return (vec) ? (size_t)__flatbuffers_uoffset_read_from_pe((flatbuffers_uoffset_t *)vec - 1) : 0; } -#define __flatbuffers_string_len(s) __flatbuffers_vec_len(s) -static inline size_t flatbuffers_vec_len(const void *vec) -__flatbuffers_vec_len(vec) -#define __flatbuffers_scalar_vec_at(N, vec, i)\ -{ FLATCC_ASSERT(flatbuffers_vec_len(vec) > (i) && "index out of range");\ - return __flatbuffers_read_scalar(N, &(vec)[i]); } -#define __flatbuffers_struct_vec_at(vec, i)\ -{ FLATCC_ASSERT(flatbuffers_vec_len(vec) > (i) && "index out of range"); return (vec) + (i); } -/* `adjust` skips past the header for string vectors. */ -#define __flatbuffers_offset_vec_at(T, vec, i, adjust)\ -{ const flatbuffers_uoffset_t *elem__tmp = (vec) + (i);\ - FLATCC_ASSERT(flatbuffers_vec_len(vec) > (i) && "index out of range");\ - return (T)((uint8_t *)(elem__tmp) + (size_t)__flatbuffers_uoffset_read_from_pe(elem__tmp) + (adjust)); } -#define __flatbuffers_define_scalar_vec_len(N)\ -static inline size_t N ## _vec_len(N ##_vec_t vec__tmp)\ -{ return flatbuffers_vec_len(vec__tmp); } -#define __flatbuffers_define_scalar_vec_at(N, T) \ -static inline T N ## _vec_at(N ## _vec_t vec__tmp, size_t i__tmp)\ -__flatbuffers_scalar_vec_at(N, vec__tmp, i__tmp) -typedef const char *flatbuffers_string_t; -static inline size_t flatbuffers_string_len(flatbuffers_string_t s) -__flatbuffers_string_len(s) -typedef const flatbuffers_uoffset_t *flatbuffers_string_vec_t; -typedef flatbuffers_uoffset_t *flatbuffers_string_mutable_vec_t; -static inline size_t flatbuffers_string_vec_len(flatbuffers_string_vec_t vec) -__flatbuffers_vec_len(vec) -static inline flatbuffers_string_t flatbuffers_string_vec_at(flatbuffers_string_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(flatbuffers_string_t, vec, i, sizeof(vec[0])) -typedef const void *flatbuffers_generic_t; -typedef void *flatbuffers_mutable_generic_t; -static inline flatbuffers_string_t flatbuffers_string_cast_from_generic(const flatbuffers_generic_t p) -{ return p ? ((const char *)p) + __flatbuffers_uoffset__size() : 0; } -typedef const flatbuffers_uoffset_t *flatbuffers_generic_vec_t; -typedef flatbuffers_uoffset_t *flatbuffers_generic_table_mutable_vec_t; -static inline size_t flatbuffers_generic_vec_len(flatbuffers_generic_vec_t vec) -__flatbuffers_vec_len(vec) -static inline flatbuffers_generic_t flatbuffers_generic_vec_at(flatbuffers_generic_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(flatbuffers_generic_t, vec, i, 0) -static inline flatbuffers_generic_t flatbuffers_generic_vec_at_as_string(flatbuffers_generic_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(flatbuffers_generic_t, vec, i, sizeof(vec[0])) -typedef struct flatbuffers_union { - flatbuffers_union_type_t type; - flatbuffers_generic_t value; -} flatbuffers_union_t; -typedef struct flatbuffers_union_vec { - const flatbuffers_union_type_t *type; - const flatbuffers_uoffset_t *value; -} flatbuffers_union_vec_t; -typedef struct flatbuffers_mutable_union { - flatbuffers_union_type_t type; - flatbuffers_mutable_generic_t value; -} flatbuffers_mutable_union_t; -typedef struct flatbuffers_mutable_union_vec { - flatbuffers_union_type_t *type; - flatbuffers_uoffset_t *value; -} flatbuffers_mutable_union_vec_t; -static inline flatbuffers_mutable_union_t flatbuffers_mutable_union_cast(flatbuffers_union_t u__tmp)\ -{ flatbuffers_mutable_union_t mu = { u__tmp.type, (flatbuffers_mutable_generic_t)u__tmp.value };\ - return mu; } -static inline flatbuffers_mutable_union_vec_t flatbuffers_mutable_union_vec_cast(flatbuffers_union_vec_t uv__tmp)\ -{ flatbuffers_mutable_union_vec_t muv =\ - { (flatbuffers_union_type_t *)uv__tmp.type, (flatbuffers_uoffset_t *)uv__tmp.value }; return muv; } -#define __flatbuffers_union_type_field(ID, t)\ -{\ - __flatbuffers_read_vt(ID, offset__tmp, t)\ - return offset__tmp ? __flatbuffers_read_scalar_at_byteoffset(__flatbuffers_utype, t, offset__tmp) : 0;\ -} -static inline flatbuffers_string_t flatbuffers_string_cast_from_union(const flatbuffers_union_t u__tmp)\ -{ return flatbuffers_string_cast_from_generic(u__tmp.value); } -#define __flatbuffers_define_union_field(NS, ID, N, NK, T, r)\ -static inline T ## _union_type_t N ## _ ## NK ## _type_get(N ## _table_t t__tmp)\ -__## NS ## union_type_field(((ID) - 1), t__tmp)\ -static inline NS ## generic_t N ## _ ## NK ## _get(N ## _table_t t__tmp)\ -__## NS ## table_field(NS ## generic_t, ID, t__tmp, r)\ -static inline T ## _union_type_t N ## _ ## NK ## _type(N ## _table_t t__tmp)\ -__## NS ## union_type_field(((ID) - 1), t__tmp)\ -static inline NS ## generic_t N ## _ ## NK(N ## _table_t t__tmp)\ -__## NS ## table_field(NS ## generic_t, ID, t__tmp, r)\ -static inline int N ## _ ## NK ## _is_present(N ## _table_t t__tmp)\ -__## NS ## field_present(ID, t__tmp)\ -static inline T ## _union_t N ## _ ## NK ## _union(N ## _table_t t__tmp)\ -{ T ## _union_t u__tmp = { 0, 0 }; u__tmp.type = N ## _ ## NK ## _type_get(t__tmp);\ - if (u__tmp.type == 0) return u__tmp; u__tmp.value = N ## _ ## NK ## _get(t__tmp); return u__tmp; }\ -static inline NS ## string_t N ## _ ## NK ## _as_string(N ## _table_t t__tmp)\ -{ return NS ## string_cast_from_generic(N ## _ ## NK ## _get(t__tmp)); }\ - -#define __flatbuffers_define_union_vector_ops(NS, T)\ -static inline size_t T ## _union_vec_len(T ## _union_vec_t uv__tmp)\ -{ return NS ## vec_len(uv__tmp.type); }\ -static inline T ## _union_t T ## _union_vec_at(T ## _union_vec_t uv__tmp, size_t i__tmp)\ -{ T ## _union_t u__tmp = { 0, 0 }; size_t n__tmp = NS ## vec_len(uv__tmp.type);\ - FLATCC_ASSERT(n__tmp > (i__tmp) && "index out of range"); u__tmp.type = uv__tmp.type[i__tmp];\ - /* Unknown type is treated as NONE for schema evolution. */\ - if (u__tmp.type == 0) return u__tmp;\ - u__tmp.value = NS ## generic_vec_at(uv__tmp.value, i__tmp); return u__tmp; }\ -static inline NS ## string_t T ## _union_vec_at_as_string(T ## _union_vec_t uv__tmp, size_t i__tmp)\ -{ return (NS ## string_t) NS ## generic_vec_at_as_string(uv__tmp.value, i__tmp); }\ - -#define __flatbuffers_define_union_vector(NS, T)\ -typedef NS ## union_vec_t T ## _union_vec_t;\ -typedef NS ## mutable_union_vec_t T ## _mutable_union_vec_t;\ -static inline T ## _mutable_union_vec_t T ## _mutable_union_vec_cast(T ## _union_vec_t u__tmp)\ -{ return NS ## mutable_union_vec_cast(u__tmp); }\ -__## NS ## define_union_vector_ops(NS, T) -#define __flatbuffers_define_union(NS, T)\ -typedef NS ## union_t T ## _union_t;\ -typedef NS ## mutable_union_t T ## _mutable_union_t;\ -static inline T ## _mutable_union_t T ## _mutable_union_cast(T ## _union_t u__tmp)\ -{ return NS ## mutable_union_cast(u__tmp); }\ -__## NS ## define_union_vector(NS, T) -#define __flatbuffers_define_union_vector_field(NS, ID, N, NK, T, r)\ -__## NS ## define_vector_field(ID - 1, N, NK ## _type, T ## _vec_t, r)\ -__## NS ## define_vector_field(ID, N, NK, flatbuffers_generic_vec_t, r)\ -static inline T ## _union_vec_t N ## _ ## NK ## _union(N ## _table_t t__tmp)\ -{ T ## _union_vec_t uv__tmp; uv__tmp.type = N ## _ ## NK ## _type_get(t__tmp);\ - uv__tmp.value = N ## _ ## NK(t__tmp);\ - FLATCC_ASSERT(NS ## vec_len(uv__tmp.type) == NS ## vec_len(uv__tmp.value)\ - && "union vector type length mismatch"); return uv__tmp; } -#include -static const size_t flatbuffers_not_found = (size_t)-1; -static const size_t flatbuffers_end = (size_t)-1; -#define __flatbuffers_identity(n) (n) -#define __flatbuffers_min(a, b) ((a) < (b) ? (a) : (b)) -/* Subtraction doesn't work for unsigned types. */ -#define __flatbuffers_scalar_cmp(x, y, n) ((x) < (y) ? -1 : (x) > (y)) -static inline int __flatbuffers_string_n_cmp(flatbuffers_string_t v, const char *s, size_t n) -{ size_t nv = flatbuffers_string_len(v); int x = strncmp(v, s, nv < n ? nv : n); - return x != 0 ? x : nv < n ? -1 : nv > n; } -/* `n` arg unused, but needed by string find macro expansion. */ -static inline int __flatbuffers_string_cmp(flatbuffers_string_t v, const char *s, size_t n) { (void)n; return strcmp(v, s); } -/* A = identity if searching scalar vectors rather than key fields. */ -/* Returns lowest matching index or not_found. */ -#define __flatbuffers_find_by_field(A, V, E, L, K, Kn, T, D)\ -{ T v__tmp; size_t a__tmp = 0, b__tmp, m__tmp; if (!(b__tmp = L(V))) { return flatbuffers_not_found; }\ - --b__tmp;\ - while (a__tmp < b__tmp) {\ - m__tmp = a__tmp + ((b__tmp - a__tmp) >> 1);\ - v__tmp = A(E(V, m__tmp));\ - if ((D(v__tmp, (K), (Kn))) < 0) {\ - a__tmp = m__tmp + 1;\ - } else {\ - b__tmp = m__tmp;\ - }\ - }\ - if (a__tmp == b__tmp) {\ - v__tmp = A(E(V, a__tmp));\ - if (D(v__tmp, (K), (Kn)) == 0) {\ - return a__tmp;\ - }\ - }\ - return flatbuffers_not_found;\ -} -#define __flatbuffers_find_by_scalar_field(A, V, E, L, K, T)\ -__flatbuffers_find_by_field(A, V, E, L, K, 0, T, __flatbuffers_scalar_cmp) -#define __flatbuffers_find_by_string_field(A, V, E, L, K)\ -__flatbuffers_find_by_field(A, V, E, L, K, 0, flatbuffers_string_t, __flatbuffers_string_cmp) -#define __flatbuffers_find_by_string_n_field(A, V, E, L, K, Kn)\ -__flatbuffers_find_by_field(A, V, E, L, K, Kn, flatbuffers_string_t, __flatbuffers_string_n_cmp) -#define __flatbuffers_define_find_by_scalar_field(N, NK, TK)\ -static inline size_t N ## _vec_find_by_ ## NK(N ## _vec_t vec__tmp, TK key__tmp)\ -__flatbuffers_find_by_scalar_field(N ## _ ## NK, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, TK) -#define __flatbuffers_define_scalar_find(N, T)\ -static inline size_t N ## _vec_find(N ## _vec_t vec__tmp, T key__tmp)\ -__flatbuffers_find_by_scalar_field(__flatbuffers_identity, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T) -#define __flatbuffers_define_find_by_string_field(N, NK) \ -/* Note: find only works on vectors sorted by this field. */\ -static inline size_t N ## _vec_find_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp)\ -__flatbuffers_find_by_string_field(N ## _ ## NK, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp)\ -static inline size_t N ## _vec_find_n_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -__flatbuffers_find_by_string_n_field(N ## _ ## NK, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp, n__tmp) -#define __flatbuffers_define_default_find_by_scalar_field(N, NK, TK)\ -static inline size_t N ## _vec_find(N ## _vec_t vec__tmp, TK key__tmp)\ -{ return N ## _vec_find_by_ ## NK(vec__tmp, key__tmp); } -#define __flatbuffers_define_default_find_by_string_field(N, NK) \ -static inline size_t N ## _vec_find(N ## _vec_t vec__tmp, const char *s__tmp)\ -{ return N ## _vec_find_by_ ## NK(vec__tmp, s__tmp); }\ -static inline size_t N ## _vec_find_n(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -{ return N ## _vec_find_n_by_ ## NK(vec__tmp, s__tmp, n__tmp); } -/* A = identity if searching scalar vectors rather than key fields. */ -/* Returns lowest matching index or not_found. */ -#define __flatbuffers_scan_by_field(b, e, A, V, E, L, K, Kn, T, D)\ -{ T v__tmp; size_t i__tmp;\ - for (i__tmp = b; i__tmp < e; ++i__tmp) {\ - v__tmp = A(E(V, i__tmp));\ - if (D(v__tmp, (K), (Kn)) == 0) {\ - return i__tmp;\ - }\ - }\ - return flatbuffers_not_found;\ -} -#define __flatbuffers_rscan_by_field(b, e, A, V, E, L, K, Kn, T, D)\ -{ T v__tmp; size_t i__tmp = e;\ - while (i__tmp-- > b) {\ - v__tmp = A(E(V, i__tmp));\ - if (D(v__tmp, (K), (Kn)) == 0) {\ - return i__tmp;\ - }\ - }\ - return flatbuffers_not_found;\ -} -#define __flatbuffers_scan_by_scalar_field(b, e, A, V, E, L, K, T)\ -__flatbuffers_scan_by_field(b, e, A, V, E, L, K, 0, T, __flatbuffers_scalar_cmp) -#define __flatbuffers_scan_by_string_field(b, e, A, V, E, L, K)\ -__flatbuffers_scan_by_field(b, e, A, V, E, L, K, 0, flatbuffers_string_t, __flatbuffers_string_cmp) -#define __flatbuffers_scan_by_string_n_field(b, e, A, V, E, L, K, Kn)\ -__flatbuffers_scan_by_field(b, e, A, V, E, L, K, Kn, flatbuffers_string_t, __flatbuffers_string_n_cmp) -#define __flatbuffers_rscan_by_scalar_field(b, e, A, V, E, L, K, T)\ -__flatbuffers_rscan_by_field(b, e, A, V, E, L, K, 0, T, __flatbuffers_scalar_cmp) -#define __flatbuffers_rscan_by_string_field(b, e, A, V, E, L, K)\ -__flatbuffers_rscan_by_field(b, e, A, V, E, L, K, 0, flatbuffers_string_t, __flatbuffers_string_cmp) -#define __flatbuffers_rscan_by_string_n_field(b, e, A, V, E, L, K, Kn)\ -__flatbuffers_rscan_by_field(b, e, A, V, E, L, K, Kn, flatbuffers_string_t, __flatbuffers_string_n_cmp) -#define __flatbuffers_define_scan_by_scalar_field(N, NK, T)\ -static inline size_t N ## _vec_scan_by_ ## NK(N ## _vec_t vec__tmp, T key__tmp)\ -__flatbuffers_scan_by_scalar_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_scan_ex_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, T key__tmp)\ -__flatbuffers_scan_by_scalar_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_rscan_by_ ## NK(N ## _vec_t vec__tmp, T key__tmp)\ -__flatbuffers_rscan_by_scalar_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_rscan_ex_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, T key__tmp)\ -__flatbuffers_rscan_by_scalar_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T) -#define __flatbuffers_define_scalar_scan(N, T)\ -static inline size_t N ## _vec_scan(N ## _vec_t vec__tmp, T key__tmp)\ -__flatbuffers_scan_by_scalar_field(0, N ## _vec_len(vec__tmp), __flatbuffers_identity, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_scan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, T key__tmp)\ -__flatbuffers_scan_by_scalar_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), __flatbuffers_identity, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_rscan(N ## _vec_t vec__tmp, T key__tmp)\ -__flatbuffers_rscan_by_scalar_field(0, N ## _vec_len(vec__tmp), __flatbuffers_identity, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T)\ -static inline size_t N ## _vec_rscan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, T key__tmp)\ -__flatbuffers_rscan_by_scalar_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), __flatbuffers_identity, vec__tmp, N ## _vec_at, N ## _vec_len, key__tmp, T) -#define __flatbuffers_define_scan_by_string_field(N, NK) \ -static inline size_t N ## _vec_scan_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp)\ -__flatbuffers_scan_by_string_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp)\ -static inline size_t N ## _vec_scan_n_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -__flatbuffers_scan_by_string_n_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp, n__tmp)\ -static inline size_t N ## _vec_scan_ex_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp)\ -__flatbuffers_scan_by_string_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp)\ -static inline size_t N ## _vec_scan_ex_n_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp, size_t n__tmp)\ -__flatbuffers_scan_by_string_n_field(begin__tmp, __flatbuffers_min( end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp, n__tmp)\ -static inline size_t N ## _vec_rscan_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp)\ -__flatbuffers_rscan_by_string_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp)\ -static inline size_t N ## _vec_rscan_n_by_ ## NK(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -__flatbuffers_rscan_by_string_n_field(0, N ## _vec_len(vec__tmp), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp, n__tmp)\ -static inline size_t N ## _vec_rscan_ex_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp)\ -__flatbuffers_rscan_by_string_field(begin__tmp, __flatbuffers_min(end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp)\ -static inline size_t N ## _vec_rscan_ex_n_by_ ## NK(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp, size_t n__tmp)\ -__flatbuffers_rscan_by_string_n_field(begin__tmp, __flatbuffers_min( end__tmp, N ## _vec_len(vec__tmp)), N ## _ ## NK ## _get, vec__tmp, N ## _vec_at, N ## _vec_len, s__tmp, n__tmp) -#define __flatbuffers_define_default_scan_by_scalar_field(N, NK, TK)\ -static inline size_t N ## _vec_scan(N ## _vec_t vec__tmp, TK key__tmp)\ -{ return N ## _vec_scan_by_ ## NK(vec__tmp, key__tmp); }\ -static inline size_t N ## _vec_scan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, TK key__tmp)\ -{ return N ## _vec_scan_ex_by_ ## NK(vec__tmp, begin__tmp, end__tmp, key__tmp); }\ -static inline size_t N ## _vec_rscan(N ## _vec_t vec__tmp, TK key__tmp)\ -{ return N ## _vec_rscan_by_ ## NK(vec__tmp, key__tmp); }\ -static inline size_t N ## _vec_rscan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, TK key__tmp)\ -{ return N ## _vec_rscan_ex_by_ ## NK(vec__tmp, begin__tmp, end__tmp, key__tmp); } -#define __flatbuffers_define_default_scan_by_string_field(N, NK) \ -static inline size_t N ## _vec_scan(N ## _vec_t vec__tmp, const char *s__tmp)\ -{ return N ## _vec_scan_by_ ## NK(vec__tmp, s__tmp); }\ -static inline size_t N ## _vec_scan_n(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -{ return N ## _vec_scan_n_by_ ## NK(vec__tmp, s__tmp, n__tmp); }\ -static inline size_t N ## _vec_scan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp)\ -{ return N ## _vec_scan_ex_by_ ## NK(vec__tmp, begin__tmp, end__tmp, s__tmp); }\ -static inline size_t N ## _vec_scan_ex_n(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp, size_t n__tmp)\ -{ return N ## _vec_scan_ex_n_by_ ## NK(vec__tmp, begin__tmp, end__tmp, s__tmp, n__tmp); }\ -static inline size_t N ## _vec_rscan(N ## _vec_t vec__tmp, const char *s__tmp)\ -{ return N ## _vec_rscan_by_ ## NK(vec__tmp, s__tmp); }\ -static inline size_t N ## _vec_rscan_n(N ## _vec_t vec__tmp, const char *s__tmp, size_t n__tmp)\ -{ return N ## _vec_rscan_n_by_ ## NK(vec__tmp, s__tmp, n__tmp); }\ -static inline size_t N ## _vec_rscan_ex(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp)\ -{ return N ## _vec_rscan_ex_by_ ## NK(vec__tmp, begin__tmp, end__tmp, s__tmp); }\ -static inline size_t N ## _vec_rscan_ex_n(N ## _vec_t vec__tmp, size_t begin__tmp, size_t end__tmp, const char *s__tmp, size_t n__tmp)\ -{ return N ## _vec_rscan_ex_n_by_ ## NK(vec__tmp, begin__tmp, end__tmp, s__tmp, n__tmp); } -#define __flatbuffers_heap_sort(N, X, A, E, L, TK, TE, D, S)\ -static inline void __ ## N ## X ## __heap_sift_down(\ - N ## _mutable_vec_t vec__tmp, size_t start__tmp, size_t end__tmp)\ -{ size_t child__tmp, root__tmp; TK v1__tmp, v2__tmp, vroot__tmp;\ - root__tmp = start__tmp;\ - while ((root__tmp << 1) <= end__tmp) {\ - child__tmp = root__tmp << 1;\ - if (child__tmp < end__tmp) {\ - v1__tmp = A(E(vec__tmp, child__tmp));\ - v2__tmp = A(E(vec__tmp, child__tmp + 1));\ - if (D(v1__tmp, v2__tmp) < 0) {\ - child__tmp++;\ - }\ - }\ - vroot__tmp = A(E(vec__tmp, root__tmp));\ - v1__tmp = A(E(vec__tmp, child__tmp));\ - if (D(vroot__tmp, v1__tmp) < 0) {\ - S(vec__tmp, root__tmp, child__tmp, TE);\ - root__tmp = child__tmp;\ - } else {\ - return;\ - }\ - }\ -}\ -static inline void __ ## N ## X ## __heap_sort(N ## _mutable_vec_t vec__tmp)\ -{ size_t start__tmp, end__tmp, size__tmp;\ - size__tmp = L(vec__tmp); if (size__tmp == 0) return; end__tmp = size__tmp - 1; start__tmp = size__tmp >> 1;\ - do { __ ## N ## X ## __heap_sift_down(vec__tmp, start__tmp, end__tmp); } while (start__tmp--);\ - while (end__tmp > 0) { \ - S(vec__tmp, 0, end__tmp, TE);\ - __ ## N ## X ## __heap_sift_down(vec__tmp, 0, --end__tmp); } } -#define __flatbuffers_define_sort_by_field(N, NK, TK, TE, D, S)\ - __flatbuffers_heap_sort(N, _sort_by_ ## NK, N ## _ ## NK ## _get, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\ -static inline void N ## _vec_sort_by_ ## NK(N ## _mutable_vec_t vec__tmp)\ -{ __ ## N ## _sort_by_ ## NK ## __heap_sort(vec__tmp); } -#define __flatbuffers_define_sort(N, TK, TE, D, S)\ -__flatbuffers_heap_sort(N, , __flatbuffers_identity, N ## _vec_at, N ## _vec_len, TK, TE, D, S)\ -static inline void N ## _vec_sort(N ## _mutable_vec_t vec__tmp) { __ ## N ## __heap_sort(vec__tmp); } -#define __flatbuffers_scalar_diff(x, y) ((x) < (y) ? -1 : (x) > (y)) -#define __flatbuffers_string_diff(x, y) __flatbuffers_string_n_cmp((x), (const char *)(y), flatbuffers_string_len(y)) -#define __flatbuffers_value_swap(vec, a, b, TE) { TE x__tmp = vec[b]; vec[b] = vec[a]; vec[a] = x__tmp; } -#define __flatbuffers_uoffset_swap(vec, a, b, TE)\ -{ TE ta__tmp, tb__tmp, d__tmp;\ - d__tmp = (TE)((a - b) * sizeof(vec[0]));\ - ta__tmp = __flatbuffers_uoffset_read_from_pe(vec + b) - d__tmp;\ - tb__tmp = __flatbuffers_uoffset_read_from_pe(vec + a) + d__tmp;\ - __flatbuffers_uoffset_write_to_pe(vec + a, ta__tmp);\ - __flatbuffers_uoffset_write_to_pe(vec + b, tb__tmp); } -#define __flatbuffers_scalar_swap(vec, a, b, TE) __flatbuffers_value_swap(vec, a, b, TE) -#define __flatbuffers_string_swap(vec, a, b, TE) __flatbuffers_uoffset_swap(vec, a, b, TE) -#define __flatbuffers_struct_swap(vec, a, b, TE) __flatbuffers_value_swap(vec, a, b, TE) -#define __flatbuffers_table_swap(vec, a, b, TE) __flatbuffers_uoffset_swap(vec, a, b, TE) -#define __flatbuffers_define_struct_sort_by_scalar_field(N, NK, TK, TE)\ - __flatbuffers_define_sort_by_field(N, NK, TK, TE, __flatbuffers_scalar_diff, __flatbuffers_struct_swap) -#define __flatbuffers_define_table_sort_by_scalar_field(N, NK, TK)\ - __flatbuffers_define_sort_by_field(N, NK, TK, flatbuffers_uoffset_t, __flatbuffers_scalar_diff, __flatbuffers_table_swap) -#define __flatbuffers_define_table_sort_by_string_field(N, NK)\ - __flatbuffers_define_sort_by_field(N, NK, flatbuffers_string_t, flatbuffers_uoffset_t, __flatbuffers_string_diff, __flatbuffers_table_swap) -#define __flatbuffers_define_scalar_sort(N, T) __flatbuffers_define_sort(N, T, T, __flatbuffers_scalar_diff, __flatbuffers_scalar_swap) -#define __flatbuffers_define_string_sort() __flatbuffers_define_sort(flatbuffers_string, flatbuffers_string_t, flatbuffers_uoffset_t, __flatbuffers_string_diff, __flatbuffers_string_swap) -#define __flatbuffers_sort_vector_field(N, NK, T, t)\ -{ T ## _mutable_vec_t v__tmp = (T ## _mutable_vec_t) N ## _ ## NK ## _get(t);\ - if (v__tmp) T ## _vec_sort(v__tmp); } -#define __flatbuffers_sort_table_field(N, NK, T, t)\ -{ T ## _sort((T ## _mutable_table_t)N ## _ ## NK ## _get(t)); } -#define __flatbuffers_sort_union_field(N, NK, T, t)\ -{ T ## _sort(T ## _mutable_union_cast(N ## _ ## NK ## _union(t))); } -#define __flatbuffers_sort_table_vector_field_elements(N, NK, T, t)\ -{ T ## _vec_t v__tmp = N ## _ ## NK ## _get(t); size_t i__tmp, n__tmp;\ - n__tmp = T ## _vec_len(v__tmp); for (i__tmp = 0; i__tmp < n__tmp; ++i__tmp) {\ - T ## _sort((T ## _mutable_table_t)T ## _vec_at(v__tmp, i__tmp)); }} -#define __flatbuffers_sort_union_vector_field_elements(N, NK, T, t)\ -{ T ## _union_vec_t v__tmp = N ## _ ## NK ## _union(t); size_t i__tmp, n__tmp;\ - n__tmp = T ## _union_vec_len(v__tmp); for (i__tmp = 0; i__tmp < n__tmp; ++i__tmp) {\ - T ## _sort(T ## _mutable_union_cast(T ## _union_vec_at(v__tmp, i__tmp))); }} -#define __flatbuffers_define_scalar_vector(N, T)\ -typedef const T *N ## _vec_t;\ -typedef T *N ## _mutable_vec_t;\ -__flatbuffers_define_scalar_vec_len(N)\ -__flatbuffers_define_scalar_vec_at(N, T)\ -__flatbuffers_define_scalar_find(N, T)\ -__flatbuffers_define_scalar_scan(N, T)\ -__flatbuffers_define_scalar_sort(N, T) - -#define __flatbuffers_define_integer_type(N, T, W)\ -__flatcc_define_integer_accessors(N, T, W, flatbuffers_endian)\ -__flatbuffers_define_scalar_vector(N, T) -__flatbuffers_define_scalar_vector(flatbuffers_bool, flatbuffers_bool_t) -__flatbuffers_define_scalar_vector(flatbuffers_char, char) -__flatbuffers_define_scalar_vector(flatbuffers_uint8, uint8_t) -__flatbuffers_define_scalar_vector(flatbuffers_int8, int8_t) -__flatbuffers_define_scalar_vector(flatbuffers_uint16, uint16_t) -__flatbuffers_define_scalar_vector(flatbuffers_int16, int16_t) -__flatbuffers_define_scalar_vector(flatbuffers_uint32, uint32_t) -__flatbuffers_define_scalar_vector(flatbuffers_int32, int32_t) -__flatbuffers_define_scalar_vector(flatbuffers_uint64, uint64_t) -__flatbuffers_define_scalar_vector(flatbuffers_int64, int64_t) -__flatbuffers_define_scalar_vector(flatbuffers_float, float) -__flatbuffers_define_scalar_vector(flatbuffers_double, double) -__flatbuffers_define_scalar_vector(flatbuffers_union_type, flatbuffers_union_type_t) -static inline size_t flatbuffers_string_vec_find(flatbuffers_string_vec_t vec, const char *s) -__flatbuffers_find_by_string_field(__flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s) -static inline size_t flatbuffers_string_vec_find_n(flatbuffers_string_vec_t vec, const char *s, size_t n) -__flatbuffers_find_by_string_n_field(__flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s, n) -static inline size_t flatbuffers_string_vec_scan(flatbuffers_string_vec_t vec, const char *s) -__flatbuffers_scan_by_string_field(0, flatbuffers_string_vec_len(vec), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s) -static inline size_t flatbuffers_string_vec_scan_n(flatbuffers_string_vec_t vec, const char *s, size_t n) -__flatbuffers_scan_by_string_n_field(0, flatbuffers_string_vec_len(vec), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s, n) -static inline size_t flatbuffers_string_vec_scan_ex(flatbuffers_string_vec_t vec, size_t begin, size_t end, const char *s) -__flatbuffers_scan_by_string_field(begin, __flatbuffers_min(end, flatbuffers_string_vec_len(vec)), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s) -static inline size_t flatbuffers_string_vec_scan_ex_n(flatbuffers_string_vec_t vec, size_t begin, size_t end, const char *s, size_t n) -__flatbuffers_scan_by_string_n_field(begin, __flatbuffers_min(end, flatbuffers_string_vec_len(vec)), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s, n) -static inline size_t flatbuffers_string_vec_rscan(flatbuffers_string_vec_t vec, const char *s) -__flatbuffers_rscan_by_string_field(0, flatbuffers_string_vec_len(vec), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s) -static inline size_t flatbuffers_string_vec_rscan_n(flatbuffers_string_vec_t vec, const char *s, size_t n) -__flatbuffers_rscan_by_string_n_field(0, flatbuffers_string_vec_len(vec), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s, n) -static inline size_t flatbuffers_string_vec_rscan_ex(flatbuffers_string_vec_t vec, size_t begin, size_t end, const char *s) -__flatbuffers_rscan_by_string_field(begin, __flatbuffers_min(end, flatbuffers_string_vec_len(vec)), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s) -static inline size_t flatbuffers_string_vec_rscan_ex_n(flatbuffers_string_vec_t vec, size_t begin, size_t end, const char *s, size_t n) -__flatbuffers_rscan_by_string_n_field(begin, __flatbuffers_min(end, flatbuffers_string_vec_len(vec)), __flatbuffers_identity, vec, flatbuffers_string_vec_at, flatbuffers_string_vec_len, s, n) -__flatbuffers_define_string_sort() -#define __flatbuffers_define_struct_scalar_fixed_array_field(N, NK, TK, T, L)\ -static inline T N ## _ ## NK ## _get(N ## _struct_t t__tmp, size_t i__tmp)\ -{ if (!t__tmp || i__tmp >= L) return 0;\ - return __flatbuffers_read_scalar(TK, &(t__tmp->NK[i__tmp])); }\ -static inline const T *N ## _ ## NK ## _get_ptr(N ## _struct_t t__tmp)\ -{ return t__tmp ? t__tmp->NK : 0; }\ -static inline size_t N ## _ ## NK ## _get_len(void) { return L; }\ -static inline T N ## _ ## NK (N ## _struct_t t__tmp, size_t i__tmp)\ -{ return N ## _ ## NK ## _get(t__tmp, i__tmp); } -#define __flatbuffers_define_struct_struct_fixed_array_field(N, NK, T, L)\ -static inline T N ## _ ## NK ## _get(N ## _struct_t t__tmp, size_t i__tmp)\ -{ if (!t__tmp || i__tmp >= L) return 0; return t__tmp->NK + i__tmp; }static inline T N ## _ ## NK ## _get_ptr(N ## _struct_t t__tmp)\ -{ return t__tmp ? t__tmp->NK : 0; }\ -static inline size_t N ## _ ## NK ## _get_len(void) { return L; }\ -static inline T N ## _ ## NK(N ## _struct_t t__tmp, size_t i__tmp)\ -{ if (!t__tmp || i__tmp >= L) return 0; return t__tmp->NK + i__tmp; } -#define __flatbuffers_define_struct_scalar_field(N, NK, TK, T)\ -static inline T N ## _ ## NK ## _get(N ## _struct_t t__tmp)\ -{ return t__tmp ? __flatbuffers_read_scalar(TK, &(t__tmp->NK)) : 0; }\ -static inline const T *N ## _ ## NK ## _get_ptr(N ## _struct_t t__tmp)\ -{ return t__tmp ? &(t__tmp->NK) : 0; }\ -static inline T N ## _ ## NK (N ## _struct_t t__tmp)\ -{ return t__tmp ? __flatbuffers_read_scalar(TK, &(t__tmp->NK)) : 0; }\ -__flatbuffers_define_scan_by_scalar_field(N, NK, T) -#define __flatbuffers_define_struct_struct_field(N, NK, T)\ -static inline T N ## _ ## NK ## _get(N ## _struct_t t__tmp) { return t__tmp ? &(t__tmp->NK) : 0; }\ -static inline T N ## _ ## NK (N ## _struct_t t__tmp) { return t__tmp ? &(t__tmp->NK) : 0; } -/* If fid is null, the function returns true without testing as buffer is not expected to have any id. */ -static inline int flatbuffers_has_identifier(const void *buffer, const char *fid) -{ flatbuffers_thash_t id, id2 = 0; if (fid == 0) { return 1; }; - id2 = flatbuffers_type_hash_from_string(fid); - id = __flatbuffers_thash_read_from_pe(((flatbuffers_uoffset_t *)buffer) + 1); - return id2 == 0 || id == id2; } -static inline int flatbuffers_has_type_hash(const void *buffer, flatbuffers_thash_t thash) -{ return thash == 0 || (__flatbuffers_thash_read_from_pe((flatbuffers_uoffset_t *)buffer + 1) == thash); } - -static inline flatbuffers_thash_t flatbuffers_get_type_hash(const void *buffer) -{ return __flatbuffers_thash_read_from_pe((flatbuffers_uoffset_t *)buffer + 1); } - -#define flatbuffers_verify_endian() flatbuffers_has_identifier("\x00\x00\x00\x00" "1234", "1234") -static inline void *flatbuffers_read_size_prefix(void *b, size_t *size_out) -{ if (size_out) { *size_out = (size_t)__flatbuffers_uoffset_read_from_pe(b); } - return (uint8_t *)b + sizeof(flatbuffers_uoffset_t); } -/* Null file identifier accepts anything, otherwise fid should be 4 characters. */ -#define __flatbuffers_read_root(T, K, buffer, fid)\ - ((!buffer || !flatbuffers_has_identifier(buffer, fid)) ? 0 :\ - ((T ## _ ## K ## t)(((uint8_t *)buffer) +\ - __flatbuffers_uoffset_read_from_pe(buffer)))) -#define __flatbuffers_read_typed_root(T, K, buffer, thash)\ - ((!buffer || !flatbuffers_has_type_hash(buffer, thash)) ? 0 :\ - ((T ## _ ## K ## t)(((uint8_t *)buffer) +\ - __flatbuffers_uoffset_read_from_pe(buffer)))) -#define __flatbuffers_nested_buffer_as_root(C, N, T, K)\ -static inline T ## _ ## K ## t C ## _ ## N ## _as_root_with_identifier(C ## _ ## table_t t__tmp, const char *fid__tmp)\ -{ const uint8_t *buffer__tmp = C ## _ ## N(t__tmp); return __flatbuffers_read_root(T, K, buffer__tmp, fid__tmp); }\ -static inline T ## _ ## K ## t C ## _ ## N ## _as_typed_root(C ## _ ## table_t t__tmp)\ -{ const uint8_t *buffer__tmp = C ## _ ## N(t__tmp); return __flatbuffers_read_root(T, K, buffer__tmp, C ## _ ## type_identifier); }\ -static inline T ## _ ## K ## t C ## _ ## N ## _as_root(C ## _ ## table_t t__tmp)\ -{ const char *fid__tmp = T ## _file_identifier;\ - const uint8_t *buffer__tmp = C ## _ ## N(t__tmp); return __flatbuffers_read_root(T, K, buffer__tmp, fid__tmp); } -#define __flatbuffers_buffer_as_root(N, K)\ -static inline N ## _ ## K ## t N ## _as_root_with_identifier(const void *buffer__tmp, const char *fid__tmp)\ -{ return __flatbuffers_read_root(N, K, buffer__tmp, fid__tmp); }\ -static inline N ## _ ## K ## t N ## _as_root_with_type_hash(const void *buffer__tmp, flatbuffers_thash_t thash__tmp)\ -{ return __flatbuffers_read_typed_root(N, K, buffer__tmp, thash__tmp); }\ -static inline N ## _ ## K ## t N ## _as_root(const void *buffer__tmp)\ -{ const char *fid__tmp = N ## _file_identifier;\ - return __flatbuffers_read_root(N, K, buffer__tmp, fid__tmp); }\ -static inline N ## _ ## K ## t N ## _as_typed_root(const void *buffer__tmp)\ -{ return __flatbuffers_read_typed_root(N, K, buffer__tmp, N ## _type_hash); } -#define __flatbuffers_struct_as_root(N) __flatbuffers_buffer_as_root(N, struct_) -#define __flatbuffers_table_as_root(N) __flatbuffers_buffer_as_root(N, table_) - -#include "flatcc/flatcc_epilogue.h" -#endif /* FLATBUFFERS_COMMON_H */ diff --git a/src/libevp-agent/sdkenc/sdk_builder.h b/src/libevp-agent/sdkenc/sdk_builder.h deleted file mode 100644 index 01e946dd..00000000 --- a/src/libevp-agent/sdkenc/sdk_builder.h +++ /dev/null @@ -1,1384 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SDK_BUILDER_H -#define SDK_BUILDER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -#ifndef SDK_READER_H -#include "sdk_reader.h" -#endif -#ifndef FLATBUFFERS_COMMON_BUILDER_H -#include "flatbuffers_common_builder.h" -#endif -#include "flatcc/flatcc_prologue.h" -#ifndef flatbuffers_identifier -#define flatbuffers_identifier 0 -#endif -#ifndef flatbuffers_extension -#define flatbuffers_extension "bin" -#endif - -#define __EVP_SDK_StreamNngMode_formal_args , EVP_SDK_StreamNngMode_enum_t v0 -#define __EVP_SDK_StreamNngMode_call_args , v0 -__flatbuffers_build_scalar(flatbuffers_, EVP_SDK_StreamNngMode, EVP_SDK_StreamNngMode_enum_t) -#define __EVP_SDK_StreamNngProtocol_formal_args , EVP_SDK_StreamNngProtocol_enum_t v0 -#define __EVP_SDK_StreamNngProtocol_call_args , v0 -__flatbuffers_build_scalar(flatbuffers_, EVP_SDK_StreamNngProtocol, EVP_SDK_StreamNngProtocol_enum_t) -#define __EVP_SDK_StreamType_formal_args , EVP_SDK_StreamType_enum_t v0 -#define __EVP_SDK_StreamType_call_args , v0 -__flatbuffers_build_scalar(flatbuffers_, EVP_SDK_StreamType, EVP_SDK_StreamType_enum_t) -#define __EVP_SDK_StreamDirection_formal_args , EVP_SDK_StreamDirection_enum_t v0 -#define __EVP_SDK_StreamDirection_call_args , v0 -__flatbuffers_build_scalar(flatbuffers_, EVP_SDK_StreamDirection, EVP_SDK_StreamDirection_enum_t) - -typedef flatbuffers_union_ref_t EVP_SDK_BlobRequestUnion_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_BlobRequestUnion_union_vec_ref_t; -static EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestUnion_union_t t); -typedef flatbuffers_union_ref_t EVP_SDK_BlobResultUnion_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_BlobResultUnion_union_vec_ref_t; -static EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultUnion_union_t t); -typedef flatbuffers_union_ref_t EVP_SDK_EventBody_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_EventBody_union_vec_ref_t; -static EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_clone(flatbuffers_builder_t *B, EVP_SDK_EventBody_union_t t); -typedef flatbuffers_union_ref_t EVP_SDK_RequestUnion_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_RequestUnion_union_vec_ref_t; -static EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_clone(flatbuffers_builder_t *B, EVP_SDK_RequestUnion_union_t t); -typedef flatbuffers_union_ref_t EVP_SDK_ResponseUnion_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_ResponseUnion_union_vec_ref_t; -static EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_clone(flatbuffers_builder_t *B, EVP_SDK_ResponseUnion_union_t t); -typedef flatbuffers_union_ref_t EVP_SDK_StreamParams_union_ref_t; -typedef flatbuffers_union_vec_ref_t EVP_SDK_StreamParams_union_vec_ref_t; -static EVP_SDK_StreamParams_union_ref_t EVP_SDK_StreamParams_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParams_union_t t); - -static const flatbuffers_voffset_t __EVP_SDK_Config_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_Config_ref_t; -static EVP_SDK_Config_ref_t EVP_SDK_Config_clone(flatbuffers_builder_t *B, EVP_SDK_Config_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Config, 2) - -static const flatbuffers_voffset_t __EVP_SDK_StateInput_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_StateInput_ref_t; -static EVP_SDK_StateInput_ref_t EVP_SDK_StateInput_clone(flatbuffers_builder_t *B, EVP_SDK_StateInput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_StateInput, 4) - -static const flatbuffers_voffset_t __EVP_SDK_StateOutput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_StateOutput_ref_t; -static EVP_SDK_StateOutput_ref_t EVP_SDK_StateOutput_clone(flatbuffers_builder_t *B, EVP_SDK_StateOutput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_StateOutput, 3) - -static const flatbuffers_voffset_t __EVP_SDK_Exit_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_Exit_ref_t; -static EVP_SDK_Exit_ref_t EVP_SDK_Exit_clone(flatbuffers_builder_t *B, EVP_SDK_Exit_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Exit, 0) - -static const flatbuffers_voffset_t __EVP_SDK_BlobRequestAzureBlob_required[] = { 0, 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobRequestAzureBlob_ref_t; -static EVP_SDK_BlobRequestAzureBlob_ref_t EVP_SDK_BlobRequestAzureBlob_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestAzureBlob_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobRequestAzureBlob, 1) - -static const flatbuffers_voffset_t __EVP_SDK_BlobRequestEvp_required[] = { 0, 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobRequestEvp_ref_t; -static EVP_SDK_BlobRequestEvp_ref_t EVP_SDK_BlobRequestEvp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestEvp_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobRequestEvp, 2) - -static const flatbuffers_voffset_t __EVP_SDK_BlobRequestHttp_required[] = { 0, 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobRequestHttp_ref_t; -static EVP_SDK_BlobRequestHttp_ref_t EVP_SDK_BlobRequestHttp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestHttp_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobRequestHttp, 1) - -static const flatbuffers_voffset_t __EVP_SDK_BlobRequestHttpExt_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobRequestHttpExt_ref_t; -static EVP_SDK_BlobRequestHttpExt_ref_t EVP_SDK_BlobRequestHttpExt_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestHttpExt_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobRequestHttpExt, 2) - -static const flatbuffers_voffset_t __EVP_SDK_BlobInput_required[] = { 3, 4, 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobInput_ref_t; -static EVP_SDK_BlobInput_ref_t EVP_SDK_BlobInput_clone(flatbuffers_builder_t *B, EVP_SDK_BlobInput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobInput, 7) - -static const flatbuffers_voffset_t __EVP_SDK_BlobResultAzureBlob_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobResultAzureBlob_ref_t; -static EVP_SDK_BlobResultAzureBlob_ref_t EVP_SDK_BlobResultAzureBlob_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultAzureBlob_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobResultAzureBlob, 3) - -static const flatbuffers_voffset_t __EVP_SDK_BlobResultEvp_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobResultEvp_ref_t; -static EVP_SDK_BlobResultEvp_ref_t EVP_SDK_BlobResultEvp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultEvp_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobResultEvp, 3) - -static const flatbuffers_voffset_t __EVP_SDK_BlobResultHttp_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobResultHttp_ref_t; -static EVP_SDK_BlobResultHttp_ref_t EVP_SDK_BlobResultHttp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultHttp_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobResultHttp, 3) - -static const flatbuffers_voffset_t __EVP_SDK_BlobResultHttpExt_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobResultHttpExt_ref_t; -static EVP_SDK_BlobResultHttpExt_ref_t EVP_SDK_BlobResultHttpExt_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultHttpExt_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobResultHttpExt, 3) - -static const flatbuffers_voffset_t __EVP_SDK_BlobOutput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_BlobOutput_ref_t; -static EVP_SDK_BlobOutput_ref_t EVP_SDK_BlobOutput_clone(flatbuffers_builder_t *B, EVP_SDK_BlobOutput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_BlobOutput, 5) - -static const flatbuffers_voffset_t __EVP_SDK_MessageSentInput_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_MessageSentInput_ref_t; -static EVP_SDK_MessageSentInput_ref_t EVP_SDK_MessageSentInput_clone(flatbuffers_builder_t *B, EVP_SDK_MessageSentInput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_MessageSentInput, 4) - -static const flatbuffers_voffset_t __EVP_SDK_MessageSentOutput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_MessageSentOutput_ref_t; -static EVP_SDK_MessageSentOutput_ref_t EVP_SDK_MessageSentOutput_clone(flatbuffers_builder_t *B, EVP_SDK_MessageSentOutput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_MessageSentOutput, 3) - -static const flatbuffers_voffset_t __EVP_SDK_MessageReceived_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_MessageReceived_ref_t; -static EVP_SDK_MessageReceived_ref_t EVP_SDK_MessageReceived_clone(flatbuffers_builder_t *B, EVP_SDK_MessageReceived_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_MessageReceived, 2) - -static const flatbuffers_voffset_t __EVP_SDK_TelemetryEntry_required[] = { 0, 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_TelemetryEntry_ref_t; -static EVP_SDK_TelemetryEntry_ref_t EVP_SDK_TelemetryEntry_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryEntry_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_TelemetryEntry, 2) - -static const flatbuffers_voffset_t __EVP_SDK_TelemetryInput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_TelemetryInput_ref_t; -static EVP_SDK_TelemetryInput_ref_t EVP_SDK_TelemetryInput_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryInput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_TelemetryInput, 3) - -static const flatbuffers_voffset_t __EVP_SDK_TelemetryOutput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_TelemetryOutput_ref_t; -static EVP_SDK_TelemetryOutput_ref_t EVP_SDK_TelemetryOutput_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryOutput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_TelemetryOutput, 3) - -static const flatbuffers_voffset_t __EVP_SDK_RpcRequest_required[] = { 1, 2, 0 }; -typedef flatbuffers_ref_t EVP_SDK_RpcRequest_ref_t; -static EVP_SDK_RpcRequest_ref_t EVP_SDK_RpcRequest_clone(flatbuffers_builder_t *B, EVP_SDK_RpcRequest_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_RpcRequest, 3) - -static const flatbuffers_voffset_t __EVP_SDK_RpcResponseInput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_RpcResponseInput_ref_t; -static EVP_SDK_RpcResponseInput_ref_t EVP_SDK_RpcResponseInput_clone(flatbuffers_builder_t *B, EVP_SDK_RpcResponseInput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_RpcResponseInput, 5) - -static const flatbuffers_voffset_t __EVP_SDK_RpcResponseOutput_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_RpcResponseOutput_ref_t; -static EVP_SDK_RpcResponseOutput_ref_t EVP_SDK_RpcResponseOutput_clone(flatbuffers_builder_t *B, EVP_SDK_RpcResponseOutput_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_RpcResponseOutput, 3) - -static const flatbuffers_voffset_t __EVP_SDK_Event_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_Event_ref_t; -static EVP_SDK_Event_ref_t EVP_SDK_Event_clone(flatbuffers_builder_t *B, EVP_SDK_Event_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Event, 2) - -static const flatbuffers_voffset_t __EVP_SDK_GetEvent_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_GetEvent_ref_t; -static EVP_SDK_GetEvent_ref_t EVP_SDK_GetEvent_clone(flatbuffers_builder_t *B, EVP_SDK_GetEvent_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_GetEvent, 2) - -static const flatbuffers_voffset_t __EVP_SDK_RequestResendConfig_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_RequestResendConfig_ref_t; -static EVP_SDK_RequestResendConfig_ref_t EVP_SDK_RequestResendConfig_clone(flatbuffers_builder_t *B, EVP_SDK_RequestResendConfig_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_RequestResendConfig, 0) - -static const flatbuffers_voffset_t __EVP_SDK_Request_required[] = { 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_Request_ref_t; -static EVP_SDK_Request_ref_t EVP_SDK_Request_clone(flatbuffers_builder_t *B, EVP_SDK_Request_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Request, 2) - -static const flatbuffers_voffset_t __EVP_SDK_Simple_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_Simple_ref_t; -static EVP_SDK_Simple_ref_t EVP_SDK_Simple_clone(flatbuffers_builder_t *B, EVP_SDK_Simple_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Simple, 1) - -static const flatbuffers_voffset_t __EVP_SDK_Response_required[] = { 1, 0 }; -typedef flatbuffers_ref_t EVP_SDK_Response_ref_t; -static EVP_SDK_Response_ref_t EVP_SDK_Response_clone(flatbuffers_builder_t *B, EVP_SDK_Response_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_Response, 2) - -static const flatbuffers_voffset_t __EVP_SDK_StreamParamsRequest_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_StreamParamsRequest_ref_t; -static EVP_SDK_StreamParamsRequest_ref_t EVP_SDK_StreamParamsRequest_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParamsRequest_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_StreamParamsRequest, 1) - -static const flatbuffers_voffset_t __EVP_SDK_StreamNng_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_StreamNng_ref_t; -static EVP_SDK_StreamNng_ref_t EVP_SDK_StreamNng_clone(flatbuffers_builder_t *B, EVP_SDK_StreamNng_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_StreamNng, 3) - -static const flatbuffers_voffset_t __EVP_SDK_StreamParamsResponse_required[] = { 0 }; -typedef flatbuffers_ref_t EVP_SDK_StreamParamsResponse_ref_t; -static EVP_SDK_StreamParamsResponse_ref_t EVP_SDK_StreamParamsResponse_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParamsResponse_table_t t); -__flatbuffers_build_table(flatbuffers_, EVP_SDK_StreamParamsResponse, 5) - -#define __EVP_SDK_Config_formal_args , flatbuffers_string_ref_t v0, flatbuffers_uint8_vec_ref_t v1 -#define __EVP_SDK_Config_call_args , v0, v1 -static inline EVP_SDK_Config_ref_t EVP_SDK_Config_create(flatbuffers_builder_t *B __EVP_SDK_Config_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Config, EVP_SDK_Config_file_identifier, EVP_SDK_Config_type_identifier) - -#define __EVP_SDK_StateInput_formal_args , flatbuffers_string_ref_t v0, flatbuffers_uint8_vec_ref_t v1, uint64_t v2, uint64_t v3 -#define __EVP_SDK_StateInput_call_args , v0, v1, v2, v3 -static inline EVP_SDK_StateInput_ref_t EVP_SDK_StateInput_create(flatbuffers_builder_t *B __EVP_SDK_StateInput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_StateInput, EVP_SDK_StateInput_file_identifier, EVP_SDK_StateInput_type_identifier) - -#define __EVP_SDK_StateOutput_formal_args , uint64_t v0, uint32_t v1, uint64_t v2 -#define __EVP_SDK_StateOutput_call_args , v0, v1, v2 -static inline EVP_SDK_StateOutput_ref_t EVP_SDK_StateOutput_create(flatbuffers_builder_t *B __EVP_SDK_StateOutput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_StateOutput, EVP_SDK_StateOutput_file_identifier, EVP_SDK_StateOutput_type_identifier) - -#define __EVP_SDK_Exit_formal_args -#define __EVP_SDK_Exit_call_args -static inline EVP_SDK_Exit_ref_t EVP_SDK_Exit_create(flatbuffers_builder_t *B __EVP_SDK_Exit_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Exit, EVP_SDK_Exit_file_identifier, EVP_SDK_Exit_type_identifier) - -#define __EVP_SDK_BlobRequestAzureBlob_formal_args , flatbuffers_string_ref_t v0 -#define __EVP_SDK_BlobRequestAzureBlob_call_args , v0 -static inline EVP_SDK_BlobRequestAzureBlob_ref_t EVP_SDK_BlobRequestAzureBlob_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestAzureBlob_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobRequestAzureBlob, EVP_SDK_BlobRequestAzureBlob_file_identifier, EVP_SDK_BlobRequestAzureBlob_type_identifier) - -#define __EVP_SDK_BlobRequestEvp_formal_args , flatbuffers_string_ref_t v0, flatbuffers_string_ref_t v1 -#define __EVP_SDK_BlobRequestEvp_call_args , v0, v1 -static inline EVP_SDK_BlobRequestEvp_ref_t EVP_SDK_BlobRequestEvp_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestEvp_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobRequestEvp, EVP_SDK_BlobRequestEvp_file_identifier, EVP_SDK_BlobRequestEvp_type_identifier) - -#define __EVP_SDK_BlobRequestHttp_formal_args , flatbuffers_string_ref_t v0 -#define __EVP_SDK_BlobRequestHttp_call_args , v0 -static inline EVP_SDK_BlobRequestHttp_ref_t EVP_SDK_BlobRequestHttp_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestHttp_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobRequestHttp, EVP_SDK_BlobRequestHttp_file_identifier, EVP_SDK_BlobRequestHttp_type_identifier) - -#define __EVP_SDK_BlobRequestHttpExt_formal_args , flatbuffers_string_ref_t v0, flatbuffers_string_vec_ref_t v1 -#define __EVP_SDK_BlobRequestHttpExt_call_args , v0, v1 -static inline EVP_SDK_BlobRequestHttpExt_ref_t EVP_SDK_BlobRequestHttpExt_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestHttpExt_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobRequestHttpExt, EVP_SDK_BlobRequestHttpExt_file_identifier, EVP_SDK_BlobRequestHttpExt_type_identifier) - -#define __EVP_SDK_BlobInput_formal_args ,\ - uint32_t v0, uint32_t v1, EVP_SDK_BlobRequestUnion_union_ref_t v3, flatbuffers_string_ref_t v4, uint64_t v5, uint64_t v6 -#define __EVP_SDK_BlobInput_call_args ,\ - v0, v1, v3, v4, v5, v6 -static inline EVP_SDK_BlobInput_ref_t EVP_SDK_BlobInput_create(flatbuffers_builder_t *B __EVP_SDK_BlobInput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobInput, EVP_SDK_BlobInput_file_identifier, EVP_SDK_BlobInput_type_identifier) - -#define __EVP_SDK_BlobResultAzureBlob_formal_args , uint32_t v0, uint32_t v1, uint32_t v2 -#define __EVP_SDK_BlobResultAzureBlob_call_args , v0, v1, v2 -static inline EVP_SDK_BlobResultAzureBlob_ref_t EVP_SDK_BlobResultAzureBlob_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultAzureBlob_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobResultAzureBlob, EVP_SDK_BlobResultAzureBlob_file_identifier, EVP_SDK_BlobResultAzureBlob_type_identifier) - -#define __EVP_SDK_BlobResultEvp_formal_args , uint32_t v0, uint32_t v1, uint32_t v2 -#define __EVP_SDK_BlobResultEvp_call_args , v0, v1, v2 -static inline EVP_SDK_BlobResultEvp_ref_t EVP_SDK_BlobResultEvp_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultEvp_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobResultEvp, EVP_SDK_BlobResultEvp_file_identifier, EVP_SDK_BlobResultEvp_type_identifier) - -#define __EVP_SDK_BlobResultHttp_formal_args , uint32_t v0, uint32_t v1, uint32_t v2 -#define __EVP_SDK_BlobResultHttp_call_args , v0, v1, v2 -static inline EVP_SDK_BlobResultHttp_ref_t EVP_SDK_BlobResultHttp_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultHttp_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobResultHttp, EVP_SDK_BlobResultHttp_file_identifier, EVP_SDK_BlobResultHttp_type_identifier) - -#define __EVP_SDK_BlobResultHttpExt_formal_args , uint32_t v0, uint32_t v1, uint32_t v2 -#define __EVP_SDK_BlobResultHttpExt_call_args , v0, v1, v2 -static inline EVP_SDK_BlobResultHttpExt_ref_t EVP_SDK_BlobResultHttpExt_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultHttpExt_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobResultHttpExt, EVP_SDK_BlobResultHttpExt_file_identifier, EVP_SDK_BlobResultHttpExt_type_identifier) - -#define __EVP_SDK_BlobOutput_formal_args , EVP_SDK_BlobResultUnion_union_ref_t v1, uint64_t v2, uint32_t v3, uint64_t v4 -#define __EVP_SDK_BlobOutput_call_args , v1, v2, v3, v4 -static inline EVP_SDK_BlobOutput_ref_t EVP_SDK_BlobOutput_create(flatbuffers_builder_t *B __EVP_SDK_BlobOutput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_BlobOutput, EVP_SDK_BlobOutput_file_identifier, EVP_SDK_BlobOutput_type_identifier) - -#define __EVP_SDK_MessageSentInput_formal_args , flatbuffers_string_ref_t v0, flatbuffers_uint8_vec_ref_t v1, uint64_t v2, uint64_t v3 -#define __EVP_SDK_MessageSentInput_call_args , v0, v1, v2, v3 -static inline EVP_SDK_MessageSentInput_ref_t EVP_SDK_MessageSentInput_create(flatbuffers_builder_t *B __EVP_SDK_MessageSentInput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_MessageSentInput, EVP_SDK_MessageSentInput_file_identifier, EVP_SDK_MessageSentInput_type_identifier) - -#define __EVP_SDK_MessageSentOutput_formal_args , uint64_t v0, uint32_t v1, uint64_t v2 -#define __EVP_SDK_MessageSentOutput_call_args , v0, v1, v2 -static inline EVP_SDK_MessageSentOutput_ref_t EVP_SDK_MessageSentOutput_create(flatbuffers_builder_t *B __EVP_SDK_MessageSentOutput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_MessageSentOutput, EVP_SDK_MessageSentOutput_file_identifier, EVP_SDK_MessageSentOutput_type_identifier) - -#define __EVP_SDK_MessageReceived_formal_args , flatbuffers_string_ref_t v0, flatbuffers_uint8_vec_ref_t v1 -#define __EVP_SDK_MessageReceived_call_args , v0, v1 -static inline EVP_SDK_MessageReceived_ref_t EVP_SDK_MessageReceived_create(flatbuffers_builder_t *B __EVP_SDK_MessageReceived_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_MessageReceived, EVP_SDK_MessageReceived_file_identifier, EVP_SDK_MessageReceived_type_identifier) - -#define __EVP_SDK_TelemetryEntry_formal_args , flatbuffers_string_ref_t v0, flatbuffers_string_ref_t v1 -#define __EVP_SDK_TelemetryEntry_call_args , v0, v1 -static inline EVP_SDK_TelemetryEntry_ref_t EVP_SDK_TelemetryEntry_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryEntry_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_TelemetryEntry, EVP_SDK_TelemetryEntry_file_identifier, EVP_SDK_TelemetryEntry_type_identifier) - -#define __EVP_SDK_TelemetryInput_formal_args , EVP_SDK_TelemetryEntry_vec_ref_t v0, uint64_t v1, uint64_t v2 -#define __EVP_SDK_TelemetryInput_call_args , v0, v1, v2 -static inline EVP_SDK_TelemetryInput_ref_t EVP_SDK_TelemetryInput_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryInput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_TelemetryInput, EVP_SDK_TelemetryInput_file_identifier, EVP_SDK_TelemetryInput_type_identifier) - -#define __EVP_SDK_TelemetryOutput_formal_args , uint64_t v0, uint32_t v1, uint64_t v2 -#define __EVP_SDK_TelemetryOutput_call_args , v0, v1, v2 -static inline EVP_SDK_TelemetryOutput_ref_t EVP_SDK_TelemetryOutput_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryOutput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_TelemetryOutput, EVP_SDK_TelemetryOutput_file_identifier, EVP_SDK_TelemetryOutput_type_identifier) - -#define __EVP_SDK_RpcRequest_formal_args , uint64_t v0, flatbuffers_string_ref_t v1, flatbuffers_string_ref_t v2 -#define __EVP_SDK_RpcRequest_call_args , v0, v1, v2 -static inline EVP_SDK_RpcRequest_ref_t EVP_SDK_RpcRequest_create(flatbuffers_builder_t *B __EVP_SDK_RpcRequest_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_RpcRequest, EVP_SDK_RpcRequest_file_identifier, EVP_SDK_RpcRequest_type_identifier) - -#define __EVP_SDK_RpcResponseInput_formal_args ,\ - uint64_t v0, flatbuffers_string_ref_t v1, uint32_t v2, uint64_t v3, uint64_t v4 -#define __EVP_SDK_RpcResponseInput_call_args ,\ - v0, v1, v2, v3, v4 -static inline EVP_SDK_RpcResponseInput_ref_t EVP_SDK_RpcResponseInput_create(flatbuffers_builder_t *B __EVP_SDK_RpcResponseInput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_RpcResponseInput, EVP_SDK_RpcResponseInput_file_identifier, EVP_SDK_RpcResponseInput_type_identifier) - -#define __EVP_SDK_RpcResponseOutput_formal_args , uint64_t v0, uint32_t v1, uint64_t v2 -#define __EVP_SDK_RpcResponseOutput_call_args , v0, v1, v2 -static inline EVP_SDK_RpcResponseOutput_ref_t EVP_SDK_RpcResponseOutput_create(flatbuffers_builder_t *B __EVP_SDK_RpcResponseOutput_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_RpcResponseOutput, EVP_SDK_RpcResponseOutput_file_identifier, EVP_SDK_RpcResponseOutput_type_identifier) - -#define __EVP_SDK_Event_formal_args , EVP_SDK_EventBody_union_ref_t v1 -#define __EVP_SDK_Event_call_args , v1 -static inline EVP_SDK_Event_ref_t EVP_SDK_Event_create(flatbuffers_builder_t *B __EVP_SDK_Event_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Event, EVP_SDK_Event_file_identifier, EVP_SDK_Event_type_identifier) - -#define __EVP_SDK_GetEvent_formal_args , uint64_t v0, uint64_t v1 -#define __EVP_SDK_GetEvent_call_args , v0, v1 -static inline EVP_SDK_GetEvent_ref_t EVP_SDK_GetEvent_create(flatbuffers_builder_t *B __EVP_SDK_GetEvent_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_GetEvent, EVP_SDK_GetEvent_file_identifier, EVP_SDK_GetEvent_type_identifier) - -#define __EVP_SDK_RequestResendConfig_formal_args -#define __EVP_SDK_RequestResendConfig_call_args -static inline EVP_SDK_RequestResendConfig_ref_t EVP_SDK_RequestResendConfig_create(flatbuffers_builder_t *B __EVP_SDK_RequestResendConfig_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_RequestResendConfig, EVP_SDK_RequestResendConfig_file_identifier, EVP_SDK_RequestResendConfig_type_identifier) - -#define __EVP_SDK_Request_formal_args , EVP_SDK_RequestUnion_union_ref_t v1 -#define __EVP_SDK_Request_call_args , v1 -static inline EVP_SDK_Request_ref_t EVP_SDK_Request_create(flatbuffers_builder_t *B __EVP_SDK_Request_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Request, EVP_SDK_Request_file_identifier, EVP_SDK_Request_type_identifier) - -#define __EVP_SDK_Simple_formal_args , uint32_t v0 -#define __EVP_SDK_Simple_call_args , v0 -static inline EVP_SDK_Simple_ref_t EVP_SDK_Simple_create(flatbuffers_builder_t *B __EVP_SDK_Simple_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Simple, EVP_SDK_Simple_file_identifier, EVP_SDK_Simple_type_identifier) - -#define __EVP_SDK_Response_formal_args , EVP_SDK_ResponseUnion_union_ref_t v1 -#define __EVP_SDK_Response_call_args , v1 -static inline EVP_SDK_Response_ref_t EVP_SDK_Response_create(flatbuffers_builder_t *B __EVP_SDK_Response_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_Response, EVP_SDK_Response_file_identifier, EVP_SDK_Response_type_identifier) - -#define __EVP_SDK_StreamParamsRequest_formal_args , flatbuffers_string_ref_t v0 -#define __EVP_SDK_StreamParamsRequest_call_args , v0 -static inline EVP_SDK_StreamParamsRequest_ref_t EVP_SDK_StreamParamsRequest_create(flatbuffers_builder_t *B __EVP_SDK_StreamParamsRequest_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_StreamParamsRequest, EVP_SDK_StreamParamsRequest_file_identifier, EVP_SDK_StreamParamsRequest_type_identifier) - -#define __EVP_SDK_StreamNng_formal_args , EVP_SDK_StreamNngMode_enum_t v0, EVP_SDK_StreamNngProtocol_enum_t v1, flatbuffers_string_ref_t v2 -#define __EVP_SDK_StreamNng_call_args , v0, v1, v2 -static inline EVP_SDK_StreamNng_ref_t EVP_SDK_StreamNng_create(flatbuffers_builder_t *B __EVP_SDK_StreamNng_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_StreamNng, EVP_SDK_StreamNng_file_identifier, EVP_SDK_StreamNng_type_identifier) - -#define __EVP_SDK_StreamParamsResponse_formal_args , uint32_t v0, EVP_SDK_StreamType_enum_t v1, EVP_SDK_StreamDirection_enum_t v2, EVP_SDK_StreamParams_union_ref_t v4 -#define __EVP_SDK_StreamParamsResponse_call_args , v0, v1, v2, v4 -static inline EVP_SDK_StreamParamsResponse_ref_t EVP_SDK_StreamParamsResponse_create(flatbuffers_builder_t *B __EVP_SDK_StreamParamsResponse_formal_args); -__flatbuffers_build_table_prolog(flatbuffers_, EVP_SDK_StreamParamsResponse, EVP_SDK_StreamParamsResponse_file_identifier, EVP_SDK_StreamParamsResponse_type_identifier) - -static inline EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_as_NONE(void) -{ EVP_SDK_BlobRequestUnion_union_ref_t uref; uref.type = EVP_SDK_BlobRequestUnion_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_as_azureBlob(EVP_SDK_BlobRequestAzureBlob_ref_t ref) -{ EVP_SDK_BlobRequestUnion_union_ref_t uref; uref.type = EVP_SDK_BlobRequestUnion_azureBlob; uref.value = ref; return uref; } -static inline EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_as_evp(EVP_SDK_BlobRequestEvp_ref_t ref) -{ EVP_SDK_BlobRequestUnion_union_ref_t uref; uref.type = EVP_SDK_BlobRequestUnion_evp; uref.value = ref; return uref; } -static inline EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_as_http(EVP_SDK_BlobRequestHttp_ref_t ref) -{ EVP_SDK_BlobRequestUnion_union_ref_t uref; uref.type = EVP_SDK_BlobRequestUnion_http; uref.value = ref; return uref; } -static inline EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_as_http_ext(EVP_SDK_BlobRequestHttpExt_ref_t ref) -{ EVP_SDK_BlobRequestUnion_union_ref_t uref; uref.type = EVP_SDK_BlobRequestUnion_http_ext; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_BlobRequestUnion) - -static EVP_SDK_BlobRequestUnion_union_ref_t EVP_SDK_BlobRequestUnion_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestUnion_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_BlobRequestUnion_as_azureBlob(EVP_SDK_BlobRequestAzureBlob_clone(B, (EVP_SDK_BlobRequestAzureBlob_table_t)u.value)); - case 2: return EVP_SDK_BlobRequestUnion_as_evp(EVP_SDK_BlobRequestEvp_clone(B, (EVP_SDK_BlobRequestEvp_table_t)u.value)); - case 3: return EVP_SDK_BlobRequestUnion_as_http(EVP_SDK_BlobRequestHttp_clone(B, (EVP_SDK_BlobRequestHttp_table_t)u.value)); - case 4: return EVP_SDK_BlobRequestUnion_as_http_ext(EVP_SDK_BlobRequestHttpExt_clone(B, (EVP_SDK_BlobRequestHttpExt_table_t)u.value)); - default: return EVP_SDK_BlobRequestUnion_as_NONE(); - } -} - -static inline EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_as_NONE(void) -{ EVP_SDK_BlobResultUnion_union_ref_t uref; uref.type = EVP_SDK_BlobResultUnion_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_as_azureBlob(EVP_SDK_BlobResultAzureBlob_ref_t ref) -{ EVP_SDK_BlobResultUnion_union_ref_t uref; uref.type = EVP_SDK_BlobResultUnion_azureBlob; uref.value = ref; return uref; } -static inline EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_as_evp(EVP_SDK_BlobResultEvp_ref_t ref) -{ EVP_SDK_BlobResultUnion_union_ref_t uref; uref.type = EVP_SDK_BlobResultUnion_evp; uref.value = ref; return uref; } -static inline EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_as_http(EVP_SDK_BlobResultHttp_ref_t ref) -{ EVP_SDK_BlobResultUnion_union_ref_t uref; uref.type = EVP_SDK_BlobResultUnion_http; uref.value = ref; return uref; } -static inline EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_as_http_ext(EVP_SDK_BlobResultHttpExt_ref_t ref) -{ EVP_SDK_BlobResultUnion_union_ref_t uref; uref.type = EVP_SDK_BlobResultUnion_http_ext; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_BlobResultUnion) - -static EVP_SDK_BlobResultUnion_union_ref_t EVP_SDK_BlobResultUnion_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultUnion_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_BlobResultUnion_as_azureBlob(EVP_SDK_BlobResultAzureBlob_clone(B, (EVP_SDK_BlobResultAzureBlob_table_t)u.value)); - case 2: return EVP_SDK_BlobResultUnion_as_evp(EVP_SDK_BlobResultEvp_clone(B, (EVP_SDK_BlobResultEvp_table_t)u.value)); - case 3: return EVP_SDK_BlobResultUnion_as_http(EVP_SDK_BlobResultHttp_clone(B, (EVP_SDK_BlobResultHttp_table_t)u.value)); - case 4: return EVP_SDK_BlobResultUnion_as_http_ext(EVP_SDK_BlobResultHttpExt_clone(B, (EVP_SDK_BlobResultHttpExt_table_t)u.value)); - default: return EVP_SDK_BlobResultUnion_as_NONE(); - } -} - -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_NONE(void) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_config(EVP_SDK_Config_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_config; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_state(EVP_SDK_StateOutput_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_state; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_exit(EVP_SDK_Exit_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_exit; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_blob(EVP_SDK_BlobOutput_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_blob; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_messageSent(EVP_SDK_MessageSentOutput_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_messageSent; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_messageReceived(EVP_SDK_MessageReceived_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_messageReceived; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_telemetry(EVP_SDK_TelemetryOutput_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_telemetry; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_rpcRequest(EVP_SDK_RpcRequest_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_rpcRequest; uref.value = ref; return uref; } -static inline EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_as_rpcResponse(EVP_SDK_RpcResponseOutput_ref_t ref) -{ EVP_SDK_EventBody_union_ref_t uref; uref.type = EVP_SDK_EventBody_rpcResponse; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_EventBody) - -static EVP_SDK_EventBody_union_ref_t EVP_SDK_EventBody_clone(flatbuffers_builder_t *B, EVP_SDK_EventBody_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_EventBody_as_config(EVP_SDK_Config_clone(B, (EVP_SDK_Config_table_t)u.value)); - case 2: return EVP_SDK_EventBody_as_state(EVP_SDK_StateOutput_clone(B, (EVP_SDK_StateOutput_table_t)u.value)); - case 3: return EVP_SDK_EventBody_as_exit(EVP_SDK_Exit_clone(B, (EVP_SDK_Exit_table_t)u.value)); - case 4: return EVP_SDK_EventBody_as_blob(EVP_SDK_BlobOutput_clone(B, (EVP_SDK_BlobOutput_table_t)u.value)); - case 5: return EVP_SDK_EventBody_as_messageSent(EVP_SDK_MessageSentOutput_clone(B, (EVP_SDK_MessageSentOutput_table_t)u.value)); - case 6: return EVP_SDK_EventBody_as_messageReceived(EVP_SDK_MessageReceived_clone(B, (EVP_SDK_MessageReceived_table_t)u.value)); - case 7: return EVP_SDK_EventBody_as_telemetry(EVP_SDK_TelemetryOutput_clone(B, (EVP_SDK_TelemetryOutput_table_t)u.value)); - case 8: return EVP_SDK_EventBody_as_rpcRequest(EVP_SDK_RpcRequest_clone(B, (EVP_SDK_RpcRequest_table_t)u.value)); - case 9: return EVP_SDK_EventBody_as_rpcResponse(EVP_SDK_RpcResponseOutput_clone(B, (EVP_SDK_RpcResponseOutput_table_t)u.value)); - default: return EVP_SDK_EventBody_as_NONE(); - } -} - -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_NONE(void) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_getEvent(EVP_SDK_GetEvent_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_getEvent; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_sendState(EVP_SDK_StateInput_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_sendState; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_requestResendConfig(EVP_SDK_RequestResendConfig_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_requestResendConfig; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_blobOperation(EVP_SDK_BlobInput_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_blobOperation; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_sendTelemetry(EVP_SDK_TelemetryInput_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_sendTelemetry; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_sendMessage(EVP_SDK_MessageSentInput_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_sendMessage; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_sendRpcResponse(EVP_SDK_RpcResponseInput_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_sendRpcResponse; uref.value = ref; return uref; } -static inline EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_as_streamParamsRequest(EVP_SDK_StreamParamsRequest_ref_t ref) -{ EVP_SDK_RequestUnion_union_ref_t uref; uref.type = EVP_SDK_RequestUnion_streamParamsRequest; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_RequestUnion) - -static EVP_SDK_RequestUnion_union_ref_t EVP_SDK_RequestUnion_clone(flatbuffers_builder_t *B, EVP_SDK_RequestUnion_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_RequestUnion_as_getEvent(EVP_SDK_GetEvent_clone(B, (EVP_SDK_GetEvent_table_t)u.value)); - case 2: return EVP_SDK_RequestUnion_as_sendState(EVP_SDK_StateInput_clone(B, (EVP_SDK_StateInput_table_t)u.value)); - case 3: return EVP_SDK_RequestUnion_as_requestResendConfig(EVP_SDK_RequestResendConfig_clone(B, (EVP_SDK_RequestResendConfig_table_t)u.value)); - case 4: return EVP_SDK_RequestUnion_as_blobOperation(EVP_SDK_BlobInput_clone(B, (EVP_SDK_BlobInput_table_t)u.value)); - case 5: return EVP_SDK_RequestUnion_as_sendTelemetry(EVP_SDK_TelemetryInput_clone(B, (EVP_SDK_TelemetryInput_table_t)u.value)); - case 6: return EVP_SDK_RequestUnion_as_sendMessage(EVP_SDK_MessageSentInput_clone(B, (EVP_SDK_MessageSentInput_table_t)u.value)); - case 7: return EVP_SDK_RequestUnion_as_sendRpcResponse(EVP_SDK_RpcResponseInput_clone(B, (EVP_SDK_RpcResponseInput_table_t)u.value)); - case 8: return EVP_SDK_RequestUnion_as_streamParamsRequest(EVP_SDK_StreamParamsRequest_clone(B, (EVP_SDK_StreamParamsRequest_table_t)u.value)); - default: return EVP_SDK_RequestUnion_as_NONE(); - } -} - -static inline EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_as_NONE(void) -{ EVP_SDK_ResponseUnion_union_ref_t uref; uref.type = EVP_SDK_ResponseUnion_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_as_getEvent(EVP_SDK_Event_ref_t ref) -{ EVP_SDK_ResponseUnion_union_ref_t uref; uref.type = EVP_SDK_ResponseUnion_getEvent; uref.value = ref; return uref; } -static inline EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_as_simple(EVP_SDK_Simple_ref_t ref) -{ EVP_SDK_ResponseUnion_union_ref_t uref; uref.type = EVP_SDK_ResponseUnion_simple; uref.value = ref; return uref; } -static inline EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_as_streamParamsResponse(EVP_SDK_StreamParamsResponse_ref_t ref) -{ EVP_SDK_ResponseUnion_union_ref_t uref; uref.type = EVP_SDK_ResponseUnion_streamParamsResponse; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_ResponseUnion) - -static EVP_SDK_ResponseUnion_union_ref_t EVP_SDK_ResponseUnion_clone(flatbuffers_builder_t *B, EVP_SDK_ResponseUnion_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_ResponseUnion_as_getEvent(EVP_SDK_Event_clone(B, (EVP_SDK_Event_table_t)u.value)); - case 2: return EVP_SDK_ResponseUnion_as_simple(EVP_SDK_Simple_clone(B, (EVP_SDK_Simple_table_t)u.value)); - case 3: return EVP_SDK_ResponseUnion_as_streamParamsResponse(EVP_SDK_StreamParamsResponse_clone(B, (EVP_SDK_StreamParamsResponse_table_t)u.value)); - default: return EVP_SDK_ResponseUnion_as_NONE(); - } -} - -static inline EVP_SDK_StreamParams_union_ref_t EVP_SDK_StreamParams_as_NONE(void) -{ EVP_SDK_StreamParams_union_ref_t uref; uref.type = EVP_SDK_StreamParams_NONE; uref.value = 0; return uref; } -static inline EVP_SDK_StreamParams_union_ref_t EVP_SDK_StreamParams_as_nng(EVP_SDK_StreamNng_ref_t ref) -{ EVP_SDK_StreamParams_union_ref_t uref; uref.type = EVP_SDK_StreamParams_nng; uref.value = ref; return uref; } -__flatbuffers_build_union_vector(flatbuffers_, EVP_SDK_StreamParams) - -static EVP_SDK_StreamParams_union_ref_t EVP_SDK_StreamParams_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParams_union_t u) -{ - switch (u.type) { - case 1: return EVP_SDK_StreamParams_as_nng(EVP_SDK_StreamNng_clone(B, (EVP_SDK_StreamNng_table_t)u.value)); - default: return EVP_SDK_StreamParams_as_NONE(); - } -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_Config_topic, EVP_SDK_Config) -__flatbuffers_build_vector_field(1, flatbuffers_, EVP_SDK_Config_blob, flatbuffers_uint8, uint8_t, EVP_SDK_Config) - -static inline EVP_SDK_Config_ref_t EVP_SDK_Config_create(flatbuffers_builder_t *B __EVP_SDK_Config_formal_args) -{ - if (EVP_SDK_Config_start(B) - || EVP_SDK_Config_topic_add(B, v0) - || EVP_SDK_Config_blob_add(B, v1)) { - return 0; - } - return EVP_SDK_Config_end(B); -} - -static EVP_SDK_Config_ref_t EVP_SDK_Config_clone(flatbuffers_builder_t *B, EVP_SDK_Config_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Config_start(B) - || EVP_SDK_Config_topic_pick(B, t) - || EVP_SDK_Config_blob_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Config_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_StateInput_topic, EVP_SDK_StateInput) -__flatbuffers_build_vector_field(1, flatbuffers_, EVP_SDK_StateInput_blob, flatbuffers_uint8, uint8_t, EVP_SDK_StateInput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_StateInput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_StateInput) -__flatbuffers_build_scalar_field(3, flatbuffers_, EVP_SDK_StateInput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_StateInput) - -static inline EVP_SDK_StateInput_ref_t EVP_SDK_StateInput_create(flatbuffers_builder_t *B __EVP_SDK_StateInput_formal_args) -{ - if (EVP_SDK_StateInput_start(B) - || EVP_SDK_StateInput_cb_add(B, v2) - || EVP_SDK_StateInput_cb_userdata_add(B, v3) - || EVP_SDK_StateInput_topic_add(B, v0) - || EVP_SDK_StateInput_blob_add(B, v1)) { - return 0; - } - return EVP_SDK_StateInput_end(B); -} - -static EVP_SDK_StateInput_ref_t EVP_SDK_StateInput_clone(flatbuffers_builder_t *B, EVP_SDK_StateInput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_StateInput_start(B) - || EVP_SDK_StateInput_cb_pick(B, t) - || EVP_SDK_StateInput_cb_userdata_pick(B, t) - || EVP_SDK_StateInput_topic_pick(B, t) - || EVP_SDK_StateInput_blob_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_StateInput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_StateOutput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_StateOutput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_StateOutput_reason, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_StateOutput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_StateOutput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_StateOutput) - -static inline EVP_SDK_StateOutput_ref_t EVP_SDK_StateOutput_create(flatbuffers_builder_t *B __EVP_SDK_StateOutput_formal_args) -{ - if (EVP_SDK_StateOutput_start(B) - || EVP_SDK_StateOutput_cb_add(B, v0) - || EVP_SDK_StateOutput_cb_userdata_add(B, v2) - || EVP_SDK_StateOutput_reason_add(B, v1)) { - return 0; - } - return EVP_SDK_StateOutput_end(B); -} - -static EVP_SDK_StateOutput_ref_t EVP_SDK_StateOutput_clone(flatbuffers_builder_t *B, EVP_SDK_StateOutput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_StateOutput_start(B) - || EVP_SDK_StateOutput_cb_pick(B, t) - || EVP_SDK_StateOutput_cb_userdata_pick(B, t) - || EVP_SDK_StateOutput_reason_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_StateOutput_end(B)); -} - - -static inline EVP_SDK_Exit_ref_t EVP_SDK_Exit_create(flatbuffers_builder_t *B __EVP_SDK_Exit_formal_args) -{ - if (EVP_SDK_Exit_start(B)) { - return 0; - } - return EVP_SDK_Exit_end(B); -} - -static EVP_SDK_Exit_ref_t EVP_SDK_Exit_clone(flatbuffers_builder_t *B, EVP_SDK_Exit_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Exit_start(B)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Exit_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_BlobRequestAzureBlob_url, EVP_SDK_BlobRequestAzureBlob) - -static inline EVP_SDK_BlobRequestAzureBlob_ref_t EVP_SDK_BlobRequestAzureBlob_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestAzureBlob_formal_args) -{ - if (EVP_SDK_BlobRequestAzureBlob_start(B) - || EVP_SDK_BlobRequestAzureBlob_url_add(B, v0)) { - return 0; - } - return EVP_SDK_BlobRequestAzureBlob_end(B); -} - -static EVP_SDK_BlobRequestAzureBlob_ref_t EVP_SDK_BlobRequestAzureBlob_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestAzureBlob_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobRequestAzureBlob_start(B) - || EVP_SDK_BlobRequestAzureBlob_url_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobRequestAzureBlob_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_BlobRequestEvp_remoteName, EVP_SDK_BlobRequestEvp) -__flatbuffers_build_string_field(1, flatbuffers_, EVP_SDK_BlobRequestEvp_storageName, EVP_SDK_BlobRequestEvp) - -static inline EVP_SDK_BlobRequestEvp_ref_t EVP_SDK_BlobRequestEvp_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestEvp_formal_args) -{ - if (EVP_SDK_BlobRequestEvp_start(B) - || EVP_SDK_BlobRequestEvp_remoteName_add(B, v0) - || EVP_SDK_BlobRequestEvp_storageName_add(B, v1)) { - return 0; - } - return EVP_SDK_BlobRequestEvp_end(B); -} - -static EVP_SDK_BlobRequestEvp_ref_t EVP_SDK_BlobRequestEvp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestEvp_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobRequestEvp_start(B) - || EVP_SDK_BlobRequestEvp_remoteName_pick(B, t) - || EVP_SDK_BlobRequestEvp_storageName_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobRequestEvp_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_BlobRequestHttp_url, EVP_SDK_BlobRequestHttp) - -static inline EVP_SDK_BlobRequestHttp_ref_t EVP_SDK_BlobRequestHttp_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestHttp_formal_args) -{ - if (EVP_SDK_BlobRequestHttp_start(B) - || EVP_SDK_BlobRequestHttp_url_add(B, v0)) { - return 0; - } - return EVP_SDK_BlobRequestHttp_end(B); -} - -static EVP_SDK_BlobRequestHttp_ref_t EVP_SDK_BlobRequestHttp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestHttp_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobRequestHttp_start(B) - || EVP_SDK_BlobRequestHttp_url_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobRequestHttp_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_BlobRequestHttpExt_url, EVP_SDK_BlobRequestHttpExt) -__flatbuffers_build_string_vector_field(1, flatbuffers_, EVP_SDK_BlobRequestHttpExt_headers, EVP_SDK_BlobRequestHttpExt) - -static inline EVP_SDK_BlobRequestHttpExt_ref_t EVP_SDK_BlobRequestHttpExt_create(flatbuffers_builder_t *B __EVP_SDK_BlobRequestHttpExt_formal_args) -{ - if (EVP_SDK_BlobRequestHttpExt_start(B) - || EVP_SDK_BlobRequestHttpExt_url_add(B, v0) - || EVP_SDK_BlobRequestHttpExt_headers_add(B, v1)) { - return 0; - } - return EVP_SDK_BlobRequestHttpExt_end(B); -} - -static EVP_SDK_BlobRequestHttpExt_ref_t EVP_SDK_BlobRequestHttpExt_clone(flatbuffers_builder_t *B, EVP_SDK_BlobRequestHttpExt_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobRequestHttpExt_start(B) - || EVP_SDK_BlobRequestHttpExt_url_pick(B, t) - || EVP_SDK_BlobRequestHttpExt_headers_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobRequestHttpExt_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_BlobInput_type, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobInput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_BlobInput_op, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobInput) -__flatbuffers_build_union_field(3, flatbuffers_, EVP_SDK_BlobInput_request, EVP_SDK_BlobRequestUnion, EVP_SDK_BlobInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobInput_request, EVP_SDK_BlobRequestUnion, azureBlob, EVP_SDK_BlobRequestAzureBlob) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobInput_request, EVP_SDK_BlobRequestUnion, evp, EVP_SDK_BlobRequestEvp) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobInput_request, EVP_SDK_BlobRequestUnion, http, EVP_SDK_BlobRequestHttp) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobInput_request, EVP_SDK_BlobRequestUnion, http_ext, EVP_SDK_BlobRequestHttpExt) -__flatbuffers_build_string_field(4, flatbuffers_, EVP_SDK_BlobInput_filename, EVP_SDK_BlobInput) -__flatbuffers_build_scalar_field(5, flatbuffers_, EVP_SDK_BlobInput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_BlobInput) -__flatbuffers_build_scalar_field(6, flatbuffers_, EVP_SDK_BlobInput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_BlobInput) - -static inline EVP_SDK_BlobInput_ref_t EVP_SDK_BlobInput_create(flatbuffers_builder_t *B __EVP_SDK_BlobInput_formal_args) -{ - if (EVP_SDK_BlobInput_start(B) - || EVP_SDK_BlobInput_cb_add(B, v5) - || EVP_SDK_BlobInput_cb_userdata_add(B, v6) - || EVP_SDK_BlobInput_type_add(B, v0) - || EVP_SDK_BlobInput_op_add(B, v1) - || EVP_SDK_BlobInput_request_add_value(B, v3) - || EVP_SDK_BlobInput_filename_add(B, v4) - || EVP_SDK_BlobInput_request_add_type(B, v3.type)) { - return 0; - } - return EVP_SDK_BlobInput_end(B); -} - -static EVP_SDK_BlobInput_ref_t EVP_SDK_BlobInput_clone(flatbuffers_builder_t *B, EVP_SDK_BlobInput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobInput_start(B) - || EVP_SDK_BlobInput_cb_pick(B, t) - || EVP_SDK_BlobInput_cb_userdata_pick(B, t) - || EVP_SDK_BlobInput_type_pick(B, t) - || EVP_SDK_BlobInput_op_pick(B, t) - || EVP_SDK_BlobInput_request_pick(B, t) - || EVP_SDK_BlobInput_filename_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobInput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_BlobResultAzureBlob_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultAzureBlob) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_BlobResultAzureBlob_error, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultAzureBlob) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_BlobResultAzureBlob_http_status, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultAzureBlob) - -static inline EVP_SDK_BlobResultAzureBlob_ref_t EVP_SDK_BlobResultAzureBlob_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultAzureBlob_formal_args) -{ - if (EVP_SDK_BlobResultAzureBlob_start(B) - || EVP_SDK_BlobResultAzureBlob_result_add(B, v0) - || EVP_SDK_BlobResultAzureBlob_error_add(B, v1) - || EVP_SDK_BlobResultAzureBlob_http_status_add(B, v2)) { - return 0; - } - return EVP_SDK_BlobResultAzureBlob_end(B); -} - -static EVP_SDK_BlobResultAzureBlob_ref_t EVP_SDK_BlobResultAzureBlob_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultAzureBlob_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobResultAzureBlob_start(B) - || EVP_SDK_BlobResultAzureBlob_result_pick(B, t) - || EVP_SDK_BlobResultAzureBlob_error_pick(B, t) - || EVP_SDK_BlobResultAzureBlob_http_status_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobResultAzureBlob_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_BlobResultEvp_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultEvp) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_BlobResultEvp_error, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultEvp) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_BlobResultEvp_http_status, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultEvp) - -static inline EVP_SDK_BlobResultEvp_ref_t EVP_SDK_BlobResultEvp_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultEvp_formal_args) -{ - if (EVP_SDK_BlobResultEvp_start(B) - || EVP_SDK_BlobResultEvp_result_add(B, v0) - || EVP_SDK_BlobResultEvp_error_add(B, v1) - || EVP_SDK_BlobResultEvp_http_status_add(B, v2)) { - return 0; - } - return EVP_SDK_BlobResultEvp_end(B); -} - -static EVP_SDK_BlobResultEvp_ref_t EVP_SDK_BlobResultEvp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultEvp_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobResultEvp_start(B) - || EVP_SDK_BlobResultEvp_result_pick(B, t) - || EVP_SDK_BlobResultEvp_error_pick(B, t) - || EVP_SDK_BlobResultEvp_http_status_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobResultEvp_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_BlobResultHttp_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttp) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_BlobResultHttp_error, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttp) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_BlobResultHttp_http_status, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttp) - -static inline EVP_SDK_BlobResultHttp_ref_t EVP_SDK_BlobResultHttp_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultHttp_formal_args) -{ - if (EVP_SDK_BlobResultHttp_start(B) - || EVP_SDK_BlobResultHttp_result_add(B, v0) - || EVP_SDK_BlobResultHttp_error_add(B, v1) - || EVP_SDK_BlobResultHttp_http_status_add(B, v2)) { - return 0; - } - return EVP_SDK_BlobResultHttp_end(B); -} - -static EVP_SDK_BlobResultHttp_ref_t EVP_SDK_BlobResultHttp_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultHttp_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobResultHttp_start(B) - || EVP_SDK_BlobResultHttp_result_pick(B, t) - || EVP_SDK_BlobResultHttp_error_pick(B, t) - || EVP_SDK_BlobResultHttp_http_status_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobResultHttp_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_BlobResultHttpExt_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttpExt) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_BlobResultHttpExt_error, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttpExt) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_BlobResultHttpExt_http_status, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobResultHttpExt) - -static inline EVP_SDK_BlobResultHttpExt_ref_t EVP_SDK_BlobResultHttpExt_create(flatbuffers_builder_t *B __EVP_SDK_BlobResultHttpExt_formal_args) -{ - if (EVP_SDK_BlobResultHttpExt_start(B) - || EVP_SDK_BlobResultHttpExt_result_add(B, v0) - || EVP_SDK_BlobResultHttpExt_error_add(B, v1) - || EVP_SDK_BlobResultHttpExt_http_status_add(B, v2)) { - return 0; - } - return EVP_SDK_BlobResultHttpExt_end(B); -} - -static EVP_SDK_BlobResultHttpExt_ref_t EVP_SDK_BlobResultHttpExt_clone(flatbuffers_builder_t *B, EVP_SDK_BlobResultHttpExt_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobResultHttpExt_start(B) - || EVP_SDK_BlobResultHttpExt_result_pick(B, t) - || EVP_SDK_BlobResultHttpExt_error_pick(B, t) - || EVP_SDK_BlobResultHttpExt_http_status_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobResultHttpExt_end(B)); -} - -__flatbuffers_build_union_field(1, flatbuffers_, EVP_SDK_BlobOutput_result, EVP_SDK_BlobResultUnion, EVP_SDK_BlobOutput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobOutput_result, EVP_SDK_BlobResultUnion, azureBlob, EVP_SDK_BlobResultAzureBlob) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobOutput_result, EVP_SDK_BlobResultUnion, evp, EVP_SDK_BlobResultEvp) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobOutput_result, EVP_SDK_BlobResultUnion, http, EVP_SDK_BlobResultHttp) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_BlobOutput_result, EVP_SDK_BlobResultUnion, http_ext, EVP_SDK_BlobResultHttpExt) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_BlobOutput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_BlobOutput) -__flatbuffers_build_scalar_field(3, flatbuffers_, EVP_SDK_BlobOutput_reason, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_BlobOutput) -__flatbuffers_build_scalar_field(4, flatbuffers_, EVP_SDK_BlobOutput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_BlobOutput) - -static inline EVP_SDK_BlobOutput_ref_t EVP_SDK_BlobOutput_create(flatbuffers_builder_t *B __EVP_SDK_BlobOutput_formal_args) -{ - if (EVP_SDK_BlobOutput_start(B) - || EVP_SDK_BlobOutput_cb_add(B, v2) - || EVP_SDK_BlobOutput_cb_userdata_add(B, v4) - || EVP_SDK_BlobOutput_result_add_value(B, v1) - || EVP_SDK_BlobOutput_reason_add(B, v3) - || EVP_SDK_BlobOutput_result_add_type(B, v1.type)) { - return 0; - } - return EVP_SDK_BlobOutput_end(B); -} - -static EVP_SDK_BlobOutput_ref_t EVP_SDK_BlobOutput_clone(flatbuffers_builder_t *B, EVP_SDK_BlobOutput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_BlobOutput_start(B) - || EVP_SDK_BlobOutput_cb_pick(B, t) - || EVP_SDK_BlobOutput_cb_userdata_pick(B, t) - || EVP_SDK_BlobOutput_result_pick(B, t) - || EVP_SDK_BlobOutput_reason_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_BlobOutput_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_MessageSentInput_topic, EVP_SDK_MessageSentInput) -__flatbuffers_build_vector_field(1, flatbuffers_, EVP_SDK_MessageSentInput_blob, flatbuffers_uint8, uint8_t, EVP_SDK_MessageSentInput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_MessageSentInput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_MessageSentInput) -__flatbuffers_build_scalar_field(3, flatbuffers_, EVP_SDK_MessageSentInput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_MessageSentInput) - -static inline EVP_SDK_MessageSentInput_ref_t EVP_SDK_MessageSentInput_create(flatbuffers_builder_t *B __EVP_SDK_MessageSentInput_formal_args) -{ - if (EVP_SDK_MessageSentInput_start(B) - || EVP_SDK_MessageSentInput_cb_add(B, v2) - || EVP_SDK_MessageSentInput_cb_userdata_add(B, v3) - || EVP_SDK_MessageSentInput_topic_add(B, v0) - || EVP_SDK_MessageSentInput_blob_add(B, v1)) { - return 0; - } - return EVP_SDK_MessageSentInput_end(B); -} - -static EVP_SDK_MessageSentInput_ref_t EVP_SDK_MessageSentInput_clone(flatbuffers_builder_t *B, EVP_SDK_MessageSentInput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_MessageSentInput_start(B) - || EVP_SDK_MessageSentInput_cb_pick(B, t) - || EVP_SDK_MessageSentInput_cb_userdata_pick(B, t) - || EVP_SDK_MessageSentInput_topic_pick(B, t) - || EVP_SDK_MessageSentInput_blob_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_MessageSentInput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_MessageSentOutput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_MessageSentOutput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_MessageSentOutput_reason, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_MessageSentOutput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_MessageSentOutput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_MessageSentOutput) - -static inline EVP_SDK_MessageSentOutput_ref_t EVP_SDK_MessageSentOutput_create(flatbuffers_builder_t *B __EVP_SDK_MessageSentOutput_formal_args) -{ - if (EVP_SDK_MessageSentOutput_start(B) - || EVP_SDK_MessageSentOutput_cb_add(B, v0) - || EVP_SDK_MessageSentOutput_cb_userdata_add(B, v2) - || EVP_SDK_MessageSentOutput_reason_add(B, v1)) { - return 0; - } - return EVP_SDK_MessageSentOutput_end(B); -} - -static EVP_SDK_MessageSentOutput_ref_t EVP_SDK_MessageSentOutput_clone(flatbuffers_builder_t *B, EVP_SDK_MessageSentOutput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_MessageSentOutput_start(B) - || EVP_SDK_MessageSentOutput_cb_pick(B, t) - || EVP_SDK_MessageSentOutput_cb_userdata_pick(B, t) - || EVP_SDK_MessageSentOutput_reason_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_MessageSentOutput_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_MessageReceived_topic, EVP_SDK_MessageReceived) -__flatbuffers_build_vector_field(1, flatbuffers_, EVP_SDK_MessageReceived_blob, flatbuffers_uint8, uint8_t, EVP_SDK_MessageReceived) - -static inline EVP_SDK_MessageReceived_ref_t EVP_SDK_MessageReceived_create(flatbuffers_builder_t *B __EVP_SDK_MessageReceived_formal_args) -{ - if (EVP_SDK_MessageReceived_start(B) - || EVP_SDK_MessageReceived_topic_add(B, v0) - || EVP_SDK_MessageReceived_blob_add(B, v1)) { - return 0; - } - return EVP_SDK_MessageReceived_end(B); -} - -static EVP_SDK_MessageReceived_ref_t EVP_SDK_MessageReceived_clone(flatbuffers_builder_t *B, EVP_SDK_MessageReceived_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_MessageReceived_start(B) - || EVP_SDK_MessageReceived_topic_pick(B, t) - || EVP_SDK_MessageReceived_blob_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_MessageReceived_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_TelemetryEntry_key, EVP_SDK_TelemetryEntry) -__flatbuffers_build_string_field(1, flatbuffers_, EVP_SDK_TelemetryEntry_value, EVP_SDK_TelemetryEntry) - -static inline EVP_SDK_TelemetryEntry_ref_t EVP_SDK_TelemetryEntry_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryEntry_formal_args) -{ - if (EVP_SDK_TelemetryEntry_start(B) - || EVP_SDK_TelemetryEntry_key_add(B, v0) - || EVP_SDK_TelemetryEntry_value_add(B, v1)) { - return 0; - } - return EVP_SDK_TelemetryEntry_end(B); -} - -static EVP_SDK_TelemetryEntry_ref_t EVP_SDK_TelemetryEntry_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryEntry_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_TelemetryEntry_start(B) - || EVP_SDK_TelemetryEntry_key_pick(B, t) - || EVP_SDK_TelemetryEntry_value_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_TelemetryEntry_end(B)); -} - -__flatbuffers_build_table_vector_field(0, flatbuffers_, EVP_SDK_TelemetryInput_entries, EVP_SDK_TelemetryEntry, EVP_SDK_TelemetryInput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_TelemetryInput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_TelemetryInput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_TelemetryInput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_TelemetryInput) - -static inline EVP_SDK_TelemetryInput_ref_t EVP_SDK_TelemetryInput_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryInput_formal_args) -{ - if (EVP_SDK_TelemetryInput_start(B) - || EVP_SDK_TelemetryInput_cb_add(B, v1) - || EVP_SDK_TelemetryInput_cb_userdata_add(B, v2) - || EVP_SDK_TelemetryInput_entries_add(B, v0)) { - return 0; - } - return EVP_SDK_TelemetryInput_end(B); -} - -static EVP_SDK_TelemetryInput_ref_t EVP_SDK_TelemetryInput_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryInput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_TelemetryInput_start(B) - || EVP_SDK_TelemetryInput_cb_pick(B, t) - || EVP_SDK_TelemetryInput_cb_userdata_pick(B, t) - || EVP_SDK_TelemetryInput_entries_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_TelemetryInput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_TelemetryOutput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_TelemetryOutput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_TelemetryOutput_reason, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_TelemetryOutput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_TelemetryOutput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_TelemetryOutput) - -static inline EVP_SDK_TelemetryOutput_ref_t EVP_SDK_TelemetryOutput_create(flatbuffers_builder_t *B __EVP_SDK_TelemetryOutput_formal_args) -{ - if (EVP_SDK_TelemetryOutput_start(B) - || EVP_SDK_TelemetryOutput_cb_add(B, v0) - || EVP_SDK_TelemetryOutput_cb_userdata_add(B, v2) - || EVP_SDK_TelemetryOutput_reason_add(B, v1)) { - return 0; - } - return EVP_SDK_TelemetryOutput_end(B); -} - -static EVP_SDK_TelemetryOutput_ref_t EVP_SDK_TelemetryOutput_clone(flatbuffers_builder_t *B, EVP_SDK_TelemetryOutput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_TelemetryOutput_start(B) - || EVP_SDK_TelemetryOutput_cb_pick(B, t) - || EVP_SDK_TelemetryOutput_cb_userdata_pick(B, t) - || EVP_SDK_TelemetryOutput_reason_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_TelemetryOutput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_RpcRequest_id, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcRequest) -__flatbuffers_build_string_field(1, flatbuffers_, EVP_SDK_RpcRequest_method, EVP_SDK_RpcRequest) -__flatbuffers_build_string_field(2, flatbuffers_, EVP_SDK_RpcRequest_params, EVP_SDK_RpcRequest) - -static inline EVP_SDK_RpcRequest_ref_t EVP_SDK_RpcRequest_create(flatbuffers_builder_t *B __EVP_SDK_RpcRequest_formal_args) -{ - if (EVP_SDK_RpcRequest_start(B) - || EVP_SDK_RpcRequest_id_add(B, v0) - || EVP_SDK_RpcRequest_method_add(B, v1) - || EVP_SDK_RpcRequest_params_add(B, v2)) { - return 0; - } - return EVP_SDK_RpcRequest_end(B); -} - -static EVP_SDK_RpcRequest_ref_t EVP_SDK_RpcRequest_clone(flatbuffers_builder_t *B, EVP_SDK_RpcRequest_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_RpcRequest_start(B) - || EVP_SDK_RpcRequest_id_pick(B, t) - || EVP_SDK_RpcRequest_method_pick(B, t) - || EVP_SDK_RpcRequest_params_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_RpcRequest_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_RpcResponseInput_id, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcResponseInput) -__flatbuffers_build_string_field(1, flatbuffers_, EVP_SDK_RpcResponseInput_response, EVP_SDK_RpcResponseInput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_RpcResponseInput_status, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_RpcResponseInput) -__flatbuffers_build_scalar_field(3, flatbuffers_, EVP_SDK_RpcResponseInput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcResponseInput) -__flatbuffers_build_scalar_field(4, flatbuffers_, EVP_SDK_RpcResponseInput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcResponseInput) - -static inline EVP_SDK_RpcResponseInput_ref_t EVP_SDK_RpcResponseInput_create(flatbuffers_builder_t *B __EVP_SDK_RpcResponseInput_formal_args) -{ - if (EVP_SDK_RpcResponseInput_start(B) - || EVP_SDK_RpcResponseInput_id_add(B, v0) - || EVP_SDK_RpcResponseInput_cb_add(B, v3) - || EVP_SDK_RpcResponseInput_cb_userdata_add(B, v4) - || EVP_SDK_RpcResponseInput_response_add(B, v1) - || EVP_SDK_RpcResponseInput_status_add(B, v2)) { - return 0; - } - return EVP_SDK_RpcResponseInput_end(B); -} - -static EVP_SDK_RpcResponseInput_ref_t EVP_SDK_RpcResponseInput_clone(flatbuffers_builder_t *B, EVP_SDK_RpcResponseInput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_RpcResponseInput_start(B) - || EVP_SDK_RpcResponseInput_id_pick(B, t) - || EVP_SDK_RpcResponseInput_cb_pick(B, t) - || EVP_SDK_RpcResponseInput_cb_userdata_pick(B, t) - || EVP_SDK_RpcResponseInput_response_pick(B, t) - || EVP_SDK_RpcResponseInput_status_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_RpcResponseInput_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_RpcResponseOutput_cb, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcResponseOutput) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_RpcResponseOutput_reason, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_RpcResponseOutput) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_RpcResponseOutput_cb_userdata, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_RpcResponseOutput) - -static inline EVP_SDK_RpcResponseOutput_ref_t EVP_SDK_RpcResponseOutput_create(flatbuffers_builder_t *B __EVP_SDK_RpcResponseOutput_formal_args) -{ - if (EVP_SDK_RpcResponseOutput_start(B) - || EVP_SDK_RpcResponseOutput_cb_add(B, v0) - || EVP_SDK_RpcResponseOutput_cb_userdata_add(B, v2) - || EVP_SDK_RpcResponseOutput_reason_add(B, v1)) { - return 0; - } - return EVP_SDK_RpcResponseOutput_end(B); -} - -static EVP_SDK_RpcResponseOutput_ref_t EVP_SDK_RpcResponseOutput_clone(flatbuffers_builder_t *B, EVP_SDK_RpcResponseOutput_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_RpcResponseOutput_start(B) - || EVP_SDK_RpcResponseOutput_cb_pick(B, t) - || EVP_SDK_RpcResponseOutput_cb_userdata_pick(B, t) - || EVP_SDK_RpcResponseOutput_reason_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_RpcResponseOutput_end(B)); -} - -__flatbuffers_build_union_field(1, flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, EVP_SDK_Event) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, config, EVP_SDK_Config) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, state, EVP_SDK_StateOutput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, exit, EVP_SDK_Exit) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, blob, EVP_SDK_BlobOutput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, messageSent, EVP_SDK_MessageSentOutput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, messageReceived, EVP_SDK_MessageReceived) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, telemetry, EVP_SDK_TelemetryOutput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, rpcRequest, EVP_SDK_RpcRequest) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Event_body, EVP_SDK_EventBody, rpcResponse, EVP_SDK_RpcResponseOutput) - -static inline EVP_SDK_Event_ref_t EVP_SDK_Event_create(flatbuffers_builder_t *B __EVP_SDK_Event_formal_args) -{ - if (EVP_SDK_Event_start(B) - || EVP_SDK_Event_body_add_value(B, v1) - || EVP_SDK_Event_body_add_type(B, v1.type)) { - return 0; - } - return EVP_SDK_Event_end(B); -} - -static EVP_SDK_Event_ref_t EVP_SDK_Event_clone(flatbuffers_builder_t *B, EVP_SDK_Event_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Event_start(B) - || EVP_SDK_Event_body_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Event_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_GetEvent_timeout_sec, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_GetEvent) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_GetEvent_timeout_nsec, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), EVP_SDK_GetEvent) - -static inline EVP_SDK_GetEvent_ref_t EVP_SDK_GetEvent_create(flatbuffers_builder_t *B __EVP_SDK_GetEvent_formal_args) -{ - if (EVP_SDK_GetEvent_start(B) - || EVP_SDK_GetEvent_timeout_sec_add(B, v0) - || EVP_SDK_GetEvent_timeout_nsec_add(B, v1)) { - return 0; - } - return EVP_SDK_GetEvent_end(B); -} - -static EVP_SDK_GetEvent_ref_t EVP_SDK_GetEvent_clone(flatbuffers_builder_t *B, EVP_SDK_GetEvent_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_GetEvent_start(B) - || EVP_SDK_GetEvent_timeout_sec_pick(B, t) - || EVP_SDK_GetEvent_timeout_nsec_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_GetEvent_end(B)); -} - - -static inline EVP_SDK_RequestResendConfig_ref_t EVP_SDK_RequestResendConfig_create(flatbuffers_builder_t *B __EVP_SDK_RequestResendConfig_formal_args) -{ - if (EVP_SDK_RequestResendConfig_start(B)) { - return 0; - } - return EVP_SDK_RequestResendConfig_end(B); -} - -static EVP_SDK_RequestResendConfig_ref_t EVP_SDK_RequestResendConfig_clone(flatbuffers_builder_t *B, EVP_SDK_RequestResendConfig_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_RequestResendConfig_start(B)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_RequestResendConfig_end(B)); -} - -__flatbuffers_build_union_field(1, flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, EVP_SDK_Request) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, getEvent, EVP_SDK_GetEvent) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, sendState, EVP_SDK_StateInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, requestResendConfig, EVP_SDK_RequestResendConfig) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, blobOperation, EVP_SDK_BlobInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, sendTelemetry, EVP_SDK_TelemetryInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, sendMessage, EVP_SDK_MessageSentInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, sendRpcResponse, EVP_SDK_RpcResponseInput) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Request_body, EVP_SDK_RequestUnion, streamParamsRequest, EVP_SDK_StreamParamsRequest) - -static inline EVP_SDK_Request_ref_t EVP_SDK_Request_create(flatbuffers_builder_t *B __EVP_SDK_Request_formal_args) -{ - if (EVP_SDK_Request_start(B) - || EVP_SDK_Request_body_add_value(B, v1) - || EVP_SDK_Request_body_add_type(B, v1.type)) { - return 0; - } - return EVP_SDK_Request_end(B); -} - -static EVP_SDK_Request_ref_t EVP_SDK_Request_clone(flatbuffers_builder_t *B, EVP_SDK_Request_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Request_start(B) - || EVP_SDK_Request_body_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Request_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_Simple_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_Simple) - -static inline EVP_SDK_Simple_ref_t EVP_SDK_Simple_create(flatbuffers_builder_t *B __EVP_SDK_Simple_formal_args) -{ - if (EVP_SDK_Simple_start(B) - || EVP_SDK_Simple_result_add(B, v0)) { - return 0; - } - return EVP_SDK_Simple_end(B); -} - -static EVP_SDK_Simple_ref_t EVP_SDK_Simple_clone(flatbuffers_builder_t *B, EVP_SDK_Simple_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Simple_start(B) - || EVP_SDK_Simple_result_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Simple_end(B)); -} - -__flatbuffers_build_union_field(1, flatbuffers_, EVP_SDK_Response_body, EVP_SDK_ResponseUnion, EVP_SDK_Response) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Response_body, EVP_SDK_ResponseUnion, getEvent, EVP_SDK_Event) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Response_body, EVP_SDK_ResponseUnion, simple, EVP_SDK_Simple) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_Response_body, EVP_SDK_ResponseUnion, streamParamsResponse, EVP_SDK_StreamParamsResponse) - -static inline EVP_SDK_Response_ref_t EVP_SDK_Response_create(flatbuffers_builder_t *B __EVP_SDK_Response_formal_args) -{ - if (EVP_SDK_Response_start(B) - || EVP_SDK_Response_body_add_value(B, v1) - || EVP_SDK_Response_body_add_type(B, v1.type)) { - return 0; - } - return EVP_SDK_Response_end(B); -} - -static EVP_SDK_Response_ref_t EVP_SDK_Response_clone(flatbuffers_builder_t *B, EVP_SDK_Response_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_Response_start(B) - || EVP_SDK_Response_body_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_Response_end(B)); -} - -__flatbuffers_build_string_field(0, flatbuffers_, EVP_SDK_StreamParamsRequest_name, EVP_SDK_StreamParamsRequest) - -static inline EVP_SDK_StreamParamsRequest_ref_t EVP_SDK_StreamParamsRequest_create(flatbuffers_builder_t *B __EVP_SDK_StreamParamsRequest_formal_args) -{ - if (EVP_SDK_StreamParamsRequest_start(B) - || EVP_SDK_StreamParamsRequest_name_add(B, v0)) { - return 0; - } - return EVP_SDK_StreamParamsRequest_end(B); -} - -static EVP_SDK_StreamParamsRequest_ref_t EVP_SDK_StreamParamsRequest_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParamsRequest_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_StreamParamsRequest_start(B) - || EVP_SDK_StreamParamsRequest_name_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_StreamParamsRequest_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_StreamNng_mode, EVP_SDK_StreamNngMode, EVP_SDK_StreamNngMode_enum_t, 1, 1, INT8_C(0), EVP_SDK_StreamNng) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_StreamNng_protocol, EVP_SDK_StreamNngProtocol, EVP_SDK_StreamNngProtocol_enum_t, 1, 1, INT8_C(0), EVP_SDK_StreamNng) -__flatbuffers_build_string_field(2, flatbuffers_, EVP_SDK_StreamNng_connection, EVP_SDK_StreamNng) - -static inline EVP_SDK_StreamNng_ref_t EVP_SDK_StreamNng_create(flatbuffers_builder_t *B __EVP_SDK_StreamNng_formal_args) -{ - if (EVP_SDK_StreamNng_start(B) - || EVP_SDK_StreamNng_connection_add(B, v2) - || EVP_SDK_StreamNng_mode_add(B, v0) - || EVP_SDK_StreamNng_protocol_add(B, v1)) { - return 0; - } - return EVP_SDK_StreamNng_end(B); -} - -static EVP_SDK_StreamNng_ref_t EVP_SDK_StreamNng_clone(flatbuffers_builder_t *B, EVP_SDK_StreamNng_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_StreamNng_start(B) - || EVP_SDK_StreamNng_connection_pick(B, t) - || EVP_SDK_StreamNng_mode_pick(B, t) - || EVP_SDK_StreamNng_protocol_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_StreamNng_end(B)); -} - -__flatbuffers_build_scalar_field(0, flatbuffers_, EVP_SDK_StreamParamsResponse_result, flatbuffers_uint32, uint32_t, 4, 4, UINT32_C(0), EVP_SDK_StreamParamsResponse) -__flatbuffers_build_scalar_field(1, flatbuffers_, EVP_SDK_StreamParamsResponse_type, EVP_SDK_StreamType, EVP_SDK_StreamType_enum_t, 1, 1, INT8_C(0), EVP_SDK_StreamParamsResponse) -__flatbuffers_build_scalar_field(2, flatbuffers_, EVP_SDK_StreamParamsResponse_direction, EVP_SDK_StreamDirection, EVP_SDK_StreamDirection_enum_t, 1, 1, INT8_C(0), EVP_SDK_StreamParamsResponse) -__flatbuffers_build_union_field(4, flatbuffers_, EVP_SDK_StreamParamsResponse_params, EVP_SDK_StreamParams, EVP_SDK_StreamParamsResponse) -__flatbuffers_build_union_table_value_field(flatbuffers_, EVP_SDK_StreamParamsResponse_params, EVP_SDK_StreamParams, nng, EVP_SDK_StreamNng) - -static inline EVP_SDK_StreamParamsResponse_ref_t EVP_SDK_StreamParamsResponse_create(flatbuffers_builder_t *B __EVP_SDK_StreamParamsResponse_formal_args) -{ - if (EVP_SDK_StreamParamsResponse_start(B) - || EVP_SDK_StreamParamsResponse_result_add(B, v0) - || EVP_SDK_StreamParamsResponse_params_add_value(B, v4) - || EVP_SDK_StreamParamsResponse_type_add(B, v1) - || EVP_SDK_StreamParamsResponse_direction_add(B, v2) - || EVP_SDK_StreamParamsResponse_params_add_type(B, v4.type)) { - return 0; - } - return EVP_SDK_StreamParamsResponse_end(B); -} - -static EVP_SDK_StreamParamsResponse_ref_t EVP_SDK_StreamParamsResponse_clone(flatbuffers_builder_t *B, EVP_SDK_StreamParamsResponse_table_t t) -{ - __flatbuffers_memoize_begin(B, t); - if (EVP_SDK_StreamParamsResponse_start(B) - || EVP_SDK_StreamParamsResponse_result_pick(B, t) - || EVP_SDK_StreamParamsResponse_params_pick(B, t) - || EVP_SDK_StreamParamsResponse_type_pick(B, t) - || EVP_SDK_StreamParamsResponse_direction_pick(B, t)) { - return 0; - } - __flatbuffers_memoize_end(B, t, EVP_SDK_StreamParamsResponse_end(B)); -} - -#include "flatcc/flatcc_epilogue.h" -#endif /* SDK_BUILDER_H */ diff --git a/src/libevp-agent/sdkenc/sdk_json_printer.h b/src/libevp-agent/sdkenc/sdk_json_printer.h deleted file mode 100644 index c750268e..00000000 --- a/src/libevp-agent/sdkenc/sdk_json_printer.h +++ /dev/null @@ -1,744 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SDK_JSON_PRINTER_H -#define SDK_JSON_PRINTER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -#include "flatcc/flatcc_json_printer.h" -#include "flatcc/flatcc_prologue.h" - -static void EVP_SDK_Config_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_StateInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_StateOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_Exit_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobRequestAzureBlob_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobRequestEvp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobRequestHttp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobRequestHttpExt_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobRequestUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_BlobRequestUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_BlobInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobResultAzureBlob_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobResultEvp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobResultHttp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobResultHttpExt_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_BlobResultUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_BlobResultUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_BlobOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_MessageSentInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_MessageSentOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_MessageReceived_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_TelemetryEntry_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_TelemetryInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_TelemetryOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_RpcRequest_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_RpcResponseInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_RpcResponseOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_EventBody_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_EventBody_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_Event_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_GetEvent_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_RequestResendConfig_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_RequestUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_RequestUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_Request_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_Simple_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_ResponseUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_ResponseUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_Response_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_StreamParamsRequest_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_StreamNng_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); -static void EVP_SDK_StreamParams_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type); -static void EVP_SDK_StreamParams_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud); -static void EVP_SDK_StreamParamsResponse_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td); - -static void EVP_SDK_StreamNngMode_print_json_enum(flatcc_json_printer_t *ctx, int8_t v) -{ - - switch (v) { - case (0): flatcc_json_printer_enum(ctx, "Dial", 4); break; - case (1): flatcc_json_printer_enum(ctx, "Listen", 6); break; - default: flatcc_json_printer_int8(ctx, v); break; - } -} - -static void EVP_SDK_StreamNngProtocol_print_json_enum(flatcc_json_printer_t *ctx, int8_t v) -{ - - switch (v) { - case (0): flatcc_json_printer_enum(ctx, "Push", 4); break; - case (1): flatcc_json_printer_enum(ctx, "Pull", 4); break; - default: flatcc_json_printer_int8(ctx, v); break; - } -} - -static void EVP_SDK_StreamType_print_json_enum(flatcc_json_printer_t *ctx, int8_t v) -{ - - switch (v) { - case (0): flatcc_json_printer_enum(ctx, "Null", 4); break; - case (1): flatcc_json_printer_enum(ctx, "Nng", 3); break; - default: flatcc_json_printer_int8(ctx, v); break; - } -} - -static void EVP_SDK_StreamDirection_print_json_enum(flatcc_json_printer_t *ctx, int8_t v) -{ - - switch (v) { - case (0): flatcc_json_printer_enum(ctx, "In", 2); break; - case (1): flatcc_json_printer_enum(ctx, "Out", 3); break; - default: flatcc_json_printer_int8(ctx, v); break; - } -} - -static void EVP_SDK_BlobRequestUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "azureBlob", 9); - break; - case 2: - flatcc_json_printer_enum(ctx, "evp", 3); - break; - case 3: - flatcc_json_printer_enum(ctx, "http", 4); - break; - case 4: - flatcc_json_printer_enum(ctx, "http_ext", 8); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_BlobRequestUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobRequestAzureBlob_print_json_table); - break; - case 2: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobRequestEvp_print_json_table); - break; - case 3: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobRequestHttp_print_json_table); - break; - case 4: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobRequestHttpExt_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_BlobResultUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "azureBlob", 9); - break; - case 2: - flatcc_json_printer_enum(ctx, "evp", 3); - break; - case 3: - flatcc_json_printer_enum(ctx, "http", 4); - break; - case 4: - flatcc_json_printer_enum(ctx, "http_ext", 8); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_BlobResultUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobResultAzureBlob_print_json_table); - break; - case 2: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobResultEvp_print_json_table); - break; - case 3: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobResultHttp_print_json_table); - break; - case 4: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobResultHttpExt_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_EventBody_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "config", 6); - break; - case 2: - flatcc_json_printer_enum(ctx, "state", 5); - break; - case 3: - flatcc_json_printer_enum(ctx, "exit", 4); - break; - case 4: - flatcc_json_printer_enum(ctx, "blob", 4); - break; - case 5: - flatcc_json_printer_enum(ctx, "messageSent", 11); - break; - case 6: - flatcc_json_printer_enum(ctx, "messageReceived", 15); - break; - case 7: - flatcc_json_printer_enum(ctx, "telemetry", 9); - break; - case 8: - flatcc_json_printer_enum(ctx, "rpcRequest", 10); - break; - case 9: - flatcc_json_printer_enum(ctx, "rpcResponse", 11); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_EventBody_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_Config_print_json_table); - break; - case 2: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_StateOutput_print_json_table); - break; - case 3: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_Exit_print_json_table); - break; - case 4: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobOutput_print_json_table); - break; - case 5: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_MessageSentOutput_print_json_table); - break; - case 6: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_MessageReceived_print_json_table); - break; - case 7: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_TelemetryOutput_print_json_table); - break; - case 8: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_RpcRequest_print_json_table); - break; - case 9: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_RpcResponseOutput_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_RequestUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "getEvent", 8); - break; - case 2: - flatcc_json_printer_enum(ctx, "sendState", 9); - break; - case 3: - flatcc_json_printer_enum(ctx, "requestResendConfig", 19); - break; - case 4: - flatcc_json_printer_enum(ctx, "blobOperation", 13); - break; - case 5: - flatcc_json_printer_enum(ctx, "sendTelemetry", 13); - break; - case 6: - flatcc_json_printer_enum(ctx, "sendMessage", 11); - break; - case 7: - flatcc_json_printer_enum(ctx, "sendRpcResponse", 15); - break; - case 8: - flatcc_json_printer_enum(ctx, "streamParamsRequest", 19); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_RequestUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_GetEvent_print_json_table); - break; - case 2: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_StateInput_print_json_table); - break; - case 3: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_RequestResendConfig_print_json_table); - break; - case 4: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_BlobInput_print_json_table); - break; - case 5: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_TelemetryInput_print_json_table); - break; - case 6: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_MessageSentInput_print_json_table); - break; - case 7: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_RpcResponseInput_print_json_table); - break; - case 8: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_StreamParamsRequest_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_ResponseUnion_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "getEvent", 8); - break; - case 2: - flatcc_json_printer_enum(ctx, "simple", 6); - break; - case 3: - flatcc_json_printer_enum(ctx, "streamParamsResponse", 20); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_ResponseUnion_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_Event_print_json_table); - break; - case 2: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_Simple_print_json_table); - break; - case 3: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_StreamParamsResponse_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_StreamParams_print_json_union_type(flatcc_json_printer_t *ctx, flatbuffers_utype_t type) -{ - switch (type) { - case 1: - flatcc_json_printer_enum(ctx, "nng", 3); - break; - default: - flatcc_json_printer_enum(ctx, "NONE", 4); - break; - } -} - -static void EVP_SDK_StreamParams_print_json_union(flatcc_json_printer_t *ctx, flatcc_json_printer_union_descriptor_t *ud) -{ - switch (ud->type) { - case 1: - flatcc_json_printer_union_table(ctx, ud, EVP_SDK_StreamNng_print_json_table); - break; - default: - break; - } -} - -static void EVP_SDK_Config_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "topic", 5); - flatcc_json_printer_uint8_vector_field(ctx, td, 1, "blob", 4); -} - -static inline int EVP_SDK_Config_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Config_print_json_table); -} - -static void EVP_SDK_StateInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "topic", 5); - flatcc_json_printer_uint8_vector_field(ctx, td, 1, "blob", 4); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 3, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_StateInput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_StateInput_print_json_table); -} - -static void EVP_SDK_StateOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "reason", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_StateOutput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_StateOutput_print_json_table); -} - -static void EVP_SDK_Exit_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ -} - -static inline int EVP_SDK_Exit_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Exit_print_json_table); -} - -static void EVP_SDK_BlobRequestAzureBlob_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "url", 3); -} - -static inline int EVP_SDK_BlobRequestAzureBlob_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobRequestAzureBlob_print_json_table); -} - -static void EVP_SDK_BlobRequestEvp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "remoteName", 10); - flatcc_json_printer_string_field(ctx, td, 1, "storageName", 11); -} - -static inline int EVP_SDK_BlobRequestEvp_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobRequestEvp_print_json_table); -} - -static void EVP_SDK_BlobRequestHttp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "url", 3); -} - -static inline int EVP_SDK_BlobRequestHttp_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobRequestHttp_print_json_table); -} - -static void EVP_SDK_BlobRequestHttpExt_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "url", 3); - flatcc_json_printer_string_vector_field(ctx, td, 1, "headers", 7); -} - -static inline int EVP_SDK_BlobRequestHttpExt_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobRequestHttpExt_print_json_table); -} - -static void EVP_SDK_BlobInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "type", 4, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "op", 2, UINT32_C(0)); - flatcc_json_printer_union_field(ctx, td, 3, "request", 7, EVP_SDK_BlobRequestUnion_print_json_union_type, EVP_SDK_BlobRequestUnion_print_json_union); - flatcc_json_printer_string_field(ctx, td, 4, "filename", 8); - flatcc_json_printer_uint64_field(ctx, td, 5, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 6, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_BlobInput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobInput_print_json_table); -} - -static void EVP_SDK_BlobResultAzureBlob_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "error", 5, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 2, "http_status", 11, UINT32_C(0)); -} - -static inline int EVP_SDK_BlobResultAzureBlob_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobResultAzureBlob_print_json_table); -} - -static void EVP_SDK_BlobResultEvp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "error", 5, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 2, "http_status", 11, UINT32_C(0)); -} - -static inline int EVP_SDK_BlobResultEvp_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobResultEvp_print_json_table); -} - -static void EVP_SDK_BlobResultHttp_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "error", 5, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 2, "http_status", 11, UINT32_C(0)); -} - -static inline int EVP_SDK_BlobResultHttp_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobResultHttp_print_json_table); -} - -static void EVP_SDK_BlobResultHttpExt_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "error", 5, UINT32_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 2, "http_status", 11, UINT32_C(0)); -} - -static inline int EVP_SDK_BlobResultHttpExt_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobResultHttpExt_print_json_table); -} - -static void EVP_SDK_BlobOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_union_field(ctx, td, 1, "result", 6, EVP_SDK_BlobResultUnion_print_json_union_type, EVP_SDK_BlobResultUnion_print_json_union); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 3, "reason", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 4, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_BlobOutput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_BlobOutput_print_json_table); -} - -static void EVP_SDK_MessageSentInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "topic", 5); - flatcc_json_printer_uint8_vector_field(ctx, td, 1, "blob", 4); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 3, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_MessageSentInput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_MessageSentInput_print_json_table); -} - -static void EVP_SDK_MessageSentOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "reason", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_MessageSentOutput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_MessageSentOutput_print_json_table); -} - -static void EVP_SDK_MessageReceived_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "topic", 5); - flatcc_json_printer_uint8_vector_field(ctx, td, 1, "blob", 4); -} - -static inline int EVP_SDK_MessageReceived_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_MessageReceived_print_json_table); -} - -static void EVP_SDK_TelemetryEntry_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "key", 3); - flatcc_json_printer_string_field(ctx, td, 1, "value", 5); -} - -static inline int EVP_SDK_TelemetryEntry_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_TelemetryEntry_print_json_table); -} - -static void EVP_SDK_TelemetryInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_table_vector_field(ctx, td, 0, "entries", 7, EVP_SDK_TelemetryEntry_print_json_table); - flatcc_json_printer_uint64_field(ctx, td, 1, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_TelemetryInput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_TelemetryInput_print_json_table); -} - -static void EVP_SDK_TelemetryOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "reason", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_TelemetryOutput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_TelemetryOutput_print_json_table); -} - -static void EVP_SDK_RpcRequest_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "id", 2, UINT64_C(0)); - flatcc_json_printer_string_field(ctx, td, 1, "method", 6); - flatcc_json_printer_string_field(ctx, td, 2, "params", 6); -} - -static inline int EVP_SDK_RpcRequest_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_RpcRequest_print_json_table); -} - -static void EVP_SDK_RpcResponseInput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "id", 2, UINT64_C(0)); - flatcc_json_printer_string_field(ctx, td, 1, "response", 8); - flatcc_json_printer_uint32_field(ctx, td, 2, "status", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 3, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 4, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_RpcResponseInput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_RpcResponseInput_print_json_table); -} - -static void EVP_SDK_RpcResponseOutput_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "cb", 2, UINT64_C(0)); - flatcc_json_printer_uint32_field(ctx, td, 1, "reason", 6, UINT32_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 2, "cb_userdata", 11, UINT64_C(0)); -} - -static inline int EVP_SDK_RpcResponseOutput_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_RpcResponseOutput_print_json_table); -} - -static void EVP_SDK_Event_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_union_field(ctx, td, 1, "body", 4, EVP_SDK_EventBody_print_json_union_type, EVP_SDK_EventBody_print_json_union); -} - -static inline int EVP_SDK_Event_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Event_print_json_table); -} - -static void EVP_SDK_GetEvent_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint64_field(ctx, td, 0, "timeout_sec", 11, UINT64_C(0)); - flatcc_json_printer_uint64_field(ctx, td, 1, "timeout_nsec", 12, UINT64_C(0)); -} - -static inline int EVP_SDK_GetEvent_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_GetEvent_print_json_table); -} - -static void EVP_SDK_RequestResendConfig_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ -} - -static inline int EVP_SDK_RequestResendConfig_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_RequestResendConfig_print_json_table); -} - -static void EVP_SDK_Request_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_union_field(ctx, td, 1, "body", 4, EVP_SDK_RequestUnion_print_json_union_type, EVP_SDK_RequestUnion_print_json_union); -} - -static inline int EVP_SDK_Request_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Request_print_json_table); -} - -static void EVP_SDK_Simple_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); -} - -static inline int EVP_SDK_Simple_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Simple_print_json_table); -} - -static void EVP_SDK_Response_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_union_field(ctx, td, 1, "body", 4, EVP_SDK_ResponseUnion_print_json_union_type, EVP_SDK_ResponseUnion_print_json_union); -} - -static inline int EVP_SDK_Response_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_Response_print_json_table); -} - -static void EVP_SDK_StreamParamsRequest_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_string_field(ctx, td, 0, "name", 4); -} - -static inline int EVP_SDK_StreamParamsRequest_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_StreamParamsRequest_print_json_table); -} - -static void EVP_SDK_StreamNng_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_int8_enum_field(ctx, td, 0, "mode", 4, INT8_C(0), EVP_SDK_StreamNngMode_print_json_enum); - flatcc_json_printer_int8_enum_field(ctx, td, 1, "protocol", 8, INT8_C(0), EVP_SDK_StreamNngProtocol_print_json_enum); - flatcc_json_printer_string_field(ctx, td, 2, "connection", 10); -} - -static inline int EVP_SDK_StreamNng_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_StreamNng_print_json_table); -} - -static void EVP_SDK_StreamParamsResponse_print_json_table(flatcc_json_printer_t *ctx, flatcc_json_printer_table_descriptor_t *td) -{ - flatcc_json_printer_uint32_field(ctx, td, 0, "result", 6, UINT32_C(0)); - flatcc_json_printer_int8_enum_field(ctx, td, 1, "type", 4, INT8_C(0), EVP_SDK_StreamType_print_json_enum); - flatcc_json_printer_int8_enum_field(ctx, td, 2, "direction", 9, INT8_C(0), EVP_SDK_StreamDirection_print_json_enum); - flatcc_json_printer_union_field(ctx, td, 4, "params", 6, EVP_SDK_StreamParams_print_json_union_type, EVP_SDK_StreamParams_print_json_union); -} - -static inline int EVP_SDK_StreamParamsResponse_print_json_as_root(flatcc_json_printer_t *ctx, const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_json_printer_table_as_root(ctx, buf, bufsiz, fid, EVP_SDK_StreamParamsResponse_print_json_table); -} - -#include "flatcc/flatcc_epilogue.h" -#endif /* SDK_JSON_PRINTER_H */ diff --git a/src/libevp-agent/sdkenc/sdk_reader.h b/src/libevp-agent/sdkenc/sdk_reader.h deleted file mode 100644 index 01e2094a..00000000 --- a/src/libevp-agent/sdkenc/sdk_reader.h +++ /dev/null @@ -1,1217 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SDK_READER_H -#define SDK_READER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -#ifndef FLATBUFFERS_COMMON_READER_H -#include "flatbuffers_common_reader.h" -#endif -#include "flatcc/flatcc_flatbuffers.h" -#ifndef __alignas_is_defined -#include -#endif -#include "flatcc/flatcc_prologue.h" -#ifndef flatbuffers_identifier -#define flatbuffers_identifier 0 -#endif -#ifndef flatbuffers_extension -#define flatbuffers_extension "bin" -#endif - - -typedef const struct EVP_SDK_Config_table *EVP_SDK_Config_table_t; -typedef struct EVP_SDK_Config_table *EVP_SDK_Config_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Config_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Config_mutable_vec_t; -typedef const struct EVP_SDK_StateInput_table *EVP_SDK_StateInput_table_t; -typedef struct EVP_SDK_StateInput_table *EVP_SDK_StateInput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_StateInput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_StateInput_mutable_vec_t; -typedef const struct EVP_SDK_StateOutput_table *EVP_SDK_StateOutput_table_t; -typedef struct EVP_SDK_StateOutput_table *EVP_SDK_StateOutput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_StateOutput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_StateOutput_mutable_vec_t; -typedef const struct EVP_SDK_Exit_table *EVP_SDK_Exit_table_t; -typedef struct EVP_SDK_Exit_table *EVP_SDK_Exit_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Exit_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Exit_mutable_vec_t; -typedef const struct EVP_SDK_BlobRequestAzureBlob_table *EVP_SDK_BlobRequestAzureBlob_table_t; -typedef struct EVP_SDK_BlobRequestAzureBlob_table *EVP_SDK_BlobRequestAzureBlob_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobRequestAzureBlob_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobRequestAzureBlob_mutable_vec_t; -typedef const struct EVP_SDK_BlobRequestEvp_table *EVP_SDK_BlobRequestEvp_table_t; -typedef struct EVP_SDK_BlobRequestEvp_table *EVP_SDK_BlobRequestEvp_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobRequestEvp_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobRequestEvp_mutable_vec_t; -typedef const struct EVP_SDK_BlobRequestHttp_table *EVP_SDK_BlobRequestHttp_table_t; -typedef struct EVP_SDK_BlobRequestHttp_table *EVP_SDK_BlobRequestHttp_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobRequestHttp_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobRequestHttp_mutable_vec_t; -typedef const struct EVP_SDK_BlobRequestHttpExt_table *EVP_SDK_BlobRequestHttpExt_table_t; -typedef struct EVP_SDK_BlobRequestHttpExt_table *EVP_SDK_BlobRequestHttpExt_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobRequestHttpExt_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobRequestHttpExt_mutable_vec_t; -typedef const struct EVP_SDK_BlobInput_table *EVP_SDK_BlobInput_table_t; -typedef struct EVP_SDK_BlobInput_table *EVP_SDK_BlobInput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobInput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobInput_mutable_vec_t; -typedef const struct EVP_SDK_BlobResultAzureBlob_table *EVP_SDK_BlobResultAzureBlob_table_t; -typedef struct EVP_SDK_BlobResultAzureBlob_table *EVP_SDK_BlobResultAzureBlob_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobResultAzureBlob_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobResultAzureBlob_mutable_vec_t; -typedef const struct EVP_SDK_BlobResultEvp_table *EVP_SDK_BlobResultEvp_table_t; -typedef struct EVP_SDK_BlobResultEvp_table *EVP_SDK_BlobResultEvp_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobResultEvp_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobResultEvp_mutable_vec_t; -typedef const struct EVP_SDK_BlobResultHttp_table *EVP_SDK_BlobResultHttp_table_t; -typedef struct EVP_SDK_BlobResultHttp_table *EVP_SDK_BlobResultHttp_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobResultHttp_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobResultHttp_mutable_vec_t; -typedef const struct EVP_SDK_BlobResultHttpExt_table *EVP_SDK_BlobResultHttpExt_table_t; -typedef struct EVP_SDK_BlobResultHttpExt_table *EVP_SDK_BlobResultHttpExt_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobResultHttpExt_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobResultHttpExt_mutable_vec_t; -typedef const struct EVP_SDK_BlobOutput_table *EVP_SDK_BlobOutput_table_t; -typedef struct EVP_SDK_BlobOutput_table *EVP_SDK_BlobOutput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_BlobOutput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_BlobOutput_mutable_vec_t; -typedef const struct EVP_SDK_MessageSentInput_table *EVP_SDK_MessageSentInput_table_t; -typedef struct EVP_SDK_MessageSentInput_table *EVP_SDK_MessageSentInput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_MessageSentInput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_MessageSentInput_mutable_vec_t; -typedef const struct EVP_SDK_MessageSentOutput_table *EVP_SDK_MessageSentOutput_table_t; -typedef struct EVP_SDK_MessageSentOutput_table *EVP_SDK_MessageSentOutput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_MessageSentOutput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_MessageSentOutput_mutable_vec_t; -typedef const struct EVP_SDK_MessageReceived_table *EVP_SDK_MessageReceived_table_t; -typedef struct EVP_SDK_MessageReceived_table *EVP_SDK_MessageReceived_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_MessageReceived_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_MessageReceived_mutable_vec_t; -typedef const struct EVP_SDK_TelemetryEntry_table *EVP_SDK_TelemetryEntry_table_t; -typedef struct EVP_SDK_TelemetryEntry_table *EVP_SDK_TelemetryEntry_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_TelemetryEntry_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_TelemetryEntry_mutable_vec_t; -typedef const struct EVP_SDK_TelemetryInput_table *EVP_SDK_TelemetryInput_table_t; -typedef struct EVP_SDK_TelemetryInput_table *EVP_SDK_TelemetryInput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_TelemetryInput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_TelemetryInput_mutable_vec_t; -typedef const struct EVP_SDK_TelemetryOutput_table *EVP_SDK_TelemetryOutput_table_t; -typedef struct EVP_SDK_TelemetryOutput_table *EVP_SDK_TelemetryOutput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_TelemetryOutput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_TelemetryOutput_mutable_vec_t; -typedef const struct EVP_SDK_RpcRequest_table *EVP_SDK_RpcRequest_table_t; -typedef struct EVP_SDK_RpcRequest_table *EVP_SDK_RpcRequest_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_RpcRequest_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_RpcRequest_mutable_vec_t; -typedef const struct EVP_SDK_RpcResponseInput_table *EVP_SDK_RpcResponseInput_table_t; -typedef struct EVP_SDK_RpcResponseInput_table *EVP_SDK_RpcResponseInput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_RpcResponseInput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_RpcResponseInput_mutable_vec_t; -typedef const struct EVP_SDK_RpcResponseOutput_table *EVP_SDK_RpcResponseOutput_table_t; -typedef struct EVP_SDK_RpcResponseOutput_table *EVP_SDK_RpcResponseOutput_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_RpcResponseOutput_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_RpcResponseOutput_mutable_vec_t; -typedef const struct EVP_SDK_Event_table *EVP_SDK_Event_table_t; -typedef struct EVP_SDK_Event_table *EVP_SDK_Event_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Event_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Event_mutable_vec_t; -typedef const struct EVP_SDK_GetEvent_table *EVP_SDK_GetEvent_table_t; -typedef struct EVP_SDK_GetEvent_table *EVP_SDK_GetEvent_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_GetEvent_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_GetEvent_mutable_vec_t; -typedef const struct EVP_SDK_RequestResendConfig_table *EVP_SDK_RequestResendConfig_table_t; -typedef struct EVP_SDK_RequestResendConfig_table *EVP_SDK_RequestResendConfig_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_RequestResendConfig_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_RequestResendConfig_mutable_vec_t; -typedef const struct EVP_SDK_Request_table *EVP_SDK_Request_table_t; -typedef struct EVP_SDK_Request_table *EVP_SDK_Request_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Request_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Request_mutable_vec_t; -typedef const struct EVP_SDK_Simple_table *EVP_SDK_Simple_table_t; -typedef struct EVP_SDK_Simple_table *EVP_SDK_Simple_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Simple_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Simple_mutable_vec_t; -typedef const struct EVP_SDK_Response_table *EVP_SDK_Response_table_t; -typedef struct EVP_SDK_Response_table *EVP_SDK_Response_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_Response_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_Response_mutable_vec_t; -typedef const struct EVP_SDK_StreamParamsRequest_table *EVP_SDK_StreamParamsRequest_table_t; -typedef struct EVP_SDK_StreamParamsRequest_table *EVP_SDK_StreamParamsRequest_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_StreamParamsRequest_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_StreamParamsRequest_mutable_vec_t; -typedef const struct EVP_SDK_StreamNng_table *EVP_SDK_StreamNng_table_t; -typedef struct EVP_SDK_StreamNng_table *EVP_SDK_StreamNng_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_StreamNng_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_StreamNng_mutable_vec_t; -typedef const struct EVP_SDK_StreamParamsResponse_table *EVP_SDK_StreamParamsResponse_table_t; -typedef struct EVP_SDK_StreamParamsResponse_table *EVP_SDK_StreamParamsResponse_mutable_table_t; -typedef const flatbuffers_uoffset_t *EVP_SDK_StreamParamsResponse_vec_t; -typedef flatbuffers_uoffset_t *EVP_SDK_StreamParamsResponse_mutable_vec_t; -#ifndef EVP_SDK_Config_file_identifier -#define EVP_SDK_Config_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Config_file_identifier */ -#ifndef EVP_SDK_Config_identifier -#define EVP_SDK_Config_identifier 0 -#endif -#define EVP_SDK_Config_type_hash ((flatbuffers_thash_t)0x7364d710) -#define EVP_SDK_Config_type_identifier "\x10\xd7\x64\x73" -#ifndef EVP_SDK_Config_file_extension -#define EVP_SDK_Config_file_extension "bin" -#endif -#ifndef EVP_SDK_StateInput_file_identifier -#define EVP_SDK_StateInput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_StateInput_file_identifier */ -#ifndef EVP_SDK_StateInput_identifier -#define EVP_SDK_StateInput_identifier 0 -#endif -#define EVP_SDK_StateInput_type_hash ((flatbuffers_thash_t)0xb2d1e079) -#define EVP_SDK_StateInput_type_identifier "\x79\xe0\xd1\xb2" -#ifndef EVP_SDK_StateInput_file_extension -#define EVP_SDK_StateInput_file_extension "bin" -#endif -#ifndef EVP_SDK_StateOutput_file_identifier -#define EVP_SDK_StateOutput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_StateOutput_file_identifier */ -#ifndef EVP_SDK_StateOutput_identifier -#define EVP_SDK_StateOutput_identifier 0 -#endif -#define EVP_SDK_StateOutput_type_hash ((flatbuffers_thash_t)0xddff3836) -#define EVP_SDK_StateOutput_type_identifier "\x36\x38\xff\xdd" -#ifndef EVP_SDK_StateOutput_file_extension -#define EVP_SDK_StateOutput_file_extension "bin" -#endif -#ifndef EVP_SDK_Exit_file_identifier -#define EVP_SDK_Exit_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Exit_file_identifier */ -#ifndef EVP_SDK_Exit_identifier -#define EVP_SDK_Exit_identifier 0 -#endif -#define EVP_SDK_Exit_type_hash ((flatbuffers_thash_t)0xfaa2e95e) -#define EVP_SDK_Exit_type_identifier "\x5e\xe9\xa2\xfa" -#ifndef EVP_SDK_Exit_file_extension -#define EVP_SDK_Exit_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobRequestAzureBlob_file_identifier -#define EVP_SDK_BlobRequestAzureBlob_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobRequestAzureBlob_file_identifier */ -#ifndef EVP_SDK_BlobRequestAzureBlob_identifier -#define EVP_SDK_BlobRequestAzureBlob_identifier 0 -#endif -#define EVP_SDK_BlobRequestAzureBlob_type_hash ((flatbuffers_thash_t)0x9b72ef62) -#define EVP_SDK_BlobRequestAzureBlob_type_identifier "\x62\xef\x72\x9b" -#ifndef EVP_SDK_BlobRequestAzureBlob_file_extension -#define EVP_SDK_BlobRequestAzureBlob_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobRequestEvp_file_identifier -#define EVP_SDK_BlobRequestEvp_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobRequestEvp_file_identifier */ -#ifndef EVP_SDK_BlobRequestEvp_identifier -#define EVP_SDK_BlobRequestEvp_identifier 0 -#endif -#define EVP_SDK_BlobRequestEvp_type_hash ((flatbuffers_thash_t)0xfb84e483) -#define EVP_SDK_BlobRequestEvp_type_identifier "\x83\xe4\x84\xfb" -#ifndef EVP_SDK_BlobRequestEvp_file_extension -#define EVP_SDK_BlobRequestEvp_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobRequestHttp_file_identifier -#define EVP_SDK_BlobRequestHttp_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobRequestHttp_file_identifier */ -#ifndef EVP_SDK_BlobRequestHttp_identifier -#define EVP_SDK_BlobRequestHttp_identifier 0 -#endif -#define EVP_SDK_BlobRequestHttp_type_hash ((flatbuffers_thash_t)0xffa84bb2) -#define EVP_SDK_BlobRequestHttp_type_identifier "\xb2\x4b\xa8\xff" -#ifndef EVP_SDK_BlobRequestHttp_file_extension -#define EVP_SDK_BlobRequestHttp_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobRequestHttpExt_file_identifier -#define EVP_SDK_BlobRequestHttpExt_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobRequestHttpExt_file_identifier */ -#ifndef EVP_SDK_BlobRequestHttpExt_identifier -#define EVP_SDK_BlobRequestHttpExt_identifier 0 -#endif -#define EVP_SDK_BlobRequestHttpExt_type_hash ((flatbuffers_thash_t)0x80f28419) -#define EVP_SDK_BlobRequestHttpExt_type_identifier "\x19\x84\xf2\x80" -#ifndef EVP_SDK_BlobRequestHttpExt_file_extension -#define EVP_SDK_BlobRequestHttpExt_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobInput_file_identifier -#define EVP_SDK_BlobInput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobInput_file_identifier */ -#ifndef EVP_SDK_BlobInput_identifier -#define EVP_SDK_BlobInput_identifier 0 -#endif -#define EVP_SDK_BlobInput_type_hash ((flatbuffers_thash_t)0x670c46e3) -#define EVP_SDK_BlobInput_type_identifier "\xe3\x46\x0c\x67" -#ifndef EVP_SDK_BlobInput_file_extension -#define EVP_SDK_BlobInput_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobResultAzureBlob_file_identifier -#define EVP_SDK_BlobResultAzureBlob_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobResultAzureBlob_file_identifier */ -#ifndef EVP_SDK_BlobResultAzureBlob_identifier -#define EVP_SDK_BlobResultAzureBlob_identifier 0 -#endif -#define EVP_SDK_BlobResultAzureBlob_type_hash ((flatbuffers_thash_t)0xcd9e1ac4) -#define EVP_SDK_BlobResultAzureBlob_type_identifier "\xc4\x1a\x9e\xcd" -#ifndef EVP_SDK_BlobResultAzureBlob_file_extension -#define EVP_SDK_BlobResultAzureBlob_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobResultEvp_file_identifier -#define EVP_SDK_BlobResultEvp_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobResultEvp_file_identifier */ -#ifndef EVP_SDK_BlobResultEvp_identifier -#define EVP_SDK_BlobResultEvp_identifier 0 -#endif -#define EVP_SDK_BlobResultEvp_type_hash ((flatbuffers_thash_t)0x7f1996b5) -#define EVP_SDK_BlobResultEvp_type_identifier "\xb5\x96\x19\x7f" -#ifndef EVP_SDK_BlobResultEvp_file_extension -#define EVP_SDK_BlobResultEvp_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobResultHttp_file_identifier -#define EVP_SDK_BlobResultHttp_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobResultHttp_file_identifier */ -#ifndef EVP_SDK_BlobResultHttp_identifier -#define EVP_SDK_BlobResultHttp_identifier 0 -#endif -#define EVP_SDK_BlobResultHttp_type_hash ((flatbuffers_thash_t)0x6f9ccfac) -#define EVP_SDK_BlobResultHttp_type_identifier "\xac\xcf\x9c\x6f" -#ifndef EVP_SDK_BlobResultHttp_file_extension -#define EVP_SDK_BlobResultHttp_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobResultHttpExt_file_identifier -#define EVP_SDK_BlobResultHttpExt_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobResultHttpExt_file_identifier */ -#ifndef EVP_SDK_BlobResultHttpExt_identifier -#define EVP_SDK_BlobResultHttpExt_identifier 0 -#endif -#define EVP_SDK_BlobResultHttpExt_type_hash ((flatbuffers_thash_t)0xf56b4787) -#define EVP_SDK_BlobResultHttpExt_type_identifier "\x87\x47\x6b\xf5" -#ifndef EVP_SDK_BlobResultHttpExt_file_extension -#define EVP_SDK_BlobResultHttpExt_file_extension "bin" -#endif -#ifndef EVP_SDK_BlobOutput_file_identifier -#define EVP_SDK_BlobOutput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_BlobOutput_file_identifier */ -#ifndef EVP_SDK_BlobOutput_identifier -#define EVP_SDK_BlobOutput_identifier 0 -#endif -#define EVP_SDK_BlobOutput_type_hash ((flatbuffers_thash_t)0x65b9ce6c) -#define EVP_SDK_BlobOutput_type_identifier "\x6c\xce\xb9\x65" -#ifndef EVP_SDK_BlobOutput_file_extension -#define EVP_SDK_BlobOutput_file_extension "bin" -#endif -#ifndef EVP_SDK_MessageSentInput_file_identifier -#define EVP_SDK_MessageSentInput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_MessageSentInput_file_identifier */ -#ifndef EVP_SDK_MessageSentInput_identifier -#define EVP_SDK_MessageSentInput_identifier 0 -#endif -#define EVP_SDK_MessageSentInput_type_hash ((flatbuffers_thash_t)0x91727efd) -#define EVP_SDK_MessageSentInput_type_identifier "\xfd\x7e\x72\x91" -#ifndef EVP_SDK_MessageSentInput_file_extension -#define EVP_SDK_MessageSentInput_file_extension "bin" -#endif -#ifndef EVP_SDK_MessageSentOutput_file_identifier -#define EVP_SDK_MessageSentOutput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_MessageSentOutput_file_identifier */ -#ifndef EVP_SDK_MessageSentOutput_identifier -#define EVP_SDK_MessageSentOutput_identifier 0 -#endif -#define EVP_SDK_MessageSentOutput_type_hash ((flatbuffers_thash_t)0xff303a2) -#define EVP_SDK_MessageSentOutput_type_identifier "\xa2\x03\xf3\x0f" -#ifndef EVP_SDK_MessageSentOutput_file_extension -#define EVP_SDK_MessageSentOutput_file_extension "bin" -#endif -#ifndef EVP_SDK_MessageReceived_file_identifier -#define EVP_SDK_MessageReceived_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_MessageReceived_file_identifier */ -#ifndef EVP_SDK_MessageReceived_identifier -#define EVP_SDK_MessageReceived_identifier 0 -#endif -#define EVP_SDK_MessageReceived_type_hash ((flatbuffers_thash_t)0xc41d61c2) -#define EVP_SDK_MessageReceived_type_identifier "\xc2\x61\x1d\xc4" -#ifndef EVP_SDK_MessageReceived_file_extension -#define EVP_SDK_MessageReceived_file_extension "bin" -#endif -#ifndef EVP_SDK_TelemetryEntry_file_identifier -#define EVP_SDK_TelemetryEntry_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_TelemetryEntry_file_identifier */ -#ifndef EVP_SDK_TelemetryEntry_identifier -#define EVP_SDK_TelemetryEntry_identifier 0 -#endif -#define EVP_SDK_TelemetryEntry_type_hash ((flatbuffers_thash_t)0x1df9492b) -#define EVP_SDK_TelemetryEntry_type_identifier "\x2b\x49\xf9\x1d" -#ifndef EVP_SDK_TelemetryEntry_file_extension -#define EVP_SDK_TelemetryEntry_file_extension "bin" -#endif -#ifndef EVP_SDK_TelemetryInput_file_identifier -#define EVP_SDK_TelemetryInput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_TelemetryInput_file_identifier */ -#ifndef EVP_SDK_TelemetryInput_identifier -#define EVP_SDK_TelemetryInput_identifier 0 -#endif -#define EVP_SDK_TelemetryInput_type_hash ((flatbuffers_thash_t)0x5f6e5ad3) -#define EVP_SDK_TelemetryInput_type_identifier "\xd3\x5a\x6e\x5f" -#ifndef EVP_SDK_TelemetryInput_file_extension -#define EVP_SDK_TelemetryInput_file_extension "bin" -#endif -#ifndef EVP_SDK_TelemetryOutput_file_identifier -#define EVP_SDK_TelemetryOutput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_TelemetryOutput_file_identifier */ -#ifndef EVP_SDK_TelemetryOutput_identifier -#define EVP_SDK_TelemetryOutput_identifier 0 -#endif -#define EVP_SDK_TelemetryOutput_type_hash ((flatbuffers_thash_t)0x4d6b10fc) -#define EVP_SDK_TelemetryOutput_type_identifier "\xfc\x10\x6b\x4d" -#ifndef EVP_SDK_TelemetryOutput_file_extension -#define EVP_SDK_TelemetryOutput_file_extension "bin" -#endif -#ifndef EVP_SDK_RpcRequest_file_identifier -#define EVP_SDK_RpcRequest_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_RpcRequest_file_identifier */ -#ifndef EVP_SDK_RpcRequest_identifier -#define EVP_SDK_RpcRequest_identifier 0 -#endif -#define EVP_SDK_RpcRequest_type_hash ((flatbuffers_thash_t)0xdaf8cf82) -#define EVP_SDK_RpcRequest_type_identifier "\x82\xcf\xf8\xda" -#ifndef EVP_SDK_RpcRequest_file_extension -#define EVP_SDK_RpcRequest_file_extension "bin" -#endif -#ifndef EVP_SDK_RpcResponseInput_file_identifier -#define EVP_SDK_RpcResponseInput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_RpcResponseInput_file_identifier */ -#ifndef EVP_SDK_RpcResponseInput_identifier -#define EVP_SDK_RpcResponseInput_identifier 0 -#endif -#define EVP_SDK_RpcResponseInput_type_hash ((flatbuffers_thash_t)0x4dc1a472) -#define EVP_SDK_RpcResponseInput_type_identifier "\x72\xa4\xc1\x4d" -#ifndef EVP_SDK_RpcResponseInput_file_extension -#define EVP_SDK_RpcResponseInput_file_extension "bin" -#endif -#ifndef EVP_SDK_RpcResponseOutput_file_identifier -#define EVP_SDK_RpcResponseOutput_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_RpcResponseOutput_file_identifier */ -#ifndef EVP_SDK_RpcResponseOutput_identifier -#define EVP_SDK_RpcResponseOutput_identifier 0 -#endif -#define EVP_SDK_RpcResponseOutput_type_hash ((flatbuffers_thash_t)0x15d054e7) -#define EVP_SDK_RpcResponseOutput_type_identifier "\xe7\x54\xd0\x15" -#ifndef EVP_SDK_RpcResponseOutput_file_extension -#define EVP_SDK_RpcResponseOutput_file_extension "bin" -#endif -#ifndef EVP_SDK_Event_file_identifier -#define EVP_SDK_Event_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Event_file_identifier */ -#ifndef EVP_SDK_Event_identifier -#define EVP_SDK_Event_identifier 0 -#endif -#define EVP_SDK_Event_type_hash ((flatbuffers_thash_t)0xba6188e2) -#define EVP_SDK_Event_type_identifier "\xe2\x88\x61\xba" -#ifndef EVP_SDK_Event_file_extension -#define EVP_SDK_Event_file_extension "bin" -#endif -#ifndef EVP_SDK_GetEvent_file_identifier -#define EVP_SDK_GetEvent_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_GetEvent_file_identifier */ -#ifndef EVP_SDK_GetEvent_identifier -#define EVP_SDK_GetEvent_identifier 0 -#endif -#define EVP_SDK_GetEvent_type_hash ((flatbuffers_thash_t)0xaa52d20e) -#define EVP_SDK_GetEvent_type_identifier "\x0e\xd2\x52\xaa" -#ifndef EVP_SDK_GetEvent_file_extension -#define EVP_SDK_GetEvent_file_extension "bin" -#endif -#ifndef EVP_SDK_RequestResendConfig_file_identifier -#define EVP_SDK_RequestResendConfig_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_RequestResendConfig_file_identifier */ -#ifndef EVP_SDK_RequestResendConfig_identifier -#define EVP_SDK_RequestResendConfig_identifier 0 -#endif -#define EVP_SDK_RequestResendConfig_type_hash ((flatbuffers_thash_t)0x6d80b9e6) -#define EVP_SDK_RequestResendConfig_type_identifier "\xe6\xb9\x80\x6d" -#ifndef EVP_SDK_RequestResendConfig_file_extension -#define EVP_SDK_RequestResendConfig_file_extension "bin" -#endif -#ifndef EVP_SDK_Request_file_identifier -#define EVP_SDK_Request_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Request_file_identifier */ -#ifndef EVP_SDK_Request_identifier -#define EVP_SDK_Request_identifier 0 -#endif -#define EVP_SDK_Request_type_hash ((flatbuffers_thash_t)0x2960395b) -#define EVP_SDK_Request_type_identifier "\x5b\x39\x60\x29" -#ifndef EVP_SDK_Request_file_extension -#define EVP_SDK_Request_file_extension "bin" -#endif -#ifndef EVP_SDK_Simple_file_identifier -#define EVP_SDK_Simple_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Simple_file_identifier */ -#ifndef EVP_SDK_Simple_identifier -#define EVP_SDK_Simple_identifier 0 -#endif -#define EVP_SDK_Simple_type_hash ((flatbuffers_thash_t)0xd737272c) -#define EVP_SDK_Simple_type_identifier "\x2c\x27\x37\xd7" -#ifndef EVP_SDK_Simple_file_extension -#define EVP_SDK_Simple_file_extension "bin" -#endif -#ifndef EVP_SDK_Response_file_identifier -#define EVP_SDK_Response_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_Response_file_identifier */ -#ifndef EVP_SDK_Response_identifier -#define EVP_SDK_Response_identifier 0 -#endif -#define EVP_SDK_Response_type_hash ((flatbuffers_thash_t)0x8c2c4f59) -#define EVP_SDK_Response_type_identifier "\x59\x4f\x2c\x8c" -#ifndef EVP_SDK_Response_file_extension -#define EVP_SDK_Response_file_extension "bin" -#endif -#ifndef EVP_SDK_StreamParamsRequest_file_identifier -#define EVP_SDK_StreamParamsRequest_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_StreamParamsRequest_file_identifier */ -#ifndef EVP_SDK_StreamParamsRequest_identifier -#define EVP_SDK_StreamParamsRequest_identifier 0 -#endif -#define EVP_SDK_StreamParamsRequest_type_hash ((flatbuffers_thash_t)0x3da8965) -#define EVP_SDK_StreamParamsRequest_type_identifier "\x65\x89\xda\x03" -#ifndef EVP_SDK_StreamParamsRequest_file_extension -#define EVP_SDK_StreamParamsRequest_file_extension "bin" -#endif -#ifndef EVP_SDK_StreamNng_file_identifier -#define EVP_SDK_StreamNng_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_StreamNng_file_identifier */ -#ifndef EVP_SDK_StreamNng_identifier -#define EVP_SDK_StreamNng_identifier 0 -#endif -#define EVP_SDK_StreamNng_type_hash ((flatbuffers_thash_t)0xa148609f) -#define EVP_SDK_StreamNng_type_identifier "\x9f\x60\x48\xa1" -#ifndef EVP_SDK_StreamNng_file_extension -#define EVP_SDK_StreamNng_file_extension "bin" -#endif -#ifndef EVP_SDK_StreamParamsResponse_file_identifier -#define EVP_SDK_StreamParamsResponse_file_identifier 0 -#endif -/* deprecated, use EVP_SDK_StreamParamsResponse_file_identifier */ -#ifndef EVP_SDK_StreamParamsResponse_identifier -#define EVP_SDK_StreamParamsResponse_identifier 0 -#endif -#define EVP_SDK_StreamParamsResponse_type_hash ((flatbuffers_thash_t)0x6f321fbb) -#define EVP_SDK_StreamParamsResponse_type_identifier "\xbb\x1f\x32\x6f" -#ifndef EVP_SDK_StreamParamsResponse_file_extension -#define EVP_SDK_StreamParamsResponse_file_extension "bin" -#endif - -typedef int8_t EVP_SDK_StreamNngMode_enum_t; -__flatbuffers_define_integer_type(EVP_SDK_StreamNngMode, EVP_SDK_StreamNngMode_enum_t, 8) -#define EVP_SDK_StreamNngMode_Dial ((EVP_SDK_StreamNngMode_enum_t)INT8_C(0)) -#define EVP_SDK_StreamNngMode_Listen ((EVP_SDK_StreamNngMode_enum_t)INT8_C(1)) - -static inline const char *EVP_SDK_StreamNngMode_name(EVP_SDK_StreamNngMode_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamNngMode_Dial: return "Dial"; - case EVP_SDK_StreamNngMode_Listen: return "Listen"; - default: return ""; - } -} - -static inline int EVP_SDK_StreamNngMode_is_known_value(EVP_SDK_StreamNngMode_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamNngMode_Dial: return 1; - case EVP_SDK_StreamNngMode_Listen: return 1; - default: return 0; - } -} - -typedef int8_t EVP_SDK_StreamNngProtocol_enum_t; -__flatbuffers_define_integer_type(EVP_SDK_StreamNngProtocol, EVP_SDK_StreamNngProtocol_enum_t, 8) -#define EVP_SDK_StreamNngProtocol_Push ((EVP_SDK_StreamNngProtocol_enum_t)INT8_C(0)) -#define EVP_SDK_StreamNngProtocol_Pull ((EVP_SDK_StreamNngProtocol_enum_t)INT8_C(1)) - -static inline const char *EVP_SDK_StreamNngProtocol_name(EVP_SDK_StreamNngProtocol_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamNngProtocol_Push: return "Push"; - case EVP_SDK_StreamNngProtocol_Pull: return "Pull"; - default: return ""; - } -} - -static inline int EVP_SDK_StreamNngProtocol_is_known_value(EVP_SDK_StreamNngProtocol_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamNngProtocol_Push: return 1; - case EVP_SDK_StreamNngProtocol_Pull: return 1; - default: return 0; - } -} - -typedef int8_t EVP_SDK_StreamType_enum_t; -__flatbuffers_define_integer_type(EVP_SDK_StreamType, EVP_SDK_StreamType_enum_t, 8) -#define EVP_SDK_StreamType_Null ((EVP_SDK_StreamType_enum_t)INT8_C(0)) -#define EVP_SDK_StreamType_Nng ((EVP_SDK_StreamType_enum_t)INT8_C(1)) - -static inline const char *EVP_SDK_StreamType_name(EVP_SDK_StreamType_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamType_Null: return "Null"; - case EVP_SDK_StreamType_Nng: return "Nng"; - default: return ""; - } -} - -static inline int EVP_SDK_StreamType_is_known_value(EVP_SDK_StreamType_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamType_Null: return 1; - case EVP_SDK_StreamType_Nng: return 1; - default: return 0; - } -} - -typedef int8_t EVP_SDK_StreamDirection_enum_t; -__flatbuffers_define_integer_type(EVP_SDK_StreamDirection, EVP_SDK_StreamDirection_enum_t, 8) -#define EVP_SDK_StreamDirection_In ((EVP_SDK_StreamDirection_enum_t)INT8_C(0)) -#define EVP_SDK_StreamDirection_Out ((EVP_SDK_StreamDirection_enum_t)INT8_C(1)) - -static inline const char *EVP_SDK_StreamDirection_name(EVP_SDK_StreamDirection_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamDirection_In: return "In"; - case EVP_SDK_StreamDirection_Out: return "Out"; - default: return ""; - } -} - -static inline int EVP_SDK_StreamDirection_is_known_value(EVP_SDK_StreamDirection_enum_t value) -{ - switch (value) { - case EVP_SDK_StreamDirection_In: return 1; - case EVP_SDK_StreamDirection_Out: return 1; - default: return 0; - } -} - - - -struct EVP_SDK_Config_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Config_vec_len(EVP_SDK_Config_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Config_table_t EVP_SDK_Config_vec_at(EVP_SDK_Config_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Config_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Config) - -__flatbuffers_define_string_field(0, EVP_SDK_Config, topic, 1) -__flatbuffers_define_vector_field(1, EVP_SDK_Config, blob, flatbuffers_uint8_vec_t, 1) - -struct EVP_SDK_StateInput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_StateInput_vec_len(EVP_SDK_StateInput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_StateInput_table_t EVP_SDK_StateInput_vec_at(EVP_SDK_StateInput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_StateInput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_StateInput) - -__flatbuffers_define_string_field(0, EVP_SDK_StateInput, topic, 1) -__flatbuffers_define_vector_field(1, EVP_SDK_StateInput, blob, flatbuffers_uint8_vec_t, 1) -__flatbuffers_define_scalar_field(2, EVP_SDK_StateInput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(3, EVP_SDK_StateInput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_StateOutput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_StateOutput_vec_len(EVP_SDK_StateOutput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_StateOutput_table_t EVP_SDK_StateOutput_vec_at(EVP_SDK_StateOutput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_StateOutput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_StateOutput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_StateOutput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_StateOutput, reason, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_StateOutput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_Exit_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Exit_vec_len(EVP_SDK_Exit_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Exit_table_t EVP_SDK_Exit_vec_at(EVP_SDK_Exit_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Exit_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Exit) - - -struct EVP_SDK_BlobRequestAzureBlob_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobRequestAzureBlob_vec_len(EVP_SDK_BlobRequestAzureBlob_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobRequestAzureBlob_table_t EVP_SDK_BlobRequestAzureBlob_vec_at(EVP_SDK_BlobRequestAzureBlob_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobRequestAzureBlob_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobRequestAzureBlob) - -__flatbuffers_define_string_field(0, EVP_SDK_BlobRequestAzureBlob, url, 1) - -struct EVP_SDK_BlobRequestEvp_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobRequestEvp_vec_len(EVP_SDK_BlobRequestEvp_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobRequestEvp_table_t EVP_SDK_BlobRequestEvp_vec_at(EVP_SDK_BlobRequestEvp_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobRequestEvp_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobRequestEvp) - -__flatbuffers_define_string_field(0, EVP_SDK_BlobRequestEvp, remoteName, 1) -__flatbuffers_define_string_field(1, EVP_SDK_BlobRequestEvp, storageName, 0) - -struct EVP_SDK_BlobRequestHttp_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobRequestHttp_vec_len(EVP_SDK_BlobRequestHttp_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobRequestHttp_table_t EVP_SDK_BlobRequestHttp_vec_at(EVP_SDK_BlobRequestHttp_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobRequestHttp_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobRequestHttp) - -__flatbuffers_define_string_field(0, EVP_SDK_BlobRequestHttp, url, 1) - -struct EVP_SDK_BlobRequestHttpExt_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobRequestHttpExt_vec_len(EVP_SDK_BlobRequestHttpExt_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobRequestHttpExt_table_t EVP_SDK_BlobRequestHttpExt_vec_at(EVP_SDK_BlobRequestHttpExt_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobRequestHttpExt_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobRequestHttpExt) - -__flatbuffers_define_string_field(0, EVP_SDK_BlobRequestHttpExt, url, 1) -__flatbuffers_define_vector_field(1, EVP_SDK_BlobRequestHttpExt, headers, flatbuffers_string_vec_t, 1) -typedef uint8_t EVP_SDK_BlobRequestUnion_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_BlobRequestUnion, EVP_SDK_BlobRequestUnion_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_BlobRequestUnion) -#define EVP_SDK_BlobRequestUnion_NONE ((EVP_SDK_BlobRequestUnion_union_type_t)UINT8_C(0)) -#define EVP_SDK_BlobRequestUnion_azureBlob ((EVP_SDK_BlobRequestUnion_union_type_t)UINT8_C(1)) -#define EVP_SDK_BlobRequestUnion_evp ((EVP_SDK_BlobRequestUnion_union_type_t)UINT8_C(2)) -#define EVP_SDK_BlobRequestUnion_http ((EVP_SDK_BlobRequestUnion_union_type_t)UINT8_C(3)) -#define EVP_SDK_BlobRequestUnion_http_ext ((EVP_SDK_BlobRequestUnion_union_type_t)UINT8_C(4)) - -static inline const char *EVP_SDK_BlobRequestUnion_type_name(EVP_SDK_BlobRequestUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_BlobRequestUnion_NONE: return "NONE"; - case EVP_SDK_BlobRequestUnion_azureBlob: return "azureBlob"; - case EVP_SDK_BlobRequestUnion_evp: return "evp"; - case EVP_SDK_BlobRequestUnion_http: return "http"; - case EVP_SDK_BlobRequestUnion_http_ext: return "http_ext"; - default: return ""; - } -} - -static inline int EVP_SDK_BlobRequestUnion_is_known_type(EVP_SDK_BlobRequestUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_BlobRequestUnion_NONE: return 1; - case EVP_SDK_BlobRequestUnion_azureBlob: return 1; - case EVP_SDK_BlobRequestUnion_evp: return 1; - case EVP_SDK_BlobRequestUnion_http: return 1; - case EVP_SDK_BlobRequestUnion_http_ext: return 1; - default: return 0; - } -} - - -struct EVP_SDK_BlobInput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobInput_vec_len(EVP_SDK_BlobInput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobInput_table_t EVP_SDK_BlobInput_vec_at(EVP_SDK_BlobInput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobInput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobInput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_BlobInput, type, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_BlobInput, op, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_union_field(flatbuffers_, 3, EVP_SDK_BlobInput, request, EVP_SDK_BlobRequestUnion, 1) -__flatbuffers_define_string_field(4, EVP_SDK_BlobInput, filename, 1) -__flatbuffers_define_scalar_field(5, EVP_SDK_BlobInput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(6, EVP_SDK_BlobInput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_BlobResultAzureBlob_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobResultAzureBlob_vec_len(EVP_SDK_BlobResultAzureBlob_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobResultAzureBlob_table_t EVP_SDK_BlobResultAzureBlob_vec_at(EVP_SDK_BlobResultAzureBlob_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobResultAzureBlob_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobResultAzureBlob) - -__flatbuffers_define_scalar_field(0, EVP_SDK_BlobResultAzureBlob, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_BlobResultAzureBlob, error, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_BlobResultAzureBlob, http_status, flatbuffers_uint32, uint32_t, UINT32_C(0)) - -struct EVP_SDK_BlobResultEvp_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobResultEvp_vec_len(EVP_SDK_BlobResultEvp_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobResultEvp_table_t EVP_SDK_BlobResultEvp_vec_at(EVP_SDK_BlobResultEvp_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobResultEvp_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobResultEvp) - -__flatbuffers_define_scalar_field(0, EVP_SDK_BlobResultEvp, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_BlobResultEvp, error, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_BlobResultEvp, http_status, flatbuffers_uint32, uint32_t, UINT32_C(0)) - -struct EVP_SDK_BlobResultHttp_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobResultHttp_vec_len(EVP_SDK_BlobResultHttp_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobResultHttp_table_t EVP_SDK_BlobResultHttp_vec_at(EVP_SDK_BlobResultHttp_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobResultHttp_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobResultHttp) - -__flatbuffers_define_scalar_field(0, EVP_SDK_BlobResultHttp, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_BlobResultHttp, error, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_BlobResultHttp, http_status, flatbuffers_uint32, uint32_t, UINT32_C(0)) - -struct EVP_SDK_BlobResultHttpExt_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobResultHttpExt_vec_len(EVP_SDK_BlobResultHttpExt_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobResultHttpExt_table_t EVP_SDK_BlobResultHttpExt_vec_at(EVP_SDK_BlobResultHttpExt_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobResultHttpExt_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobResultHttpExt) - -__flatbuffers_define_scalar_field(0, EVP_SDK_BlobResultHttpExt, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_BlobResultHttpExt, error, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_BlobResultHttpExt, http_status, flatbuffers_uint32, uint32_t, UINT32_C(0)) -typedef uint8_t EVP_SDK_BlobResultUnion_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_BlobResultUnion, EVP_SDK_BlobResultUnion_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_BlobResultUnion) -#define EVP_SDK_BlobResultUnion_NONE ((EVP_SDK_BlobResultUnion_union_type_t)UINT8_C(0)) -#define EVP_SDK_BlobResultUnion_azureBlob ((EVP_SDK_BlobResultUnion_union_type_t)UINT8_C(1)) -#define EVP_SDK_BlobResultUnion_evp ((EVP_SDK_BlobResultUnion_union_type_t)UINT8_C(2)) -#define EVP_SDK_BlobResultUnion_http ((EVP_SDK_BlobResultUnion_union_type_t)UINT8_C(3)) -#define EVP_SDK_BlobResultUnion_http_ext ((EVP_SDK_BlobResultUnion_union_type_t)UINT8_C(4)) - -static inline const char *EVP_SDK_BlobResultUnion_type_name(EVP_SDK_BlobResultUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_BlobResultUnion_NONE: return "NONE"; - case EVP_SDK_BlobResultUnion_azureBlob: return "azureBlob"; - case EVP_SDK_BlobResultUnion_evp: return "evp"; - case EVP_SDK_BlobResultUnion_http: return "http"; - case EVP_SDK_BlobResultUnion_http_ext: return "http_ext"; - default: return ""; - } -} - -static inline int EVP_SDK_BlobResultUnion_is_known_type(EVP_SDK_BlobResultUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_BlobResultUnion_NONE: return 1; - case EVP_SDK_BlobResultUnion_azureBlob: return 1; - case EVP_SDK_BlobResultUnion_evp: return 1; - case EVP_SDK_BlobResultUnion_http: return 1; - case EVP_SDK_BlobResultUnion_http_ext: return 1; - default: return 0; - } -} - - -struct EVP_SDK_BlobOutput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_BlobOutput_vec_len(EVP_SDK_BlobOutput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_BlobOutput_table_t EVP_SDK_BlobOutput_vec_at(EVP_SDK_BlobOutput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_BlobOutput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_BlobOutput) - -__flatbuffers_define_union_field(flatbuffers_, 1, EVP_SDK_BlobOutput, result, EVP_SDK_BlobResultUnion, 0) -__flatbuffers_define_scalar_field(2, EVP_SDK_BlobOutput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(3, EVP_SDK_BlobOutput, reason, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(4, EVP_SDK_BlobOutput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_MessageSentInput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_MessageSentInput_vec_len(EVP_SDK_MessageSentInput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_MessageSentInput_table_t EVP_SDK_MessageSentInput_vec_at(EVP_SDK_MessageSentInput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_MessageSentInput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_MessageSentInput) - -__flatbuffers_define_string_field(0, EVP_SDK_MessageSentInput, topic, 1) -__flatbuffers_define_vector_field(1, EVP_SDK_MessageSentInput, blob, flatbuffers_uint8_vec_t, 1) -__flatbuffers_define_scalar_field(2, EVP_SDK_MessageSentInput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(3, EVP_SDK_MessageSentInput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_MessageSentOutput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_MessageSentOutput_vec_len(EVP_SDK_MessageSentOutput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_MessageSentOutput_table_t EVP_SDK_MessageSentOutput_vec_at(EVP_SDK_MessageSentOutput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_MessageSentOutput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_MessageSentOutput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_MessageSentOutput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_MessageSentOutput, reason, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_MessageSentOutput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_MessageReceived_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_MessageReceived_vec_len(EVP_SDK_MessageReceived_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_MessageReceived_table_t EVP_SDK_MessageReceived_vec_at(EVP_SDK_MessageReceived_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_MessageReceived_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_MessageReceived) - -__flatbuffers_define_string_field(0, EVP_SDK_MessageReceived, topic, 1) -__flatbuffers_define_vector_field(1, EVP_SDK_MessageReceived, blob, flatbuffers_uint8_vec_t, 1) - -struct EVP_SDK_TelemetryEntry_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_TelemetryEntry_vec_len(EVP_SDK_TelemetryEntry_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_TelemetryEntry_table_t EVP_SDK_TelemetryEntry_vec_at(EVP_SDK_TelemetryEntry_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_TelemetryEntry_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_TelemetryEntry) - -__flatbuffers_define_string_field(0, EVP_SDK_TelemetryEntry, key, 1) -__flatbuffers_define_string_field(1, EVP_SDK_TelemetryEntry, value, 1) - -struct EVP_SDK_TelemetryInput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_TelemetryInput_vec_len(EVP_SDK_TelemetryInput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_TelemetryInput_table_t EVP_SDK_TelemetryInput_vec_at(EVP_SDK_TelemetryInput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_TelemetryInput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_TelemetryInput) - -__flatbuffers_define_vector_field(0, EVP_SDK_TelemetryInput, entries, EVP_SDK_TelemetryEntry_vec_t, 0) -__flatbuffers_define_scalar_field(1, EVP_SDK_TelemetryInput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_TelemetryInput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_TelemetryOutput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_TelemetryOutput_vec_len(EVP_SDK_TelemetryOutput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_TelemetryOutput_table_t EVP_SDK_TelemetryOutput_vec_at(EVP_SDK_TelemetryOutput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_TelemetryOutput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_TelemetryOutput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_TelemetryOutput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_TelemetryOutput, reason, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_TelemetryOutput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_RpcRequest_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_RpcRequest_vec_len(EVP_SDK_RpcRequest_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_RpcRequest_table_t EVP_SDK_RpcRequest_vec_at(EVP_SDK_RpcRequest_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_RpcRequest_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_RpcRequest) - -__flatbuffers_define_scalar_field(0, EVP_SDK_RpcRequest, id, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_string_field(1, EVP_SDK_RpcRequest, method, 1) -__flatbuffers_define_string_field(2, EVP_SDK_RpcRequest, params, 1) - -struct EVP_SDK_RpcResponseInput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_RpcResponseInput_vec_len(EVP_SDK_RpcResponseInput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_RpcResponseInput_table_t EVP_SDK_RpcResponseInput_vec_at(EVP_SDK_RpcResponseInput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_RpcResponseInput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_RpcResponseInput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_RpcResponseInput, id, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_string_field(1, EVP_SDK_RpcResponseInput, response, 0) -__flatbuffers_define_scalar_field(2, EVP_SDK_RpcResponseInput, status, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(3, EVP_SDK_RpcResponseInput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(4, EVP_SDK_RpcResponseInput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_RpcResponseOutput_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_RpcResponseOutput_vec_len(EVP_SDK_RpcResponseOutput_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_RpcResponseOutput_table_t EVP_SDK_RpcResponseOutput_vec_at(EVP_SDK_RpcResponseOutput_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_RpcResponseOutput_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_RpcResponseOutput) - -__flatbuffers_define_scalar_field(0, EVP_SDK_RpcResponseOutput, cb, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_RpcResponseOutput, reason, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_RpcResponseOutput, cb_userdata, flatbuffers_uint64, uint64_t, UINT64_C(0)) -typedef uint8_t EVP_SDK_EventBody_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_EventBody, EVP_SDK_EventBody_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_EventBody) -#define EVP_SDK_EventBody_NONE ((EVP_SDK_EventBody_union_type_t)UINT8_C(0)) -#define EVP_SDK_EventBody_config ((EVP_SDK_EventBody_union_type_t)UINT8_C(1)) -#define EVP_SDK_EventBody_state ((EVP_SDK_EventBody_union_type_t)UINT8_C(2)) -#define EVP_SDK_EventBody_exit ((EVP_SDK_EventBody_union_type_t)UINT8_C(3)) -#define EVP_SDK_EventBody_blob ((EVP_SDK_EventBody_union_type_t)UINT8_C(4)) -#define EVP_SDK_EventBody_messageSent ((EVP_SDK_EventBody_union_type_t)UINT8_C(5)) -#define EVP_SDK_EventBody_messageReceived ((EVP_SDK_EventBody_union_type_t)UINT8_C(6)) -#define EVP_SDK_EventBody_telemetry ((EVP_SDK_EventBody_union_type_t)UINT8_C(7)) -#define EVP_SDK_EventBody_rpcRequest ((EVP_SDK_EventBody_union_type_t)UINT8_C(8)) -#define EVP_SDK_EventBody_rpcResponse ((EVP_SDK_EventBody_union_type_t)UINT8_C(9)) - -static inline const char *EVP_SDK_EventBody_type_name(EVP_SDK_EventBody_union_type_t type) -{ - switch (type) { - case EVP_SDK_EventBody_NONE: return "NONE"; - case EVP_SDK_EventBody_config: return "config"; - case EVP_SDK_EventBody_state: return "state"; - case EVP_SDK_EventBody_exit: return "exit"; - case EVP_SDK_EventBody_blob: return "blob"; - case EVP_SDK_EventBody_messageSent: return "messageSent"; - case EVP_SDK_EventBody_messageReceived: return "messageReceived"; - case EVP_SDK_EventBody_telemetry: return "telemetry"; - case EVP_SDK_EventBody_rpcRequest: return "rpcRequest"; - case EVP_SDK_EventBody_rpcResponse: return "rpcResponse"; - default: return ""; - } -} - -static inline int EVP_SDK_EventBody_is_known_type(EVP_SDK_EventBody_union_type_t type) -{ - switch (type) { - case EVP_SDK_EventBody_NONE: return 1; - case EVP_SDK_EventBody_config: return 1; - case EVP_SDK_EventBody_state: return 1; - case EVP_SDK_EventBody_exit: return 1; - case EVP_SDK_EventBody_blob: return 1; - case EVP_SDK_EventBody_messageSent: return 1; - case EVP_SDK_EventBody_messageReceived: return 1; - case EVP_SDK_EventBody_telemetry: return 1; - case EVP_SDK_EventBody_rpcRequest: return 1; - case EVP_SDK_EventBody_rpcResponse: return 1; - default: return 0; - } -} - - -struct EVP_SDK_Event_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Event_vec_len(EVP_SDK_Event_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Event_table_t EVP_SDK_Event_vec_at(EVP_SDK_Event_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Event_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Event) - -__flatbuffers_define_union_field(flatbuffers_, 1, EVP_SDK_Event, body, EVP_SDK_EventBody, 0) - -struct EVP_SDK_GetEvent_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_GetEvent_vec_len(EVP_SDK_GetEvent_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_GetEvent_table_t EVP_SDK_GetEvent_vec_at(EVP_SDK_GetEvent_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_GetEvent_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_GetEvent) - -__flatbuffers_define_scalar_field(0, EVP_SDK_GetEvent, timeout_sec, flatbuffers_uint64, uint64_t, UINT64_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_GetEvent, timeout_nsec, flatbuffers_uint64, uint64_t, UINT64_C(0)) - -struct EVP_SDK_RequestResendConfig_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_RequestResendConfig_vec_len(EVP_SDK_RequestResendConfig_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_RequestResendConfig_table_t EVP_SDK_RequestResendConfig_vec_at(EVP_SDK_RequestResendConfig_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_RequestResendConfig_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_RequestResendConfig) - -typedef uint8_t EVP_SDK_RequestUnion_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_RequestUnion, EVP_SDK_RequestUnion_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_RequestUnion) -#define EVP_SDK_RequestUnion_NONE ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(0)) -#define EVP_SDK_RequestUnion_getEvent ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(1)) -#define EVP_SDK_RequestUnion_sendState ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(2)) -#define EVP_SDK_RequestUnion_requestResendConfig ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(3)) -#define EVP_SDK_RequestUnion_blobOperation ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(4)) -#define EVP_SDK_RequestUnion_sendTelemetry ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(5)) -#define EVP_SDK_RequestUnion_sendMessage ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(6)) -#define EVP_SDK_RequestUnion_sendRpcResponse ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(7)) -#define EVP_SDK_RequestUnion_streamParamsRequest ((EVP_SDK_RequestUnion_union_type_t)UINT8_C(8)) - -static inline const char *EVP_SDK_RequestUnion_type_name(EVP_SDK_RequestUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_RequestUnion_NONE: return "NONE"; - case EVP_SDK_RequestUnion_getEvent: return "getEvent"; - case EVP_SDK_RequestUnion_sendState: return "sendState"; - case EVP_SDK_RequestUnion_requestResendConfig: return "requestResendConfig"; - case EVP_SDK_RequestUnion_blobOperation: return "blobOperation"; - case EVP_SDK_RequestUnion_sendTelemetry: return "sendTelemetry"; - case EVP_SDK_RequestUnion_sendMessage: return "sendMessage"; - case EVP_SDK_RequestUnion_sendRpcResponse: return "sendRpcResponse"; - case EVP_SDK_RequestUnion_streamParamsRequest: return "streamParamsRequest"; - default: return ""; - } -} - -static inline int EVP_SDK_RequestUnion_is_known_type(EVP_SDK_RequestUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_RequestUnion_NONE: return 1; - case EVP_SDK_RequestUnion_getEvent: return 1; - case EVP_SDK_RequestUnion_sendState: return 1; - case EVP_SDK_RequestUnion_requestResendConfig: return 1; - case EVP_SDK_RequestUnion_blobOperation: return 1; - case EVP_SDK_RequestUnion_sendTelemetry: return 1; - case EVP_SDK_RequestUnion_sendMessage: return 1; - case EVP_SDK_RequestUnion_sendRpcResponse: return 1; - case EVP_SDK_RequestUnion_streamParamsRequest: return 1; - default: return 0; - } -} - - -struct EVP_SDK_Request_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Request_vec_len(EVP_SDK_Request_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Request_table_t EVP_SDK_Request_vec_at(EVP_SDK_Request_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Request_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Request) - -__flatbuffers_define_union_field(flatbuffers_, 1, EVP_SDK_Request, body, EVP_SDK_RequestUnion, 1) - -struct EVP_SDK_Simple_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Simple_vec_len(EVP_SDK_Simple_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Simple_table_t EVP_SDK_Simple_vec_at(EVP_SDK_Simple_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Simple_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Simple) - -__flatbuffers_define_scalar_field(0, EVP_SDK_Simple, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -typedef uint8_t EVP_SDK_ResponseUnion_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_ResponseUnion, EVP_SDK_ResponseUnion_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_ResponseUnion) -#define EVP_SDK_ResponseUnion_NONE ((EVP_SDK_ResponseUnion_union_type_t)UINT8_C(0)) -#define EVP_SDK_ResponseUnion_getEvent ((EVP_SDK_ResponseUnion_union_type_t)UINT8_C(1)) -#define EVP_SDK_ResponseUnion_simple ((EVP_SDK_ResponseUnion_union_type_t)UINT8_C(2)) -#define EVP_SDK_ResponseUnion_streamParamsResponse ((EVP_SDK_ResponseUnion_union_type_t)UINT8_C(3)) - -static inline const char *EVP_SDK_ResponseUnion_type_name(EVP_SDK_ResponseUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_ResponseUnion_NONE: return "NONE"; - case EVP_SDK_ResponseUnion_getEvent: return "getEvent"; - case EVP_SDK_ResponseUnion_simple: return "simple"; - case EVP_SDK_ResponseUnion_streamParamsResponse: return "streamParamsResponse"; - default: return ""; - } -} - -static inline int EVP_SDK_ResponseUnion_is_known_type(EVP_SDK_ResponseUnion_union_type_t type) -{ - switch (type) { - case EVP_SDK_ResponseUnion_NONE: return 1; - case EVP_SDK_ResponseUnion_getEvent: return 1; - case EVP_SDK_ResponseUnion_simple: return 1; - case EVP_SDK_ResponseUnion_streamParamsResponse: return 1; - default: return 0; - } -} - - -struct EVP_SDK_Response_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_Response_vec_len(EVP_SDK_Response_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_Response_table_t EVP_SDK_Response_vec_at(EVP_SDK_Response_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_Response_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_Response) - -__flatbuffers_define_union_field(flatbuffers_, 1, EVP_SDK_Response, body, EVP_SDK_ResponseUnion, 1) - -struct EVP_SDK_StreamParamsRequest_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_StreamParamsRequest_vec_len(EVP_SDK_StreamParamsRequest_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_StreamParamsRequest_table_t EVP_SDK_StreamParamsRequest_vec_at(EVP_SDK_StreamParamsRequest_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_StreamParamsRequest_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_StreamParamsRequest) - -__flatbuffers_define_string_field(0, EVP_SDK_StreamParamsRequest, name, 0) - -struct EVP_SDK_StreamNng_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_StreamNng_vec_len(EVP_SDK_StreamNng_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_StreamNng_table_t EVP_SDK_StreamNng_vec_at(EVP_SDK_StreamNng_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_StreamNng_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_StreamNng) - -__flatbuffers_define_scalar_field(0, EVP_SDK_StreamNng, mode, EVP_SDK_StreamNngMode, EVP_SDK_StreamNngMode_enum_t, INT8_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_StreamNng, protocol, EVP_SDK_StreamNngProtocol, EVP_SDK_StreamNngProtocol_enum_t, INT8_C(0)) -__flatbuffers_define_string_field(2, EVP_SDK_StreamNng, connection, 0) -typedef uint8_t EVP_SDK_StreamParams_union_type_t; -__flatbuffers_define_integer_type(EVP_SDK_StreamParams, EVP_SDK_StreamParams_union_type_t, 8) -__flatbuffers_define_union(flatbuffers_, EVP_SDK_StreamParams) -#define EVP_SDK_StreamParams_NONE ((EVP_SDK_StreamParams_union_type_t)UINT8_C(0)) -#define EVP_SDK_StreamParams_nng ((EVP_SDK_StreamParams_union_type_t)UINT8_C(1)) - -static inline const char *EVP_SDK_StreamParams_type_name(EVP_SDK_StreamParams_union_type_t type) -{ - switch (type) { - case EVP_SDK_StreamParams_NONE: return "NONE"; - case EVP_SDK_StreamParams_nng: return "nng"; - default: return ""; - } -} - -static inline int EVP_SDK_StreamParams_is_known_type(EVP_SDK_StreamParams_union_type_t type) -{ - switch (type) { - case EVP_SDK_StreamParams_NONE: return 1; - case EVP_SDK_StreamParams_nng: return 1; - default: return 0; - } -} - - -struct EVP_SDK_StreamParamsResponse_table { uint8_t unused__; }; - -static inline size_t EVP_SDK_StreamParamsResponse_vec_len(EVP_SDK_StreamParamsResponse_vec_t vec) -__flatbuffers_vec_len(vec) -static inline EVP_SDK_StreamParamsResponse_table_t EVP_SDK_StreamParamsResponse_vec_at(EVP_SDK_StreamParamsResponse_vec_t vec, size_t i) -__flatbuffers_offset_vec_at(EVP_SDK_StreamParamsResponse_table_t, vec, i, 0) -__flatbuffers_table_as_root(EVP_SDK_StreamParamsResponse) - -__flatbuffers_define_scalar_field(0, EVP_SDK_StreamParamsResponse, result, flatbuffers_uint32, uint32_t, UINT32_C(0)) -__flatbuffers_define_scalar_field(1, EVP_SDK_StreamParamsResponse, type, EVP_SDK_StreamType, EVP_SDK_StreamType_enum_t, INT8_C(0)) -__flatbuffers_define_scalar_field(2, EVP_SDK_StreamParamsResponse, direction, EVP_SDK_StreamDirection, EVP_SDK_StreamDirection_enum_t, INT8_C(0)) -__flatbuffers_define_union_field(flatbuffers_, 4, EVP_SDK_StreamParamsResponse, params, EVP_SDK_StreamParams, 0) - - -#include "flatcc/flatcc_epilogue.h" -#endif /* SDK_READER_H */ diff --git a/src/libevp-agent/sdkenc/sdk_verifier.h b/src/libevp-agent/sdkenc/sdk_verifier.h deleted file mode 100644 index 5dfa0935..00000000 --- a/src/libevp-agent/sdkenc/sdk_verifier.h +++ /dev/null @@ -1,1032 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef SDK_VERIFIER_H -#define SDK_VERIFIER_H - -/* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ - -#ifndef SDK_READER_H -#include "sdk_reader.h" -#endif -#include "flatcc/flatcc_verifier.h" -#include "flatcc/flatcc_prologue.h" - -static int EVP_SDK_Config_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_StateInput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_StateOutput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_Exit_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobRequestAzureBlob_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobRequestEvp_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobRequestHttp_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobRequestHttpExt_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobInput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobResultAzureBlob_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobResultEvp_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobResultHttp_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobResultHttpExt_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_BlobOutput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_MessageSentInput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_MessageSentOutput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_MessageReceived_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_TelemetryEntry_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_TelemetryInput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_TelemetryOutput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_RpcRequest_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_RpcResponseInput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_RpcResponseOutput_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_Event_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_GetEvent_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_RequestResendConfig_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_Request_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_Simple_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_Response_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_StreamParamsRequest_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_StreamNng_verify_table(flatcc_table_verifier_descriptor_t *td); -static int EVP_SDK_StreamParamsResponse_verify_table(flatcc_table_verifier_descriptor_t *td); - -static int EVP_SDK_BlobRequestUnion_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_BlobRequestAzureBlob_verify_table); /* azureBlob */ - case 2: return flatcc_verify_union_table(ud, EVP_SDK_BlobRequestEvp_verify_table); /* evp */ - case 3: return flatcc_verify_union_table(ud, EVP_SDK_BlobRequestHttp_verify_table); /* http */ - case 4: return flatcc_verify_union_table(ud, EVP_SDK_BlobRequestHttpExt_verify_table); /* http_ext */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_BlobResultUnion_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_BlobResultAzureBlob_verify_table); /* azureBlob */ - case 2: return flatcc_verify_union_table(ud, EVP_SDK_BlobResultEvp_verify_table); /* evp */ - case 3: return flatcc_verify_union_table(ud, EVP_SDK_BlobResultHttp_verify_table); /* http */ - case 4: return flatcc_verify_union_table(ud, EVP_SDK_BlobResultHttpExt_verify_table); /* http_ext */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_EventBody_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_Config_verify_table); /* config */ - case 2: return flatcc_verify_union_table(ud, EVP_SDK_StateOutput_verify_table); /* state */ - case 3: return flatcc_verify_union_table(ud, EVP_SDK_Exit_verify_table); /* exit */ - case 4: return flatcc_verify_union_table(ud, EVP_SDK_BlobOutput_verify_table); /* blob */ - case 5: return flatcc_verify_union_table(ud, EVP_SDK_MessageSentOutput_verify_table); /* messageSent */ - case 6: return flatcc_verify_union_table(ud, EVP_SDK_MessageReceived_verify_table); /* messageReceived */ - case 7: return flatcc_verify_union_table(ud, EVP_SDK_TelemetryOutput_verify_table); /* telemetry */ - case 8: return flatcc_verify_union_table(ud, EVP_SDK_RpcRequest_verify_table); /* rpcRequest */ - case 9: return flatcc_verify_union_table(ud, EVP_SDK_RpcResponseOutput_verify_table); /* rpcResponse */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_RequestUnion_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_GetEvent_verify_table); /* getEvent */ - case 2: return flatcc_verify_union_table(ud, EVP_SDK_StateInput_verify_table); /* sendState */ - case 3: return flatcc_verify_union_table(ud, EVP_SDK_RequestResendConfig_verify_table); /* requestResendConfig */ - case 4: return flatcc_verify_union_table(ud, EVP_SDK_BlobInput_verify_table); /* blobOperation */ - case 5: return flatcc_verify_union_table(ud, EVP_SDK_TelemetryInput_verify_table); /* sendTelemetry */ - case 6: return flatcc_verify_union_table(ud, EVP_SDK_MessageSentInput_verify_table); /* sendMessage */ - case 7: return flatcc_verify_union_table(ud, EVP_SDK_RpcResponseInput_verify_table); /* sendRpcResponse */ - case 8: return flatcc_verify_union_table(ud, EVP_SDK_StreamParamsRequest_verify_table); /* streamParamsRequest */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_ResponseUnion_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_Event_verify_table); /* getEvent */ - case 2: return flatcc_verify_union_table(ud, EVP_SDK_Simple_verify_table); /* simple */ - case 3: return flatcc_verify_union_table(ud, EVP_SDK_StreamParamsResponse_verify_table); /* streamParamsResponse */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_StreamParams_union_verifier(flatcc_union_verifier_descriptor_t *ud) -{ - switch (ud->type) { - case 1: return flatcc_verify_union_table(ud, EVP_SDK_StreamNng_verify_table); /* nng */ - default: return flatcc_verify_ok; - } -} - -static int EVP_SDK_Config_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* topic */)) return ret; - if ((ret = flatcc_verify_vector_field(td, 1, 1, 1, 1, INT64_C(4294967295)) /* blob */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Config_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Config_identifier, &EVP_SDK_Config_verify_table); -} - -static inline int EVP_SDK_Config_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Config_type_identifier, &EVP_SDK_Config_verify_table); -} - -static inline int EVP_SDK_Config_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Config_verify_table); -} - -static inline int EVP_SDK_Config_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Config_verify_table); -} - -static int EVP_SDK_StateInput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* topic */)) return ret; - if ((ret = flatcc_verify_vector_field(td, 1, 1, 1, 1, INT64_C(4294967295)) /* blob */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 3, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_StateInput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StateInput_identifier, &EVP_SDK_StateInput_verify_table); -} - -static inline int EVP_SDK_StateInput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StateInput_type_identifier, &EVP_SDK_StateInput_verify_table); -} - -static inline int EVP_SDK_StateInput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_StateInput_verify_table); -} - -static inline int EVP_SDK_StateInput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_StateInput_verify_table); -} - -static int EVP_SDK_StateOutput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* reason */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_StateOutput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StateOutput_identifier, &EVP_SDK_StateOutput_verify_table); -} - -static inline int EVP_SDK_StateOutput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StateOutput_type_identifier, &EVP_SDK_StateOutput_verify_table); -} - -static inline int EVP_SDK_StateOutput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_StateOutput_verify_table); -} - -static inline int EVP_SDK_StateOutput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_StateOutput_verify_table); -} - -static int EVP_SDK_Exit_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Exit_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Exit_identifier, &EVP_SDK_Exit_verify_table); -} - -static inline int EVP_SDK_Exit_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Exit_type_identifier, &EVP_SDK_Exit_verify_table); -} - -static inline int EVP_SDK_Exit_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Exit_verify_table); -} - -static inline int EVP_SDK_Exit_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Exit_verify_table); -} - -static int EVP_SDK_BlobRequestAzureBlob_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* url */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobRequestAzureBlob_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestAzureBlob_identifier, &EVP_SDK_BlobRequestAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobRequestAzureBlob_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestAzureBlob_type_identifier, &EVP_SDK_BlobRequestAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobRequestAzureBlob_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobRequestAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobRequestAzureBlob_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobRequestAzureBlob_verify_table); -} - -static int EVP_SDK_BlobRequestEvp_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* remoteName */)) return ret; - if ((ret = flatcc_verify_string_field(td, 1, 0) /* storageName */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobRequestEvp_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestEvp_identifier, &EVP_SDK_BlobRequestEvp_verify_table); -} - -static inline int EVP_SDK_BlobRequestEvp_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestEvp_type_identifier, &EVP_SDK_BlobRequestEvp_verify_table); -} - -static inline int EVP_SDK_BlobRequestEvp_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobRequestEvp_verify_table); -} - -static inline int EVP_SDK_BlobRequestEvp_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobRequestEvp_verify_table); -} - -static int EVP_SDK_BlobRequestHttp_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* url */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobRequestHttp_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestHttp_identifier, &EVP_SDK_BlobRequestHttp_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttp_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestHttp_type_identifier, &EVP_SDK_BlobRequestHttp_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttp_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobRequestHttp_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttp_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobRequestHttp_verify_table); -} - -static int EVP_SDK_BlobRequestHttpExt_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* url */)) return ret; - if ((ret = flatcc_verify_string_vector_field(td, 1, 1) /* headers */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobRequestHttpExt_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestHttpExt_identifier, &EVP_SDK_BlobRequestHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttpExt_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobRequestHttpExt_type_identifier, &EVP_SDK_BlobRequestHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttpExt_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobRequestHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobRequestHttpExt_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobRequestHttpExt_verify_table); -} - -static int EVP_SDK_BlobInput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* type */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* op */)) return ret; - if ((ret = flatcc_verify_union_field(td, 3, 1, &EVP_SDK_BlobRequestUnion_union_verifier) /* request */)) return ret; - if ((ret = flatcc_verify_string_field(td, 4, 1) /* filename */)) return ret; - if ((ret = flatcc_verify_field(td, 5, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 6, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobInput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobInput_identifier, &EVP_SDK_BlobInput_verify_table); -} - -static inline int EVP_SDK_BlobInput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobInput_type_identifier, &EVP_SDK_BlobInput_verify_table); -} - -static inline int EVP_SDK_BlobInput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobInput_verify_table); -} - -static inline int EVP_SDK_BlobInput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobInput_verify_table); -} - -static int EVP_SDK_BlobResultAzureBlob_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* error */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 4, 4) /* http_status */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobResultAzureBlob_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultAzureBlob_identifier, &EVP_SDK_BlobResultAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobResultAzureBlob_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultAzureBlob_type_identifier, &EVP_SDK_BlobResultAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobResultAzureBlob_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobResultAzureBlob_verify_table); -} - -static inline int EVP_SDK_BlobResultAzureBlob_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobResultAzureBlob_verify_table); -} - -static int EVP_SDK_BlobResultEvp_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* error */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 4, 4) /* http_status */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobResultEvp_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultEvp_identifier, &EVP_SDK_BlobResultEvp_verify_table); -} - -static inline int EVP_SDK_BlobResultEvp_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultEvp_type_identifier, &EVP_SDK_BlobResultEvp_verify_table); -} - -static inline int EVP_SDK_BlobResultEvp_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobResultEvp_verify_table); -} - -static inline int EVP_SDK_BlobResultEvp_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobResultEvp_verify_table); -} - -static int EVP_SDK_BlobResultHttp_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* error */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 4, 4) /* http_status */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobResultHttp_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultHttp_identifier, &EVP_SDK_BlobResultHttp_verify_table); -} - -static inline int EVP_SDK_BlobResultHttp_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultHttp_type_identifier, &EVP_SDK_BlobResultHttp_verify_table); -} - -static inline int EVP_SDK_BlobResultHttp_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobResultHttp_verify_table); -} - -static inline int EVP_SDK_BlobResultHttp_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobResultHttp_verify_table); -} - -static int EVP_SDK_BlobResultHttpExt_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* error */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 4, 4) /* http_status */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobResultHttpExt_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultHttpExt_identifier, &EVP_SDK_BlobResultHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobResultHttpExt_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobResultHttpExt_type_identifier, &EVP_SDK_BlobResultHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobResultHttpExt_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobResultHttpExt_verify_table); -} - -static inline int EVP_SDK_BlobResultHttpExt_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobResultHttpExt_verify_table); -} - -static int EVP_SDK_BlobOutput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_union_field(td, 1, 0, &EVP_SDK_BlobResultUnion_union_verifier) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 3, 4, 4) /* reason */)) return ret; - if ((ret = flatcc_verify_field(td, 4, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_BlobOutput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobOutput_identifier, &EVP_SDK_BlobOutput_verify_table); -} - -static inline int EVP_SDK_BlobOutput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_BlobOutput_type_identifier, &EVP_SDK_BlobOutput_verify_table); -} - -static inline int EVP_SDK_BlobOutput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_BlobOutput_verify_table); -} - -static inline int EVP_SDK_BlobOutput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_BlobOutput_verify_table); -} - -static int EVP_SDK_MessageSentInput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* topic */)) return ret; - if ((ret = flatcc_verify_vector_field(td, 1, 1, 1, 1, INT64_C(4294967295)) /* blob */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 3, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_MessageSentInput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageSentInput_identifier, &EVP_SDK_MessageSentInput_verify_table); -} - -static inline int EVP_SDK_MessageSentInput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageSentInput_type_identifier, &EVP_SDK_MessageSentInput_verify_table); -} - -static inline int EVP_SDK_MessageSentInput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_MessageSentInput_verify_table); -} - -static inline int EVP_SDK_MessageSentInput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_MessageSentInput_verify_table); -} - -static int EVP_SDK_MessageSentOutput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* reason */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_MessageSentOutput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageSentOutput_identifier, &EVP_SDK_MessageSentOutput_verify_table); -} - -static inline int EVP_SDK_MessageSentOutput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageSentOutput_type_identifier, &EVP_SDK_MessageSentOutput_verify_table); -} - -static inline int EVP_SDK_MessageSentOutput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_MessageSentOutput_verify_table); -} - -static inline int EVP_SDK_MessageSentOutput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_MessageSentOutput_verify_table); -} - -static int EVP_SDK_MessageReceived_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* topic */)) return ret; - if ((ret = flatcc_verify_vector_field(td, 1, 1, 1, 1, INT64_C(4294967295)) /* blob */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_MessageReceived_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageReceived_identifier, &EVP_SDK_MessageReceived_verify_table); -} - -static inline int EVP_SDK_MessageReceived_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_MessageReceived_type_identifier, &EVP_SDK_MessageReceived_verify_table); -} - -static inline int EVP_SDK_MessageReceived_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_MessageReceived_verify_table); -} - -static inline int EVP_SDK_MessageReceived_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_MessageReceived_verify_table); -} - -static int EVP_SDK_TelemetryEntry_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 1) /* key */)) return ret; - if ((ret = flatcc_verify_string_field(td, 1, 1) /* value */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_TelemetryEntry_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryEntry_identifier, &EVP_SDK_TelemetryEntry_verify_table); -} - -static inline int EVP_SDK_TelemetryEntry_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryEntry_type_identifier, &EVP_SDK_TelemetryEntry_verify_table); -} - -static inline int EVP_SDK_TelemetryEntry_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_TelemetryEntry_verify_table); -} - -static inline int EVP_SDK_TelemetryEntry_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_TelemetryEntry_verify_table); -} - -static int EVP_SDK_TelemetryInput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_table_vector_field(td, 0, 0, &EVP_SDK_TelemetryEntry_verify_table) /* entries */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_TelemetryInput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryInput_identifier, &EVP_SDK_TelemetryInput_verify_table); -} - -static inline int EVP_SDK_TelemetryInput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryInput_type_identifier, &EVP_SDK_TelemetryInput_verify_table); -} - -static inline int EVP_SDK_TelemetryInput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_TelemetryInput_verify_table); -} - -static inline int EVP_SDK_TelemetryInput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_TelemetryInput_verify_table); -} - -static int EVP_SDK_TelemetryOutput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* reason */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_TelemetryOutput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryOutput_identifier, &EVP_SDK_TelemetryOutput_verify_table); -} - -static inline int EVP_SDK_TelemetryOutput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_TelemetryOutput_type_identifier, &EVP_SDK_TelemetryOutput_verify_table); -} - -static inline int EVP_SDK_TelemetryOutput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_TelemetryOutput_verify_table); -} - -static inline int EVP_SDK_TelemetryOutput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_TelemetryOutput_verify_table); -} - -static int EVP_SDK_RpcRequest_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* id */)) return ret; - if ((ret = flatcc_verify_string_field(td, 1, 1) /* method */)) return ret; - if ((ret = flatcc_verify_string_field(td, 2, 1) /* params */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_RpcRequest_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcRequest_identifier, &EVP_SDK_RpcRequest_verify_table); -} - -static inline int EVP_SDK_RpcRequest_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcRequest_type_identifier, &EVP_SDK_RpcRequest_verify_table); -} - -static inline int EVP_SDK_RpcRequest_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_RpcRequest_verify_table); -} - -static inline int EVP_SDK_RpcRequest_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_RpcRequest_verify_table); -} - -static int EVP_SDK_RpcResponseInput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* id */)) return ret; - if ((ret = flatcc_verify_string_field(td, 1, 0) /* response */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 4, 4) /* status */)) return ret; - if ((ret = flatcc_verify_field(td, 3, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 4, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_RpcResponseInput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcResponseInput_identifier, &EVP_SDK_RpcResponseInput_verify_table); -} - -static inline int EVP_SDK_RpcResponseInput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcResponseInput_type_identifier, &EVP_SDK_RpcResponseInput_verify_table); -} - -static inline int EVP_SDK_RpcResponseInput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_RpcResponseInput_verify_table); -} - -static inline int EVP_SDK_RpcResponseInput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_RpcResponseInput_verify_table); -} - -static int EVP_SDK_RpcResponseOutput_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* cb */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 4, 4) /* reason */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 8, 8) /* cb_userdata */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_RpcResponseOutput_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcResponseOutput_identifier, &EVP_SDK_RpcResponseOutput_verify_table); -} - -static inline int EVP_SDK_RpcResponseOutput_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RpcResponseOutput_type_identifier, &EVP_SDK_RpcResponseOutput_verify_table); -} - -static inline int EVP_SDK_RpcResponseOutput_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_RpcResponseOutput_verify_table); -} - -static inline int EVP_SDK_RpcResponseOutput_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_RpcResponseOutput_verify_table); -} - -static int EVP_SDK_Event_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_union_field(td, 1, 0, &EVP_SDK_EventBody_union_verifier) /* body */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Event_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Event_identifier, &EVP_SDK_Event_verify_table); -} - -static inline int EVP_SDK_Event_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Event_type_identifier, &EVP_SDK_Event_verify_table); -} - -static inline int EVP_SDK_Event_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Event_verify_table); -} - -static inline int EVP_SDK_Event_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Event_verify_table); -} - -static int EVP_SDK_GetEvent_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 8, 8) /* timeout_sec */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 8, 8) /* timeout_nsec */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_GetEvent_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_GetEvent_identifier, &EVP_SDK_GetEvent_verify_table); -} - -static inline int EVP_SDK_GetEvent_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_GetEvent_type_identifier, &EVP_SDK_GetEvent_verify_table); -} - -static inline int EVP_SDK_GetEvent_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_GetEvent_verify_table); -} - -static inline int EVP_SDK_GetEvent_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_GetEvent_verify_table); -} - -static int EVP_SDK_RequestResendConfig_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - return flatcc_verify_ok; -} - -static inline int EVP_SDK_RequestResendConfig_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RequestResendConfig_identifier, &EVP_SDK_RequestResendConfig_verify_table); -} - -static inline int EVP_SDK_RequestResendConfig_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_RequestResendConfig_type_identifier, &EVP_SDK_RequestResendConfig_verify_table); -} - -static inline int EVP_SDK_RequestResendConfig_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_RequestResendConfig_verify_table); -} - -static inline int EVP_SDK_RequestResendConfig_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_RequestResendConfig_verify_table); -} - -static int EVP_SDK_Request_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_union_field(td, 1, 1, &EVP_SDK_RequestUnion_union_verifier) /* body */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Request_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Request_identifier, &EVP_SDK_Request_verify_table); -} - -static inline int EVP_SDK_Request_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Request_type_identifier, &EVP_SDK_Request_verify_table); -} - -static inline int EVP_SDK_Request_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Request_verify_table); -} - -static inline int EVP_SDK_Request_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Request_verify_table); -} - -static int EVP_SDK_Simple_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Simple_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Simple_identifier, &EVP_SDK_Simple_verify_table); -} - -static inline int EVP_SDK_Simple_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Simple_type_identifier, &EVP_SDK_Simple_verify_table); -} - -static inline int EVP_SDK_Simple_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Simple_verify_table); -} - -static inline int EVP_SDK_Simple_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Simple_verify_table); -} - -static int EVP_SDK_Response_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_union_field(td, 1, 1, &EVP_SDK_ResponseUnion_union_verifier) /* body */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_Response_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Response_identifier, &EVP_SDK_Response_verify_table); -} - -static inline int EVP_SDK_Response_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_Response_type_identifier, &EVP_SDK_Response_verify_table); -} - -static inline int EVP_SDK_Response_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_Response_verify_table); -} - -static inline int EVP_SDK_Response_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_Response_verify_table); -} - -static int EVP_SDK_StreamParamsRequest_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_string_field(td, 0, 0) /* name */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_StreamParamsRequest_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamParamsRequest_identifier, &EVP_SDK_StreamParamsRequest_verify_table); -} - -static inline int EVP_SDK_StreamParamsRequest_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamParamsRequest_type_identifier, &EVP_SDK_StreamParamsRequest_verify_table); -} - -static inline int EVP_SDK_StreamParamsRequest_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_StreamParamsRequest_verify_table); -} - -static inline int EVP_SDK_StreamParamsRequest_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_StreamParamsRequest_verify_table); -} - -static int EVP_SDK_StreamNng_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 1, 1) /* mode */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 1, 1) /* protocol */)) return ret; - if ((ret = flatcc_verify_string_field(td, 2, 0) /* connection */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_StreamNng_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamNng_identifier, &EVP_SDK_StreamNng_verify_table); -} - -static inline int EVP_SDK_StreamNng_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamNng_type_identifier, &EVP_SDK_StreamNng_verify_table); -} - -static inline int EVP_SDK_StreamNng_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_StreamNng_verify_table); -} - -static inline int EVP_SDK_StreamNng_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_StreamNng_verify_table); -} - -static int EVP_SDK_StreamParamsResponse_verify_table(flatcc_table_verifier_descriptor_t *td) -{ - int ret; - if ((ret = flatcc_verify_field(td, 0, 4, 4) /* result */)) return ret; - if ((ret = flatcc_verify_field(td, 1, 1, 1) /* type */)) return ret; - if ((ret = flatcc_verify_field(td, 2, 1, 1) /* direction */)) return ret; - if ((ret = flatcc_verify_union_field(td, 4, 0, &EVP_SDK_StreamParams_union_verifier) /* params */)) return ret; - return flatcc_verify_ok; -} - -static inline int EVP_SDK_StreamParamsResponse_verify_as_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamParamsResponse_identifier, &EVP_SDK_StreamParamsResponse_verify_table); -} - -static inline int EVP_SDK_StreamParamsResponse_verify_as_typed_root(const void *buf, size_t bufsiz) -{ - return flatcc_verify_table_as_root(buf, bufsiz, EVP_SDK_StreamParamsResponse_type_identifier, &EVP_SDK_StreamParamsResponse_verify_table); -} - -static inline int EVP_SDK_StreamParamsResponse_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) -{ - return flatcc_verify_table_as_root(buf, bufsiz, fid, &EVP_SDK_StreamParamsResponse_verify_table); -} - -static inline int EVP_SDK_StreamParamsResponse_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) -{ - return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &EVP_SDK_StreamParamsResponse_verify_table); -} - -#include "flatcc/flatcc_epilogue.h" -#endif /* SDK_VERIFIER_H */ diff --git a/src/libevp-agent/sdkrpc/server.c b/src/libevp-agent/sdkrpc/server.c index d60e2a75..a51e8491 100644 --- a/src/libevp-agent/sdkrpc/server.c +++ b/src/libevp-agent/sdkrpc/server.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include "../ioutil.h" #include "../sdk_agent.h" -#include "../sdkenc/sdk_builder.h" #include "server.h" void diff --git a/src/libevp-agent/stream/nng.c b/src/libevp-agent/stream/nng.c deleted file mode 100644 index 8c40915b..00000000 --- a/src/libevp-agent/stream/nng.c +++ /dev/null @@ -1,307 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "evp/sdk.h" -#include "stream.h" - -struct stream_impl_params { - nng_socket socket; - union { - nng_dialer dialer; - nng_listener listener; - } dl; -}; - -static int -close_internal(const struct StreamNng *cfg, struct stream_impl_params *nng) -{ - int ret = 0; - - if (nng != NULL) { - int error; - - switch (cfg->mode) { - case STREAM_NNG_MODE_DIAL: - error = nng_dialer_close(nng->dl.dialer); - if (error != 0) { - fprintf(stderr, "nng_dialer_close: %s\n", - nng_strerror(error)); - ret = -1; - } - break; - case STREAM_NNG_MODE_LISTEN: - error = nng_listener_close(nng->dl.listener); - if (error != 0) { - fprintf(stderr, "nng_listener_close: %s\n", - nng_strerror(error)); - ret = -1; - } - break; - } - - error = nng_close(nng->socket); - if (error != 0) { - fprintf(stderr, "nng_close: %s\n", - nng_strerror(error)); - ret = -1; - } - } - - free(nng); - return ret; -} - -static int -close_nng_stream(struct stream_impl *si) -{ - return close_internal(&si->cfg.params.nng, si->params); -} - -static EVP_RESULT -init_nng_stream(struct stream_impl *si) -{ - EVP_RESULT ret = EVP_ERROR; - const struct StreamNng *cfg = &si->cfg.params.nng; - struct stream_impl_params *nng = malloc(sizeof(*nng)); - - if (nng == NULL) { - fprintf(stderr, "%s: malloc(3): %s\n", __func__, - strerror(errno)); - goto end; - } - - *nng = (struct stream_impl_params){0}; - - int error; - - switch (cfg->protocol) { - case STREAM_NNG_PROTOCOL_PUSH: - error = nng_push0_open(&nng->socket); - if (error != 0) { - fprintf(stderr, "nng_push0_open: %s\n", - nng_strerror(error)); - goto end; - } - break; - case STREAM_NNG_PROTOCOL_PULL: - error = nng_pull0_open(&nng->socket); - if (error != 0) { - fprintf(stderr, "nng_pull0_open: %s\n", - nng_strerror(error)); - return EVP_ERROR; - } - } - - switch (cfg->mode) { - case STREAM_NNG_MODE_DIAL: - error = nng_dialer_create(&nng->dl.dialer, nng->socket, - cfg->connection); - if (error != 0) { - fprintf(stderr, "nng_dialer_create: %s\n", - nng_strerror(error)); - return EVP_ERROR; - } - - error = nng_dialer_start(nng->dl.dialer, 0); - if (error != 0) { - fprintf(stderr, "nng_dialer_start: %s\n", - nng_strerror(error)); - return EVP_ERROR; - } - break; - case STREAM_NNG_MODE_LISTEN: - { - error = nng_listener_create(&nng->dl.listener, - nng->socket, - cfg->connection); - if (error != 0) { - fprintf(stderr, "nng_listener_create: %s\n", - nng_strerror(error)); - return EVP_ERROR; - } - - error = nng_listener_start(nng->dl.listener, 0); - if (error != 0) { - fprintf(stderr, "nng_listener_start: %s\n", - nng_strerror(error)); - return EVP_ERROR; - } - - int port; - - error = nng_listener_get_int(nng->dl.listener, - NNG_OPT_TCP_BOUND_PORT, - &port); - - if (error != 0) { - fprintf(stderr, - "%s: nng_dialer_get_int failed: %s\n", - __func__, nng_strerror(error)); - return EVP_ERROR; - } - - struct notification *n = stream_notification(); - - if (n == NULL) { - fprintf(stderr, - "%s: stream_notification failed\n", - __func__); - return EVP_ERROR; - } - - struct stream_port p = {.port = port, .si = si}; - - if (notification_publish(n, "init/port", &p)) { - fprintf(stderr, - "%s: notification_publish failed\n", - __func__); - return EVP_ERROR; - } - } - } - - si->params = nng; - ret = EVP_OK; -end: - if (ret != EVP_OK) { - if (nng != NULL) { - close_internal(cfg, nng); - } - } - - return ret; -} - -static int -write_nng(const struct stream_impl *si, const void *buf, size_t n) -{ - const struct stream_impl_params *nng = si->params; - /* nng_send(3) takes a (void *) only because the buffer is freed when - * NNG_FLAG_ALLOC is passed. Otherwise, no modifications are made, - * so the explicit cast below is safe. */ - int error = nng_send(nng->socket, (void *)buf, n, 0); - if (error != 0) { - fprintf(stderr, "nng_send: %s\n", nng_strerror(error)); - return -1; - } - return 0; -} - -/* - * A modified version of nng_recvmsg that disables thread cancellation. - * This is required since the thread running this function might be - * cancelled while nng_recv_aio or nng_aio_wait are running, which - * might have cancellation points. The original function is implemented on - * src/nng/src/nng.c. - * - * Unfortunately, cleanup handlers are not enough here, since mutexes - * are taken internally by the nng library that cannot be unlocked from - * userspace, causing a deadlock. - */ -static int -recvmsg_nng_custom(nng_socket s, nng_msg **msgp, nng_duration timeout) -{ - nng_aio *ap = NULL; - int rv = NNG_EINVAL, oldstate, - error = pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldstate); - - if (error) { - fprintf(stderr, "%s: pthread_setcancelstate(3) disable: %s\n", - __func__, strerror(error)); - goto end; - } - - rv = nng_aio_alloc(&ap, NULL, NULL); - - if (rv) { - fprintf(stderr, "%s: nng_aio_alloc: %s\n", __func__, - nng_strerror(rv)); - goto end; - } - - nng_aio_set_timeout(ap, timeout); - nng_recv_aio(s, ap); - nng_aio_wait(ap); - rv = nng_aio_result(ap); - - if (rv == 0) { - *msgp = nng_aio_get_msg(ap); - } else if (rv == NNG_ETIMEDOUT) { - rv = NNG_EAGAIN; - } - -end: - nng_aio_free(ap); - error = pthread_setcancelstate(oldstate, NULL); - - if (error) { - fprintf(stderr, "%s: pthread_setcancelstate(3) oldstate: %s\n", - __func__, strerror(error)); - rv = NNG_EINVAL; - } - - return rv; -} - -static int -read_nng(struct stream_impl *si, struct stream_read *sr) -{ - const struct stream_impl_params *nng = si->params; - nng_msg *msg = NULL; - const nng_duration timeout = 1000; - int error; - -retry: - error = recvmsg_nng_custom(nng->socket, &msg, timeout); - - if (error == NNG_EAGAIN) { - goto retry; - } - - if (error != 0) { - fprintf(stderr, "recvmsg_nng_custom: %s\n", - nng_strerror(error)); - return -1; - } - - nng_pipe pipe = nng_msg_get_pipe(msg); - - *sr = (struct stream_read){.id = pipe.id, - .buf = nng_msg_body(msg), - .n = nng_msg_len(msg), - .free_args = msg}; - - return 0; -} - -static void -free_msg_nng(void *args) -{ - nng_msg_free(args); -} - -static int -stream_nng_atexit(void) -{ - return atexit(nng_fini); -} - -const struct stream_ops stream_nng_ops = { - .init = init_nng_stream, - .close = close_nng_stream, - .write = write_nng, - .read = read_nng, - .free_msg = free_msg_nng, - .atexit = stream_nng_atexit, -}; diff --git a/src/libevp-agent/stream/stream.c b/src/libevp-agent/stream/stream.c index dfabe100..497d2f4b 100644 --- a/src/libevp-agent/stream/stream.c +++ b/src/libevp-agent/stream/stream.c @@ -27,9 +27,6 @@ static const struct stream_ops *stream_ops[NR_STREAM_TYPE] = { [STREAM_TYPE_NULL] = &stream_null_ops, [STREAM_TYPE_POSIX] = &stream_posix_ops, -#ifdef CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS - [STREAM_TYPE_NNG] = &stream_nng_ops, -#endif }; static struct notification notification = @@ -487,25 +484,6 @@ stream_duplicate(const struct Stream *src, struct Stream *dst) switch (src->type) { case STREAM_TYPE_NULL: break; - case STREAM_TYPE_NNG: - { - const struct StreamNng *nng = &src->params.nng; - - connectiondup = strdup(nng->connection); - if (connectiondup == NULL) { - fprintf(stderr, - "strdup(3) failed with errno %d\n", - errno); - ret = errno; - goto end; - } - params.nng = (struct StreamNng){ - .connection = connectiondup, - .mode = nng->mode, - .protocol = nng->protocol, - }; - } - break; case STREAM_TYPE_POSIX: { const struct StreamPosix *posix = &src->params.posix; @@ -557,9 +535,6 @@ stream_free(struct Stream *s) /* TODO: Create virtual function instead of switch */ switch (s->type) { - case STREAM_TYPE_NNG: - free(s->params.nng.connection); - break; case STREAM_TYPE_NULL: break; case STREAM_TYPE_POSIX: diff --git a/src/libevp-agent/stream/stream.h b/src/libevp-agent/stream/stream.h index aaffb4ce..f05a8ef2 100644 --- a/src/libevp-agent/stream/stream.h +++ b/src/libevp-agent/stream/stream.h @@ -20,7 +20,6 @@ struct Stream { char *name; enum StreamType { STREAM_TYPE_NULL, - STREAM_TYPE_NNG, STREAM_TYPE_POSIX, NR_STREAM_TYPE } type; @@ -29,17 +28,6 @@ struct Stream { STREAM_DIRECTION_OUT } direction; union StreamParams { - struct StreamNng { - enum { - STREAM_NNG_MODE_DIAL, - STREAM_NNG_MODE_LISTEN - } mode; - enum { - STREAM_NNG_PROTOCOL_PUSH, - STREAM_NNG_PROTOCOL_PULL - } protocol; - char *connection; - } nng; struct StreamPosix { enum { STREAM_POSIX_TYPE_TCP } type; enum { @@ -140,7 +128,6 @@ EVP_RESULT EVP_impl_streamWrite(struct EVP_client *h, EVP_STREAM stream, const void *buf, size_t n); extern const struct stream_ops stream_null_ops; -extern const struct stream_ops stream_nng_ops; extern const struct stream_ops stream_posix_ops; #endif /* STREAM_H */ diff --git a/src/libevp-agent/sys/sys_common.c b/src/libevp-agent/sys/sys_common.c index e45a2ca9..76fc816c 100644 --- a/src/libevp-agent/sys/sys_common.c +++ b/src/libevp-agent/sys/sys_common.c @@ -48,7 +48,7 @@ sys_add_headers(struct EVP_BlobRequestHttpExt *req, if (result != EVP_OK) { xlog_error("EVP_BlobRequestHttpExt_addHeader failed " "with %u", - (int)result); + (unsigned int)result); return -1; } } diff --git a/src/libevp-agent/tls.c b/src/libevp-agent/tls.c index 707d91ef..fb5eeb77 100644 --- a/src/libevp-agent/tls.c +++ b/src/libevp-agent/tls.c @@ -150,7 +150,7 @@ xlog_mbedtls_error(int rv, const char *fmt, ...) xlog_error("%s, mbedtls returned -0x%x (%s)", msg, (unsigned int)-rv, buf); } else { - xlog_error("%s, mbedtls returned 0x%x", msg, rv); + xlog_error("%s, mbedtls returned 0x%x", msg, (unsigned int)rv); } } @@ -162,10 +162,11 @@ failed(const char *fn, int rv) if (rv < 0) { char buf[100]; mbedtls_strerror(rv, buf, sizeof(buf)); - xlog_error("%s failed with -0x%x (%s)", fn, -rv, buf); + xlog_error("%s failed with -0x%x (%s)", fn, (unsigned int)-rv, + buf); } else { xlog_error("%s failed, returning a positive value 0x%x", fn, - rv); + (unsigned int)rv); } return rv; } @@ -751,11 +752,11 @@ mbedtls2errno(int rv) xlog_info("mbedtls2errno: converting -0x%x " "(%s) to %d " "(%s)", - -rv, buf, error, strerror(error)); + (unsigned int)-rv, buf, error, strerror(error)); } else { xlog_info("mbedtls2errno: converting 0x%x to " "%d (%s)", - rv, error, strerror(error)); + (unsigned int)rv, error, strerror(error)); } return error; diff --git a/src/libevp-agent/xmqtt.c b/src/libevp-agent/xmqtt.c index 766f8ae9..bea15095 100644 --- a/src/libevp-agent/xmqtt.c +++ b/src/libevp-agent/xmqtt.c @@ -127,11 +127,10 @@ mqtt_prepare_poll(struct mqtt_client *client, bool *want_writep) const time_t now_sec = MQTT_PAL_TIME(); const uint64_t now_ms = gettime_ms(); uint64_t abs_timeout_ms; - fprintf(stderr, - "%s: abs_timeout_sec=%ju, " - "now_sec=%ju\n", - __func__, (uintmax_t)abs_timeout_sec, - (uintmax_t)now_sec); + xlog_info("%s: abs_timeout_sec=%ju, " + "now_sec=%ju\n", + __func__, (uintmax_t)abs_timeout_sec, + (uintmax_t)now_sec); if (abs_timeout_sec >= now_sec) { uint64_t delta_sec = abs_timeout_sec - now_sec; abs_timeout_ms = now_ms + delta_sec * 1000; diff --git a/src/libevp-app-sdk/Makefile b/src/libevp-app-sdk/Makefile index 11384e8c..8f736df8 100644 --- a/src/libevp-app-sdk/Makefile +++ b/src/libevp-app-sdk/Makefile @@ -33,19 +33,23 @@ obj-$(CONFIG_EVP_SDK_SOCKET) += \ sdk.o \ sdkrpc/client.o \ -obj-$(CONFIG_EVP_AGENT_LOCAL_SDK_NNG_STREAMS) += stream/nng.o - LDFLAGS = -L$(LIBDIR) all: libevp-app-sdk.a libevp-app-sdk-bundle.a -libevp-app-sdk.a: $(obj-y) +libevp-app-sdk.o: $(obj-y) $(LD) -r -o $@ $(MORE_LDFLAGS) $(obj-y) -X -x $(OBJCOPY) --keep-global-symbols=symbols.list $@ + +libevp-app-sdk.a: libevp-app-sdk.o + $(AR) $(PROJ_ARFLAGS) $@ $? cp $@ $(LIBDIR) -libevp-app-sdk-bundle.a: libevp-app-sdk.a - $(LD) -r -o $@ $(LDFLAGS) libevp-app-sdk.a $(DEPLIBS) +libevp-app-sdk-bundle.o: libevp-app-sdk.o + $(LD) -r -o $@ $(LDFLAGS) libevp-app-sdk.o $(DEPLIBS) + +libevp-app-sdk-bundle.a: libevp-app-sdk-bundle.o + $(AR) $(PROJ_ARFLAGS) $@ $? cp $@ $(LIBDIR) clean: diff --git a/src/libevp-app-sdk/sdk.c b/src/libevp-app-sdk/sdk.c index bfb1fb65..4b73561e 100644 --- a/src/libevp-app-sdk/sdk.c +++ b/src/libevp-app-sdk/sdk.c @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -20,9 +23,6 @@ #include "path_docker.h" #include "sdk_callback_impl_ops.h" #include "sdk_common.h" -#include "sdkenc/sdk_builder.h" -#include "sdkenc/sdk_reader.h" -#include "sdkenc/sdk_verifier.h" #include "sdkrpc/client.h" #include "sdkutil.h" #include "stream/stream.h" @@ -1012,51 +1012,6 @@ process_null_params(ns(StreamParamsResponse_table_t) body, return EVP_OK; } -static EVP_RESULT -process_nng_params(const ns(StreamParamsResponse_table_t) body, - union StreamParams *p) -{ - EVP_RESULT ret; - char *connectiondup = NULL; - const struct ns(StreamNng_table) *params = - ns(StreamParamsResponse_params(body)); - - if (params == NULL) { - fprintf(stderr, "%s: StreamParamsResponse_params failed\n", - __func__); - ret = EVP_AGENT_PROTOCOL_ERROR; - goto end; - } - - flatbuffers_string_t connection = ns(StreamNng_connection_get(params)); - if (connection == NULL) { - fprintf(stderr, "%s: unexpected null connection\n", __func__); - ret = EVP_AGENT_PROTOCOL_ERROR; - goto end; - } - - connectiondup = strdup(connection); - if (connectiondup == NULL) { - fprintf(stderr, "%s: realloc(3) failed with errno %d\n", - __func__, errno); - ret = EVP_NOMEM; - goto end; - } - - p->nng = (struct StreamNng){ - .mode = ns(StreamNng_mode_get(params)), - .protocol = ns(StreamNng_protocol_get(params)), - .connection = connectiondup, - }; - - ret = EVP_OK; -end: - if (ret != EVP_OK) { - free(connectiondup); - } - return ret; -} - static EVP_RESULT process_stream_response(const struct sdk_request *req, const char *name, struct Stream *stream) @@ -1114,7 +1069,6 @@ process_stream_response(const struct sdk_request *req, const char *name, static EVP_RESULT (*f[])(ns(StreamParamsResponse_table_t), union StreamParams *p) = { [STREAM_TYPE_NULL] = process_null_params, - [STREAM_TYPE_NNG] = process_nng_params, }; if (s.type >= __arraycount(f)) { diff --git a/src/libevp-app-sdk/stream/nng.c b/src/libevp-app-sdk/stream/nng.c deleted file mode 120000 index 79c34680..00000000 --- a/src/libevp-app-sdk/stream/nng.c +++ /dev/null @@ -1 +0,0 @@ -../../libevp-agent/stream/nng.c \ No newline at end of file diff --git a/src/libevp-utils/chan_def.h b/src/libevp-utils/chan_def.h index eea3a265..2d1de88c 100644 --- a/src/libevp-utils/chan_def.h +++ b/src/libevp-utils/chan_def.h @@ -14,7 +14,6 @@ struct chan_item { sem_t sem; - pthread_cond_t cond; struct chan_msg msg; struct chan_item *next; }; diff --git a/src/libevp-utils/chan_item_alloc.c b/src/libevp-utils/chan_item_alloc.c index 686faeec..808022f7 100644 --- a/src/libevp-utils/chan_item_alloc.c +++ b/src/libevp-utils/chan_item_alloc.c @@ -20,12 +20,9 @@ chan_item_alloc(void) if ((it = malloc(sizeof(*it))) == NULL) return NULL; - *it = (struct chan_item){ - .cond = PTHREAD_COND_INITIALIZER, - }; + *it = (struct chan_item){0}; if (sem_init(&it->sem, 0, 0)) { - pthread_cond_destroy(&it->cond); free(it); return NULL; } diff --git a/src/libevp-utils/chan_item_dealloc.c b/src/libevp-utils/chan_item_dealloc.c index 3c413fff..bec960fe 100644 --- a/src/libevp-utils/chan_item_dealloc.c +++ b/src/libevp-utils/chan_item_dealloc.c @@ -19,6 +19,5 @@ chan_item_dealloc(struct chan_item *it) if (!it) return; sem_destroy(&it->sem); - pthread_cond_destroy(&it->cond); free(it); } diff --git a/src/libevp-utils/chan_send.c b/src/libevp-utils/chan_send.c index d63e06c5..e973270d 100644 --- a/src/libevp-utils/chan_send.c +++ b/src/libevp-utils/chan_send.c @@ -32,8 +32,8 @@ chan_send(struct chan *ch, struct chan_msg *msg) /* * synchronous msg, `it->m' is hold * by this thread and we have to wait - * in `it->cond' until the receiver - * signals it and then we can free `it' + * in `it->sem' until the receiver + * posts it and then we can free `it' */ while (sem_wait(&it->sem) && errno == EINTR) diff --git a/src/nng b/src/nng deleted file mode 160000 index 85fbe7f9..00000000 --- a/src/nng +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85fbe7f9e4642b554d0d97f2e3ff2aa12978691a diff --git a/src/sdkenc/Makefile b/src/sdkenc/Makefile new file mode 100644 index 00000000..2514fdf6 --- /dev/null +++ b/src/sdkenc/Makefile @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +PROJECTDIR = ../.. + +include $(PROJECTDIR)/scripts/rules.mk + +FLATCC=$(PROJECTDIR)/bin/flatcc + +all: stamp + +stamp: sdk.fbs + $(FLATCC) \ + -a \ + --json-printer \ + sdk.fbs + mkdir -p $(INCDIR)/sdkenc + cp *.h $(INCDIR)/sdkenc + touch $@ + +clean: + rm -f *.h stamp diff --git a/src/libevp-agent/sdkenc/sdk.fbs b/src/sdkenc/sdk.fbs similarity index 93% rename from src/libevp-agent/sdkenc/sdk.fbs rename to src/sdkenc/sdk.fbs index 680fdef8..53581721 100644 --- a/src/libevp-agent/sdkenc/sdk.fbs +++ b/src/sdkenc/sdk.fbs @@ -218,30 +218,9 @@ table StreamParamsRequest { name:string; } -enum StreamNngMode : byte { - Dial, - Listen -} - -enum StreamNngProtocol : byte { - Push, - Pull -} - -table StreamNng { - mode:StreamNngMode; - protocol:StreamNngProtocol; - connection:string; -} - -union StreamParams { - nng:StreamNng -} - // This must match the definition in src/stream.h. enum StreamType : byte { Null, - Nng } // This must match the definition in src/stream.h. @@ -255,5 +234,4 @@ table StreamParamsResponse { // Only valid if EVP_RESULT == EVP_OK type:StreamType; direction:StreamDirection; - params:StreamParams; } diff --git a/test/certs/Makefile b/test/certs/Makefile index 2af95373..46f313bc 100644 --- a/test/certs/Makefile +++ b/test/certs/Makefile @@ -23,7 +23,7 @@ ca-cert.pem: ca-key.pem -out $@ \ -sha256 \ -noenc \ - -subj "/C=XX/ST=Barcelona/L=Barcelona/O=Midokura/CN=CA" + -subj "/C=XX/ST=Barcelona/L=Barcelona/O=SSS/CN=CA" server-key.pem: @echo Generating $@ @@ -41,7 +41,7 @@ server.csr: server-key.pem -key server-key.pem \ -sha256 \ -noenc \ - -subj "/C=XX/ST=Barcelona/L=Barcelona/O=Midokura/CN=localhost" + -subj "/C=XX/ST=Barcelona/L=Barcelona/O=SSS/CN=localhost" server-cert.pem: server.csr ca-cert.pem ca-key.pem @echo Generating $@ diff --git a/test/src/systest/test_sysapp_telemetry.c b/test/src/systest/test_sysapp_telemetry.c index 2cc8844e..85855c4d 100644 --- a/test/src/systest/test_sysapp_telemetry.c +++ b/test/src/systest/test_sysapp_telemetry.c @@ -30,6 +30,7 @@ struct test { struct evp_agent_context *ctxt; pthread_t thread; + pthread_mutex_t mtx; enum SYS_result result; struct SYS_client *c; sem_t sem; @@ -121,8 +122,13 @@ void * __wrap_strdup(const char *s) { void *__real_strdup(const char *); + bool fail; - if (g_test.strdup_fail) + assert(!pthread_mutex_lock(&g_test.mtx)); + fail = g_test.strdup_fail; + assert(!pthread_mutex_unlock(&g_test.mtx)); + + if (fail) return NULL; return __real_strdup(s); @@ -136,6 +142,7 @@ __wrap_sys_collect_telemetry(struct sys_group *gr, sys_telemetry_collect cb, sys_telemetry_collect, void *); int ret; + assert(!pthread_mutex_lock(&g_test.mtx)); if (g_test.fail) { g_test.strdup_fail = true; } @@ -145,6 +152,7 @@ __wrap_sys_collect_telemetry(struct sys_group *gr, sys_telemetry_collect cb, ret = __real_sys_collect_telemetry(gr, cb, user); g_test.strdup_fail = false; + assert(!pthread_mutex_unlock(&g_test.mtx)); return ret; } @@ -167,7 +175,9 @@ setup(void **state) { struct test *test = *state; + assert(!pthread_mutex_lock(&g_test.mtx)); test->fail = false; + assert(!pthread_mutex_unlock(&g_test.mtx)); return setup_common(test); } @@ -176,7 +186,9 @@ setup_error(void **state) { struct test *test = *state; + assert(!pthread_mutex_lock(&g_test.mtx)); test->fail = true; + assert(!pthread_mutex_unlock(&g_test.mtx)); return setup_common(test); } @@ -184,6 +196,8 @@ static int suite_setup(void **state) { struct test *test = &g_test; + int error; + pthread_mutexattr_t attr; if (sem_init(&test->sem, 0, 0)) { fprintf(stderr, "%s: sem_init(3): %s\n", __func__, @@ -191,6 +205,25 @@ suite_setup(void **state) return -1; } + if ((error = pthread_mutexattr_init(&attr))) { + fprintf(stderr, "%s: pthread_mutexattr_init(3): %s\n", + __func__, strerror(error)); + return -1; + } + + if ((error = pthread_mutexattr_settype(&attr, + PTHREAD_MUTEX_RECURSIVE))) { + fprintf(stderr, "%s: pthread_mutexattr_settype(3): %s\n", + __func__, strerror(error)); + return -1; + } + + if ((error = pthread_mutex_init(&test->mtx, &attr))) { + fprintf(stderr, "%s: pthread_mutex_init(3): %s\n", __func__, + strerror(error)); + return -1; + } + agent_test_setup(); test->ctxt = agent_test_start(); @@ -207,6 +240,7 @@ static int suite_teardown(void **state) { struct test *test = *state; + int error; if (sem_destroy(&test->sem)) { fprintf(stderr, "%s: sem_destroy(3): %s\n", __func__, @@ -215,6 +249,13 @@ suite_teardown(void **state) } agent_test_exit(); + + if ((error = pthread_mutex_destroy(&test->mtx))) { + fprintf(stderr, "%s: pthread_mutex_destroy(3): %s\n", __func__, + strerror(error)); + return -1; + } + return 0; } diff --git a/test/src/systest/test_wasm_mod_streams.c b/test/src/systest/test_wasm_mod_streams.c index a9eff333..868ea224 100644 --- a/test/src/systest/test_wasm_mod_streams.c +++ b/test/src/systest/test_wasm_mod_streams.c @@ -6,9 +6,6 @@ #include #include -#include -#include -#include #include #include #include @@ -31,29 +28,23 @@ enum test_wasm_config_echo_payloads { DEPLOYMENT_MANIFEST_1, DEPLOYMENT_MANIFEST_2, - DEPLOYMENT_MANIFEST_3, - DEPLOYMENT_MANIFEST_4, EMPTY_DEPLOYMENT_MANIFEST_1, INSTANCE_CONFIG_1 }; -#define TEST_EMPTY_DEPLOYMENT_ID1 "d2862453-f57e-4ddb-90d2-d470c27f6a92" -#define TEST_DEPLOYMENT_ID1 "4fa905ae-e103-46ab-a8b9-73be07599708" -#define TEST_DEPLOYMENT_ID2 "0f40626e-5d98-4472-ad4e-a4fb1490b382" -#define TEST_DEPLOYMENT_ID3 "f5cb7e2d-4e23-4bc3-bd48-845945de3456" -#define TEST_DEPLOYMENT_ID4 "79e98832-23c7-4733-b656-b49a24e33c89" +#define TEST_EMPTY_DEPLOYMENT_ID "d2862453-f57e-4ddb-90d2-d470c27f6a92" +#define TEST_DEPLOYMENT_ID1 "f5cb7e2d-4e23-4bc3-bd48-845945de3456" +#define TEST_DEPLOYMENT_ID2 "79e98832-23c7-4733-b656-b49a24e33c89" -#define READER_INSTANCE_ID "10709a54-1d35-4955-b087-2380863f7eea" -#define READER_INSTANCE_ID2 "1fddfca9-0607-40f6-8e87-661d9f366424" -#define READER_MODULE_ID "0329dea0-bd16-4e8a-be29-cd415c1a10ff" -#define READER_MODULE_PATH "../test_modules/stream_reader.wasm" +#define READER_INSTANCE_ID "1fddfca9-0607-40f6-8e87-661d9f366424" +#define READER_MODULE_ID "0329dea0-bd16-4e8a-be29-cd415c1a10ff" +#define READER_MODULE_PATH "../test_modules/stream_reader.wasm" #define READER_MODULE_HASH \ "f0464cf80c305261400ebc744571d6cff6968907cc53b24529c1ababfd7aabeb" -#define WRITER_INSTANCE_ID "4a3737bd-98ea-4675-b9f8-336c59bacf78" -#define WRITER_INSTANCE_ID2 "bc7b3156-5651-4efe-8743-ca763e0f2b15" -#define WRITER_MODULE_ID "a2f149eb-3c53-4d02-88af-d0838aa12dcb" -#define WRITER_MODULE_PATH "../test_modules/stream_writer.wasm" +#define WRITER_INSTANCE_ID "bc7b3156-5651-4efe-8743-ca763e0f2b15" +#define WRITER_MODULE_ID "a2f149eb-3c53-4d02-88af-d0838aa12dcb" +#define WRITER_MODULE_PATH "../test_modules/stream_writer.wasm" #define WRITER_MODULE_HASH \ "5b02344d79409668d1da54d50e852380faf98728facbedb0140bb176fe4bdd56" @@ -69,102 +60,6 @@ enum test_wasm_config_echo_payloads { " \"direction\": \"in\"," \ " \"parameters\": {" \ " " \ - "\"connection_string\": \"tcp://127.0.0.1:0\"," \ - " \"mode\": " \ - "\"listen\"," \ - " \"protocol\": " \ - "\"pull\"" \ - " }," \ - " \"type\": \"nng\"" \ - " }" \ - " }," \ - " \"subscribe\": {}" \ - " }" \ - " }," \ - " \"modules\": {" \ - " \"" READER_MODULE_ID "\": {" \ - " \"downloadUrl\": \"file://" READER_MODULE_PATH "\"," \ - " \"entryPoint\": \"main\"," \ - " \"hash\": \"" READER_MODULE_HASH "\"," \ - " \"moduleImpl\": \"wasm\"" \ - " }" \ - " }," \ - " \"publishTopics\": {}," \ - " \"subscribeTopics\": {}" \ - "}" - -#define EVP2_DEPLOYMENT_MANIFEST_2 \ - "{" \ - " \"deploymentId\": \"" TEST_DEPLOYMENT_ID2 "\"," \ - " \"instanceSpecs\": {" \ - " \"" READER_INSTANCE_ID "\": {" \ - " \"moduleId\": \"" READER_MODULE_ID "\"," \ - " \"publish\": {}," \ - " \"streams\": {" \ - " \"in-video-stream\": {" \ - " \"direction\": \"in\"," \ - " \"parameters\": {" \ - " " \ - "\"connection_string\": \"tcp://127.0.0.1:0\"," \ - " \"mode\": " \ - "\"listen\"," \ - " \"protocol\": " \ - "\"pull\"" \ - " }," \ - " \"type\": \"nng\"" \ - " }" \ - " }," \ - " \"subscribe\": {}" \ - " }," \ - " \"" WRITER_INSTANCE_ID "\": {" \ - " \"moduleId\": \"" WRITER_MODULE_ID "\"," \ - " \"publish\": {}," \ - " \"streams\": {" \ - " \"out-video-stream\": {" \ - " \"direction\": \"out\"," \ - " \"parameters\": {" \ - " " \ - "\"connection_string\": \"tcp://127.0.0.1:%hu\"," \ - " \"mode\": \"dial\"," \ - " \"protocol\": " \ - "\"push\"" \ - " }," \ - " \"type\": \"nng\"" \ - " }" \ - " }," \ - " \"subscribe\": {}" \ - " }" \ - " }," \ - " \"modules\": {" \ - " \"" READER_MODULE_ID "\": {" \ - " \"downloadUrl\": \"file://" READER_MODULE_PATH "\"," \ - " \"entryPoint\": \"main\"," \ - " \"hash\": \"" READER_MODULE_HASH "\"," \ - " \"moduleImpl\": \"wasm\"" \ - " }," \ - " \"" WRITER_MODULE_ID "\": {" \ - " \"downloadUrl\": \"file://" WRITER_MODULE_PATH "\"," \ - " \"entryPoint\": \"main\"," \ - " \"hash\": \"" WRITER_MODULE_HASH "\"," \ - " \"moduleImpl\": \"wasm\"" \ - " }" \ - " }," \ - " \"publishTopics\": {}," \ - " \"subscribeTopics\": {}" \ - "}" - -#define EVP2_DEPLOYMENT_MANIFEST_3 \ - "{" \ - " \"deploymentId\": \"" TEST_DEPLOYMENT_ID3 "\"," \ - " \"instanceSpecs\": {" \ - " \"" READER_INSTANCE_ID2 "\": {" \ - " \"moduleId\": \"" READER_MODULE_ID "\"," \ - " \"publish\": {}," \ - " \"streams\": {" \ - " \"in-video-stream\": {" \ - " \"direction\": \"in\"," \ - " \"parameters\": {" \ - " " \ "\"hostname\": \"127.0.0.1\"," \ "\"port\": \"0\"," \ "\"domain\": \"IPv4\"," \ @@ -188,11 +83,11 @@ enum test_wasm_config_echo_payloads { " \"subscribeTopics\": {}" \ "}" -#define EVP2_DEPLOYMENT_MANIFEST_4 \ +#define EVP2_DEPLOYMENT_MANIFEST_2 \ "{" \ - " \"deploymentId\": \"" TEST_DEPLOYMENT_ID4 "\"," \ + " \"deploymentId\": \"" TEST_DEPLOYMENT_ID2 "\"," \ " \"instanceSpecs\": {" \ - " \"" READER_INSTANCE_ID2 "\": {" \ + " \"" READER_INSTANCE_ID "\": {" \ " \"moduleId\": \"" READER_MODULE_ID "\"," \ " \"publish\": {}," \ " \"streams\": {" \ @@ -210,7 +105,7 @@ enum test_wasm_config_echo_payloads { " }," \ " \"subscribe\": {}" \ " }," \ - " \"" WRITER_INSTANCE_ID2 "\": {" \ + " \"" WRITER_INSTANCE_ID "\": {" \ " \"moduleId\": \"" WRITER_MODULE_ID "\"," \ " \"publish\": {}," \ " \"streams\": {" \ @@ -249,7 +144,7 @@ enum test_wasm_config_echo_payloads { #define EVP2_EMPTY_DEPLOYMENT_MANIFEST_1 \ "{" \ - " \"deploymentId\": \"" TEST_EMPTY_DEPLOYMENT_ID1 "\"," \ + " \"deploymentId\": \"" TEST_EMPTY_DEPLOYMENT_ID "\"," \ " \"instanceSpecs\": {}," \ " \"modules\": {}," \ " \"publishTopics\": {}," \ @@ -276,10 +171,10 @@ send_deployment(struct evp_agent_context *ctxt, const char *payload) } } -static char *evp2_deployment2; +static char *evp2_deployment; static void -test_wasm_mod_streams_nng(void **state) +test_wasm_mod_streams_posix(void **state) { struct evp_agent_context *ctxt = *state; const char *iot = getenv("EVP_IOT_PLATFORM"); @@ -309,15 +204,16 @@ test_wasm_mod_streams_nng(void **state) sdk_unlock(); assert_non_null(h); + struct stream_impl *si = stream_from_name(h, "in-video-stream"); assert_non_null(si); assert_ptr_equal(si, p.si); - xasprintf(&evp2_deployment2, EVP2_DEPLOYMENT_MANIFEST_2, p.port); + xasprintf(&evp2_deployment, EVP2_DEPLOYMENT_MANIFEST_2, p.port); agent_register_payload(DEPLOYMENT_MANIFEST_2, EVP_HUB_TYPE_EVP2_TB, - evp2_deployment2); + evp2_deployment); agent_send_deployment(ctxt, agent_get_payload(DEPLOYMENT_MANIFEST_2)); @@ -335,70 +231,7 @@ test_wasm_mod_streams_nng(void **state) agent_poll(verify_json, "deploymentStatus.deploymentId=%s," "deploymentStatus.reconcileStatus=%s", - TEST_EMPTY_DEPLOYMENT_ID1, "ok"); -} - -static char *evp2_deployment4; - -static void -test_wasm_mod_streams_posix(void **state) -{ - struct evp_agent_context *ctxt = *state; - const char *iot = getenv("EVP_IOT_PLATFORM"); - assert_non_null(iot); - - if (!strcmp(iot, "EVP1")) { - skip(); - } - - struct stream_port p; - struct notification_entry *e; - struct notification *n = stream_notification(); - - assert_non_null(n); - assert_int_equal( - notification_subscribe(n, "init/port", on_port, &p, &e), 0); - - send_deployment(ctxt, agent_get_payload(DEPLOYMENT_MANIFEST_3)); - - agent_poll(verify_json, - "deploymentStatus.deploymentId=%s," - "deploymentStatus.reconcileStatus=%s", - TEST_DEPLOYMENT_ID3, "ok"); - - sdk_lock(); - struct EVP_client *h = sdk_handle_from_name(READER_INSTANCE_ID2); - sdk_unlock(); - - assert_non_null(h); - - struct stream_impl *si = stream_from_name(h, "in-video-stream"); - - assert_non_null(si); - assert_ptr_equal(si, p.si); - - xasprintf(&evp2_deployment4, EVP2_DEPLOYMENT_MANIFEST_4, p.port); - - agent_register_payload(DEPLOYMENT_MANIFEST_4, EVP_HUB_TYPE_EVP2_TB, - evp2_deployment4); - - agent_send_deployment(ctxt, agent_get_payload(DEPLOYMENT_MANIFEST_4)); - - agent_poll(verify_json, - "deploymentStatus.deploymentId=%s," - "deploymentStatus.reconcileStatus=%s", - TEST_DEPLOYMENT_ID4, "ok"); - - agent_poll(verify_contains, "stream-read-ok"); - assert_int_equal(notification_unsubscribe(n, e), 0); - - // send empty deployment - send_deployment(ctxt, agent_get_payload(EMPTY_DEPLOYMENT_MANIFEST_1)); - - agent_poll(verify_json, - "deploymentStatus.deploymentId=%s," - "deploymentStatus.reconcileStatus=%s", - TEST_EMPTY_DEPLOYMENT_ID1, "ok"); + TEST_EMPTY_DEPLOYMENT_ID, "ok"); } static int @@ -407,8 +240,7 @@ teardown(void **state) // wait for agent to finish agent_test_exit(); - free(evp2_deployment2); - free(evp2_deployment4); + free(evp2_deployment); return 0; } @@ -444,9 +276,6 @@ setup(void **state) agent_register_payload(DEPLOYMENT_MANIFEST_1, EVP_HUB_TYPE_EVP2_TB, EVP2_DEPLOYMENT_MANIFEST_1); - - agent_register_payload(DEPLOYMENT_MANIFEST_3, EVP_HUB_TYPE_EVP2_TB, - EVP2_DEPLOYMENT_MANIFEST_3); return 0; } @@ -455,7 +284,6 @@ main(void) { // define tests const struct CMUnitTest tests[] = { - cmocka_unit_test(test_wasm_mod_streams_nng), cmocka_unit_test(test_wasm_mod_streams_posix), }; // setup, run tests and teardown diff --git a/test/src/ut-nohub/test_sdkenc.c b/test/src/ut-nohub/test_sdkenc.c index d7731823..c81603b6 100644 --- a/test/src/ut-nohub/test_sdkenc.c +++ b/test/src/ut-nohub/test_sdkenc.c @@ -5,6 +5,9 @@ */ #include +#include +#include +#include #include #include #include @@ -15,9 +18,6 @@ #include #include "hub.h" -#include "sdk_builder.h" -#include "sdk_reader.h" -#include "sdk_verifier.h" #undef ns #define ns(a) FLATBUFFERS_WRAP_NAMESPACE(EVP_SDK, a) diff --git a/test_modules/nng_test.c b/test_modules/nng_test.c deleted file mode 100644 index d27b6bbb..00000000 --- a/test_modules/nng_test.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "evp/sdk.h" - -int -main(void) -{ - int ret = EXIT_FAILURE; - int error; - nng_socket s = {0}; - nng_listener l = {0}; - struct EVP_client *h = EVP_initialize(); - - if (h == NULL) { - log_module(module_name, "EVP_initialize failed\n"); - goto end; - } - - error = nng_pull0_open(&s); - if (error != 0) { - log_module(module_name, "nng_pull0_open failed: %s\n", - nng_strerror(error)); - goto end; - } - - error = nng_listener_create(&l, s, "tcp://127.0.0.1:9090"); - if (error != 0) { - log_module(module_name, "nng_dialer_create failed: %s\n", - nng_strerror(error)); - goto end; - } - - error = nng_listener_start(l, 0); - if (error != 0) { - log_module(module_name, "nng_listener_create failed: %s\n", - nng_strerror(error)); - goto end; - } - - for (;;) { - EVP_RESULT result = EVP_processEvent(h, 1000); - - if (result == EVP_SHOULDEXIT) { - break; - } - } - - ret = EXIT_SUCCESS; - -end: - if (l.id != 0) { - error = nng_listener_close(l); - if (error != 0) { - log_module(module_name, - "nng_listener_close failed: %s\n", - nng_strerror(error)); - ret = EXIT_FAILURE; - } - } - - if (s.id != 0) { - error = nng_close(s); - if (error != 0) { - log_module(module_name, "nng_close failed: %s\n", - nng_strerror(error)); - ret = EXIT_FAILURE; - } - } - - return ret; -} diff --git a/tools/fortify/filter-agent.txt b/tools/fortify/filter-agent.txt index b543e5a8..02ee3623 100644 --- a/tools/fortify/filter-agent.txt +++ b/tools/fortify/filter-agent.txt @@ -187,79 +187,6 @@ F4BC0DB59A449AD000146D1FF3F6A717 # VariableAccess: tmpmax [req.c(133)] EC3A8A0AD55E3A2C4FF67D7A5EB5A853 -# False positive. -# Yet again, Fortify fails to see the ownership for nng is transferred to -# si->params if successful, or freed otherwise. -# [1A885094842BD658D060434C33161244 : high : Memory Leak : controlflow ] -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(102) : Branch taken: (cfg->protocol == 1) -# stream/nng.c(102) : goto -# stream/nng.c(104) : Branch taken: (error != 0) -# stream/nng.c(107) : allocated -> allocated : return -# stream/nng.c(107) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(107) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(112) : Branch taken: (cfg->mode == 0) -# stream/nng.c(112) : goto -# stream/nng.c(115) : Branch taken: (error != 0) -# stream/nng.c(118) : allocated -> allocated : return -# stream/nng.c(118) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(118) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(128) : Branch taken: (cfg->mode == 1) -# stream/nng.c(128) : goto -# stream/nng.c(131) : Branch taken: (error != 0) -# stream/nng.c(134) : allocated -> allocated : return -# stream/nng.c(134) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(134) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(94) : Branch taken: (cfg->protocol == 0) -# stream/nng.c(94) : goto -# stream/nng.c(96) : Branch taken: (error != 0) -# stream/nng.c(99) : goto -# stream/nng.c(148) : Branch not taken: (ret == 0) -# stream/nng.c(154) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(154) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(112) : Branch taken: (cfg->mode == 0) -# stream/nng.c(112) : goto -# stream/nng.c(115) : Branch not taken: (error == 0) -# stream/nng.c(122) : Branch taken: (error != 0) -# stream/nng.c(125) : allocated -> allocated : return -# stream/nng.c(125) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(125) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(128) : Branch taken: (cfg->mode == 1) -# stream/nng.c(128) : goto -# stream/nng.c(131) : Branch not taken: (error == 0) -# stream/nng.c(138) : Branch taken: (error != 0) -# stream/nng.c(141) : allocated -> allocated : return -# stream/nng.c(141) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(141) : allocated -> leak : nng end scope : Memory leaked -1A885094842BD658D060434C33161244 - # False positive. # Yet again, Fortify fails to see the ownership for si is transferred on the # call to stream_insert when successful, or freed otherwise. @@ -305,65 +232,69 @@ EC3A8A0AD55E3A2C4FF67D7A5EB5A853 # Filtering flatbuffers issues # ########################################################## -# [6EBADB667319025D962EA0A1E48D58DC : high : Integer Overflow : dataflow ] -# libevp-agent/sdk_remote.c(559) : ->malloc(0) -# libevp-agent/sdk_remote.c(554) : <=> (nentries) -# libevp-agent/sdkenc/sdk_reader.h(897) : return -# flatcc/include/flatcc/flatcc_endian.h(87) : return -# flatcc/include/flatcc/flatcc_endian.h(87) : return +# [994C38F53DC53FA3194741CAC501D7A2 : high : Integer Overflow : dataflow ] +# sdk_remote.c(567) : ->malloc(0) +# sdk_remote.c(562) : <=> (nentries) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(832) : return +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return # /usr/include/x86_64-linux-gnu/bits/uintn-identity.h(41) : return (__x) -# flatcc/include/flatcc/flatcc_endian.h(87) : <->__uint32_identity(0->return) -# flatcc/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_cast_from_pe(0->return) -# libevp-agent/sdkenc/sdk_reader.h(897) : <->__flatbuffers_uoffset_read_from_pe(0->return) -# libevp-agent/sdk_remote.c(554) : <->EVP_SDK_TelemetryEntry_vec_len(0->return) -# libevp-agent/sdk_remote.c(553) : <=> (vec) -# libevp-agent/sdkenc/sdk_reader.h(913) : return -# libevp-agent/sdkenc/sdk_reader.h(913) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(553) : <->EVP_SDK_TelemetryInput_entries(0->return) -# libevp-agent/sdk_remote.c(550) : <=> (t) -# libevp-agent/sdkenc/sdk_reader.h(1098) : return -# libevp-agent/sdkenc/sdk_reader.h(1098) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(550) : <->EVP_SDK_Request_body(0->return) -# libevp-agent/sdk_remote.c(969) : ->process_send_telemetry(1) -# libevp-agent/sdk_remote.c(926) : <=> (req) -# libevp-agent/sdkenc/sdk_reader.h(1096) : return -# libevp-agent/sdk_remote.c(926) : <->EVP_SDK_Request_as_root(0->return) -# libevp-agent/sdkrpc/server.c(96) : ->sdk_process_request(0) -# libevp-agent/sdkrpc/server.c(85) : <- readall(1) -# libevp-agent/ioutil.c(28) : <- read(1) -6EBADB667319025D962EA0A1E48D58DC - -# [974D927872FA4C2E2EBCCFD5EFAD10E6 : high : Integer Overflow : dataflow ] -# libevp-agent/sdk_remote.c(496) : ->calloc(0) -# libevp-agent/sdk_remote.c(493) : <=> (http_ext_request.nheaders) -# libevp-agent/sdkenc/flatbuffers_common_reader.h(135) : return -# flatcc/include/flatcc/flatcc_endian.h(87) : return -# flatcc/include/flatcc/flatcc_endian.h(87) : return +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__uint32_identity(0->return) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_cast_from_pe(0->return) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return (p) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_read(0->return) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(832) : <->__flatbuffers_uoffset_read_from_pe(0->return) +# sdk_remote.c(562) : <->EVP_SDK_TelemetryEntry_vec_len(0->return) +# sdk_remote.c(561) : <=> (vec) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(848) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(848) : <=> (elem__tmp) +# sdk_remote.c(561) : <->EVP_SDK_TelemetryInput_entries(0->return) +# sdk_remote.c(558) : <=> (t) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : <=> (elem__tmp) +# sdk_remote.c(558) : <->EVP_SDK_Request_body(0->return) +# sdk_remote.c(952) : ->process_send_telemetry(1) +# sdk_remote.c(909) : <=> (req) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1031) : return +# sdk_remote.c(909) : <->EVP_SDK_Request_as_root(0->return) +# sdkrpc/server.c(96) : ->sdk_process_request(0) +# sdkrpc/server.c(85) : <- readall(1) +# ioutil.c(22) : <- read(1) +994C38F53DC53FA3194741CAC501D7A2 + +# [C4E975D3F24A6B555BDF5CAB0D8F241B : high : Integer Overflow : dataflow ] +# sdk_remote.c(504) : ->calloc(0) +# sdk_remote.c(501) : <=> (http_ext_request.nheaders) +# /__w/wedge-agent/wedge-agent/include/sdkenc/flatbuffers_common_reader.h(135) : return +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return # /usr/include/x86_64-linux-gnu/bits/uintn-identity.h(41) : return (__x) -# flatcc/include/flatcc/flatcc_endian.h(87) : <->__uint32_identity(0->return) -# flatcc/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_cast_from_pe(0->return) -# libevp-agent/sdkenc/flatbuffers_common_reader.h(135) : <->__flatbuffers_uoffset_read_from_pe(0->return) -# libevp-agent/sdk_remote.c(494) : <->flatbuffers_string_vec_len(0->return) -# libevp-agent/sdk_remote.c(491) : <=> (headers_vec) -# libevp-agent/sdkenc/sdk_reader.h(714) : return -# libevp-agent/sdkenc/sdk_reader.h(714) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(492) : <->EVP_SDK_BlobRequestHttpExt_headers(0->return) -# libevp-agent/sdk_remote.c(483) : <=> (http_ext) -# libevp-agent/sdkenc/sdk_reader.h(759) : return -# libevp-agent/sdkenc/sdk_reader.h(759) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(484) : <->EVP_SDK_BlobInput_request(0->return) -# libevp-agent/sdk_remote.c(414) : <=> (blob) -# libevp-agent/sdkenc/sdk_reader.h(1098) : return -# libevp-agent/sdkenc/sdk_reader.h(1098) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(414) : <->EVP_SDK_Request_body(0->return) -# libevp-agent/sdk_remote.c(969) : ->process_blob_operation(1) -# libevp-agent/sdk_remote.c(926) : <=> (req) -# libevp-agent/sdkenc/sdk_reader.h(1096) : return -# libevp-agent/sdk_remote.c(926) : <->EVP_SDK_Request_as_root(0->return) -# libevp-agent/sdkrpc/server.c(96) : ->sdk_process_request(0) -# libevp-agent/sdkrpc/server.c(85) : <- readall(1) -# libevp-agent/ioutil.c(28) : <- read(1) -974D927872FA4C2E2EBCCFD5EFAD10E6 +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__uint32_identity(0->return) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_cast_from_pe(0->return) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : return (p) +# /__w/wedge-agent/wedge-agent/include/flatcc/flatcc_endian.h(87) : <->__flatbuffers_uoffset_read(0->return) +# /__w/wedge-agent/wedge-agent/include/sdkenc/flatbuffers_common_reader.h(135) : <->__flatbuffers_uoffset_read_from_pe(0->return) +# sdk_remote.c(502) : <->flatbuffers_string_vec_len(0->return) +# sdk_remote.c(499) : <=> (headers_vec) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(649) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(649) : <=> (elem__tmp) +# sdk_remote.c(500) : <->EVP_SDK_BlobRequestHttpExt_headers(0->return) +# sdk_remote.c(491) : <=> (http_ext) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(694) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(694) : <=> (elem__tmp) +# sdk_remote.c(492) : <->EVP_SDK_BlobInput_request(0->return) +# sdk_remote.c(422) : <=> (blob) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : <=> (elem__tmp) +# sdk_remote.c(422) : <->EVP_SDK_Request_body(0->return) +# sdk_remote.c(952) : ->process_blob_operation(1) +# sdk_remote.c(909) : <=> (req) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1031) : return +# sdk_remote.c(909) : <->EVP_SDK_Request_as_root(0->return) +# sdkrpc/server.c(96) : ->sdk_process_request(0) +# sdkrpc/server.c(85) : <- readall(1) +# ioutil.c(22) : <- read(1) +C4E975D3F24A6B555BDF5CAB0D8F241B ################## # MQTT-C related # @@ -592,16 +523,16 @@ B838E55D9366945FE643B14028366303 # And in this branch there is the free # sdk_remote.c(491) ==> free(entries); # -# [6BAB7EEBA1E6EBF51D76071F2CBF4A74 : high : Memory Leak : controlflow ] +# [52F5843BA1269E1A5925D903D288954D : high : Memory Leak : controlflow ] # -# libevp-agent/sdk_remote.c(552) : Branch taken: (t != NULL) -# libevp-agent/sdk_remote.c(558) : start -> allocated : entries = malloc(...) -# libevp-agent/sdk_remote.c(558) : allocated -> allocated : entries refers to dynamically allocated memory -# libevp-agent/sdk_remote.c(560) : Branch not taken: (entries != NULL) -# libevp-agent/sdk_remote.c(579) : Branch not taken: (0 == ret) -# libevp-agent/sdk_remote.c(596) : allocated -> allocated : entries no longer refers to dynamically allocated memory -# libevp-agent/sdk_remote.c(596) : allocated -> leak : entries end scope : Memory leaked -6BAB7EEBA1E6EBF51D76071F2CBF4A74 +# sdk_remote.c(560) : Branch taken: (t != NULL) +# sdk_remote.c(566) : start -> allocated : entries = malloc(...) +# sdk_remote.c(566) : allocated -> allocated : entries refers to dynamically allocated memory +# sdk_remote.c(568) : Branch not taken: (entries != NULL) +# sdk_remote.c(587) : Branch not taken: (0 == ret) +# sdk_remote.c(604) : allocated -> allocated : entries no longer refers to dynamically allocated memory +# sdk_remote.c(604) : allocated -> leak : entries end scope : Memory leaked +52F5843BA1269E1A5925D903D288954D # The EVP SDK (agent side) allocates memory for each event (event is any action, # like RPC, telemetry, ...) and put in queue and wait feedback from the agent. @@ -612,100 +543,127 @@ B838E55D9366945FE643B14028366303 # This one frees the allocated fields and the event itself. # So the all issues related with sdk when a event is enqued is a false positive # 8 issues 8 type of events (so it matches) -# [067C59367AD524EC4D6133BE4D62A0AC : high : Memory Leak : controlflow ] -# -# sdk.c(244) : Branch taken: (h != NULL) -# sdk.c(244) : Branch taken: (h->exiting == 0) -# sdk.c(255) : Branch not taken: (event == NULL) -# sdk.c(259) : start -> allocated : config = xcalloc_internal(...) -# util.c(188) : start -> allocated : vp = calloc(...) -# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory -# util.c(189) : Branch not taken: (vp != NULL) -# util.c(192) : allocated -> allocated : return -# sdk.c(259) : allocated -> allocated : config refers to dynamically allocated memory -# sdk.c(267) : allocated -> allocated : config no longer refers to dynamically allocated memory -# sdk.c(267) : allocated -> leak : config end scope : Memory leaked -067C59367AD524EC4D6133BE4D62A0AC - -# [DCAD7EB558B6D37BA468C58E7B1385D7 : high : Memory Leak : controlflow ] -# -# sdk.c(301) : Branch taken: (h != NULL) -# sdk.c(301) : Branch taken: (h->exiting == 0) -# sdk.c(302) : start -> allocated : r = xcalloc_internal(...) -# util.c(188) : start -> allocated : vp = calloc(...) -# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory -# util.c(189) : Branch not taken: (vp != NULL) -# util.c(192) : allocated -> allocated : return -# sdk.c(302) : allocated -> allocated : r refers to dynamically allocated memory -# sdk.c(309) : allocated -> allocated : r no longer refers to dynamically allocated memory -# sdk.c(309) : allocated -> leak : r end scope : Memory leaked -DCAD7EB558B6D37BA468C58E7B1385D7 - -# [0225114F0DD658B78203F1590A4D491A : high : Memory Leak : controlflow ] -# -# sdk.c(244) : Branch taken: (h != NULL) -# sdk.c(244) : Branch taken: (h->exiting == 0) -# sdk.c(264) : start -> allocated : config->topic = xstrdup_internal(...) -# util.c(221) : start -> allocated : cp = strdup(...) -# util.c(221) : allocated -> allocated : cp refers to dynamically allocated memory -# util.c(222) : Branch not taken: (cp != NULL) -# util.c(225) : allocated -> allocated : return -# sdk.c(264) : allocated -> allocated : config->topic refers to dynamically allocated memory -# sdk.c(267) : allocated -> allocated : config->topic no longer refers to dynamically allocated memory -# sdk.c(267) : allocated -> leak : config end scope : Memory leaked -0225114F0DD658B78203F1590A4D491A +#[753C80AA0C46D7EFF76F1EF35D45EAA6 : high : Memory Leak : controlflow ] +# +# sdk.c(245) : Branch taken: (h != NULL) +# sdk.c(245) : Branch taken: (h->exiting == 0) +# sdk.c(256) : Branch not taken: (event == NULL) +# sdk.c(260) : start -> allocated : config = xcalloc_internal(...) +# util.c(188) : start -> allocated : vp = calloc(...) +# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory +# util.c(189) : Branch not taken: (vp != NULL) +# util.c(192) : allocated -> allocated : return +# sdk.c(260) : allocated -> allocated : config refers to dynamically allocated memory +# sdk.c(268) : allocated -> allocated : config no longer refers to dynamically allocated memory +# sdk.c(268) : allocated -> leak : config end scope : Memory leaked +753C80AA0C46D7EFF76F1EF35D45EAA6 + +#[7E30001FB07717CFF2FE5B13587B01B0 : high : Memory Leak : controlflow ] +# +# sdk.c(302) : Branch taken: (h != NULL) +# sdk.c(302) : Branch taken: (h->exiting == 0) +# sdk.c(303) : start -> allocated : r = xcalloc_internal(...) +# util.c(188) : start -> allocated : vp = calloc(...) +# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory +# util.c(189) : Branch not taken: (vp != NULL) +# util.c(192) : allocated -> allocated : return +# sdk.c(303) : allocated -> allocated : r refers to dynamically allocated memory +# sdk.c(310) : allocated -> allocated : r no longer refers to dynamically allocated memory +# sdk.c(310) : allocated -> leak : r end scope : Memory leaked +7E30001FB07717CFF2FE5B13587B01B0 + +#[753C80AA0C46D7EFF76F1EF35D45EAA6 : high : Memory Leak : controlflow ] +# +# sdk.c(245) : Branch taken: (h != NULL) +# sdk.c(245) : Branch taken: (h->exiting == 0) +# sdk.c(256) : Branch not taken: (event == NULL) +# sdk.c(260) : start -> allocated : config = xcalloc_internal(...) +# util.c(188) : start -> allocated : vp = calloc(...) +# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory +# util.c(189) : Branch not taken: (vp != NULL) +# util.c(192) : allocated -> allocated : return +# sdk.c(260) : allocated -> allocated : config refers to dynamically allocated memory +# sdk.c(268) : allocated -> allocated : config no longer refers to dynamically allocated memory +# sdk.c(268) : allocated -> leak : config end scope : Memory leaked +753C80AA0C46D7EFF76F1EF35D45EAA6 # False positive. The ownership for instance_name is transferred to the # caller when successful. Otherwise, the memory is released via free(3). -# [2875963782EF8F6D3886C98861CEC80A : high : Memory Leak : controlflow ] -# -# sdk.c(1340) : start -> allocated : instance_name = strdup(...) -# sdk.c(1340) : allocated -> allocated : instance_name refers to dynamically allocated memory -# sdk.c(1343) : Branch not taken: (instance_name != NULL) -# sdk.c(1343) : Branch taken: (remote_name == NULL) -# sdk.c(1345) : goto -# sdk.c(1355) : Branch not taken: (ret == 0) -# sdk.c(1360) : allocated -> allocated : instance_name no longer refers to dynamically allocated memory -# sdk.c(1360) : allocated -> leak : instance_name end scope : Memory leaked -2875963782EF8F6D3886C98861CEC80A +#[BC68A3AE07F66F3EA7F344AA1CF6B9E1 : high : Memory Leak : controlflow ] +# +# sdk.c(1351) : start -> allocated : instance_name = strdup(...) +# sdk.c(1351) : allocated -> allocated : instance_name refers to dynamically allocated memory +# sdk.c(1353) : Branch taken: (evp_ext->storage_name != NULL) +# sdk.c(1356) : Branch taken: (storage_name == NULL) +# sdk.c(1358) : goto +# sdk.c(1372) : Branch not taken: (ret == 0) +# sdk.c(1377) : allocated -> allocated : instance_name no longer refers to dynamically allocated memory +# sdk.c(1377) : allocated -> leak : instance_name end scope : Memory leaked +BC68A3AE07F66F3EA7F344AA1CF6B9E1 -# False positive. Similar to 2875963782EF8F6D3886C98861CEC80A. -# [3D0F88E4D11DF8FC1CE7FBEA5FDCA9FC : high : Memory Leak : controlflow ] +# False positive. +#[88FACBFC4F408F7012D2315A7D788BF9 : high : Memory Leak : controlflow ] # -# sdk.c(1341) : start -> allocated : remote_name = strdup(...) -# sdk.c(1341) : allocated -> allocated : remote_name refers to dynamically allocated memory -# sdk.c(1343) : Branch taken: (instance_name == NULL) -# sdk.c(1345) : goto -# sdk.c(1355) : Branch not taken: (ret == 0) -# sdk.c(1360) : allocated -> allocated : remote_name no longer refers to dynamically allocated memory -# sdk.c(1360) : allocated -> leak : remote_name end scope : Memory leaked -3D0F88E4D11DF8FC1CE7FBEA5FDCA9FC - -# False positive. Similar to 2875963782EF8F6D3886C98861CEC80A. -# [00327D8809D0B8577E45D1A736AD8420 : high : Memory Leak : controlflow ] -# -# sdk.c(1370) : start -> allocated : remote_name = strdup(...) -# sdk.c(1370) : allocated -> allocated : remote_name refers to dynamically allocated memory -# sdk.c(1373) : Branch taken: (evp_ext->storage_name != NULL) -# sdk.c(1376) : Branch taken: (storage_name == NULL) -# sdk.c(1378) : goto -# sdk.c(1392) : Branch not taken: (ret == 0) -# sdk.c(1397) : allocated -> allocated : remote_name no longer refers to dynamically allocated memory -# sdk.c(1397) : allocated -> leak : remote_name end scope : Memory leaked -00327D8809D0B8577E45D1A736AD8420 +# sdk.c(1321) : start -> allocated : remote_name = strdup(...) +# sdk.c(1321) : allocated -> allocated : remote_name refers to dynamically allocated memory +# sdk.c(1323) : Branch taken: (instance_name == NULL) +# sdk.c(1325) : goto +# sdk.c(1335) : Branch not taken: (ret == 0) +# sdk.c(1340) : allocated -> allocated : remote_name no longer refers to dynamically allocated memory +# sdk.c(1340) : allocated -> leak : remote_name end scope : Memory leaked +88FACBFC4F408F7012D2315A7D788BF9 # False positive. Similar to 2875963782EF8F6D3886C98861CEC80A. -# [3CA40910073FFCA06B9FA2F3D81DA617 : high : Memory Leak : controlflow ] -# -# sdk.c(1371) : start -> allocated : instance_name = strdup(...) -# sdk.c(1371) : allocated -> allocated : instance_name refers to dynamically allocated memory -# sdk.c(1373) : Branch taken: (evp_ext->storage_name != NULL) -# sdk.c(1376) : Branch taken: (storage_name == NULL) -# sdk.c(1378) : goto -# sdk.c(1392) : Branch not taken: (ret == 0) -# sdk.c(1397) : allocated -> allocated : instance_name no longer refers to dynamically allocated memory -# sdk.c(1397) : allocated -> leak : instance_name end scope : Memory leaked -3CA40910073FFCA06B9FA2F3D81DA617 +#[05D749459E2661F49E9A2800A98323B3 : high : Memory Leak : controlflow ] +# +# sdk.c(1350) : start -> allocated : remote_name = strdup(...) +# sdk.c(1350) : allocated -> allocated : remote_name refers to dynamically allocated memory +# sdk.c(1353) : Branch taken: (evp_ext->storage_name != NULL) +# sdk.c(1356) : Branch taken: (storage_name == NULL) +# sdk.c(1358) : goto +# sdk.c(1372) : Branch not taken: (ret == 0) +# sdk.c(1377) : allocated -> allocated : remote_name no longer refers to dynamically allocated memory +# sdk.c(1377) : allocated -> leak : remote_name end scope : Memory leaked +05D749459E2661F49E9A2800A98323B3 + +#[13DD2A203C18A517C7B4840513317DB0 : high : Memory Leak : controlflow ] +# +# sdk.c(245) : Branch taken: (h != NULL) +# sdk.c(245) : Branch taken: (h->exiting == 0) +# sdk.c(265) : start -> allocated : config->topic = xstrdup_internal(...) +# util.c(221) : start -> allocated : cp = strdup(...) +# util.c(221) : allocated -> allocated : cp refers to dynamically allocated memory +# util.c(222) : Branch not taken: (cp != NULL) +# util.c(225) : allocated -> allocated : return +# sdk.c(265) : allocated -> allocated : config->topic refers to dynamically allocated memory +# sdk.c(268) : allocated -> allocated : config->topic no longer refers to dynamically allocated memory +# sdk.c(268) : allocated -> leak : config end scope : Memory leaked +13DD2A203C18A517C7B4840513317DB0 + +#[89E9B42F5C5AF6377B59C48DE9E785F7 : high : Memory Leak : controlflow ] +# +# sdk.c(1016) : Branch not taken: (g_mqtt_client != NULL) +# sdk.c(1022) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, len) != 0) +# sdk.c(1033) : start -> allocated : state = malloc(...) +# sdk.c(1033) : allocated -> allocated : state refers to dynamically allocated memory +# sdk.c(1034) : Branch not taken: (state != NULL) +# sdk.c(1054) : Branch not taken: (oevent == NULL) +# sdk.c(1082) : Branch not taken: (ret == 0) +# sdk.c(1085) : allocated -> allocated : state no longer refers to dynamically allocated memory +# sdk.c(1085) : allocated -> leak : state end scope : Memory leaked +89E9B42F5C5AF6377B59C48DE9E785F7 + +#[4E89E0F5591AA8A38639E4FE6EB0A8B2 : high : Memory Leak : controlflow ] +# +# sdk.c(1320) : start -> allocated : instance_name = strdup(...) +# sdk.c(1320) : allocated -> allocated : instance_name refers to dynamically allocated memory +# sdk.c(1323) : Branch not taken: (instance_name != NULL) +# sdk.c(1323) : Branch taken: (remote_name == NULL) +# sdk.c(1325) : goto +# sdk.c(1335) : Branch not taken: (ret == 0) +# sdk.c(1340) : allocated -> allocated : instance_name no longer refers to dynamically allocated memory +# sdk.c(1340) : allocated -> leak : instance_name end scope : Memory leaked +4E89E0F5591AA8A38639E4FE6EB0A8B2 # False positive # @@ -718,14 +676,14 @@ DCAD7EB558B6D37BA468C58E7B1385D7 # gets each element in the queue # cast to specific event. # free at the end of each event by sdk_free_event -# [B0CE5CE3545B4A42DE7B936450EFBF70 : high : Memory Leak : controlflow ] +#[3E1476C1E6658229EE0E5AF63E7786B7 : high : Memory Leak : controlflow ] # -# sdk.c(1679) : start -> allocated : event_message = malloc(...) -# sdk.c(1679) : allocated -> allocated : event_message refers to dynamically allocated memory -# sdk.c(1681) : Branch not taken: (event_message != NULL) -# sdk.c(1712) : allocated -> allocated : event_message no longer refers to dynamically allocated memory -# sdk.c(1712) : allocated -> leak : event_message end scope : Memory leaked -B0CE5CE3545B4A42DE7B936450EFBF70 +# sdk.c(1659) : start -> allocated : event_message = malloc(...) +# sdk.c(1659) : allocated -> allocated : event_message refers to dynamically allocated memory +# sdk.c(1661) : Branch not taken: (event_message != NULL) +# sdk.c(1692) : allocated -> allocated : event_message no longer refers to dynamically allocated memory +# sdk.c(1692) : allocated -> leak : event_message end scope : Memory leaked +3E1476C1E6658229EE0E5AF63E7786B7 # False positive (idem of previous) # @@ -738,28 +696,28 @@ B0CE5CE3545B4A42DE7B936450EFBF70 # gets each element in the queue # cast to specific event. # free at the end of each event by sdk_free_event -# [7E018F765E3B9D243BFD58974619AB3E : high : Memory Leak : controlflow ] -# -# sdk.c(1741) : Branch not taken: (g_mqtt_client != NULL) -# sdk.c(1745) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, total_size) != 0) -# sdk.c(1749) : start -> allocated : t = malloc(...) -# sdk.c(1749) : allocated -> allocated : t refers to dynamically allocated memory -# sdk.c(1750) : Branch not taken: (t != NULL) -# sdk.c(1780) : allocated -> allocated : t no longer refers to dynamically allocated memory -# sdk.c(1780) : allocated -> leak : t end scope : Memory leaked -7E018F765E3B9D243BFD58974619AB3E - -# [508BA8845299DD5DDF222FB8FABDB985 : high : Memory Leak : controlflow ] -# -# sdk.c(1837) : Branch not taken: (response != NULL) -# sdk.c(1846) : Branch not taken: (g_mqtt_client != NULL) -# sdk.c(1851) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, outsz) != 0) -# sdk.c(1855) : start -> allocated : r = malloc(...) -# sdk.c(1855) : allocated -> allocated : r refers to dynamically allocated memory -# sdk.c(1856) : Branch not taken: (r != NULL) -# sdk.c(1884) : allocated -> allocated : r no longer refers to dynamically allocated memory -# sdk.c(1884) : allocated -> leak : r end scope : Memory leaked -508BA8845299DD5DDF222FB8FABDB985 +#[B3B20F3988D18CC8CA5C28514719C705 : high : Memory Leak : controlflow ] +# +# sdk.c(1721) : Branch not taken: (g_mqtt_client != NULL) +# sdk.c(1725) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, total_size) != 0) +# sdk.c(1729) : start -> allocated : t = malloc(...) +# sdk.c(1729) : allocated -> allocated : t refers to dynamically allocated memory +# sdk.c(1730) : Branch not taken: (t != NULL) +# sdk.c(1760) : allocated -> allocated : t no longer refers to dynamically allocated memory +# sdk.c(1760) : allocated -> leak : t end scope : Memory leaked +B3B20F3988D18CC8CA5C28514719C705 + +#[D0731D514166A49C8FFB53F1F9FD92A2 : high : Memory Leak : controlflow ] +# +# sdk.c(1817) : Branch not taken: (response != NULL) +# sdk.c(1826) : Branch not taken: (g_mqtt_client != NULL) +# sdk.c(1831) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, outsz) != 0) +# sdk.c(1835) : start -> allocated : r = malloc(...) +# sdk.c(1835) : allocated -> allocated : r refers to dynamically allocated memory +# sdk.c(1836) : Branch not taken: (r != NULL) +# sdk.c(1864) : allocated -> allocated : r no longer refers to dynamically allocated memory +# sdk.c(1864) : allocated -> leak : r end scope : Memory leaked +D0731D514166A49C8FFB53F1F9FD92A2 # It is true response might not be a null-terminated string, as it is # read from user input. However, this same assumption is made in a few @@ -788,15 +746,15 @@ B0CE5CE3545B4A42DE7B936450EFBF70 # False positive. # s.name is transferred to stream when the function is succesful. # Otherwise, it is freed via free_stream. -# [7DD7E3EDFC6A656A6A38B155B81127FB : high : Memory Leak : controlflow ] +# [0A6344F4769EBC172A111620056A0739 : high : Memory Leak : controlflow ] # -# libevp-agent/manifest.c(597) : start -> allocated : s.name = strdup(...) -# libevp-agent/manifest.c(597) : allocated -> allocated : s.name refers to dynamically allocated memory -# libevp-agent/manifest.c(599) : Branch not taken: (s.name != NULL) -# libevp-agent/manifest.c(607) : goto -# libevp-agent/manifest.c(644) : allocated -> allocated : s.name no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(644) : allocated -> leak : s end scope : Memory leaked -7DD7E3EDFC6A656A6A38B155B81127FB +# manifest.c(465) : start -> allocated : s.name = strdup(...) +# manifest.c(465) : allocated -> allocated : s.name refers to dynamically allocated memory +# manifest.c(467) : Branch not taken: (s.name != NULL) +# manifest.c(475) : goto +# manifest.c(507) : allocated -> allocated : s.name no longer refers to dynamically allocated memory +# manifest.c(507) : allocated -> leak : s end scope : Memory leaked +0A6344F4769EBC172A111620056A0739 # False positive. # namedup is transferred to a compound literal, which is then @@ -826,22 +784,6 @@ B0CE5CE3545B4A42DE7B936450EFBF70 # libevp-agent/stream/stream.c(543) : allocated -> leak : namedup end scope : Memory leaked E5BAF7C295BEB651FD2DBB5177CAC5CF -# False positive. Similar to E5BAF7C295BEB651FD2DBB5177CAC5CF. -# [26FAD77FB5A912E51915B0447E01950B : high : Memory Leak : controlflow ] -# -# libevp-agent/stream/stream.c(476) : Branch not taken: (namedup != NULL) -# libevp-agent/stream/stream.c(486) : Branch taken: (src->type == 1) -# libevp-agent/stream/stream.c(486) : goto -# libevp-agent/stream/stream.c(490) : start -> allocated : connectiondup = strdup(...) -# libevp-agent/stream/stream.c(490) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(491) : Branch not taken: (connectiondup != NULL) -# libevp-agent/stream/stream.c(498) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(503) : allocated -> allocated : connectiondup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(538) : Branch not taken: (ret == 0) -# libevp-agent/stream/stream.c(543) : allocated -> allocated : connectiondup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(543) : allocated -> leak : connectiondup end scope : Memory leaked -26FAD77FB5A912E51915B0447E01950B - # False positive. # list is transferred to *dst if successful. Otherwise, it is free(3)d. # [124499A2BD2494F9F09B48FD37DABF50 : high : Memory Leak : controlflow ] @@ -886,16 +828,16 @@ EC095B6EAD3150351E9E6E34CE065126 # False positive. # Fortify fails to see sem is a semaphore that would block until # the event is handled (and free(3)d) by the module instance thread. -# [8BA0A1D5D111E79758AE1C485172AF1F : high : Memory Leak : controlflow ] +#[16C3E81F20D2E967B9D97592D8968F69 : high : Memory Leak : controlflow ] # -# sdk.c(1119) : Branch not taken: (sem_init((&sem), 0, 0) == 0) -# sdk.c(1126) : Branch taken: (h->exiting == 0) -# sdk.c(1127) : start -> allocated : event = malloc(...) -# sdk.c(1127) : allocated -> allocated : event refers to dynamically allocated memory -# sdk.c(1129) : Branch not taken: (event != NULL) -# sdk.c(1153) : allocated -> allocated : event no longer refers to dynamically allocated memory -# sdk.c(1153) : allocated -> leak : event end scope : Memory leaked -8BA0A1D5D111E79758AE1C485172AF1F +# sdk.c(1099) : Branch not taken: (sem_init((&sem), 0, 0) == 0) +# sdk.c(1106) : Branch taken: (h->exiting == 0) +# sdk.c(1107) : start -> allocated : event = malloc(...) +# sdk.c(1107) : allocated -> allocated : event refers to dynamically allocated memory +# sdk.c(1109) : Branch not taken: (event != NULL) +# sdk.c(1133) : allocated -> allocated : event no longer refers to dynamically allocated memory +# sdk.c(1133) : allocated -> leak : event end scope : Memory leaked +16C3E81F20D2E967B9D97592D8968F69 # IMPORTANT NOTE: This is an actual memory leak (!) # For implementations using sdk_local_wasm.c, response_copy is never freed. @@ -1033,53 +975,34 @@ D5DDC692344473E0E239F218E33EF21D # - process_send_rpc_response (buf -> rawbuf) # - EVP_impl_sendRpcResponse assigns it to event # - The event is enqueued in the events queue (idem as above) -# [7B535B7E1D5134638028FCA6838736C8 : high : Memory Leak : controlflow ] -# -# libevp-agent/sdkrpc/server.c(56) : Branch not taken: (ssz != -1) -# libevp-agent/sdkrpc/server.c(59) : Branch not taken: (ssz >= 16) -# libevp-agent/sdkrpc/server.c(63) : Branch not taken: (hdr.zero == 0) -# libevp-agent/sdkrpc/server.c(69) : Branch not taken: (sz != 0) -# libevp-agent/sdkrpc/server.c(74) : Branch not taken: (sz <= 131072) -# libevp-agent/sdkrpc/server.c(84) : start -> allocated : buf = xcalloc_internal(...) -# libevp-agent/util.c(194) : start -> allocated : vp = calloc(...) -# libevp-agent/util.c(194) : allocated -> allocated : vp refers to dynamically allocated memory -# libevp-agent/util.c(195) : Branch not taken: (vp != NULL) -# libevp-agent/util.c(198) : allocated -> allocated : return -# libevp-agent/sdkrpc/server.c(84) : allocated -> allocated : buf refers to dynamically allocated memory -# libevp-agent/sdkrpc/server.c(86) : Branch not taken: (ssz != -1) -# libevp-agent/sdkrpc/server.c(89) : Branch not taken: (ssz >= sz) -# libevp-agent/sdkrpc/server.c(96) : allocated -> allocated : sdk_process_request(buf, ?, ?, ?) -# libevp-agent/sdk_remote.c(916) : allocated -> allocated : buf refers to dynamically allocated memory -# libevp-agent/sdk_remote.c(920) : Branch not taken: (ret == 0) -# libevp-agent/sdk_remote.c(929) : Branch taken: (h != NULL) -# libevp-agent/sdk_remote.c(931) : Branch taken: (req != NULL) -# libevp-agent/sdk_remote.c(941) : goto -# libevp-agent/sdk_remote.c(967) : Branch taken: (fn != NULL) -# libevp-agent/sdk_remote.c(970) : Branch not taken: (error == 0) -# libevp-agent/sdk_remote.c(975) : Branch taken: (resp->buf != NULL) -# libevp-agent/sdk_remote.c(977) : Branch taken: (resp->buflen > 0) -# libevp-agent/sdkrpc/server.c(97) : allocated -> allocated : buf no longer refers to dynamically allocated memory -# libevp-agent/sdkrpc/server.c(97) : allocated -> leak : buf end scope : Memory leaked -7B535B7E1D5134638028FCA6838736C8 - -# A false positive. -# The allocated object is attached to another object. -# [EFB49A2723D07EE736C615C0F79F438E : high : Memory Leak : controlflow ] -# -# sdk.c(1010) : Branch not taken: (iret == 0) -# sdk.c(1017) : Branch not taken: (v != NULL) -# sdk.c(1022) : Branch not taken: (o != NULL) -# sdk.c(1026) : Branch not taken: (json_object_set_string(o, name, base64) == 0) -# sdk.c(1033) : Branch not taken: (g_mqtt_client != NULL) -# sdk.c(1039) : Branch not taken: (xmqtt_request_fits(g_mqtt_client, len) != 0) -# sdk.c(1050) : start -> allocated : state = malloc(...) -# sdk.c(1050) : allocated -> allocated : state refers to dynamically allocated memory -# sdk.c(1051) : Branch not taken: (state != NULL) -# sdk.c(1071) : Branch not taken: (oevent == NULL) -# sdk.c(1102) : Branch not taken: (ret == 0) -# sdk.c(1105) : allocated -> allocated : state no longer refers to dynamically allocated memory -# sdk.c(1105) : allocated -> leak : state end scope : Memory leaked -EFB49A2723D07EE736C615C0F79F438E +# [9AD20D74459F476EC44B35052092111A : high : Memory Leak : controlflow ] +# +# sdkrpc/server.c(51) : Branch not taken: (ssz >= 0) +# sdkrpc/server.c(54) : Branch not taken: (ssz >= 16) +# sdkrpc/server.c(58) : Branch not taken: (hdr.zero == 0) +# sdkrpc/server.c(64) : Branch not taken: (sz != 0) +# sdkrpc/server.c(69) : Branch not taken: (sz <= 131072) +# sdkrpc/server.c(84) : start -> allocated : buf = xcalloc_internal(...) +# util.c(188) : start -> allocated : vp = calloc(...) +# util.c(188) : allocated -> allocated : vp refers to dynamically allocated memory +# util.c(189) : Branch not taken: (vp != NULL) +# util.c(192) : allocated -> allocated : return +# sdkrpc/server.c(84) : allocated -> allocated : buf refers to dynamically allocated memory +# sdkrpc/server.c(86) : Branch not taken: (ssz >= 0) +# sdkrpc/server.c(89) : Branch not taken: (ssz >= sz) +# sdkrpc/server.c(96) : allocated -> allocated : sdk_process_request(buf, ?, ?, ?) +# sdk_remote.c(899) : allocated -> allocated : buf refers to dynamically allocated memory +# sdk_remote.c(903) : Branch not taken: (ret == 0) +# sdk_remote.c(912) : Branch taken: (h != NULL) +# sdk_remote.c(914) : Branch taken: (req != NULL) +# sdk_remote.c(924) : goto +# sdk_remote.c(950) : Branch taken: (fn != NULL) +# sdk_remote.c(953) : Branch not taken: (error == 0) +# sdk_remote.c(958) : Branch taken: (resp->buf != NULL) +# sdk_remote.c(960) : Branch taken: (resp->buflen > 0) +# sdkrpc/server.c(97) : allocated -> allocated : buf no longer refers to dynamically allocated memory +# sdkrpc/server.c(97) : allocated -> leak : buf end scope : Memory leaked +9AD20D74459F476EC44B35052092111A # False positive. # Yet again, Fortify fails to see the ownership for eventdup is transferred @@ -1445,217 +1368,223 @@ C1AF649FEDEB4229BFC18C509C83E800 # False positive. # Fortify fails to see that, in case of failure, instance.entryPoint # is free(3)d by free_module_instance_spec. -# [A9783E58C961156441ACFD57F3739B4D : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(883) : start -> allocated : instance.entryPoint = strdup(...) -# libevp-agent/manifest.c(883) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch taken: (ret != 0) -# libevp-agent/manifest.c(896) : goto -# libevp-agent/manifest.c(938) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(938) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(883) : start -> allocated : instance.entryPoint = strdup(...) -# libevp-agent/manifest.c(883) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(901) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(909) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(917) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(929) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(934) : allocated -> allocated : return -# libevp-agent/manifest.c(934) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(934) : allocated -> leak : instance end scope : Memory leaked -A9783E58C961156441ACFD57F3739B4D - -# False positive. Similar to A9783E58C961156441ACFD57F3739B4D. -# [02417191CBB22D04481F86C433D27E69 : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(901) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(907) : start -> allocated : instance.name = strdup(...) -# libevp-agent/manifest.c(907) : allocated -> allocated : instance.name refers to dynamically allocated memory -# libevp-agent/manifest.c(909) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(917) : Branch taken: (instance.moduleId == NULL) -# libevp-agent/manifest.c(920) : goto -# libevp-agent/manifest.c(938) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(938) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(901) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(907) : start -> allocated : instance.name = strdup(...) -# libevp-agent/manifest.c(907) : allocated -> allocated : instance.name refers to dynamically allocated memory -# libevp-agent/manifest.c(909) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(917) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(929) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(934) : allocated -> allocated : return -# libevp-agent/manifest.c(934) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(934) : allocated -> leak : instance end scope : Memory leaked -02417191CBB22D04481F86C433D27E69 - -# False positive. Similar to A9783E58C961156441ACFD57F3739B4D. -# [345E5BE7C1620FD439159C04DC190011 : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(901) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(909) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(915) : start -> allocated : instance.moduleId = strdup(...) -# libevp-agent/manifest.c(915) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory -# libevp-agent/manifest.c(917) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(929) : Branch taken: (ret != 0) -# libevp-agent/manifest.c(930) : goto -# libevp-agent/manifest.c(938) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(938) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(862) : Branch not taken: (v != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(870) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(871) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(878) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(885) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(893) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(901) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(909) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(915) : start -> allocated : instance.moduleId = strdup(...) -# libevp-agent/manifest.c(915) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory -# libevp-agent/manifest.c(917) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(929) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(934) : allocated -> allocated : return -# libevp-agent/manifest.c(934) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(934) : allocated -> leak : instance end scope : Memory leaked -345E5BE7C1620FD439159C04DC190011 - -# False positive. Similar to A9783E58C961156441ACFD57F3739B4D. -# [0AE3683072C00C18D5DBCD59A9D9911F : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1066) : start -> allocated : instance.entryPoint = strdup(...) -# libevp-agent/manifest.c(1066) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch taken: (ret != 0) -# libevp-agent/manifest.c(1079) : goto -# libevp-agent/manifest.c(1132) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1132) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1066) : start -> allocated : instance.entryPoint = strdup(...) -# libevp-agent/manifest.c(1066) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1084) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1092) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(1100) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(1117) : Branch not taken: (streams == NULL) -# libevp-agent/manifest.c(1128) : allocated -> allocated : return -# libevp-agent/manifest.c(1128) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1128) : allocated -> leak : instance end scope : Memory leaked -0AE3683072C00C18D5DBCD59A9D9911F - -# False positive. Similar to A9783E58C961156441ACFD57F3739B4D. -# [9762EE270A23868FD534DA82DD8C7AEB : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1084) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1090) : start -> allocated : instance.name = strdup(...) -# libevp-agent/manifest.c(1090) : allocated -> allocated : instance.name refers to dynamically allocated memory -# libevp-agent/manifest.c(1092) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(1100) : Branch taken: (instance.moduleId == NULL) -# libevp-agent/manifest.c(1103) : goto -# libevp-agent/manifest.c(1132) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1132) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1084) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1090) : start -> allocated : instance.name = strdup(...) -# libevp-agent/manifest.c(1090) : allocated -> allocated : instance.name refers to dynamically allocated memory -# libevp-agent/manifest.c(1092) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(1100) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(1117) : Branch not taken: (streams == NULL) -# libevp-agent/manifest.c(1128) : allocated -> allocated : return -# libevp-agent/manifest.c(1128) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1128) : allocated -> leak : instance end scope : Memory leaked -9762EE270A23868FD534DA82DD8C7AEB - -# False positive. Similar to A9783E58C961156441ACFD57F3739B4D. -# [B32C402AEF8096D587CBE9E630A4BFD0 : high : Memory Leak : controlflow ] -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1084) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1092) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(1098) : start -> allocated : instance.moduleId = strdup(...) -# libevp-agent/manifest.c(1098) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory -# libevp-agent/manifest.c(1100) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(1117) : Branch not taken: (streams == NULL) -# libevp-agent/manifest.c(1128) : allocated -> allocated : return -# libevp-agent/manifest.c(1128) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1128) : allocated -> leak : instance end scope : Memory leaked -# -# libevp-agent/manifest.c(1053) : Branch not taken: (o != NULL) -# libevp-agent/manifest.c(1053) : Branch not taken: (moduleId != NULL) -# libevp-agent/manifest.c(1054) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) -# libevp-agent/manifest.c(1061) : Branch not taken: (entryPoint != NULL) -# libevp-agent/manifest.c(1068) : Branch not taken: (instance.entryPoint != NULL) -# libevp-agent/manifest.c(1076) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1084) : Branch not taken: (ret == 0) -# libevp-agent/manifest.c(1092) : Branch not taken: (instance.name != NULL) -# libevp-agent/manifest.c(1098) : start -> allocated : instance.moduleId = strdup(...) -# libevp-agent/manifest.c(1098) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory -# libevp-agent/manifest.c(1100) : Branch not taken: (instance.moduleId != NULL) -# libevp-agent/manifest.c(1117) : Branch taken: (streams != NULL) -# libevp-agent/manifest.c(1119) : Branch taken: (ret != 0) -# libevp-agent/manifest.c(1121) : goto -# libevp-agent/manifest.c(1132) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory -# libevp-agent/manifest.c(1132) : allocated -> leak : instance end scope : Memory leaked -B32C402AEF8096D587CBE9E630A4BFD0 +# [F99AECBB87090FBF69CAE4BB005C57E2 : high : Memory Leak : controlflow ] +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(746) : start -> allocated : instance.entryPoint = strdup(...) +# manifest.c(746) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch taken: (ret != 0) +# manifest.c(759) : goto +# manifest.c(801) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory +# manifest.c(801) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(746) : start -> allocated : instance.entryPoint = strdup(...) +# manifest.c(746) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch not taken: (ret == 0) +# manifest.c(764) : Branch not taken: (ret == 0) +# manifest.c(772) : Branch not taken: (instance.name != NULL) +# manifest.c(780) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(792) : Branch not taken: (ret == 0) +# manifest.c(797) : allocated -> allocated : return +# manifest.c(797) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory +# manifest.c(797) : allocated -> leak : instance end scope : Memory leaked +F99AECBB87090FBF69CAE4BB005C57E2 + +# False positive. Similar to F99AECBB87090FBF69CAE4BB005C57E2. +# [79ED26DD8F3723080A20179B526D8E78 : high : Memory Leak : controlflow ] +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch not taken: (ret == 0) +# manifest.c(764) : Branch not taken: (ret == 0) +# manifest.c(770) : start -> allocated : instance.name = strdup(...) +# manifest.c(770) : allocated -> allocated : instance.name refers to dynamically allocated memory +# manifest.c(772) : Branch not taken: (instance.name != NULL) +# manifest.c(780) : Branch taken: (instance.moduleId == NULL) +# manifest.c(783) : goto +# manifest.c(801) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory +# manifest.c(801) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch not taken: (ret == 0) +# manifest.c(764) : Branch not taken: (ret == 0) +# manifest.c(770) : start -> allocated : instance.name = strdup(...) +# manifest.c(770) : allocated -> allocated : instance.name refers to dynamically allocated memory +# manifest.c(772) : Branch not taken: (instance.name != NULL) +# manifest.c(780) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(792) : Branch not taken: (ret == 0) +# manifest.c(797) : allocated -> allocated : return +# manifest.c(797) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory +# manifest.c(797) : allocated -> leak : instance end scope : Memory leaked +79ED26DD8F3723080A20179B526D8E78 + +# False positive. Similar to F99AECBB87090FBF69CAE4BB005C57E2. +# [556B4D067C64D486F428850F49F2AFF1 : high : Memory Leak : controlflow ] +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch not taken: (ret == 0) +# manifest.c(764) : Branch not taken: (ret == 0) +# manifest.c(772) : Branch not taken: (instance.name != NULL) +# manifest.c(778) : start -> allocated : instance.moduleId = strdup(...) +# manifest.c(778) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory +# manifest.c(780) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(792) : Branch taken: (ret != 0) +# manifest.c(793) : goto +# manifest.c(801) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory +# manifest.c(801) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(725) : Branch not taken: (v != NULL) +# manifest.c(733) : Branch not taken: (o != NULL) +# manifest.c(733) : Branch not taken: (moduleId != NULL) +# manifest.c(734) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(741) : Branch not taken: (entryPoint != NULL) +# manifest.c(748) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(756) : Branch not taken: (ret == 0) +# manifest.c(764) : Branch not taken: (ret == 0) +# manifest.c(772) : Branch not taken: (instance.name != NULL) +# manifest.c(778) : start -> allocated : instance.moduleId = strdup(...) +# manifest.c(778) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory +# manifest.c(780) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(792) : Branch not taken: (ret == 0) +# manifest.c(797) : allocated -> allocated : return +# manifest.c(797) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory +# manifest.c(797) : allocated -> leak : instance end scope : Memory leaked +556B4D067C64D486F428850F49F2AFF1 + +# False positive. Similar to F99AECBB87090FBF69CAE4BB005C57E2. +# [F6C075848518BB810DD22EA06389658F : high : Memory Leak : controlflow ] +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(936) : start -> allocated : instance.entryPoint = strdup(...) +# manifest.c(936) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch taken: (ret != 0) +# manifest.c(949) : goto +# manifest.c(1002) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory +# manifest.c(1002) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(936) : start -> allocated : instance.entryPoint = strdup(...) +# manifest.c(936) : allocated -> allocated : instance.entryPoint refers to dynamically allocated memory +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch not taken: (ret == 0) +# manifest.c(954) : Branch not taken: (ret == 0) +# manifest.c(962) : Branch not taken: (instance.name != NULL) +# manifest.c(970) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(987) : Branch not taken: (streams == NULL) +# manifest.c(998) : allocated -> allocated : return +# manifest.c(998) : allocated -> allocated : instance.entryPoint no longer refers to dynamically allocated memory +# manifest.c(998) : allocated -> leak : instance end scope : Memory leaked +F6C075848518BB810DD22EA06389658F + +# False positive. Similar to F99AECBB87090FBF69CAE4BB005C57E2. +# [00C342C2029E138DA2C4C403DD0136D4 : high : Memory Leak : controlflow ] +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch not taken: (ret == 0) +# manifest.c(954) : Branch not taken: (ret == 0) +# manifest.c(960) : start -> allocated : instance.name = strdup(...) +# manifest.c(960) : allocated -> allocated : instance.name refers to dynamically allocated memory +# manifest.c(962) : Branch not taken: (instance.name != NULL) +# manifest.c(970) : Branch taken: (instance.moduleId == NULL) +# manifest.c(973) : goto +# manifest.c(1002) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory +# manifest.c(1002) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch not taken: (ret == 0) +# manifest.c(954) : Branch not taken: (ret == 0) +# manifest.c(960) : start -> allocated : instance.name = strdup(...) +# manifest.c(960) : allocated -> allocated : instance.name refers to dynamically allocated memory +# manifest.c(962) : Branch not taken: (instance.name != NULL) +# manifest.c(970) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(987) : Branch not taken: (streams == NULL) +# manifest.c(998) : allocated -> allocated : return +# manifest.c(998) : allocated -> allocated : instance.name no longer refers to dynamically allocated memory +# manifest.c(998) : allocated -> leak : instance end scope : Memory leaked +00C342C2029E138DA2C4C403DD0136D4 + +# False positive. Similar to F99AECBB87090FBF69CAE4BB005C57E2. +# [1CE832BFD1FAEC22F58A5C5030F0E9C8 : high : Memory Leak : controlflow ] +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch not taken: (ret == 0) +# manifest.c(954) : Branch not taken: (ret == 0) +# manifest.c(962) : Branch not taken: (instance.name != NULL) +# manifest.c(968) : start -> allocated : instance.moduleId = strdup(...) +# manifest.c(968) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory +# manifest.c(970) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(987) : Branch not taken: (streams == NULL) +# manifest.c(998) : allocated -> allocated : return +# manifest.c(998) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory +# manifest.c(998) : allocated -> leak : instance end scope : Memory leaked +# +# manifest.c(916) : Branch not taken: (o != NULL) +# manifest.c(916) : Branch not taken: (moduleId != NULL) +# manifest.c(917) : Branch not taken: (strncmp(name, g_reserved_prefix, strlen(g_reserved_prefix)) != 0) +# manifest.c(924) : Branch not taken: (entryPoint != NULL) +# manifest.c(929) : Branch not taken: (strlen(entryPoint) != 0) +# manifest.c(938) : Branch not taken: (instance.entryPoint != NULL) +# manifest.c(946) : Branch not taken: (ret == 0) +# manifest.c(954) : Branch not taken: (ret == 0) +# manifest.c(962) : Branch not taken: (instance.name != NULL) +# manifest.c(968) : start -> allocated : instance.moduleId = strdup(...) +# manifest.c(968) : allocated -> allocated : instance.moduleId refers to dynamically allocated memory +# manifest.c(970) : Branch not taken: (instance.moduleId != NULL) +# manifest.c(987) : Branch taken: (streams != NULL) +# manifest.c(989) : Branch taken: (ret != 0) +# manifest.c(991) : goto +# manifest.c(1002) : allocated -> allocated : instance.moduleId no longer refers to dynamically allocated memory +# manifest.c(1002) : allocated -> leak : instance end scope : Memory leaked +1CE832BFD1FAEC22F58A5C5030F0E9C8 # False positive. # Yet again, Fortify fails to see the ownership for `topicdup` is transferred @@ -2748,52 +2677,50 @@ C382DF34B7262C9187069ABBC7FEEDCF # The string gets a final zero termination regardless, not counted in the # string length (in compliance with the FlatBuffers format)." -# [62B60C2E17194F11BC81E06AFE6A99F4 : high : String Termination Error : dataflow ] -# sdk.c(1076) : ->strcmp(1) -# sdk_remote.c(403) : ->EVP_impl_sendState(2) -# sdk_remote.c(397) : <=> (topic) -# sdkenc/sdk_reader.h(654) : return -# sdkenc/sdk_reader.h(654) : <=> (elem__tmp) -# sdk_remote.c(397) : <->EVP_SDK_StateInput_topic(0->return) -# sdk_remote.c(394) : <=> (state) -# sdkenc/sdk_reader.h(1104) : return -# sdkenc/sdk_reader.h(1104) : <=> (elem__tmp) -# sdk_remote.c(394) : <->EVP_SDK_Request_body(0->return) -# sdk_remote.c(982) : ->process_send_state(1) -# sdk_remote.c(939) : <=> (req) -# sdkenc/sdk_reader.h(1102) : return -# sdk_remote.c(939) : <->EVP_SDK_Request_as_root(0->return) -# sdkrpc/server.c(96) : ->sdk_process_request(0) -# sdkrpc/server.c(85) : <- readall(1) -# ioutil.c(22) : <- read(1) -# -# -# StateInput_topic is a Flatbuffer String. In sdkenc/sdk.fbs: +#[3397B3B424EF87DF712DEFD26B45C7AC : high : String Termination Error : dataflow ] +#sdk.c(1059) : ->strcmp(1) +# sdk_remote.c(403) : ->EVP_impl_sendState(2) +# sdk_remote.c(397) : <=> (topic) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(583) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(583) : <=> (elem__tmp) +# sdk_remote.c(397) : <->EVP_SDK_StateInput_topic(0->return) +# sdk_remote.c(394) : <=> (state) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : <=> (elem__tmp) +# sdk_remote.c(394) : <->EVP_SDK_Request_body(0->return) +# sdk_remote.c(952) : ->process_send_state(1) +# sdk_remote.c(909) : <=> (req) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1031) : return +# sdk_remote.c(909) : <->EVP_SDK_Request_as_root(0->return) +# sdkrpc/server.c(96) : ->sdk_process_request(0) +# sdkrpc/server.c(85) : <- readall(1) +# ioutil.c(22) : <- read(1) +# +## StateInput_topic is a Flatbuffer String. In sdkenc/sdk.fbs: # table StateInput { # topic:string (required); -62B60C2E17194F11BC81E06AFE6A99F4 +3397B3B424EF87DF712DEFD26B45C7AC # StateInput_topic is a Flatbuffer String. In sdkenc/sdk.fbs: -#[CBC0774DF49EAD8C2B5A11C4FACD6362 : high : Format String : dataflow ] -#libevp-agent/util.c(294) : ->vasprintf(1) -# libevp-agent/sdk.c(987) : ->xasprintf_internal(5) -# libevp-agent/sdk_remote.c(386) : ->EVP_impl_sendState(2) -# libevp-agent/sdk_remote.c(380) : <=> (topic) -# libevp-agent/sdkenc/sdk_reader.h(648) : return -# libevp-agent/sdkenc/sdk_reader.h(648) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(380) : <->EVP_SDK_StateInput_topic(0->return) -# libevp-agent/sdk_remote.c(377) : <=> (state) -# libevp-agent/sdkenc/sdk_reader.h(1098) : return -# libevp-agent/sdkenc/sdk_reader.h(1098) : <=> (elem__tmp) -# libevp-agent/sdk_remote.c(377) : <->EVP_SDK_Request_body(0->return) -# libevp-agent/sdk_remote.c(914) : ->process_send_state(1) -# libevp-agent/sdk_remote.c(871) : <=> (req) -# libevp-agent/sdkenc/sdk_reader.h(1096) : return -# libevp-agent/sdk_remote.c(871) : <->EVP_SDK_Request_as_root(0->return) -# libevp-agent/sdkrpc/server.c(116) : ->sdk_process_request(0) -# libevp-agent/sdkrpc/server.c(105) : <- readall(1) -# libevp-agent/ioutil.c(28) : <- read(1) -CBC0774DF49EAD8C2B5A11C4FACD6362 +#[263E550BDAD8048B7714327862E5FA4B : high : String Termination Error : dataflow ] +#sdk.c(1008) : ->snprintf(4) +# sdk_remote.c(403) : ->EVP_impl_sendState(2) +# sdk_remote.c(397) : <=> (topic) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(583) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(583) : <=> (elem__tmp) +# sdk_remote.c(397) : <->EVP_SDK_StateInput_topic(0->return) +# sdk_remote.c(394) : <=> (state) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : return +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1033) : <=> (elem__tmp) +# sdk_remote.c(394) : <->EVP_SDK_Request_body(0->return) +# sdk_remote.c(952) : ->process_send_state(1) +# sdk_remote.c(909) : <=> (req) +# /__w/wedge-agent/wedge-agent/include/sdkenc/sdk_reader.h(1031) : return +# sdk_remote.c(909) : <->EVP_SDK_Request_as_root(0->return) +# sdkrpc/server.c(96) : ->sdk_process_request(0) +# sdkrpc/server.c(85) : <- readall(1) +# ioutil.c(22) : <- read(1) +263E550BDAD8048B7714327862E5FA4B # Seemingly false-positive # The buffer is big enough to store any possible values of uint16_t @@ -3247,20 +3174,20 @@ BA0F36F9B53D08073B3E0230D7DE21EB # False positive. # Yet again, Fortify fails to see the ownership for hostnamedup is transferred # to params.posix when the function is succesful. -# [E420D9DB4AAAEC85F8B479ADC95EDBF9 : high : Memory Leak : controlflow ] -# -# libevp-agent/stream/stream.c(476) : Branch not taken: (namedup != NULL) -# libevp-agent/stream/stream.c(505) : Branch taken: (src->type == 2) -# libevp-agent/stream/stream.c(505) : goto -# libevp-agent/stream/stream.c(509) : start -> allocated : hostnamedup = strdup(...) -# libevp-agent/stream/stream.c(509) : allocated -> allocated : hostnamedup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(510) : Branch not taken: (hostnamedup != NULL) -# libevp-agent/stream/stream.c(519) : allocated -> allocated : hostnamedup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(523) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(538) : Branch not taken: (ret == 0) -# libevp-agent/stream/stream.c(543) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(543) : allocated -> leak : hostnamedup end scope : Memory leaked -E420D9DB4AAAEC85F8B479ADC95EDBF9 +# [74169ED2AA3FB0795C28912A9E687D77 : high : Memory Leak : controlflow ] +# +# stream/stream.c(477) : Branch not taken: (namedup != NULL) +# stream/stream.c(487) : Branch taken: (src->type == 1) +# stream/stream.c(487) : goto +# stream/stream.c(491) : start -> allocated : hostnamedup = strdup(...) +# stream/stream.c(491) : allocated -> allocated : hostnamedup refers to dynamically allocated memory +# stream/stream.c(492) : Branch not taken: (hostnamedup != NULL) +# stream/stream.c(501) : allocated -> allocated : hostnamedup refers to dynamically allocated memory +# stream/stream.c(505) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory +# stream/stream.c(520) : Branch not taken: (ret == 0) +# stream/stream.c(525) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory +# stream/stream.c(525) : allocated -> leak : hostnamedup end scope : Memory leaked +74169ED2AA3FB0795C28912A9E687D77 # Not an issue. # Even if the data type for sr->id is defined as EVP_STREAM_PEER_ID, @@ -3407,20 +3334,6 @@ B6EA5D109BFEAA89BA2B58FCEAF41E47 # libevp-agent/main_loop.c(105) : <- getenv(return) 2292946D6DF27B0D6C5BFEDE04EBB3DA -# False positive. -# According to the documentation for NNG_OPT_TCP_BOUND_PORT, on -# nng_tcp_options(5): -# -# While the value is of type `int`, it will be a legal TCP port number, that -# is a value between 1 and 65535, inclusive. -# -# Therefore, there is no risk when assigning it into an unsigned short. -# [1F8D42C32A560CD0B51D7CFB4F3D55A3 : high : Type Mismatch : Signed to Unsigned : structural ] -# stream/nng.c(168) -# FieldAccess: p.port [stream/nng.c(168)] -# VariableAccess: port [stream/nng.c(168)] -1F8D42C32A560CD0B51D7CFB4F3D55A3 - # False positive # Fortify fails to see the ownership for `req` is # transferred in the call to EVP_impl_blobOperation and blob is diff --git a/tools/fortify/filter-sdk.txt b/tools/fortify/filter-sdk.txt index 02b1d260..6ee618bc 100644 --- a/tools/fortify/filter-sdk.txt +++ b/tools/fortify/filter-sdk.txt @@ -113,21 +113,6 @@ F86380716072F498F0206FB2ADD37348 # libevp-agent/stream/stream.c(543) : allocated -> leak : namedup end scope : Memory leaked E5BAF7C295BEB651FD2DBB5177CAC5CF -# False positive. Similar to E5BAF7C295BEB651FD2DBB5177CAC5CF. -# [A7652CC7EE4E2C7FADB3C4DA860B7064 : high : Memory Leak : controlflow ] -# -# libevp-app-sdk/sdk.c(1025) : Branch not taken: (params != NULL) -# libevp-app-sdk/sdk.c(1033) : Branch not taken: (connection != NULL) -# libevp-app-sdk/sdk.c(1039) : start -> allocated : connectiondup = strdup(...) -# libevp-app-sdk/sdk.c(1039) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1040) : Branch not taken: (connectiondup != NULL) -# libevp-app-sdk/sdk.c(1047) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1055) : Branch not taken: (ret == 0) -# libevp-app-sdk/sdk.c(1058) : allocated -> allocated : connectiondup no longer refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1058) : allocated -> allocated : .connection no longer refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1058) : allocated -> leak : end scope : Memory leaked -A7652CC7EE4E2C7FADB3C4DA860B7064 - # False positive. Similar to E5BAF7C295BEB651FD2DBB5177CAC5CF. # [EC095B6EAD3150351E9E6E34CE065126 : high : Memory Leak : controlflow ] # @@ -139,37 +124,20 @@ A7652CC7EE4E2C7FADB3C4DA860B7064 # libevp-agent/stream/stream.c(361) : allocated -> leak : event end scope : Memory leaked EC095B6EAD3150351E9E6E34CE065126 -# False positive. Similar to E5BAF7C295BEB651FD2DBB5177CAC5CF. -# [26FAD77FB5A912E51915B0447E01950B : high : Memory Leak : controlflow ] -# -# libevp-agent/stream/stream.c(476) : Branch not taken: (namedup != NULL) -# libevp-agent/stream/stream.c(486) : Branch taken: (src->type == 1) -# libevp-agent/stream/stream.c(486) : goto -# libevp-agent/stream/stream.c(490) : start -> allocated : connectiondup = strdup(...) -# libevp-agent/stream/stream.c(490) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(491) : Branch not taken: (connectiondup != NULL) -# libevp-agent/stream/stream.c(498) : allocated -> allocated : connectiondup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(503) : allocated -> allocated : connectiondup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(538) : Branch not taken: (ret == 0) -# libevp-agent/stream/stream.c(543) : allocated -> allocated : connectiondup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(543) : allocated -> leak : connectiondup end scope : Memory leaked -26FAD77FB5A912E51915B0447E01950B - -#[021918F34229D07C933ED83A05B8936F : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(133) : Branch taken: (event_type == 1) -# evpmodulesdk/sdk.c(133) : goto -# evpmodulesdk/sdk.c(136) : start -> allocated : config = xmalloc(...) -# evpmodulesdk/sdk.c(136) : allocated -> allocated : config refers to dynamically allocated memory -# evpmodulesdk/sdk.c(147) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(150) : allocated -> allocated : config no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(150) : allocated -> leak : config end scope : Memory leaked +# [6BECED8E31EAFCD29B5E7BC15AAF1FDD : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(143) : Branch taken: (event_type == 1) +# libevp-app-sdk/sdk.c(143) : goto +# libevp-app-sdk/sdk.c(146) : start -> allocated : config = xmalloc(...) +# libevp-app-sdk/sdk.c(146) : allocated -> allocated : config refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(160) : allocated -> allocated : config no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(160) : allocated -> leak : config end scope : Memory leaked # # False positive: Fortify does not follow properly our code, when we use queues. # In get_event_done, we receive a Response in FlatBuffers format. @@ -186,158 +154,152 @@ EC095B6EAD3150351E9E6E34CE065126 # TAILQ_INSERT_TAIL(&h->events, &config->event, q); # It is the first element of the struct, so at the end is the same address. # -62BD6CC9A3041FA5D5C28253E85A2E8A - -# [665DA3BD2C75A9C1BE4FB49B452B9910 : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(151) : Branch taken: (event_type == 2) -# evpmodulesdk/sdk.c(151) : goto -# evpmodulesdk/sdk.c(154) : start -> allocated : state = xmalloc(...) -# evpmodulesdk/sdk.c(154) : allocated -> allocated : state refers to dynamically allocated memory -# evpmodulesdk/sdk.c(163) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(166) : allocated -> allocated : state no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(166) : allocated -> leak : state end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -665DA3BD2C75A9C1BE4FB49B452B9910 - -# [B6AEA6E3137DDE6B46E8F66139B21D05 : high : Memory Leak : controlflow ] -# -# libevp-app-sdk/sdk.c(109) : Branch taken: (req != NULL) -# libevp-app-sdk/sdk.c(111) : Branch taken: (req->resp != NULL) -# libevp-app-sdk/sdk.c(115) : Branch taken: (h != NULL) -# libevp-app-sdk/sdk.c(119) : Branch not taken: (ret == 0) -# libevp-app-sdk/sdk.c(131) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# libevp-app-sdk/sdk.c(138) : Branch not taken: (event_type != 3) -# libevp-app-sdk/sdk.c(182) : Branch taken: (event_type == 4) -# libevp-app-sdk/sdk.c(182) : goto -# libevp-app-sdk/sdk.c(185) : start -> allocated : blob = xmalloc(...) -# libevp-app-sdk/sdk.c(185) : allocated -> allocated : blob refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(197) : goto -# libevp-app-sdk/sdk.c(265) : allocated -> allocated : blob no longer refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(265) : allocated -> leak : blob end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -B6AEA6E3137DDE6B46E8F66139B21D05 - -# [3C7581FDD281BA4B93BF86B6A0673FCE : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(251) : Branch taken: (event_type == 7) -# evpmodulesdk/sdk.c(251) : goto -# evpmodulesdk/sdk.c(255) : start -> allocated : t = xmalloc(...) -# evpmodulesdk/sdk.c(255) : allocated -> allocated : t refers to dynamically allocated memory -# evpmodulesdk/sdk.c(264) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(266) : allocated -> allocated : t no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(266) : allocated -> leak : t end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -3C7581FDD281BA4B93BF86B6A0673FCE - -# [65AD68D88420428179DA394BC062053A : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(267) : Branch taken: (event_type == 6) -# evpmodulesdk/sdk.c(267) : goto -# evpmodulesdk/sdk.c(271) : start -> allocated : m = xmalloc(...) -# evpmodulesdk/sdk.c(271) : allocated -> allocated : m refers to dynamically allocated memory -# evpmodulesdk/sdk.c(282) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(284) : allocated -> allocated : m no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(284) : allocated -> leak : m end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -65AD68D88420428179DA394BC062053A - -# [223D718847FF6F14A459589470D14108 : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(285) : Branch taken: (event_type == 5) -# evpmodulesdk/sdk.c(285) : goto -# evpmodulesdk/sdk.c(289) : start -> allocated : m = xmalloc(...) -# evpmodulesdk/sdk.c(289) : allocated -> allocated : m refers to dynamically allocated memory -# evpmodulesdk/sdk.c(298) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(300) : allocated -> allocated : m no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(300) : allocated -> leak : m end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -223D718847FF6F14A459589470D14108 - -# [7EE760949B13347BC41DB50D41BFE153 : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(301) : Branch taken: (event_type == 8) -# evpmodulesdk/sdk.c(301) : goto -# evpmodulesdk/sdk.c(304) : start -> allocated : r = xmalloc(...) -# evpmodulesdk/sdk.c(304) : allocated -> allocated : r refers to dynamically allocated memory -# evpmodulesdk/sdk.c(312) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(314) : allocated -> allocated : r no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(314) : allocated -> leak : r end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -7EE760949B13347BC41DB50D41BFE153 - -# [1B5DC44A2958BF7578A974B7D1F9CBF8 : high : Memory Leak : controlflow ] -# -# evpmodulesdk/sdk.c(94) : Branch taken: (req != NULL) -# evpmodulesdk/sdk.c(96) : Branch taken: (req->resp != NULL) -# evpmodulesdk/sdk.c(100) : Branch taken: (h != NULL) -# evpmodulesdk/sdk.c(104) : Branch not taken: (ret == 0) -# evpmodulesdk/sdk.c(116) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) -# evpmodulesdk/sdk.c(123) : Branch not taken: (event_type != 3) -# evpmodulesdk/sdk.c(315) : Branch taken: (event_type == 9) -# evpmodulesdk/sdk.c(315) : goto -# evpmodulesdk/sdk.c(319) : start -> allocated : r = xmalloc(...) -# evpmodulesdk/sdk.c(319) : allocated -> allocated : r refers to dynamically allocated memory -# evpmodulesdk/sdk.c(328) : Branch not taken: (*h->events.tqh_last == NULL) -# evpmodulesdk/sdk.c(330) : allocated -> allocated : r no longer refers to dynamically allocated memory -# evpmodulesdk/sdk.c(330) : allocated -> leak : r end scope : Memory leaked -# -# Same justification than in: 62BD6CC9A3041FA5D5C28253E85A2E8A -1B5DC44A2958BF7578A974B7D1F9CBF8 +6BECED8E31EAFCD29B5E7BC15AAF1FDD + +# [31573DA6474BF1CCBA709A528D24DBCC : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(161) : Branch taken: (event_type == 2) +# libevp-app-sdk/sdk.c(161) : goto +# libevp-app-sdk/sdk.c(164) : start -> allocated : state = xmalloc(...) +# libevp-app-sdk/sdk.c(164) : allocated -> allocated : state refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(176) : allocated -> allocated : state no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(176) : allocated -> leak : state end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +31573DA6474BF1CCBA709A528D24DBCC + +# [1CA522911595C8BABF32803DCDBE2A96 : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(177) : Branch taken: (event_type == 4) +# libevp-app-sdk/sdk.c(177) : goto +# libevp-app-sdk/sdk.c(180) : start -> allocated : blob = xmalloc(...) +# libevp-app-sdk/sdk.c(180) : allocated -> allocated : blob refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(192) : goto +# libevp-app-sdk/sdk.c(260) : allocated -> allocated : blob no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(260) : allocated -> leak : blob end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +1CA522911595C8BABF32803DCDBE2A96 + +# [FE42DC481FA854957010E17498F565ED : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(261) : Branch taken: (event_type == 7) +# libevp-app-sdk/sdk.c(261) : goto +# libevp-app-sdk/sdk.c(265) : start -> allocated : t = xmalloc(...) +# libevp-app-sdk/sdk.c(265) : allocated -> allocated : t refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(276) : allocated -> allocated : t no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(276) : allocated -> leak : t end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +FE42DC481FA854957010E17498F565ED + +# [46E0976A4B4294C72B70D1F52BC94A1A : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(277) : Branch taken: (event_type == 6) +# libevp-app-sdk/sdk.c(277) : goto +# libevp-app-sdk/sdk.c(281) : start -> allocated : m = xmalloc(...) +# libevp-app-sdk/sdk.c(281) : allocated -> allocated : m refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(294) : allocated -> allocated : m no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(294) : allocated -> leak : m end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +46E0976A4B4294C72B70D1F52BC94A1A + +# [1D8790E2DFD741E844E1E1CD77D99B85 : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(295) : Branch taken: (event_type == 5) +# libevp-app-sdk/sdk.c(295) : goto +# libevp-app-sdk/sdk.c(299) : start -> allocated : m = xmalloc(...) +# libevp-app-sdk/sdk.c(299) : allocated -> allocated : m refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(310) : allocated -> allocated : m no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(310) : allocated -> leak : m end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +1D8790E2DFD741E844E1E1CD77D99B85 + +# [6B80B9BB335AA182BA410E34B0044CBF : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(311) : Branch taken: (event_type == 8) +# libevp-app-sdk/sdk.c(311) : goto +# libevp-app-sdk/sdk.c(314) : start -> allocated : r = xmalloc(...) +# libevp-app-sdk/sdk.c(314) : allocated -> allocated : r refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(324) : allocated -> allocated : r no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(324) : allocated -> leak : r end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +6B80B9BB335AA182BA410E34B0044CBF + +# [1C8B3D7F573A6BCF4E57146791121F5D : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(104) : Branch taken: (req != NULL) +# libevp-app-sdk/sdk.c(106) : Branch taken: (req->resp != NULL) +# libevp-app-sdk/sdk.c(110) : Branch taken: (h != NULL) +# libevp-app-sdk/sdk.c(114) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(126) : Branch taken: (EVP_SDK_Response_body_type(resp) == 1) +# libevp-app-sdk/sdk.c(133) : Branch not taken: (event_type != 3) +# libevp-app-sdk/sdk.c(325) : Branch taken: (event_type == 9) +# libevp-app-sdk/sdk.c(325) : goto +# libevp-app-sdk/sdk.c(329) : start -> allocated : r = xmalloc(...) +# libevp-app-sdk/sdk.c(329) : allocated -> allocated : r refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(340) : allocated -> allocated : r no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(340) : allocated -> leak : r end scope : Memory leaked +# +# Same justification than in: 6BECED8E31EAFCD29B5E7BC15AAF1FDD +1C8B3D7F573A6BCF4E57146791121F5D # False positive. # Yet again, Fortify fails to see the struct Stream compound literal is # transferred to "s", which is then transferred to "stream", so no objects # are being leaked. -# [ED473AC9E862F8946CD298692F6C47B7 : high : Memory Leak : controlflow ] -# -# libevp-app-sdk/sdk.c(1068) : Branch not taken: (error == 0) -# libevp-app-sdk/sdk.c(1076) : Branch not taken: (resp != NULL) -# libevp-app-sdk/sdk.c(1083) : Branch not taken: (type == 3) -# libevp-app-sdk/sdk.c(1091) : Branch not taken: (body != NULL) -# libevp-app-sdk/sdk.c(1099) : Branch not taken: (ret == 0) -# libevp-app-sdk/sdk.c(1103) : start -> allocated : .name = strdup(...) -# libevp-app-sdk/sdk.c(1103) : allocated -> allocated : .name refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1112) : goto -# libevp-app-sdk/sdk.c(1138) : allocated -> allocated : .name no longer refers to dynamically allocated memory -# libevp-app-sdk/sdk.c(1138) : allocated -> leak : end scope : Memory leaked -ED473AC9E862F8946CD298692F6C47B7 +# [6D9CD92CF4AE13E28081815C47C5B94A : high : Memory Leak : controlflow ] +# +# libevp-app-sdk/sdk.c(1022) : Branch not taken: (error == 0) +# libevp-app-sdk/sdk.c(1030) : Branch not taken: (resp != NULL) +# libevp-app-sdk/sdk.c(1037) : Branch not taken: (type == 3) +# libevp-app-sdk/sdk.c(1045) : Branch not taken: (body != NULL) +# libevp-app-sdk/sdk.c(1053) : Branch not taken: (ret == 0) +# libevp-app-sdk/sdk.c(1057) : start -> allocated : .name = strdup(...) +# libevp-app-sdk/sdk.c(1057) : allocated -> allocated : .name refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(1066) : goto +# libevp-app-sdk/sdk.c(1091) : allocated -> allocated : .name no longer refers to dynamically allocated memory +# libevp-app-sdk/sdk.c(1091) : allocated -> leak : end scope : Memory leaked +6D9CD92CF4AE13E28081815C47C5B94A # False positive. # Fortify fails to see the ownership for event is transferred to the @@ -355,79 +317,6 @@ ED473AC9E862F8946CD298692F6C47B7 # libevp-agent/stream/stream.c(361) : allocated -> leak : end scope : Memory leaked FAB645EE0389BCEEDFF7466521CF7A24 -# False positive. -# Yet again, Fortify fails to see the ownership for nng is transferred to -# si->params if successful, or freed otherwise. -# [1A885094842BD658D060434C33161244 : high : Memory Leak : controlflow ] -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(102) : Branch taken: (cfg->protocol == 1) -# stream/nng.c(102) : goto -# stream/nng.c(104) : Branch taken: (error != 0) -# stream/nng.c(107) : allocated -> allocated : return -# stream/nng.c(107) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(107) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(112) : Branch taken: (cfg->mode == 0) -# stream/nng.c(112) : goto -# stream/nng.c(115) : Branch taken: (error != 0) -# stream/nng.c(118) : allocated -> allocated : return -# stream/nng.c(118) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(118) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(128) : Branch taken: (cfg->mode == 1) -# stream/nng.c(128) : goto -# stream/nng.c(131) : Branch taken: (error != 0) -# stream/nng.c(134) : allocated -> allocated : return -# stream/nng.c(134) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(134) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(94) : Branch taken: (cfg->protocol == 0) -# stream/nng.c(94) : goto -# stream/nng.c(96) : Branch taken: (error != 0) -# stream/nng.c(99) : goto -# stream/nng.c(148) : Branch not taken: (ret == 0) -# stream/nng.c(154) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(154) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(112) : Branch taken: (cfg->mode == 0) -# stream/nng.c(112) : goto -# stream/nng.c(115) : Branch not taken: (error == 0) -# stream/nng.c(122) : Branch taken: (error != 0) -# stream/nng.c(125) : allocated -> allocated : return -# stream/nng.c(125) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(125) : allocated -> leak : nng end scope : Memory leaked -# -# stream/nng.c(81) : start -> allocated : nng = malloc(...) -# stream/nng.c(81) : allocated -> allocated : nng refers to dynamically allocated memory -# stream/nng.c(83) : Branch not taken: (nng != NULL) -# stream/nng.c(93) : Default case -# stream/nng.c(128) : Branch taken: (cfg->mode == 1) -# stream/nng.c(128) : goto -# stream/nng.c(131) : Branch not taken: (error == 0) -# stream/nng.c(138) : Branch taken: (error != 0) -# stream/nng.c(141) : allocated -> allocated : return -# stream/nng.c(141) : allocated -> allocated : nng no longer refers to dynamically allocated memory -# stream/nng.c(141) : allocated -> leak : nng end scope : Memory leaked -1A885094842BD658D060434C33161244 - # False positive. # Yet again, Fortify fails to see the ownership for si is transferred on the # call to stream_insert when successful, or freed otherwise. @@ -507,20 +396,20 @@ BA0F36F9B53D08073B3E0230D7DE21EB # False positive. # Yet again, Fortify fails to see the ownership for hostnamedup is transferred # to params.posix when the function is succesful. -# [E420D9DB4AAAEC85F8B479ADC95EDBF9 : high : Memory Leak : controlflow ] -# -# libevp-agent/stream/stream.c(476) : Branch not taken: (namedup != NULL) -# libevp-agent/stream/stream.c(505) : Branch taken: (src->type == 2) -# libevp-agent/stream/stream.c(505) : goto -# libevp-agent/stream/stream.c(509) : start -> allocated : hostnamedup = strdup(...) -# libevp-agent/stream/stream.c(509) : allocated -> allocated : hostnamedup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(510) : Branch not taken: (hostnamedup != NULL) -# libevp-agent/stream/stream.c(519) : allocated -> allocated : hostnamedup refers to dynamically allocated memory -# libevp-agent/stream/stream.c(523) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(538) : Branch not taken: (ret == 0) -# libevp-agent/stream/stream.c(543) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory -# libevp-agent/stream/stream.c(543) : allocated -> leak : hostnamedup end scope : Memory leaked -E420D9DB4AAAEC85F8B479ADC95EDBF9 +# [74169ED2AA3FB0795C28912A9E687D77 : high : Memory Leak : controlflow ] +# +# libevp-agent/stream/stream.c(477) : Branch not taken: (namedup != NULL) +# libevp-agent/stream/stream.c(487) : Branch taken: (src->type == 1) +# libevp-agent/stream/stream.c(487) : goto +# libevp-agent/stream/stream.c(491) : start -> allocated : hostnamedup = strdup(...) +# libevp-agent/stream/stream.c(491) : allocated -> allocated : hostnamedup refers to dynamically allocated memory +# libevp-agent/stream/stream.c(492) : Branch not taken: (hostnamedup != NULL) +# libevp-agent/stream/stream.c(501) : allocated -> allocated : hostnamedup refers to dynamically allocated memory +# libevp-agent/stream/stream.c(505) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory +# libevp-agent/stream/stream.c(520) : Branch not taken: (ret == 0) +# libevp-agent/stream/stream.c(525) : allocated -> allocated : hostnamedup no longer refers to dynamically allocated memory +# libevp-agent/stream/stream.c(525) : allocated -> leak : hostnamedup end scope : Memory leaked +74169ED2AA3FB0795C28912A9E687D77 # Not an issue. # Even if the data type for sr->id is defined as EVP_STREAM_PEER_ID, @@ -612,17 +501,3 @@ AB82561AD6FCF66BC65E7AFFCCBCC835 # notification.c(86) : allocated -> allocated : .event no longer refers to dynamically allocated memory # notification.c(86) : allocated -> leak : end scope : Memory leaked 94637FA846AF053377DDFE701AE8B068 - -# False positive. -# According to the documentation for NNG_OPT_TCP_BOUND_PORT, on -# nng_tcp_options(5): -# -# While the value is of type `int`, it will be a legal TCP port number, that -# is a value between 1 and 65535, inclusive. -# -# Therefore, there is no risk when assigning it into an unsigned short. -# [1F8D42C32A560CD0B51D7CFB4F3D55A3 : high : Type Mismatch : Signed to Unsigned : structural ] -# stream/nng.c(168) -# FieldAccess: p.port [stream/nng.c(168)] -# VariableAccess: port [stream/nng.c(168)] -1F8D42C32A560CD0B51D7CFB4F3D55A3 diff --git a/tools/fortify/rules.xml b/tools/fortify/rules.xml index fd7e9b3b..5fabe3bc 100644 --- a/tools/fortify/rules.xml +++ b/tools/fortify/rules.xml @@ -9,12 +9,12 @@ SPDX-License-Identifier: Apache-2.0 94923a24-0582-11ec-b8c0-573a9c68bf17 0000.0.0.0000 cpp diff --git a/version.mk b/version.mk index c96c3864..7942426b 100644 --- a/version.mk +++ b/version.mk @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -VERSION = 1.42.0 +VERSION = 1.43.0 COMMIT_HASH = $(shell git describe --always --abbrev=0 --dirty --match "NOT A TAG") define VERSION_BODY