67 len -=
sizeof ( *footer );
73 data +=
sizeof ( *header );
74 len -=
sizeof ( *header );
79 DBGC (
image,
"GZIP %s overlength extra header\n",
84 data +=
sizeof ( *extra );
85 len -=
sizeof ( *extra );
87 if (
len < extra_len ) {
88 DBGC (
image,
"GZIP %s overlength extra header\n",
102 while ( strings-- ) {
104 if ( string_len ==
len ) {
105 DBGC (
image,
"GZIP %s overlength name/comment\n",
109 data += ( string_len + 1 );
110 len -= ( string_len + 1 );
115 if (
len <
sizeof ( *
crc ) ) {
116 DBGC (
image,
"GZIP %s overlength CRC header\n",
120 data +=
sizeof ( *crc );
121 len -=
sizeof ( *crc );
127 DBGC (
image,
"GZIP %s could not presize: %s\n",
134 extracted ) ) != 0 ) {
135 DBGC (
image,
"GZIP %s could not decompress: %s\n",
#define cpu_to_be16(value)
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
#define le32_to_cpu(value)
#define GZIP_FL_NAME
File name is present.
const void * data
Read-only data.
uint8_t extra
Signature extra byte.
#define ENOEXEC
Exec format error.
#define GZIP_FL_HCRC
CRC header is present.
An executable image type.
#define PROBE_NORMAL
Normal image probe priority.
struct image_type gzip_image_type __image_type(PROBE_NORMAL)
gzip image type
char * name
Name of this image type.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define GZIP_FL_EXTRA
Extra header is present.
static int gzip_probe(struct image *image)
Probe gzip image.
char * strerror(int errno)
Retrieve string representation of error number.
size_t len
Length of raw file image.
#define GZIP_MAGIC
Magic ID.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static int gzip_extract(struct image *image, struct image *extracted)
Extract gzip image.
size_t strnlen(const char *src, size_t max)
Get length of string.
#define le16_to_cpu(value)
int image_set_len(struct image *image, size_t len)
Set image length.
Raw DEFLATE data (no header or footer)
struct ena_llq_option header
Header locations.
uint8_t data[48]
Additional event data.
int zlib_deflate(enum deflate_format format, const void *data, size_t len, struct image *extracted)
Extract compressed data to image.
#define GZIP_FL_COMMENT
File comment is present.
DEFLATE decompression algorithm.
int image_extract_exec(struct image *image)
Extract and execute image.