summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-gmr1_rr.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-01-01 14:33:19 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2014-01-01 14:33:19 +0000
commit6ebc058f473085a2fa9884fe2fd7f4a9959be915 (patch)
treef514e3d9eadd1c89ad434cc00d5d20fda6168ef1 /epan/dissectors/packet-gmr1_rr.c
parente504cf945bb54c3c73efbaee51acaa968179586a (diff)
downloadwireshark-6ebc058f473085a2fa9884fe2fd7f4a9959be915.tar.gz
Add proto_tree_add_ts_23_038_7bits_item() / tvb_get_ts_23_038_7bits_string() functions and update dissectors to use it.
Remove gsm_sms_char_7bit_unpack() / gsm_sms_chars_to_utf8() functions. Update documentation a bit. svn path=/trunk/; revision=54534
Diffstat (limited to 'epan/dissectors/packet-gmr1_rr.c')
-rw-r--r--epan/dissectors/packet-gmr1_rr.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c
index ce530cc88f..28f110e911 100644
--- a/epan/dissectors/packet-gmr1_rr.c
+++ b/epan/dissectors/packet-gmr1_rr.c
@@ -649,25 +649,29 @@ static const value_string rr_pos_display_flag_vals[] = {
GMR1_IE_FUNC(gmr1_ie_rr_pos_display)
{
const unsigned char *txt_raw;
- unsigned char txt_packed[11], txt_unpacked[12];
- int out_len, i;
+ gchar *txt_packed, *txt_unpacked;
+ tvbuff_t *txt_packed_tvb;
+ int i;
/* Flag */
proto_tree_add_item(tree, hf_rr_pos_display_flag,
tvb, offset, 1, ENC_BIG_ENDIAN);
- /* Unpack text */
+ /* Get text in an aligned tvbuff */
txt_raw = tvb_get_ptr(tvb, offset, 11);
-
+ txt_packed = (gchar*)wmem_alloc(wmem_packet_scope(), 11);
for (i=0; i<10; i++)
txt_packed[i] = (txt_raw[i] << 4) | (txt_raw[i+1] >> 4);
txt_packed[10] = txt_raw[10];
+ txt_packed_tvb = tvb_new_real_data(txt_packed, 11, 11);
- out_len = gsm_sms_char_7bit_unpack(0, 11, 12, txt_packed, txt_unpacked);
+ /* Unpack text */
+ txt_unpacked = tvb_get_ts_23_038_7bits_string(wmem_packet_scope(), txt_packed_tvb, 0, 12);
+ tvb_free(txt_packed_tvb);
/* Display it */
proto_tree_add_string(tree, hf_rr_pos_display_text, tvb, offset, 11,
- gsm_sms_chars_to_utf8(txt_unpacked, out_len));
+ txt_unpacked);
return 11;
}