a16ce57573163b6d8242f46264087905cc00479bvboxsync/** @file
a16ce57573163b6d8242f46264087905cc00479bvboxsync * IPRT - Extensible Archiver (XAR) format.
a16ce57573163b6d8242f46264087905cc00479bvboxsync */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
a16ce57573163b6d8242f46264087905cc00479bvboxsync/*
a16ce57573163b6d8242f46264087905cc00479bvboxsync * Copyright (C) 2013 Oracle Corporation
a16ce57573163b6d8242f46264087905cc00479bvboxsync *
a16ce57573163b6d8242f46264087905cc00479bvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a16ce57573163b6d8242f46264087905cc00479bvboxsync * available from http://www.virtualbox.org. This file is free software;
a16ce57573163b6d8242f46264087905cc00479bvboxsync * you can redistribute it and/or modify it under the terms of the GNU
a16ce57573163b6d8242f46264087905cc00479bvboxsync * General Public License (GPL) as published by the Free Software
a16ce57573163b6d8242f46264087905cc00479bvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a16ce57573163b6d8242f46264087905cc00479bvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a16ce57573163b6d8242f46264087905cc00479bvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a16ce57573163b6d8242f46264087905cc00479bvboxsync *
a16ce57573163b6d8242f46264087905cc00479bvboxsync * The contents of this file may alternatively be used under the terms
a16ce57573163b6d8242f46264087905cc00479bvboxsync * of the Common Development and Distribution License Version 1.0
a16ce57573163b6d8242f46264087905cc00479bvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a16ce57573163b6d8242f46264087905cc00479bvboxsync * VirtualBox OSE distribution, in which case the provisions of the
a16ce57573163b6d8242f46264087905cc00479bvboxsync * CDDL are applicable instead of those of the GPL.
a16ce57573163b6d8242f46264087905cc00479bvboxsync *
a16ce57573163b6d8242f46264087905cc00479bvboxsync * You may elect to license modified versions of this file under the
a16ce57573163b6d8242f46264087905cc00479bvboxsync * terms and conditions of either the GPL or the CDDL or both.
a16ce57573163b6d8242f46264087905cc00479bvboxsync */
a16ce57573163b6d8242f46264087905cc00479bvboxsync
a16ce57573163b6d8242f46264087905cc00479bvboxsync
a16ce57573163b6d8242f46264087905cc00479bvboxsync#ifndef ___iprt_formats_xar_h
a16ce57573163b6d8242f46264087905cc00479bvboxsync#define ___iprt_formats_xar_h
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#pragma pack(4) /* Misdesigned header, not 8-byte aligned size. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsynctypedef struct XARHEADER
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync{
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** The magic number 'xar!' (XAR_HEADER_MAGIC). */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint32_t u32Magic;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** The size of this header structure. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint16_t cbHeader;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** The header version structure. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint16_t uVersion;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** The size of the compressed table of content (TOC). */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint64_t cbTocCompressed;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** The size of the table of context (TOC) when not compressed. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint64_t cbTocUncompressed;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync /** Which cryptographic hash function is used (XAR_HASH_XXX). */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync uint32_t uHashFunction;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync} XARHEADER;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#pragma pack()
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** Pointer to a XAR header. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsynctypedef XARHEADER *PXARHEADER;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** Pointer to a const XAR header. */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsynctypedef XARHEADER const *PCXARHEADER;
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** XAR magic value (on disk endian). */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HEADER_MAGIC RT_H2LE_U32(RT_MAKE_U32_FROM_U8('x', 'a', 'r', '!'))
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** The current header version value (host endian). */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HEADER_VERSION 1
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** @name XAR hashing functions.
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync * @{ */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HASH_NONE 0
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HASH_SHA1 1
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HASH_MD5 2
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync#define XAR_HASH_MAX 2
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync/** @} */
ab65f9ce33765b251219fbf18b19d3e56fdf5d2cvboxsync
a16ce57573163b6d8242f46264087905cc00479bvboxsync
a16ce57573163b6d8242f46264087905cc00479bvboxsync#endif
a16ce57573163b6d8242f46264087905cc00479bvboxsync