aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-06-05 10:39:49 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-06-05 09:31:16 +0000
commit896049f68f917759383fea498a94276296522e5b (patch)
tree5eb97d2239a96143fd12453789202561ca5b8cc3
parentecc9b011c5c0a1c5b7b9efdadafe2d41794c4036 (diff)
SYNC: make sync.length_of_packet filter usable
Change-Id: I9f72e589d8bb7f6d0fc2270082d0b5cec1d23049 Reviewed-on: https://code.wireshark.org/review/28033 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-sync.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-sync.c b/epan/dissectors/packet-sync.c
index 82b0f3c125..6e5343e682 100644
--- a/epan/dissectors/packet-sync.c
+++ b/epan/dissectors/packet-sync.c
@@ -182,19 +182,19 @@ dissect_sync(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
for (i = 1; i < packet_nr; i+=2, offset+=3) {
packet_len1 = tvb_get_bits16(tvb, offset*8, 12, ENC_BIG_ENDIAN);
packet_len2 = tvb_get_bits16(tvb, offset*8+12, 12, ENC_BIG_ENDIAN);
- proto_tree_add_string_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, "", "Length of Packet %u : %hu", i, packet_len1);
- proto_tree_add_string_format(sync_tree, hf_sync_length_of_packet, tvb, offset+1, 2, "", "Length of Packet %u : %hu", i+1, packet_len2);
+ proto_tree_add_uint_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, packet_len1, "Length of Packet %u : %hu", i, packet_len1);
+ proto_tree_add_uint_format(sync_tree, hf_sync_length_of_packet, tvb, offset+1, 2, packet_len2, "Length of Packet %u : %hu", i+1, packet_len2);
}
} else {
/* Odd number of packets */
for (i = 1; i < packet_nr; i+=2, offset+=3) {
packet_len1 = tvb_get_bits16(tvb, offset*8, 12, ENC_BIG_ENDIAN);
packet_len2 = tvb_get_bits16(tvb, offset*8+12, 12, ENC_BIG_ENDIAN);
- proto_tree_add_string_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, "", "Length of Packet %u : %hu", i, packet_len1);
- proto_tree_add_string_format(sync_tree, hf_sync_length_of_packet, tvb, offset+1, 2, "", "Length of Packet %u : %hu", i+1, packet_len2);
+ proto_tree_add_uint_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, packet_len1, "Length of Packet %u : %hu", i, packet_len1);
+ proto_tree_add_uint_format(sync_tree, hf_sync_length_of_packet, tvb, offset+1, 2, packet_len2, "Length of Packet %u : %hu", i+1, packet_len2);
}
packet_len1 = tvb_get_bits16(tvb, offset*8, 12, ENC_BIG_ENDIAN);
- proto_tree_add_string_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, "", "Length of Packet %u : %hu", packet_nr, packet_len1);
+ proto_tree_add_uint_format(sync_tree, hf_sync_length_of_packet, tvb, offset, 2, packet_len1, "Length of Packet %u : %hu", packet_nr, packet_len1);
offset++;
proto_tree_add_item(sync_tree, hf_sync_spare4, tvb, offset, 1, ENC_BIG_ENDIAN);
}
@@ -261,7 +261,7 @@ proto_register_sync(void)
},
{ &hf_sync_length_of_packet,
{ "Length of Packet", "sync.length_of_packet",
- FT_STRING, BASE_NONE, NULL, 0x0,
+ FT_UINT16, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
};