Lines Matching +full:hdr +full:- +full:v2

7 //     http://www.apache.org/licenses/LICENSE-2.0
32 V2(LayoutVerified<B, boot_img_hdr_v2>), enumerator
57 /// Catch-all for remaining errors.
62 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { in fmt()
76 fn parse_header<B: ByteSlice + PartialEq, T>(buffer: B) -> BootResult<LayoutVerified<B, T>> { in parse_header()
81 /// Given a byte buffer, attempt to parse the contents and return a zero-copy reference
85 /// * `buffer` - buffer to parse
89 /// * `Ok(BootImage)` - if parsing was successful.
90 /// * `Err(ImageError)` - if `buffer` does not contain a valid boot image header.
101 pub fn parse(buffer: B) -> BootResult<Self> { in parse()
103 // Note: even though the v3 header is not a prefix for the v0, v1, or v2 header, in parse()
106 let (hdr, _) = in parse()
110 if hdr.magic.ne(&BOOT_MAGIC[..magic_size]) { in parse()
114 match hdr.header_version { in parse()
117 2 => Ok(Self::V2(parse_header::<B, boot_img_hdr_v2>(buffer)?)), in parse()
126 /// Given a byte buffer, attempt to parse the contents and return a zero-copy reference
130 /// * `buffer` - buffer to parse
134 /// * `Ok(VendorImageHeader)` - if parsing was successful.
135 /// * `Err(ImageError)` - If `buffer` does not contain a valid boot image header.
146 pub fn parse(buffer: B) -> BootResult<Self> { in parse()
148 let (hdr, _) = LayoutVerified::<&[u8], vendor_boot_img_hdr_v3>::new_from_prefix( in parse()
153 if hdr.magic.ne(&VENDOR_BOOT_MAGIC[..magic_size]) { in parse()
157 match hdr.header_version { in parse()
186 // we can trigger a buffer-too-small error by providing in buffer_too_small_valid_version()
277 Ok(BootImage::V2(LayoutVerified::<&[u8], boot_img_hdr_v2>::new(&buffer).unwrap())); in parse_v2()
354 // we can trigger a buffer-too-small error by providing in vendor_buffer_too_small_valid_version()