diff options
author | Evan Huus <eapache@gmail.com> | 2021-10-04 13:35:37 -0400 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-10-05 04:42:13 +0000 |
commit | f9ac0f40f715666439fb44b77c7620ba6427d490 (patch) | |
tree | 75e5ec4a0fa3cd293d3f76cfc7025d680a238e24 /epan/dissectors | |
parent | 4661e1ddd973e603f5c0d22d3e18a797ba357d68 (diff) |
to_str: scope decode_bits_in_field
Mostly straightforward. The only complication was
proto_tree_add_split_bits_crumb which needed some manipulation to
guarantee a non-null tree so we could use its memory scope.
This is one of the last non-dissector uses of wmem_packet_scope!
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-gsm_a_dtap.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_gm.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-gsm_a_rr.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-per.c | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c index e230e3ba04..6dfe8175d8 100644 --- a/epan/dissectors/packet-gsm_a_dtap.c +++ b/epan/dissectors/packet-gsm_a_dtap.c @@ -3959,7 +3959,7 @@ de_tp_epc_ellipsoid_point_with_alt(tvbuff_t *tvb, proto_tree *tree, packet_info curr_offset += 3; longitude = tvb_get_ntoh24(tvb, curr_offset); proto_tree_add_int_format(tree, hf_gsm_a_dtap_epc_degrees_longitude, tvb, curr_offset, 3, longitude, - "%s = %s: %d", decode_bits_in_field(curr_offset<<3, 24, longitude, ENC_BIG_ENDIAN), + "%s = %s: %d", decode_bits_in_field(pinfo->pool, curr_offset<<3, 24, longitude, ENC_BIG_ENDIAN), proto_registrar_get_name(hf_gsm_a_dtap_epc_degrees_longitude), longitude-8388608); curr_offset += 3; proto_tree_add_bits_item(tree, hf_gsm_a_dtap_epc_altitude_dir, tvb, curr_offset<<3, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-gsm_a_gm.c b/epan/dissectors/packet-gsm_a_gm.c index 8b4c8f0cdf..5c023b1ad3 100644 --- a/epan/dissectors/packet-gsm_a_gm.c +++ b/epan/dissectors/packet-gsm_a_gm.c @@ -1880,7 +1880,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui /* decode_bits_in_field(gint bit_offset, gint no_of_bits, guint64 value)*/ proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_rf_power_capability, tvb, curr_offset-1-add_octets, 1+add_octets, value, - "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value, ENC_BIG_ENDIAN), str, value); + "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(pinfo->pool, bit_offset, 3, value, ENC_BIG_ENDIAN), str, value); bit_offset += 3; curr_bits_length -= bits_needed; oct <<= bits_needed; @@ -1948,7 +1948,7 @@ de_gmm_ms_radio_acc_cap(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, gui str = "Not specified??"; proto_tree_add_uint_format(tf_tree, hf_gsm_a_gm_rf_power_capability, tvb, curr_offset-1-add_octets, 1+add_octets, value, - "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(bit_offset, 3, value, ENC_BIG_ENDIAN), str, value); + "%s RF Power Capability, GMSK Power Class: %s (%u)", decode_bits_in_field(pinfo->pool, bit_offset, 3, value, ENC_BIG_ENDIAN), str, value); bit_offset += 3; curr_bits_length -= bits_needed; diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c index 745bde8fe8..1e471eb6f9 100644 --- a/epan/dissectors/packet-gsm_a_rr.c +++ b/epan/dissectors/packet-gsm_a_rr.c @@ -1599,7 +1599,7 @@ static void dissect_channel_list_n_range(tvbuff_t *tvb, proto_tree *tree, packet for (i=1; i<=imax; i++) { w[i] = (gint) tvb_get_bits(tvb, bit_offset, wsize, FALSE); proto_tree_add_bytes_format(subtree, hf_gsm_a_rr_w_elements, tvb, bit_offset>>3, ((bit_offset+wsize-1)>>3) - (bit_offset>>3) + 1 , NULL, "%s W(%d): %d", - decode_bits_in_field(bit_offset, wsize, w[i], ENC_BIG_ENDIAN), + decode_bits_in_field(pinfo->pool, bit_offset, wsize, w[i], ENC_BIG_ENDIAN), i, w[i]); bit_offset += wsize; diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index 3a5e2cdbbd..15f05965d7 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -1334,7 +1334,7 @@ DEBUG_ENTRY("dissect_per_constrained_integer"); val = (guint32)tvb_get_bits64(tvb,offset,num_bits,ENC_BIG_ENDIAN); if (display_internal_per_fields){ - str = decode_bits_in_field((offset&0x07),num_bits,val,ENC_BIG_ENDIAN); + str = decode_bits_in_field(actx->pinfo->pool, (offset&0x07),num_bits,val,ENC_BIG_ENDIAN); proto_tree_add_uint(tree, hf_per_internal_min, tvb, val_start,val_length, min); proto_tree_add_uint64(tree, hf_per_internal_range, tvb, val_start, val_length, range); proto_tree_add_uint(tree, hf_per_internal_num_bits, tvb, val_start, val_length, num_bits); @@ -2134,7 +2134,7 @@ static tvbuff_t *dissect_per_bit_string_display(tvbuff_t *tvb, guint32 offset, a value = tvb_get_bits64(out_tvb, 0, length, ENC_BIG_ENDIAN); } proto_item_append_text(actx->created_item, ", %s decimal value %" G_GINT64_MODIFIER "u", - decode_bits_in_field(0, length, value, ENC_BIG_ENDIAN), value); + decode_bits_in_field(actx->pinfo->pool, 0, length, value, ENC_BIG_ENDIAN), value); if (named_bits) { const guint32 named_bits_bytelen = (num_named_bits + 7) / 8; proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_per_named_bits); |