aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-06-20 17:36:59 -0700
committerEvan Huus <eapache@gmail.com>2014-06-21 04:01:52 +0000
commit37b903d7abab78a6f13b61feb88f62f2fa638151 (patch)
treecc35bbf35e846d55bf7c03936d5e43329f7b642a /asn1
parent3773a7561c79e3545fca664c2a25cf2312de0ada (diff)
batch of tvb-length conversions
Change-Id: I76ca4d075756e3ac691070e0c05344a410ea2498 Reviewed-on: https://code.wireshark.org/review/2507 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/lcsap/packet-lcsap-template.c10
-rw-r--r--asn1/ldap/packet-ldap-template.c30
-rw-r--r--asn1/lppa/packet-lppa-template.c8
-rw-r--r--asn1/m3ap/packet-m3ap-template.c10
-rw-r--r--asn1/nbap/packet-nbap-template.c10
-rw-r--r--asn1/p1/packet-p1-template.c10
-rw-r--r--asn1/pcap/packet-pcap-template.c12
-rw-r--r--asn1/pkcs12/packet-pkcs12-template.c4
-rw-r--r--asn1/pres/packet-pres-template.c6
-rw-r--r--asn1/qsig/packet-qsig-template.c20
-rw-r--r--asn1/ranap/packet-ranap-template.c29
-rw-r--r--asn1/rnsap/packet-rnsap-template.c12
-rw-r--r--asn1/ros/packet-ros-template.c2
-rw-r--r--asn1/rtse/packet-rtse-template.c12
-rw-r--r--asn1/rua/packet-rua-template.c10
-rw-r--r--asn1/s1ap/packet-s1ap-template.c14
-rw-r--r--asn1/sabp/packet-sabp-template.c16
-rw-r--r--asn1/sbc-ap/packet-sbc-ap-template.c14
-rw-r--r--asn1/snmp/packet-snmp-template.c22
-rw-r--r--asn1/spnego/packet-spnego-template.c26
-rw-r--r--asn1/t124/packet-t124-template.c4
-rw-r--r--asn1/t125/packet-t125-template.c4
-rw-r--r--asn1/tetra/packet-tetra-template.c2
-rw-r--r--asn1/ulp/packet-ulp-template.c2
-rw-r--r--asn1/x2ap/packet-x2ap-template.c10
25 files changed, 148 insertions, 151 deletions
diff --git a/asn1/lcsap/packet-lcsap-template.c b/asn1/lcsap/packet-lcsap-template.c
index f1b9b332fd..b2548e73cc 100644
--- a/asn1/lcsap/packet-lcsap-template.c
+++ b/asn1/lcsap/packet-lcsap-template.c
@@ -197,28 +197,28 @@ static const value_string lcsap_gnss_pos_usage_vals[] = {
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lcsap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lcsap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index d97ca666b1..2d386f4014 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -604,7 +604,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, as
offset=get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
offset=get_ber_length(tvb, offset, &len, &ind);
} else {
- len=tvb_length_remaining(tvb,offset);
+ len=tvb_captured_length_remaining(tvb,offset);
}
if(len==0){
@@ -984,7 +984,7 @@ one_more_pdu:
/* If this was a sasl blob there might be another PDU following in the
* same blob
*/
- if(tvb_length_remaining(tvb, offset)>=6){
+ if(tvb_reported_length_remaining(tvb, offset)>=6){
tvb = tvb_new_subset_remaining(tvb, offset);
offset = 0;
@@ -1191,7 +1191,7 @@ static void
* the token, from which we compute the offset in the tvbuff at
* which the plaintext data, i.e. the LDAP message, begins.
*/
- tmp_length = tvb_length_remaining(sasl_tvb, 4);
+ tmp_length = tvb_reported_length_remaining(sasl_tvb, 4);
if ((guint)tmp_length > sasl_len)
tmp_length = sasl_len;
gssapi_tvb = tvb_new_subset(sasl_tvb, 4, tmp_length, sasl_len);
@@ -1443,7 +1443,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
/* Get the length of the buffer */
- len=tvb_length_remaining(tvb,offset);
+ len=tvb_reported_length_remaining(tvb,offset);
/* check the len if it is to small return */
if (len < 10) return;
@@ -1462,7 +1462,7 @@ static void dissect_NetLogon_PDU(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
switch(itype){
case LOGON_SAM_LOGON_RESPONSE:
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
/* logon server name */
fn = get_unicode_or_ascii_string(tvb,&offset,TRUE,&fn_len,FALSE,FALSE,&bc);
proto_tree_add_string(tree, hf_mscldap_nb_hostname, tvb,offset, fn_len, fn);
@@ -1642,7 +1642,7 @@ static int
dissect_sasl_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -1664,7 +1664,7 @@ static int
dissect_normal_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
dissect_ldap_pdu(tvb, pinfo, tree, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -1678,7 +1678,7 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
* proto_tree_add_oid() instead.
*/
- oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_length(tvb), ENC_UTF_8|ENC_NA);
+ oid=tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_captured_length(tvb), ENC_UTF_8|ENC_NA);
if(!oid){
return;
}
@@ -1686,9 +1686,9 @@ dissect_ldap_oid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
oidname=oid_resolved_from_string(oid);
if(oidname){
- proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s (%s)",oid,oidname);
+ proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s (%s)",oid,oidname);
} else {
- proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "OID: %s",oid);
+ proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "OID: %s",oid);
}
}
@@ -1770,7 +1770,7 @@ struct access_mask_info ldap_access_mask_info = {
static void
dissect_ldap_nt_sec_desc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_length(tvb), &ldap_access_mask_info);
+ dissect_nt_sec_desc(tvb, 0, pinfo, tree, NULL, TRUE, tvb_captured_length(tvb), &ldap_access_mask_info);
}
static void
@@ -1856,7 +1856,7 @@ dissect_ldap_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
this_was_not_sasl:
/* check if it is a normal BER encoded LDAP packet
@@ -1936,16 +1936,16 @@ this_was_not_normal_ldap:
dissector_add_uint("tcp.port", tcp_port, ldap_handle);
/* we are done */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Ok it might be a strange case of SASL still
* It has been seen with Exchange setup to MS AD
* when Exchange pretend that there is SASL but in fact data are still
* in clear*/
- if ((sasl_len + 4) == (guint32)tvb_length_remaining(tvb, 0))
+ if ((sasl_len + 4) == (guint32)tvb_captured_length_remaining(tvb, 0))
tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_sasl_ldap_pdu_len, dissect_sasl_ldap_pdu, data);
end:
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/asn1/lppa/packet-lppa-template.c b/asn1/lppa/packet-lppa-template.c
index 1344a620e3..53ee3fc6af 100644
--- a/asn1/lppa/packet-lppa-template.c
+++ b/asn1/lppa/packet-lppa-template.c
@@ -70,22 +70,22 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(lppa_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(lppa_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/*--- proto_register_lppa -------------------------------------------*/
diff --git a/asn1/m3ap/packet-m3ap-template.c b/asn1/m3ap/packet-m3ap-template.c
index 22a77aa5f2..e5e42ae6eb 100644
--- a/asn1/m3ap/packet-m3ap-template.c
+++ b/asn1/m3ap/packet-m3ap-template.c
@@ -93,27 +93,27 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(m3ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(m3ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/asn1/nbap/packet-nbap-template.c b/asn1/nbap/packet-nbap-template.c
index 2d0ca1408b..62843e54b8 100644
--- a/asn1/nbap/packet-nbap-template.c
+++ b/asn1/nbap/packet-nbap-template.c
@@ -323,30 +323,30 @@ static void add_hsdsch_bind(packet_info * pinfo);
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(nbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(nbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(nbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(nbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(nbap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void add_hsdsch_bind(packet_info *pinfo){
address null_addr;
diff --git a/asn1/p1/packet-p1-template.c b/asn1/p1/packet-p1-template.c
index 0df41cd64a..63a5b8462d 100644
--- a/asn1/p1/packet-p1-template.c
+++ b/asn1/p1/packet-p1-template.c
@@ -114,7 +114,7 @@ static void do_address(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* actx)
wmem_strbuf_append(ctx->oraddress, addr);
}
if (tvb_string) {
- wmem_strbuf_append(ctx->oraddress, tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ wmem_strbuf_append(ctx->oraddress, tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
}
@@ -128,7 +128,7 @@ static void do_address_str(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* a
do_address(addr, tvb_string, actx);
if (ctx && ctx->do_address && ddatype && tvb_string)
- wmem_strbuf_append(ddatype, tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ wmem_strbuf_append(ddatype, tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
static void do_address_str_tree(const char* addr, tvbuff_t* tvb_string, asn1_ctx_t* actx, proto_tree* tree)
@@ -140,7 +140,7 @@ static void do_address_str_tree(const char* addr, tvbuff_t* tvb_string, asn1_ctx
if (ctx && ctx->do_address && tvb_string && ddatype) {
if (wmem_strbuf_get_len(ddatype) > 0) {
- proto_item_append_text (tree, " (%s=%s)", wmem_strbuf_get_str(ddatype), tvb_format_text(tvb_string, 0, tvb_length(tvb_string)));
+ proto_item_append_text (tree, " (%s=%s)", wmem_strbuf_get_str(ddatype), tvb_format_text(tvb_string, 0, tvb_captured_length(tvb_string)));
}
}
}
@@ -272,7 +272,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported P1 PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
col_set_str(pinfo->cinfo, COL_INFO, p1_op_name);
@@ -286,7 +286,7 @@ dissect_p1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* dat
}
}
p1_initialize_content_globals (&asn1_ctx, NULL, FALSE);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/asn1/pcap/packet-pcap-template.c b/asn1/pcap/packet-pcap-template.c
index 785e1c6fcc..395213a735 100644
--- a/asn1/pcap/packet-pcap-template.c
+++ b/asn1/pcap/packet-pcap-template.c
@@ -97,32 +97,32 @@ static int dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(pcap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(pcap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/asn1/pkcs12/packet-pkcs12-template.c b/asn1/pkcs12/packet-pkcs12-template.c
index 690ac6c36b..103252e1e2 100644
--- a/asn1/pkcs12/packet-pkcs12-template.c
+++ b/asn1/pkcs12/packet-pkcs12-template.c
@@ -112,7 +112,7 @@ generate_key_or_iv(unsigned int id, tvbuff_t *salt_tvb, unsigned int iter,
cur_keylen = 0;
- salt_size = tvb_length(salt_tvb);
+ salt_size = tvb_captured_length(salt_tvb);
salt_p = (char *)tvb_memdup(wmem_packet_scope(), salt_tvb, 0, salt_size);
if (pw == NULL)
@@ -313,7 +313,7 @@ int PBE_decrypt_data(const char *object_identifier_id_param, tvbuff_t *encrypted
}
}
- datalen = tvb_length(encrypted_tvb);
+ datalen = tvb_captured_length(encrypted_tvb);
clear_data = (char *)g_malloc(datalen);
err = gcry_cipher_decrypt (cipher, clear_data, datalen, (char *)tvb_memdup(wmem_packet_scope(), encrypted_tvb, 0, datalen), datalen);
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index 1526897cf8..07dda48452 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -333,7 +333,7 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
/* dissect the packet */
dissect_UD_type_PDU(tvb, pinfo, clpres_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* we can't make any additional checking here */
@@ -351,7 +351,7 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
proto_tree_add_text(parent_tree, tvb, offset,
tvb_reported_length_remaining(tvb,offset),"User data");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
while (tvb_reported_length_remaining(tvb, offset) > 0){
@@ -363,7 +363,7 @@ dissect_pres(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/asn1/qsig/packet-qsig-template.c b/asn1/qsig/packet-qsig-template.c
index a0f79e1081..cfd70c60cf 100644
--- a/asn1/qsig/packet-qsig-template.c
+++ b/asn1/qsig/packet-qsig-template.c
@@ -400,7 +400,7 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return offset;
service = get_service(opcode);
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_operation, tvb, 0, 0, opcode);
@@ -419,9 +419,9 @@ dissect_qsig_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (op_ptr->arg_pdu)
offset = op_ptr->arg_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -454,7 +454,7 @@ dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return offset;
service = get_service(opcode);
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_operation, tvb, 0, 0, opcode);
@@ -473,9 +473,9 @@ dissect_qsig_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (op_ptr->res_pdu)
offset = op_ptr->res_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -507,7 +507,7 @@ dissect_qsig_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (!err_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_qsig, tvb, offset, tvb_captured_length(tvb), ENC_NA);
qsig_tree = proto_item_add_subtree(ti, ett_qsig);
proto_tree_add_uint(qsig_tree, hf_qsig_error, tvb, 0, 0, errcode);
@@ -522,9 +522,9 @@ dissect_qsig_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
if (err_ptr->err_pdu)
offset = err_ptr->err_pdu(tvb, pinfo, qsig_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(qsig_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (QSIG)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
@@ -569,7 +569,7 @@ dissect_qsig_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int codeset
PROTO_ITEM_SET_HIDDEN(hidden_item);
proto_tree_add_item(ie_tree, hf_qsig_ie_len, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_reported_length_remaining(tvb, offset) <= 0)
return;
switch ((codeset << 8) | ie_type) {
case CS4 | QSIG_IE_TRANSIT_COUNTER :
diff --git a/asn1/ranap/packet-ranap-template.c b/asn1/ranap/packet-ranap-template.c
index 76df8035f7..a01444142b 100644
--- a/asn1/ranap/packet-ranap-template.c
+++ b/asn1/ranap/packet-ranap-template.c
@@ -154,16 +154,16 @@ dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
case id_RelocationPreparation:
if((ProtocolIE_ID == id_Source_ToTarget_TransparentContainer)||(ProtocolIE_ID == id_Target_ToSource_TransparentContainer)){
key = SPECIAL | ProtocolIE_ID;
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
break;
}
/* Fall trough */
default:
/* no special handling */
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
if (ret == 0) {
key = pdu_type | ProtocolIE_ID;
- ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ ret = (dissector_try_uint_new(ranap_ies_dissector_table, key, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
break;
}
@@ -173,19 +173,19 @@ dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
static int
dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
@@ -196,7 +196,7 @@ dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
pdu_type = IMSG;
ret = dissector_try_uint_new(ranap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL);
pdu_type = 0;
- return ret ? tvb_length(tvb) : 0;
+ return ret ? tvb_captured_length(tvb) : 0;
}
static int
@@ -207,19 +207,19 @@ dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
pdu_type = SOUT;
ret = dissector_try_uint_new(ranap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL);
pdu_type = 0;
- return ret ? tvb_length(tvb) : 0;
+ return ret ? tvb_captured_length(tvb) : 0;
}
static int
dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_OutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(ranap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(ranap_proc_out_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
@@ -275,21 +275,18 @@ dissect_sccp_ranap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
#define LENGTH_OFFSET 3
#define MSG_TYPE_OFFSET 1
- if (tvb_length(tvb) < RANAP_MSG_MIN_LENGTH) { return FALSE; }
- /*if (tvb_get_guint8(tvb, LENGTH_OFFSET) != (tvb_length(tvb) - 4)) { return FALSE; }*/
+ if (tvb_captured_length(tvb) < RANAP_MSG_MIN_LENGTH) { return FALSE; }
/* Read the length NOTE offset in bits */
offset = dissect_per_length_determinant(tvb, LENGTH_OFFSET<<3, &asn1_ctx, tree, -1, &length);
offset = offset>>3;
- if (length!= (tvb_length(tvb) - offset)){
+ if (length!= (tvb_reported_length(tvb) - offset)){
return FALSE;
}
temp = tvb_get_guint8(tvb, MSG_TYPE_OFFSET);
if (temp > RANAP_MAX_PC) { return FALSE; }
- /* Try to strengthen the heuristic further, by checking byte 6 and 7 which usually is a sequence-of lenght
- *
- */
+ /* Try to strengthen the heuristic further, by checking byte 6 and 7 which usually is a sequence-of length */
word = tvb_get_ntohs(tvb,5);
if(word > 0x1ff){
return FALSE;
diff --git a/asn1/rnsap/packet-rnsap-template.c b/asn1/rnsap/packet-rnsap-template.c
index 0359ea547d..de6842e655 100644
--- a/asn1/rnsap/packet-rnsap-template.c
+++ b/asn1/rnsap/packet-rnsap-template.c
@@ -91,35 +91,35 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(rnsap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(rnsap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_PrivateIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (call_ber_oid_callback(obj_id, tvb, 0, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_imsg_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_sout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureID) return 0;
- return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(rnsap_proc_uout_dissector_table, ProcedureID, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/asn1/ros/packet-ros-template.c b/asn1/ros/packet-ros-template.c
index c375f4a0a4..17097d1363 100644
--- a/asn1/ros/packet-ros-template.c
+++ b/asn1/ros/packet-ros-template.c
@@ -432,7 +432,7 @@ dissect_ros(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/asn1/rtse/packet-rtse-template.c b/asn1/rtse/packet-rtse-template.c
index 199a23fb28..45132ff225 100644
--- a/asn1/rtse/packet-rtse-template.c
+++ b/asn1/rtse/packet-rtse-template.c
@@ -147,7 +147,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *
next_tvb = tvb_new_subset_remaining(tvb, offset);
if(!dissector_try_string(rtse_oid_dissector_table, oid, next_tvb, pinfo, tree, data)){
- proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
+ proto_item *item=proto_tree_add_text(tree, next_tvb, 0, tvb_captured_length_remaining(tvb, offset), "RTSE: Dissector for OID:%s not implemented. Contact Wireshark developers if you want this supported", oid);
proto_tree *next_tree=proto_item_add_subtree(item, ett_rtse_unknown);
expert_add_info_format(pinfo, item, &ei_rtse_dissector_oid_not_implemented,
@@ -159,7 +159,7 @@ call_rtse_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *
* into new_dissector_t we have to do this kludge with
* manually step past the content in the ANY type.
*/
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -245,7 +245,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
dissect_ber_octet_string(FALSE, &asn1_ctx, tree, tvb, offset, hf_rtse_segment_data, &data_tvb);
if (data_tvb) {
- fragment_length = tvb_length_remaining (data_tvb, 0);
+ fragment_length = tvb_captured_length_remaining (data_tvb, 0);
proto_item_append_text(asn1_ctx.created_item, " (%u byte%s)", fragment_length,
plurality(fragment_length, "", "s"));
frag_msg = fragment_add_seq_next (&rtse_reassembly_table,
@@ -260,7 +260,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
pinfo->fragmented = TRUE;
data_handled = TRUE;
} else {
- fragment_length = tvb_length_remaining (tvb, offset);
+ fragment_length = tvb_captured_length_remaining (tvb, offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "[RTSE fragment, %u byte%s]",
@@ -274,7 +274,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
/* Return other than 0 to indicate that we handled this packet */
return 1;
} else {
- offset = tvb_length (tvb);
+ offset = tvb_captured_length (tvb);
}
pinfo->fragmented = FALSE;
data_handled = TRUE;
@@ -296,7 +296,7 @@ dissect_rtse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
top_tree = NULL;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void rtse_reassemble_init (void)
diff --git a/asn1/rua/packet-rua-template.c b/asn1/rua/packet-rua-template.c
index b97e67eee3..37947b187f 100644
--- a/asn1/rua/packet-rua-template.c
+++ b/asn1/rua/packet-rua-template.c
@@ -87,27 +87,27 @@ void proto_reg_handoff_rua(void);
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(rua_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(rua_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/asn1/s1ap/packet-s1ap-template.c b/asn1/s1ap/packet-s1ap-template.c
index f26dd967db..9f83e16fc7 100644
--- a/asn1/s1ap/packet-s1ap-template.c
+++ b/asn1/s1ap/packet-s1ap-template.c
@@ -131,38 +131,38 @@ static int dissect_TargetBSS_ToSourceBSS_TransparentContainer_PDU(tvbuff_t *tvb,
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- return (dissector_try_uint(s1ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- return (dissector_try_uint(s1ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
*/
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(s1ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/asn1/sabp/packet-sabp-template.c b/asn1/sabp/packet-sabp-template.c
index 7adc661b10..0f544c0f5b 100644
--- a/asn1/sabp/packet-sabp-template.c
+++ b/asn1/sabp/packet-sabp-template.c
@@ -95,27 +95,27 @@ static void dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sabp_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
@@ -152,7 +152,7 @@ dissect_sabp_cb_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cb_inf_msg_len = tvb_get_guint8(tvb,offset+82);
page_tvb = tvb_new_subset_length(tvb, offset, cb_inf_msg_len);
unpacked_tvb = dissect_cbs_data(sms_encoding, page_tvb, subtree, pinfo, 0);
- len = tvb_length(unpacked_tvb);
+ len = tvb_captured_length(unpacked_tvb);
if (unpacked_tvb != NULL){
if (tree != NULL){
proto_tree *cbs_page_subtree = proto_item_add_subtree(cbs_page_item, ett_sabp_cbs_page_content);
@@ -209,7 +209,7 @@ dissect_sabp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
sabp_tree = proto_item_add_subtree(sabp_item, ett_sabp);
dissect_SABP_PDU_PDU(tvb, pinfo, sabp_tree, NULL);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Note a little bit of a hack assumes length max takes two bytes and that the length starts at byte 4 */
@@ -218,7 +218,7 @@ dissect_sabp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
{
tcp_dissect_pdus(tvb, pinfo, tree, gbl_sabp_desegment, 5,
get_sabp_pdu_len, dissect_sabp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_sabp -------------------------------------------*/
diff --git a/asn1/sbc-ap/packet-sbc-ap-template.c b/asn1/sbc-ap/packet-sbc-ap-template.c
index 5cc5f8b318..d36c653853 100644
--- a/asn1/sbc-ap/packet-sbc-ap-template.c
+++ b/asn1/sbc-ap/packet-sbc-ap-template.c
@@ -92,38 +92,38 @@ static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
*/
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 7e2bfb9e5e..a430717648 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -357,7 +357,7 @@ dissect_snmp_variable_string(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree_add_item(tree, hf_snmp_var_bind_str, tvb, 0, -1, ENC_ASCII|ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1512,8 +1512,8 @@ get_user_assoc(tvbuff_t* engine_tvb, tvbuff_t* user_tvb)
if (! ( user_tvb && engine_tvb ) ) return NULL;
- given_username_len = tvb_length(user_tvb);
- given_engine_len = tvb_length(engine_tvb);
+ given_username_len = tvb_captured_length(user_tvb);
+ given_engine_len = tvb_captured_length(engine_tvb);
if (! ( given_engine_len && given_username_len ) ) return NULL;
given_username = (guint8*)tvb_memdup(wmem_packet_scope(),user_tvb,0,-1);
given_engine = (guint8*)tvb_memdup(wmem_packet_scope(),engine_tvb,0,-1);
@@ -1563,14 +1563,14 @@ snmp_usm_auth_md5(snmp_usm_params_t* p, guint8** calc_auth_p, guint* calc_auth_l
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length(p->auth_tvb);
if (auth_len != 12) {
*error = "Authenticator length wrong";
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length(p->msg_tvb);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1627,7 +1627,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
}
- auth_len = tvb_length_remaining(p->auth_tvb,0);
+ auth_len = tvb_captured_length(p->auth_tvb);
if (auth_len != 12) {
@@ -1635,7 +1635,7 @@ snmp_usm_auth_sha1(snmp_usm_params_t* p _U_, guint8** calc_auth_p, guint* calc_a
return FALSE;
}
- msg_len = tvb_length_remaining(p->msg_tvb,0);
+ msg_len = tvb_captured_length(p->msg_tvb);
if (msg_len <= 0) {
*error = "Not enough data remaining";
return FALSE;
@@ -1681,7 +1681,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
guint i;
- salt_len = tvb_length_remaining(p->priv_tvb,0);
+ salt_len = tvb_captured_length(p->priv_tvb);
if (salt_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1697,7 +1697,7 @@ snmp_usm_priv_des(snmp_usm_params_t* p _U_, tvbuff_t* encryptedData _U_, gchar c
iv[i] = pre_iv[i] ^ salt[i];
}
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length(encryptedData);
if ((cryptgrm_len <= 0) || (cryptgrm_len % 8)) {
*error = "decryptionError: the length of the encrypted data is not a mutiple of 8 octets";
@@ -1754,7 +1754,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
guint8* cryptgrm;
tvbuff_t* clear_tvb;
- priv_len = tvb_length_remaining(p->priv_tvb,0);
+ priv_len = tvb_captured_length(p->priv_tvb);
if (priv_len != 8) {
*error = "decryptionError: msgPrivacyParameters length != 8";
@@ -1771,7 +1771,7 @@ snmp_usm_priv_aes_common(snmp_usm_params_t* p, tvbuff_t* encryptedData, gchar co
iv[7] = (p->time & 0x000000ff);
tvb_memcpy(p->priv_tvb,&(iv[8]),0,8);
- cryptgrm_len = tvb_length_remaining(encryptedData,0);
+ cryptgrm_len = tvb_captured_length(encryptedData);
if (cryptgrm_len <= 0) {
*error = "Not enough data remaining";
return NULL;
diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c
index 748c22d30b..b03277f336 100644
--- a/asn1/spnego/packet-spnego-template.c
+++ b/asn1/spnego/packet-spnego-template.c
@@ -464,7 +464,7 @@ decrypt_arcfour(packet_info *pinfo,
int conf_flag;
int padlen = 0;
- datalen = tvb_length(pinfo->gssapi_encrypted_tvb);
+ datalen = tvb_captured_length(pinfo->gssapi_encrypted_tvb);
if(tvb_get_ntohs(pinfo->gssapi_wrap_tvb, 4)==0x1000){
conf_flag=1;
@@ -577,7 +577,7 @@ decrypt_gssapi_krb_arcfour_wrap(proto_tree *tree, packet_info *pinfo, tvbuff_t *
guint8 *cryptocopy=NULL; /* workaround for pre-0.6.1 heimdal bug */
guint8 *output_message_buffer;
- length=tvb_length(pinfo->gssapi_encrypted_tvb);
+ length=tvb_captured_length(pinfo->gssapi_encrypted_tvb);
original_data=tvb_get_ptr(pinfo->gssapi_encrypted_tvb, 0, length);
/* dont do anything if we are not attempting to decrypt data */
@@ -692,14 +692,14 @@ decrypt_gssapi_krb_cfx_wrap(proto_tree *tree _U_,
return;
}
- datalen = tvb_length(checksum_tvb) + tvb_length(encrypted_tvb);
+ datalen = tvb_captured_length(checksum_tvb) + tvb_captured_length(encrypted_tvb);
rotated = (guint8 *)wmem_alloc(pinfo->pool, datalen);
tvb_memcpy(checksum_tvb, rotated,
- 0, tvb_length(checksum_tvb));
- tvb_memcpy(encrypted_tvb, rotated + tvb_length(checksum_tvb),
- 0, tvb_length(encrypted_tvb));
+ 0, tvb_captured_length(checksum_tvb));
+ tvb_memcpy(encrypted_tvb, rotated + tvb_captured_length(checksum_tvb),
+ 0, tvb_captured_length(encrypted_tvb));
if (is_dce) {
rrc += ec;
@@ -717,13 +717,13 @@ decrypt_gssapi_krb_cfx_wrap(proto_tree *tree _U_,
if (output) {
guint8 *outdata;
- outdata = (guint8 *)g_memdup(output, tvb_length(encrypted_tvb));
+ outdata = (guint8 *)g_memdup(output, tvb_captured_length(encrypted_tvb));
g_free(output);
pinfo->gssapi_decrypted_tvb=tvb_new_child_real_data(encrypted_tvb,
outdata,
- tvb_length(encrypted_tvb),
- tvb_length(encrypted_tvb));
+ tvb_captured_length(encrypted_tvb),
+ tvb_captured_length(encrypted_tvb));
add_new_data_source(pinfo, pinfo->gssapi_decrypted_tvb, "Decrypted GSS-Krb5");
tvb_set_free_cb(pinfo->gssapi_decrypted_tvb, g_free);
return;
@@ -822,7 +822,7 @@ dissect_spnego_krb5_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
if(!pinfo->gssapi_encrypted_tvb){
int len;
len=tvb_reported_length_remaining(tvb,offset);
- if(len>tvb_length_remaining(tvb, offset)){
+ if(len>tvb_captured_length_remaining(tvb, offset)){
/* no point in trying to decrypt,
we dont have the full pdu.
*/
@@ -916,7 +916,7 @@ dissect_spnego_krb5_getmic_base(tvbuff_t *tvb, int offset, packet_info *pinfo _U
* so we need to test here if there are more bytes in our tvb or not.
* -- ronnie
*/
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_reported_length_remaining(tvb, offset)) {
if (sgn_alg == KRB_SGN_ALG_HMAC) {
proto_tree_add_item(tree, hf_spnego_krb5_confounder, tvb, offset, 8,
ENC_NA);
@@ -1067,7 +1067,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
if(!pinfo->gssapi_encrypted_tvb){
int len;
len=tvb_reported_length_remaining(tvb,offset);
- if(len>tvb_length_remaining(tvb, offset)){
+ if(len>tvb_captured_length_remaining(tvb, offset)){
/* no point in trying to decrypt,
we dont have the full pdu.
*/
@@ -1155,7 +1155,7 @@ dissect_spnego_krb5_cfx_getmic_base(tvbuff_t *tvb, int offset, packet_info *pinf
/* Checksum of plaintext padded data */
- checksum_size = tvb_length_remaining(tvb, offset);
+ checksum_size = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_spnego_krb5_sgn_cksum, tvb, offset,
checksum_size, ENC_NA);
diff --git a/asn1/t124/packet-t124-template.c b/asn1/t124/packet-t124-template.c
index 382c92bf12..e1465e2463 100644
--- a/asn1/t124/packet-t124-template.c
+++ b/asn1/t124/packet-t124-template.c
@@ -131,13 +131,13 @@ dissect_t124_new(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.124");
col_clear(pinfo->cinfo, COL_INFO);
- item = proto_tree_add_item(parent_tree, proto_t124, tvb, 0, tvb_length(tvb), ENC_NA);
+ item = proto_tree_add_item(parent_tree, proto_t124, tvb, 0, tvb_captured_length(tvb), ENC_NA);
tree = proto_item_add_subtree(item, ett_t124);
asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
dissect_t124_ConnectData(tvb, 0, &asn1_ctx, tree, hf_t124_ConnectData);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/asn1/t125/packet-t125-template.c b/asn1/t125/packet-t125-template.c
index 9d517ce451..77d70b37f1 100644
--- a/asn1/t125/packet-t125-template.c
+++ b/asn1/t125/packet-t125-template.c
@@ -72,7 +72,7 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.125");
col_clear(pinfo->cinfo, COL_INFO);
- item = proto_tree_add_item(parent_tree, proto_t125, tvb, 0, tvb_length(tvb), ENC_NA);
+ item = proto_tree_add_item(parent_tree, proto_t125, tvb, 0, tvb_captured_length(tvb), ENC_NA);
tree = proto_item_add_subtree(item, ett_t125);
get_ber_identifier(tvb, 0, &ber_class, &pc, &tag);
@@ -84,7 +84,7 @@ dissect_t125(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
dissect_DomainMCSPDU_PDU(tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
diff --git a/asn1/tetra/packet-tetra-template.c b/asn1/tetra/packet-tetra-template.c
index 28e0c82994..1429b1a995 100644
--- a/asn1/tetra/packet-tetra-template.c
+++ b/asn1/tetra/packet-tetra-template.c
@@ -227,7 +227,7 @@ void tetra_dissect_pdu(int channel_type, int dir, tvbuff_t *pdu, proto_tree *tre
guint8 p;
tetra_sub_item = proto_tree_add_item(tree, hf_tetra_pdu,
- pdu, 0, tvb_length(pdu), ENC_NA);
+ pdu, 0, tvb_captured_length(pdu), ENC_NA);
tetra_sub_tree = proto_item_add_subtree(tetra_sub_item, ett_tetra);
diff --git a/asn1/ulp/packet-ulp-template.c b/asn1/ulp/packet-ulp-template.c
index 9260faae73..d242da1302 100644
--- a/asn1/ulp/packet-ulp-template.c
+++ b/asn1/ulp/packet-ulp-template.c
@@ -84,7 +84,7 @@ dissect_ulp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ulp_desegment, ULP_HEADER_SIZE,
get_ulp_pdu_len, dissect_ULP_PDU_PDU, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_ulp(void);
diff --git a/asn1/x2ap/packet-x2ap-template.c b/asn1/x2ap/packet-x2ap-template.c
index d8bae5d36e..1491eacef5 100644
--- a/asn1/x2ap/packet-x2ap-template.c
+++ b/asn1/x2ap/packet-x2ap-template.c
@@ -89,27 +89,27 @@ void proto_reg_handoff_x2ap(void);
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint(x2ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint(x2ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static void