diff options
author | Guy Harris <guy@alum.mit.edu> | 2020-04-26 16:33:20 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-04-27 01:53:09 +0000 |
commit | 524baee94fd8fab0ce4ba212ef35f39e81a386c0 (patch) | |
tree | b024d4b5d739ad69a84c6fd6f9ac8d951263ad08 /epan/dissectors/packet-gtp.c | |
parent | 94556ca7a2502f820e2884550b153d06997b9384 (diff) |
Add string encoding values for various BCD encodings, and use them.
Add some ENC_ values for various flavors of packed BCD, and use that
instead of explicitly calling tvb_bcd_dig_to_wmem_packet_str() and
adding the result.
Change-Id: I07511d9d09c9231b610c121cd6ffb3b16fb017a9
Reviewed-on: https://code.wireshark.org/review/36952
Reviewed-by: Guy Harris <gharris@sonic.net>
Diffstat (limited to 'epan/dissectors/packet-gtp.c')
-rw-r--r-- | epan/dissectors/packet-gtp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index d8cc3aae31..ad4f98fccd 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -6806,7 +6806,7 @@ decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre proto_tree *ext_imeisv; proto_item *te; tvbuff_t *next_tvb; - const char *digit_str; + char *digit_str; length = tvb_get_ntohs(tvb, offset + 1); ext_imeisv = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_IMEISV], &te, @@ -6823,8 +6823,7 @@ decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre * set to '1111'. Both IMEI and IMEISV are BCD encoded. */ next_tvb = tvb_new_subset_length(tvb, offset, length); - digit_str = tvb_bcd_dig_to_wmem_packet_str(next_tvb, 0, -1, NULL, FALSE); - proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str); + proto_tree_add_item_ret_display_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, ENC_BCD_DIGITS_0_9, wmem_packet_scope(), &digit_str); proto_item_append_text(te, ": %s", digit_str); return 3 + length; |