libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
dump.c File Reference
`#include <inttypes.h>`
`#include <limits.h>`
`#include <stdint.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "aaruformat/consts.h"`
`#include "aaruformat/context.h"`
`#include "aaruformat/decls.h"`
`#include "aaruformat/endian.h"`
`#include "aaruformat/enums.h"`
`#include "aaruformat/structs/dump.h"`
`#include "aaruformat/structs/index.h"`
`#include "internal.h"`
`#include "log.h"`

Go to the source code of this file.

## Functions
static void | free_dump_hardware_entries_array (DumpHardwareEntriesWithData *entries, uint16_t count)
static void | reset_dump_hardware_context (aaruformat_context *ctx)
static bool | read_dump_string (FILE *stream, const char *field_name, const uint32_t length, uint32_t *remaining, uint8_t **destination)
void | process_dumphw_block (aaruformat_context *ctx, const IndexEntry *entry)
| Processes a dump hardware block from the image stream.

## Function Documentation

## ◆ free_dump_hardware_entries_array()

void free_dump_hardware_entries_array | ( | DumpHardwareEntriesWithData * | entries,
|  | uint16_t | count )
| static

Definition at line 36 of file dump.c.

Referenced by process_dumphw_block(), and reset_dump_hardware_context().

## ◆ process_dumphw_block()

void process_dumphw_block | ( | aaruformat_context * | ctx,
|  | const IndexEntry * | entry )

Processes a dump hardware block from the image stream.

Reads a dump hardware block from the image and updates the context with its contents.

Parameters

  ctx | Pointer to the aaruformat context.
  entry | Pointer to the index entry describing the dump hardware block.

Definition at line 107 of file dump.c.

References aaruf_crc64_data(), AARUF_VERSION_V1, IndexEntry::blockType, bswap_64, compare_extents(), DumpHardwareHeader::crc64, aaruformat_context::dump_hardware_entries_with_data, aaruformat_context::dump_hardware_header, DumpHardwareBlock, DumpHardwareHeader::entries, DumpHardwareEntriesWithData::entry, DumpHardwareEntriesWithData::extents, DumpHardwareEntry::extents, FATAL, DumpHardwareEntriesWithData::firmware, DumpHardwareEntry::firmwareLength, free_dump_hardware_entries_array(), aaruformat_context::header, DumpHardwareHeader::identifier, AaruHeaderV2::imageMajorVersion, aaruformat_context::imageStream, DumpHardwareHeader::length, DumpHardwareEntriesWithData::manufacturer, DumpHardwareEntry::manufacturerLength, DumpHardwareEntriesWithData::model, DumpHardwareEntry::modelLength, IndexEntry::offset, read_dump_string(), reset_dump_hardware_context(), DumpHardwareEntriesWithData::revision, DumpHardwareEntry::revisionLength, DumpHardwareEntriesWithData::serial, DumpHardwareEntry::serialLength, DumpHardwareEntriesWithData::softwareName, DumpHardwareEntry::softwareNameLength, DumpHardwareEntriesWithData::softwareOperatingSystem, DumpHardwareEntry::softwareOperatingSystemLength, DumpHardwareEntriesWithData::softwareVersion, DumpHardwareEntry::softwareVersionLength, and TRACE.

Referenced by aaruf_open().

## ◆ read_dump_string()

bool read_dump_string | ( | FILE * | stream,
|  | const char * | field_name,
|  | const uint32_t | length,
|  | uint32_t * | remaining,
|  | uint8_t ** | destination )
| static

Definition at line 64 of file dump.c.

References TRACE.

Referenced by process_dumphw_block().

## ◆ reset_dump_hardware_context()

void reset_dump_hardware_context | ( | aaruformat_context * | ctx | ) |
| static

Definition at line 54 of file dump.c.

References aaruformat_context::dump_hardware_entries_with_data, aaruformat_context::dump_hardware_header, DumpHardwareHeader::entries, and free_dump_hardware_entries_array().

Referenced by process_dumphw_block().