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

#pragma once
#include <fu-input-stream.h>
/**
 * FuTpmAlg:
 */
typedef enum {
    /**
     * FU_TPM_ALG_UNKNOWN:
     */
    FU_TPM_ALG_UNKNOWN = 0x0000,
    /**
     * FU_TPM_ALG_SHA1:
     */
    FU_TPM_ALG_SHA1 = 0x0004,
    /**
     * FU_TPM_ALG_SHA256:
     */
    FU_TPM_ALG_SHA256 = 0x000B,
    /**
     * FU_TPM_ALG_SHA384:
     */
    FU_TPM_ALG_SHA384 = 0x000C,
    /**
     * FU_TPM_ALG_SHA512:
     */
    FU_TPM_ALG_SHA512 = 0x000D,
    /**
     * FU_TPM_ALG_SM3_256:
     */
    FU_TPM_ALG_SM3_256 = 0x0012,
    /**
     * FU_TPM_ALG_SHA3_256:
     */
    FU_TPM_ALG_SHA3_256 = 0x0027,
    /**
     * FU_TPM_ALG_SHA3_384:
     */
    FU_TPM_ALG_SHA3_384 = 0x0028,
    /**
     * FU_TPM_ALG_SHA3_512:
     */
    FU_TPM_ALG_SHA3_512 = 0x0029,
}  FuTpmAlg;
const gchar *fu_tpm_alg_to_string(FuTpmAlg val) G_GNUC_CONST;
FuTpmAlg fu_tpm_alg_from_string(const gchar *val) G_GNUC_CONST G_GNUC_NON_NULL(1);
/**
 * FuTpmEventlogItemKind:
 */
typedef enum {
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_PREBOOT_CERT:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_PREBOOT_CERT = 0x00000000,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_POST_CODE:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_POST_CODE = 0x00000001,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_NO_ACTION:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_NO_ACTION = 0x00000003,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_SEPARATOR:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_SEPARATOR = 0x00000004,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_ACTION:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_ACTION = 0x00000005,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EVENT_TAG:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EVENT_TAG = 0x00000006,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_S_CRTM_CONTENTS:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_S_CRTM_CONTENTS = 0x00000007,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_S_CRTM_VERSION:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_S_CRTM_VERSION = 0x00000008,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_CPU_MICROCODE:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_CPU_MICROCODE = 0x00000009,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_PLATFORM_CONFIG_FLAGS:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_PLATFORM_CONFIG_FLAGS = 0x0000000a,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_TABLE_OF_DEVICES:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_TABLE_OF_DEVICES = 0x0000000b,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_COMPACT_HASH:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_COMPACT_HASH = 0x0000000c,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_CODE:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_CODE = 0x0000000f,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_CONFIG:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_CONFIG = 0x00000010,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_INFO:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_NONHOST_INFO = 0x00000011,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_OMIT_BOOT_DEVICE_EVENTS:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_OMIT_BOOT_DEVICE_EVENTS = 0x00000012,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_EVENT_BASE:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_EVENT_BASE = 0x80000000,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_DRIVER_CONFIG:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_DRIVER_CONFIG = 0x80000001,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_BOOT:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_BOOT = 0x80000002,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_BOOT_SERVICES_APPLICATION:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_BOOT_SERVICES_APPLICATION = 0x80000003,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_BOOT_SERVICES_DRIVER:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_BOOT_SERVICES_DRIVER = 0x80000004,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_RUNTIME_SERVICES_DRIVER:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_RUNTIME_SERVICES_DRIVER = 0x80000005,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_GPT_EVENT:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_GPT_EVENT = 0x80000006,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_ACTION:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_ACTION = 0x80000007,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_PLATFORM_FIRMWARE_BLOB:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_PLATFORM_FIRMWARE_BLOB = 0x80000008,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_HANDOFF_TABLES:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_HANDOFF_TABLES = 0x80000009,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_HCRTM_EVENT:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_HCRTM_EVENT = 0x80000010,
    /**
     * FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_AUTHORITY:
     */
    FU_TPM_EVENTLOG_ITEM_KIND_EFI_VARIABLE_AUTHORITY = 0x800000e0,
}  FuTpmEventlogItemKind;
const gchar *fu_tpm_eventlog_item_kind_to_string(FuTpmEventlogItemKind val) G_GNUC_CONST;
FuTpmEventlogItemKind fu_tpm_eventlog_item_kind_from_string(const gchar *val) G_GNUC_CONST G_GNUC_NON_NULL(1);
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructTpmEfiStartupLocalityEvent;

FuStructTpmEfiStartupLocalityEvent *fu_struct_tpm_efi_startup_locality_event_ref(FuStructTpmEfiStartupLocalityEvent *st) G_GNUC_NON_NULL(1);
void fu_struct_tpm_efi_startup_locality_event_unref(FuStructTpmEfiStartupLocalityEvent *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructTpmEfiStartupLocalityEvent, fu_struct_tpm_efi_startup_locality_event_unref)
FuStructTpmEfiStartupLocalityEvent *fu_struct_tpm_efi_startup_locality_event_parse_bytes(GBytes *blob, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint8 fu_struct_tpm_efi_startup_locality_event_get_locality(const FuStructTpmEfiStartupLocalityEvent *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_OFFSET_SIGNATURE 0x0
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_OFFSET_LOCALITY 0x10
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_SIZE_SIGNATURE 0x10
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_N_ELEMENTS_SIGNATURE 16
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_SIZE 0x11
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EFI_STARTUP_LOCALITY_EVENT_DEFAULT_SIGNATURE "StartupLocality"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructTpmEventLog1Item;

FuStructTpmEventLog1Item *fu_struct_tpm_event_log1_item_ref(FuStructTpmEventLog1Item *st) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log1_item_unref(FuStructTpmEventLog1Item *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructTpmEventLog1Item, fu_struct_tpm_event_log1_item_unref)
FuStructTpmEventLog1Item *fu_struct_tpm_event_log1_item_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructTpmEventLog1Item *fu_struct_tpm_event_log1_item_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_tpm_event_log1_item_get_pcr(const FuStructTpmEventLog1Item *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuTpmEventlogItemKind fu_struct_tpm_event_log1_item_get_type(const FuStructTpmEventLog1Item *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
const guint8 *fu_struct_tpm_event_log1_item_get_digest(const FuStructTpmEventLog1Item *st, gsize *bufsz) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_tpm_event_log1_item_get_datasz(const FuStructTpmEventLog1Item *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_tpm_event_log1_item_set_pcr(FuStructTpmEventLog1Item *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log1_item_set_type(FuStructTpmEventLog1Item *st, FuTpmEventlogItemKind value) G_GNUC_NON_NULL(1);
gboolean fu_struct_tpm_event_log1_item_set_digest(FuStructTpmEventLog1Item *st, const guint8 *buf, gsize bufsz, GError **error) G_GNUC_NON_NULL(1, 2) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_tpm_event_log1_item_set_datasz(FuStructTpmEventLog1Item *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_OFFSET_PCR 0x0
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_OFFSET_TYPE 0x4
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_OFFSET_DIGEST 0x8
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_OFFSET_DATASZ 0x1C
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_SIZE_DIGEST 0x14
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_N_ELEMENTS_DIGEST 20
#define FU_STRUCT_TPM_EVENT_LOG1_ITEM_SIZE 0x20
#endif

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

FuStructTpmEventLog2Hdr *fu_struct_tpm_event_log2_hdr_ref(FuStructTpmEventLog2Hdr *st) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log2_hdr_unref(FuStructTpmEventLog2Hdr *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructTpmEventLog2Hdr, fu_struct_tpm_event_log2_hdr_unref)
FuStructTpmEventLog2Hdr *fu_struct_tpm_event_log2_hdr_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructTpmEventLog2Hdr *fu_struct_tpm_event_log2_hdr_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_tpm_event_log2_hdr_get_datasz(const FuStructTpmEventLog2Hdr *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_tpm_event_log2_hdr_set_datasz(FuStructTpmEventLog2Hdr *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_OFFSET_PCR 0x0
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_OFFSET_TYPE 0x4
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_OFFSET_DATASZ 0x1C
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_OFFSET_DATA 0x20
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_SIZE_DATA 0xF
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_N_ELEMENTS_DATA 15
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_SIZE 0x2F
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_DEFAULT_PCR 0x0
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_DEFAULT_TYPE FU_TPM_EVENTLOG_ITEM_KIND_NO_ACTION
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_DEFAULT_DATASZ 15
#define FU_STRUCT_TPM_EVENT_LOG2_HDR_DEFAULT_DATA "Spec ID Event03"
#endif
typedef struct {
  GByteArray *buf;
  guint refcount;
} FuStructTpmEventLog2;

FuStructTpmEventLog2 *fu_struct_tpm_event_log2_ref(FuStructTpmEventLog2 *st) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log2_unref(FuStructTpmEventLog2 *st) G_GNUC_NON_NULL(1);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(FuStructTpmEventLog2, fu_struct_tpm_event_log2_unref)
FuStructTpmEventLog2 *fu_struct_tpm_event_log2_new(void) G_GNUC_WARN_UNUSED_RESULT;
FuStructTpmEventLog2 *fu_struct_tpm_event_log2_parse_stream(GInputStream *stream, gsize offset, GError **error) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_tpm_event_log2_get_pcr(const FuStructTpmEventLog2 *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
FuTpmEventlogItemKind fu_struct_tpm_event_log2_get_type(const FuStructTpmEventLog2 *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
guint32 fu_struct_tpm_event_log2_get_digest_count(const FuStructTpmEventLog2 *st) G_GNUC_NON_NULL(1) G_GNUC_WARN_UNUSED_RESULT;
void fu_struct_tpm_event_log2_set_pcr(FuStructTpmEventLog2 *st, guint32 value) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log2_set_type(FuStructTpmEventLog2 *st, FuTpmEventlogItemKind value) G_GNUC_NON_NULL(1);
void fu_struct_tpm_event_log2_set_digest_count(FuStructTpmEventLog2 *st, guint32 value) G_GNUC_NON_NULL(1);

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG2_OFFSET_PCR 0x0
#define FU_STRUCT_TPM_EVENT_LOG2_OFFSET_TYPE 0x4
#define FU_STRUCT_TPM_EVENT_LOG2_OFFSET_DIGEST_COUNT 0x8
#endif

#ifndef __GI_SCANNER__
#define FU_STRUCT_TPM_EVENT_LOG2_SIZE 0xC
#endif

#ifndef __GI_SCANNER__
#endif
