aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-06-21 06:48:58 -0400
committerAnders Broman <a.broman58@gmail.com>2015-06-21 22:38:59 +0000
commitebc8ec83fdaefd6253aeb8db587f2d3b413fc340 (patch)
tree54c523d543a8e2ea7866e13ba062e2524202fa23 /epan
parenta2e2c1f99783b5ad1048e9bba5b7a2834680b5fd (diff)
Remove deprecated tvb_length from a bunch of dissectors
Change-Id: I5c777806cb1403062a9d85261149d722df57b239 Reviewed-on: https://code.wireshark.org/review/9005 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-v150fw.c6
-rw-r--r--epan/dissectors/packet-v5dl.c10
-rw-r--r--epan/dissectors/packet-vines.c2
-rw-r--r--epan/dissectors/packet-vlan.c2
-rw-r--r--epan/dissectors/packet-vnc.c4
-rw-r--r--epan/dissectors/packet-vrrp.c2
-rw-r--r--epan/dissectors/packet-wassp.c2
-rw-r--r--epan/dissectors/packet-waveagent.c6
-rw-r--r--epan/dissectors/packet-wccp.c2
-rw-r--r--epan/dissectors/packet-wifi-p2p.c6
-rw-r--r--epan/dissectors/packet-winsrepl.c4
-rw-r--r--epan/dissectors/packet-wol.c2
-rw-r--r--epan/dissectors/packet-wow.c2
-rw-r--r--epan/dissectors/packet-wsp.c2
-rw-r--r--epan/dissectors/packet-wtls.c4
-rw-r--r--epan/dissectors/packet-wtp.c4
-rw-r--r--epan/dissectors/packet-x25.c4
-rw-r--r--epan/dissectors/packet-x29.c2
-rw-r--r--epan/dissectors/packet-xcsl.c5
-rw-r--r--epan/dissectors/packet-xmcp.c8
-rw-r--r--epan/dissectors/packet-xml.c4
-rw-r--r--epan/dissectors/packet-xot.c20
22 files changed, 51 insertions, 52 deletions
diff --git a/epan/dissectors/packet-v150fw.c b/epan/dissectors/packet-v150fw.c
index a6d3a18d70..44b0926b8d 100644
--- a/epan/dissectors/packet-v150fw.c
+++ b/epan/dissectors/packet-v150fw.c
@@ -254,7 +254,7 @@ dissect_v150fw_heur(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_)
guint8 octet1;
guint8 extb, ric;
guint16 ric_info;
- gint payload_length = tvb_length(tvb);
+ gint payload_length = tvb_captured_length(tvb);
unsigned int offset = 0;
/* see appendix C (State Signalling Events) in ITU-T Rec. V.150.1 for details */
@@ -318,7 +318,7 @@ dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *da
ti = proto_tree_add_item(tree, proto_v150fw, tvb, 0, -1, ENC_NA);
v150fw_tree = proto_item_add_subtree(ti, ett_v150fw);
- payload_length = tvb_length(tvb);
+ payload_length = tvb_reported_length(tvb);
/* Get fields needed for further dissection */
extb = tvb_get_guint8(tvb, offset) & 0x01; /* extension bit */
@@ -399,7 +399,7 @@ dissect_v150fw(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-v5dl.c b/epan/dissectors/packet-v5dl.c
index 455f029618..b16f9fd15d 100644
--- a/epan/dissectors/packet-v5dl.c
+++ b/epan/dissectors/packet-v5dl.c
@@ -225,9 +225,9 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Check the checksum, if available.
* The checksum is a CCITT CRC-16 at the end of the packet, so
* if we don't have the entire packet in the capture - i.e., if
- * tvb_length(tvb) != tvb_reported_length(tvb) we can't check it.
+ * tvb_captured_length(tvb) != tvb_reported_length(tvb) we can't check it.
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
/*
@@ -270,7 +270,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* Remove the V5DL header *and* the checksum.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len) - 2,
+ tvb_captured_length_remaining(tvb, v5dl_header_len) - 2,
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
} else {
/*
@@ -285,7 +285,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* and both bytes from the reported length.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len) - 1,
+ tvb_captured_length_remaining(tvb, v5dl_header_len) - 1,
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
} else {
/*
@@ -295,7 +295,7 @@ dissect_v5dl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* length.
*/
next_tvb = tvb_new_subset(tvb, v5dl_header_len,
- tvb_length_remaining(tvb, v5dl_header_len),
+ tvb_captured_length_remaining(tvb, v5dl_header_len),
tvb_reported_length_remaining(tvb, v5dl_header_len) - 2);
}
}
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index e9406f9e5c..6996a1f3dc 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -374,7 +374,7 @@ dissect_vines_frp_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return 0;
}
dissect_vines_frp(tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-vlan.c b/epan/dissectors/packet-vlan.c
index 5217c6da71..5f7d258bcc 100644
--- a/epan/dissectors/packet-vlan.c
+++ b/epan/dissectors/packet-vlan.c
@@ -179,7 +179,7 @@ dissect_vlan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
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;
}
diff --git a/epan/dissectors/packet-vnc.c b/epan/dissectors/packet-vnc.c
index 47b9da0b90..1e75c01b95 100644
--- a/epan/dissectors/packet-vnc.c
+++ b/epan/dissectors/packet-vnc.c
@@ -1037,7 +1037,7 @@ process_tight_capabilities(proto_tree *tree,
static gboolean
vnc_is_client_or_server_version_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- if(tvb_length(tvb) != 12) {
+ if(tvb_captured_length(tvb) != 12) {
return FALSE;
}
@@ -1545,7 +1545,7 @@ vnc_startup_messages(tvbuff_t *tvb, packet_info *pinfo, gint offset,
tvb, offset, 3, ENC_NA);
offset += 3; /* Skip over 3 bytes of padding */
- if(tvb_length_remaining(tvb, offset) > 4) {
+ if(tvb_reported_length_remaining(tvb, offset) > 4) {
/* Sometimes the desktop name & length is skipped */
proto_tree_add_item(tree, hf_vnc_desktop_name_len,
tvb, offset, 4, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-vrrp.c b/epan/dissectors/packet-vrrp.c
index 56be004d72..00da577395 100644
--- a/epan/dissectors/packet-vrrp.c
+++ b/epan/dissectors/packet-vrrp.c
@@ -173,7 +173,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
cksum = tvb_get_ntohs(tvb, offset);
vrrp_len = (gint)tvb_reported_length(tvb);
- if (!pinfo->fragmented && (gint)tvb_length(tvb) >= vrrp_len) {
+ if (!pinfo->fragmented && (gint)tvb_captured_length(tvb) >= vrrp_len) {
/* The packet isn't part of a fragmented datagram
and isn't truncated, so we can checksum it. */
switch(hi_nibble(ver_type)) {
diff --git a/epan/dissectors/packet-wassp.c b/epan/dissectors/packet-wassp.c
index 678c467dca..a5245f9619 100644
--- a/epan/dissectors/packet-wassp.c
+++ b/epan/dissectors/packet-wassp.c
@@ -974,7 +974,7 @@ static gboolean
test_wassp(tvbuff_t *tvb)
{
/* Minimum of 8 bytes, first byte (version) has value of 3 */
- if ( tvb_length(tvb) < 8
+ if ( tvb_captured_length(tvb) < 8
|| tvb_get_guint8(tvb, 0) != 3
/* || tvb_get_guint8(tvb, 2) != 0
|| tvb_get_ntohs(tvb, 6) > tvb_reported_length(tvb) */
diff --git a/epan/dissectors/packet-waveagent.c b/epan/dissectors/packet-waveagent.c
index 0de2107537..dbdbc107ef 100644
--- a/epan/dissectors/packet-waveagent.c
+++ b/epan/dissectors/packet-waveagent.c
@@ -1003,7 +1003,7 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
guint32 wa_payload_offset;
/* Check that there's enough data */
- if (tvb_length(tvb) < 52 )
+ if (tvb_reported_length(tvb) < 52 )
return 0;
magic_number = tvb_get_ntohl(tvb, 16) & 0x0FFFFFFF; /* Mask magic number off */
@@ -1071,8 +1071,8 @@ static int dissect_waveagent(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
dissect_wa_payload(wa_payload_offset, payload_tree, tvb, control_word, version);
}
-/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ /* Return the amount of data this dissector was able to dissect */
+ return tvb_captured_length(tvb);
}
static gboolean dissect_waveagent_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
diff --git a/epan/dissectors/packet-wccp.c b/epan/dissectors/packet-wccp.c
index 3b65429f21..a4b65ace69 100644
--- a/epan/dissectors/packet-wccp.c
+++ b/epan/dissectors/packet-wccp.c
@@ -812,7 +812,7 @@ dissect_wccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
diff --git a/epan/dissectors/packet-wifi-p2p.c b/epan/dissectors/packet-wifi-p2p.c
index 9c255602ff..aeffb3d4dc 100644
--- a/epan/dissectors/packet-wifi-p2p.c
+++ b/epan/dissectors/packet-wifi-p2p.c
@@ -1209,7 +1209,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- while (tvb_length_remaining(tvb, offset) >= (request ? 4 : 5)) {
+ while (tvb_reported_length_remaining(tvb, offset) >= (request ? 4 : 5)) {
guint16 len;
proto_tree *tlv;
guint8 type, id, sd_proto;
@@ -1219,7 +1219,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short Service TLV field");
return;
}
- if (len > tvb_length_remaining(tvb, offset + 2)) {
+ if (len > tvb_reported_length_remaining(tvb, offset + 2)) {
expert_add_info_format(pinfo, item, &ei_wifi_p2p_anqp_length, "Too short frame for Service TLV field");
return;
}
@@ -1252,7 +1252,7 @@ void dissect_wifi_p2p_anqp(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
offset += len;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
expert_add_info(pinfo, item, &ei_wifi_p2p_anqp_unexpected_padding);
}
}
diff --git a/epan/dissectors/packet-winsrepl.c b/epan/dissectors/packet-winsrepl.c
index e9714e3f05..ddae5af02c 100644
--- a/epan/dissectors/packet-winsrepl.c
+++ b/epan/dissectors/packet-winsrepl.c
@@ -673,7 +673,7 @@ dissect_winsrepl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -690,7 +690,7 @@ static int
dissect_winsrepl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, winsrepl_reassemble, 4, get_winsrepl_pdu_len, dissect_winsrepl_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-wol.c b/epan/dissectors/packet-wol.c
index a0639e3120..adddd37657 100644
--- a/epan/dissectors/packet-wol.c
+++ b/epan/dissectors/packet-wol.c
@@ -96,7 +96,7 @@ dissect_wol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
* in Wireshark handing an HTTP packet to your dissector). For example:
*/
/* Check that there's enough data */
- len = tvb_length(tvb);
+ len = tvb_reported_length(tvb);
if ( len < 102 ) /* wol's smallest packet size is 102 */
return (0);
diff --git a/epan/dissectors/packet-wow.c b/epan/dissectors/packet-wow.c
index 32e90f9ff6..766de88930 100644
--- a/epan/dissectors/packet-wow.c
+++ b/epan/dissectors/packet-wow.c
@@ -395,7 +395,7 @@ dissect_wow_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index a1889c8269..179feccd7c 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -4062,7 +4062,7 @@ add_addresses(proto_tree *tree, tvbuff_t *tvb, int hf)
guint8 bearer_type;
guint8 address_flags_len;
int address_len;
- guint32 tvb_len = tvb_length(tvb);
+ guint32 tvb_len = tvb_reported_length(tvb);
guint32 offset = 0;
guint32 idx = 0; /* Address index */
guint32 address_record_len; /* Length of the entire address record */
diff --git a/epan/dissectors/packet-wtls.c b/epan/dissectors/packet-wtls.c
index f558621f63..5bb33b5f6f 100644
--- a/epan/dissectors/packet-wtls.c
+++ b/epan/dissectors/packet-wtls.c
@@ -365,7 +365,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
count += offset-offset_wtls;
}
else {
- count = tvb_length_remaining (tvb, offset_wtls);
+ count = tvb_reported_length_remaining (tvb, offset_wtls);
}
ti = proto_tree_add_uint(wtls_tree, hf_wtls_record, tvb, offset_wtls,
count, pdut);
@@ -392,7 +392,7 @@ dissect_wtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+=2;
}
else {
- count = tvb_length_remaining (tvb, offset);
+ count = tvb_reported_length_remaining (tvb, offset);
}
if (pdut & WTLS_RECORD_TYPE_CIPHER_CUR) {
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index 4ca431b9d4..f356b9bbee 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -276,7 +276,7 @@ wtp_handle_tpi(proto_tree *tree, tvbuff_t *tvb)
else
tLen = tByte & 0x03;
pi = proto_tree_add_uint(tree, hf_wtp_tpi_type,
- tvb, 0, tvb_length(tvb), tType);
+ tvb, 0, tvb_captured_length(tvb), tType);
subTree = proto_item_add_subtree(pi, ett_tpilist);
switch (tType) {
case 0x00: /* Error*/
@@ -400,7 +400,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
printf("WTP packet %u: tree = %p, pdu = %s (%u) length: %u\n",
pinfo->fd->num, tree,
val_to_str(pdut, vals_wtp_pdu_type, "Unknown PDU type 0x%x"),
- pdut, tvb_length(tvb));
+ pdut, tvb_captured_length(tvb));
#endif
/* Develop the string to put in the Info column */
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index 742a41cb9a..d9535981a3 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -1461,7 +1461,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* We don't know what it is; just skip it.
*/
- localoffset = tvb_length(tvb);
+ localoffset = tvb_reported_length(tvb);
} else if (is_x_264) {
/* It looks like an X.264 UN TPDU, so show it as such. */
if (userdata_tree) {
@@ -1954,7 +1954,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (payload_check_data){
/* If the Call Req. has not been captured, let's look at the first
two bytes of the payload to see if this looks like COTP. */
- if (tvb_get_guint8(tvb, localoffset) == tvb_length(next_tvb)-1) {
+ if (tvb_get_guint8(tvb, localoffset) == tvb_reported_length(next_tvb)-1) {
/* First byte contains the length of the remaining buffer */
if ((tvb_get_guint8(tvb, localoffset+1) & 0x0F) == 0) {
/* Second byte contains a valid COTP TPDU */
diff --git a/epan/dissectors/packet-x29.c b/epan/dissectors/packet-x29.c
index b6fde4e0a0..cdffad2443 100644
--- a/epan/dissectors/packet-x29.c
+++ b/epan/dissectors/packet-x29.c
@@ -233,7 +233,7 @@ dissect_x29(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-xcsl.c b/epan/dissectors/packet-xcsl.c
index 9328157efa..9facf1ce90 100644
--- a/epan/dissectors/packet-xcsl.c
+++ b/epan/dissectors/packet-xcsl.c
@@ -299,11 +299,10 @@ static void dissect_xcsl_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* This function determines whether the first 4 octets equals to xcsl and the fifth is an ; or - */
static gboolean dissect_xcsl_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
guint8 *protocol;
- if (tvb_length_remaining (tvb, offset) >= 5) {
- protocol = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 5, ENC_ASCII);
+ if (tvb_captured_length (tvb) >= 5) {
+ protocol = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 5, ENC_ASCII);
if (strncmp(protocol,"xcsl",4) == 0 && (protocol[4] == ';' || protocol[4] == '-')) {
diff --git a/epan/dissectors/packet-xmcp.c b/epan/dissectors/packet-xmcp.c
index ed77ab9ed4..da0f7bf430 100644
--- a/epan/dissectors/packet-xmcp.c
+++ b/epan/dissectors/packet-xmcp.c
@@ -937,7 +937,7 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
msg_length = tvb_get_ntohs(tvb, 2);
if ((guint)(msg_length + XMCP_HDR_LEN) > tvb_reported_length(tvb)) {
expert_add_info_format(pinfo, ti, &ei_xmcp_length_bad, "XMCP message length (%u-byte header + %u) exceeds packet length (%u)", XMCP_HDR_LEN, msg_length, tvb_reported_length(tvb));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* ...a 4 byte magic cookie... */
@@ -1044,7 +1044,7 @@ dissect_xmcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1052,14 +1052,14 @@ dissect_xmcp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, XMCP_HDR_LEN,
get_xmcp_message_len, dissect_xmcp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
dissect_xmcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
/* See if this looks like a real XMCP packet */
- if (tvb_length(tvb) < XMCP_HDR_LEN) {
+ if (tvb_captured_length(tvb) < XMCP_HDR_LEN) {
return FALSE;
}
/* Check for valid message type field */
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index 5f493b3fb0..fe7a108e55 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -235,8 +235,8 @@ static gboolean dissect_xml_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
return TRUE;
} else if (pref_heuristic_unicode) {
/* XXX - UCS-2, or UTF-16? */
- const guint8 *data_str = tvb_get_string_enc(NULL, tvb, 0, tvb_length(tvb), ENC_UCS_2|ENC_LITTLE_ENDIAN);
- tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_length(tvb)/2, tvb_length(tvb)/2);
+ const guint8 *data_str = tvb_get_string_enc(NULL, tvb, 0, tvb_captured_length(tvb), ENC_UCS_2|ENC_LITTLE_ENDIAN);
+ tvbuff_t *unicode_tvb = tvb_new_child_real_data(tvb, data_str, tvb_captured_length(tvb)/2, tvb_captured_length(tvb)/2);
tvb_set_free_cb(unicode_tvb, g_free);
if (tvbparse_peek(tvbparse_init(unicode_tvb, 0, -1, NULL, want_ignore), want_heur)) {
add_new_data_source(pinfo, unicode_tvb, "UTF8");
diff --git a/epan/dissectors/packet-xot.c b/epan/dissectors/packet-xot.c
index 2647a262fa..915563d5ae 100644
--- a/epan/dissectors/packet-xot.c
+++ b/epan/dissectors/packet-xot.c
@@ -107,7 +107,7 @@ static guint get_xot_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb,
int offset, void *data _U_)
{
guint16 plen;
- int remain = tvb_length_remaining(tvb, offset);
+ int remain = tvb_captured_length_remaining(tvb, offset);
if ( remain < XOT_HEADER_LENGTH){
/* We did not get the data we asked for, use up what we can */
return remain;
@@ -127,7 +127,7 @@ static guint get_xot_pdu_len_mult(packet_info *pinfo _U_, tvbuff_t *tvb,
int offset_next = offset + XOT_HEADER_LENGTH + X25_MIN_HEADER_LENGTH;
int tvb_len;
- while (tvb_len = tvb_length_remaining(tvb, offset), tvb_len>0){
+ while (tvb_len = tvb_captured_length_remaining(tvb, offset), tvb_len>0){
guint16 plen = 0;
int modulo;
guint16 bytes0_1;
@@ -204,9 +204,9 @@ static int dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_add_fstr(pinfo->cinfo, COL_INFO, "XOT Version = %u, size = %u",
version, plen);
if (offset == 0 &&
- tvb_length_remaining(tvb, offset) > XOT_HEADER_LENGTH + plen )
+ tvb_reported_length_remaining(tvb, offset) > XOT_HEADER_LENGTH + plen )
col_append_fstr(pinfo->cinfo, COL_INFO, " TotX25: %d",
- tvb_length_remaining(tvb, offset));
+ tvb_reported_length_remaining(tvb, offset));
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_xot, tvb, offset, XOT_HEADER_LENGTH,
@@ -268,12 +268,12 @@ static int dissect_xot_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(xot_tree, hf_xot_pvc_resp_itf_name, tvb, hdr_offset, resp_itf_name_len, ENC_ASCII|ENC_NA);
} else {
next_tvb = tvb_new_subset(tvb, offset,
- MIN(plen, tvb_length_remaining(tvb, offset)), plen);
+ MIN(plen, tvb_captured_length_remaining(tvb, offset)), plen);
call_dissector(x25_handle, next_tvb, pinfo, tree);
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
@@ -281,7 +281,7 @@ static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
int offset = 0;
int len = get_xot_pdu_len_mult(pinfo, tvb, offset, NULL);
tvbuff_t *next_tvb;
- int offset_max = offset+MIN(len,tvb_length_remaining(tvb, offset));
+ int offset_max = offset+MIN(len,tvb_captured_length_remaining(tvb, offset));
proto_item *ti;
proto_tree *xot_tree;
@@ -296,16 +296,16 @@ static int dissect_xot_mult(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
while (offset <= offset_max - XOT_HEADER_LENGTH){
int plen = get_xot_pdu_len(pinfo, tvb, offset, NULL);
next_tvb = tvb_new_subset(tvb, offset,plen, plen);
- /*MIN(plen,tvb_length_remaining(tvb, offset)),plen*/
+ /*MIN(plen,tvb_captured_length_remaining(tvb, offset)),plen*/
dissect_xot_pdu(next_tvb, pinfo, tree, data);
offset += plen;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_xot_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- int tvb_len = tvb_length(tvb);
+ int tvb_len = tvb_captured_length(tvb);
int len = 0;
if (tvb_len >= 2 && tvb_get_ntohs(tvb,0) != XOT_VERSION) {