diff options
author | Evan Huus <eapache@gmail.com> | 2015-06-22 14:40:23 -0700 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2015-06-22 21:40:50 +0000 |
commit | 11803d422f31038bb03c068c2daddf29dba36603 (patch) | |
tree | 77f13ff40c308d715a516d3aebab386423ed8d91 /epan | |
parent | df352c535ff1f22cac89c06bc3dae669ff6853b9 (diff) |
Remove more tvb_length
Change-Id: I940704e927001b2a051a59fd0738e7a02328472b
Reviewed-on: https://code.wireshark.org/review/9031
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/file-png.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-acr122.c | 24 | ||||
-rw-r--r-- | epan/dissectors/packet-bt-dht.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-bt-utp.c | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-bthid.c | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-cisco-metadata.c | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c index 0ed86c73ff..496e6c67c1 100644 --- a/epan/dissectors/file-png.c +++ b/epan/dissectors/file-png.c @@ -324,7 +324,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) { gint offset=0, nul_offset; - nul_offset = tvb_find_guint8(tvb, offset, tvb_length_remaining(tvb, offset), 0); + nul_offset = tvb_find_guint8(tvb, offset, tvb_captured_length_remaining(tvb, offset), 0); /* nul_offset == 0 means empty keyword, this is not allowed by the png standard */ if (nul_offset<=0) { /* XXX exception */ @@ -334,7 +334,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) proto_tree_add_item(tree, &hfi_png_text_keyword, tvb, offset, nul_offset, ENC_ISO_8859_1|ENC_NA); offset = nul_offset+1; /* length of the key word + 0 character */ - proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA); + proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA); } diff --git a/epan/dissectors/packet-acr122.c b/epan/dissectors/packet-acr122.c index b134c2ccc8..10a065044e 100644 --- a/epan/dissectors/packet-acr122.c +++ b/epan/dissectors/packet-acr122.c @@ -501,37 +501,37 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) } } - sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_length_remaining(tvb, offset), command); + sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_captured_length_remaining(tvb, offset), command); PROTO_ITEM_SET_GENERATED(sub_item); col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown")); if (command != CMD_UNKNOWN) { - sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_frame_number); + sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_captured_length_remaining(tvb, offset), command_frame_number); PROTO_ITEM_SET_GENERATED(sub_item); } switch (command) { case CMD_GET_FIRMWARE_VERSION: proto_tree_add_item(main_tree, hf_firmware_version, tvb, offset, -1, ENC_NA | ENC_ASCII); - offset += tvb_length_remaining(tvb, offset); + offset += tvb_captured_length_remaining(tvb, offset); break; case CMD_DIRECT_TRANSMIT: use_status_word = TRUE; - if (tvb_length_remaining(tvb, offset) > 2) { - next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 2); + if (tvb_captured_length_remaining(tvb, offset) > 2) { + next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2); call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info); - offset += tvb_length_remaining(tvb, offset) - 2; + offset += tvb_captured_length_remaining(tvb, offset) - 2; } break; case CMD_READ_BINARY_BLOCKS: use_status_word = TRUE; - proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA); - offset += tvb_length_remaining(tvb, offset) - 2; + proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA); + offset += tvb_captured_length_remaining(tvb, offset) - 2; break; case CMD_READ_VALUE_BLOCK: @@ -541,14 +541,14 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) case CMD_GET_DATA_UID: use_status_word = TRUE; - proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA); - offset += tvb_length_remaining(tvb, offset) - 2; + proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA); + offset += tvb_captured_length_remaining(tvb, offset) - 2; break; case CMD_GET_DATA_ATS: use_status_word = TRUE; - proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA); - offset += tvb_length_remaining(tvb, offset) - 2; + proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA); + offset += tvb_captured_length_remaining(tvb, offset) - 2; break; case CMD_BI_COLOR_AND_BUZZER_LED_CONTROL: diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c index 84184552ae..6b6889f515 100644 --- a/epan/dissectors/packet-bt-dht.c +++ b/epan/dissectors/packet-bt-dht.c @@ -477,7 +477,7 @@ gboolean dissect_bt_dht_heur (tvbuff_t *tvb, packet_info *pinfo, /* try dissecting */ /* Assume dictionary (d) is followed by a one char long (1:) key string. */ - if(tvb_length(tvb) < 4) + if(tvb_captured_length(tvb) < 4) return FALSE; if(tvb_memeql(tvb, 0, "d1:", 3) != 0) diff --git a/epan/dissectors/packet-bt-utp.c b/epan/dissectors/packet-bt-utp.c index ea9b155013..1b00ba3e82 100644 --- a/epan/dissectors/packet-bt-utp.c +++ b/epan/dissectors/packet-bt-utp.c @@ -161,7 +161,7 @@ get_utp_version(tvbuff_t *tvb) { /* Simple heuristics inspired by code from utp.cpp */ - len = tvb_length(tvb); + len = tvb_captured_length(tvb); /* Version 1? */ if (len < V1_FIXED_HDR_SIZE) { @@ -357,7 +357,7 @@ dissect_bt_utp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _ offset = dissect_utp_extension(tvb, pinfo, sub_tree, offset, &extension_type); - len_tvb = tvb_length_remaining(tvb, offset); + len_tvb = tvb_captured_length_remaining(tvb, offset); if(len_tvb > 0) proto_tree_add_item(sub_tree, hf_bt_utp_data, tvb, offset, len_tvb, ENC_NA); diff --git a/epan/dissectors/packet-bthid.c b/epan/dissectors/packet-bthid.c index d6667700dc..a122b6a923 100644 --- a/epan/dissectors/packet-bthid.c +++ b/epan/dissectors/packet-bthid.c @@ -230,8 +230,8 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U Global Items are declared in the report descriptor, and in Boot Protocol Mode. Otherwise the field does not exist." */ - if (((parameter >> 3) && tvb_length_remaining(tvb, offset) >= 3) || - (!(parameter >> 3) && tvb_length_remaining(tvb, offset) >= 1)) { + if (((parameter >> 3) && tvb_reported_length_remaining(tvb, offset) >= 3) || + (!(parameter >> 3) && tvb_reported_length_remaining(tvb, offset) >= 1)) { proto_tree_add_item(bthid_tree, hf_bthid_report_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; } @@ -251,7 +251,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U /* playload */ proto_tree_add_item(bthid_tree, hf_bthid_data, tvb, offset, -1, ENC_NA); - offset += tvb_length_remaining(tvb, offset); + offset += tvb_captured_length_remaining(tvb, offset); break; case 0x06: /* GET_PROTOCOL */ proto_tree_add_item(bthid_tree, hf_bthid_parameter_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); diff --git a/epan/dissectors/packet-cisco-metadata.c b/epan/dissectors/packet-cisco-metadata.c index e8b26eae7b..115692c52f 100644 --- a/epan/dissectors/packet-cisco-metadata.c +++ b/epan/dissectors/packet-cisco-metadata.c @@ -82,7 +82,7 @@ dissect_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) gboolean is_802_2 = TRUE; /* Don't throw an exception for this check (even a BoundsError) */ - if (tvb_length_remaining(tvb, 4) >= 2) { + if (tvb_captured_length_remaining(tvb, 4) >= 2) { if (tvb_get_ntohs(tvb, 4) == 0xffff) is_802_2 = FALSE; } |