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 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <stdint.h>
13 #include <ipxe/image.h>
14 
15 /** gzip header */
16 struct gzip_header {
17  /** Magic ID */
19  /** Compression method */
21  /** Flags */
23  /** Modification time */
25  /** Extra flags */
27  /** Operating system */
29 } __attribute__ (( packed ));
30 
31 /** Magic ID */
32 #define GZIP_MAGIC 0x1f8b
33 
34 /** Compression method */
35 #define GZIP_METHOD_DEFLATE 0x08
36 
37 /** CRC header is present */
38 #define GZIP_FL_HCRC 0x02
39 
40 /** Extra header is present */
41 #define GZIP_FL_EXTRA 0x04
42 
43 /** File name is present */
44 #define GZIP_FL_NAME 0x08
45 
46 /** File comment is present */
47 #define GZIP_FL_COMMENT 0x10
48 
49 /** gzip extra header */
51  /** Extra header length (excluding this field) */
53 } __attribute__ (( packed ));
54 
55 /** gzip CRC header */
57  /** CRC-16 */
59 } __attribute__ (( packed ));
60 
61 /** gzip footer */
62 struct gzip_footer {
63  /** CRC-32 */
65  /** Uncompressed size (modulo 2^32) */
67 } __attribute__ (( packed ));
68 
69 extern struct image_type gzip_image_type __image_type ( PROBE_NORMAL );
70 
71 #endif /* _IPXE_GZIP_H */
#define __attribute__(x)
Definition: compiler.h:10
unsigned short uint16_t
Definition: stdint.h:11
uint16_t crc
CRC-16.
Definition: gzip.h:58
uint8_t method
Compression method.
Definition: gzip.h:20
gzip extra header
Definition: gzip.h:50
uint8_t flags
Flags.
Definition: gzip.h:22
uint32_t mtime
Modification time.
Definition: gzip.h:24
uint16_t len
Extra header length (excluding this field)
Definition: gzip.h:52
An executable image type.
Definition: image.h:76
#define PROBE_NORMAL
Normal image probe priority.
Definition: image.h:137
struct image_type gzip_image_type __image_type(PROBE_NORMAL)
gzip header
Definition: gzip.h:16
uint16_t magic
Magic ID.
Definition: gzip.h:18
uint8_t extra
Extra flags.
Definition: gzip.h:26
gzip CRC header
Definition: gzip.h:56
Executable images.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned char uint8_t
Definition: stdint.h:10
unsigned int uint32_t
Definition: stdint.h:12
uint8_t os
Operating system.
Definition: gzip.h:28