aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-06-22 20:53:46 -0700
committerEvan Huus <eapache@gmail.com>2015-06-23 03:54:13 +0000
commit6fd7e5ba33dd9104803173086c1e79c42c2e3754 (patch)
treeeb0e9e98d6dda61eeaa83457a606e772543a940d
parent46e5fd833eb3e38cab9a10e5d93ce538558196d0 (diff)
Remove more deprecated tvb_length calls
Change-Id: I56260a82b19001ab2f87f4be34a9510f127f841f Reviewed-on: https://code.wireshark.org/review/9050 Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r--epan/dissectors/packet-edonkey.c8
-rw-r--r--epan/dissectors/packet-eigrp.c14
-rw-r--r--epan/dissectors/packet-elcom.c50
-rw-r--r--epan/dissectors/packet-enip.c16
-rw-r--r--epan/dissectors/packet-enrp.c10
-rw-r--r--epan/dissectors/packet-epl_v1.c2
-rw-r--r--epan/dissectors/packet-epmd.c12
-rw-r--r--epan/dissectors/packet-erldp.c14
-rw-r--r--epan/dissectors/packet-esio.c4
-rw-r--r--epan/dissectors/packet-etch.c6
-rw-r--r--epan/dissectors/packet-ethertype.c4
-rw-r--r--epan/dissectors/packet-exec.c12
-rw-r--r--epan/dissectors/packet-extreme.c2
-rw-r--r--epan/dissectors/packet-fc.c6
-rw-r--r--epan/dissectors/packet-fcct.c2
-rw-r--r--epan/dissectors/packet-fcdns.c2
-rw-r--r--epan/dissectors/packet-fcfcs.c2
-rw-r--r--epan/dissectors/packet-fcfzs.c6
-rw-r--r--epan/dissectors/packet-fcgi.c4
-rw-r--r--epan/dissectors/packet-fcip.c4
-rw-r--r--epan/dissectors/packet-fcoe.c4
21 files changed, 92 insertions, 92 deletions
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index 5cd27d4c9e..627592c2de 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -2859,7 +2859,7 @@ static int dissect_kademlia_udp_compressed_message(guint8 msg_type,
if (tvbraw) {
guint32 raw_length;
- raw_length = tvb_length( tvbraw );
+ raw_length = tvb_captured_length( tvbraw );
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
dissect_kademlia_udp_message( msg_type, tvbraw, pinfo, 0, raw_length, tree );
@@ -2971,12 +2971,12 @@ static int dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset+1, msg_len-1, ENC_NA);
emule_zlib_tree = proto_item_add_subtree(ti, ett_emule_zlib);
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
- (*dissector)(msg_type, tvbraw, pinfo, 0, tvb_length(tvbraw), emule_zlib_tree);
+ (*dissector)(msg_type, tvbraw, pinfo, 0, tvb_captured_length(tvbraw), emule_zlib_tree);
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_edonkey_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
@@ -3046,7 +3046,7 @@ static int dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
"%s (0x%02x)", message_name, msg_type);
offset += EDONKEY_UDP_HEADER_LENGTH;
- remainingLength = tvb_length_remaining( tvb, offset );
+ remainingLength = tvb_captured_length_remaining( tvb, offset );
if (remainingLength > 0) {
switch (protocol) {
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index d9a23e2a11..04e841ef7f 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -1103,7 +1103,7 @@ dissect_eigrp_ipv4_addr (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
proto_item *ti_prefixlen, *ti_dst;
int first = TRUE;
- for (; tvb_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
+ for (; tvb_reported_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
length = tvb_get_guint8(tvb, offset);
addr_len = ipv4_addr_and_mask(tvb, offset + 1, ip_addr, length);
@@ -1160,7 +1160,7 @@ dissect_eigrp_ipv6_addr (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
proto_item *ti_prefixlen, *ti_dst;
int first = TRUE;
- for (; tvb_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
+ for (; tvb_reported_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
length = tvb_get_guint8(tvb, offset);
addr_len = ipv6_addr_and_mask(tvb, offset + 1, &addr, length);
@@ -1286,12 +1286,12 @@ dissect_eigrp_service (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
tvbuff_t *sub_tvb, *reach_tvb;
guint16 service, sub_service;
- remaining = tvb_length_remaining(tvb, offset);
+ remaining = tvb_captured_length_remaining(tvb, offset);
sub_tree = proto_tree_add_subtree(tree, tvb, offset, remaining, ett_eigrp_tlv_metric, &sub_ti, "SAF Service ");
sub_tvb = tvb_new_subset(tvb, offset, remaining, -1);
sub_offset = 0;
- for (; tvb_length_remaining(sub_tvb, sub_offset) > 0; ) {
+ for (; tvb_reported_length_remaining(sub_tvb, sub_offset) > 0; ) {
service = tvb_get_ntohs(sub_tvb, sub_offset);
proto_item_append_text(sub_ti, "%c %s", (sub_offset == 0 ? '=':','),
val_to_str_const(service, eigrp_saf_srv2string, ""));
@@ -2476,7 +2476,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree_add_item(eigrp_tree, hf_eigrp_opcode, tvb, 1, 1,
ENC_BIG_ENDIAN);
- size = tvb_length(tvb);
+ size = tvb_captured_length(tvb);
checksum = tvb_get_ntohs(tvb, 2);
cacl_checksum = ip_checksum_tvb(tvb, 0, size);
@@ -2528,7 +2528,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
size = tvb_get_ntohs(tvb, offset + 2);
if (size == 0) {
proto_tree_add_expert(eigrp_tree, pinfo, &ei_eigrp_tlv_len, tvb, offset, -1);
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
tlv_tree = proto_tree_add_subtree(eigrp_tree, tvb, offset, size, ett_eigrp_tlv, &ti,
@@ -2580,7 +2580,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* Return the amount of data this dissector was able to dissect */
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
static void
diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c
index 881f630b2e..83c90e641c 100644
--- a/epan/dissectors/packet-elcom.c
+++ b/epan/dissectors/packet-elcom.c
@@ -184,10 +184,10 @@ dissect_lower_address(proto_item *ti_arg, gint ett_arg,
* ELCOM-90 TRA3825.02 User Element conventions, p. 5-2 and Appendix G
*/
len1 = tvb_get_guint8(tvb, offset);
- if (tvb_length_remaining(tvb, offset+len1+1) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset+len1+1) <= 0)
return offset;
len2 = tvb_get_guint8(tvb, offset+len1+1);
- if (tvb_length_remaining(tvb, offset+len1+len2+2) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset+len1+len2+2) <= 0)
return offset;
if ((len1 != LOWADR_LEN) || (len2 != SUFFIX_LEN)) {
proto_item_append_text(tree, " Invalid structure");
@@ -262,20 +262,20 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
proto_item_append_text(ti, " (2 bytes, should be 1 byte)");
}
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_pduid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_version, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_result, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -284,13 +284,13 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
/* show the rest */
/* tree2 = proto_tree_add_subtree(tree, tvb, offset, -1, "User Data"); */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
ti = proto_tree_add_item(tree, hf_elcom_userdata_restmark, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_item_append_text(ti, " <-- '0' = no restart etc.");
offset +=1;
- if (tvb_length_remaining(tvb, offset+8) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset+8) <= 0)
return offset;
year = tvb_get_guint8(tvb, offset);
month = tvb_get_guint8(tvb, offset+1);
@@ -305,11 +305,11 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
year+1900, month, day, hour, min, sec, msec);
offset += 12;
- if (tvb_length_remaining(tvb, offset+12) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset+12) > 0) {
proto_item_append_text(ti, " Security info: ");
}
/* security info field, if present */
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_item_append_text(ti, elcom_show_hex ? " %02x" : " %03o",
tvb_get_guint8(tvb, offset));
offset++;
@@ -327,7 +327,7 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
proto_item *ti;
tree = proto_item_add_subtree(ti_arg, ett_arg);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
gtype = tvb_get_guint8(tvb, offset);
@@ -353,45 +353,45 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
proto_item_append_text(ti, " <<--- meaning WHAT?");
return offset;
}
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupnumber, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_grouppriority, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupsize, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupindex1, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupindex2, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
while (1) {
oidlen = tvb_get_guint8(tvb, offset);
if (oidlen == 0) /* normal termination */
break;
- if (tvb_length_remaining(tvb, offset+oidlen+1) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset+oidlen+1) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_oid, tvb, offset, 1, ENC_ASCII|ENC_BIG_ENDIAN);
offset += oidlen+1;
}
offset += 1; /* the loop exited at the 0 length byte */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return offset;
/* show the rest */
@@ -399,7 +399,7 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
return offset;
}
-/* XXX: Are all the tests against tvb_length() really the right way to handle invalid fields ?
+/* XXX: Are all the tests against tvb_reported_length() really the right way to handle invalid fields ?
* It seems to me that invalid fields should just add an expert item
* or cause a "Malformed" exception.
*/
@@ -415,7 +415,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 *suffix;
/* Check that there's enough data */
- if (tvb_length(tvb) < 3)
+ if (tvb_captured_length(tvb) < 3)
return;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ELCOM");
@@ -437,7 +437,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* starting after elcom_len and elcom_msg_type,
initiator + responder + userdata fields must be there */
- if (tvb_length_remaining(tvb, 3+TOTAL_LEN+TOTAL_LEN+3) < 0) return;
+ if (tvb_captured_length_remaining(tvb, 3+TOTAL_LEN+TOTAL_LEN+3) < 0) return;
/* check also that those field lengths are valid */
if (tvb_get_guint8(tvb, 3) != LOWADR_LEN) return;
if (tvb_get_guint8(tvb, 3+1+LOWADR_LEN) != SUFFIX_LEN) return;
@@ -495,7 +495,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(elcom_tree, " ( %s)", val_to_str(elcom_msg_type, type_vals, "Unknown %d"));
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return;
switch (elcom_msg_type) {
@@ -513,7 +513,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_elcom_initiator_ip,
hf_elcom_initiator_port,
hf_elcom_initiator_suff);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return;
ti = proto_tree_add_item(elcom_tree, hf_elcom_responder, tvb, offset, TOTAL_LEN, ENC_NA);
@@ -522,7 +522,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_elcom_responder_ip,
hf_elcom_responder_port,
hf_elcom_responder_suff);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return;
/* Rest of the payload is USER-DATA, 0..82 bytes */
@@ -555,7 +555,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_reported_length_remaining(tvb, offset) > 0)
{
/* We should not get here, but if we do, show what is left over: */
proto_tree_add_item(elcom_tree, hf_elcom_strangeleftover, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index cf3657e232..398aa52ca0 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -1829,10 +1829,10 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Call dissector for interface */
next_tvb = tvb_new_subset_length( tvb, offset+6, item_length);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
- if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_srrd_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
+ if ( tvb_reported_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_srrd_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
/* Show the undissected payload */
- if ( tvb_length_remaining(tvb, offset) > 0 )
+ if ( tvb_reported_length_remaining(tvb, offset) > 0 )
call_dissector( data_handle, next_tvb, pinfo, dissector_tree);
}
@@ -1888,10 +1888,10 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Call dissector for interface */
next_tvb = tvb_new_subset_length (tvb, offset+8, item_length-2);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
- if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_sud_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
+ if ( tvb_reported_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_sud_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
/* Show the undissected payload */
- if ( tvb_length_remaining(tvb, offset) > 0 )
+ if ( tvb_reported_length_remaining(tvb, offset) > 0 )
call_dissector( data_handle, next_tvb, pinfo, dissector_tree );
}
p_remove_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO);
@@ -1899,7 +1899,7 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
else
{
/* Display data */
- if (tvb_length_remaining(tvb, offset+6) > 0)
+ if (tvb_reported_length_remaining(tvb, offset+6) > 0)
{
next_tvb = tvb_new_subset_length(tvb, offset+6, item_length);
if (conn_info != NULL)
@@ -2343,7 +2343,7 @@ dissect_enip_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
} /* end of if ( encapsulated data ) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* end of dissect_enip_pdu() */
static int
@@ -2378,7 +2378,7 @@ dissect_enip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return 0; /* not a known command */
tcp_dissect_pdus(tvb, pinfo, tree, enip_desegment, 4, get_enip_pdu_len, dissect_enip_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the io packets*/
@@ -2542,7 +2542,7 @@ dissect_dlr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* Unknown Frame type */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* end of dissect_dlr() */
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index fe318406c3..4e66ebb6df 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -176,7 +176,7 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
code = tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET);
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
- padding_length = tvb_length(cause_tvb) - length;
+ padding_length = tvb_captured_length(cause_tvb) - length;
cause_tree = proto_tree_add_subtree(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, -1,
ett_enrp_cause, &cause_item, val_to_str_const(code, cause_code_values, "Unknown error cause"));
@@ -475,7 +475,7 @@ dissect_pool_member_selection_policy_parameter(tvbuff_t *parameter_tvb, proto_tr
proto_tree_add_item(parameter_tree, hf_policy_distance, parameter_tvb, POLICY_WRANDDPF_DISTANCE_OFFSET, POLICY_WRANDDPF_DISTANCE_LENGTH, ENC_BIG_ENDIAN);
break;
default:
- length = tvb_length(parameter_tvb) - POLICY_VALUE_OFFSET;
+ length = tvb_reported_length(parameter_tvb) - POLICY_VALUE_OFFSET;
if (length > 0) {
proto_tree_add_item(parameter_tree, hf_policy_value, parameter_tvb, POLICY_VALUE_OFFSET, length, ENC_NA);
}
@@ -641,7 +641,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *enrp_tree)
/* extract tag and length from the parameter */
type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET);
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
- padding_length = tvb_length(parameter_tvb) - length;
+ padding_length = tvb_captured_length(parameter_tvb) - length;
/* create proto_tree stuff */
parameter_tree = proto_tree_add_subtree(enrp_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, -1,
@@ -713,7 +713,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
tvbuff_t *parameter_tvb;
offset = 0;
- while((remaining_length = tvb_length_remaining(parameters_tvb, offset)) > 0) {
+ while((remaining_length = tvb_reported_length_remaining(parameters_tvb, offset)) > 0) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
if (remaining_length >= length)
@@ -904,7 +904,7 @@ dissect_enrp_error_message(tvbuff_t *message_tvb, proto_tree *message_tree, prot
static void
dissect_unknown_message(tvbuff_t *message_tvb, proto_tree *message_tree, proto_tree *flags_tree _U_)
{
- proto_tree_add_item(message_tree, hf_message_value, message_tvb, MESSAGE_VALUE_OFFSET, tvb_length(message_tvb) - MESSAGE_HEADER_LENGTH, ENC_NA);
+ proto_tree_add_item(message_tree, hf_message_value, message_tvb, MESSAGE_VALUE_OFFSET, tvb_captured_length(message_tvb) - MESSAGE_HEADER_LENGTH, ENC_NA);
}
#define ENRP_PRESENCE_MESSAGE_TYPE 0x01
diff --git a/epan/dissectors/packet-epl_v1.c b/epan/dissectors/packet-epl_v1.c
index b0aa02591c..fb6b684bf9 100644
--- a/epan/dissectors/packet-epl_v1.c
+++ b/epan/dissectors/packet-epl_v1.c
@@ -343,7 +343,7 @@ dissect_epl_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree *epl_v1_tree=NULL;
- if(tvb_length(tvb) < 3){
+ if(tvb_captured_length(tvb) < 3){
/* Not enough data for an EPL_V1 header; don't try to interpret it */
return FALSE;
}
diff --git a/epan/dissectors/packet-epmd.c b/epan/dissectors/packet-epmd.c
index be50e66ac3..fc248bc448 100644
--- a/epan/dissectors/packet-epmd.c
+++ b/epan/dissectors/packet-epmd.c
@@ -147,7 +147,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, name_length, ENC_ASCII);
offset += 2 + name_length;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
elen = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_elen, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -159,7 +159,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
case EPMD_PORT_REQ:
case EPMD_PORT2_REQ:
- name_length = tvb_length_remaining(tvb, offset);
+ name_length = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_length, ENC_ASCII);
break;
@@ -167,7 +167,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
case EPMD_ALIVE_REQ:
proto_tree_add_item(tree, hf_epmd_port_no, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- name_length = tvb_length_remaining(tvb, offset);
+ name_length = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_length, ENC_ASCII);
break;
@@ -250,7 +250,7 @@ dissect_epmd_response(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, name_length, ENC_ASCII);
offset += 2 + name_length;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_reported_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
elen = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_elen, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -280,7 +280,7 @@ check_epmd(tvbuff_t *tvb) {
* It's possible to start checking lengths but imho that
* doesn't bring very much.
*/
- if (tvb_length(tvb) < 3)
+ if (tvb_captured_length(tvb) < 3)
return (FALSE);
type = tvb_get_guint8(tvb, 0);
@@ -327,7 +327,7 @@ dissect_epmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
dissect_epmd_response(pinfo, tvb, 0, epmd_tree);
}
- return (tvb_length(tvb));
+ return (tvb_captured_length(tvb));
}
void
diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c
index 403ebc0a5b..3c63f8c001 100644
--- a/epan/dissectors/packet-erldp.c
+++ b/epan/dissectors/packet-erldp.c
@@ -400,7 +400,7 @@ static gint dissect_etf_type(const gchar *label, packet_info *pinfo, tvbuff_t *t
static gboolean is_handshake(tvbuff_t *tvb, int offset) {
guint32 len = tvb_get_ntohs(tvb, offset);
guint8 tag = tvb_get_guint8(tvb, offset + 2);
- return ((len > 0) && strchr("nras", tag) && (len == (guint32)tvb_length_remaining(tvb, offset + 2)));
+ return ((len > 0) && strchr("nras", tag) && (len == (guint32)tvb_captured_length_remaining(tvb, offset + 2)));
}
/*--- dissect_erldp_handshake -------------------------------------------------*/
@@ -435,7 +435,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_erldp_challenge, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
- str_len = tvb_length_remaining(tvb, offset);
+ str_len = tvb_captured_length_remaining(tvb, offset);
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, str_len, ENC_ASCII);
proto_tree_add_item(tree, hf_erldp_name, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", (is_challenge) ? "SEND_CHALLENGE" : "SEND_NAME", str);
@@ -456,7 +456,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
break;
case 's' :
- str_len = tvb_length_remaining(tvb, offset);
+ str_len = tvb_captured_length_remaining(tvb, offset);
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, str_len, ENC_ASCII);
proto_tree_add_item(tree, hf_erldp_status, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "SEND_STATUS %s", str);
@@ -480,7 +480,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (is_handshake(tvb, 0)) {
dissect_erldp_handshake(tvb, pinfo, erldp_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset = 0;
@@ -509,7 +509,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ctl_op, VALS(erldp_ctlmsg_vals), "unknown ControlMessage operation (%d)"));
}
offset = dissect_etf_type("ControlMessage", pinfo, tvb, offset, erldp_tree);
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_reported_length_remaining(tvb, offset) > 0)
dissect_etf_type("Message", pinfo, tvb, offset, erldp_tree);
break;
@@ -519,7 +519,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_str(pinfo->cinfo, COL_INFO, "unknown header format");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- get_erldp_pdu_len -------------------------------------------------*/
@@ -540,7 +540,7 @@ dissect_erldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
4, /* fixed-length part of the PDU */
get_erldp_pdu_len, /* routine to get the length of the PDU */
dissect_erldp_pdu, data); /* routine to dissect a PDU */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_erldp ----------------------------------------------*/
diff --git a/epan/dissectors/packet-esio.c b/epan/dissectors/packet-esio.c
index 839e48c2f8..8f201ec41c 100644
--- a/epan/dissectors/packet-esio.c
+++ b/epan/dissectors/packet-esio.c
@@ -86,7 +86,7 @@ is_esio_pdu(tvbuff_t *tvb)
/* we need at least 8 bytes to determine whether this is
Ether-S-I/O or not*/
/* minimal length is 20 bytes*/
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return FALSE;
}
/* First four bytes must be "ESIO"*/
@@ -268,7 +268,7 @@ dissect_esio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
break;
} /* switch() */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/*End of dissect_sbus*/
}
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c
index 9261c3feef..7421223dc9 100644
--- a/epan/dissectors/packet-etch.c
+++ b/epan/dissectors/packet-etch.c
@@ -616,7 +616,7 @@ read_struct(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree,
int i;
ti = proto_tree_add_item(etch_tree, hf_etch_struct, tvb, *offset,
- tvb_length(tvb) - *offset, ENC_NA);
+ tvb_captured_length(tvb) - *offset, ENC_NA);
new_tree = proto_item_add_subtree(ti, ett_etch_struct);
if (add_type_field) {
@@ -753,7 +753,7 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
read_struct(&offset, tvb, etch_tree, 0);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -774,7 +774,7 @@ get_etch_message_len(packet_info *pinfo _U_, tvbuff_t *tvb,
static int
dissect_etch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (tvb_length(tvb) < 4) {
+ if (tvb_captured_length(tvb) < 4) {
/* Too small for an etch packet. */
return 0;
}
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c
index 6e4740d6bf..3db5f98b20 100644
--- a/epan/dissectors/packet-ethertype.c
+++ b/epan/dissectors/packet-ethertype.c
@@ -266,7 +266,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* Get the captured length and reported length of the data
after the Ethernet type. */
- captured_length = tvb_length_remaining(tvb, ethertype_data->offset_after_ethertype);
+ captured_length = tvb_captured_length_remaining(tvb, ethertype_data->offset_after_ethertype);
reported_length = tvb_reported_length_remaining(tvb,
ethertype_data->offset_after_ethertype);
@@ -336,7 +336,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
add_dix_trailer(pinfo, tree, ethertype_data->fh_tree, ethertype_data->trailer_id, tvb, next_tvb, ethertype_data->offset_after_ethertype,
length_before, ethertype_data->fcs_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-exec.c b/epan/dissectors/packet-exec.c
index 6f6f81d45d..273cc0d31c 100644
--- a/epan/dissectors/packet-exec.c
+++ b/epan/dissectors/packet-exec.c
@@ -217,12 +217,12 @@ dissect_exec(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.
@@ -245,7 +245,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_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 */
@@ -273,7 +273,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_PASSWORD
- && 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 */
@@ -296,7 +296,7 @@ dissect_exec(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 */
@@ -319,7 +319,7 @@ dissect_exec(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 == EXEC_PORT){
/* Packet going to the server */
/* offset = 0 since the whole packet is data */
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c
index b3dd7f56db..4fe1d01e02 100644
--- a/epan/dissectors/packet-extreme.c
+++ b/epan/dissectors/packet-extreme.c
@@ -989,7 +989,7 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* If we have the entire ESP packet available, check the checksum.
*/
- if (tvb_length(tvb) >= data_length) {
+ if (tvb_captured_length(tvb) >= data_length) {
/* Checksum from version to null tlv */
SET_CKSUM_VEC_TVB(cksum_vec[0], tvb, 0, data_length);
computed_checksum = in_cksum(&cksum_vec[0], 1);
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index a4c3ef2307..0846dc50bc 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -1230,7 +1230,7 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
return 0;
dissect_fc_helper (tvb, pinfo, tree, FALSE, fc_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1242,7 +1242,7 @@ dissect_fc_wtap (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
fc_data.sof_eof = 0;
dissect_fc_helper (tvb, pinfo, tree, FALSE, &fc_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1254,7 +1254,7 @@ dissect_fc_ifcp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
return 0;
dissect_fc_helper (tvb, pinfo, tree, TRUE, fc_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c
index 2c46b1d714..ea412a573e 100644
--- a/epan/dissectors/packet-fcct.c
+++ b/epan/dissectors/packet-fcct.c
@@ -214,7 +214,7 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
call_dissector (data_handle, next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index 02d8e4ad34..8a9df627c2 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -1751,7 +1751,7 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c
index 02b550756c..07ebd84089 100644
--- a/epan/dissectors/packet-fcfcs.c
+++ b/epan/dissectors/packet-fcfcs.c
@@ -904,7 +904,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c
index 4e442487fa..56e5bb96e5 100644
--- a/epan/dissectors/packet-fcfzs.c
+++ b/epan/dissectors/packet-fcfzs.c
@@ -440,7 +440,7 @@ dissect_fcfzs_arzm(tvbuff_t *tvb, packet_info* pinfo, proto_tree *tree, gboolean
len, ENC_ASCII|ENC_NA);
len += (len % 4);
- plen = tvb_length(tvb) - offset - len;
+ plen = tvb_reported_length(tvb) - offset - len;
numrec = plen/12; /* each mbr rec is 12 bytes long */
@@ -540,7 +540,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_fcfzs, tvb, 0,
- tvb_length(tvb),
+ tvb_captured_length(tvb),
"Zone Server");
fcfzs_tree = proto_item_add_subtree(ti, ett_fcfzs);
proto_tree_add_item(fcfzs_tree, hf_fcfzs_opcode, tvb, offset+8, 2, ENC_BIG_ENDIAN);
@@ -688,7 +688,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcgi.c b/epan/dissectors/packet-fcgi.c
index ab99b2074b..328946abbe 100644
--- a/epan/dissectors/packet-fcgi.c
+++ b/epan/dissectors/packet-fcgi.c
@@ -315,7 +315,7 @@ dissect_fcgi_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -328,7 +328,7 @@ static int
dissect_fcgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 8, get_fcgi_record_len, dissect_fcgi_record, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-fcip.c b/epan/dissectors/packet-fcip.c
index b0c90bb0c8..53b885931e 100644
--- a/epan/dissectors/packet-fcip.c
+++ b/epan/dissectors/packet-fcip.c
@@ -142,7 +142,7 @@ static dissector_handle_t fc_handle;
static guint
get_next_fcip_header_offset (tvbuff_t *tvb, packet_info *pinfo, gint offset)
{
- gint bytes_remaining = tvb_length_remaining (tvb, offset);
+ gint bytes_remaining = tvb_reported_length_remaining (tvb, offset);
gint frame_len;
guint16 flen, flen1;
fcip_eof_t eof, eofc;
@@ -369,7 +369,7 @@ dissect_fcip (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint offset = 0,
start = 0,
frame_len = 0;
- gint bytes_remaining = tvb_length (tvb);
+ gint bytes_remaining = tvb_captured_length (tvb);
guint8 pflags, sof = 0, eof = 0;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c
index e7458ca5a8..770f9bd53d 100644
--- a/epan/dissectors/packet-fcoe.c
+++ b/epan/dissectors/packet-fcoe.c
@@ -164,7 +164,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCoE");
crc_offset = header_len + frame_len;
eof_offset = crc_offset + 4;
- bytes_remaining = tvb_length_remaining(tvb, header_len);
+ bytes_remaining = tvb_captured_length_remaining(tvb, header_len);
if (bytes_remaining > frame_len)
bytes_remaining = frame_len; /* backing length */
next_tvb = tvb_new_subset(tvb, header_len, bytes_remaining, frame_len);
@@ -228,7 +228,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
crc, crc_computed);
}
proto_tree_set_appendix(fcoe_tree, tvb, crc_offset,
- tvb_length_remaining (tvb, crc_offset));
+ tvb_captured_length_remaining (tvb, crc_offset));
} else {
item = proto_tree_add_uint_format_value(fcoe_tree, hf_fcoe_crc, tvb, crc_offset, 0,
0, "CRC: [missing]");