diff options
author | Anish Bhatt <anish@chelsio.com> | 2015-05-25 21:23:39 -0700 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-05-26 10:22:33 +0000 |
commit | 751989629ab82cc73c5dfd0e2bde173c0b72dc6f (patch) | |
tree | ff4b0e1fdcfcf8540173c60b6d584bf6e594d343 /epan/dissectors/packet-scsi.c | |
parent | 8817fd06b2eec0643b72142d2e3e27327ae34651 (diff) |
Replace deprecated tvb_length* apis
Change-Id: Ia23a6cbc61dfaf65002ce63160e87877963a3cca
Reviewed-on: https://code.wireshark.org/review/8643
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-scsi.c')
-rw-r--r-- | epan/dissectors/packet-scsi.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index 1feb1cf912..b47831f5aa 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -3091,7 +3091,7 @@ dissect_spc_inquiry(tvbuff_t *tvb_a, packet_info *pinfo, }; if (!isreq && ((cdata == NULL) || !(cdata->itlq->flags & 0x3)) - && (tvb_length_remaining(tvb_a, offset_a) >= 1) ) { + && (tvb_reported_length_remaining(tvb_a, offset_a) >= 1) ) { /* * INQUIRY response with device type information; add device type * to list of known devices & their types if not already known. @@ -3653,7 +3653,7 @@ dissect_scsi_log_page(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, if (log_parameter && log_parameter->dissector) { tvbuff_t *param_tvb; - param_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),paramlen), paramlen); + param_tvb = tvb_new_subset(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),paramlen), paramlen); log_parameter->dissector(param_tvb, pinfo, log_tree); } else { /* We did not have a dissector for this page/parameter so @@ -3760,14 +3760,14 @@ dissect_scsi_blockdescs(tvbuff_t *tvb, packet_info *pinfo _U_, if (!cdata) return; - while (tvb_length_remaining(tvb, offset) > 0) { + while (tvb_reported_length_remaining(tvb, offset) > 0) { if (longlba) { - if (tvb_length_remaining(tvb, offset)<8) + if (tvb_reported_length_remaining(tvb, offset)<8) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks64, tvb, offset, 8, ENC_BIG_ENDIAN); offset += 8; - if (tvb_length_remaining(tvb, offset)<1) + if (tvb_reported_length_remaining(tvb, offset)<1) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -3775,37 +3775,37 @@ dissect_scsi_blockdescs(tvbuff_t *tvb, packet_info *pinfo _U_, /* 3 reserved bytes */ offset += 3; - if (tvb_length_remaining(tvb, offset)<4) + if (tvb_reported_length_remaining(tvb, offset)<4) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; } else { if ((cdata->itl->cmdset&SCSI_CMDSET_MASK) == SCSI_DEV_SBC) { - if (tvb_length_remaining(tvb, offset)<4) + if (tvb_reported_length_remaining(tvb, offset)<4) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks32, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; offset++; /* reserved */ - if (tvb_length_remaining(tvb, offset)<3) + if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; } else { - if (tvb_length_remaining(tvb, offset)<1) + if (tvb_reported_length_remaining(tvb, offset)<1) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_density_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - if (tvb_length_remaining(tvb, offset)<3) + if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_no_of_blocks24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; offset++; /* reserved */ - if (tvb_length_remaining(tvb, offset)<3) + if (tvb_reported_length_remaining(tvb, offset)<3) return; proto_tree_add_item(scsi_tree, hf_scsi_blockdescs_block_length24, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; @@ -4448,8 +4448,8 @@ dissect_spc_modeselect6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 1; payload_len -= 1; - if (tvb_length_remaining(tvb, offset)>0) { - blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen); + if (tvb_reported_length_remaining(tvb, offset)>0) { + blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE); } offset += desclen; @@ -4542,8 +4542,8 @@ dissect_spc_modeselect10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 2; payload_len -= 2; - if (tvb_length_remaining(tvb, offset)>0) { - blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen); + if (tvb_reported_length_remaining(tvb, offset)>0) { + blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba); } offset += desclen; @@ -4672,8 +4672,8 @@ dissect_spc_modesense6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, tot_len -= 1; - if (tvb_length_remaining(tvb, offset)>0) { - blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen); + if (tvb_reported_length_remaining(tvb, offset)>0) { + blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, FALSE); } offset += desclen; @@ -4762,8 +4762,8 @@ dissect_spc_modesense10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset += 2; tot_len -= 2; - if (tvb_length_remaining(tvb, offset)>0) { - blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_length_remaining(tvb, offset),desclen), desclen); + if (tvb_reported_length_remaining(tvb, offset)>0) { + blockdesc_tvb = tvb_new_subset(tvb, offset, MIN(tvb_reported_length_remaining(tvb, offset),desclen), desclen); dissect_scsi_blockdescs(blockdesc_tvb, pinfo, tree, cdata, longlba); } offset += desclen; @@ -5983,7 +5983,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, return; } - payload_len = tvb_length(tvb); + payload_len = tvb_reported_length(tvb); cdata = wmem_new(wmem_packet_scope(), scsi_task_data_t); cdata->itl = itl; cdata->itlq = itlq; @@ -6068,7 +6068,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* If we don't have the entire PDU there is no point in even trying * reassembly */ - if (tvb_length_remaining(tvb, offset) != tvb_reported_length_remaining(tvb, offset)) { + if (tvb_reported_length_remaining(tvb, offset) != tvb_reported_length_remaining(tvb, offset)) { if (relative_offset) { call_dissector(data_handle, tvb, pinfo, scsi_tree); goto end_of_payload; @@ -6094,17 +6094,17 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* If this PDU already contains all the expected data we don't have to do * reassembly. */ - if ( (!relative_offset) && ((guint32)tvb_length_remaining(tvb, offset) == expected_length) ) { + if ( (!relative_offset) && ((guint32)tvb_reported_length_remaining(tvb, offset) == expected_length) ) { goto dissect_the_payload; } /* Start reassembly */ - if (tvb_length_remaining(tvb, offset) < 0) { + if (tvb_reported_length_remaining(tvb, offset) < 0) { goto end_of_payload; } - if ((tvb_length_remaining(tvb,offset) + relative_offset) != expected_length) { + if ((tvb_reported_length_remaining(tvb,offset) + relative_offset) != expected_length) { more_frags = TRUE; } ipfd_head = fragment_add_check(&scsi_reassembly_table, tvb, offset, @@ -6112,7 +6112,7 @@ dissect_scsi_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, itlq->first_exchange_frame, /* key */ NULL, relative_offset, - tvb_length_remaining(tvb, offset), + tvb_reported_length_remaining(tvb, offset), more_frags); next_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled SCSI DATA", ipfd_head, &scsi_frag_items, &update_col_info, tree); |