/* auto-generated, do not modify */
#pragma once
#include <fwupd-common.h>

GByteArray *fu_struct_dfu_ftr_new(void);
GByteArray *fu_struct_dfu_ftr_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
gboolean fu_struct_dfu_ftr_validate_bytes(GBytes *blob, gsize offset, GError **error);
guint16 fu_struct_dfu_ftr_get_release(const GByteArray *st);
guint16 fu_struct_dfu_ftr_get_pid(const GByteArray *st);
guint16 fu_struct_dfu_ftr_get_vid(const GByteArray *st);
guint16 fu_struct_dfu_ftr_get_ver(const GByteArray *st);
guint8 fu_struct_dfu_ftr_get_len(const GByteArray *st);
guint32 fu_struct_dfu_ftr_get_crc(const GByteArray *st);
void fu_struct_dfu_ftr_set_release(GByteArray *st, guint16 value);
void fu_struct_dfu_ftr_set_pid(GByteArray *st, guint16 value);
void fu_struct_dfu_ftr_set_vid(GByteArray *st, guint16 value);
void fu_struct_dfu_ftr_set_ver(GByteArray *st, guint16 value);
void fu_struct_dfu_ftr_set_len(GByteArray *st, guint8 value);
void fu_struct_dfu_ftr_set_crc(GByteArray *st, guint32 value);
#define FU_STRUCT_DFU_FTR_OFFSET_RELEASE 0x0
#define FU_STRUCT_DFU_FTR_OFFSET_PID 0x2
#define FU_STRUCT_DFU_FTR_OFFSET_VID 0x4
#define FU_STRUCT_DFU_FTR_OFFSET_VER 0x6
#define FU_STRUCT_DFU_FTR_OFFSET_SIG 0x8
#define FU_STRUCT_DFU_FTR_OFFSET_LEN 0xB
#define FU_STRUCT_DFU_FTR_OFFSET_CRC 0xC
#define FU_STRUCT_DFU_FTR_SIZE_SIG 0x3
#define FU_STRUCT_DFU_FTR_SIZE 0x10
#define FU_STRUCT_DFU_FTR_DEFAULT_SIG "UFD"
#define FU_STRUCT_DFU_FTR_DEFAULT_LEN 16

GByteArray *fu_struct_dfuse_hdr_new(void);
GByteArray *fu_struct_dfuse_hdr_parse_bytes(GBytes *blob, gsize offset, GError **error);
gboolean fu_struct_dfuse_hdr_validate_bytes(GBytes *blob, gsize offset, GError **error);
guint32 fu_struct_dfuse_hdr_get_image_size(const GByteArray *st);
guint8 fu_struct_dfuse_hdr_get_targets(const GByteArray *st);
void fu_struct_dfuse_hdr_set_image_size(GByteArray *st, guint32 value);
void fu_struct_dfuse_hdr_set_targets(GByteArray *st, guint8 value);
#define FU_STRUCT_DFUSE_HDR_OFFSET_SIG 0x0
#define FU_STRUCT_DFUSE_HDR_OFFSET_VER 0x5
#define FU_STRUCT_DFUSE_HDR_OFFSET_IMAGE_SIZE 0x6
#define FU_STRUCT_DFUSE_HDR_OFFSET_TARGETS 0xA
#define FU_STRUCT_DFUSE_HDR_SIZE_SIG 0x5
#define FU_STRUCT_DFUSE_HDR_SIZE 0xB
#define FU_STRUCT_DFUSE_HDR_DEFAULT_SIG "DfuSe"
#define FU_STRUCT_DFUSE_HDR_DEFAULT_VER 0x01

GByteArray *fu_struct_dfuse_image_new(void);
GByteArray *fu_struct_dfuse_image_parse_bytes(GBytes *blob, gsize offset, GError **error);
gboolean fu_struct_dfuse_image_validate(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint8 fu_struct_dfuse_image_get_alt_setting(const GByteArray *st);
guint32 fu_struct_dfuse_image_get_target_named(const GByteArray *st);
gchar *fu_struct_dfuse_image_get_target_name(const GByteArray *st);
guint32 fu_struct_dfuse_image_get_target_size(const GByteArray *st);
guint32 fu_struct_dfuse_image_get_chunks(const GByteArray *st);
void fu_struct_dfuse_image_set_alt_setting(GByteArray *st, guint8 value);
void fu_struct_dfuse_image_set_target_named(GByteArray *st, guint32 value);
gboolean fu_struct_dfuse_image_set_target_name(GByteArray *st, const gchar *value, GError **error);
void fu_struct_dfuse_image_set_target_size(GByteArray *st, guint32 value);
void fu_struct_dfuse_image_set_chunks(GByteArray *st, guint32 value);
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_SIG 0x0
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_ALT_SETTING 0x6
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_NAMED 0x7
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_NAME 0xB
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_TARGET_SIZE 0x10A
#define FU_STRUCT_DFUSE_IMAGE_OFFSET_CHUNKS 0x10E
#define FU_STRUCT_DFUSE_IMAGE_SIZE_SIG 0x6
#define FU_STRUCT_DFUSE_IMAGE_SIZE_TARGET_NAME 0xFF
#define FU_STRUCT_DFUSE_IMAGE_SIZE 0x112
#define FU_STRUCT_DFUSE_IMAGE_DEFAULT_SIG "Target"

GByteArray *fu_struct_dfuse_element_new(void);
GByteArray *fu_struct_dfuse_element_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
gboolean fu_struct_dfuse_element_validate(const guint8 *buf, gsize bufsz, gsize offset, GError **error);
guint32 fu_struct_dfuse_element_get_address(const GByteArray *st);
guint32 fu_struct_dfuse_element_get_size(const GByteArray *st);
void fu_struct_dfuse_element_set_address(GByteArray *st, guint32 value);
void fu_struct_dfuse_element_set_size(GByteArray *st, guint32 value);
#define FU_STRUCT_DFUSE_ELEMENT_OFFSET_ADDRESS 0x0
#define FU_STRUCT_DFUSE_ELEMENT_OFFSET_SIZE 0x4
#define FU_STRUCT_DFUSE_ELEMENT_SIZE 0x8
