forked from osmocom/wireshark
Rename "libz" to "zlib"
Change-Id: I12f92c983d587c2a4751428cdf299635090c9f0b Reviewed-on: https://code.wireshark.org/review/14748 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
e005bc819c
commit
6f98a0fac3
|
@ -900,9 +900,9 @@ endif()
|
||||||
if(GTK2_FOUND OR GTK3_FOUND)
|
if(GTK2_FOUND OR GTK3_FOUND)
|
||||||
set(GTK_FOUND ON)
|
set(GTK_FOUND ON)
|
||||||
endif()
|
endif()
|
||||||
# That's the name autofoo uses
|
|
||||||
if(HAVE_LIBZLIB)
|
if(HAVE_LIBZLIB)
|
||||||
set(HAVE_LIBZ 1)
|
set(HAVE_ZLIB 1)
|
||||||
# Always include the "true" zlib includes first. This works around a
|
# Always include the "true" zlib includes first. This works around a
|
||||||
# bug in the Windows setup of GTK[23] which has a faulty zconf.h.
|
# bug in the Windows setup of GTK[23] which has a faulty zconf.h.
|
||||||
include_directories(BEFORE ${ZLIB_INCLUDE_DIRS})
|
include_directories(BEFORE ${ZLIB_INCLUDE_DIRS})
|
||||||
|
|
|
@ -458,7 +458,7 @@ config.h : config.h.win32 config.nmake
|
||||||
-e "s/@VERSION_FLAVOR@/$(VERSION_FLAVOR)/" \
|
-e "s/@VERSION_FLAVOR@/$(VERSION_FLAVOR)/" \
|
||||||
-e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
|
-e "s/@HAVE_C_ARES@/$(C_ARES_CONFIG)/" \
|
||||||
-e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
|
-e "s/@HAVE_KFW@/$(KFW_CONFIG)/" \
|
||||||
-e "s/@HAVE_LIBZ@/$(ZLIB_CONFIG)/" \
|
-e "s/@HAVE_ZLIB@/$(ZLIB_CONFIG)/" \
|
||||||
-e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
|
-e "s/@HAVE_LIBPCAP@/$(WINPCAP_CONFIG)/" \
|
||||||
-e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
|
-e "s/@HAVE_PCAP_FINDALLDEVS@/$(PCAP_FINDALLDEVS_CONFIG)/" \
|
||||||
-e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
|
-e "s/@HAVE_PCAP_DATALINK_NAME_TO_VAL@/$(PCAP_DATALINK_NAME_TO_VAL_CONFIG)/" \
|
||||||
|
|
|
@ -507,7 +507,7 @@ AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
|
||||||
AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, $zlib_dir/lib)
|
AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, $zlib_dir/lib)
|
||||||
fi
|
fi
|
||||||
LIBS="-lz $LIBS"
|
LIBS="-lz $LIBS"
|
||||||
AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
|
AC_DEFINE(HAVE_ZLIB, 1, [Define to use zlib library])
|
||||||
#
|
#
|
||||||
# Check for "inflatePrime()" in zlib, which we need
|
# Check for "inflatePrime()" in zlib, which we need
|
||||||
# in order to read compressed capture files.
|
# in order to read compressed capture files.
|
||||||
|
|
|
@ -157,8 +157,8 @@
|
||||||
/* Define to 1 if you have the `smi' library (-lsmi). */
|
/* Define to 1 if you have the `smi' library (-lsmi). */
|
||||||
#cmakedefine HAVE_LIBSMI 1
|
#cmakedefine HAVE_LIBSMI 1
|
||||||
|
|
||||||
/* Define to use libz library */
|
/* Define to use zlib library */
|
||||||
#cmakedefine HAVE_LIBZ 1
|
#cmakedefine HAVE_ZLIB 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <linux/sockios.h> header file. */
|
/* Define to 1 if you have the <linux/sockios.h> header file. */
|
||||||
#cmakedefine HAVE_LINUX_SOCKIOS_H 1
|
#cmakedefine HAVE_LINUX_SOCKIOS_H 1
|
||||||
|
|
|
@ -157,8 +157,8 @@
|
||||||
/* #define INTTYPES_H_DEFINES_FORMATS */
|
/* #define INTTYPES_H_DEFINES_FORMATS */
|
||||||
|
|
||||||
/* Define if you have the z library (-lz). */
|
/* Define if you have the z library (-lz). */
|
||||||
@HAVE_LIBZ@
|
@HAVE_ZLIB@
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#define HAVE_INFLATEPRIME 1
|
#define HAVE_INFLATEPRIME 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1599,7 +1599,7 @@ ZLIB_CFLAGS=/I$(ZLIB_DIR)
|
||||||
ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib
|
ZLIB_LIBS=$(ZLIB_DIR)\lib\zdll.lib
|
||||||
ZLIB_DLL=$(ZLIB_DIR)\zlib1.dll
|
ZLIB_DLL=$(ZLIB_DIR)\zlib1.dll
|
||||||
# Nmake uses carets to escape special characters
|
# Nmake uses carets to escape special characters
|
||||||
ZLIB_CONFIG=^#define HAVE_LIBZ 1
|
ZLIB_CONFIG=^#define HAVE_ZLIB 1
|
||||||
!else
|
!else
|
||||||
ZLIB_CFLAGS=
|
ZLIB_CFLAGS=
|
||||||
ZLIB_LIBS=
|
ZLIB_LIBS=
|
||||||
|
|
|
@ -1447,7 +1447,7 @@ dissect_gadu_gadu_userlist_xml_compressed(tvbuff_t *tvb, packet_info *pinfo, pro
|
||||||
/* XXX add DTD (pinfo->match_string) */
|
/* XXX add DTD (pinfo->match_string) */
|
||||||
call_dissector_only(xml_handle, uncomp_tvb, pinfo, tree, NULL);
|
call_dissector_only(xml_handle, uncomp_tvb, pinfo, tree, NULL);
|
||||||
} else
|
} else
|
||||||
proto_tree_add_bytes_format_value(tree, hfi_gadu_gadu_userlist.id, tvb, offset, remain, NULL, "[Error: Decompression failed] (or no libz)");
|
proto_tree_add_bytes_format_value(tree, hfi_gadu_gadu_userlist.id, tvb, offset, remain, NULL, "[Error: Decompression failed] (or no zlib)");
|
||||||
|
|
||||||
offset += remain;
|
offset += remain;
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ static gboolean http_dechunk_body = TRUE;
|
||||||
/*
|
/*
|
||||||
* Decompression of zlib encoded entities.
|
* Decompression of zlib encoded entities.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static gboolean http_decompress_body = TRUE;
|
static gboolean http_decompress_body = TRUE;
|
||||||
#else
|
#else
|
||||||
static gboolean http_decompress_body = FALSE;
|
static gboolean http_decompress_body = FALSE;
|
||||||
|
@ -3456,7 +3456,7 @@ proto_register_http(void)
|
||||||
"Whether to reassemble bodies of entities that are transferred "
|
"Whether to reassemble bodies of entities that are transferred "
|
||||||
"using the \"Transfer-Encoding: chunked\" method",
|
"using the \"Transfer-Encoding: chunked\" method",
|
||||||
&http_dechunk_body);
|
&http_dechunk_body);
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
prefs_register_bool_preference(http_module, "decompress_body",
|
prefs_register_bool_preference(http_module, "decompress_body",
|
||||||
"Uncompress entity bodies",
|
"Uncompress entity bodies",
|
||||||
"Whether to uncompress entity bodies that are compressed "
|
"Whether to uncompress entity bodies that are compressed "
|
||||||
|
|
|
@ -685,7 +685,7 @@ dissect_ldss_transfer (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
|
||||||
? "Gzip compressed data: %d bytes"
|
? "Gzip compressed data: %d bytes"
|
||||||
: "File data: %d bytes",
|
: "File data: %d bytes",
|
||||||
tvb_captured_length(tvb));
|
tvb_captured_length(tvb));
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* Be nice and uncompress the file data. */
|
/* Be nice and uncompress the file data. */
|
||||||
if (compression == COMPRESSION_GZIP) {
|
if (compression == COMPRESSION_GZIP) {
|
||||||
tvbuff_t *uncomp_tvb;
|
tvbuff_t *uncomp_tvb;
|
||||||
|
|
|
@ -121,7 +121,7 @@ static expert_field ei_slsk_zlib_decompression_failed = EI_INIT;
|
||||||
|
|
||||||
/* desegmentation of SoulSeek Message over TCP */
|
/* desegmentation of SoulSeek Message over TCP */
|
||||||
static gboolean slsk_desegment = TRUE;
|
static gboolean slsk_desegment = TRUE;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static gboolean slsk_decompress = TRUE;
|
static gboolean slsk_decompress = TRUE;
|
||||||
#else
|
#else
|
||||||
static gboolean slsk_decompress = FALSE;
|
static gboolean slsk_decompress = FALSE;
|
||||||
|
@ -2616,7 +2616,7 @@ proto_register_slsk(void)
|
||||||
"Whether the SoulSeek dissector should reassemble messages spanning multiple TCP segments."
|
"Whether the SoulSeek dissector should reassemble messages spanning multiple TCP segments."
|
||||||
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
" To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.",
|
||||||
&slsk_desegment);
|
&slsk_desegment);
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
prefs_register_bool_preference(slsk_module, "decompress",
|
prefs_register_bool_preference(slsk_module, "decompress",
|
||||||
"Decompress zlib compressed packets inside SoulSeek messages",
|
"Decompress zlib compressed packets inside SoulSeek messages",
|
||||||
"Whether the SoulSeek dissector should decompress all zlib compressed packets inside messages",
|
"Whether the SoulSeek dissector should decompress all zlib compressed packets inside messages",
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "packet-tcp.h"
|
#include "packet-tcp.h"
|
||||||
#include "packet-ssl.h"
|
#include "packet-ssl.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#define ZLIB_CONST
|
#define ZLIB_CONST
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -58,7 +58,7 @@ void proto_reg_handoff_spdy(void);
|
||||||
* entities and for decompressing request & reply header blocks.
|
* entities and for decompressing request & reply header blocks.
|
||||||
*/
|
*/
|
||||||
typedef struct _spdy_conv_t {
|
typedef struct _spdy_conv_t {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
z_streamp rqst_decompressor;
|
z_streamp rqst_decompressor;
|
||||||
z_streamp rply_decompressor;
|
z_streamp rply_decompressor;
|
||||||
uLong dictionary_id;
|
uLong dictionary_id;
|
||||||
|
@ -248,7 +248,7 @@ static gboolean spdy_assemble_entity_bodies = TRUE;
|
||||||
/*
|
/*
|
||||||
* Decompression of zlib encoded entities.
|
* Decompression of zlib encoded entities.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static gboolean spdy_decompress_body = TRUE;
|
static gboolean spdy_decompress_body = TRUE;
|
||||||
static gboolean spdy_decompress_headers = TRUE;
|
static gboolean spdy_decompress_headers = TRUE;
|
||||||
#else
|
#else
|
||||||
|
@ -437,7 +437,7 @@ static const char spdy_dictionary[] = {
|
||||||
0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e /* - e n q - 0 - */
|
0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e /* - e n q - 0 - */
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* callback function used at the end of file-scope to cleanup zlib's inflate
|
/* callback function used at the end of file-scope to cleanup zlib's inflate
|
||||||
* streams to avoid memory leaks.
|
* streams to avoid memory leaks.
|
||||||
* XXX: can we be more aggressive and call this sooner for finished streams?
|
* XXX: can we be more aggressive and call this sooner for finished streams?
|
||||||
|
@ -467,7 +467,7 @@ spdy_init_protocol(void)
|
||||||
static spdy_conv_t * get_or_create_spdy_conversation_data(packet_info *pinfo) {
|
static spdy_conv_t * get_or_create_spdy_conversation_data(packet_info *pinfo) {
|
||||||
conversation_t *conversation;
|
conversation_t *conversation;
|
||||||
spdy_conv_t *conv_data;
|
spdy_conv_t *conv_data;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
int retcode;
|
int retcode;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -481,7 +481,7 @@ static spdy_conv_t * get_or_create_spdy_conversation_data(packet_info *pinfo) {
|
||||||
|
|
||||||
conv_data->streams = NULL;
|
conv_data->streams = NULL;
|
||||||
if (spdy_decompress_headers) {
|
if (spdy_decompress_headers) {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
conv_data->rqst_decompressor = wmem_new0(wmem_file_scope(), z_stream);
|
conv_data->rqst_decompressor = wmem_new0(wmem_file_scope(), z_stream);
|
||||||
conv_data->rply_decompressor = wmem_new0(wmem_file_scope(), z_stream);
|
conv_data->rply_decompressor = wmem_new0(wmem_file_scope(), z_stream);
|
||||||
retcode = inflateInit(conv_data->rqst_decompressor);
|
retcode = inflateInit(conv_data->rqst_decompressor);
|
||||||
|
@ -942,7 +942,7 @@ body_dissected:
|
||||||
return frame->length;
|
return frame->length;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/*
|
/*
|
||||||
* Performs header decompression.
|
* Performs header decompression.
|
||||||
*
|
*
|
||||||
|
@ -1153,7 +1153,7 @@ static int dissect_spdy_header_payload(
|
||||||
if (header_info == NULL) {
|
if (header_info == NULL) {
|
||||||
guint8 *uncomp_ptr = NULL;
|
guint8 *uncomp_ptr = NULL;
|
||||||
guint uncomp_length = 0;
|
guint uncomp_length = 0;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
z_streamp decomp;
|
z_streamp decomp;
|
||||||
|
|
||||||
/* Get our decompressor. */
|
/* Get our decompressor. */
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ dissect_ImageJPEG(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, const gui
|
||||||
return JPEG_Size + 4;
|
return JPEG_Size + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static void
|
static void
|
||||||
dissect_ImageZLIB_GLZ_stream(tvbuff_t *tvb, proto_tree *ZLIB_GLZ_tree, packet_info *pinfo,
|
dissect_ImageZLIB_GLZ_stream(tvbuff_t *tvb, proto_tree *ZLIB_GLZ_tree, packet_info *pinfo,
|
||||||
guint32 offset, guint32 ZLIB_GLZSize, guint32 ZLIB_uncompSize)
|
guint32 offset, guint32 ZLIB_GLZSize, guint32 ZLIB_uncompSize)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#define ZLIB_CONST
|
#define ZLIB_CONST
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -1233,7 +1233,7 @@ static const ssl_alpn_protocol_t ssl_alpn_protocols[] = {
|
||||||
*/
|
*/
|
||||||
struct _SslDecompress {
|
struct _SslDecompress {
|
||||||
gint compression;
|
gint compression;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
z_stream istream;
|
z_stream istream;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -2613,7 +2613,7 @@ ssl_decrypt_record(SslDecryptSession*ssl, SslDecoder* decoder, gint ct,
|
||||||
|
|
||||||
#ifdef HAVE_LIBGCRYPT
|
#ifdef HAVE_LIBGCRYPT
|
||||||
/* Record Decompression (after decryption) {{{ */
|
/* Record Decompression (after decryption) {{{ */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* memory allocation functions for zlib initialization */
|
/* memory allocation functions for zlib initialization */
|
||||||
static void* ssl_zalloc(void* opaque _U_, unsigned int no, unsigned int size)
|
static void* ssl_zalloc(void* opaque _U_, unsigned int no, unsigned int size)
|
||||||
{
|
{
|
||||||
|
@ -2629,7 +2629,7 @@ static SslDecompress*
|
||||||
ssl_create_decompressor(gint compression)
|
ssl_create_decompressor(gint compression)
|
||||||
{
|
{
|
||||||
SslDecompress *decomp;
|
SslDecompress *decomp;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
int err;
|
int err;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2638,7 +2638,7 @@ ssl_create_decompressor(gint compression)
|
||||||
decomp = (SslDecompress *)wmem_alloc(wmem_file_scope(), sizeof(SslDecompress));
|
decomp = (SslDecompress *)wmem_alloc(wmem_file_scope(), sizeof(SslDecompress));
|
||||||
decomp->compression = compression;
|
decomp->compression = compression;
|
||||||
switch (decomp->compression) {
|
switch (decomp->compression) {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
case 1: /* DEFLATE */
|
case 1: /* DEFLATE */
|
||||||
decomp->istream.zalloc = ssl_zalloc;
|
decomp->istream.zalloc = ssl_zalloc;
|
||||||
decomp->istream.zfree = ssl_zfree;
|
decomp->istream.zfree = ssl_zfree;
|
||||||
|
@ -2661,7 +2661,7 @@ ssl_create_decompressor(gint compression)
|
||||||
return decomp;
|
return decomp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static int
|
static int
|
||||||
ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, StringInfo* out_str, guint* outl)
|
ssl_decompress_record(SslDecompress* decomp, const guchar* in, guint inl, StringInfo* out_str, guint* outl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2938,7 +2938,7 @@ vnc_h264_encoding(tvbuff_t *tvb, gint *offset, proto_tree *tree)
|
||||||
return 0; /* bytes_needed */
|
return 0; /* bytes_needed */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static guint
|
static guint
|
||||||
vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset,
|
vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo, gint *offset,
|
||||||
proto_tree *tree, const guint16 width, const guint16 height)
|
proto_tree *tree, const guint16 width, const guint16 height)
|
||||||
|
@ -2949,7 +2949,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
guint32 data_len;
|
guint32 data_len;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
guint8 palette_size;
|
guint8 palette_size;
|
||||||
guint8 bytes_per_cpixel = vnc_get_bytes_per_pixel(pinfo);
|
guint8 bytes_per_cpixel = vnc_get_bytes_per_pixel(pinfo);
|
||||||
gint uncomp_offset = 0;
|
gint uncomp_offset = 0;
|
||||||
|
@ -2972,7 +2972,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
|
||||||
proto_tree_add_item(tree, hf_vnc_zrle_data, tvb, *offset,
|
proto_tree_add_item(tree, hf_vnc_zrle_data, tvb, *offset,
|
||||||
data_len, ENC_NA);
|
data_len, ENC_NA);
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
uncomp_tvb = tvb_child_uncompress(tvb, tvb, *offset, data_len);
|
uncomp_tvb = tvb_child_uncompress(tvb, tvb, *offset, data_len);
|
||||||
|
|
||||||
if(uncomp_tvb != NULL) {
|
if(uncomp_tvb != NULL) {
|
||||||
|
@ -3020,7 +3020,7 @@ vnc_zrle_encoding(tvbuff_t *tvb, packet_info *pinfo _U_, gint *offset,
|
||||||
} else {
|
} else {
|
||||||
proto_tree_add_expert(tree, pinfo, &ei_vnc_zrle_failed, tvb, *offset, data_len);
|
proto_tree_add_expert(tree, pinfo, &ei_vnc_zrle_failed, tvb, *offset, data_len);
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_ZLIB */
|
||||||
|
|
||||||
*offset += data_len;
|
*offset += data_len;
|
||||||
|
|
||||||
|
|
|
@ -27,14 +27,14 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#define ZLIB_CONST
|
#define ZLIB_CONST
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "tvbuff.h"
|
#include "tvbuff.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/*
|
/*
|
||||||
* Uncompresses a zlib compressed packet inside a message of tvb at offset with
|
* Uncompresses a zlib compressed packet inside a message of tvb at offset with
|
||||||
* length comprlen. Returns an uncompressed tvbuffer if uncompression
|
* length comprlen. Returns an uncompressed tvbuffer if uncompression
|
||||||
|
|
|
@ -1206,7 +1206,7 @@ WSLUA_METHOD TvbRange_uncompress(lua_State* L) {
|
||||||
/* Obtain an uncompressed TvbRange from a TvbRange */
|
/* Obtain an uncompressed TvbRange from a TvbRange */
|
||||||
#define WSLUA_ARG_TvbRange_uncompress_NAME 2 /* The name to be given to the new data-source. */
|
#define WSLUA_ARG_TvbRange_uncompress_NAME 2 /* The name to be given to the new data-source. */
|
||||||
TvbRange tvbr = checkTvbRange(L,1);
|
TvbRange tvbr = checkTvbRange(L,1);
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
const gchar* name = luaL_optstring(L,WSLUA_ARG_TvbRange_uncompress_NAME,"Uncompressed");
|
const gchar* name = luaL_optstring(L,WSLUA_ARG_TvbRange_uncompress_NAME,"Uncompressed");
|
||||||
tvbuff_t *uncompr_tvb;
|
tvbuff_t *uncompr_tvb;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1218,7 +1218,7 @@ WSLUA_METHOD TvbRange_uncompress(lua_State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
uncompr_tvb = tvb_child_uncompress(tvbr->tvb->ws_tvb, tvbr->tvb->ws_tvb, tvbr->offset, tvbr->len);
|
uncompr_tvb = tvb_child_uncompress(tvbr->tvb->ws_tvb, tvbr->tvb->ws_tvb, tvbr->offset, tvbr->len);
|
||||||
if (uncompr_tvb) {
|
if (uncompr_tvb) {
|
||||||
add_new_data_source (lua_pinfo, uncompr_tvb, name);
|
add_new_data_source (lua_pinfo, uncompr_tvb, name);
|
||||||
|
|
|
@ -2080,7 +2080,7 @@ wtap_dump_can_open(int file_type_subtype)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
gboolean
|
gboolean
|
||||||
wtap_dump_can_compress(int file_type_subtype)
|
wtap_dump_can_compress(int file_type_subtype)
|
||||||
{
|
{
|
||||||
|
@ -2503,7 +2503,7 @@ wtap_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
|
||||||
void
|
void
|
||||||
wtap_dump_flush(wtap_dumper *wdh)
|
wtap_dump_flush(wtap_dumper *wdh)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(wdh->compressed) {
|
if(wdh->compressed) {
|
||||||
gzwfile_flush((GZWFILE_T)wdh->fh);
|
gzwfile_flush((GZWFILE_T)wdh->fh);
|
||||||
} else
|
} else
|
||||||
|
@ -2563,7 +2563,7 @@ wtap_dump_set_addrinfo_list(wtap_dumper *wdh, addrinfo_lists_t *addrinfo_lists)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* internally open a file for writing (compressed or not) */
|
/* internally open a file for writing (compressed or not) */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static WFILE_T
|
static WFILE_T
|
||||||
wtap_dump_file_open(wtap_dumper *wdh, const char *filename)
|
wtap_dump_file_open(wtap_dumper *wdh, const char *filename)
|
||||||
{
|
{
|
||||||
|
@ -2582,7 +2582,7 @@ wtap_dump_file_open(wtap_dumper *wdh _U_, const char *filename)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* internally open a file for writing (compressed or not) */
|
/* internally open a file for writing (compressed or not) */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
static WFILE_T
|
static WFILE_T
|
||||||
wtap_dump_file_fdopen(wtap_dumper *wdh, int fd)
|
wtap_dump_file_fdopen(wtap_dumper *wdh, int fd)
|
||||||
{
|
{
|
||||||
|
@ -2606,7 +2606,7 @@ wtap_dump_file_write(wtap_dumper *wdh, const void *buf, size_t bufsize, int *err
|
||||||
{
|
{
|
||||||
size_t nwritten;
|
size_t nwritten;
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if (wdh->compressed) {
|
if (wdh->compressed) {
|
||||||
nwritten = gzwfile_write((GZWFILE_T)wdh->fh, buf, (unsigned int) bufsize);
|
nwritten = gzwfile_write((GZWFILE_T)wdh->fh, buf, (unsigned int) bufsize);
|
||||||
/*
|
/*
|
||||||
|
@ -2640,7 +2640,7 @@ wtap_dump_file_write(wtap_dumper *wdh, const void *buf, size_t bufsize, int *err
|
||||||
static int
|
static int
|
||||||
wtap_dump_file_close(wtap_dumper *wdh)
|
wtap_dump_file_close(wtap_dumper *wdh)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(wdh->compressed) {
|
if(wdh->compressed) {
|
||||||
/*
|
/*
|
||||||
* Tell gzwfile_close() whether to close the descriptor
|
* Tell gzwfile_close() whether to close the descriptor
|
||||||
|
@ -2664,7 +2664,7 @@ wtap_dump_file_close(wtap_dumper *wdh)
|
||||||
gint64
|
gint64
|
||||||
wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err)
|
wtap_dump_file_seek(wtap_dumper *wdh, gint64 offset, int whence, int *err)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(wdh->compressed) {
|
if(wdh->compressed) {
|
||||||
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
|
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2685,7 +2685,7 @@ gint64
|
||||||
wtap_dump_file_tell(wtap_dumper *wdh, int *err)
|
wtap_dump_file_tell(wtap_dumper *wdh, int *err)
|
||||||
{
|
{
|
||||||
gint64 rval;
|
gint64 rval;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if(wdh->compressed) {
|
if(wdh->compressed) {
|
||||||
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
|
*err = WTAP_ERR_CANT_SEEK_COMPRESSED;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -48,10 +48,10 @@
|
||||||
#include <wsutil/ws_diag_control.h>
|
#include <wsutil/ws_diag_control.h>
|
||||||
#include <wsutil/file_util.h>
|
#include <wsutil/file_util.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#define ZLIB_CONST
|
#define ZLIB_CONST
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_ZLIB */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See RFC 1952 for a description of the gzip file format.
|
* See RFC 1952 for a description of the gzip file format.
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
* compression types.
|
* compression types.
|
||||||
*/
|
*/
|
||||||
const char *compressed_file_extension_table[] = {
|
const char *compressed_file_extension_table[] = {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
"gz",
|
"gz",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
|
@ -83,7 +83,7 @@ const char *compressed_file_extension_table[] = {
|
||||||
typedef enum {
|
typedef enum {
|
||||||
UNKNOWN, /* unknown - look for a gzip header */
|
UNKNOWN, /* unknown - look for a gzip header */
|
||||||
UNCOMPRESSED, /* uncompressed - copy input directly */
|
UNCOMPRESSED, /* uncompressed - copy input directly */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
ZLIB, /* decompress a zlib stream */
|
ZLIB, /* decompress a zlib stream */
|
||||||
GZIP_AFTER_HEADER
|
GZIP_AFTER_HEADER
|
||||||
#endif
|
#endif
|
||||||
|
@ -113,7 +113,7 @@ struct wtap_reader {
|
||||||
|
|
||||||
guint avail_in; /* number of bytes available at next_in */
|
guint avail_in; /* number of bytes available at next_in */
|
||||||
unsigned char *next_in; /* next input byte */
|
unsigned char *next_in; /* next input byte */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* zlib inflate stream */
|
/* zlib inflate stream */
|
||||||
z_stream strm; /* stream structure in-place (not a pointer) */
|
z_stream strm; /* stream structure in-place (not a pointer) */
|
||||||
gboolean dont_check_crc; /* TRUE if we aren't supposed to check the CRC */
|
gboolean dont_check_crc; /* TRUE if we aren't supposed to check the CRC */
|
||||||
|
@ -234,13 +234,13 @@ fast_seek_header(FILE_T file, gint64 in_pos, gint64 out_pos,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fast_seek_reset(
|
fast_seek_reset(
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
FILE_T state)
|
FILE_T state)
|
||||||
#else
|
#else
|
||||||
FILE_T state _U_)
|
FILE_T state _U_)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if (state->compression == ZLIB && state->fast_seek_cur) {
|
if (state->compression == ZLIB && state->fast_seek_cur) {
|
||||||
struct zlib_cur_seek_point *cur = (struct zlib_cur_seek_point *) state->fast_seek_cur;
|
struct zlib_cur_seek_point *cur = (struct zlib_cur_seek_point *) state->fast_seek_cur;
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ fast_seek_reset(
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
|
|
||||||
/* Get next byte from input, or -1 if end or error.
|
/* Get next byte from input, or -1 if end or error.
|
||||||
*
|
*
|
||||||
|
@ -573,7 +573,7 @@ gz_head(FILE_T state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* look for the gzip magic header bytes 31 and 139 */
|
/* look for the gzip magic header bytes 31 and 139 */
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if (state->next_in[0] == 31) {
|
if (state->next_in[0] == 31) {
|
||||||
state->avail_in--;
|
state->avail_in--;
|
||||||
state->next_in++;
|
state->next_in++;
|
||||||
|
@ -706,7 +706,7 @@ fill_out_buffer(FILE_T state)
|
||||||
return -1;
|
return -1;
|
||||||
state->next = state->out;
|
state->next = state->out;
|
||||||
}
|
}
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
else if (state->compression == ZLIB) { /* decompress */
|
else if (state->compression == ZLIB) { /* decompress */
|
||||||
zlib_read(state, state->out, state->size << 1);
|
zlib_read(state, state->out, state->size << 1);
|
||||||
}
|
}
|
||||||
|
@ -825,7 +825,7 @@ file_fdopen(int fd)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* allocate inflate memory */
|
/* allocate inflate memory */
|
||||||
state->strm.zalloc = Z_NULL;
|
state->strm.zalloc = Z_NULL;
|
||||||
state->strm.zfree = Z_NULL;
|
state->strm.zfree = Z_NULL;
|
||||||
|
@ -852,7 +852,7 @@ file_open(const char *path)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
FILE_T ft;
|
FILE_T ft;
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
const char *suffixp;
|
const char *suffixp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ file_open(const char *path)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/*
|
/*
|
||||||
* If this file's name ends in ".caz", it's probably a compressed
|
* If this file's name ends in ".caz", it's probably a compressed
|
||||||
* Windows Sniffer file. The compression is gzip, but if we
|
* Windows Sniffer file. The compression is gzip, but if we
|
||||||
|
@ -991,7 +991,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
|
||||||
* has been called on this file, which should never be the case
|
* has been called on this file, which should never be the case
|
||||||
* for a pipe.
|
* for a pipe.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if (here->compression == ZLIB) {
|
if (here->compression == ZLIB) {
|
||||||
#ifdef HAVE_INFLATEPRIME
|
#ifdef HAVE_INFLATEPRIME
|
||||||
off = here->in - (here->data.zlib.bits ? 1 : 0);
|
off = here->in - (here->data.zlib.bits ? 1 : 0);
|
||||||
|
@ -1023,7 +1023,7 @@ file_seek(FILE_T file, gint64 offset, int whence, int *err)
|
||||||
file->err_info = NULL;
|
file->err_info = NULL;
|
||||||
file->avail_in = 0;
|
file->avail_in = 0;
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
if (here->compression == ZLIB) {
|
if (here->compression == ZLIB) {
|
||||||
z_stream *strm = &file->strm;
|
z_stream *strm = &file->strm;
|
||||||
|
|
||||||
|
@ -1444,7 +1444,7 @@ file_close(FILE_T file)
|
||||||
|
|
||||||
/* free memory and close file */
|
/* free memory and close file */
|
||||||
if (file->size) {
|
if (file->size) {
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
inflateEnd(&(file->strm));
|
inflateEnd(&(file->strm));
|
||||||
#endif
|
#endif
|
||||||
g_free(file->out);
|
g_free(file->out);
|
||||||
|
@ -1463,7 +1463,7 @@ file_close(FILE_T file)
|
||||||
ws_close(fd);
|
ws_close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
/* internal gzip file state data structure for writing */
|
/* internal gzip file state data structure for writing */
|
||||||
struct wtap_writer {
|
struct wtap_writer {
|
||||||
int fd; /* file descriptor */
|
int fd; /* file descriptor */
|
||||||
|
|
|
@ -46,7 +46,7 @@ extern void file_fdclose(FILE_T file);
|
||||||
extern int file_fdreopen(FILE_T file, const char *path);
|
extern int file_fdreopen(FILE_T file, const char *path);
|
||||||
extern void file_close(FILE_T file);
|
extern void file_close(FILE_T file);
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
typedef struct wtap_writer *GZWFILE_T;
|
typedef struct wtap_writer *GZWFILE_T;
|
||||||
|
|
||||||
extern GZWFILE_T gzwfile_open(const char *path);
|
extern GZWFILE_T gzwfile_open(const char *path);
|
||||||
|
@ -55,6 +55,6 @@ extern guint gzwfile_write(GZWFILE_T state, const void *buf, guint len);
|
||||||
extern int gzwfile_flush(GZWFILE_T state);
|
extern int gzwfile_flush(GZWFILE_T state);
|
||||||
extern int gzwfile_close(GZWFILE_T state, gboolean is_stdout);
|
extern int gzwfile_close(GZWFILE_T state, gboolean is_stdout);
|
||||||
extern int gzwfile_geterr(GZWFILE_T state);
|
extern int gzwfile_geterr(GZWFILE_T state);
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_ZLIB */
|
||||||
|
|
||||||
#endif /* __FILE_H__ */
|
#endif /* __FILE_H__ */
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -78,15 +78,15 @@ end_string(GString *str)
|
||||||
static const gchar *
|
static const gchar *
|
||||||
get_zlib_compiled_version_info(void)
|
get_zlib_compiled_version_info(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_ZLIB
|
||||||
#ifdef ZLIB_VERSION
|
#ifdef ZLIB_VERSION
|
||||||
return "with libz "ZLIB_VERSION;
|
return "with zlib "ZLIB_VERSION;
|
||||||
#else
|
#else
|
||||||
return "with libz (version unknown)";
|
return "with zlib (version unknown)";
|
||||||
#endif /* ZLIB_VERSION */
|
#endif /* ZLIB_VERSION */
|
||||||
#else
|
#else
|
||||||
return "without libz";
|
return "without zlib";
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_ZLIB */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -355,8 +355,8 @@ get_runtime_version_info(void (*additional_info)(GString *))
|
||||||
(*additional_info)(str);
|
(*additional_info)(str);
|
||||||
|
|
||||||
/* zlib */
|
/* zlib */
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
#if defined(HAVE_ZLIB) && !defined(_WIN32)
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
g_string_append_printf(str, ", with zlib %s", zlibVersion());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_string_append(str, ".");
|
g_string_append(str, ".");
|
||||||
|
|
Loading…
Reference in New Issue