| // WARNING: This file is machine generated by fidlgen. |
| |
| #pragma once |
| |
| #include <lib/fidl/internal.h> |
| #include <lib/fidl/txn_header.h> |
| #include <lib/fidl/llcpp/array.h> |
| #include <lib/fidl/llcpp/coding.h> |
| #include <lib/fidl/llcpp/connect_service.h> |
| #include <lib/fidl/llcpp/service_handler_interface.h> |
| #include <lib/fidl/llcpp/string_view.h> |
| #include <lib/fidl/llcpp/sync_call.h> |
| #include <lib/fidl/llcpp/traits.h> |
| #include <lib/fidl/llcpp/transaction.h> |
| #include <lib/fidl/llcpp/vector_view.h> |
| #include <lib/fit/function.h> |
| #include <lib/zx/channel.h> |
| #include <lib/zx/vmo.h> |
| #include <zircon/fidl.h> |
| |
| namespace llcpp { |
| |
| namespace fuchsia { |
| namespace tee { |
| |
| struct Uuid; |
| enum class ReturnOrigin : uint32_t { |
| COMMUNICATION = 0u, |
| TRUSTED_OS = 1u, |
| TRUSTED_APPLICATION = 2u, |
| }; |
| |
| |
| struct OsRevision; |
| struct OsInfo; |
| struct None; |
| enum class Direction : uint32_t { |
| INPUT = 0u, |
| OUTPUT = 1u, |
| INOUT = 2u, |
| }; |
| |
| |
| struct Value; |
| struct Buffer; |
| struct Parameter; |
| struct OpResult; |
| class Device; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_OsRevisionTable; |
| |
| struct OsRevision final : private ::fidl::VectorView<fidl_envelope_t> { |
| using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>; |
| public: |
| // Returns whether no field is set. |
| bool IsEmpty() const { return EnvelopesView::empty(); } |
| |
| const uint32_t& major() const { |
| ZX_ASSERT(has_major()); |
| return *reinterpret_cast<const uint32_t*>(EnvelopesView::at(1 - 1).data); |
| } |
| uint32_t& major() { |
| ZX_ASSERT(has_major()); |
| return *reinterpret_cast<uint32_t*>(EnvelopesView::at(1 - 1).data); |
| } |
| bool has_major() const { |
| return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr; |
| } |
| |
| const uint32_t& minor() const { |
| ZX_ASSERT(has_minor()); |
| return *reinterpret_cast<const uint32_t*>(EnvelopesView::at(2 - 1).data); |
| } |
| uint32_t& minor() { |
| ZX_ASSERT(has_minor()); |
| return *reinterpret_cast<uint32_t*>(EnvelopesView::at(2 - 1).data); |
| } |
| bool has_minor() const { |
| return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr; |
| } |
| |
| OsRevision() = default; |
| ~OsRevision() = default; |
| OsRevision(OsRevision&& other) noexcept = default; |
| OsRevision& operator=(OsRevision&& other) noexcept = default; |
| |
| class Builder; |
| friend class Builder; |
| static Builder Build(); |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_OsRevisionTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 48; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| OsRevision(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {} |
| }; |
| |
| class OsRevision::Builder { |
| public: |
| OsRevision view() { return OsRevision(max_ordinal_, envelopes_.data_); } |
| ~Builder() = default; |
| Builder(Builder&& other) noexcept = default; |
| Builder& operator=(Builder&& other) noexcept = default; |
| |
| Builder&& set_major(uint32_t* elem); |
| |
| Builder&& set_minor(uint32_t* elem); |
| |
| private: |
| Builder() = default; |
| friend Builder OsRevision::Build(); |
| |
| uint64_t max_ordinal_ = 0; |
| ::fidl::Array<fidl_envelope_t, 2> envelopes_ = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_OsInfoTable; |
| |
| struct OsInfo final : private ::fidl::VectorView<fidl_envelope_t> { |
| using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>; |
| public: |
| // Returns whether no field is set. |
| bool IsEmpty() const { return EnvelopesView::empty(); } |
| |
| const ::llcpp::fuchsia::tee::Uuid& uuid() const { |
| ZX_ASSERT(has_uuid()); |
| return *reinterpret_cast<const ::llcpp::fuchsia::tee::Uuid*>(EnvelopesView::at(1 - 1).data); |
| } |
| ::llcpp::fuchsia::tee::Uuid& uuid() { |
| ZX_ASSERT(has_uuid()); |
| return *reinterpret_cast<::llcpp::fuchsia::tee::Uuid*>(EnvelopesView::at(1 - 1).data); |
| } |
| bool has_uuid() const { |
| return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr; |
| } |
| |
| const ::llcpp::fuchsia::tee::OsRevision& revision() const { |
| ZX_ASSERT(has_revision()); |
| return *reinterpret_cast<const ::llcpp::fuchsia::tee::OsRevision*>(EnvelopesView::at(2 - 1).data); |
| } |
| ::llcpp::fuchsia::tee::OsRevision& revision() { |
| ZX_ASSERT(has_revision()); |
| return *reinterpret_cast<::llcpp::fuchsia::tee::OsRevision*>(EnvelopesView::at(2 - 1).data); |
| } |
| bool has_revision() const { |
| return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr; |
| } |
| |
| const bool& is_global_platform_compliant() const { |
| ZX_ASSERT(has_is_global_platform_compliant()); |
| return *reinterpret_cast<const bool*>(EnvelopesView::at(3 - 1).data); |
| } |
| bool& is_global_platform_compliant() { |
| ZX_ASSERT(has_is_global_platform_compliant()); |
| return *reinterpret_cast<bool*>(EnvelopesView::at(3 - 1).data); |
| } |
| bool has_is_global_platform_compliant() const { |
| return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr; |
| } |
| |
| OsInfo() = default; |
| ~OsInfo() = default; |
| OsInfo(OsInfo&& other) noexcept = default; |
| OsInfo& operator=(OsInfo&& other) noexcept = default; |
| |
| class Builder; |
| friend class Builder; |
| static Builder Build(); |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_OsInfoTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 136; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| OsInfo(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {} |
| }; |
| |
| class OsInfo::Builder { |
| public: |
| OsInfo view() { return OsInfo(max_ordinal_, envelopes_.data_); } |
| ~Builder() = default; |
| Builder(Builder&& other) noexcept = default; |
| Builder& operator=(Builder&& other) noexcept = default; |
| |
| Builder&& set_uuid(::llcpp::fuchsia::tee::Uuid* elem); |
| |
| Builder&& set_revision(::llcpp::fuchsia::tee::OsRevision* elem); |
| |
| Builder&& set_is_global_platform_compliant(bool* elem); |
| |
| private: |
| Builder() = default; |
| friend Builder OsInfo::Build(); |
| |
| uint64_t max_ordinal_ = 0; |
| ::fidl::Array<fidl_envelope_t, 3> envelopes_ = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_ValueTable; |
| |
| // Represents a direct value parameter. |
| struct Value final : private ::fidl::VectorView<fidl_envelope_t> { |
| using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>; |
| public: |
| // Returns whether no field is set. |
| bool IsEmpty() const { return EnvelopesView::empty(); } |
| |
| const ::llcpp::fuchsia::tee::Direction& direction() const { |
| ZX_ASSERT(has_direction()); |
| return *reinterpret_cast<const ::llcpp::fuchsia::tee::Direction*>(EnvelopesView::at(1 - 1).data); |
| } |
| ::llcpp::fuchsia::tee::Direction& direction() { |
| ZX_ASSERT(has_direction()); |
| return *reinterpret_cast<::llcpp::fuchsia::tee::Direction*>(EnvelopesView::at(1 - 1).data); |
| } |
| bool has_direction() const { |
| return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr; |
| } |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| const uint64_t& a() const { |
| ZX_ASSERT(has_a()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(2 - 1).data); |
| } |
| uint64_t& a() { |
| ZX_ASSERT(has_a()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(2 - 1).data); |
| } |
| bool has_a() const { |
| return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr; |
| } |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| const uint64_t& b() const { |
| ZX_ASSERT(has_b()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(3 - 1).data); |
| } |
| uint64_t& b() { |
| ZX_ASSERT(has_b()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(3 - 1).data); |
| } |
| bool has_b() const { |
| return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr; |
| } |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| const uint64_t& c() const { |
| ZX_ASSERT(has_c()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(4 - 1).data); |
| } |
| uint64_t& c() { |
| ZX_ASSERT(has_c()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(4 - 1).data); |
| } |
| bool has_c() const { |
| return EnvelopesView::count() >= 4 && EnvelopesView::at(4 - 1).data != nullptr; |
| } |
| |
| Value() = default; |
| ~Value() = default; |
| Value(Value&& other) noexcept = default; |
| Value& operator=(Value&& other) noexcept = default; |
| |
| class Builder; |
| friend class Builder; |
| static Builder Build(); |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_ValueTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 96; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| Value(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {} |
| }; |
| |
| class Value::Builder { |
| public: |
| Value view() { return Value(max_ordinal_, envelopes_.data_); } |
| ~Builder() = default; |
| Builder(Builder&& other) noexcept = default; |
| Builder& operator=(Builder&& other) noexcept = default; |
| |
| Builder&& set_direction(::llcpp::fuchsia::tee::Direction* elem); |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| Builder&& set_a(uint64_t* elem); |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| Builder&& set_b(uint64_t* elem); |
| |
| // This value is optional. If not set, a zero value is sent in its place if it is required by |
| // the calling convention. |
| Builder&& set_c(uint64_t* elem); |
| |
| private: |
| Builder() = default; |
| friend Builder Value::Build(); |
| |
| uint64_t max_ordinal_ = 0; |
| ::fidl::Array<fidl_envelope_t, 4> envelopes_ = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_BufferTable; |
| |
| // Represents a buffer parameter. |
| struct Buffer final : private ::fidl::VectorView<fidl_envelope_t> { |
| using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>; |
| public: |
| // Returns whether no field is set. |
| bool IsEmpty() const { return EnvelopesView::empty(); } |
| |
| const ::llcpp::fuchsia::tee::Direction& direction() const { |
| ZX_ASSERT(has_direction()); |
| return *reinterpret_cast<const ::llcpp::fuchsia::tee::Direction*>(EnvelopesView::at(1 - 1).data); |
| } |
| ::llcpp::fuchsia::tee::Direction& direction() { |
| ZX_ASSERT(has_direction()); |
| return *reinterpret_cast<::llcpp::fuchsia::tee::Direction*>(EnvelopesView::at(1 - 1).data); |
| } |
| bool has_direction() const { |
| return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr; |
| } |
| |
| // The VMO is allowed to be not present for situations where the TEE allows for buffer size |
| // checks. |
| // |
| // For example, if the operation to be performed needs an output buffer, but the user cannot |
| // calculate how large that output buffer should be, they can attempt the operation without |
| // a vmo and the Trusted Application will populate the size field so that the operation can |
| // be performed again with an appropriately sized buffer. |
| const ::zx::vmo& vmo() const { |
| ZX_ASSERT(has_vmo()); |
| return *reinterpret_cast<const ::zx::vmo*>(EnvelopesView::at(2 - 1).data); |
| } |
| ::zx::vmo& vmo() { |
| ZX_ASSERT(has_vmo()); |
| return *reinterpret_cast<::zx::vmo*>(EnvelopesView::at(2 - 1).data); |
| } |
| bool has_vmo() const { |
| return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr; |
| } |
| |
| const uint64_t& offset() const { |
| ZX_ASSERT(has_offset()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(3 - 1).data); |
| } |
| uint64_t& offset() { |
| ZX_ASSERT(has_offset()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(3 - 1).data); |
| } |
| bool has_offset() const { |
| return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr; |
| } |
| |
| const uint64_t& size() const { |
| ZX_ASSERT(has_size()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(4 - 1).data); |
| } |
| uint64_t& size() { |
| ZX_ASSERT(has_size()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(4 - 1).data); |
| } |
| bool has_size() const { |
| return EnvelopesView::count() >= 4 && EnvelopesView::at(4 - 1).data != nullptr; |
| } |
| |
| Buffer() = default; |
| ~Buffer() = default; |
| Buffer(Buffer&& other) noexcept = default; |
| Buffer& operator=(Buffer&& other) noexcept = default; |
| |
| class Builder; |
| friend class Builder; |
| static Builder Build(); |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_BufferTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 96; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| Buffer(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {} |
| }; |
| |
| class Buffer::Builder { |
| public: |
| Buffer view() { return Buffer(max_ordinal_, envelopes_.data_); } |
| ~Builder() = default; |
| Builder(Builder&& other) noexcept = default; |
| Builder& operator=(Builder&& other) noexcept = default; |
| |
| Builder&& set_direction(::llcpp::fuchsia::tee::Direction* elem); |
| |
| // The VMO is allowed to be not present for situations where the TEE allows for buffer size |
| // checks. |
| // |
| // For example, if the operation to be performed needs an output buffer, but the user cannot |
| // calculate how large that output buffer should be, they can attempt the operation without |
| // a vmo and the Trusted Application will populate the size field so that the operation can |
| // be performed again with an appropriately sized buffer. |
| Builder&& set_vmo(::zx::vmo* elem); |
| |
| Builder&& set_offset(uint64_t* elem); |
| |
| Builder&& set_size(uint64_t* elem); |
| |
| private: |
| Builder() = default; |
| friend Builder Buffer::Build(); |
| |
| uint64_t max_ordinal_ = 0; |
| ::fidl::Array<fidl_envelope_t, 4> envelopes_ = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_ParameterTable; |
| |
| struct Parameter { |
| Parameter() : ordinal_(Ordinal::Invalid), envelope_{} {} |
| |
| enum class Tag : fidl_xunion_tag_t { |
| kNone = 1, // 0x1 |
| kBuffer = 2, // 0x2 |
| kValue = 3, // 0x3 |
| kUnknown = ::std::numeric_limits<::fidl_union_tag_t>::max(), |
| }; |
| |
| bool has_invalid_tag() const { return ordinal_ == Ordinal::Invalid; } |
| |
| bool is_none() const { return ordinal() == Ordinal::kNone; } |
| |
| static Parameter WithNone(::llcpp::fuchsia::tee::None* val) { |
| Parameter result; |
| result.set_none(val); |
| return result; |
| } |
| |
| void set_none(::llcpp::fuchsia::tee::None* elem) { |
| ordinal_ = Ordinal::kNone; |
| envelope_.data = static_cast<void*>(elem); |
| } |
| |
| ::llcpp::fuchsia::tee::None& mutable_none() { |
| ZX_ASSERT(ordinal() == Ordinal::kNone); |
| return *static_cast<::llcpp::fuchsia::tee::None*>(envelope_.data); |
| } |
| const ::llcpp::fuchsia::tee::None& none() const { |
| ZX_ASSERT(ordinal() == Ordinal::kNone); |
| return *static_cast<::llcpp::fuchsia::tee::None*>(envelope_.data); |
| } |
| |
| bool is_buffer() const { return ordinal() == Ordinal::kBuffer; } |
| |
| static Parameter WithBuffer(::llcpp::fuchsia::tee::Buffer* val) { |
| Parameter result; |
| result.set_buffer(val); |
| return result; |
| } |
| |
| void set_buffer(::llcpp::fuchsia::tee::Buffer* elem) { |
| ordinal_ = Ordinal::kBuffer; |
| envelope_.data = static_cast<void*>(elem); |
| } |
| |
| ::llcpp::fuchsia::tee::Buffer& mutable_buffer() { |
| ZX_ASSERT(ordinal() == Ordinal::kBuffer); |
| return *static_cast<::llcpp::fuchsia::tee::Buffer*>(envelope_.data); |
| } |
| const ::llcpp::fuchsia::tee::Buffer& buffer() const { |
| ZX_ASSERT(ordinal() == Ordinal::kBuffer); |
| return *static_cast<::llcpp::fuchsia::tee::Buffer*>(envelope_.data); |
| } |
| |
| bool is_value() const { return ordinal() == Ordinal::kValue; } |
| |
| static Parameter WithValue(::llcpp::fuchsia::tee::Value* val) { |
| Parameter result; |
| result.set_value(val); |
| return result; |
| } |
| |
| void set_value(::llcpp::fuchsia::tee::Value* elem) { |
| ordinal_ = Ordinal::kValue; |
| envelope_.data = static_cast<void*>(elem); |
| } |
| |
| ::llcpp::fuchsia::tee::Value& mutable_value() { |
| ZX_ASSERT(ordinal() == Ordinal::kValue); |
| return *static_cast<::llcpp::fuchsia::tee::Value*>(envelope_.data); |
| } |
| const ::llcpp::fuchsia::tee::Value& value() const { |
| ZX_ASSERT(ordinal() == Ordinal::kValue); |
| return *static_cast<::llcpp::fuchsia::tee::Value*>(envelope_.data); |
| } |
| void* unknownData() const { |
| ZX_ASSERT(which() == Tag::kUnknown); |
| return envelope_.data; |
| } |
| Tag which() const; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_ParameterTable; |
| static constexpr uint32_t MaxNumHandles = 1; |
| static constexpr uint32_t PrimarySize = 24; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 112; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| enum class Ordinal : fidl_xunion_tag_t { |
| Invalid = 0, |
| kNone = 1, // 0x1 |
| kBuffer = 2, // 0x2 |
| kValue = 3, // 0x3 |
| }; |
| |
| Ordinal ordinal() const { |
| switch (static_cast<fidl_xunion_tag_t>(ordinal_)) { |
| case 1: |
| case 614881370: |
| return Ordinal::kNone; |
| case 2: |
| case 526330047: |
| return Ordinal::kBuffer; |
| case 3: |
| case 483243862: |
| return Ordinal::kValue; |
| } |
| return ordinal_; |
| } |
| |
| static void SizeAndOffsetAssertionHelper(); |
| Ordinal ordinal_; |
| FIDL_ALIGNDECL |
| fidl_envelope_t envelope_; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_OpResultTable; |
| |
| // The result of an operation will include a return code, the origin of the result, and the return |
| // of the parameter set. The returned parameter set will be a copy of the input parameter set, but |
| // with the INOUT and OUTPUT parameters updated. If the parameter is a Buffer, it will update the |
| // Buffer.size to the number of bytes written. |
| struct OpResult final : private ::fidl::VectorView<fidl_envelope_t> { |
| using EnvelopesView = ::fidl::VectorView<fidl_envelope_t>; |
| public: |
| // Returns whether no field is set. |
| bool IsEmpty() const { return EnvelopesView::empty(); } |
| |
| const uint64_t& return_code() const { |
| ZX_ASSERT(has_return_code()); |
| return *reinterpret_cast<const uint64_t*>(EnvelopesView::at(1 - 1).data); |
| } |
| uint64_t& return_code() { |
| ZX_ASSERT(has_return_code()); |
| return *reinterpret_cast<uint64_t*>(EnvelopesView::at(1 - 1).data); |
| } |
| bool has_return_code() const { |
| return EnvelopesView::count() >= 1 && EnvelopesView::at(1 - 1).data != nullptr; |
| } |
| |
| const ::llcpp::fuchsia::tee::ReturnOrigin& return_origin() const { |
| ZX_ASSERT(has_return_origin()); |
| return *reinterpret_cast<const ::llcpp::fuchsia::tee::ReturnOrigin*>(EnvelopesView::at(2 - 1).data); |
| } |
| ::llcpp::fuchsia::tee::ReturnOrigin& return_origin() { |
| ZX_ASSERT(has_return_origin()); |
| return *reinterpret_cast<::llcpp::fuchsia::tee::ReturnOrigin*>(EnvelopesView::at(2 - 1).data); |
| } |
| bool has_return_origin() const { |
| return EnvelopesView::count() >= 2 && EnvelopesView::at(2 - 1).data != nullptr; |
| } |
| |
| const ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter>& parameter_set() const { |
| ZX_ASSERT(has_parameter_set()); |
| return *reinterpret_cast<const ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter>*>(EnvelopesView::at(3 - 1).data); |
| } |
| ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter>& parameter_set() { |
| ZX_ASSERT(has_parameter_set()); |
| return *reinterpret_cast<::fidl::VectorView<::llcpp::fuchsia::tee::Parameter>*>(EnvelopesView::at(3 - 1).data); |
| } |
| bool has_parameter_set() const { |
| return EnvelopesView::count() >= 3 && EnvelopesView::at(3 - 1).data != nullptr; |
| } |
| |
| OpResult() = default; |
| ~OpResult() = default; |
| OpResult(OpResult&& other) noexcept = default; |
| OpResult& operator=(OpResult&& other) noexcept = default; |
| |
| class Builder; |
| friend class Builder; |
| static Builder Build(); |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_OpResultTable; |
| static constexpr uint32_t MaxNumHandles = 4; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 624; |
| static constexpr bool HasPointer = true; |
| |
| private: |
| OpResult(uint64_t max_ordinal, fidl_envelope_t* data) : EnvelopesView(data, max_ordinal) {} |
| }; |
| |
| class OpResult::Builder { |
| public: |
| OpResult view() { return OpResult(max_ordinal_, envelopes_.data_); } |
| ~Builder() = default; |
| Builder(Builder&& other) noexcept = default; |
| Builder& operator=(Builder&& other) noexcept = default; |
| |
| Builder&& set_return_code(uint64_t* elem); |
| |
| Builder&& set_return_origin(::llcpp::fuchsia::tee::ReturnOrigin* elem); |
| |
| Builder&& set_parameter_set(::fidl::VectorView<::llcpp::fuchsia::tee::Parameter>* elem); |
| |
| private: |
| Builder() = default; |
| friend Builder OpResult::Build(); |
| |
| uint64_t max_ordinal_ = 0; |
| ::fidl::Array<fidl_envelope_t, 3> envelopes_ = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_UuidTable; |
| |
| // UUID identifiers are used to identify the TEE Operating System and individual Trusted |
| // Applications. This structure matches the UUID type as defined by RFC4122. |
| struct Uuid { |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_UuidTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 16; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr bool HasPointer = false; |
| |
| uint32_t time_low = {}; |
| |
| uint16_t time_mid = {}; |
| |
| uint16_t time_hi_and_version = {}; |
| |
| ::fidl::Array<uint8_t, 8> clock_seq_and_node = {}; |
| }; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_NoneTable; |
| |
| // An empty parameter type is used as a placeholder for elements in the parameter set that are not |
| // used. |
| struct None { |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_NoneTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 1; |
| [[maybe_unused]] |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr bool HasPointer = false; |
| |
| uint8_t __reserved = {}; |
| }; |
| |
| constexpr uint32_t MAX_PARAMETERSET_COUNT = 4u; |
| |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceGetOsInfoRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceGetOsInfoResponseTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceOpenSessionRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceOpenSessionResponseTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceInvokeCommandRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceInvokeCommandResponseTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceCloseSessionRequestTable; |
| extern "C" const fidl_type_t v1_fuchsia_tee_DeviceCloseSessionResponseTable; |
| |
| class Device final { |
| Device() = delete; |
| public: |
| static constexpr char Name[] = "fuchsia.tee.Device"; |
| |
| struct GetOsInfoResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fuchsia::tee::OsInfo info; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceGetOsInfoResponseTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 136; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| using GetOsInfoRequest = ::fidl::AnyZeroArgMessage; |
| |
| struct OpenSessionResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| uint32_t session_id; |
| ::llcpp::fuchsia::tee::OpResult op_result; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceOpenSessionResponseTable; |
| static constexpr uint32_t MaxNumHandles = 4; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 624; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| struct OpenSessionRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fuchsia::tee::Uuid trusted_app; |
| ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceOpenSessionRequestTable; |
| static constexpr uint32_t MaxNumHandles = 4; |
| static constexpr uint32_t PrimarySize = 48; |
| static constexpr uint32_t MaxOutOfLine = 544; |
| static constexpr uint32_t AltPrimarySize = 48; |
| static constexpr uint32_t AltMaxOutOfLine = 544; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = OpenSessionResponse; |
| }; |
| |
| struct InvokeCommandResponse final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| ::llcpp::fuchsia::tee::OpResult op_result; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceInvokeCommandResponseTable; |
| static constexpr uint32_t MaxNumHandles = 4; |
| static constexpr uint32_t PrimarySize = 32; |
| static constexpr uint32_t MaxOutOfLine = 624; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kResponse; |
| }; |
| struct InvokeCommandRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| uint32_t session_id; |
| uint32_t command_id; |
| ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceInvokeCommandRequestTable; |
| static constexpr uint32_t MaxNumHandles = 4; |
| static constexpr uint32_t PrimarySize = 40; |
| static constexpr uint32_t MaxOutOfLine = 544; |
| static constexpr uint32_t AltPrimarySize = 40; |
| static constexpr uint32_t AltMaxOutOfLine = 544; |
| static constexpr bool HasFlexibleEnvelope = true; |
| static constexpr bool HasPointer = true; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| using ResponseType = InvokeCommandResponse; |
| }; |
| |
| using CloseSessionResponse = ::fidl::AnyZeroArgMessage; |
| struct CloseSessionRequest final { |
| FIDL_ALIGNDECL |
| fidl_message_header_t _hdr; |
| uint32_t session_id; |
| |
| static constexpr const fidl_type_t* Type = &v1_fuchsia_tee_DeviceCloseSessionRequestTable; |
| static constexpr uint32_t MaxNumHandles = 0; |
| static constexpr uint32_t PrimarySize = 24; |
| static constexpr uint32_t MaxOutOfLine = 0; |
| static constexpr uint32_t AltPrimarySize = 24; |
| static constexpr uint32_t AltMaxOutOfLine = 0; |
| static constexpr bool HasFlexibleEnvelope = false; |
| static constexpr bool HasPointer = false; |
| static constexpr bool ContainsUnion = false; |
| static constexpr ::fidl::internal::TransactionalMessageKind MessageKind = |
| ::fidl::internal::TransactionalMessageKind::kRequest; |
| }; |
| |
| |
| // Collection of return types of FIDL calls in this interface. |
| class ResultOf final { |
| ResultOf() = delete; |
| private: |
| template <typename ResponseType> |
| class GetOsInfo_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| GetOsInfo_Impl(::zx::unowned_channel _client_end); |
| ~GetOsInfo_Impl() = default; |
| GetOsInfo_Impl(GetOsInfo_Impl&& other) = default; |
| GetOsInfo_Impl& operator=(GetOsInfo_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class OpenSession_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| OpenSession_Impl(::zx::unowned_channel _client_end, ::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| ~OpenSession_Impl() = default; |
| OpenSession_Impl(OpenSession_Impl&& other) = default; |
| OpenSession_Impl& operator=(OpenSession_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class InvokeCommand_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| InvokeCommand_Impl(::zx::unowned_channel _client_end, uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| ~InvokeCommand_Impl() = default; |
| InvokeCommand_Impl(InvokeCommand_Impl&& other) = default; |
| InvokeCommand_Impl& operator=(InvokeCommand_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class CloseSession_Impl final : private ::fidl::internal::OwnedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::OwnedSyncCallBase<ResponseType>; |
| public: |
| CloseSession_Impl(::zx::unowned_channel _client_end, uint32_t session_id); |
| ~CloseSession_Impl() = default; |
| CloseSession_Impl(CloseSession_Impl&& other) = default; |
| CloseSession_Impl& operator=(CloseSession_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using GetOsInfo = GetOsInfo_Impl<GetOsInfoResponse>; |
| using OpenSession = OpenSession_Impl<OpenSessionResponse>; |
| using InvokeCommand = InvokeCommand_Impl<InvokeCommandResponse>; |
| using CloseSession = CloseSession_Impl<CloseSessionResponse>; |
| }; |
| |
| // Collection of return types of FIDL calls in this interface, |
| // when the caller-allocate flavor or in-place call is used. |
| class UnownedResultOf final { |
| UnownedResultOf() = delete; |
| private: |
| template <typename ResponseType> |
| class GetOsInfo_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| GetOsInfo_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer); |
| ~GetOsInfo_Impl() = default; |
| GetOsInfo_Impl(GetOsInfo_Impl&& other) = default; |
| GetOsInfo_Impl& operator=(GetOsInfo_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class OpenSession_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| OpenSession_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| ~OpenSession_Impl() = default; |
| OpenSession_Impl(OpenSession_Impl&& other) = default; |
| OpenSession_Impl& operator=(OpenSession_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class InvokeCommand_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| InvokeCommand_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| ~InvokeCommand_Impl() = default; |
| InvokeCommand_Impl(InvokeCommand_Impl&& other) = default; |
| InvokeCommand_Impl& operator=(InvokeCommand_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| template <typename ResponseType> |
| class CloseSession_Impl final : private ::fidl::internal::UnownedSyncCallBase<ResponseType> { |
| using Super = ::fidl::internal::UnownedSyncCallBase<ResponseType>; |
| public: |
| CloseSession_Impl(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t session_id, ::fidl::BytePart _response_buffer); |
| ~CloseSession_Impl() = default; |
| CloseSession_Impl(CloseSession_Impl&& other) = default; |
| CloseSession_Impl& operator=(CloseSession_Impl&& other) = default; |
| using Super::status; |
| using Super::error; |
| using Super::ok; |
| using Super::Unwrap; |
| using Super::value; |
| using Super::operator->; |
| using Super::operator*; |
| }; |
| |
| public: |
| using GetOsInfo = GetOsInfo_Impl<GetOsInfoResponse>; |
| using OpenSession = OpenSession_Impl<OpenSessionResponse>; |
| using InvokeCommand = InvokeCommand_Impl<InvokeCommandResponse>; |
| using CloseSession = CloseSession_Impl<CloseSessionResponse>; |
| }; |
| |
| class SyncClient final { |
| public: |
| explicit SyncClient(::zx::channel channel) : channel_(std::move(channel)) {} |
| ~SyncClient() = default; |
| SyncClient(SyncClient&&) = default; |
| SyncClient& operator=(SyncClient&&) = default; |
| |
| const ::zx::channel& channel() const { return channel_; } |
| |
| ::zx::channel* mutable_channel() { return &channel_; } |
| |
| // Obtain information about the TEE OS |
| // Allocates 16 bytes of request buffer on the stack. Response is heap-allocated. |
| ResultOf::GetOsInfo GetOsInfo(); |
| |
| // Obtain information about the TEE OS |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::GetOsInfo GetOsInfo(::fidl::BytePart _response_buffer); |
| |
| // Initiates a communication session with the specified trusted application. |
| // Request is heap-allocated. Response is heap-allocated. |
| ResultOf::OpenSession OpenSession(::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| |
| // Initiates a communication session with the specified trusted application. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::OpenSession OpenSession(::fidl::BytePart _request_buffer, ::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| |
| // Requests the trusted application perform the provided command. The command is unique to the |
| // trusted application. |
| // Request is heap-allocated. Response is heap-allocated. |
| ResultOf::InvokeCommand InvokeCommand(uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| |
| // Requests the trusted application perform the provided command. The command is unique to the |
| // trusted application. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::InvokeCommand InvokeCommand(::fidl::BytePart _request_buffer, uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| |
| // Closes an established session. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation necessary. |
| ResultOf::CloseSession CloseSession(uint32_t session_id); |
| |
| // Closes an established session. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| UnownedResultOf::CloseSession CloseSession(::fidl::BytePart _request_buffer, uint32_t session_id, ::fidl::BytePart _response_buffer); |
| |
| private: |
| ::zx::channel channel_; |
| }; |
| |
| // Methods to make a sync FIDL call directly on an unowned channel, avoiding setting up a client. |
| class Call final { |
| Call() = delete; |
| public: |
| |
| // Obtain information about the TEE OS |
| // Allocates 16 bytes of request buffer on the stack. Response is heap-allocated. |
| static ResultOf::GetOsInfo GetOsInfo(::zx::unowned_channel _client_end); |
| |
| // Obtain information about the TEE OS |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::GetOsInfo GetOsInfo(::zx::unowned_channel _client_end, ::fidl::BytePart _response_buffer); |
| |
| // Initiates a communication session with the specified trusted application. |
| // Request is heap-allocated. Response is heap-allocated. |
| static ResultOf::OpenSession OpenSession(::zx::unowned_channel _client_end, ::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| |
| // Initiates a communication session with the specified trusted application. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::OpenSession OpenSession(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, ::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| |
| // Requests the trusted application perform the provided command. The command is unique to the |
| // trusted application. |
| // Request is heap-allocated. Response is heap-allocated. |
| static ResultOf::InvokeCommand InvokeCommand(::zx::unowned_channel _client_end, uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set); |
| |
| // Requests the trusted application perform the provided command. The command is unique to the |
| // trusted application. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::InvokeCommand InvokeCommand(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, ::fidl::BytePart _response_buffer); |
| |
| // Closes an established session. |
| // Allocates 40 bytes of message buffer on the stack. No heap allocation necessary. |
| static ResultOf::CloseSession CloseSession(::zx::unowned_channel _client_end, uint32_t session_id); |
| |
| // Closes an established session. |
| // Caller provides the backing storage for FIDL message via request and response buffers. |
| static UnownedResultOf::CloseSession CloseSession(::zx::unowned_channel _client_end, ::fidl::BytePart _request_buffer, uint32_t session_id, ::fidl::BytePart _response_buffer); |
| |
| }; |
| |
| // Messages are encoded and decoded in-place when these methods are used. |
| // Additionally, requests must be already laid-out according to the FIDL wire-format. |
| class InPlace final { |
| InPlace() = delete; |
| public: |
| |
| // Obtain information about the TEE OS |
| static ::fidl::DecodeResult<GetOsInfoResponse> GetOsInfo(::zx::unowned_channel _client_end, ::fidl::BytePart response_buffer); |
| |
| // Initiates a communication session with the specified trusted application. |
| static ::fidl::DecodeResult<OpenSessionResponse> OpenSession(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<OpenSessionRequest> params, ::fidl::BytePart response_buffer); |
| |
| // Requests the trusted application perform the provided command. The command is unique to the |
| // trusted application. |
| static ::fidl::DecodeResult<InvokeCommandResponse> InvokeCommand(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<InvokeCommandRequest> params, ::fidl::BytePart response_buffer); |
| |
| // Closes an established session. |
| static ::fidl::DecodeResult<CloseSessionResponse> CloseSession(::zx::unowned_channel _client_end, ::fidl::DecodedMessage<CloseSessionRequest> params, ::fidl::BytePart response_buffer); |
| |
| }; |
| |
| // Pure-virtual interface to be implemented by a server. |
| class Interface { |
| public: |
| Interface() = default; |
| virtual ~Interface() = default; |
| using _Outer = Device; |
| using _Base = ::fidl::CompleterBase; |
| |
| class GetOsInfoCompleterBase : public _Base { |
| public: |
| void Reply(::llcpp::fuchsia::tee::OsInfo info); |
| void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::tee::OsInfo info); |
| void Reply(::fidl::DecodedMessage<GetOsInfoResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using GetOsInfoCompleter = ::fidl::Completer<GetOsInfoCompleterBase>; |
| |
| virtual void GetOsInfo(GetOsInfoCompleter::Sync _completer) = 0; |
| |
| class OpenSessionCompleterBase : public _Base { |
| public: |
| void Reply(uint32_t session_id, ::llcpp::fuchsia::tee::OpResult op_result); |
| void Reply(::fidl::BytePart _buffer, uint32_t session_id, ::llcpp::fuchsia::tee::OpResult op_result); |
| void Reply(::fidl::DecodedMessage<OpenSessionResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using OpenSessionCompleter = ::fidl::Completer<OpenSessionCompleterBase>; |
| |
| virtual void OpenSession(::llcpp::fuchsia::tee::Uuid trusted_app, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, OpenSessionCompleter::Sync _completer) = 0; |
| |
| class InvokeCommandCompleterBase : public _Base { |
| public: |
| void Reply(::llcpp::fuchsia::tee::OpResult op_result); |
| void Reply(::fidl::BytePart _buffer, ::llcpp::fuchsia::tee::OpResult op_result); |
| void Reply(::fidl::DecodedMessage<InvokeCommandResponse> params); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using InvokeCommandCompleter = ::fidl::Completer<InvokeCommandCompleterBase>; |
| |
| virtual void InvokeCommand(uint32_t session_id, uint32_t command_id, ::fidl::VectorView<::llcpp::fuchsia::tee::Parameter> parameter_set, InvokeCommandCompleter::Sync _completer) = 0; |
| |
| class CloseSessionCompleterBase : public _Base { |
| public: |
| void Reply(); |
| |
| protected: |
| using ::fidl::CompleterBase::CompleterBase; |
| }; |
| |
| using CloseSessionCompleter = ::fidl::Completer<CloseSessionCompleterBase>; |
| |
| virtual void CloseSession(uint32_t session_id, CloseSessionCompleter::Sync _completer) = 0; |
| |
| }; |
| |
| // Attempts to dispatch the incoming message to a handler function in the server implementation. |
| // If there is no matching handler, it returns false, leaving the message and transaction intact. |
| // In all other cases, it consumes the message and returns true. |
| // It is possible to chain multiple TryDispatch functions in this manner. |
| static bool TryDispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Dispatches the incoming message to one of the handlers functions in the interface. |
| // If there is no matching handler, it closes all the handles in |msg| and closes the channel with |
| // a |ZX_ERR_NOT_SUPPORTED| epitaph, before returning false. The message should then be discarded. |
| static bool Dispatch(Interface* impl, fidl_msg_t* msg, ::fidl::Transaction* txn); |
| |
| // Same as |Dispatch|, but takes a |void*| instead of |Interface*|. Only used with |fidl::Bind| |
| // to reduce template expansion. |
| // Do not call this method manually. Use |Dispatch| instead. |
| static bool TypeErasedDispatch(void* impl, fidl_msg_t* msg, ::fidl::Transaction* txn) { |
| return Dispatch(static_cast<Interface*>(impl), msg, txn); |
| } |
| |
| |
| // Helper functions to fill in the transaction header in a |DecodedMessage<TransactionalMessage>|. |
| class SetTransactionHeaderFor final { |
| SetTransactionHeaderFor() = delete; |
| public: |
| static void GetOsInfoRequest(const ::fidl::DecodedMessage<Device::GetOsInfoRequest>& _msg); |
| static void GetOsInfoResponse(const ::fidl::DecodedMessage<Device::GetOsInfoResponse>& _msg); |
| static void OpenSessionRequest(const ::fidl::DecodedMessage<Device::OpenSessionRequest>& _msg); |
| static void OpenSessionResponse(const ::fidl::DecodedMessage<Device::OpenSessionResponse>& _msg); |
| static void InvokeCommandRequest(const ::fidl::DecodedMessage<Device::InvokeCommandRequest>& _msg); |
| static void InvokeCommandResponse(const ::fidl::DecodedMessage<Device::InvokeCommandResponse>& _msg); |
| static void CloseSessionRequest(const ::fidl::DecodedMessage<Device::CloseSessionRequest>& _msg); |
| static void CloseSessionResponse(const ::fidl::DecodedMessage<Device::CloseSessionResponse>& _msg); |
| }; |
| }; |
| |
| } // namespace tee |
| } // namespace fuchsia |
| } // namespace llcpp |
| |
| namespace fidl { |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Uuid> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::Uuid>); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Uuid, time_low) == 0); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Uuid, time_mid) == 4); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Uuid, time_hi_and_version) == 6); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Uuid, clock_seq_and_node) == 8); |
| static_assert(sizeof(::llcpp::fuchsia::tee::Uuid) == ::llcpp::fuchsia::tee::Uuid::PrimarySize); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::OsRevision> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::OsRevision>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::OsInfo> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::OsInfo>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::None> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::None>); |
| static_assert(offsetof(::llcpp::fuchsia::tee::None, __reserved) == 0); |
| static_assert(sizeof(::llcpp::fuchsia::tee::None) == ::llcpp::fuchsia::tee::None::PrimarySize); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Value> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::Value>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Buffer> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::Buffer>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Parameter> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::Parameter>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::OpResult> : public std::true_type {}; |
| static_assert(std::is_standard_layout_v<::llcpp::fuchsia::tee::OpResult>); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::GetOsInfoResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::GetOsInfoResponse> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::GetOsInfoResponse) |
| == ::llcpp::fuchsia::tee::Device::GetOsInfoResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::GetOsInfoResponse, info) == 16); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::OpenSessionRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::OpenSessionRequest> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::OpenSessionRequest) |
| == ::llcpp::fuchsia::tee::Device::OpenSessionRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::OpenSessionRequest, trusted_app) == 16); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::OpenSessionRequest, parameter_set) == 32); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::OpenSessionResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::OpenSessionResponse> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::OpenSessionResponse) |
| == ::llcpp::fuchsia::tee::Device::OpenSessionResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::OpenSessionResponse, session_id) == 16); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::OpenSessionResponse, op_result) == 24); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::InvokeCommandRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::InvokeCommandRequest> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::InvokeCommandRequest) |
| == ::llcpp::fuchsia::tee::Device::InvokeCommandRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::InvokeCommandRequest, session_id) == 16); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::InvokeCommandRequest, command_id) == 20); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::InvokeCommandRequest, parameter_set) == 24); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::InvokeCommandResponse> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::InvokeCommandResponse> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::InvokeCommandResponse) |
| == ::llcpp::fuchsia::tee::Device::InvokeCommandResponse::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::InvokeCommandResponse, op_result) == 16); |
| |
| template <> |
| struct IsFidlType<::llcpp::fuchsia::tee::Device::CloseSessionRequest> : public std::true_type {}; |
| template <> |
| struct IsFidlMessage<::llcpp::fuchsia::tee::Device::CloseSessionRequest> : public std::true_type {}; |
| static_assert(sizeof(::llcpp::fuchsia::tee::Device::CloseSessionRequest) |
| == ::llcpp::fuchsia::tee::Device::CloseSessionRequest::PrimarySize); |
| static_assert(offsetof(::llcpp::fuchsia::tee::Device::CloseSessionRequest, session_id) == 16); |
| |
| } // namespace fidl |