aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-msdp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-07-30 18:06:14 -0700
committerGuy Harris <guy@alum.mit.edu>2017-07-31 01:06:44 +0000
commit4ad98cc3f53073d5d726619f6bb03e0679ff9bdc (patch)
tree272c756aee377e2ce3812004805d25c952cd2e9c /epan/dissectors/packet-msdp.c
parentfe29cb3bb0b291ef354996b2e32fa3bdb724b152 (diff)
Use proto_tree_add_item_ret_uint().
Change-Id: I006bb0f2cf7e215d24c5eaa6f208cdd6d563d36a Reviewed-on: https://code.wireshark.org/review/22883 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-msdp.c')
-rw-r--r--epan/dissectors/packet-msdp.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/epan/dissectors/packet-msdp.c b/epan/dissectors/packet-msdp.c
index bbd9bf5451..f354d89ebf 100644
--- a/epan/dissectors/packet-msdp.c
+++ b/epan/dissectors/packet-msdp.c
@@ -186,8 +186,8 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree *msdp_tree;
proto_item *length_item;
int offset;
- guint8 type;
- guint16 length;
+ guint32 type;
+ guint32 length;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MSDP");
@@ -201,10 +201,8 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
offset = 0;
while (tvb_reported_length_remaining(tvb, offset) != 0) {
- type = tvb_get_guint8(tvb, offset);
- length = tvb_get_ntohs(tvb, offset + 1);
- proto_tree_add_uint(msdp_tree, hf_msdp_type, tvb, offset, 1, type);
- length_item = proto_tree_add_uint(msdp_tree, hf_msdp_length, tvb, offset + 1, 2, length);
+ proto_tree_add_item_ret_uint(msdp_tree, hf_msdp_type, tvb, offset, 1, ENC_BIG_ENDIAN, &type);
+ length_item = proto_tree_add_item_ret_uint(msdp_tree, hf_msdp_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN, &length);
if (length < 3) {
expert_add_info_format(pinfo, length_item,
&ei_msdp_tlv_len_too_short,
@@ -293,7 +291,7 @@ dissect_msdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
static void dissect_msdp_sa(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree, int *offset, int length, proto_item *length_item)
{
- guint8 entries;
+ guint32 entries;
if (length < 1) {
expert_add_info_format(pinfo, length_item,
@@ -301,8 +299,7 @@ static void dissect_msdp_sa(tvbuff_t *tvb, packet_info *pinfo,
"TLV length for IPv4 Source-Active or Source-Active Response < 5");
return;
}
- entries = tvb_get_guint8(tvb, *offset);
- proto_tree_add_uint(tree, hf_msdp_sa_entry_count, tvb, *offset, 1, entries);
+ proto_tree_add_item_ret_uint(tree, hf_msdp_sa_entry_count, tvb, *offset, 1, ENC_BIG_ENDIAN, &entries);
*offset += 1;
length -= 1;