diff options
author | Evan Huus <eapache@gmail.com> | 2015-04-19 15:28:23 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-04-20 06:38:00 +0000 |
commit | b3caf8917c2861a760cc8cc9525a2d352830ddc9 (patch) | |
tree | 6caffdf66726e4f6cd7b8071d7036de4bf93da6f /plugins | |
parent | 8844fbc4f64ebef23b70b6d0327b54f328b3e876 (diff) |
wimax: replace deprecated tvb_length calls
Change-Id: I9db1051e065762b826973ecbc2dba460a7f89013
Reviewed-on: https://code.wireshark.org/review/8123
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wimaxasncp/packet-wimaxasncp.c | 27 | ||||
-rw-r--r-- | plugins/wimaxmacphy/packet-wimaxmacphy.c | 4 |
2 files changed, 15 insertions, 16 deletions
diff --git a/plugins/wimaxasncp/packet-wimaxasncp.c b/plugins/wimaxasncp/packet-wimaxasncp.c index 513ae008a9..5bb42a0113 100644 --- a/plugins/wimaxasncp/packet-wimaxasncp.c +++ b/plugins/wimaxasncp/packet-wimaxasncp.c @@ -1324,7 +1324,7 @@ static void wimaxasncp_dissect_tlv_value( PROTO_ITEM_SET_HIDDEN(item); - while (offset < tvb_length(tvb)) + while (offset < tvb_reported_length(tvb)) { guint16 protocol; const gchar *protocol_name; @@ -1381,7 +1381,7 @@ static void wimaxasncp_dissect_tlv_value( PROTO_ITEM_SET_HIDDEN(item); - while (offset < tvb_length(tvb)) + while (offset < tvb_reported_length(tvb)) { guint16 portLow; guint16 portHigh; @@ -1471,7 +1471,7 @@ static void wimaxasncp_dissect_tlv_value( * ------------------------------------------------------------ */ - while (offset < tvb_length(tvb)) + while (offset < tvb_reported_length(tvb)) { proto_tree *ip_address_mask_tree; @@ -1521,7 +1521,7 @@ static void wimaxasncp_dissect_tlv_value( * ------------------------------------------------------------ */ - while (offset < tvb_length(tvb)) + while (offset < tvb_reported_length(tvb)) { proto_tree *ip_address_mask_tree; guint32 ip; @@ -1628,8 +1628,7 @@ static void wimaxasncp_dissect_tlv_value( /* Extract remaining bytes into new tvb */ - eap_tvb = tvb_new_subset(tvb, offset, length, - tvb_length_remaining(tvb, offset)); + eap_tvb = tvb_new_subset_remaining(tvb, offset); /* Disable writing to info column while calling eap dissector */ save_writable = col_get_writable(pinfo->cinfo); @@ -1706,7 +1705,7 @@ static void wimaxasncp_dissect_tlv_value( * ---------------------------------------------------------------- */ - if (offset < tvb_length(tvb)) + if (offset < tvb_reported_length(tvb)) { proto_tree_add_item( vsif_tree, tlv_info->hf_vendor_rest_of_info, @@ -1824,7 +1823,7 @@ static guint dissect_wimaxasncp_tlvs( proto_item *type_item; gint tree_length = MIN( - (gint)(4 + length + pad), tvb_length_remaining(tvb, offset)); + (gint)(4 + length + pad), tvb_captured_length_remaining(tvb, offset)); tlv_item = proto_tree_add_item( tree, tlv_info->hf_root, @@ -1882,14 +1881,14 @@ static guint dissect_wimaxasncp_tlvs( { /* error? compound, but no TLVs inside */ } - else if (tvb_length_remaining(tvb, offset) > 0) + else if (tvb_reported_length_remaining(tvb, offset) > 0) { tvbuff_t *tlv_tvb; /* N.B. Not padding out tvb length */ tlv_tvb = tvb_new_subset( tvb, offset, - MIN(length, tvb_length_remaining(tvb, offset)), + MIN(length, tvb_captured_length_remaining(tvb, offset)), length); /* N.B. This is a recursive call... */ @@ -1909,7 +1908,7 @@ static guint dissect_wimaxasncp_tlvs( tlv_tvb = tvb_new_subset( tvb, offset, - MIN(length, tvb_length_remaining(tvb, offset)), + MIN(length, tvb_captured_length_remaining(tvb, offset)), length); wimaxasncp_dissect_tlv_value( @@ -2032,7 +2031,7 @@ static guint dissect_wimaxasncp_backend( * ------------------------------------------------------------------------ */ - if (offset < tvb_length(tvb)) + if (tvb_reported_length_remaining(tvb, offset) > 0) { tvbuff_t *tlv_tvb; @@ -2167,7 +2166,7 @@ dissect_wimaxasncp( { packet_item = proto_tree_add_item( tree, proto_wimaxasncp, - tvb, 0, MIN(WIMAXASNCP_HEADER_LENGTH_END, tvb_length(tvb)), ENC_NA); + tvb, 0, MIN(WIMAXASNCP_HEADER_LENGTH_END, tvb_captured_length(tvb)), ENC_NA); wimaxasncp_tree = proto_item_add_subtree( packet_item, ett_wimaxasncp); @@ -2394,7 +2393,7 @@ dissect_wimaxasncp( subtree = tvb_new_subset( tvb, offset, - MIN(length, tvb_length(tvb) - offset), + MIN(length, tvb_captured_length_remaining(tvb, offset)), length - WIMAXASNCP_HEADER_LENGTH_END); offset += dissect_wimaxasncp_backend( diff --git a/plugins/wimaxmacphy/packet-wimaxmacphy.c b/plugins/wimaxmacphy/packet-wimaxmacphy.c index dd39b7016d..8e75abd5b2 100644 --- a/plugins/wimaxmacphy/packet-wimaxmacphy.c +++ b/plugins/wimaxmacphy/packet-wimaxmacphy.c @@ -2361,7 +2361,7 @@ dissect_wimaxmacphy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d guint8 message_type; /* Ensure minimum size */ - if (tvb_length(tvb) < WIMAXMACPHY_HEADER_SIZE) + if (tvb_reported_length(tvb) < WIMAXMACPHY_HEADER_SIZE) return 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "wimaxmacphy"); @@ -2453,7 +2453,7 @@ dissect_wimaxmacphy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d expert_add_info(pinfo, item, &ei_wimaxmacphy_unknown); } - return tvb_length(tvb); + return tvb_captured_length(tvb); } void |