aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-06-22 17:05:37 -0700
committerEvan Huus <eapache@gmail.com>2015-06-23 00:06:19 +0000
commit67ab8a059c489022aebe0e27d1f937c7b6abad06 (patch)
tree6b6cb9e97c0b56ac14ea8224760356e1c5965748 /epan
parenta43682d4fd9075f07f8dce1ddc5bda3e07296c27 (diff)
Remove more deprecated tvb_length
Change-Id: I36603453c2563406f82663683930088dedd5f39c Reviewed-on: https://code.wireshark.org/review/9041 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-radius.c14
-rw-r--r--epan/dissectors/packet-rdp.c6
-rw-r--r--epan/dissectors/packet-rdt.c52
-rw-r--r--epan/dissectors/packet-redbackli.c4
-rw-r--r--epan/dissectors/packet-reload-framing.c6
-rw-r--r--epan/dissectors/packet-reload.c4
-rw-r--r--epan/dissectors/packet-rfid-pn532-hci.c14
-rw-r--r--epan/dissectors/packet-rfid-pn532.c112
-rw-r--r--epan/dissectors/packet-rlc.c42
-rw-r--r--epan/dissectors/packet-rlm.c2
-rw-r--r--epan/dissectors/packet-rlogin.c12
-rw-r--r--epan/dissectors/packet-rmcp.c6
-rw-r--r--epan/dissectors/packet-rohc.c32
-rw-r--r--epan/dissectors/packet-rpcap.c20
-rw-r--r--epan/dissectors/packet-rpl.c2
-rw-r--r--epan/dissectors/packet-rsh.c12
-rw-r--r--epan/dissectors/packet-rsvp.c6
-rw-r--r--epan/dissectors/packet-rsync.c8
-rw-r--r--epan/dissectors/packet-rtacser.c4
-rw-r--r--epan/dissectors/packet-rtcdc.c8
-rw-r--r--epan/dissectors/packet-rtpproxy.c2
-rw-r--r--epan/dissectors/packet-rtsp.c2
-rw-r--r--epan/dissectors/packet-rudp.c2
-rw-r--r--epan/dissectors/packet-rx.c6
24 files changed, 189 insertions, 189 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index dc5176ee46..9d69909421 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -478,7 +478,7 @@ static const gchar *dissect_chap_password(proto_tree* tree, tvbuff_t* tvb, packe
proto_item *ti;
proto_tree *chap_tree;
- len = tvb_length(tvb);
+ len = tvb_reported_length(tvb);
if (len != 17)
return "[wrong length for CHAP-Password]";
@@ -563,7 +563,7 @@ static const gchar *dissect_ascend_data_filter(proto_tree* tree, tvbuff_t* tvb,
guint16 srcport, dstport;
guint8 srcportq, dstportq;
- len=tvb_length(tvb);
+ len=tvb_reported_length(tvb);
if (len != 24) {
return wmem_strdup_printf(wmem_packet_scope(), "Wrong attribute length %d", len);
@@ -616,7 +616,7 @@ static const gchar *dissect_framed_ipx_network(proto_tree* tree, tvbuff_t* tvb,
guint32 net;
const gchar *str;
- len = tvb_length(tvb);
+ len = tvb_reported_length(tvb);
if (len != 4)
return "[wrong length for IPX network]";
@@ -635,7 +635,7 @@ static const gchar *dissect_framed_ipx_network(proto_tree* tree, tvbuff_t* tvb,
static const gchar* dissect_cosine_vpvc(proto_tree* tree, tvbuff_t* tvb, packet_info* pinfo _U_) {
guint vpi, vci;
- if ( tvb_length(tvb) != 4 )
+ if ( tvb_reported_length(tvb) != 4 )
return "[Wrong Length for VP/VC AVP]";
vpi = tvb_get_ntohs(tvb,0);
@@ -1349,7 +1349,7 @@ void dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_
PROTO_ITEM_SET_GENERATED(avp_len_item);
}
- tvb_len = tvb_length_remaining(tvb, offset);
+ tvb_len = tvb_captured_length_remaining(tvb, offset);
if ((gint)avp_length < tvb_len)
tvb_len = avp_length;
@@ -1587,7 +1587,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
tvb, 2, 2, rh.rh_pktlength, "%u (bogus, < %u)",
rh.rh_pktlength, HDR_LENGTH);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
avplength = rh.rh_pktlength - HDR_LENGTH;
@@ -1847,7 +1847,7 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
avplength);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-rdp.c b/epan/dissectors/packet-rdp.c
index 3c9dd311b9..7bccabacdd 100644
--- a/epan/dissectors/packet-rdp.c
+++ b/epan/dissectors/packet-rdp.c
@@ -1743,7 +1743,7 @@ dissect_rdp_ClientData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
#if 0
printf("offset=%d, type=%x, length=%d, remaining=%d\n",
- offset, type, length, tvb_length_remaining(tvb, offset));
+ offset, type, length, tvb_captured_length_remaining(tvb, offset));
#endif
switch(type) {
@@ -1899,13 +1899,13 @@ dissect_rdp_ServerData(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
* Note: If length is less than the header size (4 bytes) offset is advanced by 4 bytes
* to ensure that dissection eventually terminates.
*/
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_reported_length_remaining(tvb, offset) > 0) {
type = tvb_get_letohs(tvb, offset);
length = tvb_get_letohs(tvb, offset+2);
/* printf("offset=%d, type=%x, length=%d, remaining=%d\n",
- offset, type, length, tvb_length_remaining(tvb, offset)); */
+ offset, type, length, tvb_captured_length_remaining(tvb, offset)); */
switch(type) {
case SC_CORE:
diff --git a/epan/dissectors/packet-rdt.c b/epan/dissectors/packet-rdt.c
index 02767db895..22657d2a21 100644
--- a/epan/dissectors/packet-rdt.c
+++ b/epan/dissectors/packet-rdt.c
@@ -311,7 +311,7 @@ static void dissect_rdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Parse all RDT packets found in the frame */
- while (offset != -1 && tvb_length_remaining(tvb, offset))
+ while (offset != -1 && tvb_reported_length_remaining(tvb, offset))
{
/* Every packet type should have at least 3 bytes */
tvb_ensure_bytes_exist(tvb, offset, 3);
@@ -459,7 +459,7 @@ guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* More flags */
@@ -522,13 +522,13 @@ guint dissect_rdt_data_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -587,7 +587,7 @@ guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* Stream ID expansion */
@@ -606,10 +606,10 @@ guint dissect_rdt_asm_action_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -658,7 +658,7 @@ guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, pro
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_brpt_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -671,10 +671,10 @@ guint dissect_rdt_bandwidth_report_packet(tvbuff_t *tvb, packet_info *pinfo, pro
col_append_str(pinfo->cinfo, COL_INFO, "BANDWIDTH-REPORT: ");
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -727,7 +727,7 @@ guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
/* XXX: The remaining data is unparsed. */
@@ -736,10 +736,10 @@ guint dissect_rdt_ack_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_append_fstr(pinfo->cinfo, COL_INFO, "ACK: lh=%u ", lost_high_flag);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -870,7 +870,7 @@ guint dissect_rdt_stream_end_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_rdt_stre_reason_code, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* XXX: Remainder is reason_text */
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "STREAM-END: stream-id=%02u ", stream_id);
@@ -921,7 +921,7 @@ guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
col_append_str(pinfo->cinfo, COL_INFO, "REPORT: ");
@@ -930,10 +930,10 @@ guint dissect_rdt_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -983,7 +983,7 @@ guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
server_out_time = tvb_get_ntohl(tvb, offset);
@@ -993,10 +993,10 @@ guint dissect_rdt_latency_report_packet(tvbuff_t *tvb, packet_info *pinfo, proto
col_append_fstr(pinfo->cinfo, COL_INFO, "LATENCY-REPORT: t=%u ", server_out_time);
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -1131,7 +1131,7 @@ guint dissect_rdt_transport_info_response_packet(tvbuff_t *tvb, packet_info *pin
}
/* Report what is left */
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "RESPONSE: ");
@@ -1181,7 +1181,7 @@ guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
}
else
{
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
proto_tree_add_item(tree, hf_rdt_bwpp_seqno, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1192,10 +1192,10 @@ guint dissect_rdt_bw_probing_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tre
col_append_str(pinfo->cinfo, COL_INFO, "BW-PROBING: ");
if (packet_length < (offset - start_offset) ||
- packet_length > tvb_length_remaining(tvb, start_offset))
+ packet_length > tvb_reported_length_remaining(tvb, start_offset))
{
proto_tree_add_expert(tree, pinfo, &ei_rdt_packet_length, tvb, 0, 0);
- packet_length = tvb_length_remaining(tvb, start_offset);
+ packet_length = tvb_captured_length_remaining(tvb, start_offset);
}
return start_offset + packet_length;
@@ -1214,7 +1214,7 @@ guint dissect_rdt_unknown_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* The remaining data is unparsed. */
proto_tree_add_item(tree, hf_rdt_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
col_append_str(pinfo->cinfo, COL_INFO, "UNKNOWN-CTL: ");
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c
index 3d82ee907d..eb8ceb09b1 100644
--- a/epan/dissectors/packet-redbackli.c
+++ b/epan/dissectors/packet-redbackli.c
@@ -142,7 +142,7 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 0, -1, ENC_NA);
redbackli_tree = proto_item_add_subtree(ti, ett_redbackli);
- len = tvb_length(tvb);
+ len = tvb_reported_length(tvb);
offset = 0;
eoh = FALSE;
while (!eoh && (len > 2)) {
@@ -179,7 +179,7 @@ redbackli_dissect_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
guint8 avptype, avplen;
guint32 avpfound = 0;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len < MIN_REDBACKLI_SIZE)
return FALSE;
diff --git a/epan/dissectors/packet-reload-framing.c b/epan/dissectors/packet-reload-framing.c
index 5a4fe43eca..15f6a4cf99 100644
--- a/epan/dissectors/packet-reload-framing.c
+++ b/epan/dissectors/packet-reload-framing.c
@@ -350,7 +350,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
next_tvb = tvb_new_subset(tvb, offset, effective_length - offset, message_length);
if (reload_handle == NULL) {
expert_add_info(pinfo, ti, &ei_reload_no_dissector);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
call_dissector_only(reload_handle, next_tvb, pinfo, tree, NULL);
}
@@ -442,7 +442,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
DISSECTOR_ASSERT_NOT_REACHED();
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -457,7 +457,7 @@ dissect_reload_framing_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* XXX: Check if we have a valid RELOAD Frame Type ? */
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, MIN_HDR_LENGTH,
get_reload_framing_message_length, dissect_reload_framing, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* ToDo: If a TCP connection is identified heuristically as reload-framing, then
diff --git a/epan/dissectors/packet-reload.c b/epan/dissectors/packet-reload.c
index d9d93f1b0a..d20d77a382 100644
--- a/epan/dissectors/packet-reload.c
+++ b/epan/dissectors/packet-reload.c
@@ -3931,7 +3931,7 @@ dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean update_col_info = TRUE;
offset = 0;
- effective_length = tvb_length(tvb);
+ effective_length = tvb_captured_length(tvb);
/* First, make sure we have enough data to do the check. */
if (effective_length < MIN_HDR_LENGTH)
@@ -4154,7 +4154,7 @@ dissect_reload_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = 0;
}
- effective_length = tvb_length(tvb);
+ effective_length = tvb_captured_length(tvb);
if (effective_length < msg_length) {
/* The effective length is too small for the packet */
expert_add_info(pinfo, NULL, &ei_reload_truncated_packet);
diff --git a/epan/dissectors/packet-rfid-pn532-hci.c b/epan/dissectors/packet-rfid-pn532-hci.c
index acf08e28d8..93c047a672 100644
--- a/epan/dissectors/packet-rfid-pn532-hci.c
+++ b/epan/dissectors/packet-rfid-pn532-hci.c
@@ -79,7 +79,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
return 0;
usb_conv_info = (usb_conv_info_t *)data;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 6) return offset;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN532_HCI");
@@ -89,7 +89,7 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
main_tree = proto_item_add_subtree(main_item, ett_pn532_hci);
length = 0;
- while (tvb_length_remaining(tvb, length) >= 2 && tvb_get_ntohs(tvb, length) != 0x00FF) {
+ while (tvb_captured_length_remaining(tvb, length) >= 2 && tvb_get_ntohs(tvb, length) != 0x00FF) {
length += 1;
}
if (length) {
@@ -177,9 +177,9 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
}
length = 0;
- if (tvb_length_remaining(tvb, offset) == 1) {
+ if (tvb_captured_length_remaining(tvb, offset) == 1) {
length = 1;
- } else while (tvb_length_remaining(tvb, offset + length) >= 2 && tvb_get_ntohs(tvb, offset + length) != 0x00FF) {
+ } else while (tvb_captured_length_remaining(tvb, offset + length) >= 2 && tvb_get_ntohs(tvb, offset + length) != 0x00FF) {
length += 1;
}
if (length) {
@@ -187,9 +187,9 @@ dissect_pn532_hci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
offset += length;
}
- if (tvb_length_remaining(tvb, offset)) {
- proto_tree_add_item(main_tree, hf_ignored, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_captured_length_remaining(tvb, offset)) {
+ proto_tree_add_item(main_tree, hf_ignored, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-rfid-pn532.c b/epan/dissectors/packet-rfid-pn532.c
index ed590a2af2..e932238d4d 100644
--- a/epan/dissectors/packet-rfid-pn532.c
+++ b/epan/dissectors/packet-rfid-pn532.c
@@ -725,7 +725,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (command_data) {
- sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_data->command_frame_number);
+ sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_response_for, tvb, offset, tvb_captured_length_remaining(tvb, offset), command_data->command_frame_number);
PROTO_ITEM_SET_GENERATED(sub_item);
}
}
@@ -777,8 +777,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -788,7 +788,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
else
test_number = -1; /* Force unknown test_numer */
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_parameters_length, tvb, offset, 1, ENC_NA);
offset += 1;
@@ -798,7 +798,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 1;
proto_tree_add_item(pn532_tree, hf_pn532_parameters_length, tvb, offset, 1, ENC_NA);
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
offset += 1;
proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, length, ENC_NA);
@@ -819,8 +819,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Not possible; test 0x05 runs infinitely */
break;
default:
- proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_parameters, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
break;
@@ -887,21 +887,21 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
case READ_REGISTER_REQ:
- while (tvb_length_remaining(tvb, offset) >= 2) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(pn532_tree, hf_pn532_register_address, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
break;
case READ_REGISTER_RSP:
- while (tvb_length_remaining(tvb, offset) >= 1) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_register_value, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
break;
case WRITE_REGISTER_REQ:
- while (tvb_length_remaining(tvb, offset) >= 3) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 3) {
proto_tree_add_item(pn532_tree, hf_pn532_register_address, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
@@ -976,7 +976,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_sam_timeout, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_sam_irq, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1000,7 +1000,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_wakeup_enable_int_0, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_generate_irq, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1131,8 +1131,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 1;
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1184,8 +1184,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (value & 0x04) {
- proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1232,7 +1232,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
switch(baudrate) {
case ISO_IEC_14443A_106:
- while (tvb_length_remaining(tvb, offset) >= 4) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 4) {
proto_tree_add_item(pn532_tree, hf_pn532_14443a_uid, tvb, 6, 4, ENC_BIG_ENDIAN);
offset += 4;
}
@@ -1248,7 +1248,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_afi, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) >= 1) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 1) {
proto_tree_add_item(pn532_tree, hf_pn532_polling_method, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -1269,11 +1269,11 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
else
baudrate = -1; /* Force unknown baudrate... */
- sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_BrTy, tvb, offset, tvb_length_remaining(tvb, offset), baudrate);
+ sub_item = proto_tree_add_uint(pn532_tree, hf_pn532_BrTy, tvb, offset, tvb_captured_length_remaining(tvb, offset), baudrate);
PROTO_ITEM_SET_GENERATED(sub_item);
for (item_value = 1; item_value <= value; item_value += 1) {
- sub_item = proto_tree_add_item(pn532_tree, hf_pn532_target, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
+ sub_item = proto_tree_add_item(pn532_tree, hf_pn532_target, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_pn532_target);
proto_item_append_text(sub_item, " %u/%u", item_value, value);
@@ -1295,7 +1295,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_nfc_id_1, tvb, offset, length, ENC_NA);
offset += length;
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_reported_length_remaining(tvb, offset)) {
proto_tree_add_item(sub_tree, hf_pn532_ats_length, tvb, offset, 1, ENC_BIG_ENDIAN);
length = tvb_get_guint8(tvb, offset);
offset += 1;
@@ -1318,10 +1318,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_pad, tvb, offset, 8, ENC_NA);
offset += 8;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(sub_tree, hf_pn532_syst_code, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- } else if (tvb_length_remaining(tvb, offset) == 1) {
+ } else if (tvb_reported_length_remaining(tvb, offset) == 1) {
proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, 1);
offset += 1;
}
@@ -1345,8 +1345,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
offset += 4;
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
@@ -1368,8 +1368,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
if (value & 0x02) {
- proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gi, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1421,7 +1421,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Seems to work for payloads from LibNFC's "nfc-mfultralight" command */
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(sub_handles[SUB_MIFARE], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else if (sub_selected == SUB_ISO7816) {
/* Seems to work for EMV payloads sent using TAMA shell scripts */
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1429,10 +1429,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Need to do this, for the ISO7816 dissector to work, it seems */
pinfo->p2p_dir = P2P_DIR_SENT;
call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else {
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1450,10 +1450,10 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* Need to do this, for the ISO7816 dissector to work, it seems */
pinfo->p2p_dir = P2P_DIR_RECV;
call_dissector(sub_handles[SUB_ISO7816], next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
} else {
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1470,8 +1470,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
} else {
/* NOTE: MiFare transmissions may identify as spurious FeliCa packets, in some cases */
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1489,8 +1489,8 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
} else {
/* NOTE: MiFare transmissions may identify as spurious FeliCa packets, in some cases */
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
@@ -1525,7 +1525,7 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(sub_tree, hf_pn532_autopoll_type_baudrate_and_modulation, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- while (tvb_length_remaining(tvb, offset) >= 1) {
+ while (tvb_reported_length_remaining(tvb, offset) >= 1) {
sub_item = proto_tree_add_item(pn532_tree, hf_pn532_autopoll_type, tvb, offset, 1, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_item, ett_pn532_autopoll_type);
proto_tree_add_item(sub_tree, hf_pn532_autopoll_type_act, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -1660,13 +1660,13 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(pn532_tree, hf_pn532_mode_framing_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_GENERAL_BYTES_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_gt, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_gt, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_GENERAL_BYTES_RSP:
@@ -1680,14 +1680,14 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case TG_GET_DATA_RSP:
offset = dissect_status(pn532_tree, tvb, offset);
- proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_in, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_DATA_REQ:
case TG_SET_METADATA_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_data_out, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_SET_DATA_RSP:
@@ -1702,13 +1702,13 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case TG_GET_INITIATOR_CMD_RSP:
offset = dissect_status(pn532_tree, tvb, offset);
- proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_initiator_command, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_RESP_TO_INITIATOR_REQ:
- proto_tree_add_item(pn532_tree, hf_pn532_tg_response, tvb, offset, tvb_length_remaining(tvb, offset), ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_item(pn532_tree, hf_pn532_tg_response, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case TG_RESP_TO_INITIATOR_RSP:
@@ -1731,14 +1731,14 @@ dissect_pn532(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
- proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
+ proto_tree_add_expert(pn532_tree, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-rlc.c b/epan/dissectors/packet-rlc.c
index ca3b1375fa..7111a75393 100644
--- a/epan/dissectors/packet-rlc.c
+++ b/epan/dissectors/packet-rlc.c
@@ -770,7 +770,7 @@ tree_add_li(enum rlc_mode mode, struct rlc_li *li, guint8 li_idx, guint8 hdr_off
}
if (li->len > 0) {
- if (li->li > tvb_length_remaining(tvb, hdr_offs)) return li_tree;
+ if (li->li > tvb_reported_length_remaining(tvb, hdr_offs)) return li_tree;
if (li->len > li->li) return li_tree;
ti = proto_tree_add_item(li_tree, hf_rlc_li_data, tvb, hdr_offs + li->li - li->len, li->len, ENC_NA);
PROTO_ITEM_SET_HIDDEN(ti);
@@ -1427,14 +1427,14 @@ rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid
key_in = translate_hex_key(out); /*Translation*/
/*Location for decrypted data*/
- out = g_malloc( tvb_length(tvb) );
+ out = g_malloc( tvb_captured_length(tvb) );
/*Build data input but don't send the header*/
- for(i = 0; i< tvb_length(tvb)-header_size; i++ ){
+ for(i = 0; i< tvb_captured_length(tvb)-header_size; i++ ){
out[i+header_size] = tvb_get_guint8(tvb, header_size+i);
}
/*Call KASUMI confidentiality function, note that rbid is zero indxed*/
- f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_length(tvb)-header_size)*8 );
+ f8( key_in, counter, rbid-1, dir, &out[header_size], (tvb_captured_length(tvb)-header_size)*8 );
/*Restore header in tvb*/
for (i = 0; i < header_size; i++) {
@@ -1442,7 +1442,7 @@ rlc_decipher_tvb(tvbuff_t *tvb, packet_info *pinfo, guint32 counter, guint8 rbid
}
/*Create new tvb.*/
- t = tvb_new_real_data(out,tvb_length(tvb), tvb_reported_length(tvb));
+ t = tvb_new_real_data(out,tvb_captured_length(tvb), tvb_reported_length(tvb));
/*add_new_data_source(pinfo, tvb, "Data enciphered");*/
add_new_data_source(pinfo, t, "Deciphered data");
return t;
@@ -1634,9 +1634,9 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) {
/* padding, must be last LI */
if (tree) {
- proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, tvb_length_remaining(tvb, offs), ENC_NA);
+ proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, tvb_captured_length_remaining(tvb, offs), ENC_NA);
}
- offs += tvb_length_remaining(tvb, offs);
+ offs += tvb_captured_length_remaining(tvb, offs);
} else if ((!li_is_on_2_bytes && (li[i].li == 0x7c)) || (li[i].li == 0x7ffc)) {
/* a new SDU starts here, mark this seq as the first PDU. */
struct rlc_channel ch_lookup;
@@ -1650,7 +1650,7 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
} else if (li[i].li == 0x7ffa) {
/* the first data octet in this RLC PDU is the first octet of an RLC SDU
and the second last octet in this RLC PDU is the last octet of the same RLC SDU */
- length = tvb_length_remaining(tvb, offs);
+ length = tvb_reported_length_remaining(tvb, offs);
if (length > 1) {
length--;
if (tree && length) {
@@ -1684,13 +1684,13 @@ rlc_um_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo, proto_tree *tr
}
/* is there data left? */
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_reported_length_remaining(tvb, offs) > 0) {
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA);
}
if (global_rlc_perform_reassemby) {
/* add remaining data as fragment */
- add_fragment(RLC_UM, tvb, pinfo, tree, offs, seq, i, tvb_length_remaining(tvb, offs), FALSE);
+ add_fragment(RLC_UM, tvb, pinfo, tree, offs, seq, i, tvb_captured_length_remaining(tvb, offs), FALSE);
if (dissected == FALSE)
col_set_str(pinfo->cinfo, COL_INFO, "[RLC UM Fragment]");
}
@@ -1732,7 +1732,7 @@ rlc_decode_li(enum rlc_mode mode, tvbuff_t *tvb, packet_info *pinfo, proto_tree
ext = next_bytes & 0x01;
hdr_len += li_on_2_bytes ? 2 : 1;
}
- total_len = tvb_length_remaining(tvb, hdr_len);
+ total_len = tvb_captured_length_remaining(tvb, hdr_len);
/* do actual evaluation of LIs */
ext = tvb_get_guint8(tvb, offs++) & 0x01;
@@ -1884,7 +1884,7 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
- li_is_on_2_bytes = (tvb_length(tvb) > 125) ? TRUE : FALSE;
+ li_is_on_2_bytes = (tvb_reported_length(tvb) > 125) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
}
@@ -1900,7 +1900,7 @@ dissect_rlc_um(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_headers_expected) {
/* There might not be any data, if only header was logged */
- is_truncated = (tvb_length_remaining(tvb, offs) == 0);
+ is_truncated = (tvb_reported_length_remaining(tvb, offs) == 0);
truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0,
is_truncated);
if (is_truncated) {
@@ -1943,7 +1943,7 @@ dissect_rlc_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guin
bit_offset = offset*8 + 4; /* first SUFI type is always 4 bit shifted */
- while (!seen_last && tvb_length_remaining(tvb, bit_offset/8) > 0) {
+ while (!seen_last && tvb_reported_length_remaining(tvb, bit_offset/8) > 0) {
/* SUFI */
sufi_type = tvb_get_bits8(tvb, bit_offset, 4);
sufi_start_offset = bit_offset/8;
@@ -2176,7 +2176,7 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
piggyback = TRUE;
} else if ((!li_is_on_2_bytes && (li[i].li == 0x7f)) || (li[i].li == 0x7fff)) {
/* padding, must be last LI */
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_reported_length_remaining(tvb, offs) > 0) {
if (tree) {
proto_tree_add_item(tree, hf_rlc_pad, tvb, offs, -1, ENC_NA);
}
@@ -2185,7 +2185,7 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
add_fragment(RLC_AM, tvb, pinfo, li[i].tree, offs, seq, i, 0, TRUE);
}
}
- offs += tvb_length_remaining(tvb, offs);
+ offs += tvb_captured_length_remaining(tvb, offs);
} else {
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, li[i].len, ENC_NA);
@@ -2206,14 +2206,14 @@ rlc_am_reassemble(tvbuff_t *tvb, guint8 offs, packet_info *pinfo,
if (piggyback) {
dissect_rlc_status(tvb, pinfo, tree, offs);
} else {
- if (tvb_length_remaining(tvb, offs) > 0) {
+ if (tvb_reported_length_remaining(tvb, offs) > 0) {
/* we have remaining data, which we need to mark in the tree */
if (tree) {
proto_tree_add_item(tree, hf_rlc_data, tvb, offs, -1, ENC_NA);
}
if (global_rlc_perform_reassemby) {
add_fragment(RLC_AM, tvb, pinfo, tree, offs, seq, i,
- tvb_length_remaining(tvb,offs), final);
+ tvb_captured_length_remaining(tvb,offs), final);
if (final) {
next_tvb = get_reassembled_data(RLC_AM, tvb, pinfo, tree, seq, i);
}
@@ -2310,7 +2310,7 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
if (global_rlc_li_size == RLC_LI_UPPERLAYER) {
if (rlcinf->li_size[pos] == RLC_LI_VARIABLE) {
- li_is_on_2_bytes = (tvb_length(tvb) > 126) ? TRUE : FALSE;
+ li_is_on_2_bytes = (tvb_reported_length(tvb) > 126) ? TRUE : FALSE;
} else {
li_is_on_2_bytes = (rlcinf->li_size[pos] == RLC_LI_15BITS) ? TRUE : FALSE;
}
@@ -2323,7 +2323,7 @@ dissect_rlc_am(enum rlc_channel_type channel, tvbuff_t *tvb, packet_info *pinfo,
offs += ((li_is_on_2_bytes) ? 2 : 1) * num_li;
if (global_rlc_headers_expected) {
/* There might not be any data, if only header was logged */
- is_truncated = (tvb_length_remaining(tvb, offs) == 0);
+ is_truncated = (tvb_reported_length_remaining(tvb, offs) == 0);
truncated_ti = proto_tree_add_boolean(tree, hf_rlc_header_only, tvb, 0, 0,
is_truncated);
if (is_truncated) {
@@ -2600,7 +2600,7 @@ dissect_rlc_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
- conditional header bytes
- tag for data
- at least one byte of RLC PDU payload */
- if (tvb_length_remaining(tvb, offset) < (gint)(strlen(RLC_START_STRING)+2+2)) {
+ if (tvb_captured_length_remaining(tvb, offset) < (gint)(strlen(RLC_START_STRING)+2+2)) {
return FALSE;
}
diff --git a/epan/dissectors/packet-rlm.c b/epan/dissectors/packet-rlm.c
index c91c052f27..b23800449a 100644
--- a/epan/dissectors/packet-rlm.c
+++ b/epan/dissectors/packet-rlm.c
@@ -130,7 +130,7 @@ dissect_rlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
rlm_type = tvb_get_guint8(tvb, 1);
/* we only know about version 2, and I've only seen 8 byte packets */
- if (tvb_length(tvb) != 8 || version != 2) {
+ if (tvb_captured_length(tvb) != 8 || version != 2) {
return FALSE;
}
diff --git a/epan/dissectors/packet-rlogin.c b/epan/dissectors/packet-rlogin.c
index 0a02b39d34..a292312839 100644
--- a/epan/dissectors/packet-rlogin.c
+++ b/epan/dissectors/packet-rlogin.c
@@ -117,7 +117,7 @@ rlogin_state_machine(rlogin_hash_entry_t *hash_info, tvbuff_t *tvb, packet_info
}
/* exit if no data */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length == 0)
{
return;
@@ -192,7 +192,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
rlogin_tree = proto_item_add_subtree(ti, ett_rlogin);
/* Return if data empty */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length == 0)
{
return;
@@ -256,7 +256,7 @@ static void rlogin_display(rlogin_hash_entry_t *hash_info,
/* First frame of conversation, assume user info... */
- info_len = tvb_length_remaining(tvb, offset);
+ info_len = tvb_captured_length_remaining(tvb, offset);
if (info_len <= 0)
return;
@@ -416,7 +416,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
/* Work out packet content summary for display */
- length = tvb_length(tvb);
+ length = tvb_reported_length(tvb);
if (length != 0)
{
/* Initial NULL byte represents part of connection handshake */
@@ -447,7 +447,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
else
{
/* Show any text data in the frame */
- int bytes_to_copy = tvb_length(tvb);
+ int bytes_to_copy = tvb_captured_length(tvb);
if (bytes_to_copy > 128)
{
/* Truncate to 128 bytes for display */
@@ -468,7 +468,7 @@ dissect_rlogin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
/* Dissect in detail */
rlogin_display(hash_info, tvb, pinfo, tree, tcpinfo);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-rmcp.c b/epan/dissectors/packet-rmcp.c
index eb42381866..dd3ddce298 100644
--- a/epan/dissectors/packet-rmcp.c
+++ b/epan/dissectors/packet-rmcp.c
@@ -143,13 +143,13 @@ dissect_rmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (!dissector_try_uint(rmcp_dissector_table, rmcp_class, next_tvb, pinfo,
tree)) {
len = call_dissector(data_handle, next_tvb, pinfo, tree);
- if (len < tvb_length(next_tvb)) {
+ if (len < tvb_reported_length(next_tvb)) {
proto_tree_add_item(tree, hf_rmcp_trailer, tvb, 4 + len, -1, ENC_NA);
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -178,7 +178,7 @@ dissect_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
next_tvb = tvb_new_subset_remaining(tvb, 8);
dissect_rmcp(next_tvb, pinfo, tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index ca5a1b6c1f..002731b093 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -501,8 +501,8 @@ dissect_rohc_ext_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
offset++;
} else {
proto_tree_add_expert_format(tree, pinfo, &ei_rohc_not_dissected_yet, tvb, offset, -1, "extension 3 [Not dissected yet]");
- if (tvb_length_remaining(tvb, offset) > 0)
- offset += tvb_length_remaining(tvb, offset);
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
}
@@ -1898,17 +1898,17 @@ dissect_rohc_ir_packet(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
switch(profile){
case ROHC_PROFILE_UNCOMPRESSED:
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
oct = tvb_get_guint8(tvb, offset);
if ( (oct&0xf0) == 0x60 ) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ipv6_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
else if ( (oct&0xf0) == 0x40 ) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ip_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC <");
col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
@@ -2065,7 +2065,7 @@ dissect_rohc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
memset(&g_rohc_info, 0, sizeof(rohc_info));
}
- length = tvb_length(tvb);
+ length = tvb_reported_length(tvb);
/* If this is ROHC ethertype clear col */
if ( pinfo->src.type == AT_ETHER ){
@@ -2153,7 +2153,7 @@ start_over:
p_rohc_info->last_created_item = proto_tree_add_item(rohc_tree, hf_rohc_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
col_append_str(pinfo->cinfo, COL_INFO, "Error packet");
proto_tree_add_item(rohc_tree, hf_rohc_error_packet, tvb, offset, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}else{
col_append_str(pinfo->cinfo, COL_INFO, "Feedback ");
/* 4) If the first remaining octet starts with 11110, and an Add-CID
@@ -2206,7 +2206,7 @@ start_over:
goto start_over;
proto_item_set_len(p_rohc_info->last_created_item, offset-feedback_start);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}/*feedback */
/* 5) If the first remaining octet starts with 1111111, this is a segment:
@@ -2219,7 +2219,7 @@ start_over:
PROTO_ITEM_SET_GENERATED(item);
}
proto_tree_add_expert(rohc_tree, pinfo, &ei_rohc_desegmentation_not_implemented, tvb, offset, -1);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* 6) Here, it is known that the rest is forward information (unless the
* header is damaged).
@@ -2229,24 +2229,24 @@ start_over:
offset = dissect_rohc_ir_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
if(offset == -1){
/* Could not parse header */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, rohc_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if((oct&0xff) == 0xf8){
col_append_str(pinfo->cinfo, COL_INFO, "IR-DYN packet");
offset = dissect_rohc_ir_dyn_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
if(offset == -1){
/* Could not parse header */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, rohc_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if (!pinfo->fd->flags.visited){
@@ -2281,7 +2281,7 @@ start_over:
guint8 *payload_data;
gint len;
get_self_describing_var_len_val(tvb, rohc_tree, offset+1, hf_rohc_large_cid, &val_len);
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if (len >= val_len) {
len -= val_len;
payload_data = (guint8 *)wmem_alloc(pinfo->pool, len);
@@ -2305,7 +2305,7 @@ start_over:
}
col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC <");
col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
else if (((oct&0x80)==0x00) && (rohc_cid_context->profile==ROHC_PROFILE_RTP)) {
/* 5.7.1. Packet type 0: UO-0, R-0, R-0-CRC */
@@ -2339,7 +2339,7 @@ start_over:
payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(data_handle, payload_tvb, pinfo, tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Set up rohc_cid_hash which holds data for a CID
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c
index 2a9e7864b0..70f81fe03f 100644
--- a/epan/dissectors/packet-rpcap.c
+++ b/epan/dissectors/packet-rpcap.c
@@ -374,7 +374,7 @@ dissect_rpcap_error (tvbuff_t *tvb, packet_info *pinfo,
proto_item *ti;
gint len;
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
if (len <= 0)
return;
@@ -498,7 +498,7 @@ dissect_rpcap_findalldevs_if (tvbuff_t *tvb, packet_info *pinfo _U_,
for (i = 0; i < naddr; i++) {
offset = dissect_rpcap_findalldevs_ifaddr (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_reported_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -524,7 +524,7 @@ dissect_rpcap_findalldevs_reply (tvbuff_t *tvb, packet_info *pinfo _U_,
for (i = 0; i < no_devs; i++) {
offset = dissect_rpcap_findalldevs_if (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_reported_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -613,7 +613,7 @@ dissect_rpcap_filter (tvbuff_t *tvb, packet_info *pinfo,
for (i = 0; i < nitems; i++) {
offset = dissect_rpcap_filterbpf_insn (tvb, pinfo, tree, offset);
- if (tvb_length_remaining (tvb, offset) < 0) {
+ if (tvb_reported_length_remaining (tvb, offset) < 0) {
/* No more data in packet */
expert_add_info(pinfo, ti, &ei_no_more_data);
break;
@@ -673,7 +673,7 @@ dissect_rpcap_open_request (tvbuff_t *tvb, packet_info *pinfo _U_,
{
gint len;
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
proto_tree_add_item (parent_tree, hf_open_request, tvb, offset, len, ENC_ASCII|ENC_NA);
}
@@ -866,7 +866,7 @@ dissect_rpcap_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree,
* reported_length_remaining should not be -1, as offset is at
* most right past the end of the available data in the packet.
*/
- reported_length_remaining = tvb_length_remaining (tvb, offset);
+ reported_length_remaining = tvb_reported_length_remaining (tvb, offset);
if (caplen > (guint)reported_length_remaining) {
expert_add_info(pinfo, ti, &ei_caplen_too_big);
return;
@@ -972,7 +972,7 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, void* da
dissect_rpcap_stats_reply (tvb, pinfo, tree, offset);
break;
default:
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_reported_length_remaining (tvb, offset);
if (len) {
/* Yet unknown, dump as data */
proto_item_set_len (ti, 8);
@@ -982,7 +982,7 @@ dissect_rpcap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree, void* da
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -994,7 +994,7 @@ check_rpcap_heur (tvbuff_t *tvb, gboolean tcp)
guint16 msg_value;
guint32 plen, len, caplen;
- if (tvb_length (tvb) < 8)
+ if (tvb_captured_length (tvb) < 8)
/* Too short */
return FALSE;
@@ -1028,7 +1028,7 @@ check_rpcap_heur (tvbuff_t *tvb, gboolean tcp)
plen = tvb_get_ntohl (tvb, offset);
offset += 4;
- len = (guint32) tvb_length_remaining (tvb, offset);
+ len = (guint32) tvb_reported_length_remaining (tvb, offset);
switch (msg_type) {
diff --git a/epan/dissectors/packet-rpl.c b/epan/dissectors/packet-rpl.c
index 8a69546038..c88a54faff 100644
--- a/epan/dissectors/packet-rpl.c
+++ b/epan/dissectors/packet-rpl.c
@@ -139,7 +139,7 @@ dissect_rpl_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str_const(subtyp,
rpl_type_vals,
"Unknown Type"));
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length > sublen)
length = sublen;
reported_length = tvb_reported_length_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-rsh.c b/epan/dissectors/packet-rsh.c
index 26ec6e3c17..1653c77e2a 100644
--- a/epan/dissectors/packet-rsh.c
+++ b/epan/dissectors/packet-rsh.c
@@ -228,12 +228,12 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* then it must be session data only and we can skip looking
* for the other fields.
*/
- if(tvb_find_guint8(tvb, tvb_length(tvb)-1, 1, '\0') == -1){
+ if(tvb_find_guint8(tvb, tvb_captured_length(tvb)-1, 1, '\0') == -1){
hash_info->state = WAIT_FOR_DATA;
}
if(hash_info->state == WAIT_FOR_STDERR_PORT
- && tvb_length_remaining(tvb, offset)){
+ && tvb_reported_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the stderr_port field.
@@ -256,7 +256,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_CLIENT_USERNAME
- && tvb_length_remaining(tvb, offset)){
+ && tvb_reported_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the username field */
@@ -284,7 +284,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_SERVER_USERNAME
- && tvb_length_remaining(tvb, offset)){
+ && tvb_reported_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the password field */
@@ -314,7 +314,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_COMMAND
- && tvb_length_remaining(tvb, offset)){
+ && tvb_reported_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the command field */
@@ -337,7 +337,7 @@ dissect_rsh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_DATA
- && tvb_length_remaining(tvb, offset)){
+ && tvb_reported_length_remaining(tvb, offset)){
if(pinfo->destport == RSH_PORT){
/* Packet going to the server */
/* offset = 0 since the whole packet is data */
diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c
index 6f939c1937..67d9b22372 100644
--- a/epan/dissectors/packet-rsvp.c
+++ b/epan/dissectors/packet-rsvp.c
@@ -7469,7 +7469,7 @@ dissect_rsvp_msg_tree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* We delay the checksum check until here so we know if the message
* contained an integrity object or not */
- if (!pinfo->fragmented && ((int) tvb_length(tvb) >= msg_length)) {
+ if (!pinfo->fragmented && ((int) tvb_captured_length(tvb) >= msg_length)) {
/* The packet isn't part of a fragmented datagram and isn't
truncated, so we can checksum it. */
SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, msg_length);
@@ -7621,7 +7621,7 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP");
dissect_rsvp_common(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -7630,7 +7630,7 @@ dissect_rsvp_e2ei(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSVP-E2EI");
dissect_rsvp_common(tvb, pinfo, tree, TRUE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-rsync.c b/epan/dissectors/packet-rsync.c
index fd48eae16f..23a358954b 100644
--- a/epan/dissectors/packet-rsync.c
+++ b/epan/dissectors/packet-rsync.c
@@ -218,7 +218,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(rsync_tree, &hfi_rsync_module_list_string, tvb, offset, -1, ENC_ASCII|ENC_NA);
/* we need to check the end of the buffer for magic string */
- buff_length = tvb_length_remaining(tvb, offset);
+ buff_length = tvb_captured_length_remaining(tvb, offset);
if (buff_length > RSYNCD_EXIT_LEN &&
0 == tvb_strneql(tvb, buff_length-RSYNCD_EXIT_LEN-1, RSYNCD_EXIT, RSYNCD_EXIT_LEN)) {
/* that's all, folks */
@@ -261,9 +261,9 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_data->client_state = RSYNC_COMMAND;
- if (tvb_length(tvb) == RSYNC_MODULE_LIST_QUERY_LEN &&
+ if (tvb_captured_length(tvb) == RSYNC_MODULE_LIST_QUERY_LEN &&
0 == tvb_strneql(tvb, offset, RSYNC_MODULE_LIST_QUERY, RSYNC_MODULE_LIST_QUERY_LEN)) {
- conversation_data->server_state = RSYNC_MODULE_LIST;
+ conversation_data->server_state = RSYNC_MODULE_LIST;
} else {
conversation_data->server_state = RSYNC_DATA;
}
@@ -295,7 +295,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Packet dissection routine called by tcp (& udp) when port 873 detected */
diff --git a/epan/dissectors/packet-rtacser.c b/epan/dissectors/packet-rtacser.c
index 64fdb2f6ab..c150a1dcd0 100644
--- a/epan/dissectors/packet-rtacser.c
+++ b/epan/dissectors/packet-rtacser.c
@@ -229,7 +229,7 @@ dissect_rtacser_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
static int
dissect_rtacser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a RTAC Serial packet. It should be at least 12 bytes */
if(length < 12) {
@@ -239,7 +239,7 @@ dissect_rtacser(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
dissect_rtacser_data(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/******************************************************************************************************/
diff --git a/epan/dissectors/packet-rtcdc.c b/epan/dissectors/packet-rtcdc.c
index faeca65080..cbee3e9f3b 100644
--- a/epan/dissectors/packet-rtcdc.c
+++ b/epan/dissectors/packet-rtcdc.c
@@ -141,7 +141,7 @@ dissect_open_request_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
static void
dissect_open_response_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree, proto_item *rtcdc_item)
{
- if (tvb_length(tvb) > DATA_CHANNEL_RESPONSE_LENGTH) {
+ if (tvb_reported_length(tvb) > DATA_CHANNEL_RESPONSE_LENGTH) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long);
}
if (rtcdc_tree) {
@@ -157,7 +157,7 @@ dissect_open_response_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtc
static void
dissect_open_ack_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rtcdc_tree _U_, proto_item *rtcdc_item)
{
- if (tvb_length(tvb) > DATA_CHANNEL_ACK_LENGTH) {
+ if (tvb_reported_length(tvb) > DATA_CHANNEL_ACK_LENGTH) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_message_too_long);
}
return;
@@ -219,7 +219,7 @@ dissect_new_open_request_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
}
label_length = tvb_get_ntohs(tvb, NEW_LABEL_LENGTH_OFFSET);
protocol_length = tvb_get_ntohs(tvb, NEW_PROTOCOL_LENGTH_OFFSET);
- if (NEW_OPEN_REQUEST_HEADER_LENGTH + (guint)label_length + (guint)protocol_length != tvb_length(tvb)) {
+ if (NEW_OPEN_REQUEST_HEADER_LENGTH + (guint)label_length + (guint)protocol_length != tvb_reported_length(tvb)) {
expert_add_info(pinfo, rtcdc_item, &ei_rtcdc_inconsistent_label_and_parameter_length);
}
if (rtcdc_tree) {
@@ -266,7 +266,7 @@ dissect_rtcdc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
expert_add_info(pinfo, msg_item, &ei_rtcdc_message_type_unknown);
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rtpproxy.c b/epan/dissectors/packet-rtpproxy.c
index 298617510e..4668752832 100644
--- a/epan/dissectors/packet-rtpproxy.c
+++ b/epan/dissectors/packet-rtpproxy.c
@@ -899,7 +899,7 @@ dissect_rtpproxy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (has_lf)
proto_tree_add_item(rtpproxy_tree, hf_rtpproxy_lf, tvb, realsize, 1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c
index 94bffb3466..dab24be5af 100644
--- a/epan/dissectors/packet-rtsp.c
+++ b/epan/dissectors/packet-rtsp.c
@@ -1152,7 +1152,7 @@ dissect_rtspmessage(tvbuff_t *tvb, int offset, packet_info *pinfo,
* was supplied), the amount of data to be processed is the amount
* of data remaining in the frame.
*/
- datalen = tvb_length_remaining(tvb, offset);
+ datalen = tvb_captured_length_remaining(tvb, offset);
reported_datalen = tvb_reported_length_remaining(tvb, offset);
if (content_length != -1) {
/*
diff --git a/epan/dissectors/packet-rudp.c b/epan/dissectors/packet-rudp.c
index 13bbae29c8..817b157d05 100644
--- a/epan/dissectors/packet-rudp.c
+++ b/epan/dissectors/packet-rudp.c
@@ -135,7 +135,7 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
next_tvb = tvb_new_subset_remaining(tvb, hlen);
- if (tvb_length(next_tvb) && sm_handle)
+ if (tvb_captured_length(next_tvb) && sm_handle)
call_dissector(sm_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-rx.c b/epan/dissectors/packet-rx.c
index 0ac7b255ac..e98a50517c 100644
--- a/epan/dissectors/packet-rx.c
+++ b/epan/dissectors/packet-rx.c
@@ -378,7 +378,7 @@ dissect_rx_acks(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int
* any sort of documentation other than "read the source of any of the
* (compatible?) implementations.
*/
- if (tvb_length_remaining(tvb, offset)>3) {
+ if (tvb_reported_length_remaining(tvb, offset)>3) {
offset += 3; /* guess. some implementations add 3 bytes */
if (tvb_reported_length_remaining(tvb, offset) >= 4){
@@ -441,7 +441,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
guint16 serviceid;
/* Ensure we have enough data */
- if (tvb_length(tvb) < 28)
+ if (tvb_captured_length(tvb) < 28)
return 0;
/* Make sure it's a known type */
@@ -561,7 +561,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *dat
break;
}
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
void