Lines Matching refs:hdr
14 static zbi_result_t for_each_check_entry(zbi_header_t* hdr, void* payload,
20 if (hdr->magic != ZBI_ITEM_MAGIC) {
22 } else if ((hdr->flags & ZBI_FLAG_VERSION) == 0) {
24 } else if ((hdr->flags & ZBI_FLAG_CRC32) == 0 &&
25 hdr->crc32 != ZBI_ITEM_NO_CRC32) {
31 *state->err = hdr;
34 if (hdr->type == ZBI_TYPE_STORAGE_BOOTFS) {
158 zbi_header_t* hdr = (zbi_header_t*)base;
161 if ((hdr->type != ZBI_TYPE_CONTAINER) ||
162 (hdr->magic != ZBI_ITEM_MAGIC) ||
163 (hdr->extra != ZBI_CONTAINER_MAGIC)) {
168 if (capacity - sizeof(*hdr) < hdr->length) {
171 const size_t available = capacity - sizeof(*hdr) - hdr->length;
172 if (available < sizeof(*hdr) ||
173 available - sizeof(*hdr) < ZBI_ALIGN(section_length)) {
178 zbi_header_t* new_header = (void*)((uint8_t*)(hdr + 1) + hdr->length);
192 hdr->length += sizeof(*new_header) + new_header->length;
193 if (hdr->length % ZBI_ALIGNMENT != 0) {
194 uint32_t aligned_length = ZBI_ALIGN(hdr->length);
195 if (capacity - sizeof(*hdr) < aligned_length) {
198 memset((uint8_t*)(hdr + 1) + hdr->length, 0,
199 aligned_length - hdr->length);
200 hdr->length = aligned_length;