/* Copyright 2011 Fredrik Wikstrom. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
**    notice, this list of conditions and the following disclaimer.
**
** 2. Redistributions in binary form must reproduce the above copyright
**    notice, this list of conditions and the following disclaimer in the
**    documentation and/or other materials provided with the distribution.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
** POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef VDI_FORMAT_H
#define VDI_FORMAT_H

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#pragma pack(1)

typedef struct {
	TEXT signature[64];
	uint32 sig32;
	uint32 ver32;
	uint32 hdr_size;
	uint32 img_type;
	uint32 img_flags;
	TEXT description[256];
	uint32 offset_blocks;
	uint32 offset_data;
	uint32 cylinders;
	uint32 heads;
	uint32 sectors;
	uint32 sector_size;
	uint32 unused1;
	uint64 disk_size;
	uint32 block_size;
	uint32 block_extra_data;
	uint32 blocks_in_hdd;
	uint32 blocks_allocated;
	uint8 uuid_this_vdi[16];
	uint8 uuid_last_snap[16];
	uint8 uuid_link[16];
	uint8 uuid_parent[16];
	uint8 unused2[56];
} vdi_header_t;

#define VDI_MAGIC       0xBEDA107F
#define VDI_VERSION_1_1 0x00010001
#define DYNAMIC_VDI     0x00000001
#define FIXED_VDI       0x00000002

#pragma pack()

#endif
