Skip to main content

pamoja_update_block_frame

Function pamoja_update_block_frame 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_update_block_frame( envelope: *const u8, envelope_len: usize, image: *const u8, image_len: usize, out_block: *mut u8, capacity: usize, out_len: *mut usize, ) -> PamojaStatus
Expand description

Writes a signed update into one block, for a transport that moves blocks.

The block is the signed manifest and the image behind a header that says where each begins. Nothing in the header is trusted: every rule that decides whether the image runs is still the manifest’s.

§Arguments

  • envelope - the signed manifest.
  • envelope_len - how many bytes it holds.
  • image - the image it describes.
  • image_len - how many bytes it holds.
  • out_block - receives the block.
  • capacity - how many bytes that buffer holds.
  • out_len - receives how many were written.

§Returns

PamojaStatus::Ok on success.

§Errors

Returns PamojaStatus::InvalidArgument for a null pointer, and PamojaStatus::Codec when the envelope is longer than a header can describe or the buffer is too small.

§Safety

Every pointer must be non-null, the inputs readable for their lengths, out_block writable for capacity bytes, and out_len writable.