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

#pragma once
#include <fu-input-stream.h>
/**
 * FuOpromMachineType:
 */
typedef enum {
    /**
     * FU_OPROM_MACHINE_TYPE_X64:
     */
    FU_OPROM_MACHINE_TYPE_X64,
}  FuOpromMachineType;
#define FU_OPROM_MACHINE_TYPE_LAST 1
/**
 * FuOpromSubsystem:
 */
typedef enum {
    /**
     * FU_OPROM_SUBSYSTEM_EFI_BOOT_SRV_DRV:
     */
    FU_OPROM_SUBSYSTEM_EFI_BOOT_SRV_DRV,
}  FuOpromSubsystem;
#define FU_OPROM_SUBSYSTEM_LAST 1
/**
 * FuOpromCompressionType:
 */
typedef enum {
    /**
     * FU_OPROM_COMPRESSION_TYPE_NONE:
     */
    FU_OPROM_COMPRESSION_TYPE_NONE,
}  FuOpromCompressionType;
#define FU_OPROM_COMPRESSION_TYPE_LAST 1
/**
 * FuOpromIndicatorFlags:
 */
typedef enum {
    /**
     * FU_OPROM_INDICATOR_FLAG_NONE:
     */
    FU_OPROM_INDICATOR_FLAG_NONE,
    /**
     * FU_OPROM_INDICATOR_FLAG_LAST:
     */
    FU_OPROM_INDICATOR_FLAG_LAST = 0x80,
}  FuOpromIndicatorFlags;
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructOprom;

FuStructOprom *fu_struct_oprom_ref(FuStructOprom *st) G_GNUC_NON_NULL(1);
void fu_struct_oprom_unref(FuStructOprom *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructOprom, fu_struct_oprom_unref)
FuStructOprom *fu_struct_oprom_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructOprom *fu_struct_oprom_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
gboolean fu_struct_oprom_validate_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_get_image_size(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_oprom_get_init_func_entry_point(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuOpromSubsystem fu_struct_oprom_get_subsystem(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuOpromMachineType fu_struct_oprom_get_machine_type(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuOpromCompressionType fu_struct_oprom_get_compression_type(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_get_efi_image_offset(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_get_pci_header_offset(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_get_expansion_header_offset(const FuStructOprom *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_oprom_set_image_size(FuStructOprom *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_init_func_entry_point(FuStructOprom *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_subsystem(FuStructOprom *st, FuOpromSubsystem value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_machine_type(FuStructOprom *st, FuOpromMachineType value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_compression_type(FuStructOprom *st, FuOpromCompressionType value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_efi_image_offset(FuStructOprom *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_pci_header_offset(FuStructOprom *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_set_expansion_header_offset(FuStructOprom *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_OPROM_OFFSET_IMAGE_SIZE 0x2
#define FU_STRUCT_OPROM_OFFSET_INIT_FUNC_ENTRY_POINT 0x4
#define FU_STRUCT_OPROM_OFFSET_SUBSYSTEM 0x8
#define FU_STRUCT_OPROM_OFFSET_MACHINE_TYPE 0xA
#define FU_STRUCT_OPROM_OFFSET_COMPRESSION_TYPE 0xC
#define FU_STRUCT_OPROM_OFFSET_EFI_IMAGE_OFFSET 0x16
#define FU_STRUCT_OPROM_OFFSET_PCI_HEADER_OFFSET 0x18
#define FU_STRUCT_OPROM_OFFSET_EXPANSION_HEADER_OFFSET 0x1A
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_SIZE 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_DEFAULT_SIGNATURE 0xAA55
#define FU_STRUCT_OPROM_DEFAULT_PCI_HEADER_OFFSET 28
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructOpromPci;

FuStructOpromPci *fu_struct_oprom_pci_ref(FuStructOpromPci *st) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_unref(FuStructOpromPci *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructOpromPci, fu_struct_oprom_pci_unref)
FuStructOpromPci *fu_struct_oprom_pci_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructOpromPci *fu_struct_oprom_pci_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_vendor_id(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_device_id(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_device_list_pointer(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_structure_length(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_oprom_pci_get_structure_revision(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_oprom_pci_get_class_code(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_image_length(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_image_revision(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_oprom_pci_get_code_type(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuOpromIndicatorFlags fu_struct_oprom_pci_get_indicator(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_max_runtime_image_length(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_conf_util_code_header_pointer(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint16 fu_struct_oprom_pci_get_dmtf_clp_entry_point_pointer(const FuStructOpromPci *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_oprom_pci_set_vendor_id(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_device_id(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_device_list_pointer(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_structure_length(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_structure_revision(FuStructOpromPci *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_class_code(FuStructOpromPci *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_image_length(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_image_revision(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_code_type(FuStructOpromPci *st, guint8 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_indicator(FuStructOpromPci *st, FuOpromIndicatorFlags value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_max_runtime_image_length(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_conf_util_code_header_pointer(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);
void fu_struct_oprom_pci_set_dmtf_clp_entry_point_pointer(FuStructOpromPci *st, guint16 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_PCI_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_OPROM_PCI_OFFSET_VENDOR_ID 0x4
#define FU_STRUCT_OPROM_PCI_OFFSET_DEVICE_ID 0x6
#define FU_STRUCT_OPROM_PCI_OFFSET_DEVICE_LIST_POINTER 0x8
#define FU_STRUCT_OPROM_PCI_OFFSET_STRUCTURE_LENGTH 0xA
#define FU_STRUCT_OPROM_PCI_OFFSET_STRUCTURE_REVISION 0xC
#define FU_STRUCT_OPROM_PCI_OFFSET_CLASS_CODE 0xD
#define FU_STRUCT_OPROM_PCI_OFFSET_IMAGE_LENGTH 0x10
#define FU_STRUCT_OPROM_PCI_OFFSET_IMAGE_REVISION 0x12
#define FU_STRUCT_OPROM_PCI_OFFSET_CODE_TYPE 0x14
#define FU_STRUCT_OPROM_PCI_OFFSET_INDICATOR 0x15
#define FU_STRUCT_OPROM_PCI_OFFSET_MAX_RUNTIME_IMAGE_LENGTH 0x16
#define FU_STRUCT_OPROM_PCI_OFFSET_CONF_UTIL_CODE_HEADER_POINTER 0x18
#define FU_STRUCT_OPROM_PCI_OFFSET_DMTF_CLP_ENTRY_POINT_POINTER 0x1A
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_PCI_SIZE 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_OPROM_PCI_DEFAULT_SIGNATURE 0x52494350
#endif
