/*
 * This file is auto-generated, do not modify!
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once
#include <fu-input-stream.h>
/**
 * FuFdtToken:
 */
typedef enum {
    /**
     * FU_FDT_TOKEN_BEGIN_NODE:
     */
    FU_FDT_TOKEN_BEGIN_NODE = 0x00000001,
    /**
     * FU_FDT_TOKEN_END_NODE:
     */
    FU_FDT_TOKEN_END_NODE = 0x00000002,
    /**
     * FU_FDT_TOKEN_PROP:
     */
    FU_FDT_TOKEN_PROP = 0x00000003,
    /**
     * FU_FDT_TOKEN_NOP:
     */
    FU_FDT_TOKEN_NOP = 0x00000004,
    /**
     * FU_FDT_TOKEN_END:
     */
    FU_FDT_TOKEN_END = 0x00000009,
}  FuFdtToken;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructFdt;

FuStructFdt *fu_struct_fdt_ref(FuStructFdt *st) G_GNUC_NON_NULL(1);
void fu_struct_fdt_unref(FuStructFdt *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructFdt, fu_struct_fdt_unref)
FuStructFdt *fu_struct_fdt_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructFdt *fu_struct_fdt_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_fdt_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_totalsize(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_off_dt_struct(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_off_dt_strings(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_off_mem_rsvmap(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_version(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_last_comp_version(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_boot_cpuid_phys(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_size_dt_strings(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_get_size_dt_struct(const FuStructFdt *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fdt_set_totalsize(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_off_dt_struct(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_off_dt_strings(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_off_mem_rsvmap(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_version(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_last_comp_version(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_boot_cpuid_phys(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_size_dt_strings(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_set_size_dt_struct(FuStructFdt *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_OFFSET_MAGIC 0x0
#define FU_STRUCT_FDT_OFFSET_TOTALSIZE 0x4
#define FU_STRUCT_FDT_OFFSET_OFF_DT_STRUCT 0x8
#define FU_STRUCT_FDT_OFFSET_OFF_DT_STRINGS 0xC
#define FU_STRUCT_FDT_OFFSET_OFF_MEM_RSVMAP 0x10
#define FU_STRUCT_FDT_OFFSET_VERSION 0x14
#define FU_STRUCT_FDT_OFFSET_LAST_COMP_VERSION 0x18
#define FU_STRUCT_FDT_OFFSET_BOOT_CPUID_PHYS 0x1C
#define FU_STRUCT_FDT_OFFSET_SIZE_DT_STRINGS 0x20
#define FU_STRUCT_FDT_OFFSET_SIZE_DT_STRUCT 0x24
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_SIZE 0x28
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_DEFAULT_MAGIC 0xD00DFEED
#define FU_STRUCT_FDT_DEFAULT_LAST_COMP_VERSION 2
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructFdtReserveEntry;

FuStructFdtReserveEntry *fu_struct_fdt_reserve_entry_ref(FuStructFdtReserveEntry *st) G_GNUC_NON_NULL(1);
void fu_struct_fdt_reserve_entry_unref(FuStructFdtReserveEntry *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructFdtReserveEntry, fu_struct_fdt_reserve_entry_unref)
FuStructFdtReserveEntry *fu_struct_fdt_reserve_entry_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructFdtReserveEntry *fu_struct_fdt_reserve_entry_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint64 fu_struct_fdt_reserve_entry_get_address(const FuStructFdtReserveEntry *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint64 fu_struct_fdt_reserve_entry_get_size(const FuStructFdtReserveEntry *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fdt_reserve_entry_set_address(FuStructFdtReserveEntry *st, guint64 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_reserve_entry_set_size(FuStructFdtReserveEntry *st, guint64 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_RESERVE_ENTRY_OFFSET_ADDRESS 0x0
#define FU_STRUCT_FDT_RESERVE_ENTRY_OFFSET_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_RESERVE_ENTRY_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructFdtProp;

FuStructFdtProp *fu_struct_fdt_prop_ref(FuStructFdtProp *st) G_GNUC_NON_NULL(1);
void fu_struct_fdt_prop_unref(FuStructFdtProp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructFdtProp, fu_struct_fdt_prop_unref)
FuStructFdtProp *fu_struct_fdt_prop_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructFdtProp *fu_struct_fdt_prop_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_prop_get_len(const FuStructFdtProp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_fdt_prop_get_nameoff(const FuStructFdtProp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_fdt_prop_set_len(FuStructFdtProp *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_fdt_prop_set_nameoff(FuStructFdtProp *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_PROP_OFFSET_LEN 0x0
#define FU_STRUCT_FDT_PROP_OFFSET_NAMEOFF 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_FDT_PROP_SIZE 0x8
#endif

#ifndef __GI_SCANNER__
#endif
