aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-06-19 21:41:35 -0700
committerEvan Huus <eapache@gmail.com>2014-06-20 05:33:04 +0000
commit980f5f6711ae5642adc509d9a8ee81d188f3a431 (patch)
treef4156d2827cd82a2812aadb2337fcd144a3bf5b5
parent45608810709251652104e32b3fd8065b0d50d0aa (diff)
batch of tvb-length conversions
Change-Id: I5e40df8af6841e3dad71c41d7e43c7971611b15f Reviewed-on: https://code.wireshark.org/review/2473 Reviewed-by: Evan Huus <eapache@gmail.com>
-rw-r--r--asn1/CMakeLists.txt3
-rw-r--r--asn1/h245/packet-h245-template.c4
-rw-r--r--asn1/h248/packet-h248-template.c12
-rw-r--r--asn1/h501/packet-h501-template.c4
-rw-r--r--asn1/hnbap/packet-hnbap-template.c16
-rw-r--r--asn1/idmp/packet-idmp-template.c4
-rw-r--r--asn1/ilp/packet-ilp-template.c2
-rw-r--r--asn1/isdn-sup/packet-isdn-sup-template.c18
-rw-r--r--asn1/kerberos/packet-kerberos-template.c42
-rw-r--r--epan/dissectors/packet-h245.c4
-rw-r--r--epan/dissectors/packet-h248.c12
-rw-r--r--epan/dissectors/packet-h501.c4
-rw-r--r--epan/dissectors/packet-hnbap.c16
-rw-r--r--epan/dissectors/packet-idmp.c4
-rw-r--r--epan/dissectors/packet-ilp.c2
-rw-r--r--epan/dissectors/packet-isdn-sup.c18
-rw-r--r--epan/dissectors/packet-kerberos.c42
17 files changed, 103 insertions, 104 deletions
diff --git a/asn1/CMakeLists.txt b/asn1/CMakeLists.txt
index 5eba0d44d6..216c22a4ab 100644
--- a/asn1/CMakeLists.txt
+++ b/asn1/CMakeLists.txt
@@ -64,6 +64,7 @@ set(ASN1_SRC_DIRS
ilp
inap
isdn-sup
+ kerberos
lcsap
ldap
logotypecertextn
@@ -126,8 +127,6 @@ set(ASN1_SRC_DIRS
)
set( BROKEN_ASN1_SRC_DIRS
- # Kerberos is a handwritten dissector, don't replace
- kerberos
# x721 does not build
x721
)
diff --git a/asn1/h245/packet-h245-template.c b/asn1/h245/packet-h245-template.c
index 60fe8f1860..8b05e30c3f 100644
--- a/asn1/h245/packet-h245-template.c
+++ b/asn1/h245/packet-h245-template.c
@@ -425,11 +425,11 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
- it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_length(tvb), PSNAME);
+ it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_captured_length(tvb), PSNAME);
tr=proto_item_add_subtree(it, ett_h245);
/* assume that whilst there is more tvb data, there are more h245 commands */
- while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
+ while ( tvb_reported_length_remaining( tvb, offset>>3 )>0 ){
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=wmem_new(wmem_packet_scope(), h245_packet_info);
init_h245_packet_info(h245_pi);
diff --git a/asn1/h248/packet-h248-template.c b/asn1/h248/packet-h248-template.c
index a8104ad82a..a6a5127032 100644
--- a/asn1/h248/packet-h248-template.c
+++ b/asn1/h248/packet-h248-template.c
@@ -805,7 +805,7 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_reported_length_remaining(tvb, offset);
}
@@ -843,7 +843,7 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_reported_length_remaining(tvb, offset);
}
@@ -1237,7 +1237,7 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb);
pi = actx->created_item;
- switch(tvb_length(next_tvb)) {
+ switch(tvb_reported_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1310,7 +1310,7 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *
pi = actx->created_item;
if (next_tvb) {
- switch(tvb_length(next_tvb)) {
+ switch(tvb_reported_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1389,7 +1389,7 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off
if (new_tvb) {
/* this field is either 2 or 4 bytes so just read it into an integer */
val=0;
- len=tvb_length(new_tvb);
+ len=tvb_reported_length(new_tvb);
for(i=0;i<len;i++){
val= (val<<8)|tvb_get_guint8(new_tvb, i);
}
@@ -1439,7 +1439,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect with the "megaco" dissector in Wireshark. (Both
encodings are MEGACO (RFC 3015) and both are H.248.)
*/
- if(tvb_length(tvb)>=6){
+ if(tvb_captured_length(tvb)>=6){
if(!tvb_strneql(tvb, 0, "MEGACO", 6)){
static dissector_handle_t megaco_handle=NULL;
if(!megaco_handle){
diff --git a/asn1/h501/packet-h501-template.c b/asn1/h501/packet-h501-template.c
index ed715533d5..ed5353a9c2 100644
--- a/asn1/h501/packet-h501-template.c
+++ b/asn1/h501/packet-h501-template.c
@@ -78,14 +78,14 @@ static int
dissect_h501_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, FALSE, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
dissect_h501_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, h501_desegment_tcp, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_h501 ----------------------------------------------*/
diff --git a/asn1/hnbap/packet-hnbap-template.c b/asn1/hnbap/packet-hnbap-template.c
index e8a73b0ac8..ef90ecceb1 100644
--- a/asn1/hnbap/packet-hnbap-template.c
+++ b/asn1/hnbap/packet-hnbap-template.c
@@ -83,46 +83,46 @@ void proto_reg_handoff_hnbap(void);
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
#if 0
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, 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 (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, 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 (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
#endif
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/asn1/idmp/packet-idmp-template.c b/asn1/idmp/packet-idmp-template.c
index 083004de11..a908b4b7ce 100644
--- a/asn1/idmp/packet-idmp-template.c
+++ b/asn1/idmp/packet-idmp-template.c
@@ -230,7 +230,7 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
dissect_idmp_IDM_PDU(FALSE, tvb, offset, &asn1_ctx, tree, hf_idmp_PDU);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
@@ -245,7 +245,7 @@ static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int dissect_idmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, idmp_desegment, 0, get_idmp_pdu_len, dissect_idmp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void idmp_reassemble_init (void)
diff --git a/asn1/ilp/packet-ilp-template.c b/asn1/ilp/packet-ilp-template.c
index 872ba37196..c6f1ce3b9f 100644
--- a/asn1/ilp/packet-ilp-template.c
+++ b/asn1/ilp/packet-ilp-template.c
@@ -82,7 +82,7 @@ dissect_ilp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ilp_desegment, ILP_HEADER_SIZE,
get_ilp_pdu_len, dissect_ILP_PDU_PDU, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_ilp(void);
diff --git a/asn1/isdn-sup/packet-isdn-sup-template.c b/asn1/isdn-sup/packet-isdn-sup-template.c
index 0ddc7e53bb..214a0ed411 100644
--- a/asn1/isdn-sup/packet-isdn-sup-template.c
+++ b/asn1/isdn-sup/packet-isdn-sup-template.c
@@ -161,7 +161,7 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -176,9 +176,9 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->arg_pdu)
offset = op_ptr->arg_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (ETSI Sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
@@ -210,7 +210,7 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -225,9 +225,9 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->res_pdu)
offset = op_ptr->res_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
@@ -260,7 +260,7 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!err_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_error, tvb, 0, 0, errcode);
@@ -275,9 +275,9 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (err_ptr->err_pdu)
offset = err_ptr->err_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
diff --git a/asn1/kerberos/packet-kerberos-template.c b/asn1/kerberos/packet-kerberos-template.c
index 96ceeaf5d2..fda91937d8 100644
--- a/asn1/kerberos/packet-kerberos-template.c
+++ b/asn1/kerberos/packet-kerberos-template.c
@@ -358,7 +358,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
enc_key_t *ek;
krb5_data data = {0,0,NULL};
krb5_keytab_entry key;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -367,7 +367,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -496,7 +496,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
krb5_error_code ret;
krb5_data data;
enc_key_t *ek;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -505,7 +505,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -680,7 +680,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
GSList *ske;
service_key_t *sk;
struct des3_ctx ctx;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
@@ -690,7 +690,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -1318,7 +1318,7 @@ dissect_krb5_decrypt_ticket_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1349,7 +1349,7 @@ dissect_krb5_decrypt_authenticator_data (gboolean imp_tag _U_, tvbuff_t *tvb, in
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1386,7 +1386,7 @@ dissect_krb5_decrypt_KDC_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offs
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1428,7 +1428,7 @@ dissect_krb5_decrypt_PA_ENC_TIMESTAMP (gboolean imp_tag _U_, tvbuff_t *tvb, int
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1460,7 +1460,7 @@ dissect_krb5_decrypt_AP_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1491,7 +1491,7 @@ dissect_krb5_decrypt_PRIV_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbPrivPart encrypted with usage
@@ -1522,7 +1522,7 @@ dissect_krb5_decrypt_CRED_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbCredPart encrypted with usage
@@ -1575,14 +1575,14 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
/* the next fields are optional so we have to check that we have
* more data in our buffers */
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_reported_length_remaining(tvb, offset)<2){
return offset;
}
/* dlgopt identifier */
proto_tree_add_item(tree, hf_krb_gssapi_dlgopt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_reported_length_remaining(tvb, offset)<2){
return offset;
}
/* dlglen identifier */
@@ -1590,8 +1590,8 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
proto_tree_add_item(tree, hf_krb_gssapi_dlglen, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(dlglen!=tvb_length_remaining(tvb, offset)){
- proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_length_remaining(tvb, offset));
+ if(dlglen!=tvb_reported_length_remaining(tvb, offset)){
+ proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_captured_length_remaining(tvb, offset));
return offset;
}
@@ -1814,7 +1814,7 @@ dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
All krb5 commands start with an APPL tag and thus is >=0x60
so if first byte is <=16 just blindly assume it is krb4 then
*/
- if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
+ if(tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
if(krb4_handle){
gboolean res;
@@ -1865,7 +1865,7 @@ dissect_kerberos_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1876,7 +1876,7 @@ dissect_kerberos_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
tcp_dissect_pdus(tvb, pinfo, tree, krb_desegment, 4, get_krb_pdu_len,
dissect_kerberos_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_kerberos -------------------------------------------*/
@@ -1996,7 +1996,7 @@ static int wrap_dissect_gss_kerb(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_kerberos_main(auth_tvb, pinfo, tree, FALSE, NULL);
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c
index 3591fec176..092f003725 100644
--- a/epan/dissectors/packet-h245.c
+++ b/epan/dissectors/packet-h245.c
@@ -14517,11 +14517,11 @@ dissect_h245_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, PSNAME);
- it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_length(tvb), PSNAME);
+ it=proto_tree_add_protocol_format(parent_tree, proto_h245, tvb, 0, tvb_captured_length(tvb), PSNAME);
tr=proto_item_add_subtree(it, ett_h245);
/* assume that whilst there is more tvb data, there are more h245 commands */
- while ( tvb_length_remaining( tvb, offset>>3 )>0 ){
+ while ( tvb_reported_length_remaining( tvb, offset>>3 )>0 ){
CLEANUP_PUSH(reset_h245_pi, NULL);
h245_pi=wmem_new(wmem_packet_scope(), h245_packet_info);
init_h245_packet_info(h245_pi);
diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c
index d646e4c050..df1cf437d3 100644
--- a/epan/dissectors/packet-h248.c
+++ b/epan/dissectors/packet-h248.c
@@ -1280,7 +1280,7 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_reported_length_remaining(tvb, offset);
}
@@ -1318,7 +1318,7 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset=dissect_ber_identifier(pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset=dissect_ber_length(pinfo, tree, tvb, offset, &len, NULL);
} else {
- len=tvb_length_remaining(tvb, offset);
+ len=tvb_reported_length_remaining(tvb, offset);
}
@@ -1712,7 +1712,7 @@ static int dissect_h248_SigParameterName(gboolean implicit_tag _U_, tvbuff_t *tv
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &next_tvb);
pi = actx->created_item;
- switch(tvb_length(next_tvb)) {
+ switch(tvb_reported_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1785,7 +1785,7 @@ static int dissect_h248_EventParameterName(gboolean implicit_tag _U_, tvbuff_t *
pi = actx->created_item;
if (next_tvb) {
- switch(tvb_length(next_tvb)) {
+ switch(tvb_reported_length(next_tvb)) {
case 4: param_id = tvb_get_ntohl(next_tvb,0); break;
case 3: param_id = tvb_get_ntoh24(next_tvb,0); break;
case 2: param_id = tvb_get_ntohs(next_tvb,0); break;
@@ -1864,7 +1864,7 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off
if (new_tvb) {
/* this field is either 2 or 4 bytes so just read it into an integer */
val=0;
- len=tvb_length(new_tvb);
+ len=tvb_reported_length(new_tvb);
for(i=0;i<len;i++){
val= (val<<8)|tvb_get_guint8(new_tvb, i);
}
@@ -5412,7 +5412,7 @@ dissect_h248(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect with the "megaco" dissector in Wireshark. (Both
encodings are MEGACO (RFC 3015) and both are H.248.)
*/
- if(tvb_length(tvb)>=6){
+ if(tvb_captured_length(tvb)>=6){
if(!tvb_strneql(tvb, 0, "MEGACO", 6)){
static dissector_handle_t megaco_handle=NULL;
if(!megaco_handle){
diff --git a/epan/dissectors/packet-h501.c b/epan/dissectors/packet-h501.c
index ffecca890b..de61793f58 100644
--- a/epan/dissectors/packet-h501.c
+++ b/epan/dissectors/packet-h501.c
@@ -2535,14 +2535,14 @@ static int
dissect_h501_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, FALSE, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
dissect_h501_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
dissect_tpkt_encap(tvb, pinfo, tree, h501_desegment_tcp, h501_pdu_handle);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_h501 ----------------------------------------------*/
diff --git a/epan/dissectors/packet-hnbap.c b/epan/dissectors/packet-hnbap.c
index 5b5bec4b8e..21e9791b10 100644
--- a/epan/dissectors/packet-hnbap.c
+++ b/epan/dissectors/packet-hnbap.c
@@ -2592,46 +2592,46 @@ static void dissect_HNBAP_PDU_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_extension_dissector_table, ProtocolIE_ID, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
#if 0
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
if (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_imsg_dissector_table, ProcedureCode, 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 (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_sout_dissector_table, ProcedureCode, 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 (!ProcedureCode) return 0;
- return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_string(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, NULL)) ? tvb_captured_length(tvb) : 0;
}
#endif
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- return (dissector_try_uint_new(hnbap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_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(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_length(tvb) : 0;
+ return (dissector_try_uint_new(hnbap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree, FALSE, NULL)) ? tvb_captured_length(tvb) : 0;
}
static void
diff --git a/epan/dissectors/packet-idmp.c b/epan/dissectors/packet-idmp.c
index 11ee9594cb..f27c393b55 100644
--- a/epan/dissectors/packet-idmp.c
+++ b/epan/dissectors/packet-idmp.c
@@ -716,7 +716,7 @@ static int dissect_idmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr
dissect_idmp_IDM_PDU(FALSE, tvb, offset, &asn1_ctx, tree, hf_idmp_PDU);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
@@ -731,7 +731,7 @@ static guint get_idmp_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int dissect_idmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, parent_tree, idmp_desegment, 0, get_idmp_pdu_len, dissect_idmp, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void idmp_reassemble_init (void)
diff --git a/epan/dissectors/packet-ilp.c b/epan/dissectors/packet-ilp.c
index 96af28495d..0e405d5023 100644
--- a/epan/dissectors/packet-ilp.c
+++ b/epan/dissectors/packet-ilp.c
@@ -4105,7 +4105,7 @@ dissect_ilp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, ilp_desegment, ILP_HEADER_SIZE,
get_ilp_pdu_len, dissect_ILP_PDU_PDU, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_ilp(void);
diff --git a/epan/dissectors/packet-isdn-sup.c b/epan/dissectors/packet-isdn-sup.c
index 315794ccc1..402af9fd23 100644
--- a/epan/dissectors/packet-isdn-sup.c
+++ b/epan/dissectors/packet-isdn-sup.c
@@ -2641,7 +2641,7 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -2656,9 +2656,9 @@ dissect_isdn_sup_arg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->arg_pdu)
offset = op_ptr->arg_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ARGUMENT TYPE (ETSI Sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
@@ -2690,7 +2690,7 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!op_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_operation, tvb, 0, 0, opcode);
@@ -2705,9 +2705,9 @@ dissect_isdn_sup_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (op_ptr->res_pdu)
offset = op_ptr->res_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED RESULT TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
@@ -2740,7 +2740,7 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (!err_ptr)
return offset;
- ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_length(tvb), ENC_NA);
+ ti = proto_tree_add_item(tree, proto_isdn_sup, tvb, offset, tvb_captured_length(tvb), ENC_NA);
isdn_sup_tree = proto_item_add_subtree(ti, ett_isdn_sup);
proto_tree_add_uint(isdn_sup_tree, hf_isdn_sup_error, tvb, 0, 0, errcode);
@@ -2755,9 +2755,9 @@ dissect_isdn_sup_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
if (err_ptr->err_pdu)
offset = err_ptr->err_pdu(tvb, pinfo, isdn_sup_tree, NULL);
else
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_reported_length_remaining(tvb, offset) > 0) {
proto_tree_add_text(isdn_sup_tree, tvb, offset, -1, "UNSUPPORTED ERROR TYPE (ETSI sup)");
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_reported_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c
index 934a4ff801..2fe4602b7f 100644
--- a/epan/dissectors/packet-kerberos.c
+++ b/epan/dissectors/packet-kerberos.c
@@ -609,7 +609,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
enc_key_t *ek;
krb5_data data = {0,0,NULL};
krb5_keytab_entry key;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -618,7 +618,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -747,7 +747,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
krb5_error_code ret;
krb5_data data;
enc_key_t *ek;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
/* don't do anything if we are not attempting to decrypt data */
@@ -756,7 +756,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -931,7 +931,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
GSList *ske;
service_key_t *sk;
struct des3_ctx ctx;
- int length = tvb_length(cryptotvb);
+ int length = tvb_captured_length(cryptotvb);
const guint8 *cryptotext = tvb_get_ptr(cryptotvb, 0, length);
@@ -941,7 +941,7 @@ decrypt_krb5_data(proto_tree *tree, packet_info *pinfo,
}
/* make sure we have all the data we need */
- if (tvb_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
+ if (tvb_captured_length(cryptotvb) < tvb_reported_length(cryptotvb)) {
return NULL;
}
@@ -1569,7 +1569,7 @@ dissect_krb5_decrypt_ticket_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1600,7 +1600,7 @@ dissect_krb5_decrypt_authenticator_data (gboolean imp_tag _U_, tvbuff_t *tvb, in
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1637,7 +1637,7 @@ dissect_krb5_decrypt_KDC_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offs
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1679,7 +1679,7 @@ dissect_krb5_decrypt_PA_ENC_TIMESTAMP (gboolean imp_tag _U_, tvbuff_t *tvb, int
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1711,7 +1711,7 @@ dissect_krb5_decrypt_AP_REP_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offse
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* draft-ietf-krb-wg-kerberos-clarifications-05.txt :
* 7.5.1
@@ -1742,7 +1742,7 @@ dissect_krb5_decrypt_PRIV_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbPrivPart encrypted with usage
@@ -1773,7 +1773,7 @@ dissect_krb5_decrypt_CRED_data (gboolean imp_tag _U_, tvbuff_t *tvb, int offset,
tvbuff_t *next_tvb;
next_tvb=tvb_new_subset_remaining(tvb, offset);
- length=tvb_length_remaining(tvb, offset);
+ length=tvb_captured_length_remaining(tvb, offset);
/* RFC4120 :
* EncKrbCredPart encrypted with usage
@@ -1826,14 +1826,14 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
/* the next fields are optional so we have to check that we have
* more data in our buffers */
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_reported_length_remaining(tvb, offset)<2){
return offset;
}
/* dlgopt identifier */
proto_tree_add_item(tree, hf_krb_gssapi_dlgopt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(tvb_length_remaining(tvb, offset)<2){
+ if(tvb_reported_length_remaining(tvb, offset)<2){
return offset;
}
/* dlglen identifier */
@@ -1841,8 +1841,8 @@ dissect_krb5_rfc1964_checksum(asn1_ctx_t *actx _U_, proto_tree *tree, tvbuff_t *
proto_tree_add_item(tree, hf_krb_gssapi_dlglen, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if(dlglen!=tvb_length_remaining(tvb, offset)){
- proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_length_remaining(tvb, offset));
+ if(dlglen!=tvb_reported_length_remaining(tvb, offset)){
+ proto_tree_add_text(tree, tvb, 0, 0, "Error: DlgLen:%d is not the same as number of bytes remaining:%d", dlglen, tvb_captured_length_remaining(tvb, offset));
return offset;
}
@@ -4075,7 +4075,7 @@ dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
All krb5 commands start with an APPL tag and thus is >=0x60
so if first byte is <=16 just blindly assume it is krb4 then
*/
- if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
+ if(tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb, 0)<=0x10){
if(krb4_handle){
gboolean res;
@@ -4126,7 +4126,7 @@ dissect_kerberos_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
col_set_str(pinfo->cinfo, COL_INFO, "Continuation");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -4137,7 +4137,7 @@ dissect_kerberos_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
tcp_dissect_pdus(tvb, pinfo, tree, krb_desegment, 4, get_krb_pdu_len,
dissect_kerberos_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_kerberos -------------------------------------------*/
@@ -4972,7 +4972,7 @@ static int wrap_dissect_gss_kerb(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_kerberos_main(auth_tvb, pinfo, tree, FALSE, NULL);
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}