Remove depricated API tvb_length -> tvb_reported_length
Change-Id: I78b1d2accf4fd0b37eaa16cb8bf515422565e98a Reviewed-on: https://code.wireshark.org/review/8011 Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
38d3e063d3
commit
1785d42061
|
@ -250,7 +250,7 @@ IpnSecurityResponse B "2.6.1.18.1" "id-sec-security-common-fields"
|
|||
%(DEFAULT_BODY)s
|
||||
|
||||
if(subject)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", tvb_format_text(subject, 0, tvb_length(subject)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%%s)", tvb_format_text(subject, 0, tvb_reported_length(subject)));
|
||||
|
||||
#.FN_PARS CharacterSetRegistration
|
||||
VAL_PTR=&crs
|
||||
|
|
|
@ -82,7 +82,7 @@ ASIdentifiers B "1.3.6.1.5.5.7.1.8" "id-pe-autonomousSysIds"
|
|||
return offset;
|
||||
subtree = proto_item_add_subtree(actx->created_item, ett_pkix1explicit_addressFamily);
|
||||
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_afn, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
|
||||
if(tvb_length(parameter_tvb)>2)
|
||||
if(tvb_reported_length(parameter_tvb)>2)
|
||||
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_safi, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
|
||||
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ fp_info *fpinf ;
|
|||
|
||||
%(DEFAULT_BODY)s
|
||||
|
||||
bits_remaining = 8*tvb_length(tvb) - offset;
|
||||
bits_remaining = 8*tvb_reported_length(tvb) - offset;
|
||||
whole_octets_remaining = bits_remaining / 8;
|
||||
|
||||
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
|
||||
|
@ -542,7 +542,7 @@ fp_info *fpinf ;
|
|||
|
||||
%(DEFAULT_BODY)s
|
||||
|
||||
bits_remaining = 8*tvb_length(tvb) - offset;
|
||||
bits_remaining = 8*tvb_reported_length(tvb) - offset;
|
||||
whole_octets_remaining = bits_remaining / 8;
|
||||
|
||||
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
|
||||
|
@ -582,7 +582,7 @@ fp_info *fpinf ;
|
|||
|
||||
%(DEFAULT_BODY)s
|
||||
if (parameter_tvb){
|
||||
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
|
||||
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
|
||||
}
|
||||
|
||||
#.FN_BODY GSM-MS-RadioAccessCapability VAL_PTR = ¶meter_tvb
|
||||
|
@ -590,7 +590,7 @@ fp_info *fpinf ;
|
|||
|
||||
%(DEFAULT_BODY)s
|
||||
if (parameter_tvb){
|
||||
de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
|
||||
de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
|
||||
}
|
||||
|
||||
#.FN_BODY InterRATHandoverInfoWithInterRATCapabilities-r3-IEs/interRATHandoverInfo VAL_PTR = ¶meter_tvb
|
||||
|
@ -708,7 +708,7 @@ HNBName TYPE=FT_STRING DISPLAY=STR_UNICODE
|
|||
proto_tree *subtree;
|
||||
|
||||
%(DEFAULT_BODY)s
|
||||
length = tvb_length(nas_sys_info_gsm_map_tvb);
|
||||
length = tvb_reported_length(nas_sys_info_gsm_map_tvb);
|
||||
if (length) {
|
||||
if (actx->private_data) {
|
||||
switch (GPOINTER_TO_UINT(actx->private_data)-1) {
|
||||
|
|
|
@ -116,7 +116,7 @@ RTSE-apdus
|
|||
tvbuff_t *string = NULL;
|
||||
%(DEFAULT_BODY)s
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
#.FN_PARS CommonReference
|
||||
VAL_PTR=&string
|
||||
|
@ -124,7 +124,7 @@ RTSE-apdus
|
|||
tvbuff_t *string = NULL;
|
||||
%(DEFAULT_BODY)s
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
#.END
|
||||
|
||||
|
@ -132,7 +132,7 @@ RTSE-apdus
|
|||
tvbuff_t *string = NULL;
|
||||
%(DEFAULT_BODY)s
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %%s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
#.FN_BODY RTTPapdu VAL_PTR=&priority
|
||||
int priority = -1;
|
||||
|
|
|
@ -94,7 +94,7 @@ ProtocolIE-Single-Container
|
|||
#.FN_BODY RANAP-Message VAL_PTR = &ranap_message_tvb
|
||||
tvbuff_t *ranap_message_tvb=NULL;
|
||||
%(DEFAULT_BODY)s
|
||||
if ((tvb_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
|
||||
if ((tvb_reported_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
|
||||
col_set_str(actx->pinfo->cinfo, COL_INFO,
|
||||
"(RUA) "); /* Set info to (RUA) to make room for RANAP */
|
||||
col_set_fence(actx->pinfo->cinfo, COL_INFO);
|
||||
|
|
|
@ -100,7 +100,7 @@ ProtocolIE-Field/value ie_field_value
|
|||
|
||||
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
|
||||
3, 3, FALSE, ¶meter_tvb);
|
||||
if(tvb_length(tvb)==0)
|
||||
if(tvb_reported_length(tvb)==0)
|
||||
return offset;
|
||||
|
||||
if (!parameter_tvb)
|
||||
|
|
|
@ -1909,7 +1909,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
* have that routine deal with ASN.1, and just use
|
||||
* "tcp_dissect_pdus()"?)
|
||||
*/
|
||||
length_remaining = tvb_ensure_length_remaining(tvb, offset);
|
||||
length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
|
||||
|
||||
/* NOTE: we have to parse the message piece by piece, since the
|
||||
* capture length may be less than the message length: a 'global'
|
||||
|
|
|
@ -95,7 +95,7 @@ gint pdu_type=-1;
|
|||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &usm_p.engine_tvb);
|
||||
if (usm_p.engine_tvb) {
|
||||
proto_tree* engine_tree = proto_item_add_subtree(%(ACTX)s->created_item,ett_engineid);
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, usm_p.engine_tvb, 0, tvb_length_remaining(usm_p.engine_tvb,0));
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, usm_p.engine_tvb, 0, tvb_reported_length_remaining(usm_p.engine_tvb,0));
|
||||
}
|
||||
|
||||
#.FN_BODY SnmpEngineID
|
||||
|
@ -104,7 +104,7 @@ gint pdu_type=-1;
|
|||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶m_tvb);
|
||||
if (param_tvb) {
|
||||
proto_tree* engine_tree = proto_item_add_subtree(%(ACTX)s->created_item,ett_engineid);
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, param_tvb, 0, tvb_length_remaining(param_tvb,0));
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, param_tvb, 0, tvb_reported_length_remaining(param_tvb,0));
|
||||
}
|
||||
|
||||
#.FN_PARS UsmSecurityParameters/msgUserName
|
||||
|
|
|
@ -91,11 +91,11 @@ NegotiationToken
|
|||
len = call_dissector(next_level_value_lcl->wrap_handle, token_tvb, actx->pinfo,
|
||||
subtree);
|
||||
if (len == 0)
|
||||
offset = tvb_length(tvb);
|
||||
offset = tvb_reported_length(tvb);
|
||||
else
|
||||
offset = offset + len;
|
||||
} else
|
||||
offset = tvb_length(tvb);
|
||||
offset = tvb_reported_length(tvb);
|
||||
|
||||
#.FN_BODY MechTypeList
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ SampledValues
|
|||
nstime_t ts;
|
||||
gchar * ptime;
|
||||
|
||||
len = tvb_length_remaining(tvb, offset);
|
||||
len = tvb_reported_length_remaining(tvb, offset);
|
||||
|
||||
if(len != 8)
|
||||
{
|
||||
|
|
|
@ -133,7 +133,7 @@ RegistryAllocateHandleResponse/result AllocateHandleResponseResult
|
|||
/* Not sure why - but lets ignore the length. */
|
||||
/* We assume the OCTET STRING is all of the remaining bytes */
|
||||
|
||||
if(tvb_length(next_tvb) == 42) {
|
||||
if(tvb_reported_length(next_tvb) == 42) {
|
||||
/* this is perhaps a naive ... */
|
||||
next_tvb = tvb_new_subset_remaining(tvb, (old_offset>>3)+1);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ RegistryAllocateHandleResponse/result AllocateHandleResponseResult
|
|||
|
||||
if(next_tvb) {
|
||||
|
||||
ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
|
||||
ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_reported_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
|
||||
if(ns != NULL) {
|
||||
dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree, NULL);
|
||||
g_free(ns);
|
||||
|
|
|
@ -538,7 +538,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
offset = dissect_UDPTLPacket_PDU(tvb, pinfo, tr, NULL);
|
||||
|
||||
if (tvb_length_remaining(tvb,offset)>0){
|
||||
if (tvb_reported_length_remaining(tvb,offset)>0){
|
||||
proto_tree_add_expert_format(tr, pinfo, &ei_t38_malformed, tvb, offset, tvb_reported_length_remaining(tvb, offset),
|
||||
"[MALFORMED PACKET or wrong preference settings]");
|
||||
col_append_str(pinfo->cinfo, COL_INFO, " [Malformed?]");
|
||||
|
@ -575,13 +575,13 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "TCP: IFPPacket");
|
||||
|
||||
while(tvb_length_remaining(tvb,offset)>0)
|
||||
while(tvb_reported_length_remaining(tvb,offset)>0)
|
||||
{
|
||||
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
||||
offset += dissect_IFPPacket_PDU(next_tvb, pinfo, tr, NULL);
|
||||
ifp_packet_number++;
|
||||
|
||||
if(tvb_length_remaining(tvb,offset)>0){
|
||||
if(tvb_reported_length_remaining(tvb,offset)>0){
|
||||
if(t38_tpkt_usage == T38_TPKT_ALWAYS){
|
||||
proto_tree_add_expert_format(tr, pinfo, &ei_t38_malformed, tvb, offset, tvb_reported_length_remaining(tvb, offset),
|
||||
"[MALFORMED PACKET or wrong preference settings]");
|
||||
|
|
|
@ -152,7 +152,7 @@ VAL_PTR=&Data_Field_field_type_value
|
|||
guint32 value_len;
|
||||
|
||||
%(DEFAULT_BODY)s
|
||||
value_len = tvb_length(value_tvb);
|
||||
value_len = tvb_reported_length(value_tvb);
|
||||
|
||||
#.FN_FTR Data-Field/_item/field-data
|
||||
if (primary_part){
|
||||
|
|
|
@ -242,7 +242,7 @@ DistinguishedName B "2.16.840.1.101.2.2.1.188" "id-at-primaryMember"
|
|||
|
||||
if(out_tvb) {
|
||||
/* it was a string - format it */
|
||||
value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));
|
||||
value = tvb_format_text(out_tvb, 0, tvb_reported_length(out_tvb));
|
||||
|
||||
if(last_rdn) {
|
||||
g_strlcat(last_rdn, value, MAX_RDN_STR_LEN);
|
||||
|
|
|
@ -385,7 +385,7 @@ XDayOf/fifth fifth_dayof
|
|||
offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
|
||||
offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
|
||||
} else {
|
||||
gint32 remaining=tvb_length_remaining(tvb, offset);
|
||||
gint32 remaining=tvb_reported_length_remaining(tvb, offset);
|
||||
len=remaining>0 ? remaining : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -580,7 +580,7 @@ dissect_opsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
|
|||
}
|
||||
|
||||
dissect_attributes(tvb, pinfo, opsi_tree, HEADER_LENGTH, MIN(((int)tvb_reported_length(tvb)-HEADER_LENGTH), (tvb_get_ntohs(tvb, PACKET_LENGTH_OFFSET)-HEADER_LENGTH)));
|
||||
return tvb_length(tvb);
|
||||
return tvb_reported_length(tvb);
|
||||
}
|
||||
|
||||
|
||||
|
@ -590,7 +590,7 @@ dissect_opsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
|
|||
/* We should mimimally grab the header */
|
||||
tcp_dissect_pdus(tvb, pinfo, tree, opsi_desegment, HEADER_LENGTH, get_opsi_pdu_len,
|
||||
dissect_opsi_pdu, data);
|
||||
return tvb_length(tvb);
|
||||
return tvb_reported_length(tvb);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1233,7 +1233,7 @@ dissect_p22_SubjectField(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
|
|||
|
||||
|
||||
if(subject)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_format_text(subject, 0, tvb_length(subject)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " (%s)", tvb_format_text(subject, 0, tvb_reported_length(subject)));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -566,7 +566,7 @@ dissect_pkix1explicit_T_addressFamily(gboolean implicit_tag _U_, tvbuff_t *tvb _
|
|||
return offset;
|
||||
subtree = proto_item_add_subtree(actx->created_item, ett_pkix1explicit_addressFamily);
|
||||
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_afn, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
|
||||
if(tvb_length(parameter_tvb)>2)
|
||||
if(tvb_reported_length(parameter_tvb)>2)
|
||||
proto_tree_add_item(subtree, hf_pkix1explicit_addressFamily_safi, parameter_tvb, 0, 2, ENC_BIG_ENDIAN);
|
||||
|
||||
|
||||
|
|
|
@ -16622,7 +16622,7 @@ dissect_rrc_NAS_SystemInformationGSM_MAP(tvbuff_t *tvb _U_, int offset _U_, asn1
|
|||
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
|
||||
1, 8, FALSE, &nas_sys_info_gsm_map_tvb);
|
||||
|
||||
length = tvb_length(nas_sys_info_gsm_map_tvb);
|
||||
length = tvb_reported_length(nas_sys_info_gsm_map_tvb);
|
||||
if (length) {
|
||||
if (actx->private_data) {
|
||||
switch (GPOINTER_TO_UINT(actx->private_data)-1) {
|
||||
|
@ -56205,7 +56205,7 @@ dissect_rrc_T_single_GSM_Message_r3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
|
|||
ett_rrc_T_single_GSM_Message_r3, T_single_GSM_Message_r3_sequence);
|
||||
|
||||
|
||||
bits_remaining = 8*tvb_length(tvb) - offset;
|
||||
bits_remaining = 8*tvb_reported_length(tvb) - offset;
|
||||
whole_octets_remaining = bits_remaining / 8;
|
||||
|
||||
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
|
||||
|
@ -56491,7 +56491,7 @@ dissect_rrc_T_single_GSM_Message_r6(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
|
|||
ett_rrc_T_single_GSM_Message_r6, T_single_GSM_Message_r6_sequence);
|
||||
|
||||
|
||||
bits_remaining = 8*tvb_length(tvb) - offset;
|
||||
bits_remaining = 8*tvb_reported_length(tvb) - offset;
|
||||
whole_octets_remaining = bits_remaining / 8;
|
||||
|
||||
gsm_message_tvb = tvb_new_octet_aligned(tvb, offset, 8*whole_octets_remaining);
|
||||
|
@ -96013,7 +96013,7 @@ dissect_rrc_GSM_Classmark3(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
|
|||
1, 32, FALSE, ¶meter_tvb);
|
||||
|
||||
if (parameter_tvb){
|
||||
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
|
||||
de_ms_cm_3(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122501,7 +122501,7 @@ dissect_rrc_GSM_MS_RadioAccessCapability(tvbuff_t *tvb _U_, int offset _U_, asn1
|
|||
1, 64, FALSE, ¶meter_tvb);
|
||||
|
||||
if (parameter_tvb){
|
||||
de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
|
||||
de_gmm_ms_radio_acc_cap(parameter_tvb, tree, actx->pinfo, 0, tvb_reported_length(parameter_tvb), NULL, 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ dissect_rtse_T_t61String(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse
|
|||
&string);
|
||||
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
|
||||
|
||||
|
@ -330,7 +330,7 @@ dissect_rtse_T_octetString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
|
|||
&string);
|
||||
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
|
||||
|
||||
|
@ -368,7 +368,7 @@ dissect_rtse_CommonReference(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
|
|||
offset = dissect_ber_UTCTime(implicit_tag, actx, tree, tvb, offset, hf_index);
|
||||
|
||||
if(open_request && string)
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_length(string)));
|
||||
col_append_fstr(actx->pinfo->cinfo, COL_INFO, " %s", tvb_format_text(string, 0, tvb_reported_length(string)));
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -832,7 +832,7 @@ dissect_rua_RANAP_Message(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
|
|||
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
|
||||
NO_BOUND, NO_BOUND, FALSE, &ranap_message_tvb);
|
||||
|
||||
if ((tvb_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
|
||||
if ((tvb_reported_length(ranap_message_tvb)>0)&&(ranap_handle)) { /* RUA has a RANAP-PDU */
|
||||
col_set_str(actx->pinfo->cinfo, COL_INFO,
|
||||
"(RUA) "); /* Set info to (RUA) to make room for RANAP */
|
||||
col_set_fence(actx->pinfo->cinfo, COL_INFO);
|
||||
|
|
|
@ -554,7 +554,7 @@ dissect_sbc_ap_PLMNidentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
|
|||
|
||||
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
|
||||
3, 3, FALSE, ¶meter_tvb);
|
||||
if(tvb_length(tvb)==0)
|
||||
if(tvb_reported_length(tvb)==0)
|
||||
return offset;
|
||||
|
||||
if (!parameter_tvb)
|
||||
|
|
|
@ -2470,7 +2470,7 @@ dissect_snmp_SnmpEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
|
|||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, ¶m_tvb);
|
||||
if (param_tvb) {
|
||||
proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, param_tvb, 0, tvb_length_remaining(param_tvb,0));
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, param_tvb, 0, tvb_reported_length_remaining(param_tvb,0));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2487,7 +2487,7 @@ dissect_snmp_T_msgAuthoritativeEngineID(gboolean implicit_tag _U_, tvbuff_t *tvb
|
|||
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, &usm_p.engine_tvb);
|
||||
if (usm_p.engine_tvb) {
|
||||
proto_tree* engine_tree = proto_item_add_subtree(actx->created_item,ett_engineid);
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, usm_p.engine_tvb, 0, tvb_length_remaining(usm_p.engine_tvb,0));
|
||||
dissect_snmp_engineid(engine_tree, actx->pinfo, usm_p.engine_tvb, 0, tvb_reported_length_remaining(usm_p.engine_tvb,0));
|
||||
}
|
||||
|
||||
|
||||
|
@ -3125,7 +3125,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
* have that routine deal with ASN.1, and just use
|
||||
* "tcp_dissect_pdus()"?)
|
||||
*/
|
||||
length_remaining = tvb_ensure_length_remaining(tvb, offset);
|
||||
length_remaining = tvb_ensure_captured_length_remaining(tvb, offset);
|
||||
|
||||
/* NOTE: we have to parse the message piece by piece, since the
|
||||
* capture length may be less than the message length: a 'global'
|
||||
|
|
|
@ -516,11 +516,11 @@ dissect_spnego_InnerContextToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
|
|||
len = call_dissector(next_level_value_lcl->wrap_handle, token_tvb, actx->pinfo,
|
||||
subtree);
|
||||
if (len == 0)
|
||||
offset = tvb_length(tvb);
|
||||
offset = tvb_reported_length(tvb);
|
||||
else
|
||||
offset = offset + len;
|
||||
} else
|
||||
offset = tvb_length(tvb);
|
||||
offset = tvb_reported_length(tvb);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ dissect_sv_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
|
|||
nstime_t ts;
|
||||
gchar * ptime;
|
||||
|
||||
len = tvb_length_remaining(tvb, offset);
|
||||
len = tvb_reported_length_remaining(tvb, offset);
|
||||
|
||||
if(len != 8)
|
||||
{
|
||||
|
|
|
@ -737,7 +737,7 @@ static tvbuff_t *
|
|||
unpack_digitech_message(tvbuff_t *tvb, gint offset)
|
||||
{
|
||||
tvbuff_t *next_tvb;
|
||||
gint length = tvb_length(tvb);
|
||||
gint length = tvb_reported_length(tvb);
|
||||
gint data_len = length - offset - 2;
|
||||
const guint8* data_ptr;
|
||||
gint remaining = data_len;
|
||||
|
@ -972,7 +972,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
|
|||
* of System Exclusive packet (one byte is checksum, the other one
|
||||
* is EOX)
|
||||
*/
|
||||
if (tvb_length(tvb) - offset < 2)
|
||||
if (tvb_reported_length(tvb) - offset < 2)
|
||||
{
|
||||
/* There is no DigiTech procedure data, do not attempt further
|
||||
* dissection */
|
||||
|
@ -983,7 +983,7 @@ dissect_digitech_procedure(guint8 procedure, const gint offset,
|
|||
add_new_data_source(pinfo, data_tvb, "Unpacked Procedure Data");
|
||||
|
||||
data_offset = 0;
|
||||
data_len = tvb_length(data_tvb);
|
||||
data_len = tvb_reported_length(data_tvb);
|
||||
|
||||
switch (procedure)
|
||||
{
|
||||
|
@ -1115,7 +1115,7 @@ dissect_sysex_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SYSEX");
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "MIDI System Exclusive Command");
|
||||
|
||||
data_len = tvb_length(tvb);
|
||||
data_len = tvb_reported_length(tvb);
|
||||
|
||||
if (parent_tree)
|
||||
{
|
||||
|
@ -1181,7 +1181,7 @@ dissect_sysex_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree
|
|||
|
||||
dissect_digitech_procedure(procedure_id, offset, tvb, pinfo, tree);
|
||||
|
||||
len = tvb_length(tvb) - 2;
|
||||
len = tvb_reported_length(tvb) - 2;
|
||||
offset = len; /* Penultimate byte is checksum */
|
||||
data_ptr = tvb_get_ptr(tvb, 1, len);
|
||||
/* Calculate checksum */
|
||||
|
|
|
@ -581,7 +581,7 @@ dissect_t124_T_value(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
|
|||
|
||||
if(next_tvb) {
|
||||
|
||||
ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
|
||||
ns = tvb_get_string_enc(NULL, t124NSIdentifier, 0, tvb_reported_length(t124NSIdentifier), ENC_ASCII|ENC_NA);
|
||||
if(ns != NULL) {
|
||||
dissector_try_string(t124_ns_dissector_table, ns, next_tvb, actx->pinfo, top_tree, NULL);
|
||||
g_free(ns);
|
||||
|
@ -1514,7 +1514,7 @@ dissect_t124_T_connectPDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U
|
|||
/* Not sure why - but lets ignore the length. */
|
||||
/* We assume the OCTET STRING is all of the remaining bytes */
|
||||
|
||||
if(tvb_length(next_tvb) == 42) {
|
||||
if(tvb_reported_length(next_tvb) == 42) {
|
||||
/* this is perhaps a naive ... */
|
||||
next_tvb = tvb_new_subset_remaining(tvb, (old_offset>>3)+1);
|
||||
}
|
||||
|
|
|
@ -676,7 +676,7 @@ dissect_t38_T_field_data(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_
|
|||
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
|
||||
1, 65535, FALSE, &value_tvb);
|
||||
|
||||
value_len = tvb_length(value_tvb);
|
||||
value_len = tvb_reported_length(value_tvb);
|
||||
|
||||
|
||||
|
||||
|
@ -1127,7 +1127,7 @@ dissect_t38_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
offset = dissect_UDPTLPacket_PDU(tvb, pinfo, tr, NULL);
|
||||
|
||||
if (tvb_length_remaining(tvb,offset)>0){
|
||||
if (tvb_reported_length_remaining(tvb,offset)>0){
|
||||
proto_tree_add_expert_format(tr, pinfo, &ei_t38_malformed, tvb, offset, tvb_reported_length_remaining(tvb, offset),
|
||||
"[MALFORMED PACKET or wrong preference settings]");
|
||||
col_append_str(pinfo->cinfo, COL_INFO, " [Malformed?]");
|
||||
|
@ -1164,13 +1164,13 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "TCP: IFPPacket");
|
||||
|
||||
while(tvb_length_remaining(tvb,offset)>0)
|
||||
while(tvb_reported_length_remaining(tvb,offset)>0)
|
||||
{
|
||||
next_tvb = tvb_new_subset_remaining(tvb, offset);
|
||||
offset += dissect_IFPPacket_PDU(next_tvb, pinfo, tr, NULL);
|
||||
ifp_packet_number++;
|
||||
|
||||
if(tvb_length_remaining(tvb,offset)>0){
|
||||
if(tvb_reported_length_remaining(tvb,offset)>0){
|
||||
if(t38_tpkt_usage == T38_TPKT_ALWAYS){
|
||||
proto_tree_add_expert_format(tr, pinfo, &ei_t38_malformed, tvb, offset, tvb_reported_length_remaining(tvb, offset),
|
||||
"[MALFORMED PACKET or wrong preference settings]");
|
||||
|
|
|
@ -338,7 +338,7 @@ dissect_draft_error_code_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
|
|||
guint16 offset = MGMT_ERROR_MSG_HEADER_LENGTH + tvb_get_ntohs(parameter_tvb, MGMT_ERROR_MSG_LENGTH_OFFSET) + 4;
|
||||
proto_tree_add_item(parameter_tree, hf_draft_error_code, parameter_tvb, offset, MGMT_ERROR_CODE_LENGTH, ENC_BIG_ENDIAN);
|
||||
offset += MGMT_ERROR_CODE_LENGTH ;
|
||||
if( tvb_length_remaining(parameter_tvb,offset) > 0 )
|
||||
if( tvb_reported_length_remaining(parameter_tvb,offset) > 0 )
|
||||
proto_tree_add_item(parameter_tree, hf_info_string, parameter_tvb, offset, msg_length - offset,ENC_ASCII|ENC_NA);
|
||||
}
|
||||
/*----------------------Error Indication (Draft)-------------------------------*/
|
||||
|
@ -486,7 +486,7 @@ dissect_draft_tei_status_parameter(tvbuff_t *parameter_tvb, proto_tree *paramete
|
|||
{
|
||||
gint offset;
|
||||
offset = tvb_get_ntohs(parameter_tvb, TEI_STATUS_LENGTH_OFFSET) + 8;
|
||||
if(tvb_length_remaining(parameter_tvb, offset) > 0 ){
|
||||
if(tvb_reported_length_remaining(parameter_tvb, offset) > 0 ){
|
||||
proto_tree_add_item(parameter_tree, hf_tei_draft_status, parameter_tvb, offset, TEI_STATUS_LENGTH, ENC_BIG_ENDIAN);
|
||||
proto_item_append_text(parameter_item, " (%s)",
|
||||
val_to_str_const(tvb_get_ntohl(parameter_tvb, offset), tei_draft_status_values, "Unknown TEI Status"));
|
||||
|
@ -899,7 +899,7 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *v5ua_
|
|||
if((msg_class==0 || msg_class==1 || msg_class==9) && msg_type<=10)
|
||||
length = msg_length;
|
||||
}
|
||||
padding_length = tvb_length(parameter_tvb) - length;
|
||||
padding_length = tvb_reported_length(parameter_tvb) - length;
|
||||
paddingl = padding_length;
|
||||
|
||||
/* create proto_tree stuff */
|
||||
|
@ -1025,7 +1025,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
|
|||
|
||||
|
||||
offset = 0;
|
||||
while((remaining_length = tvb_length_remaining(parameters_tvb, offset))) {
|
||||
while((remaining_length = tvb_reported_length_remaining(parameters_tvb, offset))) {
|
||||
tag = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_TAG_OFFSET);
|
||||
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
|
||||
if(iua_version==DRAFT){
|
||||
|
@ -1406,7 +1406,7 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
iua_version = RFC;
|
||||
offset = COMMON_HEADER_LENGTH;
|
||||
|
||||
remaining_length = tvb_length_remaining(tvb, offset);
|
||||
remaining_length = tvb_reported_length_remaining(tvb, offset);
|
||||
|
||||
while(remaining_length) {
|
||||
tag = tvb_get_ntohs(tvb, offset);
|
||||
|
@ -1455,7 +1455,7 @@ dissect_v5ua(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
}
|
||||
else{
|
||||
offset+=2;
|
||||
remaining_length = tvb_length_remaining(tvb, offset);
|
||||
remaining_length = tvb_reported_length_remaining(tvb, offset);
|
||||
}
|
||||
/* add a notice for the draft version */
|
||||
if(iua_version == DRAFT){
|
||||
|
|
|
@ -108,7 +108,7 @@ dissect_x224_cr(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int off
|
|||
proto_tree_add_item(tree, hf_x224_class, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset += 1;
|
||||
|
||||
if(tvb_length_remaining(tvb, offset) > 0) {
|
||||
if(tvb_reported_length_remaining(tvb, offset) > 0) {
|
||||
len = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE);
|
||||
proto_tree_add_item(tree, hf_x224_rdp_rt, tvb, offset, len,
|
||||
ENC_ASCII|ENC_NA);
|
||||
|
|
|
@ -785,7 +785,7 @@ dissect_x509if_T_atadv_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
|
|||
|
||||
if(out_tvb) {
|
||||
/* it was a string - format it */
|
||||
value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));
|
||||
value = tvb_format_text(out_tvb, 0, tvb_reported_length(out_tvb));
|
||||
|
||||
if(last_rdn) {
|
||||
g_strlcat(last_rdn, value, MAX_RDN_STR_LEN);
|
||||
|
|
|
@ -1625,7 +1625,7 @@ dissect_x509sat_GUID(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U
|
|||
offset=dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
|
||||
offset=dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
|
||||
} else {
|
||||
gint32 remaining=tvb_length_remaining(tvb, offset);
|
||||
gint32 remaining=tvb_reported_length_remaining(tvb, offset);
|
||||
len=remaining>0 ? remaining : 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue