diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-data.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-data.c')
-rw-r--r-- | epan/dissectors/packet-data.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c index 9aed2767..78ac3d9e 100644 --- a/epan/dissectors/packet-data.c +++ b/epan/dissectors/packet-data.c @@ -23,28 +23,28 @@ void proto_register_data(void); void proto_reg_handoff_data(void); -static int proto_data = -1; +static int proto_data; -static int hf_data_data = -1; -static int hf_data_len = -1; -static int hf_data_md5_hash = -1; -static int hf_data_text = -1; -static int hf_data_uncompressed_data = -1; -static int hf_data_uncompressed_len = -1; +static int hf_data_data; +static int hf_data_len; +static int hf_data_md5_hash; +static int hf_data_text; +static int hf_data_uncompressed_data; +static int hf_data_uncompressed_len; -static gboolean new_pane = FALSE; -static gboolean uncompress_data = FALSE; -static gboolean show_as_text = FALSE; -static gboolean generate_md5_hash = FALSE; +static bool new_pane; +static bool uncompress_data; +static bool show_as_text; +static bool generate_md5_hash; -static gint ett_data = -1; +static int ett_data; static dissector_handle_t data_handle; static int dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - gint bytes; + int bytes; char *display_str; if (tree) { @@ -52,11 +52,11 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (bytes > 0) { tvbuff_t *data_tvb; tvbuff_t *uncompr_tvb = NULL; - gint uncompr_len = 0; + int uncompr_len = 0; proto_item *ti; proto_tree *data_tree; if (new_pane) { - guint8 *real_data = (guint8 *)tvb_memdup(pinfo->pool, tvb, 0, bytes); + uint8_t *real_data = (uint8_t *)tvb_memdup(pinfo->pool, tvb, 0, bytes); data_tvb = tvb_new_child_real_data(tvb,real_data,bytes,bytes); add_new_data_source(pinfo, data_tvb, "Not dissected data bytes"); } else { @@ -71,7 +71,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ proto_tree_add_item(data_tree, hf_data_data, data_tvb, 0, bytes, ENC_NA); if (uncompress_data) { - uncompr_tvb = tvb_child_uncompress(data_tvb, data_tvb, 0, tvb_reported_length(data_tvb)); + uncompr_tvb = tvb_child_uncompress_zlib(data_tvb, data_tvb, 0, tvb_reported_length(data_tvb)); if (uncompr_tvb) { uncompr_len = tvb_reported_length(uncompr_tvb); @@ -97,9 +97,9 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ } if(generate_md5_hash) { - const guint8 *cp; - guint8 digest[HASH_MD5_LENGTH]; - const gchar *digest_string; + const uint8_t *cp; + uint8_t digest[HASH_MD5_LENGTH]; + const char *digest_string; cp = tvb_get_ptr(tvb, 0, bytes); @@ -152,7 +152,7 @@ proto_register_data(void) }, }; - static gint *ett[] = { + static int *ett[] = { &ett_data }; @@ -175,7 +175,7 @@ proto_register_data(void) "Show not dissected data on new Packet Bytes pane", "Show not dissected data on new Packet Bytes pane", &new_pane); -#ifdef HAVE_ZLIB +#if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG) prefs_register_bool_preference(module_data, "uncompress_data", "Try to uncompress zlib compressed data", @@ -201,7 +201,7 @@ proto_register_data(void) } static void -add_foreach_decode_as(const gchar *table_name, const gchar *ui_name _U_, gpointer user_data) +add_foreach_decode_as(const char *table_name, const char *ui_name _U_, void *user_data) { dissector_handle_t handle = (dissector_handle_t) user_data; dissector_table_t dissector_table = find_dissector_table(table_name); @@ -218,7 +218,7 @@ proto_reg_handoff_data(void) ssl_dissector_add(0, data_handle); dtls_dissector_add(0, data_handle); - dissector_all_tables_foreach_table(add_foreach_decode_as, (gpointer)data_handle, NULL); + dissector_all_tables_foreach_table(add_foreach_decode_as, (void *)data_handle, NULL); } /* |