Fixup: tvb_* -> tvb_captured

Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2014-06-17 17:45:00 +02:00 committed by Anders Broman
parent 971ffd683e
commit 246fe2ca4c
638 changed files with 3408 additions and 3408 deletions

View File

@ -1155,7 +1155,7 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
guint64 strtab_offset = 0;
guint64 dynstr_offset = 0;
if (tvb_length(tvb) < 52)
if (tvb_captured_length(tvb) < 52)
return 0;
if (tvb_memeql(tvb, 0, magic, sizeof(magic)) != 0)
@ -1703,8 +1703,8 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
}
if (segment_info[area_counter - 1].offset + segment_info[area_counter - 1].size < tvb_length(tvb)) {
len = tvb_length(tvb) - (guint) (segment_info[area_counter - 1].offset - segment_info[area_counter - 1].size);
if (segment_info[area_counter - 1].offset + segment_info[area_counter - 1].size < tvb_captured_length(tvb)) {
len = tvb_captured_length(tvb) - (guint) (segment_info[area_counter - 1].offset - segment_info[area_counter - 1].size);
proto_tree_add_text(blackhole_tree, tvb,
value_guard(segment_info[area_counter - 1].offset +
@ -1713,15 +1713,15 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
segment_info[area_counter - 1].name, len);
}
proto_tree_add_text(generated_tree, tvb, 0, 0, "File size: %i", tvb_length(tvb));
proto_tree_add_text(generated_tree, tvb, 0, 0, "File size: %i", tvb_captured_length(tvb));
proto_tree_add_text(generated_tree, tvb, 0, 0, "Header size + all segment size: %i", (int) file_size);
proto_tree_add_text(generated_tree, tvb, 0, 0, "Total blackholes size: %i", tvb_length(tvb) - (int) file_size);
proto_tree_add_text(generated_tree, tvb, 0, 0, "Total blackholes size: %i", tvb_captured_length(tvb) - (int) file_size);
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO, "(ELF)");
/* We jumping around offsets, so treat as bytes as read */
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
return offset;
}

View File

@ -110,7 +110,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
gboolean old_visible;
/* Put in frame header information. */
cap_len = tvb_length(tvb);
cap_len = tvb_captured_length(tvb);
frame_len = tvb_reported_length(tvb);
cap_plurality = plurality(cap_len, "", "s");

View File

@ -326,7 +326,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
gint offset=0, nul_offset;
nul_offset = tvb_find_guint8(tvb, offset, tvb_length_remaining(tvb, offset), 0);
nul_offset = tvb_find_guint8(tvb, offset, tvb_captured_length_remaining(tvb, offset), 0);
/* nul_offset == 0 means empty keyword, this is not allowed by the png standard */
if (nul_offset<=0) {
/* XXX exception */
@ -336,7 +336,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, &hfi_png_text_keyword, tvb, offset, nul_offset, ENC_ISO_8859_1|ENC_NA);
offset = nul_offset+1; /* length of the key word + 0 character */
proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA);
proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA);
}
@ -442,7 +442,7 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da
/* http://libpng.org/pub/png/spec/1.2/PNG-Structure.html#PNG-file-signature */
static const guint8 magic[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
if (tvb_length(tvb) < 20)
if (tvb_captured_length(tvb) < 20)
return 0;
if (tvb_memeql(tvb, 0, magic, sizeof(magic)) != 0)
return 0;

View File

@ -644,7 +644,7 @@ static gboolean
test_njack(tvbuff_t *tvb)
{
/* We need at least 'NJ200' + 1 Byte packet type */
if ( (tvb_length(tvb) < 6) ||
if ( (tvb_captured_length(tvb) < 6) ||
(tvb_strncaseeql(tvb, 0, "NJ200", 5) != 0) ) {
return FALSE;
}

View File

@ -746,7 +746,7 @@ dissect_3gpp2_service_option_profile(proto_tree *tree, tvbuff_t *tvb, packet_i
proto_tree_add_item(tree, hf_a11_serv_opt_prof_max_serv, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
while (tvb_length_remaining(tvb,offset) > 0) {
while (tvb_captured_length_remaining(tvb,offset) > 0) {
sub_type_length = tvb_get_guint8(tvb,offset+1);
sub_type = tvb_get_guint8(tvb,offset);
@ -790,7 +790,7 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac
guint8 sub_type, sub_type_length;
guint32 value;
while (tvb_length_remaining(tvb,offset) > 0) {
while (tvb_captured_length_remaining(tvb,offset) > 0) {
sub_type = tvb_get_guint8(tvb,offset);
sub_type_length = tvb_get_guint8(tvb,offset+1);
/* value is 2 octets */

View File

@ -1804,10 +1804,10 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
if (!iphc_tvb) return NULL;
/* Create the next header structure for the tunneled IPv6 header. */
nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_length(iphc_tvb));
nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_captured_length(iphc_tvb));
nhdr->next = NULL;
nhdr->proto = IP_PROTO_IPV6;
nhdr->length = tvb_length(iphc_tvb);
nhdr->length = tvb_captured_length(iphc_tvb);
nhdr->reported = tvb_reported_length(iphc_tvb);
tvb_memcpy(iphc_tvb, LOWPAN_NHDR_DATA(nhdr), 0, nhdr->length);
return nhdr;
@ -1887,8 +1887,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, nhc_tree);
/* Copy the remainder, and truncate the real buffer length. */
nhdr->length = tvb_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext);
tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_length_remaining(tvb, offset));
nhdr->length = tvb_captured_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext);
tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_captured_length_remaining(tvb, offset));
/* There is nothing more we can do. */
return nhdr;
@ -2072,7 +2072,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
/* Copy the UDP header and payload into the buffer. */
memcpy(LOWPAN_NHDR_DATA(nhdr), &udp, sizeof(struct udp_hdr));
tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_length_remaining(tvb, offset));
tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_captured_length_remaining(tvb, offset));
return nhdr;
}
/*=====================================================
@ -2320,7 +2320,7 @@ dissect_6lowpan_frag_first(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Add this datagram to the fragment table. */
frag_size = tvb_length(frag_tvb);
frag_size = tvb_captured_length(frag_tvb);
tvb_set_reported_length(frag_tvb, frag_size);
save_fragmented = pinfo->fragmented;
pinfo->fragmented = TRUE;

View File

@ -157,17 +157,17 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
{
default:
{
if(tvb_length(tvb) > 1)
if(tvb_captured_length(tvb) > 1)
proto_tree_add_item(subtree, hf_a_data, tvb, 1, -1, ENC_NA);
break;
}
case CONTEXT_INFO:
{
for(i = 1; i<tvb_length(tvb); )
for(i = 1; i<tvb_captured_length(tvb); )
{
switch(tvb_get_guint8(tvb, i))
{
default: i = tvb_length(tvb); continue;
default: i = tvb_captured_length(tvb); continue;
case 1:
case 3:
@ -209,7 +209,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
}
case SET_TEXT:
{
if(tvb_length(tvb) > 3)
if(tvb_captured_length(tvb) > 3)
{
proto_tree_add_item(subtree, hf_a_data, tvb, 1, 3, ENC_NA);
proto_tree_add_item(subtree, hf_a_length, tvb, 4, 1, ENC_NA);
@ -231,7 +231,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
{
proto_tree *infotree;
for(i=1; i<tvb_length(tvb); )
for(i=1; i<tvb_captured_length(tvb); )
{
switch(tvb_get_guint8(tvb, i))
{
@ -347,7 +347,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
}
case DO_COMMAND:
{
if(tvb_length(tvb) > 1)
if(tvb_captured_length(tvb) > 1)
{
proto_tree_add_item(subtree, hf_a_line, tvb, 1, 1, ENC_NA);
proto_tree_add_item(subtree, hf_a_length, tvb, 2, 1, ENC_NA);
@ -387,7 +387,7 @@ dissect_aasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
proto_item *ti; proto_tree *aasp_tree; guint n;
/* Check that there's enough data */
n = tvb_length(tvb);
n = tvb_captured_length(tvb);
if(n < 3) return 0;
col_clear(pinfo->cinfo, COL_INFO);

View File

@ -456,7 +456,7 @@ is_acn(tvbuff_t *tvb)
{
static const char acn_packet_id[] = "ASC-E1.17\0\0\0"; /* must be 12 bytes */
if (tvb_length(tvb) < (4+sizeof(acn_packet_id)))
if (tvb_captured_length(tvb) < (4+sizeof(acn_packet_id)))
return FALSE;
/* Check the bytes in octets 4 - 16 */
@ -2760,7 +2760,7 @@ dissect_acn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (data_offset == old_offset) break;
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/******************************************************************************/

View File

@ -503,37 +503,37 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_length_remaining(tvb, offset), command);
sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_captured_length_remaining(tvb, offset), command);
PROTO_ITEM_SET_GENERATED(sub_item);
col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown"));
if (command != CMD_UNKNOWN) {
sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_frame_number);
sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_captured_length_remaining(tvb, offset), command_frame_number);
PROTO_ITEM_SET_GENERATED(sub_item);
}
switch (command) {
case CMD_GET_FIRMWARE_VERSION:
proto_tree_add_item(main_tree, hf_firmware_version, tvb, offset, -1, ENC_NA | ENC_ASCII);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
case CMD_DIRECT_TRANSMIT:
use_status_word = TRUE;
if (tvb_length_remaining(tvb, offset) > 2) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 2);
if (tvb_captured_length_remaining(tvb, offset) > 2) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
offset += tvb_length_remaining(tvb, offset) - 2;
offset += tvb_captured_length_remaining(tvb, offset) - 2;
}
break;
case CMD_READ_BINARY_BLOCKS:
use_status_word = TRUE;
proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_length_remaining(tvb, offset) - 2;
proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_READ_VALUE_BLOCK:
@ -543,14 +543,14 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case CMD_GET_DATA_UID:
use_status_word = TRUE;
proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_length_remaining(tvb, offset) - 2;
proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_GET_DATA_ATS:
use_status_word = TRUE;
proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_length_remaining(tvb, offset) - 2;
proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_BI_COLOR_AND_BUZZER_LED_CONTROL:

View File

@ -1785,7 +1785,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
top_tree = NULL;
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/*--- proto_register_acse ----------------------------------------------*/

View File

@ -486,7 +486,7 @@ static int dissect_actrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_actrace_isdn(tvb, pinfo, tree, actrace_tree);
break;
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
return 0;

View File

@ -216,7 +216,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* heuristic to recognize type of (partial) packet */
if (tvb_length_remaining(tvb, offset) >= 4) {
if (tvb_captured_length_remaining(tvb, offset) >= 4) {
guint8 hex_ascii_length[5];
hex_ascii_length[4] = 0;
@ -237,10 +237,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (g_str_has_prefix(service, "shell:")) {
proto_tree_add_item(main_tree, hf_stdin, tvb, offset, -1, ENC_NA | ENC_ASCII);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
return offset;
@ -274,7 +274,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
wmem_tree_insert32_array(client_requests, key, client_request);
}
if (!pinfo->fd->flags.visited && (length == -1 || (client_request && client_request->service_in == -1 && tvb_length_remaining(tvb, offset) > 0))) { /* save Service to client_requests */
if (!pinfo->fd->flags.visited && (length == -1 || (client_request && client_request->service_in == -1 && tvb_captured_length_remaining(tvb, offset) > 0))) { /* save Service to client_requests */
if (!client_request) {
if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID)
wireshark_interface_id = pinfo->phdr->interface_id;
@ -300,19 +300,19 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
}
if (!client_request_service && tvb_length_remaining(tvb, offset) > 0) {
if (!client_request_service && tvb_captured_length_remaining(tvb, offset) > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, " Unknown service");
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
} else if (tvb_length_remaining(tvb, offset) > 0) {
offset = tvb_captured_length(tvb);
} else if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(main_tree, hf_service, tvb, offset, -1, ENC_NA | ENC_ASCII);
service = (guint8 *) wmem_alloc(wmem_packet_scope(), tvb_length_remaining(tvb, offset) + 1);
tvb_memcpy(tvb, service, offset, tvb_length_remaining(tvb, offset));
service[tvb_length_remaining(tvb, offset)] = '\0';
service = (guint8 *) wmem_alloc(wmem_packet_scope(), tvb_captured_length_remaining(tvb, offset) + 1);
tvb_memcpy(tvb, service, offset, tvb_captured_length_remaining(tvb, offset));
service[tvb_captured_length_remaining(tvb, offset)] = '\0';
col_append_fstr(pinfo->cinfo, COL_INFO, " Service=<%s>", service);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
} else if (pinfo->srcport == server_port) { /* Server sent to Client */
@ -358,7 +358,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (!service) {
col_append_fstr(pinfo->cinfo, COL_INFO, " Unknown service");
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
return offset;
}
@ -387,7 +387,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_append_fstr(pinfo->cinfo, COL_INFO, " Service=<%s>", service);
if (tvb_length_remaining(tvb, offset) <= 0) return offset;
if (tvb_captured_length_remaining(tvb, offset) <= 0) return offset;
if (!pinfo->fd->flags.visited && client_request && client_request->data_in == -1) {
client_request->data_in = pinfo->fd->num;
@ -396,12 +396,12 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (status == STATUS_FAIL) {
sub_item = proto_tree_add_item(main_tree, hf_fail_reason, tvb, offset, -1, ENC_NA | ENC_ASCII);
if (length < tvb_length_remaining(tvb, offset)) {
if (length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
col_append_fstr(pinfo->cinfo, COL_INFO, " Fail=<%s>", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII));
offset = tvb_length(tvb);
col_append_fstr(pinfo->cinfo, COL_INFO, " Fail=<%s>", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII));
offset = tvb_captured_length(tvb);
return offset;
}
@ -430,7 +430,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
sub_item = proto_tree_add_item(main_tree, hf_devices, tvb, offset, -1, ENC_NA | ENC_ASCII);
if (data_length < tvb_length_remaining(tvb, offset)) {
if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
} else if (g_strcmp0(service, "host:get-state") == 0 ||
@ -443,7 +443,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
sub_item = proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII);
if (data_length < tvb_length_remaining(tvb, offset)) {
if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
} else if (g_str_has_prefix(service, "framebuffer:")) {
@ -509,7 +509,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset += 4;
}
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item *pixel_item;
proto_tree *pixel_tree;
@ -524,8 +524,8 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
client_request->data.framebuffer_data->red_offset == 11 &&
client_request->data.framebuffer_data->green_offset == 5 &&
client_request->data.framebuffer_data->blue_offset == 0) {
while (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_length_remaining(tvb, offset) < 2) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) < 2) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset, -1, ENC_NA);
offset += 1;
}
@ -544,10 +544,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
client_request->data.framebuffer_data->blue_length == 8 &&
(client_request->data.framebuffer_data->alpha_length == 0 ||
client_request->data.framebuffer_data->alpha_length == 8)) {
while (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_length_remaining(tvb, offset) < 3 || (tvb_length_remaining(tvb, offset) < 4 && client_request->data.framebuffer_data->alpha_offset > 0)) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) < 3 || (tvb_captured_length_remaining(tvb, offset) < 4 && client_request->data.framebuffer_data->alpha_offset > 0)) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
break;
}
@ -569,10 +569,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset += 3;
}
} else {
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
} else {
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
}
} else if (g_strcmp0(service, "track-jdwp") == 0) {
@ -580,13 +580,13 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
sub_item = proto_tree_add_item(main_tree, hf_pids, tvb, offset, -1, ENC_NA | ENC_ASCII);
if (data_length < tvb_length_remaining(tvb, offset)) {
if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
}
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else if ((g_strcmp0(service, "shell:export ANDROID_LOG_TAGS=\"\" ; exec logcat -B") == 0) ||
(g_strcmp0(service, "shell:logcat -B") == 0)) {
tvbuff_t *next_tvb;
@ -627,7 +627,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
}
size += tvb_length_remaining(tvb, i_offset);
size += tvb_captured_length_remaining(tvb, i_offset);
if (size > 0) {
buffer = (guint8 *) wmem_alloc(pinfo->pool, size);
if (fragment && i_char > 0)
@ -642,12 +642,12 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
i_offset += 1;
old_offset = i_offset;
while (tvb_length_remaining(tvb, i_offset) > 0) {
while (tvb_captured_length_remaining(tvb, i_offset) > 0) {
c2 = tvb_get_guint8(tvb, i_offset);
if (c1 == '\r' && c2 == '\n') {
buffer[i_char] = c2;
if (tvb_length_remaining(tvb, i_offset) > 1) {
if (tvb_captured_length_remaining(tvb, i_offset) > 1) {
c1 = tvb_get_guint8(tvb, i_offset + 1);
i_offset += 2;
i_char += 1;
@ -664,10 +664,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
i_offset += 1;
}
if (tvb_length_remaining(tvb, old_offset) == 0) {
if (tvb_captured_length_remaining(tvb, old_offset) == 0) {
buffer[i_char] = c1;
i_char += 1;
} else if (tvb_length_remaining(tvb, old_offset) > 0) {
} else if (tvb_captured_length_remaining(tvb, old_offset) > 0) {
buffer[i_char] = c2;
i_char += 1;
}
@ -676,8 +676,8 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
add_new_data_source(pinfo, next_tvb, "Logcat");
i_offset = 0;
while (tvb_length_remaining(next_tvb, i_offset) > 0) {
if (tvb_length_remaining(next_tvb, i_offset) >= 4) {
while (tvb_captured_length_remaining(next_tvb, i_offset) > 0) {
if (tvb_captured_length_remaining(next_tvb, i_offset) >= 4) {
payload_length = tvb_get_letohs(next_tvb, i_offset);
try_header_size = tvb_get_letohs(next_tvb, i_offset + 2);
@ -687,7 +687,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
logcat_length = payload_length + 24;
}
if (tvb_length_remaining(next_tvb, i_offset) >= 4 && tvb_length_remaining(next_tvb, i_offset) >= logcat_length) {
if (tvb_captured_length_remaining(next_tvb, i_offset) >= 4 && tvb_captured_length_remaining(next_tvb, i_offset) >= logcat_length) {
new_tvb = tvb_new_subset_length(next_tvb, i_offset, logcat_length);
call_dissector(logcat_handle, new_tvb, pinfo, main_tree);
@ -711,7 +711,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
fragment = wmem_new(wmem_file_scope(), fragment_t);
fragment->length = tvb_length_remaining(next_tvb, i_offset);
fragment->length = tvb_captured_length_remaining(next_tvb, i_offset);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
tvb_memcpy(next_tvb, fragment->data, i_offset, fragment->length);
fragment->reassembled_in_frame = -1;
@ -720,33 +720,33 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
proto_tree_add_item(main_tree, hf_fragment, next_tvb, i_offset, -1, ENC_NA);
i_offset = tvb_length(next_tvb);
i_offset = tvb_captured_length(next_tvb);
}
}
}
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "shell:")) {
proto_tree_add_item(main_tree, hf_stdout, tvb, offset, -1, ENC_NA | ENC_ASCII);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "jdwp:")) {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "sync:")) {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
} else if (g_strcmp0(service, "host:list-forward") == 0 ||
g_str_has_prefix(service, "root:") ||
g_str_has_prefix(service, "remount:") ||
g_str_has_prefix(service, "tcpip:") ||
g_str_has_prefix(service, "usb:")) {
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
} else {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
} else {
@ -759,7 +759,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, main_tree);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;

View File

@ -363,10 +363,10 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
offset += 4;
proto_tree_add_item(adwin_tree, hf_adwin_config_unused, tvb, offset, 128, ENC_NA);
offset += 128;
length = tvb_length(tvb) - offset;
length = tvb_captured_length(tvb) - offset;
proto_tree_add_item(adwin_tree, hf_adwin_config_data, tvb, offset, length, ENC_NA);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* 00:50:c2:0a:2*:** */

View File

@ -439,7 +439,7 @@ static const value_string packet_type_mapping[] = {
static value_string_ext packet_type_mapping_ext = VALUE_STRING_EXT_INIT(packet_type_mapping);
#define SET_PACKET_TYPE(tree, type) \
proto_tree_add_int(tree, hf_adwin_packet_type, tvb, 0, tvb_length(tvb), type);
proto_tree_add_int(tree, hf_adwin_packet_type, tvb, 0, tvb_captured_length(tvb), type);
/* Initialize the protocol and registered fields */

View File

@ -5247,7 +5247,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!request_val) { /* missing request */
col_set_str(pinfo->cinfo, COL_INFO, "[Reply without query?]");
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
afp_command = request_val->command;
@ -5278,7 +5278,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_set_str(pinfo->cinfo, COL_INFO,
"[Error!IP port reused, you need to split the capture file]");
expert_add_info(pinfo, ti, &ei_afp_ip_port_reused);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/*
@ -5520,7 +5520,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!len) {
/* for some calls if the reply is an error there's no data
*/
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
switch (afp_command) {
@ -5621,7 +5621,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
pinfo, afp_tree);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static void afp_reinit( void)

View File

@ -916,7 +916,7 @@ static const fragment_items afs_frag_items = {
} else { \
if ( ! seen_null ) { \
proto_tree_add_text(tree, tvb, offset, \
tvb_length_remaining(tvb, offset), \
tvb_captured_length_remaining(tvb, offset), \
"Null Interface Addresses"); \
seen_null = 1; \
} \
@ -971,7 +971,7 @@ static const fragment_items afs_frag_items = {
offset += bytes;
/* Raw data - to end of frame */
#define OUT_BYTES_ALL(field) OUT_BYTES(field, tvb_length_remaining(tvb,offset))
#define OUT_BYTES_ALL(field) OUT_BYTES(field, tvb_captured_length_remaining(tvb,offset))
/* Raw data */
#define OUT_BYTES(field, bytes) \
@ -1025,7 +1025,7 @@ static const fragment_items afs_frag_items = {
OUT_RXString(hf_afs_kauth_realm); \
}
#define GETSTR (tvb_format_text(tvb,offset,tvb_length_remaining(tvb,offset)))
#define GETSTR (tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb,offset)))
#define VALID_OPCODE(opcode) ((opcode >= OPCODE_LOW && opcode <= OPCODE_HIGH) || \
(opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \
@ -1828,7 +1828,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
frag_msg = fragment_add_seq_check(&afs_reassembly_table,
tvb, offset, pinfo, afs_seqid, NULL,
rxinfo->seq-1, tvb_length_remaining(tvb, offset),
rxinfo->seq-1, tvb_captured_length_remaining(tvb, offset),
! ( rxinfo->flags & RX_LAST_PACKET ) );
new_tvb = process_reassembled_data( tvb, offset, pinfo, "Reassembled RX", frag_msg,
@ -1840,7 +1840,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_append_str(pinfo->cinfo, COL_INFO, " [AFS reassembled]");
} else {
col_set_str(pinfo->cinfo, COL_INFO, "[AFS segment of a reassembled PDU]");
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
}
@ -1917,7 +1917,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -954,7 +954,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
break;
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -962,7 +962,7 @@ dissect_agentx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 20, get_agentx_pdu_len,
dissect_agentx_pdu, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static const true_false_string tfs_agentx_include = { "Yes", "No" };

View File

@ -58,7 +58,7 @@ static gint ett_aim_buddylist = -1;
static int dissect_aim_buddylist_buddylist(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree)
{
int offset = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_buddyname( tvb, pinfo, offset, buddy_tree);
}
return offset;

View File

@ -73,7 +73,7 @@ static gint ett_aim_chat = -1;
static int dissect_aim_chat_userinfo_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *chat_tree)
{
int offset = 0;
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_userinfo(tvb, pinfo, offset, chat_tree);
}
return offset;
@ -89,12 +89,12 @@ static int dissect_aim_chat_outgoing_msg(tvbuff_t *tvb, packet_info *pinfo, prot
buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 );
/* channel message from client */
aim_get_message( msg, tvb, 40 + buddyname_length, tvb_length(tvb)
aim_get_message( msg, tvb, 40 + buddyname_length, tvb_captured_length(tvb)
- 40 - buddyname_length );
col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
@ -108,7 +108,7 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot
msg=(guchar *)wmem_alloc(wmem_packet_scope(), 1000);
buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 );
aim_get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb)
aim_get_message( msg, tvb, 36 + buddyname_length, tvb_captured_length(tvb)
- 36 - buddyname_length );
col_append_fstr(pinfo->cinfo, COL_INFO, "from: %s", buddyname);
@ -119,7 +119,7 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot
"Screen Name: %s",
format_text(buddyname, buddyname_length));
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static const aim_subtype aim_fnac_family_chat[] = {

View File

@ -41,7 +41,7 @@ static int ett_aim_directory = -1;
static int dissect_aim_directory_user_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;

View File

@ -217,10 +217,10 @@ static int dissect_generic_rateinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto
static int dissect_aim_generic_clientready(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
proto_item *ti = proto_tree_add_text(gen_tree, tvb, 0, tvb_length(tvb), "Supported services");
proto_item *ti = proto_tree_add_text(gen_tree, tvb, 0, tvb_captured_length(tvb), "Supported services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
@ -240,10 +240,10 @@ static int dissect_aim_generic_clientready(tvbuff_t *tvb, packet_info *pinfo _U_
static int dissect_aim_generic_serverready(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Supported services");
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Supported services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 2, "%s (0x%x)", family?family->name:"Unknown Family", famnum);
@ -271,10 +271,10 @@ static int dissect_aim_generic_redirect(tvbuff_t *tvb, packet_info *pinfo, proto
static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Requested services");
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Requested services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2));
@ -286,10 +286,10 @@ static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U
static int dissect_aim_generic_capack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Accepted requested services");
proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Accepted requested services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2));
@ -310,7 +310,7 @@ static int dissect_aim_generic_motd(tvbuff_t *tvb, packet_info *pinfo, proto_tre
static int dissect_aim_generic_rateinfoack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_uint(gen_tree, hf_generic_rateinfoack_group, tvb, offset, 2, tvb_get_ntohs(tvb, offset));
offset+=2;
}
@ -330,7 +330,7 @@ static int dissect_aim_generic_ratechange(tvbuff_t *tvb, packet_info *pinfo, pro
static int dissect_aim_generic_clientpauseack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(gen_tree, tvb, offset, 4, "Family: %s (0x%x)", family?family->name:"Unknown Family", famnum);
@ -384,7 +384,7 @@ static int dissect_aim_generic_evil(tvbuff_t *tvb, packet_info *pinfo, proto_tre
{
int offset = 0;
proto_tree_add_item(gen_tree, hf_generic_evil_new_warn_level, tvb, offset, 2, ENC_BIG_ENDIAN);
while(tvb_length_remaining(tvb, offset) > 0) {
while(tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_userinfo(tvb, pinfo, offset, gen_tree);
}
return offset;

View File

@ -104,7 +104,7 @@ static int dissect_aim_location_setuserinfo(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_aim_location_watcher_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree)
{
int offset = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_buddyname(tvb, pinfo, offset, loc_tree);
}
return offset;

View File

@ -507,7 +507,7 @@ dissect_aim_rendezvous_extended_message(tvbuff_t *tvb, proto_tree *msg_tree)
text = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, text_length, ENC_ASCII|ENC_NA);
proto_tree_add_text(msg_tree, tvb, offset, text_length, "Text: %s", text); /* offset+=text_length; */
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
return offset;
}
@ -571,7 +571,7 @@ dissect_aim_tlv_value_extended_data(proto_item *ti, guint16 valueid _U_, tvbuff_
/* plugin-specific data follows */
proto_tree_add_text(entry, tvb, offset, -1, "Plugin-specific data");
}
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
return offset;
}
@ -604,7 +604,7 @@ dissect_aim_msg_client_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *msg_tr
reason = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(msg_tree, hf_aim_icbm_client_err_reason, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2;
if (reason == CLIENT_ERR__REASON_CHANNEL_SPECIFIC && tvb_length_remaining(tvb, offset) > 0)
if (reason == CLIENT_ERR__REASON_CHANNEL_SPECIFIC && tvb_captured_length_remaining(tvb, offset) > 0)
{
switch (channel)
{

View File

@ -51,7 +51,7 @@ static int dissect_aim_snac_signon_logon(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree)
{
int offset = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;
@ -62,7 +62,7 @@ static int dissect_aim_snac_signon_logon_reply(tvbuff_t *tvb,
proto_tree *tree)
{
int offset = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;

View File

@ -157,7 +157,7 @@ static int dissect_ssi_ssi_items(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
gint ssi_entry_size;
proto_item *ti;
proto_tree *ssi_entry = NULL;
int size = tvb_length(tvb);
int size = tvb_captured_length(tvb);
while (size > offset)
{
ssi_entry_size = calc_ssi_entry_size(tvb, offset);

View File

@ -44,8 +44,8 @@ static gint ett_aim_userlookup = -1;
static int dissect_aim_userlookup_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *lookup_tree)
{
proto_tree_add_item(lookup_tree, hf_aim_userlookup_email, tvb, 0, tvb_length(tvb), ENC_UTF_8|ENC_NA);
return tvb_length(tvb);
proto_tree_add_item(lookup_tree, hf_aim_userlookup_email, tvb, 0, tvb_captured_length(tvb), ENC_UTF_8|ENC_NA);
return tvb_captured_length(tvb);
}

View File

@ -1048,7 +1048,7 @@ dissect_aim_tlv_value_client_capabilities(proto_item *ti _U_, guint16 valueid _U
offset = dissect_aim_capability(entry, tvb, offset);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -1065,14 +1065,14 @@ dissect_aim_tlv_value_client_short_capabilities(proto_item *ti _U_, guint16 valu
offset = dissect_aim_short_capability(entry, tvb, offset);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
int
dissect_aim_tlv_value_time(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_)
{
/* FIXME */
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
int
@ -1117,7 +1117,7 @@ static int
dissect_aim_tlv_value_userstatus(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_)
{
/* FIXME */
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -1148,7 +1148,7 @@ dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb
guint8 *buf;
gint string_len;
string_len = tvb_length(tvb);
string_len = tvb_captured_length(tvb);
buf = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, string_len, ENC_UTF_8|ENC_NA);
proto_item_set_text(ti, "Value: %s", format_text(buf, string_len));
@ -1178,7 +1178,7 @@ dissect_aim_tlv_value_string08_array (proto_item *ti, guint16 valueid _U_, tvbuf
int
dissect_aim_tlv_value_bytes (proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb _U_, packet_info *pinfo _U_)
{
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
int
@ -1461,7 +1461,7 @@ dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
break;
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Code to actually dissect the packets */
@ -1471,7 +1471,7 @@ dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* check, if this is really an AIM packet, they start with 0x2a */
/* XXX - I've seen some stuff starting with 0x5a followed by 0x2a */
if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0) != 0x2a)
if(tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb, 0) != 0x2a)
{
/* Not an instant messenger packet, just happened to use the
* same port
@ -1484,7 +1484,7 @@ dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, aim_desegment, 6, get_aim_pdu_len,
dissect_aim_pdu, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -828,7 +828,7 @@ dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
@ -862,7 +862,7 @@ dissect_ajp13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
get_ajp13_pdu_len, /* use first 4, calc data len */
dissect_ajp13_tcp_pdu, data); /* the naive dissector */
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -1349,7 +1349,7 @@ extern void alcap_tree_from_bearer_key(proto_tree* tree, tvbuff_t* tvb, packet_i
static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree *alcap_tree = NULL;
alcap_message_info_t* msg_info = wmem_new0(wmem_packet_scope(), alcap_message_info_t);
int len = tvb_length(tvb);
int len = tvb_captured_length(tvb);
int offset;
proto_item* pi;
proto_tree* compat_tree;

View File

@ -7178,7 +7178,7 @@ dissect_amqp_1_0_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
col_append_str(pinfo->cinfo, COL_INFO, method_name);
col_append_str(pinfo->cinfo, COL_INFO, " ");
col_set_fence(pinfo->cinfo, COL_INFO);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -7325,7 +7325,7 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %d", frame_type);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Dissection routine for AMQP 0-9 frames */
@ -7969,7 +7969,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %u", frame_type);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Dissection routine for method Connection.Start */

View File

@ -615,7 +615,7 @@ dissect_amr_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, void*
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
void

View File

@ -634,7 +634,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
tap_queue_packet(ancp_tap, pinfo, ancp_info);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static guint
@ -649,7 +649,7 @@ dissect_ancp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, ANCP_MIN_HDR,
get_ancp_msg_len, dissect_ancp_message, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
void

View File

@ -2274,7 +2274,7 @@ dissect_ansi_637_tele_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ans
guint32 curr_offset;
curr_offset = 0;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
while ((len - curr_offset) > 0)
{
@ -2530,7 +2530,7 @@ dissect_ansi_637_trans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
curr_offset = 1;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
while ((len - curr_offset) > 0)
{

View File

@ -4691,7 +4691,7 @@ dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
if (ansi_683_for_msg_fcn[idx] != NULL)
{
(*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
(*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_captured_length(tvb) - 1, 1);
}
}
@ -4719,7 +4719,7 @@ dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
proto_tree_add_uint(ansi_683_tree, hf_ansi_683_rev_msg_type,
tvb, 0, 1, msg_type);
(*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
(*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_captured_length(tvb) - 1, 1);
}
static void

View File

@ -1405,14 +1405,14 @@ dissect_ansi_801_for_message(tvbuff_t *tvb, proto_tree *tree)
}
offset++;
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
while ((num_req > 0) &&
(rem_len >= 2))
{
for_request(tvb, tree, &offset, pd_msg_type);
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
num_req--;
}
@ -1428,7 +1428,7 @@ dissect_ansi_801_for_message(tvbuff_t *tvb, proto_tree *tree)
{
for_response(tvb, tree, &offset);
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
num_rsp--;
}
@ -1529,14 +1529,14 @@ dissect_ansi_801_rev_message(tvbuff_t *tvb, proto_tree *tree)
offset++;
}
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
while ((num_req > 0) &&
(rem_len >= 2))
{
rev_request(tvb, tree, &offset, pd_msg_type);
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
num_req--;
}
@ -1552,7 +1552,7 @@ dissect_ansi_801_rev_message(tvbuff_t *tvb, proto_tree *tree)
{
rev_response(tvb, tree, &offset);
rem_len = tvb_length_remaining(tvb, offset);
rem_len = tvb_captured_length_remaining(tvb, offset);
num_rsp--;
}

View File

@ -7486,7 +7486,7 @@ elem_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gu
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@ -7552,7 +7552,7 @@ elem_tv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gui
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@ -7614,7 +7614,7 @@ elem_t(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, elem_idx_t idx,
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@ -7651,7 +7651,7 @@ elem_lv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gui
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
dec_idx = ansi_a_elem_1_strings[idx].dec_index;
@ -7705,7 +7705,7 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
return tvb_length_remaining(tvb, offset) ;
return tvb_captured_length_remaining(tvb, offset) ;
}
dec_idx = ansi_a_elem_1_strings[idx].dec_index;
@ -10499,7 +10499,7 @@ dissect_bsmap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
}
tap_p = &tap_rec[tap_current];
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
offset = 0;
/*
@ -10586,7 +10586,7 @@ dissect_dtap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
const gchar *str;
ansi_a_shared_data_t shared_data;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
if ((len < 3) && !from_sip)
{

View File

@ -1431,7 +1431,7 @@ dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
subtree = proto_item_add_subtree(actx->created_item, ett_mintype);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), NULL, FALSE);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), NULL, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
}
@ -1476,7 +1476,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
if(octet_len == 0)
return;
offset++;
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
@ -1488,7 +1488,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
return;
offset++;
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_captured_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
break;
case 3:
/* Octet string */
@ -1514,14 +1514,14 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
switch ((octet&0xf)){
case 1:
/* BCD Coding */
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
/* IA5 Coding */
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_captured_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
break;
case 3:
/* Octet string */
@ -1951,7 +1951,7 @@ dissect_ansi_map_callingfeaturesindicator(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *subtree;
length = tvb_length_remaining(tvb,offset);
length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_mscid);
@ -2108,7 +2108,7 @@ dissect_ansi_map_cdmacallmode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
proto_tree *subtree;
length = tvb_length_remaining(tvb,offset);
length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_mscid);
@ -2162,7 +2162,7 @@ dissect_ansi_map_cdmachanneldata(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
proto_tree *subtree;
length = tvb_length_remaining(tvb,offset);
length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_cdmachanneldata);
@ -6019,7 +6019,7 @@ dissect_ansi_map_CDMA2000HandoffInvokeIOSData(gboolean implicit_tag _U_, tvbuff_
if (parameter_tvb){
subtree = proto_item_add_subtree(actx->created_item, ett_CDMA2000HandoffInvokeIOSData);
dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree,
0, tvb_length_remaining(parameter_tvb,0));
0, tvb_captured_length_remaining(parameter_tvb,0));
}
@ -6628,7 +6628,7 @@ dissect_ansi_map_CDMA2000HandoffResponseIOSData(gboolean implicit_tag _U_, tvbuf
if (parameter_tvb){
subtree = proto_item_add_subtree(actx->created_item, ett_CDMA2000HandoffResponseIOSData);
dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree,
0, tvb_length_remaining(parameter_tvb,0));
0, tvb_captured_length_remaining(parameter_tvb,0));
}
@ -10633,7 +10633,7 @@ dissect_ansi_map_SMS_BearerData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
if (SMS_BearerData_tvb){
/* A zero length OCTET STRING will return a zero length tvb */
length = tvb_length_remaining(SMS_BearerData_tvb,0);
length = tvb_captured_length_remaining(SMS_BearerData_tvb,0);
if (length <=0){
proto_item_append_text(actx->created_item," length %u",length);
SMS_BearerData_tvb = NULL;
@ -10679,7 +10679,7 @@ dissect_ansi_map_SMS_TeleserviceIdentifier(gboolean implicit_tag _U_, tvbuff_t *
if (parameter_tvb){
/* A zero length OCTET STRING will return a zero length tvb */
length = tvb_length_remaining(parameter_tvb,0);
length = tvb_captured_length_remaining(parameter_tvb,0);
if (length <=0){
proto_item_append_text(actx->created_item, " length %u",length);
return offset;
@ -15480,7 +15480,7 @@ dissect_ansi_map_win_trigger_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree *subtree;
guint8 octet;
end_offset = tvb_length_remaining(tvb,offset);
end_offset = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_win_trigger_list);
while(offset< end_offset) {
@ -16267,7 +16267,7 @@ dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
break;
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static void range_delete_callback(guint32 ssn)

View File

@ -614,7 +614,7 @@ guint8 len;
if(next_tvb) {
len = tvb_length_remaining(next_tvb, 0);
len = tvb_captured_length_remaining(next_tvb, 0);
if(len !=0){
/* 0 octets for the Unidirectional,
* 4 octets for Query, Response & Abort
@ -875,7 +875,7 @@ dissect_ansi_tcap_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
#line 87 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
@ -920,7 +920,7 @@ static int
dissect_ansi_tcap_T_parameter_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 100 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
@ -964,7 +964,7 @@ static int
dissect_ansi_tcap_T_parameter_02(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 110 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);

View File

@ -816,7 +816,7 @@ dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Unknown AODV Packet Type (%u)", type);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -144,7 +144,7 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse
guint16 win_ver = 0;
/* Add the Data subtree */
data_item = proto_tree_add_item(tree,hf_aol_init,tvb,offset,tvb_length_remaining(tvb,offset)-1,ENC_NA);
data_item = proto_tree_add_item(tree,hf_aol_init,tvb,offset,tvb_captured_length_remaining(tvb,offset)-1,ENC_NA);
data_tree = proto_item_add_subtree(data_item,ett_aol_data);
/* Now, parse the structure */
@ -180,8 +180,8 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse
proto_tree_add_item(data_tree,hf_aol_num_colors, tvb,offset,2,ENC_LITTLE_ENDIAN); offset += 2; /* 37b */
/* WAOL 1.5 (48b), >= 2.5 (49b) */
if (tvb_length_remaining(tvb,offset) <= 13) { /* WAOL 1.5 - 3.0 */
if (tvb_length_remaining(tvb,offset) == 13) { /* WAOL > 1.5 */
if (tvb_captured_length_remaining(tvb,offset) <= 13) { /* WAOL 1.5 - 3.0 */
if (tvb_captured_length_remaining(tvb,offset) == 13) { /* WAOL > 1.5 */
proto_tree_add_item(data_tree,hf_aol_filler,tvb,offset,1,ENC_BIG_ENDIAN); offset += 1;
}
@ -252,7 +252,7 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (pdu_len > 0) {
old_offset = offset;
if (tvb_length_remaining(tvb,offset) > pdu_len) {
if (tvb_captured_length_remaining(tvb,offset) > pdu_len) {
/* Init packets are a special case */
if (pdu_type == AOL_P3_TYPE_INIT) {
offset = dissect_aol_init(tvb,pinfo,offset,aol_tree);
@ -287,14 +287,14 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* End-of-Frame Marker */
if (tvb_length_remaining(tvb,offset) >= 1) {
if (tvb_captured_length_remaining(tvb,offset) >= 1) {
proto_tree_add_item(aol_tree,hf_aol_end,tvb,offset,1,ENC_NA);/* offset += 1;*/
} else {
/* Malformed Packet */
expert_add_info(pinfo,ti,&ei_aol_end_missing);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/**
@ -302,11 +302,11 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
static int dissect_aol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
/* Ensure this really is an AOL packet */
if (tvb_length(tvb) >= 1 && tvb_get_guint8(tvb,0) != AOL_P3_FRAME_START) return 0;
if (tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb,0) != AOL_P3_FRAME_START) return 0;
/* Dissect PDUs */
tcp_dissect_pdus(tvb,pinfo,tree,aol_desegment,9,get_aol_pdu_len,dissect_aol_pdu,data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/**

View File

@ -225,7 +225,7 @@ dissect_applemidi_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
}
/* If there is any remaining data (possibly because an unknown command was encountered),
* we just dump it here */
len = tvb_length_remaining( tvb, offset );
len = tvb_captured_length_remaining( tvb, offset );
if ( len > 0 ) {
proto_tree_add_item( applemidi_tree, hf_applemidi_unknown_data, tvb, offset, len, ENC_NA );
}
@ -287,7 +287,7 @@ dissect_applemidi_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/*struct _rtp_conversation_info *p_conv_data = NULL;*/
rtp_dyn_payload_t *rtp_dyn_payload = NULL;
if ( tvb_length( tvb ) < 4)
if ( tvb_captured_length( tvb ) < 4)
return FALSE; /* not enough bytes to check */
if ( !test_applemidi( tvb, &command, FALSE ) ) {

View File

@ -706,7 +706,7 @@ dissect_mic_e( tvbuff_t *tvb,
const guint8 *addr;
const mic_e_dst_code_table_s *dst_code_entry;
data_len = tvb_length_remaining( tvb, offset );
data_len = tvb_captured_length_remaining( tvb, offset );
new_offset = offset + data_len;
info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN );
@ -898,7 +898,7 @@ dissect_aprs_weather( tvbuff_t *tvb,
guint8 ch;
data_len = tvb_length_remaining( tvb, offset );
data_len = tvb_captured_length_remaining( tvb, offset );
new_offset = offset + data_len;
tc = proto_tree_add_item( parent_tree, hf_aprs_weather_idx, tvb, offset, data_len, ENC_ASCII|ENC_NA );
@ -1100,7 +1100,7 @@ aprs_status( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
{
int data_len;
data_len = tvb_length_remaining( tvb, offset );
data_len = tvb_captured_length_remaining( tvb, offset );
if ( ( data_len > 7 ) && ( tvb_get_guint8( tvb, offset+6 ) == 'z' ) )
{

View File

@ -124,7 +124,7 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
char *command;
guint32 dword;
if (tvb_length(tvb) < 4)
if (tvb_captured_length(tvb) < 4)
return 0;
/* Make sure the packet we're dissecting is a ar_drone packet

View File

@ -115,7 +115,7 @@ is_armagetronad_packet(tvbuff_t * tvb)
gint offset = 0;
/* For each message in the frame */
while (tvb_length_remaining(tvb, offset) > 2) {
while (tvb_captured_length_remaining(tvb, offset) > 2) {
gint data_len = tvb_get_ntohs(tvb, offset + 4) * 2;
#if 0
@ -138,7 +138,7 @@ is_armagetronad_packet(tvbuff_t * tvb)
}
/* The packed should end with a 2 bytes ID */
return tvb_length_remaining(tvb, offset) == 2;
return tvb_captured_length_remaining(tvb, offset) == 2;
}
static void
@ -250,7 +250,7 @@ dissect_armagetronad(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi
armagetronad_tree = proto_item_add_subtree(ti, ett_armagetronad);
/* For each message in the frame */
while (tvb_length_remaining(tvb, offset) > 2)
while (tvb_captured_length_remaining(tvb, offset) > 2)
offset += add_message(tvb, offset, armagetronad_tree, info);
/* After the messages, comes the SenderID */

View File

@ -3134,7 +3134,7 @@ dissect_artnet_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
guint64 qword;
/* check if we atleast have the 8 byte header */
if (tvb_length(tvb) < 8)
if (tvb_captured_length(tvb) < 8)
return FALSE;
/* Check the 8 byte header "Art-Net\0" = 0x4172742d4e7400*/

View File

@ -170,9 +170,9 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
code = tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET);
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
padding_length = tvb_length(cause_tvb) - length;
padding_length = tvb_captured_length(cause_tvb) - length;
cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb),
cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_captured_length(cause_tvb),
"%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
cause_tree = proto_item_add_subtree(cause_item, ett_asap_cause);
@ -470,7 +470,7 @@ dissect_pool_member_selection_policy_parameter(tvbuff_t *parameter_tvb, proto_tr
proto_tree_add_item(parameter_tree, hf_policy_distance, parameter_tvb, POLICY_WRANDDPF_DISTANCE_OFFSET, POLICY_WRANDDPF_DISTANCE_LENGTH, ENC_BIG_ENDIAN);
break;
default:
length = tvb_length(parameter_tvb) - POLICY_VALUE_OFFSET;
length = tvb_captured_length(parameter_tvb) - POLICY_VALUE_OFFSET;
if (length > 0) {
proto_tree_add_item(parameter_tree, hf_policy_value, parameter_tvb, POLICY_VALUE_OFFSET, length, ENC_NA);
}
@ -647,10 +647,10 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *asap_tree)
/* extract tag and length from the parameter */
type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET);
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
padding_length = tvb_length(parameter_tvb) - length;
padding_length = tvb_captured_length(parameter_tvb) - length;
/* create proto_tree stuff */
parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_asap_parameter);
/* add tag and length to the asap tree */
@ -722,7 +722,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
tvbuff_t *parameter_tvb;
offset = 0;
while((remaining_length = tvb_length_remaining(parameters_tvb, offset)) > 0) {
while((remaining_length = tvb_captured_length_remaining(parameters_tvb, offset)) > 0) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
if (remaining_length >= length)

View File

@ -4172,7 +4172,7 @@ dissect_r3_upstreammfgfield_iopins (tvbuff_t *tvb, guint32 start_offset, guint32
DISSECTOR_ASSERT(start_offset == 0);
len = MAX(0, tvb_length_remaining(tvb, start_offset));
len = MAX(0, tvb_captured_length_remaining(tvb, start_offset));
if (len % 3 != 0)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "IOPINS data length not modulo 3 == 0");
@ -4251,7 +4251,7 @@ dissect_r3_upstreammfgfield_checkpointlog (tvbuff_t *tvb, guint32 start_offset,
DISSECTOR_ASSERT(start_offset == 0);
len = tvb_length_remaining (tvb, 1);
len = tvb_captured_length_remaining (tvb, 1);
proto_tree_add_item (tree, hf_r3_checkpointlog_entryptr, tvb, 0, 1, ENC_LITTLE_ENDIAN);
cpl_item = proto_tree_add_text (tree, tvb, 1, -1, "Checkpoint Log");
@ -4501,7 +4501,7 @@ dissect_r3_upstreammfgfield_taskflags (tvbuff_t *tvb, guint32 start_offset, guin
DISSECTOR_ASSERT(start_offset == 0);
len = MAX(0, tvb_length_remaining (tvb, 0));
len = MAX(0, tvb_captured_length_remaining (tvb, 0));
tfg_item = proto_tree_add_text (tree, tvb, 0, -1, "Task Flags (%u tasks)", len / 5);
tfg_tree = proto_item_add_subtree (tfg_item, ett_r3taskflags);
@ -4529,7 +4529,7 @@ dissect_r3_upstreammfgfield_timerchain (tvbuff_t *tvb, guint32 start_offset, gui
DISSECTOR_ASSERT(start_offset == 0);
len = tvb_length_remaining (tvb, 3);
len = tvb_captured_length_remaining (tvb, 3);
proto_tree_add_item (tree, hf_r3_timerchain_newtick, tvb, 0, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_timerchain_currentboundary, tvb, 2, 1, ENC_LITTLE_ENDIAN);
@ -4556,7 +4556,7 @@ dissect_r3_upstreammfgfield_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint
DISSECTOR_ASSERT(start_offset == 0);
len = tvb_length_remaining (tvb, 0);
len = tvb_captured_length_remaining (tvb, 0);
for (i = 0; i < len; i += 3)
{
@ -4696,7 +4696,7 @@ dissect_r3_upstreammfgfield_capabilities (tvbuff_t *tvb, guint32 start_offset, g
DISSECTOR_ASSERT(start_offset == 0);
len = MAX(0, tvb_length_remaining (tvb, 0));
len = MAX(0, tvb_captured_length_remaining (tvb, 0));
items = 0;
i = 0;
@ -4742,7 +4742,7 @@ dissect_r3_upstreammfgfield_dumpm41t81 (tvbuff_t *tvb, guint32 start_offset, gui
{
DISSECTOR_ASSERT(start_offset == 0);
if (tvb_length_remaining (tvb, 0) != 20)
if (tvb_captured_length_remaining (tvb, 0) != 20)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Length of M41T81 RTC register dump not 20 octets");
}
@ -4860,7 +4860,7 @@ dissect_r3_upstreammfgfield_checksumresults (tvbuff_t *tvb, guint32 start_offset
DISSECTOR_ASSERT(start_offset == 0);
len = MAX(0, tvb_length_remaining(tvb, 0));
len = MAX(0, tvb_captured_length_remaining(tvb, 0));
if (len % 3 != 0)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Checksum results data length not modulo 3 == 0");
@ -4921,7 +4921,7 @@ dissect_r3_upstreammfgfield_mortisestatelog (tvbuff_t *tvb, guint32 start_offset
DISSECTOR_ASSERT(start_offset == 0);
len = tvb_length_remaining (tvb, 3);
len = tvb_captured_length_remaining (tvb, 3);
proto_tree_add_item (tree, hf_r3_mortisestatelog_pointer, tvb, 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_mortisestatelog_mortisetype, tvb, 1, 1, ENC_LITTLE_ENDIAN);
@ -6266,7 +6266,7 @@ dissect_r3_cmdmfg_forceoptions (tvbuff_t *tvb, guint32 start_offset, guint32 len
proto_tree_add_item (tree, hf_r3_commandmfg, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
start_offset += 2;
len = tvb_length_remaining (tvb, start_offset);
len = tvb_captured_length_remaining (tvb, start_offset);
i = 0;
while (i<len && (step=tvb_get_guint8(tvb, start_offset + i))>0)
@ -6373,7 +6373,7 @@ dissect_r3_cmdmfg_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint32 length
proto_tree_add_item (tree, hf_r3_commandmfg, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
start_offset += 2;
len = tvb_length_remaining (tvb, start_offset);
len = tvb_captured_length_remaining (tvb, start_offset);
for (i = 0; i < len; i += 3)
{
@ -6759,7 +6759,7 @@ dissect_r3_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
dissect_r3_packet (tvb, pinfo, r3_tree);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static guint
@ -6772,7 +6772,7 @@ static int
dissect_r3 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus (tvb, pinfo, tree, TRUE, 4, get_r3_message_len, dissect_r3_message, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/*

View File

@ -46,7 +46,7 @@ static gboolean allowed_chars(tvbuff_t *tvb)
gint offset, len;
guint8 val;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
for (offset = 0; offset < len; offset++) {
val = tvb_get_guint8(tvb, offset);
if (!(g_ascii_isprint(val) || (val == 0x0a) || (val == 0x0d)))

View File

@ -1213,7 +1213,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
aspinfo = get_transaction(tvb, pinfo, (struct aspinfo *)data);
if (!aspinfo)
return tvb_length(tvb);
return tvb_captured_length(tvb);
fn = (guint8) aspinfo->command;
@ -1224,7 +1224,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
val_to_str(fn, zip_atp_function_vals, "Unknown (0x%01x)"), aspinfo->seq);
if (!tree)
return tvb_length(tvb);
return tvb_captured_length(tvb);
ti = proto_tree_add_item(tree, proto_zip, tvb, offset, -1, ENC_NA);
zip_tree = proto_item_add_subtree(ti, ett_zip);
@ -1268,7 +1268,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static void

View File

@ -1033,7 +1033,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* succeeded.
* Decode the trailer, if present, and then chop it off.
*/
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
if ((reported_length % 48) == 0) {
/*
@ -1151,7 +1151,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
default:
if (tvb_length(next_tvb) > 7) /* sizeof(octet) */
if (tvb_captured_length(next_tvb) > 7) /* sizeof(octet) */
{
guint8 octet[8];
tvb_memcpy(next_tvb, octet, 0, sizeof(octet));
@ -1744,7 +1744,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(aal_tree, hf_atm_aal3_4_seq_num, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(aal_tree, hf_atm_aal3_4_multiplex_id, tvb, offset, 2, ENC_BIG_ENDIAN);
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
crc10 = update_crc10_by_bytes(0, tvb_get_ptr(tvb, offset, length),
length);
offset += 2;
@ -1791,7 +1791,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(aal_tree, hf_atm_aal_oamcell_type_ft, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
crc10 = update_crc10_by_bytes(0, tvb_get_ptr(tvb, offset, length),
length);
offset += 1;
@ -1891,7 +1891,7 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated, pwpd != NULL);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -1926,7 +1926,7 @@ dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, FALSE, FALSE, pwpd);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -101,7 +101,7 @@ dissect_atmtcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* Data (for the moment...) */
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -91,7 +91,7 @@ dissect_dx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
int offset;
offset = 0;
data_len = tvb_length_remaining( tvb, offset );
data_len = tvb_captured_length_remaining( tvb, offset );
col_set_str( pinfo->cinfo, COL_PROTOCOL, "DX" );

View File

@ -194,7 +194,7 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
guint8 version;
guint16 bodylen;
if (tvb_length(tvb) < 4)
if (tvb_captured_length(tvb) < 4)
return 0;
if (tvb_get_guint8(tvb, 0) != 42)

View File

@ -42,8 +42,8 @@ static int bacapp_tap = -1;
/* formerly bacapp.h contains definitions and forward declarations */
#ifndef FAULT
#define FAULT proto_tree_add_text(subtree, tvb, offset, tvb_length(tvb) - offset, "something is going wrong here !!"); \
offset = tvb_length(tvb);
#define FAULT proto_tree_add_text(subtree, tvb, offset, tvb_captured_length(tvb) - offset, "something is going wrong here !!"); \
offset = tvb_captured_length(tvb);
#endif
/* BACnet PDU Types */
@ -5292,10 +5292,10 @@ fTagHeaderTree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvb, lvt_offset, lvt_len, *lvt);
} /* if (tree) */
if (*lvt > tvb_length(tvb)) {
if (*lvt > tvb_captured_length(tvb)) {
expert_add_info_format(pinfo, ti, &ei_bacapp_bad_length,
"LVT length too long: %d > %d", *lvt,
tvb_length(tvb));
tvb_captured_length(tvb));
*lvt = 1;
}
@ -6975,14 +6975,14 @@ fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset
offset += fTagHeaderTree(tvb, pinfo, tree, offset,
&tag_no, &tag_info, &lvt);
offset = fAbstractSyntaxNType(tvb, pinfo, tree, offset);
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
offset += fTagHeaderTree(tvb, pinfo, tree, offset,
&tag_no, &tag_info, &lvt);
}
} else {
proto_tree_add_text(tree, tvb, offset, tvb_length(tvb) - offset,
proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb) - offset,
"expected Opening Tag!");
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
return offset;
@ -7344,7 +7344,7 @@ fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (dissector_try_uint(bacapp_dissector_table,
vendor_identifier, next_tvb, pinfo, tree)) {
/* we parsed it so skip over length and we are done */
offset += tvb_length(next_tvb);
offset += tvb_captured_length(next_tvb);
return offset;
}

View File

@ -357,7 +357,7 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
vendor_id, next_tvb, pinfo, bacnet_tree)) {
/* we parsed it so skip over length and we are done */
/* Note: offset has now been bumped for message type and vendor id so we take that out of our next_tvb size */
offset += tvb_length(next_tvb) -3;
offset += tvb_captured_length(next_tvb) -3;
}
}
/* Performance Index (in I-Could-Be-Router-To-Network) */

View File

@ -139,7 +139,7 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
int i;
/* Accumulate our value/length 'til we hit a valid type */
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
byte = tvb_get_guint8(tvb, offset);
offset++;
@ -228,13 +228,13 @@ dissect_banana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree *banana_tree;
/* Check that there's enough data */
if (tvb_length(tvb) < 2)
if (tvb_captured_length(tvb) < 2)
return 0;
/* Fill in our protocol and info columns */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Banana");
while (tvb_length_remaining(tvb, offset) > 0 && offset < MAX_ELEMENT_VAL_LEN) {
while (tvb_captured_length_remaining(tvb, offset) > 0 && offset < MAX_ELEMENT_VAL_LEN) {
byte = tvb_get_guint8(tvb, offset);
if (is_element(byte))
break;
@ -255,7 +255,7 @@ dissect_banana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* Return the amount of data this dissector was able to dissect */
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static void

View File

@ -628,7 +628,7 @@ static void dissect_batman_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BATADV_???");
length_remaining = tvb_length_remaining(tvb, 0);
length_remaining = tvb_captured_length_remaining(tvb, 0);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, 0);
call_dissector(data_handle, next_tvb, pinfo, tree);
@ -650,35 +650,35 @@ static void dissect_batadv_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree
switch (version) {
case 5:
case 6:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V5_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V5_SIZE) {
offset = dissect_batadv_batman_v5(tvb, offset, pinfo, tree);
}
break;
case 7:
case 8:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V7_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V7_SIZE) {
offset = dissect_batadv_batman_v7(tvb, offset, pinfo, tree);
}
break;
case 9:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V9_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V9_SIZE) {
offset = dissect_batadv_batman_v9(tvb, offset, pinfo, tree);
}
break;
case 11:
case 13:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V11_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V11_SIZE) {
offset = dissect_batadv_batman_v11(tvb, offset, pinfo, tree);
}
break;
case 10:
case 12:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V10_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V10_SIZE) {
offset = dissect_batadv_batman_v10(tvb, offset, pinfo, tree);
}
break;
case 14:
while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V14_SIZE) {
while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V14_SIZE) {
offset = dissect_batadv_batman_v14(tvb, offset, pinfo, tree);
}
break;
@ -1358,7 +1358,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin
offset += TT_ENTRY_V14_SIZE;
}
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
@ -1475,7 +1475,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
@ -1543,7 +1543,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -1616,7 +1616,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -1733,7 +1733,7 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -1834,7 +1834,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += 1;
/* rr data available? */
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining >= 1 + BAT_RR_LEN * 6) {
dissect_batadv_icmp_rr(batadv_icmp_tree, tvb, offset);
offset += 1 + BAT_RR_LEN * 6;
@ -1848,7 +1848,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
@ -1926,7 +1926,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre
offset += 1;
/* rr data available? */
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining >= 1 + BAT_RR_LEN * 6) {
dissect_batadv_icmp_rr(batadv_icmp_tree, tvb, offset);
offset += 1 + BAT_RR_LEN * 6;
@ -1940,7 +1940,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
call_dissector(data_handle, next_tvb, pinfo, tree);
@ -2029,7 +2029,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t
tap_queue_packet(batadv_tap, pinfo, unicast_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -2098,7 +2098,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_
tap_queue_packet(batadv_tap, pinfo, unicast_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -2198,7 +2198,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo,
tap_queue_packet(batadv_tap, pinfo, unicast_4addr_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -2315,7 +2315,7 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p
tap_queue_packet(batadv_tap, pinfo, unicast_frag_packeth);
head = (unicast_frag_packeth->flags & 0x1);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining < 0)
length_remaining = 0;
frag_msg = fragment_add_seq_check(&msg_reassembly_table,
@ -2429,7 +2429,7 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p
tap_queue_packet(batadv_tap, pinfo, unicast_frag_packeth);
head = (unicast_frag_packeth->flags & 0x1);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining < 0)
length_remaining = 0;
frag_msg = fragment_add_seq_check(&msg_reassembly_table,
@ -2601,7 +2601,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += entry_size;
}
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -2705,7 +2705,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += VIS_ENTRY_V8_SIZE;
}
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -2813,7 +2813,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += VIS_ENTRY_V8_SIZE;
}
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -3009,7 +3009,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p
}
}
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@ -3141,7 +3141,7 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto
tap_queue_packet(batadv_tap, pinfo, roam_adv_packeth);
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);

View File

@ -529,9 +529,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
set_mime_hdr_flags(more, request_val, beep_frame_data, pinfo);
}
else { /* Protocol violation, so dissect rest as undisectable */
if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
}
@ -561,9 +561,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@ -579,9 +579,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Now for the payload, if any */
if (tvb_length_remaining(tvb, offset) > 0) { /* Dissect what is left as payload */
if (tvb_captured_length_remaining(tvb, offset) > 0) { /* Dissect what is left as payload */
int pl_size = MIN(size, tvb_length_remaining(tvb, offset));
int pl_size = MIN(size, tvb_captured_length_remaining(tvb, offset));
/* Except, check the payload length, and only dissect that much */
@ -608,7 +608,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* If anything else left, dissect it ... */
if (tvb_length_remaining(tvb, offset) > 0)
if (tvb_captured_length_remaining(tvb, offset) > 0)
offset += dissect_beep_tree(tvb, offset, pinfo, tree, request_val, beep_frame_data);
} else if (tvb_strneql(tvb, offset, "SEQ ", 4) == 0) {
@ -643,9 +643,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@ -659,7 +659,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tr = NULL;
if (tree) {
ti = proto_tree_add_text(tree, tvb, offset, MIN(5, MAX(0, tvb_length_remaining(tvb, offset))), "Trailer");
ti = proto_tree_add_text(tree, tvb, offset, MIN(5, MAX(0, tvb_captured_length_remaining(tvb, offset))), "Trailer");
tr = proto_item_add_subtree(ti, ett_trailer);
@ -672,9 +672,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@ -685,24 +685,24 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
if (tvb_length_remaining(tvb, offset) > 0) { /* Dissect anything left over */
if (tvb_captured_length_remaining(tvb, offset) > 0) { /* Dissect anything left over */
int pl_size = 0;
if (request_val) {
pl_size = MIN(request_val->size, tvb_length_remaining(tvb, offset));
pl_size = MIN(request_val->size, tvb_captured_length_remaining(tvb, offset));
if (pl_size == 0) { /* The whole of the rest must be payload */
pl_size = tvb_length_remaining(tvb, offset); /* Right place ? */
pl_size = tvb_captured_length_remaining(tvb, offset); /* Right place ? */
}
} else if (beep_frame_data) {
pl_size = MIN(beep_frame_data->pl_size, tvb_length_remaining(tvb, offset));
pl_size = MIN(beep_frame_data->pl_size, tvb_captured_length_remaining(tvb, offset));
} else { /* Just in case */
pl_size = tvb_length_remaining(tvb, offset);
pl_size = tvb_captured_length_remaining(tvb, offset);
}
/* Take care here to handle the payload correctly, and if there is
@ -715,7 +715,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
if (pl_size == 0 && offset == st_offset)
pl_size = tvb_length_remaining(tvb, offset);
pl_size = tvb_captured_length_remaining(tvb, offset);
if (pl_size > 0) {
@ -735,7 +735,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
offset += dissect_beep_tree(tvb, offset, pinfo, tree, request_val, beep_frame_data);
}
}
@ -811,8 +811,8 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* "tvb_format_text()" is passed a value that won't go past the end
* of the packet, so it won't throw an exception.
*/
if (tvb_length_remaining(tvb, offset) > 0)
col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, offset, tvb_length_remaining(tvb, offset)));
if (tvb_captured_length_remaining(tvb, offset) > 0)
col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
/* Here, we parse the message so we can retrieve the info we need, which
* is that there is some payload left from a previous segment on the
@ -848,7 +848,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int pl_left = beep_frame_data->pl_left;
pl_left = MIN(pl_left, MAX(0, tvb_length_remaining(tvb, offset)));
pl_left = MIN(pl_left, MAX(0, tvb_captured_length_remaining(tvb, offset)));
/* Add the payload bit, only if we have a tree */
if (tree && (pl_left > 0)) {
@ -892,7 +892,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
/*offset += */dissect_beep_tree(tvb, offset, pinfo, beep_tree, request_val, beep_frame_data);

View File

@ -282,7 +282,7 @@ static int dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo _U_,
static void dissect_bencoding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
dissect_bencoding_rec(tvb, pinfo, 0, tvb_length(tvb), tree, 0, NULL, 0);
dissect_bencoding_rec(tvb, pinfo, 0, tvb_captured_length(tvb), tree, 0, NULL, 0);
}
void

View File

@ -633,8 +633,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("dissect_ber_tagged_type(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("dissect_ber_tagged_type(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("dissect_ber_tagged_type(%s) entered\n", name);
}
@ -666,7 +666,7 @@ printf("dissect_ber_tagged_type(%s) entered\n", name);
if (tag_impl) {
gint length_remaining;
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (tmp_len > (guint32)length_remaining)
tmp_len = length_remaining;
next_tvb = tvb_new_subset_length(tvb, offset, tmp_len);
@ -827,7 +827,7 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
offset = get_ber_length(tvb, offset, &len, &ind);
if (len > (guint32)tvb_length_remaining(tvb, offset)) {
if (len > (guint32)tvb_captured_length_remaining(tvb, offset)) {
/* hmm maybe something bad happened or the frame is short;
since these are not vital outputs just return instead of
throwing an exception.
@ -839,11 +839,11 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
}
cause = proto_tree_add_string_format_value(
tree, hf_ber_error, tvb, offset, len, "illegal_length",
"length:%u longer than tvb_length_remaining:%d",
"length:%u longer than tvb_captured_length_remaining:%d",
len,
tvb_length_remaining(tvb, offset));
tvb_captured_length_remaining(tvb, offset));
expert_add_info(pinfo, cause, &ei_ber_error_length);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* we don't care about the class only on the constructor flag */
switch (pc) {
@ -1080,7 +1080,7 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
proto_tree *next_tree = NULL;
gint length_remaining;
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
if (oid == NULL) {
item = proto_tree_add_expert(tree, pinfo, &ei_ber_no_oid, next_tvb, 0, length_remaining);
@ -1124,7 +1124,7 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
* 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;
}
@ -1142,11 +1142,11 @@ call_ber_syntax_callback(const char *syntax, tvbuff_t *tvb, int offset, packet_i
if (syntax == NULL) {
item = proto_tree_add_expert_format(
tree, pinfo, &ei_ber_no_oid, next_tvb, 0, tvb_length_remaining(tvb, offset),
tree, pinfo, &ei_ber_no_oid, next_tvb, 0, tvb_captured_length_remaining(tvb, offset),
"BER: No syntax supplied to call_ber_syntax_callback");
} else {
item = proto_tree_add_expert_format(
tree, pinfo, &ei_ber_syntax_not_implemented, next_tvb, 0, tvb_length_remaining(tvb, offset),
tree, pinfo, &ei_ber_syntax_not_implemented, next_tvb, 0, tvb_captured_length_remaining(tvb, offset),
"BER: Dissector for syntax:%s not implemented."
" Contact Wireshark developers if you want this supported",
syntax);
@ -1161,7 +1161,7 @@ call_ber_syntax_callback(const char *syntax, tvbuff_t *tvb, int offset, packet_i
* 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;
}
@ -1189,7 +1189,7 @@ printf ("BER ID=%02x", id);
/* 8.1.2.4 */
if (tmp_tag == 0x1F) {
tmp_tag = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
t = tvb_get_guint8(tvb, offset);
#ifdef DEBUG_BER
printf (" %02x", t);
@ -1341,7 +1341,7 @@ try_get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind, gi
*ind = tmp_ind;
#ifdef DEBUG_BER
printf("get BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
printf("get BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_captured_length_remaining(tvb, offset));
#endif
return offset;
@ -1387,7 +1387,7 @@ dissect_ber_length(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int
*ind = tmp_ind;
#ifdef DEBUG_BER
printf("dissect BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
printf("dissect BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_captured_length_remaining(tvb, offset));
#endif
last_length = tmp_length;
@ -1462,13 +1462,13 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
}
if (tvb_length(next_tvb) < 1) {
if (tvb_captured_length(next_tvb) < 1) {
/* Don't cause an assertion in the reassembly code. */
THROW(ReportedBoundsError);
}
fd_head = fragment_add_seq_next(&octet_segment_reassembly_table,
next_tvb, 0, actx->pinfo, dst_ref, NULL,
tvb_length(next_tvb),
tvb_captured_length(next_tvb),
fragment);
firstFragment = FALSE;
@ -1524,8 +1524,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("OCTET STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("OCTET STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
}
@ -1571,7 +1571,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
end_offset = offset+len;
/* caller may have created new buffer for indefinite length data Verify via length */
len_remain = (guint32)tvb_length_remaining(tvb, offset);
len_remain = (guint32)tvb_captured_length_remaining(tvb, offset);
if (ind && (len_remain == (len - 2))) {
/* new buffer received so adjust length and indefinite flag */
len -= 2;
@ -1584,7 +1584,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
*/
cause = proto_tree_add_string_format_value(
tree, hf_ber_error, tvb, offset, len, "illegal_length",
"length:%u longer than tvb_length_remaining:%d",
"length:%u longer than tvb_captured_length_remaining:%d",
len,
len_remain);
expert_add_info(actx->pinfo, cause, &ei_ber_error_length);
@ -1602,7 +1602,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
/* primitive */
gint length_remaining;
length_remaining = tvb_length_remaining(tvb, offset);
length_remaining = tvb_captured_length_remaining(tvb, offset);
#if 0
if (length_remaining < 1) {
return end_offset;
@ -1727,7 +1727,7 @@ dissect_ber_octet_string_wcb(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
tvbuff_t *out_tvb = NULL;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_id, (func) ? &out_tvb : NULL);
if (func && out_tvb && (tvb_length(out_tvb) > 0)) {
if (func && out_tvb && (tvb_captured_length(out_tvb) > 0)) {
if (hf_id >= 0)
tree = proto_item_add_subtree(actx->created_item, ett_ber_octet_string);
/* TODO Should hf_id2 be pased as last parameter???*/
@ -1801,8 +1801,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, implicit_tag);
}
@ -1818,7 +1818,7 @@ printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, im
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_captured_length_remaining(tvb, offset);
len = remaining>0 ? remaining : 0;
}
@ -2066,8 +2066,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("SEQUENCE dissect_ber_sequence(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("SEQUENCE dissect_ber_sequence(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
}
@ -2079,7 +2079,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
offset = get_ber_length(tvb, offset, &lenx, NULL);
} else {
/* was implicit tag so just use the length of the tvb */
lenx = tvb_length_remaining(tvb, offset);
lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+lenx;
}
/* create subtree */
@ -2097,7 +2097,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &lenx, &ind);
if (ind) {
/* Fixed the length is correctly returned from dissect ber_length
end_offset = tvb_length(tvb);*/
end_offset = tvb_captured_length(tvb);*/
end_offset = offset + lenx -2;
} else {
end_offset = offset + lenx;
@ -2297,13 +2297,13 @@ ber_sequence_try_again:
} else {
hoffset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
hoffset = dissect_ber_length(actx->pinfo, tree, tvb, hoffset, NULL, NULL);
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset - (2 * ind_field)))
length_remaining = eoffset - hoffset - (2 * ind_field);
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
}
} else {
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset))
length_remaining = eoffset - hoffset;
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
@ -2332,8 +2332,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(next_tvb, 0) > 3) {
printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector\n", name);
}
@ -2398,7 +2398,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) subdissector ate %d bytes\n", name, co
}
if (ind) {
/* need to eat this EOC
end_offset = tvb_length(tvb);*/
end_offset = tvb_captured_length(tvb);*/
end_offset += 2;
if (show_internal_ber_fields) {
proto_tree_add_text(tree, tvb, end_offset-2, 2 , "SEQ EOC");
@ -2441,8 +2441,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("SET dissect_ber_set(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("SET dissect_ber_set(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SET dissect_ber_set(%s) entered\n", name);
}
@ -2456,7 +2456,7 @@ printf("SET dissect_ber_set(%s) entered\n", name);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &lenx, &ind);
if (ind) {
/* Fixed the length is correctly returned from dissect ber_length
end_offset = tvb_length(tvb);*/
end_offset = tvb_captured_length(tvb);*/
end_offset = offset + lenx -2;
} else {
end_offset = offset + lenx;
@ -2485,7 +2485,7 @@ printf("SET dissect_ber_set(%s) entered\n", name);
}
} else {
/* was implicit tag so just use the length of the tvb */
lenx = tvb_length_remaining(tvb, offset);
lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+lenx;
}
@ -2554,12 +2554,12 @@ printf("SET dissect_ber_set(%s) entered\n", name);
/* dissect header and len for field */
hoffset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
hoffset = dissect_ber_length(actx->pinfo, tree, tvb, hoffset, NULL, NULL);
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset - (2 * ind_field)))
length_remaining = eoffset - hoffset - (2 * ind_field);
next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, eoffset - hoffset - (2 * ind_field));
} else {
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset))
length_remaining = eoffset - hoffset;
next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, eoffset - hoffset);
@ -2589,8 +2589,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(next_tvb, 0) > 3) {
printf("SET dissect_ber_set(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
printf("SET dissect_ber_set(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
printf("SET dissect_ber_set(%s) calling subdissector\n", name);
}
@ -2678,7 +2678,7 @@ printf("SET dissect_ber_set(%s) calling subdissector\n", name);
if (ind) {
/* need to eat this EOC
end_offset = tvb_length(tvb);*/
end_offset = tvb_captured_length(tvb);*/
end_offset += 2;
if (show_internal_ber_fields) {
proto_tree_add_text(tree, tvb, end_offset-2, 2 , "SET EOC");
@ -2719,10 +2719,10 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("CHOICE dissect_ber_choice(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("CHOICE dissect_ber_choice(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_length_remaining(tvb, offset));
printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_captured_length_remaining(tvb, offset));
}
}
#endif
@ -2733,7 +2733,7 @@ printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_length_remain
*branch_taken = -1;
}
if (tvb_length_remaining(tvb, offset) == 0) {
if (tvb_captured_length_remaining(tvb, offset) == 0) {
item = proto_tree_add_string_format_value(
parent_tree, hf_ber_error, tvb, offset, 0, "empty_choice",
"Empty choice was found");
@ -2815,7 +2815,7 @@ printf("CHOICE testing potential subdissector class[%p]:%d:(expected)%d tag:%d:
}
}
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining>length)
length_remaining = length;
@ -2845,10 +2845,10 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(next_tvb, 0) > 3) {
printf("CHOICE dissect_ber_choice(%s) calling subdissector start_offset:%d offset:%d len:%d %02x:%02x:%02x\n", name, start_offset, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
printf("CHOICE dissect_ber_choice(%s) calling subdissector start_offset:%d offset:%d len:%d %02x:%02x:%02x\n", name, start_offset, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
printf("CHOICE dissect_ber_choice(%s) calling subdissector len:%d\n", name, tvb_length(next_tvb));
printf("CHOICE dissect_ber_choice(%s) calling subdissector len:%d\n", name, tvb_captured_length(next_tvb));
}
}
#endif
@ -3009,8 +3009,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("RESTRICTED STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("RESTRICTED STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("RESTRICTED STRING dissect_ber_octet_string(%s) entered\n", name);
}
@ -3066,7 +3066,7 @@ dissect_ber_GeneralString(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int
* do we want to throw an exception?
*/
if (out_tvb) {
tvb_len = tvb_length(out_tvb);
tvb_len = tvb_captured_length(out_tvb);
if ((guint)tvb_len >= name_len) {
tvb_memcpy(out_tvb, (guint8*)name_string, 0, name_len-1);
name_string[name_len-1] = '\0';
@ -3105,8 +3105,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb, offset) > 3) {
printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb, offset) > 3) {
printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered\n", name);
}
@ -3138,7 +3138,7 @@ printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered\n", name);
return eoffset;
}
} else {
len = tvb_length_remaining(tvb, offset);
len = tvb_captured_length_remaining(tvb, offset);
eoffset = offset+len;
}
@ -3175,7 +3175,7 @@ dissect_ber_any_oid_str(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tre
offset = dissect_ber_any_oid(implicit_tag, actx, tree, tvb, offset, hf_id, (value_stringx) ? &value_tvb : NULL, is_absolute);
if (value_stringx) {
if (value_tvb && (length = tvb_length(value_tvb))) {
if (value_tvb && (length = tvb_captured_length(value_tvb))) {
*value_stringx = oid_encoded2string(tvb_get_ptr(value_tvb, 0, length), length);
} else {
*value_stringx = "";
@ -3242,8 +3242,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
if (tvb_length_remaining(tvb,offset) > 3) {
printf("SQ OF dissect_ber_sq_of(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
if (tvb_captured_length_remaining(tvb,offset) > 3) {
printf("SQ OF dissect_ber_sq_of(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
}
@ -3297,7 +3297,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
} else {
/* the tvb length should be correct now nope we could be coming from an implicit choice or sequence, thus we
read the items we match and return the length*/
lenx = tvb_length_remaining(tvb, offset);
lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset + lenx;
}
@ -3309,7 +3309,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
* dissecting a single item.
*/
/* XXX Do we really need to count them at all ? ronnie */
if (tvb_length_remaining(tvb, offset) == tvb_reported_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset) == tvb_reported_length_remaining(tvb, offset)) {
while (offset < end_offset) {
guint32 len;
gint s_offset;
@ -3425,7 +3425,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
/* Function has IMPLICIT TAG */
}
length_remaining = tvb_length_remaining(tvb, hoffset);
length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining>eoffset-hoffset)
length_remaining = eoffset-hoffset;
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
@ -3523,7 +3523,7 @@ dissect_ber_GeneralizedTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
return end_offset;
}
} else {
len = tvb_length_remaining(tvb, offset);
len = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+len;
}
@ -3645,7 +3645,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
return offset+len;
}
} else {
len = tvb_length_remaining(tvb, offset);
len = tvb_captured_length_remaining(tvb, offset);
}
if ((len < 10) || (len > 19)) {
@ -3806,7 +3806,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
}
} else {
pc=0;
len = tvb_length_remaining(tvb, offset);
len = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+len;
}
@ -3840,7 +3840,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
}
}
if (out_tvb) {
if (len <= (guint32)tvb_length_remaining(tvb, offset)) {
if (len <= (guint32)tvb_captured_length_remaining(tvb, offset)) {
*out_tvb = tvb_new_subset_length(tvb, offset, len);
} else {
*out_tvb = tvb_new_subset_remaining(tvb, offset);
@ -3937,7 +3937,7 @@ dissect_ber_bitstring32(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *par
* so we have to read it byte by byte.
*/
val = 0;
tvb_len = tvb_length(tmp_tvb);
tvb_len = tvb_captured_length(tmp_tvb);
for (i=0; i<4; i++) {
val <<= 8;
if (i < tvb_len) {

View File

@ -458,7 +458,7 @@ dissect_bfcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* Size of smallest BFCP packet: 12 octets */
if (tvb_length(tvb) < 12)
if (tvb_captured_length(tvb) < 12)
return FALSE;
/* Check version and reserved bits in first byte */

View File

@ -1073,7 +1073,7 @@ static int dissect_bitcoin_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tvb_sub = tvb_new_subset_remaining(tvb, offset);
msg_dissectors[i].function(tvb_sub, pinfo, tree);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
}
@ -1081,7 +1081,7 @@ static int dissect_bitcoin_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "[unknown command]");
expert_add_info(pinfo, ti, &ei_bitcoin_command_unknown);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -1100,7 +1100,7 @@ dissect_bitcoin_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
guint32 magic_number;
conversation_t *conversation;
if (tvb_length(tvb) < 4)
if (tvb_captured_length(tvb) < 4)
return FALSE;
magic_number = tvb_get_letohl(tvb, 0);

View File

@ -290,7 +290,7 @@ get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
data from the middle of a message, and just return the
remaining length in the tvbuff so the rest of the tvbuff
is displayed as continuation data. */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
} else {
/* We don't have the type field, so we can't determine
@ -299,7 +299,7 @@ get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
and just return the remaining length in the tvbuff so
the rest of the tvbuff is displayed as continuation
data. */
return tvb_length_remaining(tvb, offset);
return tvb_captured_length_remaining(tvb, offset);
}
}
}
@ -547,7 +547,7 @@ int dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
col_append_str(pinfo->cinfo, COL_INFO, " ");
col_set_fence(pinfo->cinfo, COL_INFO);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static
@ -555,7 +555,7 @@ int dissect_bittorrent (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
tcp_dissect_pdus(tvb, pinfo, tree, bittorrent_desegment, BITTORRENT_HEADER_LENGTH,
get_bittorrent_pdu_length, dissect_bittorrent_tcp_pdu, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static
@ -564,7 +564,7 @@ gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo,
{
conversation_t *conversation;
if (tvb_length(tvb) >= 20 &&
if (tvb_captured_length(tvb) >= 20 &&
tvb_get_guint8(tvb, 0) == 19 &&
tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) {
conversation = find_or_create_conversation(pinfo);

View File

@ -100,7 +100,7 @@ dissect_bmc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
bmc_tree = proto_item_add_subtree(ti, ett_bmc);
/* Needs bit-reversing. Create a new buffer, copy the message to it and bit-reverse */
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
reversing_buffer = (guint8 *)tvb_memdup(NULL, tvb, offset, len);
bitswap_buf_inplace(reversing_buffer, len);
@ -151,7 +151,7 @@ dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
cell_broadcast_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_umts_cell_broadcast_message(cell_broadcast_tvb, pinfo, tree);
offset = tvb_length(cell_broadcast_tvb);
offset = tvb_captured_length(cell_broadcast_tvb);
return offset;
}
@ -213,7 +213,7 @@ dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
}
proto_item_set_len(ti, offset-saved_offset);
if (tvb_length_remaining(tvb,offset)) {
if (tvb_captured_length_remaining(tvb,offset)) {
future_extension_bitmap = tvb_get_guint8(tvb,offset);
proto_tree_add_item(tree, hf_bmc_future_extension_bitmap, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@ -243,8 +243,8 @@ dissect_bmc_cbs41_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
proto_tree_add_item(tree, hf_bmc_broadcast_address, tvb, offset, 5, ENC_NA);
offset += 5;
proto_tree_add_item(tree, hf_bmc_cb_data41, tvb, offset, tvb_length_remaining(tvb,offset), ENC_NA);
offset = tvb_length(tvb);
proto_tree_add_item(tree, hf_bmc_cb_data41, tvb, offset, tvb_captured_length_remaining(tvb,offset), ENC_NA);
offset = tvb_captured_length(tvb);
return offset;
}

View File

@ -89,7 +89,7 @@ dissect_bofl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_uint(bofl_tree, hf_bofl_sequence, tvb, 4, 4, sequence);
len = tvb_length_remaining(tvb, 8);
len = tvb_captured_length_remaining(tvb, 8);
if (len > 0)
proto_tree_add_text(bofl_tree, tvb, 8, len,
"Padding (%d byte)", len);

View File

@ -2301,9 +2301,9 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
unsigned int offset = 0;
tvb_composite_finalize(rfc3396_dns_domain_search_list.tvb_composite);
while (offset < tvb_length(rfc3396_dns_domain_search_list.tvb_composite)) {
while (offset < tvb_captured_length(rfc3396_dns_domain_search_list.tvb_composite)) {
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, offset, tvb_length(rfc3396_dns_domain_search_list.tvb_composite), 0, &dns_name);
consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, offset, tvb_captured_length(rfc3396_dns_domain_search_list.tvb_composite), 0, &dns_name);
if (rfc3396_dns_domain_search_list.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
proto_tree_add_string(v_tree, hf_bootp_option_dhcp_dns_domain_search_list_fqdn, tvb, optoff + offset, consumedx, dns_name);
@ -2360,14 +2360,14 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
switch (enc) {
case RFC_3361_ENC_FQDN: {
unsigned int consumedx = 0;
if (tvb_length(rfc3396_sip_server.tvb_composite) < 3) {
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 3 (len = %u)", tvb_length(rfc3396_sip_server.tvb_composite));
if (tvb_captured_length(rfc3396_sip_server.tvb_composite) < 3) {
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 3 (len = %u)", tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
while (offset < tvb_length(rfc3396_sip_server.tvb_composite)) {
while (offset < tvb_captured_length(rfc3396_sip_server.tvb_composite)) {
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, offset, tvb_length(rfc3396_sip_server.tvb_composite), 1 /* ignore enc */, &dns_name);
consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, offset, tvb_captured_length(rfc3396_sip_server.tvb_composite), 1 /* ignore enc */, &dns_name);
if (rfc3396_sip_server.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
@ -2382,21 +2382,21 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
break;
}
case RFC_3361_ENC_IPADDR:
if (tvb_length(rfc3396_sip_server.tvb_composite) < 5) {
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 5 (len = %u)", tvb_length(rfc3396_sip_server.tvb_composite));
if (tvb_captured_length(rfc3396_sip_server.tvb_composite) < 5) {
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 5 (len = %u)", tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
/* x % 2^n == x & (2^n - 1) note : (assuming x is a positive integer) */
if ((tvb_length(rfc3396_sip_server.tvb_composite) - 1) & 3) {
if ((tvb_captured_length(rfc3396_sip_server.tvb_composite) - 1) & 3) {
if (rfc3396_sip_server.total_number_of_block == 1)
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", tvb_length(rfc3396_sip_server.tvb_composite));
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", tvb_captured_length(rfc3396_sip_server.tvb_composite));
else
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length,
"length isn't a multiple of 4 plus 1 (len = %u). For your information with RFC 3396, the length is the length sum of all options 120 into this BOOTP packet.",
tvb_length(rfc3396_sip_server.tvb_composite));
tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
while (offset < tvb_length(rfc3396_sip_server.tvb_composite)) {
while (offset < tvb_captured_length(rfc3396_sip_server.tvb_composite)) {
if (rfc3396_sip_server.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
proto_tree_add_item(v_tree, hf_bootp_option_sip_server_address, rfc3396_sip_server.tvb_composite, offset, 4, ENC_BIG_ENDIAN);

View File

@ -248,7 +248,7 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Locate EOF which is the last 4 bytes of the frame */
len = tvb_length_remaining(tvb, hdrlen);
len = tvb_captured_length_remaining(tvb, hdrlen);
reported_len = tvb_reported_length_remaining(tvb, hdrlen);
if (reported_len < 4) {
/*

View File

@ -371,7 +371,7 @@ dissect_bssap_unknown_message(tvbuff_t *message_tvb, proto_tree *bssap_tree)
{
guint32 message_length;
message_length = tvb_length(message_tvb);
message_length = tvb_captured_length(message_tvb);
proto_tree_add_text(bssap_tree, message_tvb, 0, message_length,
"Unknown message (%u byte%s)",
@ -639,7 +639,7 @@ unpack_digits(tvbuff_t *tvb, int offset, dgt_set_t *dgt, gboolean skip_first)
int i = 0;
char *digit_str;
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
if (length < offset)
return "";
digit_str = (char *)wmem_alloc(wmem_packet_scope(), (length - offset)*2+1);
@ -1663,37 +1663,37 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
/* End of mandatory elements */
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI TMSI 18.4.23 O TLV 6 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI))
offset = dissect_bssap_tmsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location area identifier Location area identifier 18.4.14 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Channel needed Channel needed 18.4.2 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_CHANNEL_NEEDED))
offset = dissect_bssap_channel_needed(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* eMLPP Priority eMLPP Priority 18.4.4 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_EMLPP_PRIORITY))
offset = dissect_bssap_emlpp_priority(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Global CN-Id Global CN-Id 18.4.27 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_GLOBAL_CN_ID))
offset = dissect_bssap_global_cn_id(tvb, pinfo, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
@ -1706,7 +1706,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1723,7 +1723,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_DLINK_TNL_PLD_CTR_AND_INF))
offset = dissect_bssap_dlink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1736,7 +1736,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_ULINK_TNL_PLD_CTR_AND_INF))
offset = dissect_bssap_ulink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1760,31 +1760,31 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Mobile station classmark Mobile station classmark 1 18.4.18 M TLV 3 */
if (check_ie(tvb, tree, &offset, BSSAP_MOBILE_STN_CLS_MRK1))
offset = dissect_bssap_mobile_stn_cls_mrk1(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Old location area identifier Location area identifier 18.4.14 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI status TMSI status 18.4.24 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI_STATUS))
offset = dissect_bssap_tmsi_status(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* New service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEISV IMEISV 18.4.9 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_IMEISV))
offset = dissect_bssap_imesiv(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1797,13 +1797,13 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */
if (check_optional_ie(tvb, offset, BSSAP_MOBILE_ID))
offset = dissect_bssap_mobile_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1814,7 +1814,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Reject cause Reject cause 18.4.21 M TLV 3 */
if (check_ie(tvb, tree, &offset, BSSAP_REJECT_CAUSE))
offset = dissect_bssap_reject_cause(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1823,20 +1823,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1845,7 +1845,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1854,7 +1854,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1867,7 +1867,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1876,20 +1876,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1906,20 +1906,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE))
offset = dissect_bssap_imsi_det_from_gprs_serv_type(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1928,7 +1928,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1945,27 +1945,27 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE))
offset = dissect_bssap_imsi_det_from_non_gprs_serv_type(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location information age Location information age 18.4.14 O TLV 4 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_INF_AGE))
offset = dissect_bssap_location_information_age(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1974,7 +1974,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -1983,14 +1983,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* SGSN number SGSN number 18.4.22 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_SGSN_NUMBER)) {
offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}else{
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)) {
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}
@ -2002,14 +2002,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* SGSN number SGSN number 18.4.22 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_SGSN_NUMBER)) {
offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}else{
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)) {
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}
@ -2025,7 +2025,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_INFO_REQ))
offset = dissect_bssap_info_req(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
@ -2034,56 +2034,56 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* IMSI IMSI 18.4.10 M TLV 6-10 */
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI TMSI 18.4.23 O TLV 6 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI))
offset = dissect_bssap_tmsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* PTMSI PTMSI 18.4.20 O TLV 6 BSSAP_PTMSI*/
if (check_optional_ie(tvb, offset, BSSAP_PTMSI))
offset = dissect_bssap_ptmsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEI IMEI 18.4.8 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_IMEI))
offset = dissect_bssap_imei(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEISV IMEISV 18.4.9 O TLV 10 BSSAP_IMEISV*/
if (check_optional_ie(tvb, offset, BSSAP_IMEISV))
offset = dissect_bssap_imesiv(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location information age Location information age 18.4.15 O TLV 4 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_INF_AGE))
offset = dissect_bssap_location_information_age(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Mobile station state Mobile station state 18.4.19 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_MOBILE_STN_STATE))
offset = dissect_bssap_mobile_station_state(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -2092,12 +2092,12 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* MM information MM information 18.4.16 O TLV 3-n */
if (check_optional_ie(tvb, offset, BSSAP_MM_INFORMATION))
offset = dissect_bssap_MM_information(tvb, bssap_tree, pinfo, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -2113,7 +2113,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_ERRONEOUS_MSG))
offset = dissect_bssap_gprs_erroneous_msg(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -2126,7 +2126,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
if (tvb_length_remaining(tvb, offset) <= 0)
if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@ -2149,7 +2149,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
switch (tvb_get_guint8(tvb, 0))
{
case 0x00:
if (tvb_get_guint8(tvb, 1) != (tvb_length(tvb) - 2)) {
if (tvb_get_guint8(tvb, 1) != (tvb_captured_length(tvb) - 2)) {
return(FALSE);
}
if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) {
@ -2158,7 +2158,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
break;
case 0x01:
if (tvb_get_guint8(tvb, 2) != (tvb_length(tvb) - 3)) {
if (tvb_get_guint8(tvb, 2) != (tvb_captured_length(tvb) - 3)) {
return(FALSE);
}
break;

View File

@ -6399,7 +6399,7 @@ dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Save pinfo */
g_rim_application_identity = 0;
gparent_tree = tree;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSGP");

View File

@ -478,7 +478,7 @@ gboolean dissect_bt_dht_heur (tvbuff_t *tvb, packet_info *pinfo,
/* try dissecting */
/* Assume dictionary (d) is followed by a one char long (1:) key string. */
if(tvb_length(tvb) < 4)
if(tvb_captured_length(tvb) < 4)
return FALSE;
if(tvb_memeql(tvb, 0, "d1:", 3) != 0)

View File

@ -161,7 +161,7 @@ get_utp_version(tvbuff_t *tvb) {
/* Simple heuristics inspired by code from utp.cpp */
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
/* Version 1? */
if (len < V1_FIXED_HDR_SIZE) {
@ -357,7 +357,7 @@ dissect_bt_utp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_utp_extension(tvb, pinfo, sub_tree, offset, &extension_type);
len_tvb = tvb_length_remaining(tvb, offset);
len_tvb = tvb_captured_length_remaining(tvb, offset);
if(len_tvb > 0)
proto_tree_add_item(sub_tree, hf_bt_utp_data, tvb, offset, len_tvb, ENC_NA);

View File

@ -108,9 +108,9 @@ dissect_bt3ds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset += 1;
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;

View File

@ -151,7 +151,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree *st, *ltree;
guint8 opcode;
if (tvb_length_remaining(tvb, 0) < 1)
if (tvb_captured_length_remaining(tvb, 0) < 1)
return 0;
ti = proto_tree_add_item(tree, proto_btatt, tvb, 0, -1, ENC_NA);
@ -220,7 +220,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset++;
if( format == 1 ) {
while( tvb_length_remaining(tvb, offset) > 0) {
while( tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(st, hf_btatt_uuid16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@ -228,7 +228,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
}
}
else if( format == 2 ) {
while( tvb_length_remaining(tvb, offset) > 0) {
while( tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(st, hf_btatt_uuid128, tvb, offset, 16, ENC_NA);
@ -257,7 +257,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case 0x07: /* Find By Type Value Response */
while( tvb_length_remaining(tvb, offset) > 0 ) {
while( tvb_captured_length_remaining(tvb, offset) > 0 ) {
item = proto_tree_add_none_format(st, hf_btatt_handles_info, tvb, offset, 4,
"Handles Info, Handle: 0x%04x, Group End Handle: 0x%04x",
tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2));
@ -282,11 +282,11 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree_add_item(st, hf_btatt_ending_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
if (tvb_length_remaining(tvb, offset) == 2) {
if (tvb_captured_length_remaining(tvb, offset) == 2) {
proto_tree_add_item(st, hf_btatt_uuid16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
}
else if (tvb_length_remaining(tvb, offset) == 16) {
else if (tvb_captured_length_remaining(tvb, offset) == 16) {
item = proto_tree_add_item(st, hf_btatt_uuid128, tvb, offset, 16, ENC_NA);
proto_item_append_text(item, " (%s)", val_to_str_ext_const(tvb_get_letohs(tvb, offset),
&bt_sig_uuid_vals_ext, "<unknown>"));
@ -303,9 +303,9 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
if(length > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u",
tvb_length_remaining(tvb, offset)/length);
tvb_captured_length_remaining(tvb, offset)/length);
while (tvb_length_remaining(tvb, offset) >= length)
while (tvb_captured_length_remaining(tvb, offset) >= length)
{
item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb,
offset, length, "Attribute Data, Handle: 0x%04x",
@ -345,13 +345,13 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case 0x0e: /* Multiple Read Request */
if(tvb_length_remaining(tvb, offset) < 4) {
if(tvb_captured_length_remaining(tvb, offset) < 4) {
expert_add_info(pinfo, item, &ei_btatt_handle_too_few);
break;
}
col_append_str(pinfo->cinfo, COL_INFO, ", Handles: ");
while (tvb_length_remaining(tvb, offset) >= 2) {
while (tvb_captured_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "0x%04x ", tvb_get_letohs(tvb, offset));
offset += 2;
@ -366,9 +366,9 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset++;
if(length > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u", tvb_length_remaining(tvb, offset)/length);
col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u", tvb_captured_length_remaining(tvb, offset)/length);
while (tvb_length_remaining(tvb, offset) >= length) {
while (tvb_captured_length_remaining(tvb, offset) >= length) {
item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb, offset, length,
"Attribute Data, Handle: 0x%04x, Group End Handle: 0x%04x",
tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2));
@ -423,7 +423,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_append_fstr(pinfo->cinfo, COL_INFO, ", Handle: 0x%04x", tvb_get_letohs(tvb, offset));
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length > 12) {
proto_tree_add_item(st, hf_btatt_value, tvb, offset, length-12, ENC_NA);
offset+=length-12;

View File

@ -637,8 +637,8 @@ dissect_sep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
when SEP is provided in ACP role, otherwise INT frequently asking for it
*/
direction = (pinfo->p2p_dir == P2P_DIR_SENT) ? P2P_DIR_RECV : P2P_DIR_SENT;
items = tvb_length_remaining(tvb, offset) / 2;
while (tvb_length_remaining(tvb, offset) > 0) {
items = tvb_captured_length_remaining(tvb, offset) / 2;
while (tvb_captured_length_remaining(tvb, offset) > 0) {
seid = tvb_get_guint8(tvb, offset);
in_use = seid & 0x02;
seid = seid >> 2;
@ -995,7 +995,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
gint media_type = 0;
gint media_codec_type = 0;
capabilities_item = proto_tree_add_item(tree, hf_btavdtp_capabilities, tvb, offset, tvb_length(tvb) - offset, ENC_NA);
capabilities_item = proto_tree_add_item(tree, hf_btavdtp_capabilities, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
capabilities_tree = proto_item_add_subtree(capabilities_item, ett_btavdtp_capabilities);
if (codec)
@ -1007,7 +1007,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
if (vendor_codec)
*vendor_codec = 0;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
service_category = tvb_get_guint8(tvb, offset);
losc = tvb_get_guint8(tvb, offset + 1);
service_item = proto_tree_add_none_format(capabilities_tree, hf_btavdtp_service, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD"));
@ -1457,7 +1457,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
} else if (!(l2cap_data->local_cid == channels_info->control_local_cid &&
l2cap_data->remote_cid == channels_info->control_remote_cid)) {
/* Unknown Stream Channel */
@ -1466,7 +1466,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown channel stream on cid=0x%04x", l2cap_data->cid);
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Signaling Channel */
@ -1701,7 +1701,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case SIGNAL_ID_START:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset,
SEID_ACP, i_sep, NULL,
interface_id, adapter_id, chandle, frame_number);
@ -1774,7 +1774,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case SIGNAL_ID_SUSPEND:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset,
SEID_ACP, i_sep, NULL,
interface_id, adapter_id, chandle, frame_number);
@ -1814,7 +1814,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
SEID_ACP, 0, NULL, interface_id,
adapter_id, chandle, frame_number);
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
if (message_type == MESSAGE_TYPE_REJECT) {
@ -1824,7 +1824,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
case SIGNAL_ID_DELAY_REPORT:
if (message_type == MESSAGE_TYPE_COMMAND) {
@ -1849,7 +1849,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
LABEL_data:
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
}
@ -2840,7 +2840,7 @@ dissect_bta2dp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
bluetooth_add_address(pinfo, &pinfo->net_dst, sep_data.stream_number, "BT A2DP", pinfo->fd->num, FALSE, &bta2dp_codec_info);
call_dissector(rtp_handle, tvb, pinfo, tree);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@ -3021,7 +3021,7 @@ dissect_btvdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
bluetooth_add_address(pinfo, &pinfo->net_dst, 0, "BT VDP", pinfo->fd->num, TRUE, &btvdp_codec_info);
call_dissector(rtp_handle, tvb, pinfo, tree);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}

View File

@ -1036,7 +1036,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_bt_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
if (tvb_length_remaining(tvb, offset) == 0) {
if (tvb_captured_length_remaining(tvb, offset) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, " - No PDU ID");
return offset;
}

View File

@ -2185,7 +2185,7 @@ dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key, tvb, offset, -1, ENC_NA);
offset+=tvb_length_remaining(tvb, offset);
offset+=tvb_captured_length_remaining(tvb, offset);
break;
case 0x0037: /* Disconnect Physical Link */
@ -2237,7 +2237,7 @@ dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
case 0x0044: /* Receive Synchronization Train */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@ -2975,7 +2975,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
case 0x078: /* Write Synchronization Train Parameters */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@ -3051,7 +3051,7 @@ dissect_status_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree_add_item(tree, hf_bthci_cmd_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
offset+=tvb_length_remaining(tvb, offset);
offset+=tvb_captured_length_remaining(tvb, offset);
break;
case 0x00D: /* Set Triggered Clock Capture */
@ -3061,7 +3061,7 @@ dissect_status_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
case 0x00C: /* Get MWS Transport Layer Configuration */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@ -3099,7 +3099,7 @@ dissect_testing_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre
case 0x009: /* AMP Test */
/* TODO: Implement above case */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@ -3435,14 +3435,14 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
default:
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_unknown, tvb, 3, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
}
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_parameter_unexpected, tvb, offset, -1);
/*offset += tvb_length_remaining(tvb, offset);*/
/*offset += tvb_captured_length_remaining(tvb, offset);*/
}
return offset;
@ -4952,7 +4952,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint end_offset;
guint i_uuid;
data_size = tvb_length(tvb);
data_size = tvb_captured_length(tvb);
while (offset < data_size) {
length = tvb_get_guint8(tvb, offset);
@ -5245,9 +5245,9 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(tree, hf_btcommon_eir_ad_unused, tvb, offset, -1, ENC_NA);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
return offset + data_size;

View File

@ -1398,7 +1398,7 @@ dissect_bthci_evt_loopback_command(tvbuff_t *tvb, int offset,
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, hci_data);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@ -2821,7 +2821,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
proto_tree_add_item(tree, hf_bthci_evt_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
case 0x140b: /* Write Remote AMP Assoc */
@ -2976,7 +2976,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
default:
proto_tree_add_item(tree, hf_bthci_evt_ret_params, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@ -3640,12 +3640,12 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
case 0xff: /* Vendor-Specific */
/* TODO: Implement above cases */
proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
default:
proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_unknown, tvb, offset, -1);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
}

View File

@ -227,7 +227,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_data, tvb, offset, -1, ENC_NA);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -163,10 +163,10 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Parameter length is shorter than 2 in response");
}
if (parameter_length < tvb_length_remaining(tvb, offset)) {
if (parameter_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_bthcrp_control_parameter_length,
"Parameter length is shorter than payload length");
} else if (parameter_length > tvb_length_remaining(tvb, offset)) {
} else if (parameter_length > tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_bthcrp_control_parameter_length,
"Parameter length is larger than payload length");
}
@ -177,9 +177,9 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (control_pdu_id >= 0x8000) {
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
} else switch(control_pdu_id) {
case 0x0001: /* CR_DataChannelCreditGrant */
@ -249,9 +249,9 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 *id;
proto_tree_add_item(tree, hf_bthcrp_control_1284_id, tvb, offset, -1, ENC_ASCII | ENC_NA);
id = tvb_get_string_enc(NULL, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
id = tvb_get_string_enc(NULL, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
col_append_fstr(pinfo->cinfo, COL_INFO, " - 1284 ID: %s", id);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case 0x0007: /* CR_SoftReset */
@ -310,7 +310,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@ -338,9 +338,9 @@ dissect_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (notification_pdu_id >= 0x8000) {
proto_item_append_text(pitem, " (Vendor Specific)");
col_append_str(pinfo->cinfo, COL_INFO, " (Vendor Specific)");
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
} else if (notification_pdu_id != 0x001) {
proto_item_append_text(pitem, " (Reserved)");
@ -494,7 +494,7 @@ dissect_bthcrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_append_fstr(pinfo->cinfo, COL_INFO, "HCRP stream (CID: 0x%04X)", l2cap_data->cid);
}
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_item *pitem;
pitem = proto_tree_add_item(main_tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);

View File

@ -885,9 +885,9 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean quotation;
gboolean next;
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length <= 0)
return tvb_length(tvb);
return tvb_captured_length(tvb);
if (!command_number) {
proto_tree_add_item(tree, hf_data, tvb, offset, length, ENC_NA | ENC_ASCII);
@ -1120,7 +1120,7 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
i_char += i_char_fix;
proto_item_set_len(command_item, i_char);
} else {
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length < 0)
length = 0;
proto_item_set_len(command_item, length);
@ -1268,9 +1268,9 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (role == ROLE_UNKNOWN) {
col_append_fstr(pinfo->cinfo, COL_INFO, "Data: %s",
tvb_format_text(tvb, 0, tvb_length(tvb)));
tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
proto_tree_add_item(main_tree, hf_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* save fragments */
@ -1337,7 +1337,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
fragment->role = role;
fragment->index = previous_fragment ? previous_fragment->index + previous_fragment->length : 0;
fragment->reassemble_state = REASSEMBLE_FRAGMENT;
fragment->length = tvb_length(tvb);
fragment->length = tvb_captured_length(tvb);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
fragment->previous_fragment = previous_fragment;
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
@ -1345,7 +1345,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
wmem_tree_insert32_array(fragments, key, fragment);
/* Detect reassemble end character: \r for HS or \n for AG */
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
at_stream = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, length, ENC_ASCII);
reassemble_start_offset = 0;
@ -1494,7 +1494,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (fragment->index > 0 && fragment->length > 0) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
reassembled_tvb = tvb_new_child_real_data(tvb, at_data,
fragment->index + fragment->length, fragment->index + fragment->length);
add_new_data_source(pinfo, reassembled_tvb, "Reassembled HFP");
@ -1504,24 +1504,24 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (reassembled_tvb) {
guint reassembled_offset = 0;
while (tvb_length(reassembled_tvb) > reassembled_offset) {
while (tvb_captured_length(reassembled_tvb) > reassembled_offset) {
reassembled_offset = dissect_at_command(reassembled_tvb,
pinfo, main_tree, reassembled_offset, role, command_number);
command_number += 1;
}
} else {
while (tvb_length(tvb) > (guint) offset) {
while (tvb_captured_length(tvb) > (guint) offset) {
offset = dissect_at_command(tvb, pinfo, main_tree, offset, role, command_number);
command_number += 1;
}
}
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s",
tvb_format_text_wsp(tvb, offset, tvb_length_remaining(tvb, offset)));
tvb_format_text_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
pitem = proto_tree_add_item(main_tree, hf_fragmented, tvb, 0, 0, ENC_NA);
PROTO_ITEM_SET_GENERATED(pitem);
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
}
return offset;

View File

@ -663,20 +663,20 @@ dissect_hid_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
/* not really in HID Specification */
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data_mouse_horizontal_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
/* not really in HID Specification */
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data_mouse_vertical_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
break;
}
@ -751,8 +751,8 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
Global Items are declared in the report descriptor, and in
Boot Protocol Mode. Otherwise the field does not exist."
*/
if (((parameter >> 3) && tvb_length_remaining(tvb, offset) >= 3) ||
(!(parameter >> 3) && tvb_length_remaining(tvb, offset) >= 1)) {
if (((parameter >> 3) && tvb_captured_length_remaining(tvb, offset) >= 3) ||
(!(parameter >> 3) && tvb_captured_length_remaining(tvb, offset) >= 1)) {
proto_tree_add_item(bthid_tree, hf_bthid_report_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@ -772,7 +772,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
/* playload */
proto_tree_add_item(bthid_tree, hf_bthid_data, tvb, offset, -1, ENC_NA);
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
break;
case 0x06: /* GET_PROTOCOL */
proto_tree_add_item(bthid_tree, hf_bthid_parameter_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);

View File

@ -300,9 +300,9 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean next;
void *data;
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length <= 0)
return tvb_length(tvb);
return tvb_captured_length(tvb);
if (!command_number) {
proto_tree_add_item(tree, hf_data, tvb, offset, length, ENC_NA | ENC_ASCII);
@ -601,7 +601,7 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
i_char += i_char_fix;
proto_item_set_len(command_item, i_char);
} else {
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length < 0)
length = 0;
proto_item_set_len(command_item, length);
@ -767,9 +767,9 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (role == ROLE_UNKNOWN) {
col_append_fstr(pinfo->cinfo, COL_INFO, "Data: %s",
tvb_format_text(tvb, 0, tvb_length(tvb)));
tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
proto_tree_add_item(main_tree, hf_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* save fragments */
@ -836,7 +836,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
fragment->role = role;
fragment->index = previous_fragment ? previous_fragment->index + previous_fragment->length : 0;
fragment->reassemble_state = REASSEMBLE_FRAGMENT;
fragment->length = tvb_length(tvb);
fragment->length = tvb_captured_length(tvb);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
fragment->previous_fragment = previous_fragment;
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
@ -844,7 +844,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
wmem_tree_insert32_array(fragments, key, fragment);
/* Detect reassemble end character: \r for HS or \n for AG */
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
at_stream = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, length, ENC_ASCII);
reassemble_start_offset = 0;
@ -993,7 +993,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (fragment->index > 0 && fragment->length > 0) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
reassembled_tvb = tvb_new_child_real_data(tvb, at_data,
fragment->index + fragment->length, fragment->index + fragment->length);
add_new_data_source(pinfo, reassembled_tvb, "Reassembled HSP");
@ -1003,24 +1003,24 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (reassembled_tvb) {
guint reassembled_offset = 0;
while (tvb_length(reassembled_tvb) > reassembled_offset) {
while (tvb_captured_length(reassembled_tvb) > reassembled_offset) {
reassembled_offset = dissect_at_command(reassembled_tvb,
pinfo, main_tree, reassembled_offset, role, command_number);
command_number += 1;
}
} else {
while (tvb_length(tvb) > (guint) offset) {
while (tvb_captured_length(tvb) > (guint) offset) {
offset = dissect_at_command(tvb, pinfo, main_tree, offset, role, command_number);
command_number += 1;
}
}
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s",
tvb_format_text_wsp(tvb, offset, tvb_length_remaining(tvb, offset)));
tvb_format_text_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
pitem = proto_tree_add_item(main_tree, hf_fragmented, tvb, 0, 0, ENC_NA);
PROTO_ITEM_SET_GENERATED(pitem);
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
}
return offset;

View File

@ -1453,7 +1453,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
tvbuff_t *next_tvb;
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
col_append_str(pinfo->cinfo, COL_INFO, "Connection oriented channel");
@ -1629,7 +1629,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/*pass up to higher layer if we have a complete packet*/
if (segment == 0x00) {
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset) - 2, length);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, length);
}
if (next_tvb) {
if (psm) {
@ -1671,15 +1671,15 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
if (!dissector_try_uint_new(l2cap_service_dissector_table, uuid, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
/* unknown protocol. declare as data */
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_length(next_tvb), ENC_NA);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_captured_length(next_tvb), ENC_NA);
}
}
}
else {
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_length(next_tvb), ENC_NA);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_captured_length(next_tvb), ENC_NA);
}
}
offset += (tvb_length_remaining(tvb, offset) - 2);
offset += (tvb_captured_length_remaining(tvb, offset) - 2);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
return offset;
@ -1984,7 +1984,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(btl2cap_tree, hf_btl2cap_psm, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
/* call next dissector */
if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
@ -2031,13 +2031,13 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(ti_control_subtree, hf_btl2cap_control_txseq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(ti_control_subtree, hf_btl2cap_control_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, tvb_length(tvb)-2, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, tvb_captured_length(tvb)-2, 2, ENC_LITTLE_ENDIAN);
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset)-2, length);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset)-2, length);
}
}
else {
next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
}
/* call next dissector */
if (next_tvb && !dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid,

View File

@ -407,12 +407,12 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x06: /* ADV_SCAN_IND */
offset = dissect_bd_addr(hf_advertising_address, btle_tree, tvb, offset);
if (tvb_length_remaining(tvb, offset) > 3) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
if (tvb_captured_length_remaining(tvb, offset) > 3) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, btle_tree);
}
offset += tvb_length_remaining(tvb, offset) - 3;
offset += tvb_captured_length_remaining(tvb, offset) - 3;
break;
case 0x01: /* ADV_DIRECT_IND */
@ -428,15 +428,15 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x04: /* SCAN_RSP */
offset = dissect_bd_addr(hf_advertising_address, btle_tree, tvb, offset);
sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3, ENC_NA);
sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_scan_response_data);
if (tvb_length_remaining(tvb, offset) > 3) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
if (tvb_captured_length_remaining(tvb, offset) > 3) {
next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, sub_tree);
}
offset += tvb_length_remaining(tvb, offset) - 3;
offset += tvb_captured_length_remaining(tvb, offset) - 3;
break;
case 0x05: /* CONNECT_REQ */
@ -479,9 +479,9 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
if (tvb_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
offset += tvb_length_remaining(tvb, offset) - 3;
if (tvb_captured_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}
} else { /* data PDU */
@ -558,9 +558,9 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x0B: /* LL_PAUSE_ENC_RSP */
case 0x12: /* LL_PING_REQ */
case 0x13: /* LL_PING_RSP */
if (tvb_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
offset += tvb_length_remaining(tvb, offset) - 3;
if (tvb_captured_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
break;
@ -705,17 +705,17 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
if (tvb_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
offset += tvb_length_remaining(tvb, offset) - 3;
if (tvb_captured_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}
break;
default:
if (tvb_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
offset += tvb_length_remaining(tvb, offset) - 3;
if (tvb_captured_length_remaining(tvb, offset) > 3) {
proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}

View File

@ -293,24 +293,24 @@ dissect_btmcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)");
}
if ((op_code == 0x03 || op_code == 0x05 || op_code == 0x07) && tvb_length_remaining(tvb, offset)) {
if ((op_code == 0x03 || op_code == 0x05 || op_code == 0x07) && tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_btmcap_response_parameters_bad,
"The Response Parameters for MD_RECONNECT_MDL_RSP shall have length zero.");
} else if (tvb_length_remaining(tvb, offset)) {
} else if (tvb_captured_length_remaining(tvb, offset)) {
pitem = proto_tree_add_item(main_tree, hf_btmcap_response_parameters, tvb, offset, -1, ENC_NA);
if (response_code != 0x00) {
expert_add_info_format(pinfo, pitem, &ei_btmcap_response_parameters_bad,
"When the Response Code is not Success, the Response Parameters shall have length zero.");
}
offset += tvb_length_remaining(tvb, offset);
offset += tvb_captured_length_remaining(tvb, offset);
}
}
}
if (tvb_length_remaining(tvb, offset)) {
if (tvb_captured_length_remaining(tvb, offset)) {
pitem = proto_tree_add_item(main_tree, hf_btmcap_data, tvb, offset, -1, ENC_NA);
expert_add_info(pinfo, pitem, &ei_btmcap_unexpected_data);
offset = tvb_length(tvb);
offset = tvb_captured_length(tvb);
}
return offset;

View File

@ -1089,7 +1089,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
gint parameters_length;
guint8 hdr_id, i;
if (tvb_length_remaining(tvb, offset) > 0) {
if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item *hdrs;
hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, item_length, ENC_NA);
hdrs_tree = proto_item_add_subtree(hdrs, ett_btobex_hdrs);
@ -1098,7 +1098,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
return offset;
}
while (tvb_length_remaining(tvb, offset) > 0) {
while (tvb_captured_length_remaining(tvb, offset) > 0) {
hdr_id = tvb_get_guint8(tvb, offset);
switch(0xC0 & hdr_id)
@ -1475,22 +1475,22 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* not the first fragment */
frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
tvb, 0, pinfo, pinfo->p2p_dir, NULL,
tvb_length(tvb), TRUE);
tvb_captured_length(tvb), TRUE);
new_tvb = process_reassembled_data(tvb, 0, pinfo,
"Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, tree);
pinfo->fragmented = TRUE;
} else {
if (tvb_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
if (tvb_captured_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
/* first fragment in a sequence */
no_of_segments = tvb_get_ntohs(tvb, offset+1)/tvb_length(tvb);
if (tvb_get_ntohs(tvb, offset+1) > (no_of_segments * tvb_length(tvb)))
no_of_segments = tvb_get_ntohs(tvb, offset+1)/tvb_captured_length(tvb);
if (tvb_get_ntohs(tvb, offset+1) > (no_of_segments * tvb_captured_length(tvb)))
no_of_segments++;
frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
tvb, 0, pinfo, pinfo->p2p_dir, NULL,
tvb_length(tvb), TRUE);
tvb_captured_length(tvb), TRUE);
fragment_set_tot_len(&btobex_reassembly_table,
pinfo, pinfo->p2p_dir, NULL,
@ -1501,7 +1501,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
pinfo->fragmented = TRUE;
}
else if (tvb_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
else if (tvb_captured_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
/* non-fragmented */
complete = TRUE;
pinfo->fragmented = FALSE;
@ -1652,9 +1652,9 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
if (length == 0 && tvb_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(st, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
offset += tvb_length_remaining(tvb, offset);
if (length == 0 && tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(st, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
offset += tvb_captured_length_remaining(tvb, offset);
break;
} else if (length == 0) break;

View File

@ -805,7 +805,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
/* len */
offset = get_le_multi_byte_value(tvb, offset, ctrl_tree, &length, hf_mcc_len);
if (length > (guint32) tvb_length_remaining(tvb, offset)) {
if (length > (guint32) tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, ctrl_tree, &ei_btrfcomm_mcc_length_bad, "Huge MCC length: %u", length);
return offset;
}
@ -1215,7 +1215,7 @@ dissect_btdun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
gboolean is_at_cmd;
guint i, length;
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DUN");
@ -1292,7 +1292,7 @@ dissect_btspp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_item *ti;
proto_tree *st;
gboolean ascii_only;
guint i, length = tvb_length(tvb);
guint i, length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SPP");
@ -1309,12 +1309,12 @@ dissect_btspp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_add_fstr(pinfo->cinfo, COL_INFO, "%s \"%s%s\"",
(pinfo->p2p_dir == P2P_DIR_SENT) ? "Sent" : "Rcvd",
tvb_format_text(tvb, 0, length),
(tvb_length(tvb) > length) ? "..." : "");
(tvb_captured_length(tvb) > length) ? "..." : "");
}
proto_tree_add_item(st, hf_spp_data, tvb, 0, -1, ENC_NA);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
void
@ -1363,12 +1363,12 @@ dissect_btgnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
(pinfo->p2p_dir == P2P_DIR_SENT) ? "Sent" : "Rcvd",
tvb_format_text(tvb, 0, tvb_length(tvb)));
tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
/* GNSS using NMEA-0183 protocol, but it is not available */
proto_tree_add_item(main_tree, hf_gnss_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
void

View File

@ -578,7 +578,7 @@ dissect_btsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
tvb, offset, 0, "Too many parameters");
}
if (tvb_length(tvb) > offset)
if (tvb_captured_length(tvb) > offset)
proto_tree_add_expert(tree, pinfo, &ei_unexpected_data, tvb, offset, -1);
return offset;

View File

@ -1187,7 +1187,7 @@ dissect_continuation_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
proto_item *cont_item;
guint length;
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length == 0) {
proto_tree_add_expert(tree, pinfo, &ei_btsdp_continuation_state_none, tvb, offset, -1);
} else if (length > 17) {
@ -1285,7 +1285,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo,
if (is_first) *is_first = TRUE;
if (is_continued) *is_continued = TRUE;
length = tvb_length_remaining(tvb, offset);
length = tvb_captured_length_remaining(tvb, offset);
if (length == 0) {
return offset;
} else if (length > 17) {
@ -1709,7 +1709,7 @@ dissect_data_element(proto_tree *tree, proto_tree **next_tree,
}
pitem = proto_tree_add_item(ptree, hf_data_element_value, tvb, offset, 0, ENC_NA);
if (length > tvb_length_remaining(tvb, offset)) {
if (length > tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, pitem, &ei_data_element_value_large);
length = 0;
}
@ -3928,7 +3928,7 @@ dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb,
gint new_offset = 0;
gint new_length;
new_length = tvb_length(new_tvb);
new_length = tvb_captured_length(new_tvb);
reassembled_item = proto_tree_add_item(tree, (is_continued) ? hf_partial_record_handle_list : hf_reassembled_record_handle_list,new_tvb, 0, new_length, ENC_NA);
proto_item_append_text(reassembled_item, " [count = %u]", new_length / 4);
@ -4027,7 +4027,7 @@ dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb,
reassembled_item = proto_tree_add_item(tree,
(is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
new_tvb, 0, tvb_length(new_tvb), ENC_NA);
new_tvb, 0, tvb_captured_length(new_tvb), ENC_NA);
reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
PROTO_ITEM_SET_GENERATED(reassembled_item);
@ -4152,13 +4152,13 @@ dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb,
reassembled_item = proto_tree_add_item(tree,
(is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
new_tvb, 0, tvb_length(new_tvb), ENC_NA);
new_tvb, 0, tvb_captured_length(new_tvb), ENC_NA);
reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
PROTO_ITEM_SET_GENERATED(reassembled_item);
if (!is_continued)
dissect_sdp_service_attribute_list_array(reassembled_tree, new_tvb, 0,
pinfo, tvb_length(new_tvb), &uuid, l2cap_data);
pinfo, tvb_captured_length(new_tvb), &uuid, l2cap_data);
}
return offset;

View File

@ -202,7 +202,7 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
}
if (tvb_length_remaining(tvb, 0) < 1)
if (tvb_captured_length_remaining(tvb, 0) < 1)
return FALSE;
proto_tree_add_item(st, hf_btsmp_opcode, tvb, 0, 1, ENC_LITTLE_ENDIAN);

View File

@ -998,7 +998,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
case EAX_MODE_CIPHERTEXT_AUTH:
/* mode is ciphertext with authentication */
hasmac = TRUE;
len2 = tvb_length_remaining(tvb, offset);
len2 = tvb_captured_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
encrypted = TRUE;
@ -1018,7 +1018,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
case EAX_MODE_CLEARTEXT_AUTH:
/* mode is cleartext with authentication */
hasmac = TRUE;
len2 = tvb_length_remaining(tvb, offset);
len2 = tvb_captured_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
buffer = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, len2);
@ -1592,7 +1592,7 @@ dissect_c1222_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
dissect_MESSAGE_PDU(tvb, pinfo, c1222_tree);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/**
@ -1628,7 +1628,7 @@ dissect_c1222(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, c1222_desegment, 5,
get_c1222_message_len, dissect_c1222_common, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/*--- proto_register_c1222 -------------------------------------------*/

View File

@ -1358,7 +1358,7 @@ dissect_camel_AccessPointName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_AccessPointName);
de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
return offset;
}
@ -2009,7 +2009,7 @@ proto_tree *subtree;
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_cause);
dissect_q931_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
dissect_q931_cause_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
return offset;
}
@ -2042,7 +2042,7 @@ dissect_camel_T_bearerCap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
if (!parameter_tvb)
return offset;
dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), tree);
dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), tree);
return offset;
}
@ -2096,7 +2096,7 @@ dissect_camel_CalledPartyBCDNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
return offset;
@ -2215,7 +2215,7 @@ dissect_camel_INTEGER_1_864000(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_camel_T_audibleIndicator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
if (tvb_length_remaining(tvb,offset) < 2)
if (tvb_captured_length_remaining(tvb,offset) < 2)
offset = dissect_camel_BOOLEAN(TRUE, tvb, offset, actx , tree, hf_camel_audibleIndicatorTone);
else
offset = dissect_camel_AudibleIndicator(implicit_tag, tvb, offset, actx, tree, hf_index);
@ -3417,10 +3417,10 @@ dissect_camel_T_pDPAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
case 1: /* IETF */
switch(PDPTypeNumber){
case 0x21: /* IPv4 */
proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_captured_length(parameter_tvb), ENC_BIG_ENDIAN);
break;
case 0x57: /* IPv6 */
proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_NA);
proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_captured_length(parameter_tvb), ENC_NA);
break;
default:
break;
@ -4899,7 +4899,7 @@ proto_tree *subtree;
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_RPcause);
dissect_RP_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
dissect_RP_cause_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
return offset;
}
@ -7981,7 +7981,7 @@ dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -8019,7 +8019,7 @@ dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
static int
@ -8056,7 +8056,7 @@ dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/*--- proto_reg_handoff_camel ---------------------------------------*/

View File

@ -335,7 +335,7 @@ dissect_canopen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}

View File

@ -63,7 +63,7 @@ test_carp_packet(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, vo
/* First some simple check if the data is
really CARP */
if (tvb_length(tvb) < 36)
if (tvb_captured_length(tvb) < 36)
return FALSE;
/* Version must be 1 or 2, type must be in carp_type_vals */
@ -135,7 +135,7 @@ dissect_carp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
cksum = tvb_get_ntohs(tvb, offset);
carp_len = (gint)tvb_reported_length(tvb);
if (!pinfo->fragmented && (gint)tvb_length(tvb) >= carp_len) {
if (!pinfo->fragmented && (gint)tvb_captured_length(tvb) >= carp_len) {
/* The packet isn't part of a fragmented datagram
and isn't truncated, so we can checksum it. */
cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, carp_len);

View File

@ -1027,7 +1027,7 @@ dissect_cast_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Get the length of a single CAST PDU */
@ -1065,7 +1065,7 @@ dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
hdr_data_length = tvb_get_letohl(tvb, 0);
hdr_marker = tvb_get_letohl(tvb, 4);
/* data_size = MIN(8+hdr_data_length, tvb_length(tvb)) - 0xC; */
/* data_size = MIN(8+hdr_data_length, tvb_captured_length(tvb)) - 0xC; */
if (hdr_data_length < 4 || hdr_marker != 0) {
return 0;
@ -1076,7 +1076,7 @@ dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_set_str(pinfo->cinfo, COL_INFO, "Cast Client Control Protocol");
tcp_dissect_pdus(tvb, pinfo, tree, cast_desegment, 4, get_cast_pdu_len, dissect_cast_pdu, data);
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */

View File

@ -356,7 +356,7 @@ static gboolean find_ipprim_data_offset(tvbuff_t *tvb, int *data_offset, guint8
}
/* Skip any other TLC fields before reach payload */
while (tvb_length_remaining(tvb, offset) > 2) {
while (tvb_captured_length_remaining(tvb, offset) > 2) {
/* Look at next tag */
tag = tvb_get_guint8(tvb, offset++);
@ -463,7 +463,7 @@ static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offs
offset += skipASNLength(first_length_byte);
/* Skip any other fields before reach payload */
while (tvb_length_remaining(tvb, offset) > 2) {
while (tvb_captured_length_remaining(tvb, offset) > 2) {
/* Look at next tag */
tag = tvb_get_guint8(tvb, offset++);
@ -618,7 +618,7 @@ static gboolean find_sctpprim_variant3_data_offset(tvbuff_t *tvb, int *data_offs
offset += 2;
/* Some optional params */
while ((tag != 0x0c00) && (tvb_length_remaining(tvb, offset) > 4)) {
while ((tag != 0x0c00) && (tvb_captured_length_remaining(tvb, offset) > 4)) {
switch (tag) {
case 0x0900: /* Dest address */
/* Length field */
@ -727,7 +727,7 @@ static void dissect_rlc_umts(tvbuff_t *tvb, gint offset,
}
/* Keep going until reach data tag or end of frame */
while ((tag != 0x41) && tvb_length_remaining(tvb, offset)) { /* i.e. Data */
while ((tag != 0x41) && tvb_captured_length_remaining(tvb, offset)) { /* i.e. Data */
tag = tvb_get_guint8(tvb, offset++);
switch (tag) {
case 0x72: /* UE Id */
@ -1027,7 +1027,7 @@ static void dissect_rrc_lte(tvbuff_t *tvb, gint offset,
}
/* Send to RRC dissector, if got here, have sub-dissector and some data left */
if ((protocol_handle != NULL) && (tvb_length_remaining(tvb, offset) > 0)) {
if ((protocol_handle != NULL) && (tvb_captured_length_remaining(tvb, offset) > 0)) {
rrc_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(protocol_handle, rrc_tvb, pinfo, tree, NULL);
}
@ -1089,7 +1089,7 @@ static void dissect_ccpri_lte(tvbuff_t *tvb, gint offset,
/* Send remainder to lapb dissector (lapb needs patch with preference
set to call cpri C&M dissector instead of X.25) */
protocol_handle = find_dissector("lapb");
if ((protocol_handle != NULL) && (tvb_length_remaining(tvb, offset) > 0)) {
if ((protocol_handle != NULL) && (tvb_captured_length_remaining(tvb, offset) > 0)) {
ccpri_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_only(protocol_handle, ccpri_tvb, pinfo, tree, NULL);
}
@ -1253,7 +1253,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, gint offset,
/* Other optional fields may follow */
tag = tvb_get_guint8(tvb, offset++);
while ((tag != 0x41) && (tvb_length_remaining(tvb, offset) > 2)) {
while ((tag != 0x41) && (tvb_captured_length_remaining(tvb, offset) > 2)) {
if (tag == 0x35) {
/* This is MUI */
@ -1932,7 +1932,7 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Otherwise show as $hex */
int n, idx;
char *hex_string;
int tty_string_length = tvb_length_remaining(tvb, offset);
int tty_string_length = tvb_captured_length_remaining(tvb, offset);
int hex_string_length = 1+(2*tty_string_length)+1;
hex_string = (char *)wmem_alloc(wmem_packet_scope(), hex_string_length);
@ -2465,7 +2465,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (strcmp(protocol_name, "comment") == 0) {
/* Extract & add the string. */
proto_item *string_ti;
char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
/* Show comment string */
string_ti = proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_comment, tvb,
@ -2492,7 +2492,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
if (strcmp(protocol_name, "sprint") == 0) {
/* Extract & add the string. */
char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
/* Show sprint string */
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_sprint, tvb,

View File

@ -258,7 +258,7 @@ dissect_cdt_CompressedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
return offset;
}
next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_length (compr_tvb));
next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_captured_length (compr_tvb));
if (next_tvb == NULL) {
proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_uncompress_content,

View File

@ -254,7 +254,7 @@ guint dissect_cbs_message_identifier(tvbuff_t *tvb, proto_tree *tree, guint offs
tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint offset )
{
tvbuff_t * tvb_out = NULL;
int length = tvb_length(tvb) - offset;
int length = tvb_captured_length(tvb) - offset;
gchar *utf8_text = NULL, *utf8_out;
switch(sms_encoding){
@ -308,7 +308,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *cbs_msg_tvb = NULL;
fragment_head * frag_data = NULL;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast");
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Page)");
@ -330,7 +330,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (cbs_page_tvb != NULL)
{
text_len = tvb_length(cbs_page_tvb);
text_len = tvb_captured_length(cbs_page_tvb);
while (text_len && (tvb_get_guint8(cbs_page_tvb, text_len-1) == '\r')) {
text_len--;
}
@ -338,7 +338,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *item = proto_tree_add_text(cbs_page_tree, tvb, offset, -1, "Cell Broadcast Page Contents");
proto_tree *cbs_page_subtree = proto_item_add_subtree(item, ett_gsm_cbs_page_content);
len = tvb_length(cbs_page_tvb);
len = tvb_captured_length(cbs_page_tvb);
proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0,
text_len, tvb_get_string_enc(wmem_packet_scope(), cbs_page_tvb, 0, text_len, ENC_ASCII));
len -= text_len;
@ -375,7 +375,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *cbs_msg_item = NULL;
proto_tree *cbs_msg_tree = NULL;
len = tvb_length(cbs_msg_tvb);
len = tvb_captured_length(cbs_msg_tvb);
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)");
cbs_msg_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, cbs_msg_tvb, 0, len, "GSM Cell Broadcast Message");
@ -395,7 +395,7 @@ void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, prot
guint msg_len;
tvbuff_t * cbs_msg_tvb = NULL;
len = tvb_length(tvb);
len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast");
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)");
@ -407,10 +407,10 @@ void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, prot
offset++;
cbs_msg_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_tree, pinfo, offset );
msg_len = tvb_length(cbs_msg_tvb);
msg_len = tvb_captured_length(cbs_msg_tvb);
cbs_item2 = proto_tree_add_text(cbs_tree, tvb, offset, -1, "Cell Broadcast Message Contents (length: %d)", msg_len);
cbs_subtree = proto_item_add_subtree(cbs_item2, ett_cbs_msg);
proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_length(cbs_msg_tvb), "%s", tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII));
proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_captured_length(cbs_msg_tvb), "%s", tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII));
}
/* Register the protocol with Wireshark */

View File

@ -535,7 +535,7 @@ dissect_charging_ase_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
#line 13 "../../asn1/charging_ase/charging_ase.cnf"
proto_tree_add_text(tree, tvb, offset, -1, "Extensions not dissected");
return tvb_length(tvb);
return tvb_captured_length(tvb);
return offset;
@ -847,10 +847,10 @@ dissect_charging_ase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *it;
proto_tree *tr;
it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, tvb_length(tvb), "Charging ASE");
it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, tvb_captured_length(tvb), "Charging ASE");
tr=proto_item_add_subtree(it, ett_charging_ase);
if(tvb_length(tvb)>0)
if(tvb_captured_length(tvb)>0)
{
dissect_charging_ase_ChargingMessageType_PDU(tvb , pinfo, tr, NULL);
}

View File

@ -2455,7 +2455,7 @@ packet_is_cigi(tvbuff_t *tvb)
/* CIGI 3 */
guint16 byte_swap;
if (tvb_length(tvb) < 3) {
if (tvb_captured_length(tvb) < 3) {
/* Not enough data available to check */
return FALSE;
}
@ -2609,7 +2609,7 @@ dissect_cigi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
dissect_cigi_pdu(tvb, pinfo, tree);
/* We probably ate the entire packet. */
return tvb_length(tvb);
return tvb_captured_length(tvb);
}
/* Code to actually dissect the CIGI packets */
@ -2658,7 +2658,7 @@ dissect_cigi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_cigi, tvb, 0, tvb_length(tvb), "Common Image Generator Interface (%i), %s => %s (%u bytes)",
ti = proto_tree_add_protocol_format(tree, proto_cigi, tvb, 0, tvb_captured_length(tvb), "Common Image Generator Interface (%i), %s => %s (%u bytes)",
cigi_version, src_str, dest_str, tvb_reported_length(tvb));
cigi_tree = proto_item_add_subtree(ti, ett_cigi);
@ -2707,7 +2707,7 @@ cigi_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_tree* cigi_packet_tree = NULL;
proto_item* tipacket;
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given
@ -2798,7 +2798,7 @@ cigi2_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_item* tipacket;
int hf_cigi2_packet = -1;
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given
@ -2995,7 +2995,7 @@ cigi3_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_item* tipacket;
int hf_cigi3_packet = -1;
length = tvb_length(tvb);
length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given

Some files were not shown because too many files have changed in this diff Show More