iPXE
gzip.h
Go to the documentation of this file.
1#ifndef _IPXE_GZIP_H
2#define _IPXE_GZIP_H
3
4/** @file
5 *
6 * gzip compressed images
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/image.h>
15
16/** gzip header */
18 /** Magic ID */
20 /** Compression method */
22 /** Flags */
24 /** Modification time */
26 /** Extra flags */
28 /** Operating system */
30} __attribute__ (( packed ));
31
32/** Magic ID */
33#define GZIP_MAGIC 0x1f8b
34
35/** Compression method */
36#define GZIP_METHOD_DEFLATE 0x08
37
38/** CRC header is present */
39#define GZIP_FL_HCRC 0x02
40
41/** Extra header is present */
42#define GZIP_FL_EXTRA 0x04
43
44/** File name is present */
45#define GZIP_FL_NAME 0x08
46
47/** File comment is present */
48#define GZIP_FL_COMMENT 0x10
49
50/** gzip extra header */
52 /** Extra header length (excluding this field) */
54} __attribute__ (( packed ));
55
56/** gzip CRC header */
58 /** CRC-16 */
60} __attribute__ (( packed ));
61
62/** gzip footer */
64 /** CRC-32 */
66 /** Uncompressed size (modulo 2^32) */
68} __attribute__ (( packed ));
69
70extern struct image_type gzip_image_type __image_type ( PROBE_NORMAL );
71
72#endif /* _IPXE_GZIP_H */
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
Executable images.
#define PROBE_NORMAL
Normal image probe priority.
Definition image.h:156
#define __image_type(probe_order)
An executable image type.
Definition image.h:170
#define __attribute__(x)
Definition compiler.h:10
gzip CRC header
Definition gzip.h:57
uint16_t crc
CRC-16.
Definition gzip.h:59
gzip extra header
Definition gzip.h:51
uint16_t len
Extra header length (excluding this field)
Definition gzip.h:53
gzip header
Definition gzip.h:17
uint8_t os
Operating system.
Definition gzip.h:29
uint8_t extra
Extra flags.
Definition gzip.h:27
uint16_t magic
Magic ID.
Definition gzip.h:19
uint8_t flags
Flags.
Definition gzip.h:23
uint32_t mtime
Modification time.
Definition gzip.h:25
uint8_t method
Compression method.
Definition gzip.h:21
An executable image type.
Definition image.h:95