template <>
class WireServer
Defined at line 1147 of file fidling/gen/sdk/fidl/fuchsia.hardware.block.verified/fuchsia.hardware.block.verified/cpp/fidl/fuchsia.hardware.block.verified/cpp/wire_messaging.h
Pure-virtual interface to be implemented by a server.
This interface uses typed channels (i.e. |::fidl::ClientEnd
<
::fuchsia_hardware_block_verified::DeviceManager>|
and |::fidl::ServerEnd
<
::fuchsia_hardware_block_verified::DeviceManager>|).
Public Methods
void OpenForWrite (::fuchsia_hardware_block_verified::wire::DeviceManagerOpenForWriteRequest * request, OpenForWriteCompleter::Sync & completer)
Requests that the driver format the underlying block device as described
by the parameters in `config`, and enter `authoring` mode.
If `config` has any unpopulated fields, or those fields contain enum
values that are not known to this version of the driver, this method
will return `ZX_ERR_INVALID_ARGS`.
If the device was not in `closed` mode at the time of the call, this
method will return `ZX_ERR_BAD_STATE`.
If the underlying block device returns an error, this method will return
that same error code.
On success, the driver will enter `authoring` mode, expose a child
device named `mutable` which speaks the `fuchsia.hardware.block`
protocol in the device tree, then return.
void CloseAndGenerateSeal (CloseAndGenerateSealCompleter::Sync & completer)
Requests that the device in `authoring` mode:
* unbind the child device named `mutable`
* regenerate the integrity data necessary to provide the guarantees
expected by `OpenForVerifiedRead`
* flush all writes to the underlying block device
* switch to `closed` mode
* return a `Seal` that can be used to ensure that any data read in the
future from this device matches that which was written prior to this
particular call of `CloseAndGenerateSeal`.
If the device was not in "authoring" mode at the time of the call, this
function will return `ZX_ERR_BAD_STATE` and have no visible side effects.
If the underlying block device returns a failure while regenerating
integrity data or flushing writes, the device will enter the `failed` mode
and this call will propagate that error.
On success, the returned `seal` will contain a hash of the device
superblock that should be stored in tamper-proof storage, so it can be
retrieved and presented in a future `OpenForVerifiedRead` call.
void OpenForVerifiedRead (::fuchsia_hardware_block_verified::wire::DeviceManagerOpenForVerifiedReadRequest * request, OpenForVerifiedReadCompleter::Sync & completer)
Requests that the device verify that the provided `config` matches the
one on disk, and that the given `seal` covers the content of the
superblock. If all match as expected, then the device will bind a child
device named `verified` which speaks the `fuchsia.hardware.block`
protocol and enter the `verified-read` mode. Reads issued to the
`verified` block device will either successfully return the same content
as the `mutable` block device would have returned at the time the volume
was authored, or return a failure. That is to say: modifying the
underlying storage will cause the `verified` device to return read
failures for any modified blocks as `ZX_ERR_IO_DATA_INTEGRITY` rather
than data other than what was present at the time `CloseAndGenerateSeal`
was called.
* Returns `ZX_ERR_BAD_STATE` if the device was not in the `closed`
state at the time of the call
* Returns `ZX_ERR_INVALID_ARGS` if `config` lacks either `hash_function` or `block_size`
* Returns `ZX_ERR_INVALID_ARGS` if `seal` is of an unrecognized variant
* Returns `ZX_ERR_IO_DATA_INTEGRITY` if the `seal` provided is inconsistent with
the superblock, or if the properties in `config` are inconsistent with the
configuration data stored in the superblock on the underlying block device.
* Returns the underlying I/O error code if the underlying block device
returns an error.
On success, the device binds a child device `verified`, enters
`verified-read` mode, and returns from this call.
void Close (CloseCompleter::Sync & completer)
Requests that the device in either `authoring` mode or `verified-read` mode
unbind any child devices and return to `closed` mode.
Returns `ZX_ERR_BAD_STATE` if the device is not in `authoring` or
`verified-read` mode at the time of the call.
On success, the device does the following:
* If the device was in `authoring` mode, removes the child `mutable` device
* If the device was in `verified-read` mode, removes the child `verified` device
* Enters `closed` mode.
* Returns from this call
void WireServer ()
Defined at line 1150 of file fidling/gen/sdk/fidl/fuchsia.hardware.block.verified/fuchsia.hardware.block.verified/cpp/fidl/fuchsia.hardware.block.verified/cpp/wire_messaging.h
Handler bind_handler (async_dispatcher_t * dispatcher)
|bind_handler| returns a handler that binds incoming connections to this
server implementation.
The returned handler borrows the server instance.
The server must outlive the provided |dispatcher|. Only after
the dispatcher is shutdown will it be safe to destroy the servers.
The server should not be moved.
void ~WireServer ()
Defined at line 1151 of file fidling/gen/sdk/fidl/fuchsia.hardware.block.verified/fuchsia.hardware.block.verified/cpp/fidl/fuchsia.hardware.block.verified/cpp/wire_messaging.h