Use tvb_new_subset_remaining() rather than tvb_new_subset();

#include <styring.h> not req'd (in a few cases);
Minor reformating & whitespace cleanup.

svn path=/trunk/; revision=41374
This commit is contained in:
Bill Meier 2012-03-06 16:58:09 +00:00
parent 9cfb5a1ea8
commit 87cf82e056
21 changed files with 2980 additions and 2771 deletions

View File

@ -60,7 +60,7 @@ dissect_atmtcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ti;
proto_tree *atmtcp_tree;
guint offset=0;
guint offset = 0;
gint32 length;
tvbuff_t *next_tvb;
@ -102,7 +102,7 @@ dissect_atmtcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 4;
/* Data (for the moment...) */
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
return tvb_length(tvb);
}

View File

@ -28,18 +28,17 @@
#endif
#include <glib.h>
#include <string.h>
#include <epan/bitswap.h>
#include <epan/packet.h>
#include <epan/bitswap.h>
#include <epan/asn1.h> /* needed for packet-gsm_map.h */
#include "packet-cell_broadcast.h"
#include "packet-gsm_map.h"
static int dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int dissect_bmc_cbs_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int dissect_bmc_cbs41_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int dissect_bmc_cbs41_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
static int proto_bmc = -1;
static int hf_bmc_message_type = -1;
@ -143,7 +142,7 @@ static int
dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
tvbuff_t *cell_broadcast_tvb;
gint offset=1;
gint offset = 1;
dissect_cbs_message_identifier(tvb, tree, offset);
offset += 2;
@ -154,7 +153,7 @@ dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
dissect_cbs_data_coding_scheme(tvb, pinfo, tree, offset);
offset += 1;
cell_broadcast_tvb = tvb_new_subset(tvb, offset, -1, -1);
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);
@ -164,7 +163,7 @@ dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
static int
dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
gint offset=1, i, saved_offset;
gint offset = 1, i, saved_offset;
guint8 new_message_bitmap_len;
guint8 length_of_cbs_schedule_period;
guint8 message_description_type;
@ -197,7 +196,12 @@ dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
for (i=0; i<new_message_bitmap_len; i++) {
for(mask=1; bit<=length_of_cbs_schedule_period; mask<<=1, bit++) {
message_description_type = tvb_get_guint8(tvb,offset);
proto_tree_add_uint_format(message_description_tree, hf_bmc_message_description_type, tvb, offset, 1, message_description_type, "Message %d Message Description Type: %s (%d)", bit, val_to_str(message_description_type, message_description_type_vals,"Unknown"), message_description_type);
proto_tree_add_uint_format(message_description_tree, hf_bmc_message_description_type,
tvb, offset, 1, message_description_type,
"Message %d Message Description Type: %s (%d)",
bit,
val_to_str(message_description_type, message_description_type_vals,"Unknown"),
message_description_type);
offset += 1;
if ((message_description_type==1) || (message_description_type==5)) {
@ -205,7 +209,8 @@ dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
offset += 2;
}
else if ((message_description_type==0) || (message_description_type==4)) {
proto_tree_add_item(message_description_tree, hf_bmc_offset_to_ctch_bs_index_of_first_transmission, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(message_description_tree, hf_bmc_offset_to_ctch_bs_index_of_first_transmission,
tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -992,7 +992,7 @@ dissect_eigrp_extdata_flags (proto_tree *tree, tvbuff_t *tvb, int offset)
/* Decode the route flags field */
sub_ti = proto_tree_add_text(tree, tvb, offset, 1, "External Flags");
sub_tree = proto_item_add_subtree(sub_ti, ett_eigrp_extdata_flags);
sub_tvb = tvb_new_subset(tvb, offset, 1, -1);
sub_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree_add_item(sub_tree, hf_eigrp_extdata_flag_ext, sub_tvb, 0, 1,
ENC_BIG_ENDIAN);

View File

@ -88,7 +88,7 @@ dissect_etherip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Set the tvbuff for the payload after the header */
next_tvb = tvb_new_subset(tvb, sizeof(etheriph), -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, sizeof(etheriph));
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}

View File

@ -124,7 +124,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
{
ti = proto_tree_add_item(tree, proto_gmrp, tvb, 0, length, ENC_NA);
ti = proto_tree_add_item(tree, proto_gmrp, tvb, 0, -1, ENC_NA);
gmrp_tree = proto_item_add_subtree(ti, ett_gmrp);
@ -146,7 +146,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(gmrp_tree, tvb, GARP_PROTOCOL_ID, sizeof(guint16),
" (Warning: this version of Wireshark only knows about protocol id = 1)");
call_dissector(data_handle,
tvb_new_subset(tvb, GARP_PROTOCOL_ID + sizeof(guint16), -1, -1),
tvb_new_subset_remaining(tvb, GARP_PROTOCOL_ID + sizeof(guint16)),
pinfo, tree);
return;
}
@ -276,7 +276,8 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case GMRP_EVENT_LEAVEEMPTY:
case GMRP_EVENT_LEAVEIN:
case GMRP_EVENT_EMPTY:
if ( (octet != GMRP_GROUP_MEMBERSHIP_NON_LEAVEALL) && (octet != GMRP_SERVICE_REQUIREMENT_NON_LEAVEALL) )
if ( (octet != GMRP_GROUP_MEMBERSHIP_NON_LEAVEALL) &&
(octet != GMRP_SERVICE_REQUIREMENT_NON_LEAVEALL) )
{
call_dissector(data_handle,
tvb_new_subset_remaining(tvb, offset),

View File

@ -3262,7 +3262,7 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
trans = transaction_end(pinfo, icmp6_tree, conv_key);
}
}
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += call_dissector(data_handle, next_tvb, pinfo, icmp6_tree);
}
}

View File

@ -461,7 +461,7 @@ dissect_ieee802154_nonask_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree *ieee802154_tree = NULL;
proto_item *proto_root = NULL;
guint offset=0;
guint offset = 0;
guint32 preamble;
guint8 sfd,phr;
tvbuff_t* mac;
@ -1485,7 +1485,7 @@ dissect_ieee802154_assoc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Call the data dissector for any leftover bytes. */
if (tvb_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset(tvb, 1, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_assoc_req */
@ -1563,7 +1563,7 @@ dissect_ieee802154_assoc_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
/* Call the data dissector for any leftover bytes. */
if (tvb_length(tvb) > offset) {
call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
} /* dissect_ieee802154_assoc_rsp */
@ -1624,7 +1624,7 @@ dissect_ieee802154_disassoc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Call the data dissector for any leftover bytes. */
if (tvb_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset(tvb, 1, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_disassoc */
@ -1707,7 +1707,7 @@ dissect_ieee802154_realign(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Call the data dissector for any leftover bytes. */
if (tvb_length(tvb) > offset) {
call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
} /* dissect_ieee802154_realign */
@ -1766,7 +1766,7 @@ dissect_ieee802154_gtsreq(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i
/* Call the data dissector for any leftover bytes. */
if (tvb_length(tvb) > 1) {
call_dissector(data_handle, tvb_new_subset(tvb, 1, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(tvb, 1), pinfo, tree);
}
} /* dissect_ieee802154_gtsreq */

View File

@ -71,7 +71,7 @@ dissect_udpencap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Non-ESP Marker");
proto_item_set_len(ti, sizeof(spi));
}
next_tvb = tvb_new_subset(tvb, sizeof(spi), -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, sizeof(spi));
call_dissector(isakmp_handle, next_tvb, pinfo, tree);
} else {
col_set_str(pinfo->cinfo, COL_INFO, "ESP");

View File

@ -613,7 +613,7 @@ dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(tvb_get_bits8(tvb, 1, 1) == 1) /* If Reliable flag is 1 */
offset += dissect_reliable_message_index_base(tvb, 3, datagram_tree); /* Calculate RMIB */
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
while(bytes_left)
{
@ -637,7 +637,7 @@ dissect_knet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += length; /* Move the offset the amount of the payload */
next_tvb = tvb_new_subset(next_tvb, offset, -1, -1); /* Prepare the next tvb for the next message */
next_tvb = tvb_new_subset_remaining(next_tvb, offset); /* Prepare the next tvb for the next message */
}
else bytes_left = FALSE; /* We dont have any bytes left to process... Hopefully */

View File

@ -180,7 +180,7 @@ dissect_lisp_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Check if there is stuff left in the buffer, and return if not */
/* Determine if encapsulated packet is IPv4 or IPv6, and call dissector */
next_tvb = tvb_new_subset(tvb, LISP_DATA_HEADER_LEN, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, LISP_DATA_HEADER_LEN);
ip_ver = tvb_get_bits8(next_tvb, 0, 4);
switch (ip_ver) {
case 4:

View File

@ -200,7 +200,7 @@ dissect_lisp_locator(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_mapping
break;
default:
proto_tree_add_text(lisp_mapping_tree, tvb, 0, 2, "Unexpected AFI, cannot decode");
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_mapping_tree);
}
@ -240,6 +240,7 @@ dissect_lisp_mapping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tree, g
proto_item *tir;
proto_tree *lisp_mapping_tree;
tvbuff_t *next_tvb;
const char *lisp_actions[] = {
"No-Action",
"Natively-Forward",
@ -288,7 +289,7 @@ dissect_lisp_mapping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tree, g
break;
default:
proto_tree_add_text(lisp_tree, tvb, 0, 2, "Unexpected AFI, cannot decode");
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
return offset;
}
@ -306,7 +307,7 @@ dissect_lisp_mapping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tree, g
tvbuff_t *loc_tvb;
int len = 0;
loc_tvb = tvb_new_subset(tvb, offset, -1, -1);
loc_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_lisp_locator(loc_tvb, pinfo, lisp_mapping_tree);
offset += len;
}
@ -408,7 +409,7 @@ dissect_lisp_map_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tre
default:
proto_tree_add_text(lisp_tree, tvb, offset, 0,
"Unexpected Source EID AFI, cannot decode");
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
return;
}
@ -447,7 +448,7 @@ dissect_lisp_map_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tre
default:
proto_tree_add_text(lisp_tree, tvb, offset, 2,
"Unexpected ITR-RLOC-AFI, cannot decode");
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
return;
}
@ -510,7 +511,7 @@ dissect_lisp_map_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tre
break;
default:
proto_tree_add_text(lisp_tree, tvb, offset, 2, "Unexpected AFI, cannot decode");
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
return;
}
@ -526,12 +527,12 @@ dissect_lisp_map_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tre
tim = proto_tree_add_text(lisp_tree, tvb, offset, -1, "Map-Reply record");
lisp_mr_tree = proto_item_add_subtree(tim, ett_lisp_mr);
rep_tvb = tvb_new_subset(tvb, offset, -1, -1);
rep_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_lisp_mapping(rep_tvb, pinfo, lisp_mr_tree, 0);
offset += len;
}
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
}
@ -595,12 +596,12 @@ dissect_lisp_map_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tree)
tvbuff_t *rec_tvb;
int len = 0;
rec_tvb = tvb_new_subset(tvb, offset, -1, -1);
rec_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_lisp_mapping(rec_tvb, pinfo, lisp_tree, rec_cnt);
offset += len;
}
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
}
@ -684,12 +685,12 @@ dissect_lisp_map_register(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tr
tvbuff_t *rec_tvb;
int len = 0;
rec_tvb = tvb_new_subset(tvb, offset, -1, -1);
rec_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_lisp_mapping(rec_tvb, pinfo, lisp_tree, rec_cnt);
offset += len;
}
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
}
@ -767,12 +768,12 @@ dissect_lisp_map_notify(tvbuff_t *tvb, packet_info *pinfo, proto_tree *lisp_tree
tvbuff_t *rec_tvb;
int len = 0;
rec_tvb = tvb_new_subset(tvb, offset, -1, -1);
rec_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_lisp_mapping(rec_tvb, pinfo, lisp_tree, rec_cnt);
offset += len;
}
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, lisp_tree);
}
@ -798,7 +799,7 @@ dissect_lisp_ecm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree
proto_tree_add_item(lisp_tree, hf_lisp_ecm_res, tvb, 0, 4, ENC_BIG_ENDIAN);
/* Determine if encapsulated packet is IPv4 or IPv6, and call dissector */
next_tvb = tvb_new_subset(tvb, LISP_ECM_HEADER_LEN, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, LISP_ECM_HEADER_LEN);
ip_ver = tvb_get_bits8(next_tvb, 0, 4);
switch (ip_ver) {

View File

@ -268,13 +268,13 @@ dissect_mactelnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += datalength;
} else {
/* Data packet, let wireshark handle it */
tvbuff_t *next_client = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset);
return call_dissector(data_handle, next_client, pinfo, mactelnet_tree);
}
}
} else if (type == 4 || type == 5) {
/* Data packet, let wireshark handle it */
tvbuff_t *next_client = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *next_client = tvb_new_subset_remaining(tvb, offset);
return call_dissector(data_handle, next_client, pinfo, mactelnet_tree);
}

View File

@ -403,6 +403,7 @@ get_pid_analysis(guint32 pid, conversation_t *conv)
pid_analysis_data_t *pid_data = NULL;
mp2t_analysis_data_t *mp2t_data = NULL;
mp2t_data = get_mp2t_conversation_data(conv);
pid_data = se_tree_lookup32(mp2t_data->pid_table, pid);
@ -487,7 +488,7 @@ mp2t_get_packet_length(tvbuff_t *tvb, guint offset, packet_info *pinfo,
len_tvb = tvb_new_composite();
tvb_composite_append(len_tvb, frag_tvb);
data_tvb = tvb_new_subset(tvb, offset, -1, -1);
data_tvb = tvb_new_subset_remaining(tvb, offset);
tvb_composite_append(len_tvb, data_tvb);
tvb_composite_finalize(len_tvb);
@ -963,6 +964,7 @@ dissect_tsp(tvbuff_t *tvb, volatile gint offset, packet_info *pinfo,
guint32 pid;
guint32 cc;
guint32 pusi_flag;
/* guint8 pointer; */
proto_item *ti = NULL;
@ -1246,8 +1248,8 @@ dissect_mp2t( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
guint offset = 0;
conversation_t *conv;
conv = find_or_create_conversation(pinfo);
conv = find_or_create_conversation(pinfo);
for (; tvb_reported_length_remaining(tvb, offset) >= MP2T_PACKET_SIZE; offset += MP2T_PACKET_SIZE) {

View File

@ -1079,7 +1079,7 @@ dissect_mux27010(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (new_tvb) { /* take it all */
next_tvb2 = tvb_new_subset(new_tvb, 1, -1, -1);
next_tvb2 = tvb_new_subset_remaining(new_tvb, 1);
call_dissector(ppp_handle, next_tvb2, pinfo, tree);
}

View File

@ -28,7 +28,6 @@
#endif
#include <glib.h>
#include <string.h>
#include <epan/packet.h>
@ -169,7 +168,7 @@ skip:
offset = length;
/* dissect the 802.11 header next */
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
return offset;
}

View File

@ -30,8 +30,8 @@
#endif
#include <glib.h>
#include <epan/prefs.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/emem.h>
#include "packet-ppp.h"
#include <epan/ppptypes.h>
@ -1839,6 +1839,7 @@ dissect_lcp_async_map_opt(const ip_tcp_opt *optp, tvbuff_t *tvb, int offset,
{
guint32 map;
const char *mapstr;
static const char *ctrlchars[32] = {
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
"BS", "HT", "NL", "VT", "NP (FF)", "CR", "SO", "SI",
@ -3368,7 +3369,7 @@ dissect_vsnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(vsnp_tree, hf_vsnp_pdnid, tvb, offset, 1, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset(tvb, 1, -1, -1);
next_tvb = tvb_new_subset_remaining(tvb, 1);
/* do lookup with the subdissector table */
if (!dissector_try_uint(ppp_subdissector_table, PPP_IP, next_tvb, pinfo, tree))
@ -3793,7 +3794,7 @@ dissect_iphc_crtp_fh(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 ip_version;
guint8 next_protocol;
guchar* ip_packet;
guchar *ip_packet;
length = tvb_reported_length(tvb);
@ -4460,7 +4461,7 @@ dissect_pap( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) {
guint8 code;
gchar *peer_id, *password, *message;
guint8 peer_id_length, password_length, message_length;
int offset=0;
int offset = 0;
code = tvb_get_guint8(tvb, 0);

View File

@ -245,16 +245,16 @@ dissect_scop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Call the appropriate helper routine to dissect based on the service type. */
switch (packet.service) {
case SCOP_SERVICE_SCOP:
dissect_scop_zip(tvb_new_subset(next_tvb, offset, -1, -1), pinfo, scop_tree);
dissect_scop_zip(tvb_new_subset_remaining(next_tvb, offset), pinfo, scop_tree);
break;
case SCOP_SERVICE_BRIDGE:
dissect_scop_bridge(tvb_new_subset(next_tvb, offset, -1, -1), pinfo, scop_tree);
dissect_scop_bridge(tvb_new_subset_remaining(next_tvb, offset), pinfo, scop_tree);
break;
case SCOP_SERVICE_GATEWAY:
/* Nothing yet defined for the gateway. Fall-Through. */
default:
/* Unknown Service Type. */
call_dissector(data_handle, tvb_new_subset(next_tvb, offset, -1, -1), pinfo, tree);
call_dissector(data_handle, tvb_new_subset_remaining(next_tvb, offset), pinfo, tree);
break;
}
} /* dissect_scop() */
@ -293,7 +293,7 @@ dissect_scop_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* If there are any bytes left over, pass them to the data dissector. */
if (offset < tvb_length(tvb)) {
tvbuff_t *payload_tvb = tvb_new_subset(tvb, offset, -1, -1);
tvbuff_t *payload_tvb = tvb_new_subset_remaining(tvb, offset);
proto_tree *root = proto_tree_get_root(tree);
call_dissector(data_handle, payload_tvb, pinfo, root);
}

View File

@ -113,7 +113,7 @@ dissect_tdmoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* The rest is SAMPLES * CHANNELS bytes of channel data */
next_client = tvb_new_subset(tvb, offset, -1, -1);
next_client = tvb_new_subset_remaining(tvb, offset);
return call_dissector(data_handle, next_client, pinfo, tdmoe_tree);
}

View File

@ -364,7 +364,7 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (x != 0) {
/* Actually packet starts x bytes into what we have got but with all
source routing compressed. See comment above */
tr_tvb = tvb_new_subset((tvbuff_t*) tvb, x, -1, -1);
tr_tvb = tvb_new_subset_remaining((tvbuff_t*) tvb, x);
}
else {
tr_tvb = tvb;

View File

@ -140,7 +140,7 @@ dissect_trill( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
/* call the eth dissector */
next_tvb = tvb_new_subset( tvb, TRILL_MIN_FRAME_LENGTH + op_len , -1, -1 ) ;
next_tvb = tvb_new_subset_remaining( tvb, TRILL_MIN_FRAME_LENGTH + op_len ) ;
call_dissector( eth_dissector, next_tvb, pinfo, tree ) ;
return tvb_length( tvb ) ;