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

#pragma once
#include <fu-input-stream.h>
/**
 * FuCfuOfferInfoCode:
 */
typedef enum {
    /**
     * FU_CFU_OFFER_INFO_CODE_START_ENTIRE_TRANSACTION:
     */
    FU_CFU_OFFER_INFO_CODE_START_ENTIRE_TRANSACTION = 0x00,
    /**
     * FU_CFU_OFFER_INFO_CODE_START_OFFER_LIST:
     */
    FU_CFU_OFFER_INFO_CODE_START_OFFER_LIST = 0x01,
    /**
     * FU_CFU_OFFER_INFO_CODE_END_OFFER_LIST:
     */
    FU_CFU_OFFER_INFO_CODE_END_OFFER_LIST = 0x02,
}  FuCfuOfferInfoCode;
const gchar *fu_cfu_offer_info_code_to_string(FuCfuOfferInfoCode val) G_GNUC_CONST;
/**
 * FuCfuRrCode:
 */
typedef enum {
    /**
     * FU_CFU_RR_CODE_OFFER_REJECT_OLD_FIRMWARE:
     */
    FU_CFU_RR_CODE_OFFER_REJECT_OLD_FIRMWARE = 0x00,
    /**
     * FU_CFU_RR_CODE_OFFER_REJECT_INV_COMPONENT:
     */
    FU_CFU_RR_CODE_OFFER_REJECT_INV_COMPONENT = 0x01,
    /**
     * FU_CFU_RR_CODE_UPDATE_OFFER_SWAP_PENDING:
     */
    FU_CFU_RR_CODE_UPDATE_OFFER_SWAP_PENDING = 0x02,
    /**
     * FU_CFU_RR_CODE_WRONG_BANK:
     */
    FU_CFU_RR_CODE_WRONG_BANK = 0x04,
    /**
     * FU_CFU_RR_CODE_SIGN_RULE:
     */
    FU_CFU_RR_CODE_SIGN_RULE = 0xE0,
    /**
     * FU_CFU_RR_CODE_VER_RELEASE_DEBUG:
     */
    FU_CFU_RR_CODE_VER_RELEASE_DEBUG = 0xE1,
    /**
     * FU_CFU_RR_CODE_DEBUG_SAME_VERSION:
     */
    FU_CFU_RR_CODE_DEBUG_SAME_VERSION = 0xE2,
    /**
     * FU_CFU_RR_CODE_NONE:
     */
    FU_CFU_RR_CODE_NONE = 0xFF,
}  FuCfuRrCode;
const gchar *fu_cfu_rr_code_to_string(FuCfuRrCode val) G_GNUC_CONST;
/**
 * FuCfuOfferStatus:
 */
typedef enum {
    /**
     * FU_CFU_OFFER_STATUS_SKIP:
     */
    FU_CFU_OFFER_STATUS_SKIP = 0x00,
    /**
     * FU_CFU_OFFER_STATUS_ACCEPT:
     */
    FU_CFU_OFFER_STATUS_ACCEPT = 0x01,
    /**
     * FU_CFU_OFFER_STATUS_REJECT:
     */
    FU_CFU_OFFER_STATUS_REJECT = 0x02,
    /**
     * FU_CFU_OFFER_STATUS_BUSY:
     */
    FU_CFU_OFFER_STATUS_BUSY = 0x03,
    /**
     * FU_CFU_OFFER_STATUS_COMMAND:
     */
    FU_CFU_OFFER_STATUS_COMMAND = 0x04,
    /**
     * FU_CFU_OFFER_STATUS_CMD_NOT_SUPPORTED:
     */
    FU_CFU_OFFER_STATUS_CMD_NOT_SUPPORTED = 0xFF,
}  FuCfuOfferStatus;
const gchar *fu_cfu_offer_status_to_string(FuCfuOfferStatus val) G_GNUC_CONST;
/**
 * FuCfuContentFlags:
 */
typedef enum {
    /**
     * FU_CFU_CONTENT_FLAG_VERIFY:
     */
    FU_CFU_CONTENT_FLAG_VERIFY = 0x08,
    /**
     * FU_CFU_CONTENT_FLAG_TEST_REPLACE_FILESYSTEM:
     */
    FU_CFU_CONTENT_FLAG_TEST_REPLACE_FILESYSTEM = 0x20,
    /**
     * FU_CFU_CONTENT_FLAG_LAST_BLOCK:
     */
    FU_CFU_CONTENT_FLAG_LAST_BLOCK = 0x40,
    /**
     * FU_CFU_CONTENT_FLAG_FIRST_BLOCK:
     */
    FU_CFU_CONTENT_FLAG_FIRST_BLOCK = 0x80,
}  FuCfuContentFlags;
/**
 * FuCfuContentStatus:
 */
typedef enum {
    /**
     * FU_CFU_CONTENT_STATUS_SUCCESS:
     */
    FU_CFU_CONTENT_STATUS_SUCCESS = 0x00,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_PREPARE:
     */
    FU_CFU_CONTENT_STATUS_ERROR_PREPARE = 0x01,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_WRITE:
     */
    FU_CFU_CONTENT_STATUS_ERROR_WRITE = 0x02,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_COMPLETE:
     */
    FU_CFU_CONTENT_STATUS_ERROR_COMPLETE = 0x03,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_VERIFY:
     */
    FU_CFU_CONTENT_STATUS_ERROR_VERIFY = 0x04,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_CRC:
     */
    FU_CFU_CONTENT_STATUS_ERROR_CRC = 0x05,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_SIGNATURE:
     */
    FU_CFU_CONTENT_STATUS_ERROR_SIGNATURE = 0x06,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_VERSION:
     */
    FU_CFU_CONTENT_STATUS_ERROR_VERSION = 0x07,
    /**
     * FU_CFU_CONTENT_STATUS_SWAP_PENDING:
     */
    FU_CFU_CONTENT_STATUS_SWAP_PENDING = 0x08,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_INVALID_ADDR:
     */
    FU_CFU_CONTENT_STATUS_ERROR_INVALID_ADDR = 0x09,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_NO_OFFER:
     */
    FU_CFU_CONTENT_STATUS_ERROR_NO_OFFER = 0x0A,
    /**
     * FU_CFU_CONTENT_STATUS_ERROR_INVALID:
     */
    FU_CFU_CONTENT_STATUS_ERROR_INVALID = 0x0B,
}  FuCfuContentStatus;
const gchar *fu_cfu_content_status_to_string(FuCfuContentStatus val) G_GNUC_CONST;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCfuGetVersionRsp;

FuStructCfuGetVersionRsp *fu_struct_cfu_get_version_rsp_ref(FuStructCfuGetVersionRsp *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_get_version_rsp_unref(FuStructCfuGetVersionRsp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuGetVersionRsp, fu_struct_cfu_get_version_rsp_unref)
FuStructCfuGetVersionRsp *fu_struct_cfu_get_version_rsp_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCfuGetVersionRsp *fu_struct_cfu_get_version_rsp_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_get_version_rsp_get_component_cnt(const FuStructCfuGetVersionRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_get_version_rsp_get_flags(const FuStructCfuGetVersionRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cfu_get_version_rsp_set_component_cnt(FuStructCfuGetVersionRsp *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_get_version_rsp_set_flags(FuStructCfuGetVersionRsp *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_GET_VERSION_RSP_OFFSET_COMPONENT_CNT 0x0
#define FU_STRUCT_CFU_GET_VERSION_RSP_OFFSET_FLAGS 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_GET_VERSION_RSP_SIZE 0x4
#endif

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

FuStructCfuGetVersionRspComponent *fu_struct_cfu_get_version_rsp_component_ref(FuStructCfuGetVersionRspComponent *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_get_version_rsp_component_unref(FuStructCfuGetVersionRspComponent *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuGetVersionRspComponent, fu_struct_cfu_get_version_rsp_component_unref)
FuStructCfuGetVersionRspComponent *fu_struct_cfu_get_version_rsp_component_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructCfuGetVersionRspComponent *fu_struct_cfu_get_version_rsp_component_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cfu_get_version_rsp_component_get_fw_version(const FuStructCfuGetVersionRspComponent *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_get_version_rsp_component_get_flags(const FuStructCfuGetVersionRspComponent *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_get_version_rsp_component_get_component_id(const FuStructCfuGetVersionRspComponent *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cfu_get_version_rsp_component_set_fw_version(FuStructCfuGetVersionRspComponent *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_get_version_rsp_component_set_flags(FuStructCfuGetVersionRspComponent *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_get_version_rsp_component_set_component_id(FuStructCfuGetVersionRspComponent *st, guint8 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_GET_VERSION_RSP_COMPONENT_OFFSET_FW_VERSION 0x0
#define FU_STRUCT_CFU_GET_VERSION_RSP_COMPONENT_OFFSET_FLAGS 0x4
#define FU_STRUCT_CFU_GET_VERSION_RSP_COMPONENT_OFFSET_COMPONENT_ID 0x5
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_GET_VERSION_RSP_COMPONENT_SIZE 0x8
#endif

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

FuStructCfuOfferInfoReq *fu_struct_cfu_offer_info_req_ref(FuStructCfuOfferInfoReq *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_offer_info_req_unref(FuStructCfuOfferInfoReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuOfferInfoReq, fu_struct_cfu_offer_info_req_unref)
FuStructCfuOfferInfoReq *fu_struct_cfu_offer_info_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cfu_offer_info_req_set_code(FuStructCfuOfferInfoReq *st, FuCfuOfferInfoCode value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_OFFER_INFO_REQ_OFFSET_CODE 0x0
#define FU_STRUCT_CFU_OFFER_INFO_REQ_OFFSET_COMPONENT_ID 0x2
#define FU_STRUCT_CFU_OFFER_INFO_REQ_OFFSET_TOKEN 0x3
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_OFFER_INFO_REQ_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_OFFER_INFO_REQ_DEFAULT_COMPONENT_ID 0xFF
#define FU_STRUCT_CFU_OFFER_INFO_REQ_DEFAULT_TOKEN 0xDE
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructCfuOfferRsp;

FuStructCfuOfferRsp *fu_struct_cfu_offer_rsp_ref(FuStructCfuOfferRsp *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_offer_rsp_unref(FuStructCfuOfferRsp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuOfferRsp, fu_struct_cfu_offer_rsp_unref)
FuStructCfuOfferRsp *fu_struct_cfu_offer_rsp_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_offer_rsp_get_token(const FuStructCfuOfferRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCfuRrCode fu_struct_cfu_offer_rsp_get_rr_code(const FuStructCfuOfferRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCfuOfferStatus fu_struct_cfu_offer_rsp_get_status(const FuStructCfuOfferRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_OFFER_RSP_OFFSET_TOKEN 0x3
#define FU_STRUCT_CFU_OFFER_RSP_OFFSET_RR_CODE 0x8
#define FU_STRUCT_CFU_OFFER_RSP_OFFSET_STATUS 0xC
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_OFFER_RSP_SIZE 0x10
#endif

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

FuStructCfuContentReq *fu_struct_cfu_content_req_ref(FuStructCfuContentReq *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_content_req_unref(FuStructCfuContentReq *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuContentReq, fu_struct_cfu_content_req_unref)
FuStructCfuContentReq *fu_struct_cfu_content_req_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuCfuContentFlags fu_struct_cfu_content_req_get_flags(const FuStructCfuContentReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_cfu_content_req_get_data_length(const FuStructCfuContentReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cfu_content_req_get_seq_number(const FuStructCfuContentReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_cfu_content_req_get_address(const FuStructCfuContentReq *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_cfu_content_req_set_flags(FuStructCfuContentReq *st, FuCfuContentFlags value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_content_req_set_data_length(FuStructCfuContentReq *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_content_req_set_seq_number(FuStructCfuContentReq *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_cfu_content_req_set_address(FuStructCfuContentReq *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_CONTENT_REQ_OFFSET_FLAGS 0x0
#define FU_STRUCT_CFU_CONTENT_REQ_OFFSET_DATA_LENGTH 0x1
#define FU_STRUCT_CFU_CONTENT_REQ_OFFSET_SEQ_NUMBER 0x2
#define FU_STRUCT_CFU_CONTENT_REQ_OFFSET_ADDRESS 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_CONTENT_REQ_SIZE 0x8
#endif

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

FuStructCfuContentRsp *fu_struct_cfu_content_rsp_ref(FuStructCfuContentRsp *st) G_GNUC_NON_NULL(1);
void fu_struct_cfu_content_rsp_unref(FuStructCfuContentRsp *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructCfuContentRsp, fu_struct_cfu_content_rsp_unref)
FuStructCfuContentRsp *fu_struct_cfu_content_rsp_parse(const guint8 *buf, gsize bufsz, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_cfu_content_rsp_get_seq_number(const FuStructCfuContentRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuCfuContentStatus fu_struct_cfu_content_rsp_get_status(const FuStructCfuContentRsp *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_CONTENT_RSP_OFFSET_SEQ_NUMBER 0x0
#define FU_STRUCT_CFU_CONTENT_RSP_OFFSET_STATUS 0x4
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_CFU_CONTENT_RSP_SIZE 0x10
#endif

#ifndef __GI_SCANNER__
#endif
