forked from osmocom/wireshark
Remove the last deprecated tvb_length calls
And remove the shims themselves! Change-Id: I511c06eb21eaf68d1dc36bbb9558408807472f9c Reviewed-on: https://code.wireshark.org/review/9088 Reviewed-by: Evan Huus <eapache@gmail.com>
This commit is contained in:
parent
86e562f27d
commit
95ac3908d8
|
@ -2421,7 +2421,7 @@ static void free_proto_tree(void *tree)
|
||||||
static guint32
|
static guint32
|
||||||
align_4(tvbuff_t *tvb, guint32 aoffset)
|
align_4(tvbuff_t *tvb, guint32 aoffset)
|
||||||
{
|
{
|
||||||
if(tvb_length_remaining(tvb, aoffset) > 4 )
|
if(tvb_captured_length_remaining(tvb, aoffset) > 4 )
|
||||||
{
|
{
|
||||||
return (aoffset%4);
|
return (aoffset%4);
|
||||||
}
|
}
|
||||||
|
@ -2437,7 +2437,7 @@ get_string(tvbuff_t* tvb, guint offset, guint str_length)
|
||||||
gint length_remaining = 0;
|
gint length_remaining = 0;
|
||||||
gint max_length = (str_length < NW_UNI_MAX) ? str_length : NW_UNI_MAX;
|
gint max_length = (str_length < NW_UNI_MAX) ? str_length : NW_UNI_MAX;
|
||||||
|
|
||||||
length_remaining = tvb_length_remaining(tvb, offset);
|
length_remaining = tvb_captured_length_remaining(tvb, offset);
|
||||||
if((gint)str_length > length_remaining)
|
if((gint)str_length > length_remaining)
|
||||||
{
|
{
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
|
@ -3062,7 +3062,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
|
||||||
break;
|
break;
|
||||||
case 0x00000009: /* Binary String */
|
case 0x00000009: /* Binary String */
|
||||||
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
||||||
length_remaining = tvb_length_remaining(tvb, voffset);
|
length_remaining = tvb_captured_length_remaining(tvb, voffset);
|
||||||
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -3075,7 +3075,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
|
||||||
break;
|
break;
|
||||||
case 0x0000000d: /* Binary String List */
|
case 0x0000000d: /* Binary String List */
|
||||||
value1 = tvb_get_letohl(tvb, voffset); /* Overall length of field list */
|
value1 = tvb_get_letohl(tvb, voffset); /* Overall length of field list */
|
||||||
length_remaining = tvb_length_remaining(tvb, voffset);
|
length_remaining = tvb_captured_length_remaining(tvb, voffset);
|
||||||
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -3087,7 +3087,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
|
||||||
for (r=1; r<=number_of_items; r++)
|
for (r=1; r<=number_of_items; r++)
|
||||||
{
|
{
|
||||||
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
||||||
length_remaining = tvb_length_remaining(tvb, voffset);
|
length_remaining = tvb_captured_length_remaining(tvb, voffset);
|
||||||
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -3101,7 +3101,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
|
||||||
break;
|
break;
|
||||||
case 0x00000015: /* Stream */
|
case 0x00000015: /* Stream */
|
||||||
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
value1 = tvb_get_letohl(tvb, voffset); /* length of field */
|
||||||
length_remaining = tvb_length_remaining(tvb, voffset);
|
length_remaining = tvb_captured_length_remaining(tvb, voffset);
|
||||||
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -3251,7 +3251,7 @@ print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val
|
||||||
for (r=1; r <= number_of_items; r++)
|
for (r=1; r <= number_of_items; r++)
|
||||||
{
|
{
|
||||||
/* Trap for end of packet */
|
/* Trap for end of packet */
|
||||||
if(tvb_length_remaining(tvb, voffset)<12)
|
if(tvb_captured_length_remaining(tvb, voffset)<12)
|
||||||
{
|
{
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
}
|
}
|
||||||
|
@ -4166,7 +4166,7 @@ process_search_expression(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* Unknown Iteration search Item type */
|
default: /* Unknown Iteration search Item type */
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -4198,7 +4198,7 @@ process_search_subexpression(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pi
|
||||||
process_set_filter(it_subtree1, tvb, pinfo, values);
|
process_set_filter(it_subtree1, tvb, pinfo, values);
|
||||||
ioffset = values->voffset;
|
ioffset = values->voffset;
|
||||||
|
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -4294,7 +4294,7 @@ process_set_filter(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, nds_v
|
||||||
process_search_subexpression(it_tree, tvb, pinfo, values);
|
process_search_subexpression(it_tree, tvb, pinfo, values);
|
||||||
break;
|
break;
|
||||||
default: /* Unknown Iteration search type */
|
default: /* Unknown Iteration search type */
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -4778,7 +4778,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
|
||||||
#if 0
|
#if 0
|
||||||
ioffset += align_4(tvb, ioffset);
|
ioffset += align_4(tvb, ioffset);
|
||||||
#endif
|
#endif
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -4820,7 +4820,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
|
||||||
ioffset += align_4(tvb, ioffset);
|
ioffset += align_4(tvb, ioffset);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -4895,7 +4895,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
|
||||||
/* For now we will just skip this offset. NEED TO ADD LOGIC TO HANDLE */
|
/* For now we will just skip this offset. NEED TO ADD LOGIC TO HANDLE */
|
||||||
ioffset += 8;
|
ioffset += 8;
|
||||||
|
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4925,7 +4925,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
|
||||||
ioffset += 4;
|
ioffset += 4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (tvb_length_remaining(tvb, ioffset) < 4) {
|
if (tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
THROW(ReportedBoundsError);
|
THROW(ReportedBoundsError);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -4933,7 +4933,7 @@ dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, gui
|
||||||
}
|
}
|
||||||
it_verb = tvb_get_letohl(tvb, ioffset);
|
it_verb = tvb_get_letohl(tvb, ioffset);
|
||||||
ioffset += 4;
|
ioffset += 4;
|
||||||
if (it_verb == IT_DONE || tvb_length_remaining(tvb, ioffset) < 4) {
|
if (it_verb == IT_DONE || tvb_captured_length_remaining(tvb, ioffset) < 4) {
|
||||||
verb_string = val_to_str_const(it_verb, iterator_subverbs, "Internal error processing NDS iteration verbs");
|
verb_string = val_to_str_const(it_verb, iterator_subverbs, "Internal error processing NDS iteration verbs");
|
||||||
proto_tree_add_uint_format(it_tree, hf_ncp_nds_iterverb, tvb, ioffset-4, 4,
|
proto_tree_add_uint_format(it_tree, hf_ncp_nds_iterverb, tvb, ioffset-4, 4,
|
||||||
it_verb, "Iterator Verb: %d, (0x%04x), %s",
|
it_verb, "Iterator Verb: %d, (0x%04x), %s",
|
||||||
|
@ -5160,7 +5160,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
2, event_num);
|
2, event_num);
|
||||||
ioffset = ioffset + 2;
|
ioffset = ioffset + 2;
|
||||||
value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
|
value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
|
||||||
if(value5 > tvb_length_remaining(tvb, ioffset))
|
if(value5 > tvb_captured_length_remaining(tvb, ioffset))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5431,12 +5431,12 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
}
|
}
|
||||||
bvalue = bvalue*2;
|
bvalue = bvalue*2;
|
||||||
ioffset += align_4(tvb, ioffset);
|
ioffset += align_4(tvb, ioffset);
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5946,12 +5946,12 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
if (bvalue==0) {
|
if (bvalue==0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6016,7 +6016,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
if(values->vflags != 5)
|
if(values->vflags != 5)
|
||||||
{
|
{
|
||||||
value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
|
value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
|
||||||
length_remaining = tvb_length_remaining(tvb, ioffset);
|
length_remaining = tvb_captured_length_remaining(tvb, ioffset);
|
||||||
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
if(length_remaining == -1 || value1 > (guint32) length_remaining)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
|
@ -6103,7 +6103,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
|
proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
|
||||||
value2, temp_values.vstring);
|
value2, temp_values.vstring);
|
||||||
ioffset = ioffset + value2;
|
ioffset = ioffset + value2;
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6178,7 +6178,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
|
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
|
||||||
4, value1, "Default ACL %08x", value1);
|
4, value1, "Default ACL %08x", value1);
|
||||||
ioffset = ioffset + 4;
|
ioffset = ioffset + 4;
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6293,7 +6293,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
|
proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
|
||||||
4, value1, "Default ACL %08x", value1);
|
4, value1, "Default ACL %08x", value1);
|
||||||
ioffset = ioffset + 4;
|
ioffset = ioffset + 4;
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6313,7 +6313,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
value1, values->vstring);
|
value1, values->vstring);
|
||||||
ioffset = ioffset + value1;
|
ioffset = ioffset + value1;
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6332,7 +6332,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
value2, values->vstring);
|
value2, values->vstring);
|
||||||
ioffset = ioffset + value2;
|
ioffset = ioffset + value2;
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6363,7 +6363,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
4, value1, "Privileges 0x%08x", value1);
|
4, value1, "Privileges 0x%08x", value1);
|
||||||
ioffset = ioffset + 4;
|
ioffset = ioffset + 4;
|
||||||
}
|
}
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6602,7 +6602,7 @@ process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds
|
||||||
value3, values->vstring);
|
value3, values->vstring);
|
||||||
ioffset = ioffset + value3;
|
ioffset = ioffset + value3;
|
||||||
|
|
||||||
if(tvb_length_remaining(tvb, ioffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, ioffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6645,7 +6645,7 @@ dissect_ncp_89_6_request(tvbuff_t *tvb, proto_tree *volatile ncp_tree, guint32 o
|
||||||
proto_tree_add_item(ncp_tree, hf_ncp_directory_path, tvb, offset+2, string_len-2, TRUE);
|
proto_tree_add_item(ncp_tree, hf_ncp_directory_path, tvb, offset+2, string_len-2, TRUE);
|
||||||
}
|
}
|
||||||
offset += string_len;
|
offset += string_len;
|
||||||
if(tvb_length_remaining(tvb, offset) < 4 )
|
if(tvb_captured_length_remaining(tvb, offset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -6723,7 +6723,7 @@ dissect_ncp_123_17_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
proto_item_set_end(aitem, tvb, loffset);
|
proto_item_set_end(aitem, tvb, loffset);
|
||||||
if(tvb_length_remaining(tvb, loffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, loffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7079,7 +7079,7 @@ dissect_ncp_8x20reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree,
|
||||||
|
|
||||||
proto_item_set_end(aitem, tvb, loffset);
|
proto_item_set_end(aitem, tvb, loffset);
|
||||||
|
|
||||||
if(tvb_length_remaining(tvb, loffset) < 4 )
|
if(tvb_captured_length_remaining(tvb, loffset) < 4 )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7456,7 +7456,7 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
|
||||||
/* Determine which ncp_record to use. */
|
/* Determine which ncp_record to use. */
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NCP_ALLOCATE_SLOT:
|
case NCP_ALLOCATE_SLOT:
|
||||||
length_remaining = tvb_length_remaining(tvb, 4);
|
length_remaining = tvb_captured_length_remaining(tvb, 4);
|
||||||
if (length_remaining > 4)
|
if (length_remaining > 4)
|
||||||
{
|
{
|
||||||
testvar = tvb_get_ntohl(tvb, 4);
|
testvar = tvb_get_ntohl(tvb, 4);
|
||||||
|
@ -9124,7 +9124,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
|
||||||
* is 0, as we checked it above. Is there any
|
* is 0, as we checked it above. Is there any
|
||||||
* reason why we'd want to do a full dissection
|
* reason why we'd want to do a full dissection
|
||||||
* if the completion code isn't 0? */
|
* if the completion code isn't 0? */
|
||||||
if (completion_code != 0 && tvb_length(tvb) == 8) {
|
if (completion_code != 0 && tvb_captured_length(tvb) == 8) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9176,7 +9176,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
|
||||||
/* Check to see if we need to report to the expert table */
|
/* Check to see if we need to report to the expert table */
|
||||||
trap_for_expert_event(ncp_tree, pinfo, ncp_rec, 1);
|
trap_for_expert_event(ncp_tree, pinfo, ncp_rec, 1);
|
||||||
} else {
|
} else {
|
||||||
if (tvb_length(tvb) > 8) {
|
if (tvb_reported_length(tvb) > 8) {
|
||||||
expert_item = proto_tree_add_text(ncp_tree, tvb, 8, -1,
|
expert_item = proto_tree_add_text(ncp_tree, tvb, 8, -1,
|
||||||
"No request record found. Parsing is impossible.");
|
"No request record found. Parsing is impossible.");
|
||||||
if (ncp_echo_err) {
|
if (ncp_echo_err) {
|
||||||
|
|
|
@ -225,18 +225,12 @@ WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t *tvb);
|
||||||
* length of the packet). You probably want tvb_reported_length instead. */
|
* length of the packet). You probably want tvb_reported_length instead. */
|
||||||
WS_DLL_PUBLIC guint tvb_captured_length(const tvbuff_t *tvb);
|
WS_DLL_PUBLIC guint tvb_captured_length(const tvbuff_t *tvb);
|
||||||
|
|
||||||
/* DEPRECATED, do not use in new code, call tvb_captured_length directly! */
|
|
||||||
#define tvb_length tvb_captured_length
|
|
||||||
|
|
||||||
/** Computes bytes to end of buffer, from offset (which can be negative,
|
/** Computes bytes to end of buffer, from offset (which can be negative,
|
||||||
* to indicate bytes from end of buffer). Function returns 0 if offset is
|
* to indicate bytes from end of buffer). Function returns 0 if offset is
|
||||||
* either at the end of the buffer or out of bounds. No exception is thrown.
|
* either at the end of the buffer or out of bounds. No exception is thrown.
|
||||||
* You probably want tvb_reported_length_remaining instead. */
|
* You probably want tvb_reported_length_remaining instead. */
|
||||||
WS_DLL_PUBLIC gint tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset);
|
WS_DLL_PUBLIC gint tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset);
|
||||||
|
|
||||||
/* DEPRECATED, do not use in new code, call tvb_captured_length_remaining directly! */
|
|
||||||
#define tvb_length_remaining tvb_captured_length_remaining
|
|
||||||
|
|
||||||
/** Same as above, but throws an exception if the offset is out of bounds. */
|
/** Same as above, but throws an exception if the offset is out of bounds. */
|
||||||
WS_DLL_PUBLIC guint tvb_ensure_captured_length_remaining(const tvbuff_t *tvb,
|
WS_DLL_PUBLIC guint tvb_ensure_captured_length_remaining(const tvbuff_t *tvb,
|
||||||
const gint offset);
|
const gint offset);
|
||||||
|
|
|
@ -143,7 +143,6 @@ my %APIs = (
|
||||||
# have not been entirely removed from old code. These will become errors
|
# have not been entirely removed from old code. These will become errors
|
||||||
# once they've been removed from all existing code.
|
# once they've been removed from all existing code.
|
||||||
'soft-deprecated' => { 'count_errors' => 0, 'functions' => [
|
'soft-deprecated' => { 'count_errors' => 0, 'functions' => [
|
||||||
'tvb_length', # replaced with tvb_captured_length
|
|
||||||
'tvb_length_remaining', # replaced with tvb_captured_length_remaining
|
'tvb_length_remaining', # replaced with tvb_captured_length_remaining
|
||||||
'tvb_ensure_length_remaining', # replaced with tvb_ensure_captured_length_remaining
|
'tvb_ensure_length_remaining', # replaced with tvb_ensure_captured_length_remaining
|
||||||
'tvb_get_string', # replaced with tvb_get_string_enc
|
'tvb_get_string', # replaced with tvb_get_string_enc
|
||||||
|
|
|
@ -121,7 +121,7 @@ get_byte_view_data_and_length(GtkWidget *byte_view, guint *data_len)
|
||||||
if (byte_view_tvb == NULL)
|
if (byte_view_tvb == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((*data_len = tvb_length(byte_view_tvb))) {
|
if ((*data_len = tvb_captured_length(byte_view_tvb))) {
|
||||||
data_ptr = tvb_get_ptr(byte_view_tvb, 0, -1);
|
data_ptr = tvb_get_ptr(byte_view_tvb, 0, -1);
|
||||||
return data_ptr;
|
return data_ptr;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -57,8 +57,8 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const
|
||||||
memcpy(packet_buf, exp_pdu_data->tlv_buffer, exp_pdu_data->tlv_buffer_len);
|
memcpy(packet_buf, exp_pdu_data->tlv_buffer, exp_pdu_data->tlv_buffer_len);
|
||||||
g_free(exp_pdu_data->tlv_buffer);
|
g_free(exp_pdu_data->tlv_buffer);
|
||||||
}
|
}
|
||||||
if(exp_pdu_data->tvb_length > 0){
|
if(exp_pdu_data->tvb_captured_length > 0){
|
||||||
tvb_memcpy(exp_pdu_data->pdu_tvb, packet_buf+exp_pdu_data->tlv_buffer_len, 0, exp_pdu_data->tvb_length);
|
tvb_memcpy(exp_pdu_data->pdu_tvb, packet_buf+exp_pdu_data->tlv_buffer_len, 0, exp_pdu_data->tvb_captured_length);
|
||||||
}
|
}
|
||||||
pkthdr.rec_type = REC_TYPE_PACKET;
|
pkthdr.rec_type = REC_TYPE_PACKET;
|
||||||
pkthdr.ts.secs = pinfo->fd->abs_ts.secs;
|
pkthdr.ts.secs = pinfo->fd->abs_ts.secs;
|
||||||
|
|
Loading…
Reference in New Issue