1303167Ssobomax/* 2303167Ssobomax * Copyright (c) 2004-2016 Maxim Sobolev <sobomax@FreeBSD.org> 3303167Ssobomax * All rights reserved. 4303167Ssobomax * 5303167Ssobomax * Redistribution and use in source and binary forms, with or without 6303167Ssobomax * modification, are permitted provided that the following conditions 7303167Ssobomax * are met: 8303167Ssobomax * 1. Redistributions of source code must retain the above copyright 9303167Ssobomax * notice, this list of conditions and the following disclaimer. 10303167Ssobomax * 2. Redistributions in binary form must reproduce the above copyright 11303167Ssobomax * notice, this list of conditions and the following disclaimer in the 12303167Ssobomax * documentation and/or other materials provided with the distribution. 13303167Ssobomax * 14303167Ssobomax * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15303167Ssobomax * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16303167Ssobomax * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17303167Ssobomax * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18303167Ssobomax * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19303167Ssobomax * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20303167Ssobomax * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21303167Ssobomax * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22303167Ssobomax * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23303167Ssobomax * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24303167Ssobomax * SUCH DAMAGE. 25303167Ssobomax * 26303167Ssobomax * $FreeBSD$ 27303167Ssobomax */ 28303167Ssobomax 29303167Ssobomax/* CLOOP format and related constants */ 30303167Ssobomax 31303167Ssobomax/* 32303167Ssobomax * Integer values (block size, number of blocks, offsets) 33303167Ssobomax * are stored in big-endian (network) order on disk. 34303167Ssobomax */ 35303167Ssobomax 36303167Ssobomax#define CLOOP_MAGIC_LEN 128 37303167Ssobomax#define CLOOP_OFS_COMPR 0x0b 38303167Ssobomax#define CLOOP_OFS_VERSN (CLOOP_OFS_COMPR + 1) 39303167Ssobomax 40303167Ssobomax#define CLOOP_MAJVER_2 '2' 41303167Ssobomax#define CLOOP_MAJVER_3 '3' 42303167Ssobomax 43303167Ssobomax#define CLOOP_COMP_LIBZ 'V' 44303167Ssobomax#define CLOOP_COMP_LIBZ_DDP 'v' 45303167Ssobomax#define CLOOP_COMP_LZMA 'L' 46303167Ssobomax#define CLOOP_COMP_LZMA_DDP 'l' 47303167Ssobomax 48303167Ssobomax#define CLOOP_MINVER_LZMA CLOOP_MAJVER_3 49303167Ssobomax#define CLOOP_MINVER_ZLIB CLOOP_MAJVER_2 50303167Ssobomax 51303167Ssobomaxstruct cloop_header { 52303167Ssobomax char magic[CLOOP_MAGIC_LEN]; /* cloop magic */ 53303167Ssobomax uint32_t blksz; /* block size */ 54303167Ssobomax uint32_t nblocks; /* number of blocks */ 55303167Ssobomax}; 56