struct MetadataType1

Defined at line 22 of file ../../src/storage/blobfs/delivery_blob_private.h

Metadata format corresponding to a delivery blob of type `DeliveryBlobType::kType1`.

Public Members

uint64_t payload_length
uint32_t checksum
uint32_t flags
static const uint32_t kIsCompressed
static const uint32_t kValidFlagsMask
static DeliveryBlobHeader kHeader

Public Methods

bool IsCompressed ()

Defined at line 44 of file ../../src/storage/blobfs/delivery_blob_private.h

bool IsValid (const DeliveryBlobHeader & header)

Check if the metadata is valid. Requires `header` for checksum validation.

Defined at line 123 of file ../../src/storage/blobfs/delivery_blob.cc

uint32_t Checksum (const DeliveryBlobHeader & header)

Calculate the checksum over the header and this metadata.

Defined at line 136 of file ../../src/storage/blobfs/delivery_blob.cc

MetadataType1 Create (const DeliveryBlobHeader & header, size_t payload_length, bool is_compressed)

Create new `MetadataType1` with the specified `payload_length`. If `is_compressed` is

true, the payload is assumed to be in the zstd-chunked format. Otherwise, the payload

following the metadata ia assumed to be uncompressed.

Defined at line 147 of file ../../src/storage/blobfs/delivery_blob.cc

zx::result<MetadataType1> FromBuffer (std::span<const uint8_t> buffer, const blobfs::DeliveryBlobHeader & header)

Parse and return a `MetadataType1` from a byte `buffer` and a parsed `header`.

Defined at line 159 of file ../../src/storage/blobfs/delivery_blob.cc