aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asn1/ldap/packet-ldap-template.c2
-rw-r--r--asn1/mpeg-pes/packet-mpeg-pes-template.c6
-rw-r--r--asn1/pres/packet-pres-template.c2
-rw-r--r--asn1/snmp/packet-snmp-template.c2
-rw-r--r--asn1/spnego/packet-spnego-template.c4
-rw-r--r--asn1/t38/packet-t38-template.c2
-rw-r--r--epan/dissectors/packet-3com-xns.c2
-rw-r--r--epan/dissectors/packet-afp.c2
-rw-r--r--epan/dissectors/packet-aim-icq.c2
-rw-r--r--epan/dissectors/packet-aim-messaging.c4
-rw-r--r--epan/dissectors/packet-aim.c2
-rw-r--r--epan/dissectors/packet-airopeek.c2
-rw-r--r--epan/dissectors/packet-ap1394.c2
-rw-r--r--epan/dissectors/packet-arcnet.c2
-rw-r--r--epan/dissectors/packet-artnet.c2
-rw-r--r--epan/dissectors/packet-asap.c30
-rw-r--r--epan/dissectors/packet-atalk.c8
-rw-r--r--epan/dissectors/packet-atm.c12
-rw-r--r--epan/dissectors/packet-ayiya.c2
-rw-r--r--epan/dissectors/packet-bacnet.c4
-rw-r--r--epan/dissectors/packet-bat.c8
-rw-r--r--epan/dissectors/packet-bctp.c2
-rw-r--r--epan/dissectors/packet-ber.c14
-rw-r--r--epan/dissectors/packet-bssgp.c2
-rw-r--r--epan/dissectors/packet-capwap.c6
-rw-r--r--epan/dissectors/packet-cdp.c2
-rw-r--r--epan/dissectors/packet-chdlc.c6
-rw-r--r--epan/dissectors/packet-cisco-erspan.c2
-rw-r--r--epan/dissectors/packet-clnp.c6
-rw-r--r--epan/dissectors/packet-cosine.c12
-rw-r--r--epan/dissectors/packet-dccp.c2
-rw-r--r--epan/dissectors/packet-dcerpc.c2
-rw-r--r--epan/dissectors/packet-dcp-etsi.c2
-rw-r--r--epan/dissectors/packet-dsi.c2
-rw-r--r--epan/dissectors/packet-dtpt.c2
-rw-r--r--epan/dissectors/packet-dua.c2
-rw-r--r--epan/dissectors/packet-eapol.c4
-rw-r--r--epan/dissectors/packet-egd.c2
-rw-r--r--epan/dissectors/packet-ehs.c2
-rw-r--r--epan/dissectors/packet-eigrp.c2
-rw-r--r--epan/dissectors/packet-enc.c2
-rw-r--r--epan/dissectors/packet-enrp.c36
-rw-r--r--epan/dissectors/packet-erf.c6
-rw-r--r--epan/dissectors/packet-ethertype.c4
-rw-r--r--epan/dissectors/packet-fc.c6
-rw-r--r--epan/dissectors/packet-fcct.c2
-rw-r--r--epan/dissectors/packet-fcip.c2
-rw-r--r--epan/dissectors/packet-fcsb3.c8
-rw-r--r--epan/dissectors/packet-fcswils.c2
-rw-r--r--epan/dissectors/packet-fddi.c2
-rw-r--r--epan/dissectors/packet-fefd.c2
-rw-r--r--epan/dissectors/packet-fr.c16
-rw-r--r--epan/dissectors/packet-giop.c2
-rw-r--r--epan/dissectors/packet-gmrp.c14
-rw-r--r--epan/dissectors/packet-gprs-ns.c2
-rw-r--r--epan/dissectors/packet-gre.c2
-rw-r--r--epan/dissectors/packet-gsm_map.c16
-rw-r--r--epan/dissectors/packet-gsm_sms.c2
-rw-r--r--epan/dissectors/packet-gsm_sms_ud.c2
-rw-r--r--epan/dissectors/packet-gssapi.c14
-rw-r--r--epan/dissectors/packet-gtp.c10
-rw-r--r--epan/dissectors/packet-gvrp.c12
-rw-r--r--epan/dissectors/packet-hci_h1.c2
-rw-r--r--epan/dissectors/packet-hci_h4.c2
-rw-r--r--epan/dissectors/packet-hip.c2
-rw-r--r--epan/dissectors/packet-hpext.c2
-rw-r--r--epan/dissectors/packet-hsrp.c6
-rw-r--r--epan/dissectors/packet-iax2.c2
-rw-r--r--epan/dissectors/packet-icap.c2
-rw-r--r--epan/dissectors/packet-icmp.c6
-rw-r--r--epan/dissectors/packet-icmpv6.c6
-rw-r--r--epan/dissectors/packet-idp.c2
-rw-r--r--epan/dissectors/packet-ieee80211.c6
-rw-r--r--epan/dissectors/packet-ieee8021ah.c2
-rw-r--r--epan/dissectors/packet-ieee8023.c2
-rw-r--r--epan/dissectors/packet-ieee802a.c2
-rw-r--r--epan/dissectors/packet-imf.c2
-rw-r--r--epan/dissectors/packet-ip.c4
-rw-r--r--epan/dissectors/packet-ipars.c2
-rw-r--r--epan/dissectors/packet-ipfc.c2
-rw-r--r--epan/dissectors/packet-ipp.c2
-rw-r--r--epan/dissectors/packet-ipsec.c2
-rw-r--r--epan/dissectors/packet-ipv6.c6
-rw-r--r--epan/dissectors/packet-ipx.c4
-rw-r--r--epan/dissectors/packet-isl.c8
-rw-r--r--epan/dissectors/packet-isup.c14
-rw-r--r--epan/dissectors/packet-itdm.c4
-rw-r--r--epan/dissectors/packet-iua.c2
-rw-r--r--epan/dissectors/packet-iuup.c2
-rw-r--r--epan/dissectors/packet-iwarp-ddp-rdmap.c4
-rw-r--r--epan/dissectors/packet-jabber.c2
-rw-r--r--epan/dissectors/packet-juniper.c8
-rw-r--r--epan/dissectors/packet-jxta.c16
-rw-r--r--epan/dissectors/packet-kpasswd.c4
-rw-r--r--epan/dissectors/packet-l2tp.c10
-rw-r--r--epan/dissectors/packet-lanforge.c2
-rw-r--r--epan/dissectors/packet-lapb.c2
-rw-r--r--epan/dissectors/packet-lapd.c2
-rw-r--r--epan/dissectors/packet-ldap.c2
-rw-r--r--epan/dissectors/packet-lge_monitor.c2
-rw-r--r--epan/dissectors/packet-llc.c37
-rw-r--r--epan/dissectors/packet-loop.c2
-rw-r--r--epan/dissectors/packet-lwapp.c4
-rw-r--r--epan/dissectors/packet-m2pa.c6
-rw-r--r--epan/dissectors/packet-m2ua.c2
-rw-r--r--epan/dissectors/packet-m3ua.c2
-rw-r--r--epan/dissectors/packet-mdshdr.c2
-rw-r--r--epan/dissectors/packet-mgcp.c2
-rw-r--r--epan/dissectors/packet-mikey.c2
-rw-r--r--epan/dissectors/packet-miop.c2
-rw-r--r--epan/dissectors/packet-mip.c2
-rw-r--r--epan/dissectors/packet-mip6.c2
-rw-r--r--epan/dissectors/packet-mmse.c2
-rw-r--r--epan/dissectors/packet-mpeg-pes.c6
-rw-r--r--epan/dissectors/packet-mpls.c6
-rw-r--r--epan/dissectors/packet-mq.c6
-rw-r--r--epan/dissectors/packet-msdp.c2
-rw-r--r--epan/dissectors/packet-msrp.c2
-rw-r--r--epan/dissectors/packet-mtp2.c2
-rw-r--r--epan/dissectors/packet-mtp3.c6
-rw-r--r--epan/dissectors/packet-mtp3mg.c6
-rw-r--r--epan/dissectors/packet-nbipx.c4
-rw-r--r--epan/dissectors/packet-nbns.c2
-rw-r--r--epan/dissectors/packet-ncp.c12
-rw-r--r--epan/dissectors/packet-ndmp.c4
-rw-r--r--epan/dissectors/packet-ndps.c6
-rw-r--r--epan/dissectors/packet-netbios.c10
-rw-r--r--epan/dissectors/packet-nhrp.c2
-rw-r--r--epan/dissectors/packet-nsip.c2
-rw-r--r--epan/dissectors/packet-null.c4
-rw-r--r--epan/dissectors/packet-osi.c2
-rw-r--r--epan/dissectors/packet-ositp.c14
-rw-r--r--epan/dissectors/packet-ospf.c2
-rw-r--r--epan/dissectors/packet-pcli.c2
-rw-r--r--epan/dissectors/packet-pdcp-lte.c2
-rw-r--r--epan/dissectors/packet-pflog.c4
-rw-r--r--epan/dissectors/packet-pgm.c2
-rw-r--r--epan/dissectors/packet-pim.c4
-rw-r--r--epan/dissectors/packet-pktc.c10
-rw-r--r--epan/dissectors/packet-pktgen.c2
-rw-r--r--epan/dissectors/packet-ppi.c4
-rw-r--r--epan/dissectors/packet-ppp.c10
-rw-r--r--epan/dissectors/packet-pptp.c4
-rw-r--r--epan/dissectors/packet-pres.c6
-rw-r--r--epan/dissectors/packet-pw-atm.c10
-rw-r--r--epan/dissectors/packet-pw-eth.c4
-rw-r--r--epan/dissectors/packet-pw-hdlc.c2
-rw-r--r--epan/dissectors/packet-q931.c2
-rw-r--r--epan/dissectors/packet-radiotap.c2
-rw-r--r--epan/dissectors/packet-raw.c6
-rw-r--r--epan/dissectors/packet-redback.c14
-rw-r--r--epan/dissectors/packet-redbackli.c2
-rw-r--r--epan/dissectors/packet-rmcp.c4
-rw-r--r--epan/dissectors/packet-rmi.c4
-rw-r--r--epan/dissectors/packet-rmp.c16
-rw-r--r--epan/dissectors/packet-rmt-alc.c2
-rw-r--r--epan/dissectors/packet-roofnet.c2
-rw-r--r--epan/dissectors/packet-rpc.c4
-rw-r--r--epan/dissectors/packet-rpl.c8
-rw-r--r--epan/dissectors/packet-rtnet.c2
-rw-r--r--epan/dissectors/packet-rtp.c2
-rw-r--r--epan/dissectors/packet-rudp.c2
-rw-r--r--epan/dissectors/packet-rx.c2
-rw-r--r--epan/dissectors/packet-sap.c2
-rw-r--r--epan/dissectors/packet-sctp.c2
-rw-r--r--epan/dissectors/packet-sdlc.c2
-rw-r--r--epan/dissectors/packet-sdp.c2
-rw-r--r--epan/dissectors/packet-ses.c2
-rw-r--r--epan/dissectors/packet-simulcrypt.c2
-rw-r--r--epan/dissectors/packet-sll.c2
-rw-r--r--epan/dissectors/packet-smb.c6
-rw-r--r--epan/dissectors/packet-smb2.c2
-rw-r--r--epan/dissectors/packet-sna.c39
-rw-r--r--epan/dissectors/packet-snaeth.c2
-rw-r--r--epan/dissectors/packet-sndcp.c2
-rw-r--r--epan/dissectors/packet-snmp.c2
-rw-r--r--epan/dissectors/packet-spnego.c6
-rw-r--r--epan/dissectors/packet-spp.c2
-rw-r--r--epan/dissectors/packet-srp.c2
-rw-r--r--epan/dissectors/packet-ssl.c2
-rw-r--r--epan/dissectors/packet-sua.c14
-rw-r--r--epan/dissectors/packet-symantec.c4
-rw-r--r--epan/dissectors/packet-t38.c2
-rw-r--r--epan/dissectors/packet-tali.c2
-rw-r--r--epan/dissectors/packet-tcp.c2
-rw-r--r--epan/dissectors/packet-tds.c4
-rw-r--r--epan/dissectors/packet-teamspeak2.c4
-rw-r--r--epan/dissectors/packet-telkonet.c2
-rw-r--r--epan/dissectors/packet-teredo.c2
-rw-r--r--epan/dissectors/packet-tipc.c12
-rw-r--r--epan/dissectors/packet-tns.c4
-rw-r--r--epan/dissectors/packet-tr.c2
-rw-r--r--epan/dissectors/packet-tte.c2
-rw-r--r--epan/dissectors/packet-turbocell.c4
-rw-r--r--epan/dissectors/packet-tzsp.c2
-rw-r--r--epan/dissectors/packet-ucp.c2
-rw-r--r--epan/dissectors/packet-udld.c2
-rw-r--r--epan/dissectors/packet-usb.c6
-rw-r--r--epan/dissectors/packet-v120.c2
-rw-r--r--epan/dissectors/packet-v5ua.c2
-rw-r--r--epan/dissectors/packet-vcdu.c2
-rw-r--r--epan/dissectors/packet-vines.c12
-rw-r--r--epan/dissectors/packet-wcp.c2
-rw-r--r--epan/dissectors/packet-wfleet-hdlc.c2
-rw-r--r--epan/dissectors/packet-wsp.c13
-rw-r--r--epan/dissectors/packet-wtp.c2
-rw-r--r--epan/dissectors/packet-x224.c2
-rw-r--r--epan/dissectors/packet-x25.c2
-rw-r--r--epan/dissectors/packet-zbee-aps.c4
-rw-r--r--epan/dissectors/packet-zbee-nwk.c2
-rw-r--r--epan/dissectors/packet-zbee-zdp.c2
-rw-r--r--epan/libwireshark.def1
-rw-r--r--epan/reassemble.c2
-rw-r--r--plugins/docsis/packet-bpkmreq.c2
-rw-r--r--plugins/docsis/packet-bpkmrsp.c2
-rw-r--r--plugins/docsis/packet-dsaack.c2
-rw-r--r--plugins/docsis/packet-dsareq.c2
-rw-r--r--plugins/docsis/packet-dsarsp.c2
-rw-r--r--plugins/docsis/packet-dscack.c2
-rw-r--r--plugins/docsis/packet-dscreq.c2
-rw-r--r--plugins/docsis/packet-dscrsp.c2
-rw-r--r--plugins/docsis/packet-dsdreq.c2
-rw-r--r--plugins/docsis/packet-regack.c2
-rw-r--r--plugins/docsis/packet-regreq.c2
-rw-r--r--plugins/docsis/packet-regreqmp.c2
-rw-r--r--plugins/docsis/packet-regrsp.c2
-rw-r--r--plugins/docsis/packet-regrspmp.c2
-rw-r--r--plugins/docsis/packet-uccreq.c2
-rw-r--r--plugins/ethercat/packet-esl.c2
-rw-r--r--plugins/ethercat/packet-ethercat-frame.c2
-rw-r--r--plugins/irda/packet-ircomm.c2
-rw-r--r--plugins/irda/packet-irda.c18
-rw-r--r--plugins/profinet/packet-dcom-cba-acco.c4
-rw-r--r--plugins/profinet/packet-pn-mrp.c2
-rw-r--r--plugins/sercosiii/packet-sercosiii_1v1_at.c2
-rw-r--r--plugins/sercosiii/packet-sercosiii_1v1_mdt.c2
236 files changed, 528 insertions, 538 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 5fdc500924..11039e0443 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -1034,7 +1034,7 @@ dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i
*/
if (!decr_tvb) {
if(!pinfo->gssapi_data_encrypted){
- plain_tvb = tvb_new_subset(gssapi_tvb, ver_len, -1, -1);
+ plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len);
}
}
diff --git a/asn1/mpeg-pes/packet-mpeg-pes-template.c b/asn1/mpeg-pes/packet-mpeg-pes-template.c
index 714adadf11..f75883783a 100644
--- a/asn1/mpeg-pes/packet-mpeg-pes-template.c
+++ b/asn1/mpeg-pes/packet-mpeg-pes-template.c
@@ -353,7 +353,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset / 8, 64, FALSE);
offset += 64 * 8;
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_SEQUENCE_EXTENSION) {
tvbuff_t *es;
@@ -361,7 +361,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_mpeg_pes_Sequence_extension(tvb, offset, &asn1_ctx,
tree, hf_mpeg_video_sequence_extension);
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_GOP) {
tvbuff_t *es;
@@ -369,7 +369,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_mpeg_pes_Group_of_pictures(tvb, offset, &asn1_ctx,
tree, hf_mpeg_video_group_of_pictures);
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_PACK) {
if (tvb_get_guint8(tvb, offset / 8) >> 6 == 1) {
diff --git a/asn1/pres/packet-pres-template.c b/asn1/pres/packet-pres-template.c
index 01a6035df9..01236857f5 100644
--- a/asn1/pres/packet-pres-template.c
+++ b/asn1/pres/packet-pres-template.c
@@ -208,7 +208,7 @@ pres_try_users_table(guint32 ctx_id, tvbuff_t *tvb, int offset, packet_info *pin
if (u->ctx_id == ctx_id) {
/* Register oid so other dissectors can find this connection */
register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid);
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_ber_oid_callback(u->oid, next_tvb, offset, pinfo, global_tree);
return TRUE;
}
diff --git a/asn1/snmp/packet-snmp-template.c b/asn1/snmp/packet-snmp-template.c
index 74ca2d8b30..35b868b45a 100644
--- a/asn1/snmp/packet-snmp-template.c
+++ b/asn1/snmp/packet-snmp-template.c
@@ -1569,7 +1569,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
* data which needs to be dissected in case of UDP as UDP is PDU oriented.
*/
if((!is_tcp) && (length_remaining > (guint)offset)) {
- 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);
}
else{
diff --git a/asn1/spnego/packet-spnego-template.c b/asn1/spnego/packet-spnego-template.c
index 0b7f453a6d..d88e58a41e 100644
--- a/asn1/spnego/packet-spnego-template.c
+++ b/asn1/spnego/packet-spnego-template.c
@@ -283,7 +283,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case KRB_TOKEN_AP_REQ:
case KRB_TOKEN_AP_REP:
case KRB_TOKEN_AP_ERR:
- krb5_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ krb5_tvb = tvb_new_subset_remaining(tvb, offset);
offset = dissect_kerberos_main(krb5_tvb, pinfo, subtree, FALSE, NULL);
break;
@@ -1063,7 +1063,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
}
#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
- pinfo->gssapi_encrypted_tvb = tvb_new_subset(tvb, 16, -1, -1);
+ pinfo->gssapi_encrypted_tvb = tvb_new_subset_remaining(tvb, 16);
if (flags & 0x0002) {
if(pinfo->gssapi_encrypted_tvb){
diff --git a/asn1/t38/packet-t38-template.c b/asn1/t38/packet-t38-template.c
index d3cca47b22..709e5471b2 100644
--- a/asn1/t38/packet-t38-template.c
+++ b/asn1/t38/packet-t38-template.c
@@ -582,7 +582,7 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while(tvb_length_remaining(tvb,offset)>0)
{
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_IFPPacket_PDU(next_tvb, pinfo, tr);
ifp_packet_number++;
diff --git a/epan/dissectors/packet-3com-xns.c b/epan/dissectors/packet-3com-xns.c
index a105b19244..d758476648 100644
--- a/epan/dissectors/packet-3com-xns.c
+++ b/epan/dissectors/packet-3com-xns.c
@@ -79,7 +79,7 @@ dissect_3com_xns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
type = tvb_get_ntohs(tvb, 0);
- next_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 2);
if (type == 0x0004) {
proto_tree_add_uint(subtree, hf_3com_xns_type_retix_bpdu,
tvb, 0, 2, type);
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index 6f44c249b4..90f5201b9d 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -4425,7 +4425,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
if (offset < len) {
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, afp_tree);
}
}
diff --git a/epan/dissectors/packet-aim-icq.c b/epan/dissectors/packet-aim-icq.c
index 8ac5809773..ce06a3a97e 100644
--- a/epan/dissectors/packet-aim-icq.c
+++ b/epan/dissectors/packet-aim-icq.c
@@ -190,7 +190,7 @@ static int dissect_aim_tlv_value_icq(proto_item *ti _U_, guint16 subtype _U_, tv
proto_item_append_text(subtype_item, " (%s)", icq_calls[i].name?icq_calls[i].name:"Unknown");
if(icq_calls[i].dissector)
- return icq_calls[i].dissector(tvb_new_subset(tvb, offset, -1, -1), pinfo, t);
+ return icq_calls[i].dissector(tvb_new_subset_remaining(tvb, offset), pinfo, t);
default:
break;
diff --git a/epan/dissectors/packet-aim-messaging.c b/epan/dissectors/packet-aim-messaging.c
index 5a7a419f2d..df6238c75b 100644
--- a/epan/dissectors/packet-aim-messaging.c
+++ b/epan/dissectors/packet-aim-messaging.c
@@ -513,7 +513,7 @@ static int dissect_aim_tlv_value_extended_data(proto_item *ti, guint16 valueid _
if (is_uuid_null(plugin_uuid))
{
/* a message follows */
- tvbuff_t *subtvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvbuff_t *subtvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_aim_rendezvous_extended_message(subtvb, entry);
}
else
@@ -555,7 +555,7 @@ static int dissect_aim_msg_clientautoresp(tvbuff_t *tvb, packet_info *pinfo, pro
case 0x0003:
{
proto_item *ti_extended_data = proto_tree_add_text(msg_tree, tvb, offset, -1, "Extended Data");
- tvbuff_t *subtvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvbuff_t *subtvb = tvb_new_subset_remaining(tvb, offset);
dissect_aim_tlv_value_extended_data(ti_extended_data, 0, subtvb, pinfo);
}
break;
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index 9a1516580b..a648316090 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -840,7 +840,7 @@ static void dissect_aim_snac(tvbuff_t *tvb, packet_info *pinfo,
}
}
- subtvb = tvb_new_subset(tvb, offset, -1, -1);
+ subtvb = tvb_new_subset_remaining(tvb, offset);
aiminfo.tcpinfo = pinfo->private_data;
aiminfo.family = family_id;
aiminfo.subtype = subtype_id;
diff --git a/epan/dissectors/packet-airopeek.c b/epan/dissectors/packet-airopeek.c
index aa14e2066b..e852050fdd 100644
--- a/epan/dissectors/packet-airopeek.c
+++ b/epan/dissectors/packet-airopeek.c
@@ -79,7 +79,7 @@ dissect_airopeek(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(airopeek_tree, hf_airopeek_channel, tvb, 17, 1, FALSE);
proto_tree_add_item(airopeek_tree, hf_airopeek_unknown6, tvb, 18, 2, FALSE);
}
- next_tvb = tvb_new_subset(tvb, 20, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 20);
pinfo->pseudo_header->ieee_802_11.fcs_len = 4;
call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-ap1394.c b/epan/dissectors/packet-ap1394.c
index 753d67af51..d08cde5bb1 100644
--- a/epan/dissectors/packet-ap1394.c
+++ b/epan/dissectors/packet-ap1394.c
@@ -93,7 +93,7 @@ dissect_ap1394(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
etype = tvb_get_ntohs(tvb, 16);
if (tree)
proto_tree_add_uint(fh_tree, hf_ap1394_type, tvb, 16, 2, etype);
- next_tvb = tvb_new_subset(tvb, 18, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 18);
if (!dissector_try_port(ethertype_subdissector_table, etype, next_tvb,
pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-arcnet.c b/epan/dissectors/packet-arcnet.c
index 2b84feb8b3..3f7747173f 100644
--- a/epan/dissectors/packet-arcnet.c
+++ b/epan/dissectors/packet-arcnet.c
@@ -255,7 +255,7 @@ dissect_arcnet_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
if (tree)
proto_item_set_len(ti, offset);
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
if (!dissector_try_port (arcnet_dissector_table, protID,
next_tvb, pinfo, tree))
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index 2265db4c7a..4ebafc6425 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -1261,7 +1261,7 @@ dissect_artnet_rdm(tvbuff_t *tvb, guint offset, proto_tree *tree, packet_info *
col_set_writable(pinfo->cinfo, FALSE);
if (!next_tvb)
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(rdm_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c
index aca054d546..5b6fd070df 100644
--- a/epan/dissectors/packet-asap.c
+++ b/epan/dissectors/packet-asap.c
@@ -182,28 +182,28 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
switch(code) {
case UNRECOGNIZED_PARAMETER_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case UNRECONGNIZED_MESSAGE_CAUSE_CODE:
- message_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ message_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_asap(message_tvb, NULL, cause_tree);
break;
break;
case INVALID_VALUES:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case NON_UNIQUE_PE_IDENTIFIER:
break;
case POOLING_POLICY_INCONSISTENT_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case LACK_OF_RESOURCES_CAUSE_CODE:
break;
case INCONSISTENT_TRANSPORT_TYPE_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case INCONSISTENT_DATA_CONTROL_CONFIGURATION_CAUSE_CODE:
@@ -285,7 +285,7 @@ dissect_dccp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(parameter_tree, hf_dccp_reserved, parameter_tvb, DCCP_RESERVED_OFFSET, DCCP_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_dccp_service_code, parameter_tvb, DCCP_SERVICE_CODE_OFFSET, DCCP_SERVICE_CODE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, DCCP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, DCCP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -311,7 +311,7 @@ dissect_sctp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(parameter_tree, hf_sctp_port, parameter_tvb, SCTP_PORT_OFFSET, SCTP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_transport_use, parameter_tvb, SCTP_TRANSPORT_USE_OFFSET, SCTP_TRANSPORT_USE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, SCTP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, SCTP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -329,7 +329,7 @@ dissect_tcp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
proto_tree_add_item(parameter_tree, hf_tcp_port, parameter_tvb, TCP_PORT_OFFSET, TCP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_transport_use, parameter_tvb, TCP_TRANSPORT_USE_OFFSET, TCP_TRANSPORT_USE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, TCP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, TCP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -347,7 +347,7 @@ dissect_udp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
proto_tree_add_item(parameter_tree, hf_udp_port, parameter_tvb, UDP_PORT_OFFSET, UDP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_udp_reserved, parameter_tvb, UDP_RESERVED_OFFSET, UDP_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, UDP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, UDP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -365,7 +365,7 @@ dissect_udp_lite_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
proto_tree_add_item(parameter_tree, hf_udp_lite_port, parameter_tvb, UDP_LITE_PORT_OFFSET, UDP_LITE_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_udp_lite_reserved, parameter_tvb, UDP_LITE_RESERVED_OFFSET, UDP_LITE_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, UDP_LITE_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, UDP_LITE_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -517,7 +517,7 @@ dissect_pool_element_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tr
pi = proto_tree_add_item(parameter_tree, hf_reg_life, parameter_tvb, REGISTRATION_LIFE_OFFSET, REGISTRATION_LIFE_LENGTH, NETWORK_BYTE_ORDER);
proto_item_append_text(pi, "ms");
- parameters_tvb = tvb_new_subset(parameter_tvb, USER_TRANSPORT_PARAMETER_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, USER_TRANSPORT_PARAMETER_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -532,7 +532,7 @@ dissect_server_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
proto_tree_add_item(parameter_tree, hf_server_identifier, parameter_tvb, SERVER_ID_OFFSET, SERVER_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, SERVER_TRANSPORT_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, SERVER_TRANSPORT_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -543,7 +543,7 @@ dissect_operation_error_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter
{
tvbuff_t *error_causes_tvb;
- error_causes_tvb = tvb_new_subset(parameter_tvb, ERROR_CAUSES_OFFSET, -1,-1);
+ error_causes_tvb = tvb_new_subset_remaining(parameter_tvb, ERROR_CAUSES_OFFSET);
dissect_error_causes(error_causes_tvb, parameter_tree);
}
@@ -824,9 +824,9 @@ dissect_asap_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *asap
proto_tree_add_item(asap_tree, hf_message_length, message_tvb, MESSAGE_LENGTH_OFFSET, MESSAGE_LENGTH_LENGTH, NETWORK_BYTE_ORDER);
if ((type == SERVER_ANNOUNCE_MESSAGE_TYPE) || (type == ENDPOINT_KEEP_ALIVE_MESSAGE_TYPE)) {
proto_tree_add_item(asap_tree, hf_server_identifier, message_tvb, SERVER_IDENTIFIER_OFFSET, SERVER_IDENTIFIER_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_VALUE_OFFSET + SERVER_IDENTIFIER_LENGTH, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_VALUE_OFFSET + SERVER_IDENTIFIER_LENGTH);
} else {
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_VALUE_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_VALUE_OFFSET);
}
dissect_parameters(parameters_tvb, asap_tree);
}
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index 7e51052cfe..3c6205050e 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -949,7 +949,7 @@ dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
}
else {
/* Just show this as a fragment. */
- new_tvb = tvb_new_subset (tvb, ATP_HDRSIZE -1, -1, -1);
+ new_tvb = tvb_new_subset_remaining (tvb, ATP_HDRSIZE -1);
call_dissector(data_handle, new_tvb, pinfo, tree);
}
pinfo->fragmented = save_fragmented;
@@ -1721,7 +1721,7 @@ dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, guint8 dnode,
proto_tree_add_uint(ddp_tree, hf_ddp_type, tvb, 4, 1, type);
}
- new_tvb = tvb_new_subset(tvb, DDP_SHORT_HEADER_SIZE, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, DDP_SHORT_HEADER_SIZE);
if (!dissector_try_port(ddp_dissector_table, type, new_tvb, pinfo, tree))
call_dissector(data_handle,new_tvb, pinfo, tree);
@@ -1797,7 +1797,7 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ddp.type);
}
- new_tvb = tvb_new_subset(tvb, DDP_HEADER_SIZE, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, DDP_HEADER_SIZE);
if (!dissector_try_port(ddp_dissector_table, ddp.type, new_tvb, pinfo, tree))
call_dissector(data_handle,new_tvb, pinfo, tree);
@@ -1851,7 +1851,7 @@ dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
proto_tree_add_uint(llap_tree, hf_llap_type, tvb, 2, 1, type);
- new_tvb = tvb_new_subset(tvb, 3, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, 3);
switch (type) {
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index 26885ba7b8..1c13d03e56 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -675,7 +675,7 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_le_client(tvb, tree);
/* Dissect as Ethernet */
- next_tvb_le_client = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb_le_client = tvb_new_subset_remaining(tvb, 2);
call_dissector(eth_withoutfcs_handle, next_tvb_le_client, pinfo, tree);
break;
@@ -685,14 +685,14 @@ dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_le_client(tvb, tree);
/* Dissect as Token-Ring */
- next_tvb_le_client = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb_le_client = tvb_new_subset_remaining(tvb, 2);
call_dissector(tr_handle, next_tvb_le_client, pinfo, tree);
break;
default:
/* Dump it as raw data. */
col_set_str(pinfo->cinfo, COL_INFO, "Unknown LANE traffic type");
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
call_dissector(data_handle,next_tvb, pinfo, tree);
break;
}
@@ -1137,7 +1137,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
/* assume vc muxed bridged ethernet */
proto_tree_add_text(tree, tvb, 0, 2, "Pad: 0x0000");
- next_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 2);
call_dissector(eth_handle, next_tvb, pinfo, tree);
}
else if (octet[2] == 0x03 && /* NLPID */
@@ -1193,7 +1193,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo->pseudo_header->atm.vci,
pinfo->pseudo_header->atm.aal2_cid);
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
call_dissector(fp_handle, next_tvb, pinfo, tree);
break;
@@ -1785,7 +1785,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
default:
- 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);
break;
}
diff --git a/epan/dissectors/packet-ayiya.c b/epan/dissectors/packet-ayiya.c
index 7a000c9a5f..2e669f0a9f 100644
--- a/epan/dissectors/packet-ayiya.c
+++ b/epan/dissectors/packet-ayiya.c
@@ -134,7 +134,7 @@ dissect_ayiya(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = ayiya_len;
switch (opcode) {
case OPCODE_FORWARD:
- payload = tvb_new_subset(tvb, offset, -1, -1);
+ payload = tvb_new_subset_remaining(tvb, offset);
dissector_try_port(ip_dissector_table, next_header, payload, pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-bacnet.c b/epan/dissectors/packet-bacnet.c
index c0f6c1a56a..13d7caefb8 100644
--- a/epan/dissectors/packet-bacnet.c
+++ b/epan/dissectors/packet-bacnet.c
@@ -367,7 +367,7 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
/* attention: doesnt work here because of if(tree) */
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
/* Performance Index (in I-Could-Be-Router-To-Network) */
if (bacnet_mesgtyp == BAC_NET_ICB_R) {
@@ -449,7 +449,7 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_len(ti, offset);
}
/* dissect BACnet APDU */
- next_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ next_tvb = tvb_new_subset_remaining(tvb,offset);
if (bacnet_control & BAC_CONTROL_NET) {
/* Unknown function - dissect the payload as data */
call_dissector(data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-bat.c b/epan/dissectors/packet-bat.c
index e9f3a468f4..5339c4f01e 100644
--- a/epan/dissectors/packet-bat.c
+++ b/epan/dissectors/packet-bat.c
@@ -268,7 +268,7 @@ static void dissect_bat_batman_v5(tvbuff_t *tvb, packet_info *pinfo, proto_tree
length_remaining = tvb_reported_length_remaining(tvb, offset);
if (length_remaining != 0) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
@@ -373,7 +373,7 @@ static void dissect_bat_gw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
length_remaining = tvb_reported_length_remaining(tvb, offset);
if (length_remaining != 0) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
@@ -489,7 +489,7 @@ static void dissect_bat_vis_v22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
length_remaining = tvb_reported_length_remaining(tvb, offset);
if (length_remaining != 0) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
@@ -622,7 +622,7 @@ static void dissect_bat_vis_v23(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
length_remaining = tvb_reported_length_remaining(tvb, offset);
if (length_remaining != 0) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(bat_follow_tap)) {
tap_queue_packet(bat_follow_tap, pinfo, next_tvb);
diff --git a/epan/dissectors/packet-bctp.c b/epan/dissectors/packet-bctp.c
index 6a66bc86ac..b93d55bed8 100644
--- a/epan/dissectors/packet-bctp.c
+++ b/epan/dissectors/packet-bctp.c
@@ -72,7 +72,7 @@ static const value_string bvei_vals[] = {
static void dissect_bctp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) {
proto_item* pi = proto_tree_add_item(tree, proto_bctp, tvb,0,2, FALSE);
proto_tree* pt = proto_item_add_subtree(pi,ett_bctp);
- tvbuff_t* sub_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ tvbuff_t* sub_tvb = tvb_new_subset_remaining(tvb, 2);
guint8 tpi = tvb_get_guint8(tvb,1) & 0x3f;
proto_tree_add_item(pt, hf_bctp_bvei, tvb,0,2, FALSE);
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 9202068fd2..18d6b6595f 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -590,7 +590,7 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if(oid == NULL ||
!dissector_try_string(ber_oid_dissector_table, oid, next_tvb, pinfo, tree)){
proto_item *item=NULL;
@@ -645,7 +645,7 @@ call_ber_syntax_callback(const char *syntax, tvbuff_t *tvb, int offset, packet_i
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if(syntax == NULL ||
!dissector_try_string(ber_syntax_dissector_table, syntax, next_tvb, pinfo, tree)){
proto_item *item=NULL;
@@ -1557,7 +1557,7 @@ ber_sequence_try_again:
* length) of if the tvb is short, then just
* give it all of the tvb and hope for the best.
*/
- /*next_tvb = tvb_new_subset(tvb, hoffset, -1, -1);*/
+ /*next_tvb = tvb_new_subset_remaining(tvb, hoffset);*/
/*} else {*/
/*}*/
@@ -1887,7 +1887,7 @@ ber_old_sequence_try_again:
* length) of if the tvb is short, then just
* give it all of the tvb and hope for the best.
*/
- /*next_tvb = tvb_new_subset(tvb, hoffset, -1, -1);*/
+ /*next_tvb = tvb_new_subset_remaining(tvb, hoffset);*/
/*} else {*/
/*}*/
@@ -2126,7 +2126,7 @@ printf("SET dissect_ber_set(%s) entered\n",name);
* length) of if the tvb is short, then just
* give it all of the tvb and hope for the best.
*/
- /*next_tvb = tvb_new_subset(tvb, hoffset, -1, -1);*/
+ /*next_tvb = tvb_new_subset_remaining(tvb, hoffset);*/
/*} else {*/
/*}*/
@@ -2390,7 +2390,7 @@ printf("SET dissect_old_ber_set(%s) entered\n",name);
* length) of if the tvb is short, then just
* give it all of the tvb and hope for the best.
*/
- /*next_tvb = tvb_new_subset(tvb, hoffset, -1, -1);*/
+ /*next_tvb = tvb_new_subset_remaining(tvb, hoffset);*/
/*} else {*/
/*}*/
@@ -3954,7 +3954,7 @@ int dissect_ber_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *p
if(len<=(guint32)tvb_length_remaining(tvb, offset)){
*out_tvb = tvb_new_subset(tvb, offset, len, len);
} else {
- *out_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ *out_tvb = tvb_new_subset_remaining(tvb, offset);
}
}
}
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
index 1f3d439946..e3b17a135f 100644
--- a/epan/dissectors/packet-bssgp.c
+++ b/epan/dissectors/packet-bssgp.c
@@ -1241,7 +1241,7 @@ bssgp_proto_handoff(bssgp_ie_t *ie, build_info_t *bi, int ie_start_offset, disse
tvbuff_t *next_tvb=NULL;
if(ie->value_length > 0)
- next_tvb = tvb_new_subset(bi->tvb, bi->offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(bi->tvb, bi->offset);
if (bi->bssgp_tree) {
bssgp_proto_tree_add_ie(ie, bi, ie_start_offset);
diff --git a/epan/dissectors/packet-capwap.c b/epan/dissectors/packet-capwap.c
index 3dcbb4d9c2..a0fb1b77ff 100644
--- a/epan/dissectors/packet-capwap.c
+++ b/epan/dissectors/packet-capwap.c
@@ -863,7 +863,7 @@ dissect_capwap_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += dissect_capwap_preamble(tvb, capwap_control_tree, offset, &type_header);
if (type_header == 1) {
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
call_dissector(dtls_handle, next_tvb, pinfo, tree);
return;
}
@@ -908,7 +908,7 @@ dissect_capwap_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += dissect_capwap_preamble(tvb, capwap_data_tree, offset, &type_header);
if (type_header == 1) {
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
call_dissector(dtls_handle, next_tvb, pinfo, tree);
return;
}
@@ -919,7 +919,7 @@ dissect_capwap_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* CAPWAP Data Payload */
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
if (payload_type == 0) {
/* IEEE 802.3 Frame */
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c
index 65538df130..07d08b3433 100644
--- a/epan/dissectors/packet-cdp.c
+++ b/epan/dissectors/packet-cdp.c
@@ -966,7 +966,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += length;
}
}
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
cdp_tree);
}
diff --git a/epan/dissectors/packet-chdlc.c b/epan/dissectors/packet-chdlc.c
index 6991f02cc0..1f3e31e1d9 100644
--- a/epan/dissectors/packet-chdlc.c
+++ b/epan/dissectors/packet-chdlc.c
@@ -140,9 +140,9 @@ chdlctype(guint16 chdlc_type, tvbuff_t *tvb, int offset_after_chdlctype,
/* There is a Padding Byte for CLNS protocols over Cisco HDLC */
proto_tree_add_text(fh_tree, tvb, offset_after_chdlctype, 1, "CLNS Padding: 0x%02x",
padbyte);
- next_tvb = tvb_new_subset(tvb, offset_after_chdlctype + 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset_after_chdlctype + 1);
} else {
- next_tvb = tvb_new_subset(tvb, offset_after_chdlctype, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset_after_chdlctype);
}
/* do lookup with the subdissector table */
@@ -322,7 +322,7 @@ dissect_slarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown packet type 0x%08X", code);
if (tree) {
proto_tree_add_uint(slarp_tree, hf_slarp_ptype, tvb, 0, 4, code);
- call_dissector(data_handle, tvb_new_subset(tvb, 4, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, 4), pinfo,
slarp_tree);
}
break;
diff --git a/epan/dissectors/packet-cisco-erspan.c b/epan/dissectors/packet-cisco-erspan.c
index 8e9878acce..ce940770e1 100644
--- a/epan/dissectors/packet-cisco-erspan.c
+++ b/epan/dissectors/packet-cisco-erspan.c
@@ -129,7 +129,7 @@ dissect_erspan(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
FALSE);
offset += 4;
- eth_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ eth_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ethnofcs_handle, eth_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index a57de95464..e4db23f3d0 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -230,7 +230,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cnf_proto_id,
"Inactive subset");
}
- next_tvb = tvb_new_subset(tvb, 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
if (call_dissector(ositp_inactive_handle, next_tvb, pinfo, tree) == 0)
call_dissector(data_handle,tvb, pinfo, tree);
return;
@@ -459,7 +459,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* First segment, or not segmented. Dissect what we have here. */
/* Get a tvbuff for the payload. */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/*
* If this is the first segment, but not the only segment,
@@ -480,7 +480,7 @@ static void dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* As we haven't reassembled anything, we haven't changed "pi", so
we don't have to restore it. */
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
tree);
pinfo->fragmented = save_fragmented;
return;
diff --git a/epan/dissectors/packet-cosine.c b/epan/dissectors/packet-cosine.c
index 40772fee77..da3ee3ce66 100644
--- a/epan/dissectors/packet-cosine.c
+++ b/epan/dissectors/packet-cosine.c
@@ -108,30 +108,30 @@ dissect_cosine(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (pseudo_header->cosine.encap) {
case COSINE_ENCAP_ETH:
- call_dissector(eth_withoutfcs_handle, tvb_new_subset(tvb, 0, -1, -1),
+ call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, 0),
pinfo, tree);
break;
case COSINE_ENCAP_ATM:
case COSINE_ENCAP_PPoATM:
- call_dissector(llc_handle, tvb_new_subset(tvb, 16, -1, -1),
+ call_dissector(llc_handle, tvb_new_subset_remaining(tvb, 16),
pinfo, tree);
break;
case COSINE_ENCAP_PPP:
- call_dissector(ppp_hdlc_handle, tvb_new_subset(tvb, 4, -1, -1),
+ call_dissector(ppp_hdlc_handle, tvb_new_subset_remaining(tvb, 4),
pinfo, tree);
break;
case COSINE_ENCAP_HDLC:
if (pseudo_header->cosine.direction == COSINE_DIR_TX) {
- call_dissector(chdlc_handle, tvb_new_subset(tvb, 2, -1, -1),
+ call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 2),
pinfo, tree);
} else if (pseudo_header->cosine.direction == COSINE_DIR_RX) {
- call_dissector(chdlc_handle, tvb_new_subset(tvb, 4, -1, -1),
+ call_dissector(chdlc_handle, tvb_new_subset_remaining(tvb, 4),
pinfo, tree);
}
break;
case COSINE_ENCAP_FR:
case COSINE_ENCAP_PPoFR:
- call_dissector(fr_handle, tvb_new_subset(tvb, 4, -1, -1),
+ call_dissector(fr_handle, tvb_new_subset_remaining(tvb, 4),
pinfo, tree);
break;
case COSINE_ENCAP_TEST:
diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c
index ca878d9269..b551832e06 100644
--- a/epan/dissectors/packet-dccp.c
+++ b/epan/dissectors/packet-dccp.c
@@ -210,7 +210,7 @@ decode_dccp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tre
tvbuff_t *next_tvb;
int low_port, high_port;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/* determine if this packet is part of a conversation and call dissector */
/* for the conversation if available */
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 66f0fd6b43..c5fb88d2e3 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -2969,7 +2969,7 @@ dissect_dcerpc_cn_stub (tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
if(tvb_length(tvb)==tvb_reported_length(tvb)){
if(tvb_length_remaining(tvb, offset+length)>8){
- auth_tvb = tvb_new_subset(tvb, offset+length+8, -1, -1);
+ auth_tvb = tvb_new_subset_remaining(tvb, offset+length+8);
}
}
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index 7cfec3a7e5..28d46c1411 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -523,7 +523,7 @@ dissect_pft(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
);
pinfo->fragmented = save_fragmented;
} else {
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
}
if(next_tvb) {
dissect_af(next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index f9d48d3040..a006bc3c85 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -587,7 +587,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
if (tree) {
call_dissector(data_handle,
- tvb_new_subset(tvb, DSI_BLOCKSIZ, -1, -1),
+ tvb_new_subset_remaining(tvb, DSI_BLOCKSIZ),
pinfo, dsi_tree);
}
break;
diff --git a/epan/dissectors/packet-dtpt.c b/epan/dissectors/packet-dtpt.c
index 96526b17c2..963727572b 100644
--- a/epan/dissectors/packet-dtpt.c
+++ b/epan/dissectors/packet-dtpt.c
@@ -426,7 +426,7 @@ dissect_dtpt_conversation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *next_tvb;
/* ... as data. */
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
next_tvb = tvb_new_subset(tvb, offset, rest_length, rest_length);
}
return tvb_reported_length(tvb);
diff --git a/epan/dissectors/packet-dua.c b/epan/dissectors/packet-dua.c
index 79c74f1b43..6ec4803272 100644
--- a/epan/dissectors/packet-dua.c
+++ b/epan/dissectors/packet-dua.c
@@ -680,7 +680,7 @@ dissect_dua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t *common_header_tvb, *parameters_tvb;
common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
- parameters_tvb = tvb_new_subset(message_tvb, PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, PARAMETERS_OFFSET);
dissect_common_header(common_header_tvb, pinfo, dua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, dua_tree);
}
diff --git a/epan/dissectors/packet-eapol.c b/epan/dissectors/packet-eapol.c
index e104c5f390..4648aa05d0 100644
--- a/epan/dissectors/packet-eapol.c
+++ b/epan/dissectors/packet-eapol.c
@@ -173,7 +173,7 @@ dissect_eapol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (eapol_type) {
case EAP_PACKET:
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(eap_handle, next_tvb, pinfo, eapol_tree);
break;
@@ -281,7 +281,7 @@ dissect_eapol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case EAPOL_ENCAP_ASF_ALERT: /* XXX - is this an SNMP trap? */
default:
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, eapol_tree);
break;
}
diff --git a/epan/dissectors/packet-egd.c b/epan/dissectors/packet-egd.c
index 7c7054309f..77457a740c 100644
--- a/epan/dissectors/packet-egd.c
+++ b/epan/dissectors/packet-egd.c
@@ -153,7 +153,7 @@ static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
data_length = tvb_length_remaining(tvb, offset);
if (data_length > 0)
{
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, egd_tree);
}
}
diff --git a/epan/dissectors/packet-ehs.c b/epan/dissectors/packet-ehs.c
index 6ec6a07171..e15fb90d23 100644
--- a/epan/dissectors/packet-ehs.c
+++ b/epan/dissectors/packet-ehs.c
@@ -1154,7 +1154,7 @@ dissect_ehs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case EHS_PROTOCOL__PDSS_PAYLOAD_CCSDS_PACKET:
case EHS_PROTOCOL__PDSS_CORE_CCSDS_PACKET:
case EHS_PROTOCOL__PDSS_UDSM:
- new_tvb = tvb_new_subset ( tvb, offset, -1, -1 );
+ new_tvb = tvb_new_subset_remaining ( tvb, offset);
call_dissector ( ccsds_handle, new_tvb, pinfo, ehs_tree );
/* bump the offset to the data zone area */
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index f62f78a504..c5cf8f19fa 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -178,7 +178,7 @@ dissect_eigrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if (opcode==EIGRP_SAP)
{
- call_dissector(ipxsap_handle, tvb_new_subset(tvb, EIGRP_HEADER_LENGTH, -1, -1), pinfo, eigrp_tree);
+ call_dissector(ipxsap_handle, tvb_new_subset_remaining(tvb, EIGRP_HEADER_LENGTH), pinfo, eigrp_tree);
return;
}
diff --git a/epan/dissectors/packet-enc.c b/epan/dissectors/packet-enc.c
index 4b54763238..0e81f32a12 100644
--- a/epan/dissectors/packet-enc.c
+++ b/epan/dissectors/packet-enc.c
@@ -145,7 +145,7 @@ dissect_enc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Set the tvbuff for the payload after the header */
- next_tvb = tvb_new_subset(tvb, ENC_HDRLEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, ENC_HDRLEN);
switch (ench.af) {
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index b9f980e7f0..f568796750 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -188,27 +188,27 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
switch(code) {
case UNRECOGNIZED_PARAMETER_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case UNRECONGNIZED_MESSAGE_CAUSE_CODE:
- message_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ message_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_enrp(message_tvb, NULL, cause_tree);
break;
case INVALID_VALUES:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case NON_UNIQUE_PE_IDENTIFIER:
break;
case POOLING_POLICY_INCONSISTENT_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case LACK_OF_RESOURCES_CAUSE_CODE:
break;
case INCONSISTENT_TRANSPORT_TYPE_CAUSE_CODE:
- parameter_tvb = tvb_new_subset(cause_tvb, CAUSE_INFO_OFFSET, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(cause_tvb, CAUSE_INFO_OFFSET);
dissect_parameter(parameter_tvb, cause_tree);
break;
case INCONSISTENT_DATA_CONTROL_CONFIGURATION_CAUSE_CODE:
@@ -290,7 +290,7 @@ dissect_dccp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(parameter_tree, hf_dccp_reserved, parameter_tvb, DCCP_RESERVED_OFFSET, DCCP_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_dccp_service_code, parameter_tvb, DCCP_SERVICE_CODE_OFFSET, DCCP_SERVICE_CODE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, DCCP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, DCCP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -316,7 +316,7 @@ dissect_sctp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(parameter_tree, hf_sctp_port, parameter_tvb, SCTP_PORT_OFFSET, SCTP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_transport_use, parameter_tvb, SCTP_TRANSPORT_USE_OFFSET, SCTP_TRANSPORT_USE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, SCTP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, SCTP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -334,7 +334,7 @@ dissect_tcp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
proto_tree_add_item(parameter_tree, hf_tcp_port, parameter_tvb, TCP_PORT_OFFSET, TCP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_transport_use, parameter_tvb, TCP_TRANSPORT_USE_OFFSET, TCP_TRANSPORT_USE_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, TCP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, TCP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -352,7 +352,7 @@ dissect_udp_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
proto_tree_add_item(parameter_tree, hf_udp_port, parameter_tvb, UDP_PORT_OFFSET, UDP_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_udp_reserved, parameter_tvb, UDP_RESERVED_OFFSET, UDP_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, UDP_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, UDP_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -370,7 +370,7 @@ dissect_udp_lite_transport_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
proto_tree_add_item(parameter_tree, hf_udp_lite_port, parameter_tvb, UDP_LITE_PORT_OFFSET, UDP_LITE_PORT_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(parameter_tree, hf_udp_lite_reserved, parameter_tvb, UDP_LITE_RESERVED_OFFSET, UDP_LITE_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, UDP_LITE_ADDRESS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, UDP_LITE_ADDRESS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -522,7 +522,7 @@ dissect_pool_element_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tr
pi = proto_tree_add_item(parameter_tree, hf_reg_life, parameter_tvb, REGISTRATION_LIFE_OFFSET, REGISTRATION_LIFE_LENGTH, NETWORK_BYTE_ORDER);
proto_item_append_text(pi, "ms");
- parameters_tvb = tvb_new_subset(parameter_tvb, USER_TRANSPORT_PARAMETER_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, USER_TRANSPORT_PARAMETER_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -537,7 +537,7 @@ dissect_server_information_parameter(tvbuff_t *parameter_tvb, proto_tree *parame
proto_tree_add_item(parameter_tree, hf_server_identifier, parameter_tvb, SERVER_ID_OFFSET, SERVER_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(parameter_tvb, SERVER_TRANSPORT_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, SERVER_TRANSPORT_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree);
}
@@ -548,7 +548,7 @@ dissect_operation_error_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter
{
tvbuff_t *error_causes_tvb;
- error_causes_tvb = tvb_new_subset(parameter_tvb, ERROR_CAUSES_OFFSET, -1,-1);
+ error_causes_tvb = tvb_new_subset_remaining(parameter_tvb, ERROR_CAUSES_OFFSET);
dissect_error_causes(error_causes_tvb, parameter_tree);
}
@@ -764,7 +764,7 @@ dissect_enrp_presence_message(tvbuff_t *message_tvb, proto_tree *message_tree, p
proto_tree_add_item(flags_tree, hf_reply_required_bit, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_sender_servers_id, message_tvb, SENDER_SERVERS_ID_OFFSET, SENDER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_receiver_servers_id, message_tvb, RECEIVER_SERVERS_ID_OFFSET, RECEIVER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, message_tree);
}
@@ -807,7 +807,7 @@ dissect_enrp_handle_table_response_message(tvbuff_t *message_tvb, proto_tree *me
proto_tree_add_item(flags_tree, hf_reject_bit, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_sender_servers_id, message_tvb, SENDER_SERVERS_ID_OFFSET, SENDER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_receiver_servers_id, message_tvb, RECEIVER_SERVERS_ID_OFFSET, RECEIVER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, message_tree);
}
@@ -840,7 +840,7 @@ dissect_enrp_handle_update_message(tvbuff_t *message_tvb, proto_tree *message_tr
proto_tree_add_item(message_tree, hf_receiver_servers_id, message_tvb, RECEIVER_SERVERS_ID_OFFSET, RECEIVER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_update_action, message_tvb, UPDATE_ACTION_OFFSET, UPDATE_ACTION_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_pmu_reserved, message_tvb, PNU_RESERVED_OFFSET, PNU_RESERVED_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, PNU_MESSAGE_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, PNU_MESSAGE_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, message_tree);
}
@@ -860,7 +860,7 @@ dissect_enrp_list_response_message(tvbuff_t *message_tvb, proto_tree *message_tr
proto_tree_add_item(flags_tree, hf_reject_bit, message_tvb, MESSAGE_FLAGS_OFFSET, MESSAGE_FLAGS_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_sender_servers_id, message_tvb, SENDER_SERVERS_ID_OFFSET, SENDER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_receiver_servers_id, message_tvb, RECEIVER_SERVERS_ID_OFFSET, RECEIVER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, message_tree);
}
@@ -901,7 +901,7 @@ dissect_enrp_error_message(tvbuff_t *message_tvb, proto_tree *message_tree, prot
proto_tree_add_item(message_tree, hf_sender_servers_id, message_tvb, SENDER_SERVERS_ID_OFFSET, SENDER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
proto_tree_add_item(message_tree, hf_receiver_servers_id, message_tvb, RECEIVER_SERVERS_ID_OFFSET, RECEIVER_SERVERS_ID_LENGTH, NETWORK_BYTE_ORDER);
- parameters_tvb = tvb_new_subset(message_tvb, MESSAGE_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, MESSAGE_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, message_tree);
}
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c
index c335481a8e..f1403e30ea 100644
--- a/epan/dissectors/packet-erf.c
+++ b/epan/dissectors/packet-erf.c
@@ -895,7 +895,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
pinfo->pseudo_header->atm.channel = (flags & 0x03);
- new_tvb = tvb_new_subset(tvb, ATM_HDR_LENGTH, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
/* Work around to have decoding working */
if (erf_rawcell_first) {
/* Treat this as a (short) ATM AAL5 PDU */
@@ -938,7 +938,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
pinfo->pseudo_header->atm.channel = (flags & 0x03);
- new_tvb = tvb_new_subset(tvb, ATM_HDR_LENGTH, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
/* Work around to have decoding working */
pinfo->pseudo_header->atm.aal = AAL_5;
switch (erf_aal5_type) {
@@ -976,7 +976,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
- new_tvb = tvb_new_subset(tvb, ATM_HDR_LENGTH, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
call_dissector(atm_untruncated_handle, new_tvb, pinfo, tree);
break;
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c
index 1f1ac9d273..de0ccee3ea 100644
--- a/epan/dissectors/packet-ethertype.c
+++ b/epan/dissectors/packet-ethertype.c
@@ -325,8 +325,8 @@ add_dix_trailer(packet_info *pinfo, proto_tree *fh_tree, int trailer_id,
/*
* Yes - create a tvbuff for the padding.
*/
- trailer_tvb = tvb_new_subset(tvb,
- offset_after_etype + length, -1, -1);
+ trailer_tvb = tvb_new_subset_remaining(tvb,
+ offset_after_etype + length);
} else {
/*
* No - don't bother showing the trailer.
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 981f77f4e4..88ed326998 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -1103,7 +1103,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
* sequence, is not the first frame, but has a seqcnt that is
* 0. This is a bogus frame, don't attempt to reassemble it.
*/
- next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, next_offset);
if (check_col (pinfo->cinfo, COL_INFO)) {
col_append_str (pinfo->cinfo, COL_INFO, " (Bogus Fragment)");
}
@@ -1138,7 +1138,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
tvb, offset+9, 1, 0);
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
- next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, next_offset);
call_dissector (data_handle, next_tvb, pinfo, tree);
return;
}
@@ -1149,7 +1149,7 @@ dissect_fc_helper (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean
tvb, offset+9, 1, 0);
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
- next_tvb = tvb_new_subset (tvb, next_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, next_offset);
}
if ((ftype != FC_FTYPE_LINKCTL) && (ftype != FC_FTYPE_BLS)) {
diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c
index 0b99688b21..195151006a 100644
--- a/epan/dissectors/packet-fcct.c
+++ b/epan/dissectors/packet-fcct.c
@@ -222,7 +222,7 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* We do not change the starting offset for the next protocol in the
* chain since the fc_ct header is common to the sub-protocols.
*/
- next_tvb = tvb_new_subset (tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 0);
if (!dissector_try_port (fcct_gserver_table, server, next_tvb, pinfo,
tree)) {
call_dissector (data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-fcip.c b/epan/dissectors/packet-fcip.c
index 8a22388913..63eb8130bf 100644
--- a/epan/dissectors/packet-fcip.c
+++ b/epan/dissectors/packet-fcip.c
@@ -492,7 +492,7 @@ dissect_fcip (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Special frame bit is not set */
- next_tvb = tvb_new_subset (tvb, FCIP_ENCAP_HEADER_LEN+4, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, FCIP_ENCAP_HEADER_LEN+4);
if (fc_handle) {
call_dissector (fc_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-fcsb3.c b/epan/dissectors/packet-fcsb3.c
index 4457ea4e99..8ebf393a11 100644
--- a/epan/dissectors/packet-fcsb3.c
+++ b/epan/dissectors/packet-fcsb3.c
@@ -882,8 +882,7 @@ static void dissect_fc_sbccs_dib_status_hdr (tvbuff_t *tvb, packet_info *pinfo,
proto_tree_add_item (tree, hf_sbccs_lrc, tvb, offset+12, 4, 0);
if (supp_status_cnt) {
- next_tvb = tvb_new_subset (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE);
call_dissector (data_handle, next_tvb, pinfo, tree);
}
}
@@ -1087,15 +1086,14 @@ static void dissect_fc_sbccs (tvbuff_t *tvb, packet_info *pinfo,
dissect_fc_sbccs_dib_link_hdr (tvb, pinfo, dib_tree, offset);
break;
default:
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
call_dissector (data_handle, next_tvb, pinfo, dib_tree);
break;
}
if ((get_fc_sbccs_iu_type (tvb, 0) != FC_SBCCS_IU_CTL) &&
(get_fc_sbccs_iu_type (tvb, 0) != FC_SBCCS_IU_CMD_LINK_CTL)) {
- next_tvb = tvb_new_subset (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset+FC_SBCCS_DIB_LRC_HDR_SIZE);
call_dissector (data_handle, next_tvb, pinfo, tree);
}
pinfo->private_data = pd_save;
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index daa2f025c9..89d1846671 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -1913,7 +1913,7 @@ dissect_fcswils (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector (fcsp_handle, tvb, pinfo, swils_tree);
} else {
/* data dissector */
- next_tvb = tvb_new_subset (tvb, offset+4, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset+4);
call_dissector (data_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c
index 9cf32e49bd..e3ec43b038 100644
--- a/epan/dissectors/packet-fddi.c
+++ b/epan/dissectors/packet-fddi.c
@@ -367,7 +367,7 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
PROTO_ITEM_SET_HIDDEN(hidden_item);
}
- next_tvb = tvb_new_subset(tvb, FDDI_HEADER_SIZE + FDDI_PADDING, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, FDDI_HEADER_SIZE + FDDI_PADDING);
tap_queue_packet(fddi_tap, pinfo, fddihdr);
diff --git a/epan/dissectors/packet-fefd.c b/epan/dissectors/packet-fefd.c
index a96b809fbc..dc3e8f49e8 100644
--- a/epan/dissectors/packet-fefd.c
+++ b/epan/dissectors/packet-fefd.c
@@ -234,7 +234,7 @@ dissect_fefd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, fefd_tree);
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, fefd_tree);
}
void
diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c
index 95f1437d0a..a42d5b2690 100644
--- a/epan/dissectors/packet-fr.c
+++ b/epan/dissectors/packet-fr.c
@@ -600,7 +600,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
hf_fr_control, ett_fr_control,
&fr_cf_items, &fr_cf_items_ext,
NULL, NULL, is_response, TRUE, TRUE);
- dissect_lapf(tvb_new_subset(tvb,offset,-1,-1),pinfo,tree);
+ dissect_lapf(tvb_new_subset_remaining(tvb,offset),pinfo,tree);
return;
}
if (fr_ctrl == (XDLC_U|XDLC_XID)) {
@@ -608,7 +608,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
hf_fr_control, ett_fr_control,
&fr_cf_items, &fr_cf_items_ext,
NULL, NULL, is_response, TRUE, TRUE);
- dissect_fr_xid(tvb_new_subset(tvb,offset,-1,-1),pinfo,tree);
+ dissect_fr_xid(tvb_new_subset_remaining(tvb,offset),pinfo,tree);
return;
}
@@ -627,7 +627,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case GPRS_NS:
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (addr != 0)
call_dissector(gprs_ns_handle, next_tvb, pinfo, tree);
else
@@ -635,7 +635,7 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case RAW_ETHER:
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (addr != 0)
call_dissector(eth_withfcs_handle, next_tvb, pinfo, tree);
else
@@ -738,7 +738,7 @@ static void dissect_fr_nlpid(tvbuff_t *tvb, int offset, packet_info *pinfo,
*
* Either that, or it's Q.933 iff the DLCI is 0.
*/
- next_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ next_tvb = tvb_new_subset_remaining(tvb,offset);
if (dissector_try_port(osinl_subdissector_table, fr_nlpid, next_tvb,
pinfo, tree) ||
dissector_try_port(fr_osinl_subdissector_table, fr_nlpid, next_tvb,
@@ -783,7 +783,7 @@ static void dissect_fr_nlpid(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Include the NLPID in the top-level protocol tree item. */
proto_item_set_end(ti, tvb, offset);
}
- next_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ next_tvb = tvb_new_subset_remaining(tvb,offset);
if (!dissector_try_port(fr_subdissector_table,fr_nlpid,
next_tvb, pinfo, tree))
call_dissector(data_handle,next_tvb, pinfo, tree);
@@ -794,12 +794,12 @@ static void dissect_fr_nlpid(tvbuff_t *tvb, int offset, packet_info *pinfo,
static void dissect_lapf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_text(tree, tvb, 0, 0, "Frame relay lapf not yet implemented");
- call_dissector(data_handle,tvb_new_subset(tvb,0,-1,-1),pinfo,tree);
+ call_dissector(data_handle,tvb_new_subset_remaining(tvb,0),pinfo,tree);
}
static void dissect_fr_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_text(tree, tvb, 0, 0, "Frame relay xid not yet implemented");
- call_dissector(data_handle,tvb_new_subset(tvb,0,-1,-1),pinfo,tree);
+ call_dissector(data_handle,tvb_new_subset_remaining(tvb,0),pinfo,tree);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 96936260b2..0f1514cf46 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -3845,7 +3845,7 @@ static void dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
header.exception_id = NULL;
giop_header_tvb = tvb_new_subset (tvb, 0, GIOP_HEADER_SIZE, -1);
- payload_tvb = tvb_new_subset (tvb, GIOP_HEADER_SIZE, -1, -1);
+ payload_tvb = tvb_new_subset_remaining (tvb, GIOP_HEADER_SIZE);
/*
* because I have added extra elements in MessageHeader struct
diff --git a/epan/dissectors/packet-gmrp.c b/epan/dissectors/packet-gmrp.c
index 45d09bf4b4..7b58d445f2 100644
--- a/epan/dissectors/packet-gmrp.c
+++ b/epan/dissectors/packet-gmrp.c
@@ -180,7 +180,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -199,7 +199,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ( (octet != GMRP_ATTRIBUTE_TYPE_GROUP_MEMBERSHIP) && (octet != GMRP_ATTRIBUTE_TYPE_SERVICE_REQUIREMENT) )
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, offset), pinfo,
tree);
return;
}
@@ -234,7 +234,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -267,7 +267,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (octet != GMRP_LENGTH_LEAVEALL)
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -281,7 +281,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ( (octet != GMRP_GROUP_MEMBERSHIP_NON_LEAVEALL) && (octet != GMRP_SERVICE_REQUIREMENT_NON_LEAVEALL) )
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -310,7 +310,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -319,7 +319,7 @@ dissect_gmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
diff --git a/epan/dissectors/packet-gprs-ns.c b/epan/dissectors/packet-gprs-ns.c
index 2e960f20f1..f068a8ae3f 100644
--- a/epan/dissectors/packet-gprs-ns.c
+++ b/epan/dissectors/packet-gprs-ns.c
@@ -304,7 +304,7 @@ dissect_gprs_ns(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
proto_tree_add_uint(gprs_ns_tree, hf_gprs_ns_bvci, tvb, offset, 2, bvc);
offset=offset+2;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(bssgp_handle, next_tvb, pinfo, tree);
break;
diff --git a/epan/dissectors/packet-gre.c b/epan/dissectors/packet-gre.c
index 17db26a6f1..9c6d3eff5b 100644
--- a/epan/dissectors/packet-gre.c
+++ b/epan/dissectors/packet-gre.c
@@ -433,7 +433,7 @@ dissect_gre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_reported_length_remaining(tvb, offset) <= 0)
return; /* no payload */
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!dissector_try_port(gre_dissector_table, type, next_tvb, pinfo, tree))
call_dissector(data_handle,next_tvb, pinfo, gre_tree);
}
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 8a0a373788..6ff0574c02 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -2971,12 +2971,12 @@ if (!actx->value_ptr)
if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
/* Strip off discrimination and length */
proto_tree_add_item(subtree, hf_gsm_map_len, actx->value_ptr, 1,1,FALSE);
- next_tvb = tvb_new_subset(actx->value_ptr, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 2);
dissect_bssmap(next_tvb, actx->pinfo, subtree);
}else if(octet==1){
proto_tree_add_item(subtree, hf_gsm_map_dlci, actx->value_ptr, 1,1,FALSE);
proto_tree_add_item(subtree, hf_gsm_map_len, actx->value_ptr, 2,1,FALSE);
- next_tvb = tvb_new_subset(actx->value_ptr, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 3);
call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
}
break;
@@ -2985,7 +2985,7 @@ if (!actx->value_ptr)
octet = tvb_get_guint8(actx->value_ptr,0);
length = tvb_get_guint8(actx->value_ptr,1);
if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
- next_tvb = tvb_new_subset(actx->value_ptr, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 2);
dissect_bssmap(next_tvb, actx->pinfo, subtree);
}
break;
@@ -3084,13 +3084,13 @@ dissect_gsm_map_LongSignalInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
/* Strip off discrimination and length */
length = tvb_get_guint8(parameter_tvb,0);
proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 1,1,FALSE);
- next_tvb = tvb_new_subset(parameter_tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(parameter_tvb, 2);
dissect_bssmap(next_tvb, actx->pinfo, subtree);
}else if(octet==1){
proto_tree_add_item(subtree, hf_gsm_map_dlci, parameter_tvb, 1,1,FALSE);
proto_tree_add_item(subtree, hf_gsm_map_len, parameter_tvb, 2,1,FALSE);
length = tvb_get_guint8(parameter_tvb,0);
- next_tvb = tvb_new_subset(parameter_tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(parameter_tvb, 3);
call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
}
break;
@@ -14733,12 +14733,12 @@ if (!actx->value_ptr)
if ( octet == 0) {/* DISCRIMINATION TS 48 006(GSM 08.06 version 5.3.0) */
/* Strip off discrimination and length */
proto_tree_add_item(subtree, hf_gsm_map_len, actx->value_ptr, 1,1,FALSE);
- next_tvb = tvb_new_subset(actx->value_ptr, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 2);
dissect_bssmap(next_tvb, actx->pinfo, subtree);
}else if(octet==1){
proto_tree_add_item(subtree, hf_gsm_map_dlci, actx->value_ptr, 1,1,FALSE);
proto_tree_add_item(subtree, hf_gsm_map_len, actx->value_ptr, 2,1,FALSE);
- next_tvb = tvb_new_subset(actx->value_ptr, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 3);
call_dissector(dtap_handle, next_tvb, actx->pinfo, subtree);
}
break;
@@ -14747,7 +14747,7 @@ if (!actx->value_ptr)
octet = tvb_get_guint8(actx->value_ptr,0);
length = tvb_get_guint8(actx->value_ptr,1);
if ( octet == 0) {/* DISCRIMINATION TS 48 006 */
- next_tvb = tvb_new_subset(actx->value_ptr, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(actx->value_ptr, 2);
dissect_bssmap(next_tvb, actx->pinfo, subtree);
}
break;
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index d03f318813..5c3974f6b1 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -2630,7 +2630,7 @@ dis_field_ud(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint32 length, gb
}
} /* Else: not fragmented */
if (! sm_tvb) /* One single Short Message, or not reassembled */
- sm_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ sm_tvb = tvb_new_subset_remaining (tvb, offset);
if (compressed)
{
diff --git a/epan/dissectors/packet-gsm_sms_ud.c b/epan/dissectors/packet-gsm_sms_ud.c
index 41fe1feaa8..f0d1bca320 100644
--- a/epan/dissectors/packet-gsm_sms_ud.c
+++ b/epan/dissectors/packet-gsm_sms_ud.c
@@ -374,7 +374,7 @@ parse_gsm_sms_ud_message(proto_tree *sm_tree, tvbuff_t *tvb, packet_info *pinfo,
} /* Else: not fragmented */
if (! sm_tvb) /* One single Short Message, or not reassembled */
- sm_tvb = tvb_new_subset (tvb, i, -1, -1);
+ sm_tvb = tvb_new_subset_remaining (tvb, i);
/* Try calling a subdissector */
if (sm_tvb) {
if ((reassembled && pinfo->fd->num == reassembled_in)
diff --git a/epan/dissectors/packet-gssapi.c b/epan/dissectors/packet-gssapi.c
index cd9a6ff3e7..0d837201ef 100644
--- a/epan/dissectors/packet-gssapi.c
+++ b/epan/dissectors/packet-gssapi.c
@@ -309,7 +309,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
for anything that microsoft calls 'Negotiate' or GSS-SPNEGO */
if ((tvb_length_remaining(gss_tvb, start_offset)>7) && (tvb_strneql(gss_tvb, start_offset, "NTLMSSP", 7) == 0)) {
return_offset = call_dissector(ntlmssp_handle,
- tvb_new_subset(gss_tvb, start_offset, -1, -1),
+ tvb_new_subset_remaining(gss_tvb, start_offset),
pinfo, subtree);
goto done;
}
@@ -319,7 +319,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
((tvb_memeql(gss_tvb, start_offset, "\04\x04", 2) == 0) ||
(tvb_memeql(gss_tvb, start_offset, "\05\x04", 2) == 0))) {
return_offset = call_dissector(spnego_krb5_wrap_handle,
- tvb_new_subset(gss_tvb, start_offset, -1, -1),
+ tvb_new_subset_remaining(gss_tvb, start_offset),
pinfo, subtree);
goto done;
}
@@ -362,7 +362,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else {
tvbuff_t *oid_tvb_local;
- oid_tvb_local = tvb_new_subset(gss_tvb, start_offset, -1, -1);
+ oid_tvb_local = tvb_new_subset_remaining(gss_tvb, start_offset);
if (is_verifier)
handle = oidvalue->wrap_handle;
else
@@ -444,7 +444,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (is_verifier) {
handle = oidvalue->wrap_handle;
if (handle != NULL) {
- oid_tvb = tvb_new_subset(gss_tvb, offset, -1, -1);
+ oid_tvb = tvb_new_subset_remaining(gss_tvb, offset);
len = call_dissector(handle, oid_tvb, pinfo,
subtree);
if (len == 0)
@@ -459,7 +459,7 @@ dissect_gssapi_work(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} else {
handle = oidvalue->handle;
if (handle != NULL) {
- oid_tvb = tvb_new_subset(gss_tvb, offset, -1, -1);
+ oid_tvb = tvb_new_subset_remaining(gss_tvb, offset);
len = call_dissector(handle, oid_tvb, pinfo,
subtree);
if (len == 0)
@@ -563,7 +563,7 @@ static int wrap_dissect_gssapi(tvbuff_t *tvb, int offset,
{
tvbuff_t *auth_tvb;
- auth_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ auth_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_gssapi(auth_tvb, pinfo, tree);
@@ -576,7 +576,7 @@ int wrap_dissect_gssapi_verf(tvbuff_t *tvb, int offset,
{
tvbuff_t *auth_tvb;
- auth_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ auth_tvb = tvb_new_subset_remaining(tvb, offset);
return dissect_gssapi_verf(auth_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c
index f3952bf188..4146539adc 100644
--- a/epan/dissectors/packet-gtp.c
+++ b/epan/dissectors/packet-gtp.c
@@ -5975,7 +5975,7 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info *
offset++;
if (sndcpxid_handle) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(sndcpxid_handle, next_tvb, pinfo, tree);
} else
proto_tree_add_text(tree, tvb, offset, 0, "Data");
@@ -6159,7 +6159,7 @@ static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo _
proto_tree_add_text(ext_tree, tvb, offset + 5, 2, "Data record format version: %u", format_ver);
if (gtpcdr_handle) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(gtpcdr_handle, next_tvb, pinfo, tree);
} else
proto_tree_add_text(tree, tvb, offset, 0, "Data");
@@ -6563,12 +6563,12 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* 0x4f is excluded because PPP protocol type "IPv6 header compression"
* with protocol field compression is more likely than a plain IPv4 packet with 60 octet header size */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ip_handle, next_tvb, pinfo, tree);
} else if ((sub_proto & 0xf0) == 0x60) {
/* this is most likely an IPv6 packet */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ipv6_handle, next_tvb, pinfo, tree);
} else {
/* this seems to be a PPP packet */
@@ -6581,7 +6581,7 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
acfield_len = 2;
}
- next_tvb = tvb_new_subset(tvb, offset + acfield_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
call_dissector(ppp_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-gvrp.c b/epan/dissectors/packet-gvrp.c
index cc744a7960..d04fc9a3a6 100644
--- a/epan/dissectors/packet-gvrp.c
+++ b/epan/dissectors/packet-gvrp.c
@@ -164,7 +164,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
}
@@ -181,7 +181,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* GVRP only supports one attribute type. */
if (octet != GVRP_ATTRIBUTE_TYPE)
{
- call_dissector(data_handle, tvb_new_subset(tvb, offset,-1, -1),
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return;
}
@@ -216,7 +216,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
}
@@ -248,7 +248,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (octet != GVRP_LENGTH_LEAVEALL)
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, offset), pinfo,
tree);
return;
}
@@ -262,7 +262,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (octet != GVRP_LENGTH_NON_LEAVEALL)
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),pinfo,
+ tvb_new_subset_remaining(tvb, offset),pinfo,
tree);
return;
}
@@ -277,7 +277,7 @@ dissect_gvrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
}
diff --git a/epan/dissectors/packet-hci_h1.c b/epan/dissectors/packet-hci_h1.c
index 73b92d1f2e..6fa98c6b09 100644
--- a/epan/dissectors/packet-hci_h1.c
+++ b/epan/dissectors/packet-hci_h1.c
@@ -104,7 +104,7 @@ dissect_hci_h1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti=proto_tree_add_int(hci_h1_tree, hf_hci_h1_direction, tvb, 0, 0, pinfo->p2p_dir);
PROTO_ITEM_SET_GENERATED(ti);
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
if(!dissector_try_port(hci_h1_table, type, next_tvb, pinfo, tree)) {
call_dissector(data_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-hci_h4.c b/epan/dissectors/packet-hci_h4.c
index 3a409a6a94..96cad74b4a 100644
--- a/epan/dissectors/packet-hci_h4.c
+++ b/epan/dissectors/packet-hci_h4.c
@@ -84,7 +84,7 @@ dissect_hci_h4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(hci_h4_tree, hf_hci_h4_type,
tvb, 0, 1, TRUE);
- next_tvb = tvb_new_subset(tvb, 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
if(!dissector_try_port(hci_h4_table, type, next_tvb, pinfo, tree)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
pinfo->p2p_dir==P2P_DIR_SENT ? "Sent" : "Rcvd",
diff --git a/epan/dissectors/packet-hip.c b/epan/dissectors/packet-hip.c
index 2f06c173d6..0d2b27b794 100644
--- a/epan/dissectors/packet-hip.c
+++ b/epan/dissectors/packet-hip.c
@@ -553,7 +553,7 @@ dissect_hip_in_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nullbytes = tvb_get_ntohl(tvb, 0);
if (nullbytes == 0)
{
- tvbuff_t *newtvb = tvb_new_subset(tvb, 4, -1, -1);
+ tvbuff_t *newtvb = tvb_new_subset_remaining(tvb, 4);
dissect_hip(newtvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-hpext.c b/epan/dissectors/packet-hpext.c
index c5bf4760c5..259fae689f 100644
--- a/epan/dissectors/packet-hpext.c
+++ b/epan/dissectors/packet-hpext.c
@@ -83,7 +83,7 @@ dissect_hpext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(sxsap, xsap_vals, "%04x"));
if (tvb_length_remaining(tvb, 7) > 0) {
- next_tvb = tvb_new_subset(tvb, 7, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 7);
if (!dissector_try_port(subdissector_table,
dxsap, next_tvb, pinfo, tree)) {
call_dissector(data_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-hsrp.c b/epan/dissectors/packet-hsrp.c
index 7d6110b58e..56f4e65c2f 100644
--- a/epan/dissectors/packet-hsrp.c
+++ b/epan/dissectors/packet-hsrp.c
@@ -428,7 +428,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(hsrp_tree, hf_hsrp_adv_reserved2, tvb, offset, 4, FALSE);
offset += 4;
} else {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, hsrp_tree);
}
}
@@ -516,7 +516,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(group_state_tlv, hf_hsrp2_virt_ip_addr_v6, tvb, offset, 16, FALSE);
} else {
/* Unknown protocol */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, hsrp_tree);
break;
}
@@ -593,7 +593,7 @@ dissect_hsrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
/* Undefined TLV */
if (tree) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, hsrp_tree);
}
break;
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c
index bceb3136fa..46f71140c5 100644
--- a/epan/dissectors/packet-iax2.c
+++ b/epan/dissectors/packet-iax2.c
@@ -2029,7 +2029,7 @@ static void dissect_payload(tvbuff_t *tvb, guint32 offset,
return;
}
- sub_tvb = tvb_new_subset(tvb, offset, -1, -1 );
+ sub_tvb = tvb_new_subset_remaining(tvb, offset);
/* XXX shouldn't pass through out-of-order packets. */
diff --git a/epan/dissectors/packet-icap.c b/epan/dissectors/packet-icap.c
index d777ce94ac..1a7b61eea3 100644
--- a/epan/dissectors/packet-icap.c
+++ b/epan/dissectors/packet-icap.c
@@ -263,7 +263,7 @@ is_icap_header:
datalen = tvb_length_remaining(tvb, offset);
if (datalen > 0) {
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, icap_tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, icap_tree);
}
}
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index 2dd7733e73..5763f58899 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -833,7 +833,7 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Decode the IP header and first 64 bits of data from the
original datagram. */
- next_tvb = tvb_new_subset(tvb, 8, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 8);
/* There is a collision between RFC 1812 and draft-ietf-mpls-icmp-02.
We don't know how to decode the 128th and following bytes of the ICMP payload.
@@ -863,7 +863,7 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case ICMP_ECHOREPLY:
case ICMP_ECHO:
- call_dissector(data_handle, tvb_new_subset(tvb, 8, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, 8), pinfo,
icmp_tree);
break;
@@ -881,7 +881,7 @@ dissect_icmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_mip_extensions(tvb, 8 + i*8, icmp_tree);
}
} else
- call_dissector(data_handle, tvb_new_subset(tvb, 8, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, 8), pinfo,
icmp_tree);
break;
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 39e49322bd..94d26b0c85 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -337,7 +337,7 @@ dissect_contained_icmpv6(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
save_in_error_pkt = pinfo->in_error_pkt;
pinfo->in_error_pkt = TRUE;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/* tiny sanity check */
if ((tvb_get_guint8(tvb, offset) & 0xf0) == 0x60) {
@@ -1251,7 +1251,7 @@ dissect_nodeinfo(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree
nodata:;
/* the rest of data */
- call_dissector(data_handle,tvb_new_subset(tvb, offset + off, -1, -1), pinfo, tree);
+ call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset + off), pinfo, tree);
}
#define RR_SIZE 16
@@ -1306,7 +1306,7 @@ dissect_rrenum(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(tree, tvb,
offset + offsetof(struct icmp6_router_renum, rr_maxdelay), 2,
"Max delay: 0x%04x", pntohs(&rr->rr_maxdelay));
- call_dissector(data_handle,tvb_new_subset(tvb, offset + RR_SIZE, -1, -1), pinfo, tree); /*XXX*/
+ call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset + RR_SIZE), pinfo, tree); /*XXX*/
if (rr->rr_code == ICMP6_ROUTER_RENUMBERING_COMMAND) {
off = offset + RR_SIZE;
diff --git a/epan/dissectors/packet-idp.c b/epan/dissectors/packet-idp.c
index a004e34646..ea60b66065 100644
--- a/epan/dissectors/packet-idp.c
+++ b/epan/dissectors/packet-idp.c
@@ -123,7 +123,7 @@ dissect_idp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->srcport);
/* Make the next tvbuff */
- next_tvb = tvb_new_subset(tvb, IDP_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, IDP_HEADER_LEN);
/*
* Hand off to the dissector for the packet type.
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 89758a5f8f..f5ee6d6319 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -7487,7 +7487,7 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
encap_type = ENCAP_IPX;
else if (octet1 == 0x00 && octet2 == 0x00) {
proto_tree_add_text(tree, next_tvb, 0, 2, "Mysterious OLPC stuff");
- next_tvb = tvb_new_subset (next_tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining (next_tvb, 2);
}
}
}
@@ -7840,7 +7840,7 @@ dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
VALFIELD_PRISM(frmlen, "Frame Length");
/* dissect the 802.11 header next */
- next_tvb = tvb_new_subset(tvb, sizeof hdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, sizeof hdr);
call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
}
@@ -8285,7 +8285,7 @@ dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
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);
}
diff --git a/epan/dissectors/packet-ieee8021ah.c b/epan/dissectors/packet-ieee8021ah.c
index 9574667a54..8a64c26638 100644
--- a/epan/dissectors/packet-ieee8021ah.c
+++ b/epan/dissectors/packet-ieee8021ah.c
@@ -157,7 +157,7 @@ dissect_ieee8021ad(tvbuff_t *tvb, packet_info *pinfo,
proto_item_set_text(ieee8021ad_tag_tree, "B-Tag, B-VID: %d", tci & 0x0FFF);
}
- next_tvb = tvb_new_subset(tvb, IEEE8021AD_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, IEEE8021AD_LEN);
if (ptree) {
/* add bvid to label */
diff --git a/epan/dissectors/packet-ieee8023.c b/epan/dissectors/packet-ieee8023.c
index aec6252520..142dcf18f2 100644
--- a/epan/dissectors/packet-ieee8023.c
+++ b/epan/dissectors/packet-ieee8023.c
@@ -76,7 +76,7 @@ dissect_802_3(volatile int length, gboolean is_802_2, tvbuff_t *tvb,
captured_length = length;
next_tvb = tvb_new_subset(tvb, offset_after_length, captured_length, length);
TRY {
- trailer_tvb = tvb_new_subset(tvb, offset_after_length + length, -1, -1);
+ trailer_tvb = tvb_new_subset_remaining(tvb, offset_after_length + length);
}
CATCH2(BoundsError, ReportedBoundsError) {
/* The packet has exactly "length" bytes worth of captured data
diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c
index 11d8a9b576..440f2588c4 100644
--- a/epan/dissectors/packet-ieee802a.c
+++ b/epan/dissectors/packet-ieee802a.c
@@ -134,7 +134,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tree)
proto_tree_add_uint(ieee802a_tree, hf, tvb, offset+3, 2, etype);
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
if (subdissector_table != NULL) {
/* do lookup with the subdissector table */
if (dissector_try_port(subdissector_table, etype, next_tvb,
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c
index 915f0031a6..113bba29a3 100644
--- a/epan/dissectors/packet-imf.c
+++ b/epan/dissectors/packet-imf.c
@@ -601,7 +601,7 @@ static void dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pd_save = pinfo->private_data;
pinfo->private_data = parameters;
- next_tvb = tvb_new_subset(tvb, end_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, end_offset);
dissected = dissector_try_string(media_type_dissector_table, content_type_str, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index 3a130351a6..0961df6cdc 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1618,7 +1618,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* First fragment, or not fragmented. Dissect what we have here. */
/* Get a tvbuff for the payload. */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/*
* If this is the first fragment, but not the only fragment,
@@ -1641,7 +1641,7 @@ dissect_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
ipfd_head->reassembled_in);
}
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
parent_tree);
pinfo->fragmented = save_fragmented;
return;
diff --git a/epan/dissectors/packet-ipars.c b/epan/dissectors/packet-ipars.c
index 75d2cba26d..3f9ad2907f 100644
--- a/epan/dissectors/packet-ipars.c
+++ b/epan/dissectors/packet-ipars.c
@@ -160,7 +160,7 @@ dissect_ipars(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
ia = tvb_get_guint8(tvb, 5) & 0x3f;
proto_tree_add_protocol_format(ipars_tree, proto_ipars, tvb, 5, 1, "Good BCC");
} else {
- next_tvb = tvb_new_subset(tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 3);
proto_tree_add_protocol_format(ipars_tree, proto_ipars, next_tvb,
0,
bytes, "Data (%d byte%s)", bytes,
diff --git a/epan/dissectors/packet-ipfc.c b/epan/dissectors/packet-ipfc.c
index 8e133599f0..06b425cd21 100644
--- a/epan/dissectors/packet-ipfc.c
+++ b/epan/dissectors/packet-ipfc.c
@@ -88,7 +88,7 @@ dissect_ipfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
fcwwn_to_str (tvb_get_ptr (tvb, offset+8, 8)));
}
- next_tvb = tvb_new_subset (tvb, 16, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 16);
call_dissector(llc_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-ipp.c b/epan/dissectors/packet-ipp.c
index 35a39b63f9..1634b83304 100644
--- a/epan/dissectors/packet-ipp.c
+++ b/epan/dissectors/packet-ipp.c
@@ -252,7 +252,7 @@ dissect_ipp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_offset_exists(tvb, offset)) {
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, offset), pinfo,
ipp_tree);
}
}
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 081a05830e..ce40819026 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -1383,7 +1383,7 @@ dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int advance;
advance = dissect_ah_header(tvb, pinfo, tree, &nxt, &next_tree);
- next_tvb = tvb_new_subset(tvb, advance, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, advance);
if (g_ah_payload_in_subtree) {
col_set_writable(pinfo->cinfo, FALSE);
diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c
index 80d4ad8bdb..0db45678ce 100644
--- a/epan/dissectors/packet-ipv6.c
+++ b/epan/dissectors/packet-ipv6.c
@@ -1429,7 +1429,7 @@ again:
case IP_PROTO_AH:
ah = TRUE;
- advance = dissect_ah_header(tvb_new_subset(tvb, offset, -1, -1),
+ advance = dissect_ah_header(tvb_new_subset_remaining(tvb, offset),
pinfo, ipv6_tree, NULL, NULL);
nxt = tvb_get_guint8(tvb, offset);
poffset = offset;
@@ -1489,13 +1489,13 @@ again:
/* Not the first fragment, or the first when we are reassembling and there are more. */
/* Don't dissect it; just show this as a fragment. */
/* COL_INFO was filled in by "dissect_frag6()" */
- 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);
return;
} else {
/* First fragment, not fragmented, or already reassembled. Dissect what we have here. */
/* Get a tvbuff for the payload. */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/*
* If this is the first fragment, but not the only fragment,
diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c
index 53ad6d6b61..142cad82cb 100644
--- a/epan/dissectors/packet-ipx.c
+++ b/epan/dissectors/packet-ipx.c
@@ -353,7 +353,7 @@ dissect_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Make the next tvbuff */
- next_tvb = tvb_new_subset(tvb, IPX_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, IPX_HEADER_LEN);
/*
* Let the subdissector know what type of IPX packet this is.
@@ -815,7 +815,7 @@ dissect_spx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pd_save = pinfo->private_data;
pinfo->private_data = &spx_info;
- next_tvb = tvb_new_subset(tvb, SPX_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, SPX_HEADER_LEN);
if (dissector_try_port(spx_socket_dissector_table, low_socket,
next_tvb, pinfo, tree))
{
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c
index d403c58893..745a6b746d 100644
--- a/epan/dissectors/packet-isl.c
+++ b/epan/dissectors/packet-isl.c
@@ -197,7 +197,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
TRY {
payload_tvb = tvb_new_subset(tvb, 14, length, length);
- trailer_tvb = tvb_new_subset(tvb, 14 + length, -1, -1);
+ trailer_tvb = tvb_new_subset_remaining(tvb, 14 + length);
}
CATCH2(BoundsError, ReportedBoundsError) {
/* Either:
@@ -225,7 +225,7 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
/* The length field is 0; make it the length remaining in the packet
after the first 14 bytes. */
length = tvb_reported_length_remaining(tvb, 14);
- payload_tvb = tvb_new_subset(tvb, 14, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, 14);
trailer_tvb = NULL;
}
@@ -314,12 +314,12 @@ dissect_isl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int fcs_len)
proto_tree_add_item(fh_tree, hf_isl_fcs_not_incl, payload_tvb, 16, 1, FALSE);
proto_tree_add_item(fh_tree, hf_isl_esize, payload_tvb, 16, 1, FALSE);
}
- next_tvb = tvb_new_subset(payload_tvb, 17, -1, -1);
+ next_tvb = tvb_new_subset_remaining(payload_tvb, 17);
call_dissector(tr_handle, next_tvb, pinfo, tree);
break;
default:
- next_tvb = tvb_new_subset(payload_tvb, 12, -1, -1);
+ next_tvb = tvb_new_subset_remaining(payload_tvb, 12);
call_dissector(data_handle, next_tvb, pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c
index 0b1c19ee31..7f8e063e57 100644
--- a/epan/dissectors/packet-isup.c
+++ b/epan/dissectors/packet-isup.c
@@ -3228,7 +3228,7 @@ dissect_bat_ase_Encapsulated_Application_Information(tvbuff_t *parameter_tvb, pa
if(sdp_length > tvb_length_remaining(parameter_tvb,offset)){
/* If this is a segmented message we may not have all the data */
- next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(parameter_tvb, offset);
}else{
next_tvb = tvb_new_subset(parameter_tvb, offset, sdp_length, sdp_length);
}
@@ -3489,7 +3489,7 @@ dissect_isup_application_transport_parameter(tvbuff_t *parameter_tvb, packet_inf
if (new_tvb) { /* take it all */
next_tvb = new_tvb;
} else { /* make a new subset */
- next_tvb = tvb_new_subset(parameter_tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(parameter_tvb, offset);
}
proto_tree_add_text(parameter_tree, parameter_tvb, offset, -1,
@@ -6618,7 +6618,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
tap_rec.calling_number = NULL;
tap_rec.called_number = NULL;
- parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1);
+ parameter_tvb = tvb_new_subset_remaining(message_tvb, offset);
/* distinguish between message types:*/
switch (isup_standard){
@@ -7036,7 +7036,7 @@ dissect_isup_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *isup
if (opt_parameter_pointer > 0){
proto_tree_add_uint_format(isup_tree, hf_isup_pointer_to_start_of_optional_part, message_tvb, offset, PARAMETER_POINTER_LENGTH, opt_parameter_pointer, "Pointer to start of optional part: %u", opt_parameter_pointer);
offset += opt_parameter_pointer;
- optional_parameter_tvb = tvb_new_subset(message_tvb, offset, -1, -1 );
+ optional_parameter_tvb = tvb_new_subset_remaining(message_tvb, offset);
switch(isup_standard){
case ITU_STANDARD:
dissect_isup_optional_parameter(optional_parameter_tvb, pinfo, isup_tree);
@@ -7135,7 +7135,7 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(isup_tree, hf_isup_cic, tvb, CIC_OFFSET, CIC_LENGTH, cic, "CIC: %u", cic);
}
- message_tvb = tvb_new_subset(tvb, CIC_LENGTH, -1, -1);
+ message_tvb = tvb_new_subset_remaining(tvb, CIC_LENGTH);
dissect_isup_message(message_tvb, pinfo, isup_tree);
}
@@ -7181,7 +7181,7 @@ dissect_bicc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint_format(bicc_tree, hf_bicc_cic, tvb, BICC_CIC_OFFSET, BICC_CIC_LENGTH, bicc_cic, "CIC: %u", bicc_cic);
}
- message_tvb = tvb_new_subset(tvb, BICC_CIC_LENGTH, -1, -1);
+ message_tvb = tvb_new_subset_remaining(tvb, BICC_CIC_LENGTH);
dissect_isup_message(message_tvb, pinfo, bicc_tree);
}
@@ -7211,7 +7211,7 @@ dissect_application_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
isup_tree = proto_item_add_subtree(ti, ett_isup);
}
- message_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ message_tvb = tvb_new_subset_remaining(tvb, 0);
dissect_isup_message(message_tvb, pinfo, isup_tree);
}
/* ---------------------------------------------------- stats tree
diff --git a/epan/dissectors/packet-itdm.c b/epan/dissectors/packet-itdm.c
index 6b404b9316..d0e113770e 100644
--- a/epan/dissectors/packet-itdm.c
+++ b/epan/dissectors/packet-itdm.c
@@ -266,7 +266,7 @@ dissect_itdm_125usec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- 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);
}
@@ -360,7 +360,7 @@ dissect_itdm_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
}
- 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);
}
diff --git a/epan/dissectors/packet-iua.c b/epan/dissectors/packet-iua.c
index f5ab067361..7bef0aac80 100644
--- a/epan/dissectors/packet-iua.c
+++ b/epan/dissectors/packet-iua.c
@@ -868,7 +868,7 @@ dissect_iua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree,
sapi_val_assigned = FALSE;
common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
- parameters_tvb = tvb_new_subset(message_tvb, PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, PARAMETERS_OFFSET);
dissect_common_header(common_header_tvb, pinfo, iua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, iua_tree);
}
diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c
index b082083087..3948df53d9 100644
--- a/epan/dissectors/packet-iuup.c
+++ b/epan/dissectors/packet-iuup.c
@@ -832,7 +832,7 @@ static void find_iuup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
int offset = 0;
while (len > 3) {
- if ( dissect_iuup_heur(tvb_new_subset(tvb,offset,-1,-1), pinfo, tree) )
+ if ( dissect_iuup_heur(tvb_new_subset_remaining(tvb,offset), pinfo, tree) )
return;
offset++;
diff --git a/epan/dissectors/packet-iwarp-ddp-rdmap.c b/epan/dissectors/packet-iwarp-ddp-rdmap.c
index b480976274..bb1f596e70 100644
--- a/epan/dissectors/packet-iwarp-ddp-rdmap.c
+++ b/epan/dissectors/packet-iwarp-ddp-rdmap.c
@@ -604,7 +604,7 @@ dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|| rdma_msg_opcode == RDMA_WRITE) {
/* display the payload */
- next_tvb = tvb_new_subset(tvb, DDP_TAGGED_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, DDP_TAGGED_HEADER_LEN);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
@@ -633,7 +633,7 @@ dissect_iwarp_ddp_rdmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|| rdma_msg_opcode == RDMA_SEND_SE_INVALIDATE) {
/* display the payload */
- next_tvb = tvb_new_subset(tvb, DDP_UNTAGGED_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, DDP_UNTAGGED_HEADER_LEN);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-jabber.c b/epan/dissectors/packet-jabber.c
index 58bed87e1a..da71c1e4bc 100644
--- a/epan/dissectors/packet-jabber.c
+++ b/epan/dissectors/packet-jabber.c
@@ -101,7 +101,7 @@ dissect_jabber(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
PROTO_ITEM_SET_HIDDEN(hidden_item);
- xmltvb = tvb_new_subset(tvb, offset, -1, -1);
+ xmltvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(xml_handle, xmltvb, pinfo, jabber_tree);
}
}
diff --git a/epan/dissectors/packet-juniper.c b/epan/dissectors/packet-juniper.c
index 92e2a59f27..bf827dc779 100644
--- a/epan/dissectors/packet-juniper.c
+++ b/epan/dissectors/packet-juniper.c
@@ -609,7 +609,7 @@ dissect_juniper_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, prot
if ((*flags & JUNIPER_FLAG_NO_L2) == JUNIPER_FLAG_NO_L2) { /* no link header present ? */
proto = tvb_get_letohl(tvb,hdr_len); /* proto is stored in host-order */
- next_tvb = tvb_new_subset(tvb, hdr_len + 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, hdr_len + 4);
dissect_juniper_payload_proto(tvb, pinfo, tree, ti, proto, hdr_len + 4);
return -1;
}
@@ -630,7 +630,7 @@ dissect_juniper_payload_proto(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
ti = proto_tree_add_text (juniper_subtree, tvb, offset, 0, "[Payload Type: %s]",
val_to_str(proto,juniper_proto_vals,"Unknown"));
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
switch (proto) {
case PROTO_IP:
@@ -663,7 +663,7 @@ dissect_juniper_payload_proto(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
nlpid = tvb_get_guint8(tvb, offset);
if(dissector_try_port(osinl_subdissector_table, nlpid, next_tvb, pinfo, tree))
return 0;
- next_tvb = tvb_new_subset(tvb, offset+1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+1);
if(dissector_try_port(osinl_excl_subdissector_table, nlpid, next_tvb, pinfo, tree))
return 0;
break;
@@ -1089,7 +1089,7 @@ dissect_juniper_atm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint16
return;
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (next_proto == PROTO_OAM) {
dissect_juniper_payload_proto(tvb, pinfo, tree, ti, PROTO_OAM, offset);
diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c
index 9e377c9969..fa2a0c9be6 100644
--- a/epan/dissectors/packet-jxta.c
+++ b/epan/dissectors/packet-jxta.c
@@ -442,7 +442,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
offset += sizeof(JXTA_UDP_SIG);
- jxta_message_framing_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ jxta_message_framing_tvb = tvb_new_subset_remaining(tvb, offset);
processed = dissect_jxta_message_framing(jxta_message_framing_tvb, pinfo, NULL, &content_length, &content_type);
if ((0 == processed) || (NULL == content_type) || (content_length <= 0) || (content_length > UINT_MAX)) {
@@ -493,7 +493,7 @@ static int dissect_jxta_udp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
proto_tree_add_item(jxta_udp_tree, hf_jxta_udpsig, tvb, tree_offset, sizeof(JXTA_UDP_SIG), FALSE);
tree_offset += sizeof(JXTA_UDP_SIG);
- jxta_message_framing_tvb = tvb_new_subset(tvb, tree_offset, -1, -1);
+ jxta_message_framing_tvb = tvb_new_subset_remaining(tvb, tree_offset);
tree_offset += dissect_jxta_message_framing(jxta_message_framing_tvb, pinfo, jxta_tree, &content_length, &content_type);
@@ -1257,7 +1257,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
/* parse elements */
for (each_elem = 0; each_elem < elem_count; each_elem++) {
- tvbuff_t *jxta_message_element_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvbuff_t *jxta_message_element_tvb = tvb_new_subset_remaining(tvb, offset);
int processed;
if(JXTA_MSG_VERSION_1 == message_version) {
@@ -1417,7 +1417,7 @@ static int dissect_jxta_message(tvbuff_t * tvb, packet_info * pinfo, proto_tree
/* parse elements */
for (each_elem = 0; each_elem < elem_count; each_elem++) {
- tvbuff_t *jxta_message_element_tvb = tvb_new_subset(tvb, tree_offset, -1, -1);
+ tvbuff_t *jxta_message_element_tvb = tvb_new_subset_remaining(tvb, tree_offset);
if(JXTA_MSG_VERSION_1 == message_version) {
tree_offset +=
@@ -1582,7 +1582,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
tvbuff_t *jxta_signature_element_tvb;
int processed;
- jxta_signature_element_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ jxta_signature_element_tvb = tvb_new_subset_remaining(tvb, offset);
processed = dissect_jxta_message_element_1(jxta_signature_element_tvb, pinfo, NULL, 0, NULL);
@@ -1678,7 +1678,7 @@ static int dissect_jxta_message_element_1(tvbuff_t * tvb, packet_info * pinfo, p
/* process the signature element */
if ((flags & JXTAMSG1_ELMFLAG_SIGNATURE) != 0) {
- tvbuff_t *jxta_message_element_tvb = tvb_new_subset(tvb, tree_offset, -1, -1);
+ tvbuff_t *jxta_message_element_tvb = tvb_new_subset_remaining(tvb, tree_offset);
tree_offset += dissect_jxta_message_element_1(jxta_message_element_tvb, pinfo, jxta_elem_tree, ns_count, names_table);
}
@@ -1840,7 +1840,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
tvbuff_t *jxta_signature_element_tvb;
int processed;
- jxta_signature_element_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ jxta_signature_element_tvb = tvb_new_subset_remaining(tvb, offset);
processed = dissect_jxta_message_element_2(jxta_signature_element_tvb, pinfo, NULL, 0, NULL);
@@ -1977,7 +1977,7 @@ static int dissect_jxta_message_element_2(tvbuff_t * tvb, packet_info * pinfo, p
/* process the signature element */
if ((flags & JXTAMSG2_ELMFLAG_SIGNATURE) != 0) {
- tvbuff_t *jxta_message_element_tvb = tvb_new_subset(tvb, tree_offset, -1, -1);
+ tvbuff_t *jxta_message_element_tvb = tvb_new_subset_remaining(tvb, tree_offset);
tree_offset += dissect_jxta_message_element_1(jxta_message_element_tvb, pinfo, jxta_elem_tree, names_count, names_table);
}
diff --git a/epan/dissectors/packet-kpasswd.c b/epan/dissectors/packet-kpasswd.c
index e897eee104..c819712da7 100644
--- a/epan/dissectors/packet-kpasswd.c
+++ b/epan/dissectors/packet-kpasswd.c
@@ -223,7 +223,7 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
if(tvb_get_guint8(tvb, offset)==0x7e){
/* TCP record mark, if any, not displayed. But hopefully
KRB-ERROR dissection will proceed correctly. */
- next_tvb=tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb=tvb_new_subset_remaining(tvb, offset);
return dissect_kerberos_main(next_tvb, pinfo, tree, FALSE, NULL);
}
@@ -251,7 +251,7 @@ dissect_kpasswd_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboo
offset+=ap_req_len;
/* KRB-PRIV message */
- next_tvb=tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb=tvb_new_subset_remaining(tvb, offset);
offset += dissect_kpasswd_krb_priv_message(pinfo, next_tvb, kpasswd_tree, (version==0xff80));
proto_item_set_len(kpasswd_item, offset);
diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c
index f3de64de61..48014513f1 100644
--- a/epan/dissectors/packet-l2tp.c
+++ b/epan/dissectors/packet-l2tp.c
@@ -1395,7 +1395,7 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_sequence, tvb,
index + l2tpv3_cookie + 1, 3, FALSE);
}
- next_tvb = tvb_new_subset(tvb, index + l2tpv3_cookie + 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie + 4);
break;
case L2TPv3_L2_SPECIFIC_ATM:
if (tree) {
@@ -1421,16 +1421,16 @@ process_l2tpv3_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(l2_specific, hf_l2tp_l2_spec_sequence, tvb,
index + l2tpv3_cookie + 1, 3, FALSE);
}
- next_tvb = tvb_new_subset(tvb, index + l2tpv3_cookie + 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie + 4);
break;
case L2TPv3_L2_SPECIFIC_LAPD:
if (tree)
proto_tree_add_text(tree, tvb, index + l2tpv3_cookie + 4, 3,"LAPD info");
- next_tvb = tvb_new_subset(tvb, index + l2tpv3_cookie+4+3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie+4+3);
break;
case L2TPv3_L2_SPECIFIC_NONE:
default:
- next_tvb = tvb_new_subset(tvb, index + l2tpv3_cookie, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, index + l2tpv3_cookie);
break;
}
@@ -1881,7 +1881,7 @@ dissect_l2tp_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_len(l2tp_item, index);
/* If we have data, signified by having a length bit, dissect it */
if (tvb_offset_exists(tvb, index)) {
- next_tvb = tvb_new_subset(tvb, index, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, index);
call_dissector(ppp_hdlc_handle, next_tvb, pinfo, tree);
}
return tvb_length(tvb);
diff --git a/epan/dissectors/packet-lanforge.c b/epan/dissectors/packet-lanforge.c
index e7aa9f551b..18673a179a 100644
--- a/epan/dissectors/packet-lanforge.c
+++ b/epan/dissectors/packet-lanforge.c
@@ -148,7 +148,7 @@ static gboolean dissect_lanforge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
tvb_length_remaining(tvb, offset));
#else
if(tvb_length_remaining(tvb, offset)) /* random data */
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
lanforge_tree);
#endif
}
diff --git a/epan/dissectors/packet-lapb.c b/epan/dissectors/packet-lapb.c
index 1d677951f1..7d55d2da2d 100644
--- a/epan/dissectors/packet-lapb.c
+++ b/epan/dissectors/packet-lapb.c
@@ -147,7 +147,7 @@ dissect_lapb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* not end of frame ==> X.25 */
if (tvb_reported_length(tvb) > 2) {
- next_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 2);
switch (pinfo->p2p_dir) {
case P2P_DIR_SENT:
diff --git a/epan/dissectors/packet-lapd.c b/epan/dissectors/packet-lapd.c
index ce5a864deb..d8b01fe5f0 100644
--- a/epan/dissectors/packet-lapd.c
+++ b/epan/dissectors/packet-lapd.c
@@ -528,7 +528,7 @@ dissect_lapd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset(tvb, lapd_header_len, tvb_length_remaining(tvb,lapd_header_len) - 2, -1);
} else
- next_tvb = tvb_new_subset(tvb, lapd_header_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, lapd_header_len);
if (XDLC_IS_INFORMATION(control)) {
/* call next protocol */
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 2d93694b55..e512ce391b 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -3644,7 +3644,7 @@ dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i
*/
if (!decr_tvb) {
if(!pinfo->gssapi_data_encrypted){
- plain_tvb = tvb_new_subset(gssapi_tvb, ver_len, -1, -1);
+ plain_tvb = tvb_new_subset_remaining(gssapi_tvb, ver_len);
}
}
diff --git a/epan/dissectors/packet-lge_monitor.c b/epan/dissectors/packet-lge_monitor.c
index dbd7c71edd..eaf3131793 100644
--- a/epan/dissectors/packet-lge_monitor.c
+++ b/epan/dissectors/packet-lge_monitor.c
@@ -98,7 +98,7 @@ dissect_lge_monitor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(lge_monitor_tree, hf_lge_monitor_length, tvb, offset, 4, FALSE);
offset = offset +4;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
switch (lge_monitor_proto_id){
case 0: /* MTP3 */
diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c
index 06e6d41ec3..4a035c2f05 100644
--- a/epan/dissectors/packet-llc.c
+++ b/epan/dissectors/packet-llc.c
@@ -527,7 +527,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (tvb_length_remaining(tvb, llc_header_len) > 0) {
- next_tvb = tvb_new_subset(tvb, llc_header_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, llc_header_len);
if (XDLC_IS_INFORMATION(control)) {
/*
* Non-SNAP I or UI frame.
@@ -606,7 +606,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
hf = *oui_info->field_info->p_id;
subdissector_table = oui_info->table;
proto_tree_add_uint(snap_tree, hf, tvb, offset+3, 2, etype);
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
if(!dissector_try_port(hpteam_subdissector_table,etype, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -627,13 +627,13 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint(snap_tree, hf_type,
tvb, offset+3, 2, etype);
}
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
if (!dissector_try_port(ethertype_subdissector_table,
etype, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo,
tree);
} else {
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
break;
@@ -657,15 +657,13 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
switch (etype) {
case BPID_ETH_WITH_FCS:
- next_tvb = tvb_new_subset(tvb, offset+5+bridge_pad,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
call_dissector(eth_withfcs_handle, next_tvb, pinfo,
tree);
break;
case BPID_ETH_WITHOUT_FCS:
- next_tvb = tvb_new_subset(tvb, offset+5+bridge_pad,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
break;
@@ -677,25 +675,23 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
* Ring dissector expects the first byte to
* be.
*/
- next_tvb = tvb_new_subset(tvb, offset+5+bridge_pad,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5+bridge_pad);
call_dissector(tr_handle, next_tvb, pinfo, tree);
break;
case BPID_FDDI_WITH_FCS:
case BPID_FDDI_WITHOUT_FCS:
- next_tvb = tvb_new_subset(tvb, offset+5+1+bridge_pad,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5+1+bridge_pad);
call_dissector(fddi_handle, next_tvb, pinfo, tree);
break;
case BPID_BPDU:
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
call_dissector(bpdu_handle, next_tvb, pinfo, tree);
break;
default:
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
call_dissector(data_handle, next_tvb, pinfo, tree);
break;
}
@@ -706,12 +702,12 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint(snap_tree, hf_pid, tvb, offset+3, 2,
etype);
}
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
call_dissector(bpdu_handle, next_tvb, pinfo, tree);
break;
case OUI_TURBOCELL:
- next_tvb = tvb_new_subset(tvb, offset+3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+3);
call_dissector(turbo_handle, next_tvb, pinfo, tree);
break;
@@ -726,17 +722,16 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint(snap_tree, hf_type,
tvb, offset+3, 2, etype);
}
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
mesh_header_len = call_dissector(mesh_handle,
next_tvb, pinfo, tree);
- next_tvb = tvb_new_subset(tvb, offset+5+mesh_header_len,
- -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5+mesh_header_len);
if (!dissector_try_port(ethertype_subdissector_table,
etype, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo,
tree);
} else {
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
break;
@@ -764,7 +759,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
proto_tree_add_uint(snap_tree, hf, tvb, offset+3, 2,
etype);
}
- next_tvb = tvb_new_subset(tvb, offset+5, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset+5);
if (XDLC_IS_INFORMATION(control)) {
if (subdissector_table != NULL) {
/* do lookup with the subdissector table */
diff --git a/epan/dissectors/packet-loop.c b/epan/dissectors/packet-loop.c
index 569acd5b80..b9ada3eeee 100644
--- a/epan/dissectors/packet-loop.c
+++ b/epan/dissectors/packet-loop.c
@@ -121,7 +121,7 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_length_remaining(tvb, offset) > 0)
{
- 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);
}
}
diff --git a/epan/dissectors/packet-lwapp.c b/epan/dissectors/packet-lwapp.c
index 0318b286ba..0e85936115 100644
--- a/epan/dissectors/packet-lwapp.c
+++ b/epan/dissectors/packet-lwapp.c
@@ -312,7 +312,7 @@ static void dissect_control(tvbuff_t *tvb, packet_info *pinfo,
offset += 2;
/* Dissect rest of packet as data */
- 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);
}
@@ -347,7 +347,7 @@ static void dissect_lwapp_l3(tvbuff_t *tvb, packet_info *pinfo,
}
/* Dissect as Ethernet */
- next_client = tvb_new_subset(tvb, 0, -1, -1);
+ next_client = tvb_new_subset_remaining(tvb, 0);
call_dissector(eth_withoutfcs_handle, next_client, pinfo, tree);
return;
diff --git a/epan/dissectors/packet-m2pa.c b/epan/dissectors/packet-m2pa.c
index d84ea7eaed..b69528d7e2 100644
--- a/epan/dissectors/packet-m2pa.c
+++ b/epan/dissectors/packet-m2pa.c
@@ -243,7 +243,7 @@ dissect_v2_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, pro
}
}
- payload_tvb = tvb_new_subset(message_data_tvb, MTP3_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(message_data_tvb, MTP3_OFFSET);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
}
@@ -268,7 +268,7 @@ dissect_v8_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, pro
proto_item_set_len(m2pa_item, V8_HEADER_LENGTH + LI_LENGTH);
}
- payload_tvb = tvb_new_subset(message_data_tvb, MTP3_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(message_data_tvb, MTP3_OFFSET);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
}
}
@@ -297,7 +297,7 @@ dissect_v12_user_data_message(tvbuff_t *message_data_tvb, packet_info *pinfo, pr
proto_item_set_len(m2pa_item, V12_HEADER_LENGTH + PRI_LENGTH);
}
- payload_tvb = tvb_new_subset(message_data_tvb, MTP3_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(message_data_tvb, MTP3_OFFSET);
call_dissector(mtp3_handle, payload_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c
index 2611c22189..fd94619333 100644
--- a/epan/dissectors/packet-m2ua.c
+++ b/epan/dissectors/packet-m2ua.c
@@ -1044,7 +1044,7 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
tvbuff_t *common_header_tvb, *parameters_tvb;
common_header_tvb = tvb_new_subset(message_tvb, 0, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
- parameters_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_LENGTH, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, m2ua_tree);
dissect_parameters(parameters_tvb, pinfo, tree, m2ua_tree);
}
diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c
index 8121bb91a9..1a732d91c1 100644
--- a/epan/dissectors/packet-m3ua.c
+++ b/epan/dissectors/packet-m3ua.c
@@ -1903,7 +1903,7 @@ dissect_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, pro
tvbuff_t *common_header_tvb, *parameters_tvb;
common_header_tvb = tvb_new_subset(message_tvb, 0, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
- parameters_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_LENGTH, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
if (version == M3UA_V5)
dissect_v5_common_header(common_header_tvb, pinfo, m3ua_tree);
else
diff --git a/epan/dissectors/packet-mdshdr.c b/epan/dissectors/packet-mdshdr.c
index 80c2a22fd6..0e8b974c4d 100644
--- a/epan/dissectors/packet-mdshdr.c
+++ b/epan/dissectors/packet-mdshdr.c
@@ -262,7 +262,7 @@ dissect_mdshdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb = tvb_new_subset (tvb, MDSHDR_HEADER_SIZE, pktlen, pktlen);
}
else {
- next_tvb = tvb_new_subset (tvb, MDSHDR_HEADER_SIZE, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, MDSHDR_HEADER_SIZE);
}
/* Call the Fibre Channel dissector */
diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c
index ed7c71e93c..6c680ad4a9 100644
--- a/epan/dissectors/packet-mgcp.c
+++ b/epan/dissectors/packet-mgcp.c
@@ -560,7 +560,7 @@ static void dissect_mgcp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
/* Dissect sdp payload */
if (tvb_sectionend < tvb_len)
{
- next_tvb = tvb_new_subset(tvb, tvb_sectionend, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, tvb_sectionend);
call_dissector(sdp_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-mikey.c b/epan/dissectors/packet-mikey.c
index c3a703b52d..aea260c99c 100644
--- a/epan/dissectors/packet-mikey.c
+++ b/epan/dissectors/packet-mikey.c
@@ -694,7 +694,7 @@ dissect_payload_hdr(mikey_t *mikey, tvbuff_t *tvb, packet_info *pinfo, proto_tre
tvbuff_t *sub_tvb;
int len;
- sub_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ sub_tvb = tvb_new_subset_remaining(tvb, offset);
len = dissect_payload_cs_id(cs_id_map_type, mikey, sub_tvb, pinfo, tree);
if (len < 0)
diff --git a/epan/dissectors/packet-miop.c b/epan/dissectors/packet-miop.c
index cf4c0a567a..d81044e8ff 100644
--- a/epan/dissectors/packet-miop.c
+++ b/epan/dissectors/packet-miop.c
@@ -252,7 +252,7 @@ static void dissect_miop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
tvbuff_t *payload_tvb;
offset += unique_id_len;
- payload_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ payload_tvb = tvb_new_subset_remaining (tvb, offset);
dissect_giop(payload_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-mip.c b/epan/dissectors/packet-mip.c
index f3e6297287..ca1d61487b 100644
--- a/epan/dissectors/packet-mip.c
+++ b/epan/dissectors/packet-mip.c
@@ -698,7 +698,7 @@ dissect_mip( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
/* encapsulated payload */
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
call_dissector(ip_handle, next_tvb, pinfo, mip_tree);
offset += tvb_reported_length_remaining(tvb, offset);
} /* if tree */
diff --git a/epan/dissectors/packet-mip6.c b/epan/dissectors/packet-mip6.c
index 3b59b284b2..b043b075bb 100644
--- a/epan/dissectors/packet-mip6.c
+++ b/epan/dissectors/packet-mip6.c
@@ -941,7 +941,7 @@ dissect_mip6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (type == FNA && pproto == IP_PROTO_IPV6) {
tvbuff_t *ipv6_tvb;
- ipv6_tvb = tvb_new_subset(tvb, len + 8, -1, -1);
+ ipv6_tvb = tvb_new_subset_remaining(tvb, len + 8);
/* Call the IPv6 dissector */
dissector_try_port(ip_dissector_table, pproto, ipv6_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-mmse.c b/epan/dissectors/packet-mmse.c
index 307edcdd61..1c978d5cfe 100644
--- a/epan/dissectors/packet-mmse.c
+++ b/epan/dissectors/packet-mmse.c
@@ -1312,7 +1312,7 @@ dissect_mmse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint8 pdut,
DebugLog(("Calling add_content_type() in WSP dissector\n"));
offset = add_content_type(mmse_tree, tvb, offset, &type, &type_str);
DebugLog(("Generating new TVB subset (offset = %u)\n", offset));
- tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tmp_tvb = tvb_new_subset_remaining(tvb, offset);
DebugLog(("Add POST data\n"));
add_post_data(mmse_tree, tmp_tvb, type, type_str, pinfo);
DebugLog(("Done!\n"));
diff --git a/epan/dissectors/packet-mpeg-pes.c b/epan/dissectors/packet-mpeg-pes.c
index 13ac0ea68e..0ef4ead71d 100644
--- a/epan/dissectors/packet-mpeg-pes.c
+++ b/epan/dissectors/packet-mpeg-pes.c
@@ -794,7 +794,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset / 8, 64, FALSE);
offset += 64 * 8;
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_SEQUENCE_EXTENSION) {
tvbuff_t *es;
@@ -802,7 +802,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_mpeg_pes_Sequence_extension(tvb, offset, &asn1_ctx,
tree, hf_mpeg_video_sequence_extension);
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_GOP) {
tvbuff_t *es;
@@ -810,7 +810,7 @@ dissect_mpeg_pes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = dissect_mpeg_pes_Group_of_pictures(tvb, offset, &asn1_ctx,
tree, hf_mpeg_video_group_of_pictures);
- es = tvb_new_subset(tvb, offset / 8, -1, -1);
+ es = tvb_new_subset_remaining(tvb, offset / 8);
dissect_mpeg_pes(es, pinfo, tree);
} else if (stream == STREAM_PACK) {
if (tvb_get_guint8(tvb, offset / 8) >> 6 == 1) {
diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c
index 308472b656..eb8bf0ad48 100644
--- a/epan/dissectors/packet-mpls.c
+++ b/epan/dissectors/packet-mpls.c
@@ -387,7 +387,7 @@ dissect_pw_ach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
val_to_str(channel_type, mpls_pwac_types, "Unknown"),
channel_type);
}
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
if (0x21 == channel_type /*IPv4, RFC4385 clause 6.*/)
{
@@ -485,7 +485,7 @@ dissect_pw_mcw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 2, 2, sequence_number,
"Sequence Number: %d", sequence_number);
}
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
call_dissector( dissector_data, next_tvb, pinfo, tree );
}
@@ -762,7 +762,7 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (bos) break;
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if ( !dissector_try_port(mpls_subdissector_table, label, next_tvb, pinfo, tree))
{
diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c
index c43ca4b2c9..1419c489c4 100644
--- a/epan/dissectors/packet-mq.c
+++ b/epan/dissectors/packet-mq.c
@@ -2268,7 +2268,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb_memcpy(tvb, mqinfo.format, tMsgProps.iOffsetFormat, 8);
pd_save = pinfo->private_data;
pinfo->private_data = &mqinfo;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!dissector_try_heuristic(mq_heur_subdissector_list, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
pinfo->private_data = pd_save;
@@ -2290,7 +2290,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* This is a MQ segment continuation (if MQ reassembly is not enabled) */
if (check_col(pinfo->cinfo, COL_INFO)) col_append_str(pinfo->cinfo, COL_INFO, " [Unreassembled MQ]");
- 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);
}
}
}
@@ -2302,7 +2302,7 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_item(tree, proto_mq, tvb, offset, -1, FALSE);
}
- 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);
}
}
}
diff --git a/epan/dissectors/packet-msdp.c b/epan/dissectors/packet-msdp.c
index d6a11d7677..f4333c37f1 100644
--- a/epan/dissectors/packet-msdp.c
+++ b/epan/dissectors/packet-msdp.c
@@ -443,7 +443,7 @@ static void dissect_msdp_notification(tvbuff_t *tvb, packet_info *pinfo, proto_t
* message with Error Code set to Notification to be
* sent back.
*/
- next_tvb = tvb_new_subset(tvb, *offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, *offset);
dissect_msdp(next_tvb, pinfo, tree);
break;
case FSM_ERROR:
diff --git a/epan/dissectors/packet-msrp.c b/epan/dissectors/packet-msrp.c
index 1621fa3945..cd42de51ee 100644
--- a/epan/dissectors/packet-msrp.c
+++ b/epan/dissectors/packet-msrp.c
@@ -711,7 +711,7 @@ dissect_msrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_end(msrp_headers_item, tvb, next_offset);
/* Create new tree & tvb for data */
- next_tvb = tvb_new_subset(tvb, next_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, next_offset);
ti = proto_tree_add_item(msrp_tree, hf_msrp_data, tvb,
next_offset, -1, FALSE);
msrp_data_tree = proto_item_add_subtree(ti, ett_msrp_data);
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c
index 25891a551f..1638691070 100644
--- a/epan/dissectors/packet-mtp2.c
+++ b/epan/dissectors/packet-mtp2.c
@@ -164,7 +164,7 @@ mtp2_decode_crc16(tvbuff_t *tvb, proto_tree *fh_tree, packet_info *pinfo)
* or we're already past the end of the captured data.
* Don't slice anything off.
*/
- next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, proto_offset);
} else if (len < reported_len) {
/*
* The packet is claimed to have enough data for a 2-byte FCS, but
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index 7056de0fdd..d0a274536b 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -613,14 +613,14 @@ dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (mtp3_standard) {
case ITU_STANDARD:
- payload_tvb = tvb_new_subset(tvb, ITU_MTP_PAYLOAD_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, ITU_MTP_PAYLOAD_OFFSET);
break;
case ANSI_STANDARD:
case CHINESE_ITU_STANDARD:
- payload_tvb = tvb_new_subset(tvb, ANSI_MTP_PAYLOAD_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, ANSI_MTP_PAYLOAD_OFFSET);
break;
case JAPAN_STANDARD:
- payload_tvb = tvb_new_subset(tvb, JAPAN_MTP_PAYLOAD_OFFSET, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, JAPAN_MTP_PAYLOAD_OFFSET);
break;
default:
DISSECTOR_ASSERT_NOT_REACHED();
diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c
index 5f63e48b83..73b537be56 100644
--- a/epan/dissectors/packet-mtp3mg.c
+++ b/epan/dissectors/packet-mtp3mg.c
@@ -1097,7 +1097,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
h0 = tvb_get_guint8(tvb, 0) & H0_MASK;
h1 = (tvb_get_guint8(tvb, 0) & H1_MASK) >> H1_SHIFT;
- payload_tvb = tvb_new_subset(tvb, H0H1_LENGTH, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, H0H1_LENGTH);
switch (h0)
{
@@ -1124,7 +1124,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
JAPAN_SPARE_LENGTH, TRUE);
/* Get a tvb w/o the spare byte--it makes for less code below */
- tvb = tvb_new_subset(tvb, JAPAN_SPARE_LENGTH, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, JAPAN_SPARE_LENGTH);
}
proto_tree_add_item(mtp3mg_tree, hf_mtp3mg_h0, tvb, 0, H0H1_LENGTH,
@@ -1134,7 +1134,7 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
h0 = tvb_get_guint8(tvb, 0) & H0_MASK;
h1 = (tvb_get_guint8(tvb, 0) & H1_MASK) >> H1_SHIFT;
- payload_tvb = tvb_new_subset(tvb, H0H1_LENGTH, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, H0H1_LENGTH);
switch (h0)
{
diff --git a/epan/dissectors/packet-nbipx.c b/epan/dissectors/packet-nbipx.c
index 36dce82c82..bb219d4d0f 100644
--- a/epan/dissectors/packet-nbipx.c
+++ b/epan/dissectors/packet-nbipx.c
@@ -460,7 +460,7 @@ dissect_nbipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_set_len(ti, offset);
if (has_payload && tvb_offset_exists(tvb, offset)) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_netbios_payload(next_tvb, pinfo, tree);
}
}
@@ -762,7 +762,7 @@ dissect_nmpi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1 + 1 + 2 + NETBIOS_NAME_LEN + NETBIOS_NAME_LEN;
if (opcode == IMSLOT_SEND && tvb_offset_exists(tvb, offset)) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_netbios_payload(next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-nbns.c b/epan/dissectors/packet-nbns.c
index 93493b3651..9184206932 100644
--- a/epan/dissectors/packet-nbns.c
+++ b/epan/dissectors/packet-nbns.c
@@ -1320,7 +1320,7 @@ dissect_nbdgm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* XXX - take the datagram length into account?
*/
proto_item_set_len(ti, offset);
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_netbios_payload(next_tvb, pinfo, tree);
break;
diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c
index df6d493d0d..03cc391694 100644
--- a/epan/dissectors/packet-ncp.c
+++ b/epan/dissectors/packet-ncp.c
@@ -697,20 +697,20 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*break;*/
}
}
- next_tvb = tvb_new_subset(tvb, commhdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, commhdr);
dissect_ncp_request(next_tvb, pinfo, nw_connection,
header.sequence, header.type, ncp_tree);
break;
case NCP_DEALLOCATE_SLOT: /* Deallocate Slot Request */
- next_tvb = tvb_new_subset(tvb, commhdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, commhdr);
dissect_ncp_request(next_tvb, pinfo, nw_connection,
header.sequence, header.type, ncp_tree);
break;
case NCP_SERVICE_REQUEST: /* Server NCP Request */
case NCP_BROADCAST_SLOT: /* Server Broadcast Packet */
- next_tvb = tvb_new_subset(tvb, commhdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, commhdr);
if (tvb_get_guint8(tvb, commhdr+6) == 0x68) {
subfunction = tvb_get_guint8(tvb, commhdr+7);
switch (subfunction) {
@@ -740,7 +740,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
case NCP_SERVICE_REPLY: /* Server NCP Reply */
- next_tvb = tvb_new_subset(tvb, commhdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, commhdr);
nds_defrag(next_tvb, pinfo, nw_connection, header.sequence,
header.type, ncp_tree, &ncp_tap);
break;
@@ -751,7 +751,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* clear out "frags". Was that the right thing to
* do?
*/
- next_tvb = tvb_new_subset(tvb, commhdr, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, commhdr);
dissect_ncp_reply(next_tvb, pinfo, nw_connection,
header.sequence, header.type, ncp_tree, &ncp_tap);
break;
@@ -775,7 +775,7 @@ dissect_ncp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
if (tvb_offset_exists(tvb, commhdr + 10)) {
call_dissector(data_handle,
- tvb_new_subset(tvb, commhdr + 10, -1, -1),
+ tvb_new_subset_remaining(tvb, commhdr + 10),
pinfo, ncp_tree);
}
break;
diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c
index 89a5057f57..3918ce3ba2 100644
--- a/epan/dissectors/packet-ndmp.c
+++ b/epan/dissectors/packet-ndmp.c
@@ -3111,7 +3111,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
do_frag = FALSE;
- new_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, 4);
}
}
else
@@ -3195,7 +3195,7 @@ dissect_ndmp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
else
{
- new_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, 4);
}
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c
index 22058d3e60..cd1ae324b9 100644
--- a/epan/dissectors/packet-ndps.c
+++ b/epan/dissectors/packet-ndps.c
@@ -4422,7 +4422,7 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
{
/* This is either a beggining or middle fragment on second dissection */
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
if (check_col(pinfo->cinfo, COL_INFO))
{
if (!spx_info->eom)
@@ -4450,12 +4450,12 @@ ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* There are no bytes so Dissect this
*/
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
}
if (next_tvb == NULL)
{
/* This is a fragment packet */
- next_tvb = tvb_new_subset (tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 0);
call_dissector(ndps_data_handle, next_tvb, pinfo, tree);
}
else
diff --git a/epan/dissectors/packet-netbios.c b/epan/dissectors/packet-netbios.c
index 7891dba34f..be11cefb5b 100644
--- a/epan/dissectors/packet-netbios.c
+++ b/epan/dissectors/packet-netbios.c
@@ -1179,7 +1179,7 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* No fragmentation here.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_netbios_payload(next_tvb, pinfo, tree);
break;
@@ -1213,8 +1213,8 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
next_tvb, &frag_tree_item);
}
} else {
- next_tvb = tvb_new_subset(tvb,
- offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb,
+ offset);
}
} else {
next_tvb = NULL;
@@ -1235,12 +1235,12 @@ dissect_netbios(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* we'd have to do reassembly to
* be able to determine that.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
}
if (next_tvb != NULL)
dissect_netbios_payload(next_tvb, pinfo, tree);
else {
- 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);
}
diff --git a/epan/dissectors/packet-nhrp.c b/epan/dissectors/packet-nhrp.c
index 8c1abbffa7..21debb514a 100644
--- a/epan/dissectors/packet-nhrp.c
+++ b/epan/dissectors/packet-nhrp.c
@@ -698,7 +698,7 @@ void dissect_nhrp_mand(tvbuff_t *tvb,
save_in_error_pkt = pinfo->in_error_pkt;
pinfo->in_error_pkt = TRUE;
- sub_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ sub_tvb = tvb_new_subset_remaining(tvb, offset);
if (isErr) {
dissect_nhrp(sub_tvb, pinfo, ind_tree);
}
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index ccdf0b7e96..e4ecc9357b 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -702,7 +702,7 @@ decode_pdu_ns_unitdata(build_info_t *bi) {
decode_iei_control_bits(ies, bi, bi->offset);
decode_pdu_general(&ies[1], 1, bi);
- next_tvb = tvb_new_subset(bi->tvb, bi->offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(bi->tvb, bi->offset);
if (bssgp_handle) {
call_dissector(bssgp_handle, next_tvb, bi->pinfo, bi->parent_tree);
}
diff --git a/epan/dissectors/packet-null.c b/epan/dissectors/packet-null.c
index 6d6c683f0f..ed4914e361 100644
--- a/epan/dissectors/packet-null.c
+++ b/epan/dissectors/packet-null.c
@@ -429,7 +429,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(guint16) null_header);
}
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
if (!dissector_try_port(ethertype_dissector_table,
(guint16) null_header, next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -442,7 +442,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(fh_tree, hf_null_family, tvb, 0, 4, null_header);
}
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
if (!dissector_try_port(null_dissector_table, null_header,
next_tvb, pinfo, tree)) {
/* No sub-dissector found. Label rest of packet as "Data" */
diff --git a/epan/dissectors/packet-osi.c b/epan/dissectors/packet-osi.c
index 872d3dce6e..808e0764be 100644
--- a/epan/dissectors/packet-osi.c
+++ b/epan/dissectors/packet-osi.c
@@ -255,7 +255,7 @@ static void dissect_osi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (dissector_try_port(osinl_subdissector_table, nlpid, tvb, pinfo, tree))
return;
/* try lookup with the subdissector tables that excludes the nlpid */
- new_tvb = tvb_new_subset(tvb, 1, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, 1);
if (dissector_try_port(osinl_excl_subdissector_table, nlpid, new_tvb, pinfo, tree))
return;
diff --git a/epan/dissectors/packet-ositp.c b/epan/dissectors/packet-ositp.c
index b01dad854d..15c9b424e2 100644
--- a/epan/dissectors/packet-ositp.c
+++ b/epan/dissectors/packet-ositp.c
@@ -753,7 +753,7 @@ static int ositp_decode_DR(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
"Disconnect Request(DR): 0x%x -> 0x%x", src_ref, dst_ref);
/* User data */
- 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);
offset += tvb_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
@@ -911,7 +911,7 @@ static int ositp_decode_DT(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
ositp_decode_var_part(tvb, offset, li, 4, cotp_tree);
offset += li;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
fragment_length = tvb_length(next_tvb);
if (check_col(pinfo->cinfo, COL_INFO)) {
if(fragment) {
@@ -1089,7 +1089,7 @@ static int ositp_decode_ED(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
ositp_decode_var_part(tvb, offset, li, 4, cotp_tree);
offset += li;
- 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);
offset += tvb_length_remaining(tvb, offset);
@@ -1232,7 +1232,7 @@ static int ositp_decode_CC(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
ositp_decode_var_part(tvb, offset, li, class_option, cotp_tree);
offset += li;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!uses_inactive_subset){
if (dissector_try_heuristic(cotp_heur_subdissector_list, next_tvb,
pinfo, tree)) {
@@ -1581,7 +1581,7 @@ static int ositp_decode_UD(tvbuff_t *tvb, int offset, guint8 li, guint8 tpdu,
ositp_decode_var_part(tvb, offset, li, 0, cltp_tree);
offset += li;
- 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);
offset += tvb_length_remaining(tvb, offset);
/* we dissected all of the containing PDU */
@@ -1630,7 +1630,7 @@ static gint dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
if (check_col(pinfo->cinfo, COL_INFO))
col_append_str(pinfo->cinfo, COL_INFO, "Length indicator is zero");
if (!first_tpdu)
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
return found_ositp;
}
@@ -1684,7 +1684,7 @@ static gint dissect_ositp_internal(tvbuff_t *tvb, packet_info *pinfo,
if (new_offset == -1) { /* incorrect TPDU */
if (!first_tpdu)
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1),
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-ospf.c b/epan/dissectors/packet-ospf.c
index 59dc3425ce..d1537bb694 100644
--- a/epan/dissectors/packet-ospf.c
+++ b/epan/dissectors/packet-ospf.c
@@ -1172,7 +1172,7 @@ dissect_ospf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, ospf_header_length, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, ospf_header_length), pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-pcli.c b/epan/dissectors/packet-pcli.c
index a957ac5669..c728df2064 100644
--- a/epan/dissectors/packet-pcli.c
+++ b/epan/dissectors/packet-pcli.c
@@ -108,7 +108,7 @@ dissect_pcli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/*
* Hand off to the IP dissector.
*/
- next_tvb = tvb_new_subset(tvb,4,-1,-1);
+ next_tvb = tvb_new_subset_remaining(tvb,4);
call_dissector(ip_handle,next_tvb,pinfo,tree);
}
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index e0707f543f..24bcdf36b8 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1577,7 +1577,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (!p_pdcp_info->rohc_compression) {
if (global_pdcp_dissect_user_plane_as_ip && (ip_handle != 0)) {
- tvbuff_t *payload_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvbuff_t *payload_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(ip_handle, payload_tvb, pinfo, pdcp_tree);
}
else {
diff --git a/epan/dissectors/packet-pflog.c b/epan/dissectors/packet-pflog.c
index 5be796c2aa..7b63780cd0 100644
--- a/epan/dissectors/packet-pflog.c
+++ b/epan/dissectors/packet-pflog.c
@@ -195,7 +195,7 @@ dissect_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Set the tvbuff for the payload after the header */
- next_tvb = tvb_new_subset(tvb, hdrlen, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, hdrlen);
switch (pflogh.af) {
@@ -324,7 +324,7 @@ dissect_old_pflog(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Set the tvbuff for the payload after the header */
- next_tvb = tvb_new_subset(tvb, OLD_PFLOG_HDRLEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, OLD_PFLOG_HDRLEN);
switch (pflogh.af) {
diff --git a/epan/dissectors/packet-pgm.c b/epan/dissectors/packet-pgm.c
index 7a97e5aa8e..c09dc511c2 100644
--- a/epan/dissectors/packet-pgm.c
+++ b/epan/dissectors/packet-pgm.c
@@ -771,7 +771,7 @@ decode_pgm_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
tvbuff_t *next_tvb;
int found = 0;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/* do lookup with the subdissector table */
found = dissector_try_port(subdissector_table, pgmhdr_sport,
diff --git a/epan/dissectors/packet-pim.c b/epan/dissectors/packet-pim.c
index 2991b04024..754f31a0f8 100644
--- a/epan/dissectors/packet-pim.c
+++ b/epan/dissectors/packet-pim.c
@@ -250,7 +250,7 @@ dissect_pimv1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/*
* The rest of the packet is a multicast data packet.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/*
* It's an IP packet - determine whether it's IPv4 or IPv6.
@@ -856,7 +856,7 @@ dissect_pim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
/*
* The rest of the packet is a multicast data packet.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/*
* It's an IP packet - determine whether it's IPv4 or IPv6.
diff --git a/epan/dissectors/packet-pktc.c b/epan/dissectors/packet-pktc.c
index 3991fb208b..020f7b7f3f 100644
--- a/epan/dissectors/packet-pktc.c
+++ b/epan/dissectors/packet-pktc.c
@@ -337,7 +337,7 @@ dissect_pktc_ap_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int
guint32 snonce;
/* AP Request kerberos blob */
- pktc_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ pktc_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_kerberos_main(pktc_tvb, pinfo, tree, FALSE, NULL);
/* Server Nonce */
@@ -368,7 +368,7 @@ dissect_pktc_ap_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int o
tvbuff_t *pktc_tvb;
/* AP Reply kerberos blob */
- pktc_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ pktc_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_kerberos_main(pktc_tvb, pinfo, tree, FALSE, NULL);
/* app specific data */
@@ -470,7 +470,7 @@ dissect_pktc_error_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, in
tvbuff_t *pktc_tvb;
/* KRB_ERROR */
- pktc_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ pktc_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_kerberos_main(pktc_tvb, pinfo, tree, FALSE, NULL);
return offset;
@@ -565,11 +565,11 @@ dissect_pktc_mtafqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* KRB_AP_RE[QP] */
- pktc_mtafqdn_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ pktc_mtafqdn_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_kerberos_main(pktc_mtafqdn_tvb, pinfo, pktc_mtafqdn_tree, FALSE, NULL);
/* KRB_SAFE */
- pktc_mtafqdn_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ pktc_mtafqdn_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_kerberos_main(pktc_mtafqdn_tvb, pinfo, pktc_mtafqdn_tree, FALSE, cb);
proto_item_set_len(item, offset);
diff --git a/epan/dissectors/packet-pktgen.c b/epan/dissectors/packet-pktgen.c
index 0632937561..0b78cf4d19 100644
--- a/epan/dissectors/packet-pktgen.c
+++ b/epan/dissectors/packet-pktgen.c
@@ -123,7 +123,7 @@ static gboolean dissect_pktgen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
tvb_length_remaining(tvb, offset));
#else
if(tvb_length_remaining(tvb, offset)) /* random data */
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo,
pktgen_tree);
#endif
}
diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c
index 21ee423aec..1c7bfc0b69 100644
--- a/epan/dissectors/packet-ppi.c
+++ b/epan/dissectors/packet-ppi.c
@@ -938,7 +938,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(seg_tree, hf_ampdu_count, tvb, 0, 0, mpdu_count);
pinfo->fragmented=FALSE;
} else {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "IEEE 802.11n");
col_set_str(pinfo->cinfo, COL_INFO, "Unreassembled A-MPDU data");
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -946,7 +946,7 @@ dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
return;
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (is_ht) { /* We didn't hit the reassembly code */
call_dissector(ieee80211_ht_handle, next_tvb, pinfo, tree);
} else {
diff --git a/epan/dissectors/packet-ppp.c b/epan/dissectors/packet-ppp.c
index 78b44e1ac8..948372466b 100644
--- a/epan/dissectors/packet-ppp.c
+++ b/epan/dissectors/packet-ppp.c
@@ -1523,7 +1523,7 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
switch (fcs_decode) {
case NO_FCS:
- next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, proto_offset);
break;
case FCS_16:
@@ -1538,7 +1538,7 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
* or we're already past the end of the captured data.
* Don't slice anything off.
*/
- next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, proto_offset);
} else if (len < reported_len) {
/*
* The packet is claimed to have enough data for a 2-byte FCS, but
@@ -1590,7 +1590,7 @@ decode_fcs(tvbuff_t *tvb, proto_tree *fh_tree, int fcs_decode, int proto_offset)
* The packet is claimed not to even have enough data for a 4-byte FCS.
* Just pass on the tvbuff as is.
*/
- next_tvb = tvb_new_subset(tvb, proto_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, proto_offset);
} else if (len < reported_len) {
/*
* The packet is claimed to have enough data for a 4-byte FCS, but
@@ -2825,7 +2825,7 @@ dissect_ppp_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tree)
proto_tree_add_uint(fh_tree, hf_ppp_protocol, tvb, 0, proto_len, ppp_prot);
- next_tvb = tvb_new_subset(tvb, proto_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, proto_len);
/* do lookup with the subdissector table */
if (!dissector_try_port(ppp_subdissector_table, ppp_prot, next_tvb, pinfo, tree)) {
@@ -3559,7 +3559,7 @@ dissect_mp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hdrlen = mp_short_seqno ? 2 : 4;
if (tvb_reported_length_remaining(tvb, hdrlen) > 0) {
- next_tvb = tvb_new_subset(tvb, hdrlen, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, hdrlen);
dissect_ppp(next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-pptp.c b/epan/dissectors/packet-pptp.c
index 09b74612f6..960c7d5477 100644
--- a/epan/dissectors/packet-pptp.c
+++ b/epan/dissectors/packet-pptp.c
@@ -280,7 +280,7 @@ dissect_pptp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (cntrl_type < NUM_CNTRL_TYPES)
( *(strfuncs[cntrl_type].func))(tvb, offset, pinfo, pptp_tree);
else
- call_dissector(data_handle,tvb_new_subset(tvb, offset, -1, -1), pinfo, pptp_tree);
+ call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, pptp_tree);
}
}
@@ -288,7 +288,7 @@ static void
dissect_unknown(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree)
{
- 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);
}
static void
diff --git a/epan/dissectors/packet-pres.c b/epan/dissectors/packet-pres.c
index 949e0052a0..0162ca85a1 100644
--- a/epan/dissectors/packet-pres.c
+++ b/epan/dissectors/packet-pres.c
@@ -338,7 +338,7 @@ pres_try_users_table(guint32 ctx_id, tvbuff_t *tvb, int offset, packet_info *pin
if (u->ctx_id == ctx_id) {
/* Register oid so other dissectors can find this connection */
register_ctx_id_and_oid(pinfo, u->ctx_id, u->oid);
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_ber_oid_callback(u->oid, next_tvb, offset, pinfo, global_tree);
return TRUE;
}
@@ -634,7 +634,7 @@ dissect_pres_T_single_ASN1_type(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier);
if(oid){
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree);
} else {
if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) {
@@ -661,7 +661,7 @@ dissect_pres_T_octet_aligned(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
oid=find_oid_by_pres_ctx_id(actx->pinfo, presentation_context_identifier);
if(oid){
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_ber_oid_callback(oid, next_tvb, offset, actx->pinfo, global_tree);
} else {
if (!pres_try_users_table(presentation_context_identifier, tvb, offset, actx->pinfo)) {
diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c
index 63c920b21d..f6d0d6a8dc 100644
--- a/epan/dissectors/packet-pw-atm.c
+++ b/epan/dissectors/packet-pw-atm.c
@@ -398,10 +398,10 @@ void dissect_payload_and_padding(
payload_size > dissected;
++(pd->pw_cell_number))
{
- tvb_2 = tvb_new_subset(tvb,dissected,-1,-1);
+ tvb_2 = tvb_new_subset_remaining(tvb,dissected);
dissected += call_dissector(dh_cell_header, tvb_2, pinfo, tree);
- tvb_2 = tvb_new_subset(tvb,dissected,-1,-1);
+ tvb_2 = tvb_new_subset_remaining(tvb,dissected);
/*dissect as oam for specific vci/pti, just like atm dissector does*/
if (pd->vci >= 0 && pd->pti >=0)
@@ -681,7 +681,7 @@ void dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tr
union wtap_pseudo_header* pseudo_header_save;
union wtap_pseudo_header ph;
- tvb_3 = tvb_new_subset(tvb_2, 1, -1, -1);
+ tvb_3 = tvb_new_subset_remaining(tvb_2, 1);
/* prepare pseudo header for atm aal5 decoding */
pseudo_header_save = pinfo->pseudo_header;
pinfo->pseudo_header = &ph;
@@ -892,7 +892,7 @@ void dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
call_dissector(dh_control_word, tvb_2, pinfo, tree);
- tvb_2 = tvb_new_subset(tvb, PWC_SIZEOF_CW, -1, -1);
+ tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
if (PWATM_SUBMODE_ADMIN_CELL == pd.submode)
{
dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size);
@@ -1075,7 +1075,7 @@ void dissect_n1_cw(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tvb_2 = tvb_new_subset(tvb, 0, PWC_SIZEOF_CW, PWC_SIZEOF_CW);
call_dissector(dh_control_word, tvb_2, pinfo, tree);
- tvb_2 = tvb_new_subset(tvb, PWC_SIZEOF_CW, -1, -1);
+ tvb_2 = tvb_new_subset_remaining(tvb, PWC_SIZEOF_CW);
dissect_payload_and_padding(tvb_2,pinfo,tree,payload_size,padding_size);
}
diff --git a/epan/dissectors/packet-pw-eth.c b/epan/dissectors/packet-pw-eth.c
index 5e809c12c5..7956bcefbf 100644
--- a/epan/dissectors/packet-pw-eth.c
+++ b/epan/dissectors/packet-pw-eth.c
@@ -87,7 +87,7 @@ dissect_pw_eth_cw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
"Sequence Number: %d",
sequence_number);
}
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
{
/*
* When Ethernet frames being decoded, pinfo->ethertype is extracted
@@ -119,7 +119,7 @@ dissect_pw_eth_nocw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_boolean(tree, hf_pw_eth, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(ti);
}
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
{
guint32 etype_save = pinfo->ethertype;
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-pw-hdlc.c b/epan/dissectors/packet-pw-hdlc.c
index afe4b3ba6f..117a711bb5 100644
--- a/epan/dissectors/packet-pw-hdlc.c
+++ b/epan/dissectors/packet-pw-hdlc.c
@@ -180,7 +180,7 @@ static void dissect_pw_hdlc_nocw_hdlc_ppp( tvbuff_t * tvb, packet_info * pinfo,
proto_tree_add_text( tr, tvb, 1, 1, "I frame" );
}
}
- call_dissector( ppp_handle, tvb_new_subset(tvb, 2, -1, -1), pinfo, tree );
+ call_dissector( ppp_handle, tvb_new_subset_remaining(tvb, 2), pinfo, tree );
}
void proto_register_pw_hdlc(void)
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index e6b2968091..b100f446cc 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -2645,7 +2645,7 @@ dissect_q931_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
show_fragment_seq_tree(fd_head, &q931_frag_items, q931_tree, pinfo, next_tvb, &frag_tree_item);
}
} else { /* only 1 segment */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
}
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s [reassembled]",
diff --git a/epan/dissectors/packet-radiotap.c b/epan/dissectors/packet-radiotap.c
index 06986b780d..94a708c341 100644
--- a/epan/dissectors/packet-radiotap.c
+++ b/epan/dissectors/packet-radiotap.c
@@ -1294,7 +1294,7 @@ dissect_radiotap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->pseudo_header->ieee_802_11.fcs_len = 0;
/* Grab the rest of the frame. */
- next_tvb = tvb_new_subset(tvb, length, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, length);
/* If we had an in-header FCS, check it.
* This can only happen if the backward-compat configuration option
diff --git a/epan/dissectors/packet-raw.c b/epan/dissectors/packet-raw.c
index 6280977c5e..0697bc97d2 100644
--- a/epan/dissectors/packet-raw.c
+++ b/epan/dissectors/packet-raw.c
@@ -134,18 +134,18 @@ dissect_raw(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* The Linux ISDN driver sends a fake MAC address before the PPP header
* on its ippp interfaces... */
else if (tvb_get_ntohs(tvb, 6) == 0xff03) {
- next_tvb = tvb_new_subset(tvb, 6, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 6);
call_dissector(ppp_hdlc_handle, next_tvb, pinfo, tree);
}
/* ...except when it just puts out one byte before the PPP header... */
else if (tvb_get_ntohs(tvb, 1) == 0xff03) {
- next_tvb = tvb_new_subset(tvb, 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
call_dissector(ppp_hdlc_handle, next_tvb, pinfo, tree);
}
/* ...and if the connection is currently down, it sends 10 bytes of zeroes
* instead of a fake MAC address and PPP header. */
else if (memcmp(tvb_get_ptr(tvb, 0, 10), zeroes, 10) == 0) {
- next_tvb = tvb_new_subset(tvb, 10, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 10);
call_dissector(ip_handle, next_tvb, pinfo, tree);
}
else {
diff --git a/epan/dissectors/packet-redback.c b/epan/dissectors/packet-redback.c
index 64141df585..c08d9888a1 100644
--- a/epan/dissectors/packet-redback.c
+++ b/epan/dissectors/packet-redback.c
@@ -94,7 +94,7 @@ dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* IP on Ethernet - Incoming data points to an ethernet header
* outgoing we have a pure IPv4 Packet
*/
- next_tvb = tvb_new_subset(tvb, dataoff, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff);
if (dataoff == l3off)
call_dissector(ipv4_handle, next_tvb, pinfo, tree);
else if (dataoff+2 == l3off)
@@ -112,17 +112,17 @@ dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* the ethernet and CLNP headers ...
*
*/
- next_tvb = tvb_new_subset(tvb, dataoff, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff);
if (l3off > dataoff) {
call_dissector(ethnofcs_handle, next_tvb, pinfo, tree);
} else {
guint8 nlpid = tvb_get_guint8(tvb, dataoff);
if(dissector_try_port(osinl_subdissector_table, nlpid, next_tvb, pinfo, tree))
break;
- next_tvb = tvb_new_subset(tvb, dataoff+1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff+1);
if(dissector_try_port(osinl_excl_subdissector_table, nlpid, next_tvb, pinfo, tree))
break;
- next_tvb = tvb_new_subset(tvb, dataoff, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
break;
@@ -135,11 +135,11 @@ dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
flags = tvb_get_ntohl(tvb, 4);
if (flags & 0x00400000) {
- next_tvb = tvb_new_subset(tvb, dataoff, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff);
} else {
if (tree)
proto_tree_add_item(rbtree, hf_redback_unknown, tvb, dataoff, 4, FALSE);
- next_tvb = tvb_new_subset(tvb, dataoff+4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff+4);
}
if (l3off == dataoff) {
@@ -152,7 +152,7 @@ dissect_redback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case 0x03: /* Unicast Ethernet tx - Seen with PPPoE PADO */
case 0x04: /* Unicast Ethernet rx - Seen with ARP */
case 0x08: /* Broadcast Ethernet rx - Seen with PPPoE PADI */
- next_tvb = tvb_new_subset(tvb, dataoff, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, dataoff);
call_dissector(ethnofcs_handle, next_tvb, pinfo, tree);
break;
default:
diff --git a/epan/dissectors/packet-redbackli.c b/epan/dissectors/packet-redbackli.c
index 88070b02b6..7bd0853e3d 100644
--- a/epan/dissectors/packet-redbackli.c
+++ b/epan/dissectors/packet-redbackli.c
@@ -173,7 +173,7 @@ redbackli_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
len-=2+avplen;
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(ip_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-rmcp.c b/epan/dissectors/packet-rmcp.c
index 283dd76c5e..aefe7a91d0 100644
--- a/epan/dissectors/packet-rmcp.c
+++ b/epan/dissectors/packet-rmcp.c
@@ -137,7 +137,7 @@ dissect_rmcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (!type){ /* do not expect a data block for an ACK */
- next_tvb = tvb_new_subset(tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 4);
if (!dissector_try_port(rmcp_dissector_table, class, next_tvb, pinfo,
tree))
@@ -170,7 +170,7 @@ dissect_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* be done according to 3.2.3.3.3 of the specification.
* This is only valid for session ID equals 0
*/
- next_tvb = tvb_new_subset(tvb, 8, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 8);
dissect_rmcp(next_tvb, pinfo, tree);
return tvb_length(tvb);
diff --git a/epan/dissectors/packet-rmi.c b/epan/dissectors/packet-rmi.c
index c7f675c488..ab8925225b 100644
--- a/epan/dissectors/packet-rmi.c
+++ b/epan/dissectors/packet-rmi.c
@@ -218,7 +218,7 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(message == RMI_INPUTSTREAM_MESSAGE_RETURNDATA) {
proto_tree_add_text(rmi_tree, tvb, offset + 1, -1,
"Serialization Data");
- next_tvb = tvb_new_subset(tvb, offset + 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset + 1);
dissect_ser(next_tvb, tree);
}
break;
@@ -230,7 +230,7 @@ dissect_rmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(rmi_tree, tvb, offset + 1, -1,
"Serialization Data");
/* XXX */
- next_tvb = tvb_new_subset(tvb, offset + 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset + 1);
dissect_ser(next_tvb, tree);
}
if(message == RMI_OUTPUTSTREAM_MESSAGE_DGCACK) {
diff --git a/epan/dissectors/packet-rmp.c b/epan/dissectors/packet-rmp.c
index bfeab73a6d..e1fea09ef1 100644
--- a/epan/dissectors/packet-rmp.c
+++ b/epan/dissectors/packet-rmp.c
@@ -142,7 +142,7 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_rmp_filename, tvb, 30, 1, FALSE);
if(tvb_offset_exists(tvb, len+31))
call_dissector(data_handle,
- tvb_new_subset(tvb, len+31, -1, -1),
+ tvb_new_subset_remaining(tvb, len+31),
pinfo, tree);
break;
@@ -160,7 +160,7 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_rmp_filename, tvb, 10, 1, FALSE);
if(tvb_offset_exists(tvb, len+11))
call_dissector(data_handle,
- tvb_new_subset(tvb, len+11, -1, -1),
+ tvb_new_subset_remaining(tvb, len+11),
pinfo, tree);
break;
@@ -175,7 +175,7 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_rmp_size, tvb, 8, 2, FALSE);
if(tvb_offset_exists(tvb, 10))
call_dissector(data_handle,
- tvb_new_subset(tvb, 10, -1, -1),
+ tvb_new_subset_remaining(tvb, 10),
pinfo, tree);
break;
@@ -186,8 +186,8 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_rmp_offset, tvb, 2, 4, FALSE);
proto_tree_add_item(rmp_tree,
hf_rmp_sessionid, tvb, 6, 2, FALSE);
- call_dissector(data_handle, tvb_new_subset(tvb,
- 8, -1, -1), pinfo, rmp_tree);
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb,
+ 8), pinfo, rmp_tree);
break;
case RMP_BOOT_DONE:
@@ -199,12 +199,12 @@ dissect_rmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_rmp_sessionid, tvb, 6, 2, FALSE);
if(tvb_offset_exists(tvb, 8))
call_dissector(data_handle,
- tvb_new_subset(tvb, 6, -1, -1),
+ tvb_new_subset_remaining(tvb, 6),
pinfo, tree);
break;
default:
- 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);
}
}
}
diff --git a/epan/dissectors/packet-rmt-alc.c b/epan/dissectors/packet-rmt-alc.c
index 2538dd8292..957e4401b5 100644
--- a/epan/dissectors/packet-rmt-alc.c
+++ b/epan/dissectors/packet-rmt-alc.c
@@ -185,7 +185,7 @@ static void dissect_alc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Add the Payload item */
if (tvb_length(tvb) > offset){
if(is_flute){
- new_tvb = tvb_new_subset(tvb,offset,-1,-1);
+ new_tvb = tvb_new_subset_remaining(tvb,offset);
call_dissector(xml_handle, new_tvb, pinfo, alc_tree);
}else{
proto_tree_add_none_format(alc_tree, hf.payload, tvb, offset, -1, "Payload (%u bytes)", tvb_length(tvb) - offset);
diff --git a/epan/dissectors/packet-roofnet.c b/epan/dissectors/packet-roofnet.c
index 9e461e1400..08283d5cee 100644
--- a/epan/dissectors/packet-roofnet.c
+++ b/epan/dissectors/packet-roofnet.c
@@ -192,7 +192,7 @@ static void dissect_roofnet_data(proto_tree *tree, tvbuff_t *tvb, packet_info *
return;
/* dissect ip payload */
- call_dissector(ip_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ call_dissector(ip_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c
index d1d407ea61..421394fb28 100644
--- a/epan/dissectors/packet-rpc.c
+++ b/epan/dissectors/packet-rpc.c
@@ -2476,7 +2476,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* whatever's left as data.
*/
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, rpc_tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, rpc_tree);
return TRUE;
}
@@ -2673,7 +2673,7 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, ptree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, ptree);
}
/* XXX this should really loop over all fhandles registred for the frame */
diff --git a/epan/dissectors/packet-rpl.c b/epan/dissectors/packet-rpl.c
index a2746d8349..fd04576c6a 100644
--- a/epan/dissectors/packet-rpl.c
+++ b/epan/dissectors/packet-rpl.c
@@ -253,13 +253,13 @@ dissect_rpl_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, 4, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, 4), pinfo,
tree);
break;
}
if (tvb_reported_length(tvb) > offset)
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
}
static void
@@ -286,13 +286,13 @@ dissect_rpl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hidden_item = proto_tree_add_uint(rpl_tree, hf_rpl_type, tvb, 2, 2,
rpl_type);
PROTO_ITEM_SET_HIDDEN(hidden_item);
- next_tvb = tvb_new_subset(tvb, 0, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0);
set_actual_length(next_tvb, rpl_len);
dissect_rpl_container(next_tvb, pinfo, rpl_tree);
if (tvb_reported_length(tvb) > rpl_len)
call_dissector(data_handle,
- tvb_new_subset(tvb, rpl_len, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, rpl_len), pinfo,
tree);
}
}
diff --git a/epan/dissectors/packet-rtnet.c b/epan/dissectors/packet-rtnet.c
index f759520cb9..93ff5f6388 100644
--- a/epan/dissectors/packet-rtnet.c
+++ b/epan/dissectors/packet-rtnet.c
@@ -638,7 +638,7 @@ dissect_rtmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
else
offset += 4;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (ver == 1)
switch (type) {
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index e849f45f1a..f4a545c92b 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -1298,7 +1298,7 @@ dissect_rtp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
if ( tree ) proto_tree_add_text(rtp_tree, tvb, 0, 0,
"Frame has padding, but not all the frame data was captured");
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1),
+ tvb_new_subset_remaining(tvb, offset),
pinfo, rtp_tree);
return;
}
diff --git a/epan/dissectors/packet-rudp.c b/epan/dissectors/packet-rudp.c
index 5f31db4933..8cbde45172 100644
--- a/epan/dissectors/packet-rudp.c
+++ b/epan/dissectors/packet-rudp.c
@@ -136,7 +136,7 @@ dissect_rudp(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
}
}
- next_tvb = tvb_new_subset(tvb, hlen, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, hlen);
if (tvb_length(next_tvb) && sm_handle)
call_dissector(sm_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-rx.c b/epan/dissectors/packet-rx.c
index 9816453b7a..e70cb18051 100644
--- a/epan/dissectors/packet-rx.c
+++ b/epan/dissectors/packet-rx.c
@@ -580,7 +580,7 @@ dissect_rx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
void* pd_save;
pd_save = pinfo->private_data;
pinfo->private_data = &rxinfo;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(afs_handle, next_tvb, pinfo, parent_tree);
pinfo->private_data = pd_save;
};
diff --git a/epan/dissectors/packet-sap.c b/epan/dissectors/packet-sap.c
index 3d6d93c5d8..6ad82ccfc1 100644
--- a/epan/dissectors/packet-sap.c
+++ b/epan/dissectors/packet-sap.c
@@ -270,7 +270,7 @@ dissect_sap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Done with SAP */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(sdp_handle, next_tvb, pinfo, tree);
return;
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c
index c38e0256a3..b1ba98ea8e 100644
--- a/epan/dissectors/packet-sctp.c
+++ b/epan/dissectors/packet-sctp.c
@@ -1006,7 +1006,7 @@ static void
dissect_unrecognized_parameters_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *parameter_tree)
{
/* FIXME: Does it contain one or more parameters? */
- dissect_parameter(tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, -1, -1), pinfo, parameter_tree, NULL, FALSE);
+ dissect_parameter(tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET), pinfo, parameter_tree, NULL, FALSE);
}
#define COOKIE_PRESERVATIVE_PARAMETER_INCR_LENGTH 4
diff --git a/epan/dissectors/packet-sdlc.c b/epan/dissectors/packet-sdlc.c
index 1aa9b3bd4c..886dec36ab 100644
--- a/epan/dissectors/packet-sdlc.c
+++ b/epan/dissectors/packet-sdlc.c
@@ -133,7 +133,7 @@ dissect_sdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* XXX - is there an FCS at the end, at least in Sniffer
* captures? (There doesn't appear to be.)
*/
- next_tvb = tvb_new_subset(tvb, sdlc_header_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, sdlc_header_len);
if (XDLC_IS_INFORMATION(control)) {
/* call the SNA dissector */
call_dissector(sna_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index f59e33b876..091073ecad 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -1017,7 +1017,7 @@ static void dissect_sdp_session_attribute(tvbuff_t *tvb, packet_info * pinfo, pr
tvbuff_t *key_tvb;
proto_item *key_ti;
- key_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ key_tvb = tvb_new_subset_remaining(tvb, offset);
key_ti = proto_tree_add_item(sdp_session_attribute_tree, hf_key_mgmt_att_value, key_tvb, 0, -1, FALSE);
dissect_key_mgmt(key_tvb, pinfo, key_ti);
diff --git a/epan/dissectors/packet-ses.c b/epan/dissectors/packet-ses.c
index 7a873ec158..9f518609fd 100644
--- a/epan/dissectors/packet-ses.c
+++ b/epan/dissectors/packet-ses.c
@@ -1067,7 +1067,7 @@ dissect_spdu(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
/* Dissect user information, if present */
if (has_user_information) {
if (tvb_reported_length_remaining(tvb, offset) > 0 || type == SES_MAJOR_SYNC_POINT) {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/* do we have OSI presentation packet dissector ? */
if(!pres_handle)
diff --git a/epan/dissectors/packet-simulcrypt.c b/epan/dissectors/packet-simulcrypt.c
index 48123ef81f..ec3b31ebf8 100644
--- a/epan/dissectors/packet-simulcrypt.c
+++ b/epan/dissectors/packet-simulcrypt.c
@@ -579,7 +579,7 @@ dissect_ecmg_parameter_value (proto_tree *tree, tvbuff_t *tvb, packet_info *pinf
{
if(tab_ecm_inter[i].ecmg_port==pinfo->srcport) /* ECMG source port */
{ /* recognise port & ca_system_id and hence protocol name for ECM datagram */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
simulcrypt_ecm_datagram_tree = proto_item_add_subtree(simulcrypt_item, ett_simulcrypt_ecm_datagram);
if(tab_ecm_inter[i].protocol_handle != NULL)
{
diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c
index 6ef8ed39d9..68a10bb0a1 100644
--- a/epan/dissectors/packet-sll.c
+++ b/epan/dissectors/packet-sll.c
@@ -227,7 +227,7 @@ dissect_sll(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
protocol = tvb_get_ntohs(tvb, 14);
- next_tvb = tvb_new_subset(tvb, SLL_HEADER_SIZE, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, SLL_HEADER_SIZE);
if (protocol <= 1536) { /* yes, 1536 - that's how Linux does it */
/*
* "proto" is *not* a length field, it's a Linux internal
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c
index f59d63a565..bfdf1f2381 100644
--- a/epan/dissectors/packet-smb.c
+++ b/epan/dissectors/packet-smb.c
@@ -13164,7 +13164,7 @@ dissect_transaction_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* A tvbuff containing the parameters and the
* data.
*/
- pd_tvb = tvb_new_subset(tvb, po, -1, -1);
+ pd_tvb = tvb_new_subset_remaining(tvb, po);
dissected_trans = dissect_pipe_smb(sp_tvb,
s_tvb, pd_tvb, p_tvb, d_tvb, an+6, pinfo,
@@ -15099,7 +15099,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
} else {
s_tvb = tvb_new_subset(tvb, offset, 2*sc, 2*sc);
}
- sp_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ sp_tvb = tvb_new_subset_remaining(tvb, offset);
} else {
s_tvb = NULL;
sp_tvb=NULL;
@@ -15181,7 +15181,7 @@ dissect_transaction_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
* XXX - check pc and dc as well?
*/
if (tvb_length_remaining(tvb, po)){
- pd_tvb = tvb_new_subset(tvb, po, -1, -1);
+ pd_tvb = tvb_new_subset_remaining(tvb, po);
}
}
}
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 088b85913f..cbae408b2a 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -5461,7 +5461,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
}
proto_item_set_len(item, chain_offset);
- next_tvb = tvb_new_subset(tvb, chain_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, chain_offset);
offset = dissect_smb2(next_tvb, pinfo, parent_tree, FALSE);
}
diff --git a/epan/dissectors/packet-sna.c b/epan/dissectors/packet-sna.c
index f6123611da..5e4895dd3e 100644
--- a/epan/dissectors/packet-sna.c
+++ b/epan/dissectors/packet-sna.c
@@ -894,7 +894,7 @@ dissect_optional_0e(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_offset_exists(tvb, offset))
call_dissector(data_handle,
- tvb_new_subset(tvb, 4, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, 4), pinfo, tree);
}
if (bits & 0x40) {
col_set_str(pinfo->cinfo, COL_INFO, "HPR Idle Message");
@@ -912,7 +912,7 @@ dissect_optional_0f(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tree, hf_sna_nlp_opti_0f_bits, tvb, 2, 2, FALSE);
if (tvb_offset_exists(tvb, 4))
call_dissector(data_handle,
- tvb_new_subset(tvb, 4, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, 4), pinfo, tree);
}
static void
@@ -925,7 +925,7 @@ dissect_optional_10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(tree, hf_sna_nlp_opti_10_tcid, tvb, 4, 8, FALSE);
if (tvb_offset_exists(tvb, 12))
call_dissector(data_handle,
- tvb_new_subset(tvb, 12, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, 12), pinfo, tree);
}
static void
@@ -958,7 +958,7 @@ dissect_optional_14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((type != 0x83) || (len <= 16)) {
/* Invalid */
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
sub_item = proto_tree_add_text(tree, tvb, offset, len,
@@ -1010,7 +1010,7 @@ dissect_optional_14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if ((type != 0x85) || ( len < 4)) {
/* Invalid */
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
sub_item = proto_tree_add_text(tree, tvb, offset, len,
@@ -1044,7 +1044,7 @@ dissect_optional_14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
} else {
/* Invalid */
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
/* No padding here */
@@ -1103,11 +1103,11 @@ dissect_optional_22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_offset_exists(tvb, 20))
call_dissector(data_handle,
- tvb_new_subset(tvb, 20, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, 20), pinfo, tree);
} else {
if (tvb_offset_exists(tvb, 12))
call_dissector(data_handle,
- tvb_new_subset(tvb, 12, -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, 12), pinfo, tree);
}
}
@@ -1131,8 +1131,7 @@ dissect_optional(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (len == 0) {
if (tree)
call_dissector(data_handle,
- tvb_new_subset(tvb, offset,
- -1, -1), pinfo, tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
@@ -1273,7 +1272,7 @@ dissect_nlp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_offset_exists(tvb, index))
call_dissector(data_handle,
- tvb_new_subset(tvb, index, -1, -1),
+ tvb_new_subset_remaining(tvb, index),
pinfo, parent_tree);
return;
}
@@ -1368,7 +1367,7 @@ dissect_nlp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_set_str(pinfo->cinfo, COL_INFO, "HPR Fragment");
if (tvb_offset_exists(tvb, index)) {
call_dissector(data_handle,
- tvb_new_subset(tvb, index, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, index), pinfo,
parent_tree);
}
return;
@@ -1377,17 +1376,17 @@ dissect_nlp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Transmission Header Format Identifier */
fid = hi_nibble(tvb_get_guint8(tvb, index));
if (fid == 5) /* Only FID5 allowed for HPR */
- dissect_fid(tvb_new_subset(tvb, index, -1, -1), pinfo,
+ dissect_fid(tvb_new_subset_remaining(tvb, index), pinfo,
tree, parent_tree);
else {
if (tvb_get_ntohs(tvb, index+2) == 0x12ce) {
/* Route Setup */
col_set_str(pinfo->cinfo, COL_INFO, "HPR Route Setup");
- dissect_gds(tvb_new_subset(tvb, index, -1, -1),
+ dissect_gds(tvb_new_subset_remaining(tvb, index),
pinfo, tree, parent_tree);
} else
call_dissector(data_handle,
- tvb_new_subset(tvb, index, -1, -1),
+ tvb_new_subset_remaining(tvb, index),
pinfo, parent_tree);
}
}
@@ -1599,7 +1598,7 @@ dissect_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_offset_exists(tvb, len))
call_dissector(data_handle,
- tvb_new_subset(tvb, len, -1, -1), pinfo, parent_tree);
+ tvb_new_subset_remaining(tvb, len), pinfo, parent_tree);
}
/* --------------------------------------------------------------------
@@ -2194,7 +2193,7 @@ dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, 1, -1, -1), pinfo, parent_tree);
+ tvb_new_subset_remaining(tvb, 1), pinfo, parent_tree);
return;
}
@@ -2212,7 +2211,7 @@ dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* If the FID dissector function didn't create an rh_tvb, then we just
* use the rest of our tvbuff as the rh_tvb. */
if (!rh_tvb)
- rh_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ rh_tvb = tvb_new_subset_remaining(tvb, offset);
rh_offset = 0;
/* Process the rest of the SNA packet, starting with RH */
@@ -2238,7 +2237,7 @@ dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
call_dissector(data_handle,
- tvb_new_subset(rh_tvb, rh_offset, -1, -1),
+ tvb_new_subset_remaining(rh_tvb, rh_offset),
pinfo, parent_tree);
}
}
@@ -2548,7 +2547,7 @@ dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (tvb_offset_exists(tvb, offset))
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, parent_tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, parent_tree);
}
/* --------------------------------------------------------------------
diff --git a/epan/dissectors/packet-snaeth.c b/epan/dissectors/packet-snaeth.c
index bd9b3b278c..c0ba428715 100644
--- a/epan/dissectors/packet-snaeth.c
+++ b/epan/dissectors/packet-snaeth.c
@@ -74,7 +74,7 @@ dissect_snaeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* Rest of packet starts with an 802.2 LLC header.
*/
- next_tvb = tvb_new_subset(tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 3);
call_dissector(llc_handle, next_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-sndcp.c b/epan/dissectors/packet-sndcp.c
index 2deafb641a..2f8f008816 100644
--- a/epan/dissectors/packet-sndcp.c
+++ b/epan/dissectors/packet-sndcp.c
@@ -308,7 +308,7 @@ dissect_sndcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* handle N-PDU data, reassemble if necessary
*/
if (first && !more_frags) {
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
if (!dcomp && !pcomp) {
call_dissector(ip_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-snmp.c b/epan/dissectors/packet-snmp.c
index b9cf529113..180bcd1b47 100644
--- a/epan/dissectors/packet-snmp.c
+++ b/epan/dissectors/packet-snmp.c
@@ -2761,7 +2761,7 @@ dissect_snmp_pdu(tvbuff_t *tvb, int offset, packet_info *pinfo,
* data which needs to be dissected in case of UDP as UDP is PDU oriented.
*/
if((!is_tcp) && (length_remaining > (guint)offset)) {
- 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);
}
else{
diff --git a/epan/dissectors/packet-spnego.c b/epan/dissectors/packet-spnego.c
index ece1e1b111..a92eb40d00 100644
--- a/epan/dissectors/packet-spnego.c
+++ b/epan/dissectors/packet-spnego.c
@@ -561,7 +561,7 @@ dissect_spnego_InnerContextToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i
* token it dissected, so we can return the length of the part
* we (and it) dissected.
*/
- token_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ token_tvb = tvb_new_subset_remaining(tvb, offset);
if (next_level_value && next_level_value->wrap_handle) {
len = call_dissector(next_level_value->wrap_handle, token_tvb, actx->pinfo,
subtree);
@@ -782,7 +782,7 @@ dissect_spnego_krb5(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case KRB_TOKEN_AP_REQ:
case KRB_TOKEN_AP_REP:
case KRB_TOKEN_AP_ERR:
- krb5_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ krb5_tvb = tvb_new_subset_remaining(tvb, offset);
offset = dissect_kerberos_main(krb5_tvb, pinfo, subtree, FALSE, NULL);
break;
@@ -1562,7 +1562,7 @@ dissect_spnego_krb5_cfx_wrap_base(tvbuff_t *tvb, int offset, packet_info *pinfo
}
#if defined(HAVE_HEIMDAL_KERBEROS) || defined(HAVE_MIT_KERBEROS)
- pinfo->gssapi_encrypted_tvb = tvb_new_subset(tvb, 16, -1, -1);
+ pinfo->gssapi_encrypted_tvb = tvb_new_subset_remaining(tvb, 16);
if (flags & 0x0002) {
if(pinfo->gssapi_encrypted_tvb){
diff --git a/epan/dissectors/packet-spp.c b/epan/dissectors/packet-spp.c
index 10605bb487..7353dc9710 100644
--- a/epan/dissectors/packet-spp.c
+++ b/epan/dissectors/packet-spp.c
@@ -194,7 +194,7 @@ dissect_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
high_socket = pinfo->destport;
}
- next_tvb = tvb_new_subset(tvb, SPP_HEADER_LEN, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, SPP_HEADER_LEN);
if (dissector_try_port(spp_socket_dissector_table, low_socket,
next_tvb, pinfo, tree))
return;
diff --git a/epan/dissectors/packet-srp.c b/epan/dissectors/packet-srp.c
index f0f5659929..8e2b8dadf3 100644
--- a/epan/dissectors/packet-srp.c
+++ b/epan/dissectors/packet-srp.c
@@ -96,7 +96,7 @@ static void dissect_ccsrl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree
/* XXX currently, we always dissect as H245. It's not necessarily
that though.
*/
- next_tvb = tvb_new_subset(tvb, 1, -1, -1 );
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
call_dissector( h245dg_handle, next_tvb, pinfo, ccsrl_tree );
}
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index 0da783c1ba..f98c0db0a9 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -1159,7 +1159,7 @@ process_ssl_payload(tvbuff_t *tvb, volatile int offset, packet_info *pinfo,
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (association && association->handle) {
ssl_debug_printf("dissect_ssl3_record found association %p\n", (void *)association);
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 258d3f0875..9508663e6c 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -617,7 +617,7 @@ dissect_registration_result_parameter(tvbuff_t *parameter_tvb, proto_tree *param
{
tvbuff_t *parameters_tvb;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, NULL, NULL);
}
@@ -626,7 +626,7 @@ dissect_deregistration_result_parameter(tvbuff_t *parameter_tvb, proto_tree *par
{
tvbuff_t *parameters_tvb;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, NULL, NULL);
}
@@ -738,7 +738,7 @@ dissect_source_address_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_
proto_tree_add_item(address_indicator_tree, hf_source_address_ssn_bit, parameter_tvb, ADDRESS_INDICATOR_OFFSET, ADDRESS_INDICATOR_LENGTH, NETWORK_BYTE_ORDER);
}
- parameters_tvb = tvb_new_subset(parameter_tvb, ADDRESS_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, ADDRESS_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, ssn, NULL);
}
@@ -759,7 +759,7 @@ dissect_destination_address_parameter(tvbuff_t *parameter_tvb, proto_tree *param
proto_tree_add_item(address_indicator_tree, hf_destination_address_ssn_bit, parameter_tvb, ADDRESS_INDICATOR_OFFSET, ADDRESS_INDICATOR_LENGTH, NETWORK_BYTE_ORDER);
}
- parameters_tvb = tvb_new_subset(parameter_tvb, ADDRESS_PARAMETERS_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, ADDRESS_PARAMETERS_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, NULL, ssn);
}
@@ -991,7 +991,7 @@ dissect_routing_key_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tre
{
tvbuff_t *parameters_tvb;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, NULL, NULL);
}
#define DRN_START_LENGTH 1
@@ -1033,7 +1033,7 @@ dissect_address_range_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_t
{
tvbuff_t *parameters_tvb;
- parameters_tvb = tvb_new_subset(parameter_tvb, PARAMETER_VALUE_OFFSET, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(parameter_tvb, PARAMETER_VALUE_OFFSET);
dissect_parameters(parameters_tvb, parameter_tree, NULL, NULL, NULL);
}
@@ -1904,7 +1904,7 @@ dissect_sua_message(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *sua_t
common_header_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, sua_tree);
- parameters_tvb = tvb_new_subset(message_tvb, COMMON_HEADER_LENGTH, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(message_tvb, COMMON_HEADER_LENGTH);
dissect_parameters(parameters_tvb, sua_tree, &data_tvb, &source_ssn, &dest_ssn);
if ( message_class == MESSAGE_CLASS_CO_MESSAGE) {
diff --git a/epan/dissectors/packet-symantec.c b/epan/dissectors/packet-symantec.c
index b36e0e03e7..f045e83e40 100644
--- a/epan/dissectors/packet-symantec.c
+++ b/epan/dissectors/packet-symantec.c
@@ -93,7 +93,7 @@ dissect_symantec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(symantec_tree, hf_symantec_etype, tvb,
6, 2, etypev2);
}
- next_tvb = tvb_new_subset(tvb, 44, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 44);
dissector_try_port(ethertype_dissector_table, etypev2, next_tvb, pinfo,
tree);
}
@@ -116,7 +116,7 @@ dissect_symantec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* availability of a capture file from an SGSv3 box using VLAN
* tagging.
*/
- next_tvb = tvb_new_subset(tvb, 56, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 56);
dissector_try_port(ethertype_dissector_table, etypev3, next_tvb, pinfo,
tree);
}
diff --git a/epan/dissectors/packet-t38.c b/epan/dissectors/packet-t38.c
index 80a152d603..539adbaa3e 100644
--- a/epan/dissectors/packet-t38.c
+++ b/epan/dissectors/packet-t38.c
@@ -1163,7 +1163,7 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
while(tvb_length_remaining(tvb,offset)>0)
{
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_IFPPacket_PDU(next_tvb, pinfo, tr);
ifp_packet_number++;
diff --git a/epan/dissectors/packet-tali.c b/epan/dissectors/packet-tali.c
index ab2a254fc6..8fc5115230 100644
--- a/epan/dissectors/packet-tali.c
+++ b/epan/dissectors/packet-tali.c
@@ -122,7 +122,7 @@ dissect_tali_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
if (length > 0) {
- payload_tvb = tvb_new_subset(tvb, TALI_HEADER_LENGTH, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, TALI_HEADER_LENGTH);
if (payload_tvb != NULL && !dissector_try_string(tali_dissector_table, opcode, payload_tvb, pinfo, tree)) {
call_dissector(data_handle, payload_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c
index d76fceba27..137f42c204 100644
--- a/epan/dissectors/packet-tcp.c
+++ b/epan/dissectors/packet-tcp.c
@@ -2771,7 +2771,7 @@ decode_tcp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
/* determine if this packet is part of a conversation and call dissector */
/* for the conversation if available */
diff --git a/epan/dissectors/packet-tds.c b/epan/dissectors/packet-tds.c
index 04dca9b076..413570451b 100644
--- a/epan/dissectors/packet-tds.c
+++ b/epan/dissectors/packet-tds.c
@@ -1677,7 +1677,7 @@ dissect_netlib_buffer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (status == STATUS_NOT_LAST_BUFFER)
next_tvb = NULL;
else {
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
}
}
@@ -1711,7 +1711,7 @@ dissect_netlib_buffer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
} else {
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tds_tree);
}
}
diff --git a/epan/dissectors/packet-teamspeak2.c b/epan/dissectors/packet-teamspeak2.c
index 83f6ea3cb2..74c833f1ab 100644
--- a/epan/dissectors/packet-teamspeak2.c
+++ b/epan/dissectors/packet-teamspeak2.c
@@ -442,11 +442,11 @@ static void ts2_standard_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (new_tvb)
next_tvb = new_tvb;
else
- next_tvb = tvb_new_subset(tvb, 24, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 24);
pinfo->fragmented = save_fragmented;
}
else
- next_tvb = tvb_new_subset(tvb, 24, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 24);
/* If we have a full packet now dissect it */
if((new_tvb || !frag->fragmented) && !frag->outoforder)
diff --git a/epan/dissectors/packet-telkonet.c b/epan/dissectors/packet-telkonet.c
index 8903a5b5b1..de74c8f863 100644
--- a/epan/dissectors/packet-telkonet.c
+++ b/epan/dissectors/packet-telkonet.c
@@ -81,7 +81,7 @@ dissect_telkonet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 8;
if (type == TELKONET_TYPE_TUNNEL)
- call_dissector(eth_withoutfcs_handle, tvb_new_subset(tvb, offset, -1, -1),
+ call_dissector(eth_withoutfcs_handle, tvb_new_subset_remaining(tvb, offset),
pinfo, tree);
}
diff --git a/epan/dissectors/packet-teredo.c b/epan/dissectors/packet-teredo.c
index 64bfc8aaf9..5600c8e7fb 100644
--- a/epan/dissectors/packet-teredo.c
+++ b/epan/dissectors/packet-teredo.c
@@ -207,7 +207,7 @@ decode_teredo_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,proto_tree *tr
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (dissector_try_port(teredo_dissector_table, th_header, next_tvb, pinfo, tree))
return;
diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c
index b6f3e96e76..127d841458 100644
--- a/epan/dissectors/packet-tipc.c
+++ b/epan/dissectors/packet-tipc.c
@@ -1340,7 +1340,7 @@ dissect_tipc_v2_internal_msg(tvbuff_t *tipc_tvb, proto_tree *tipc_tree, packet_i
}
/* W10 */
/* dissect the (one or more) Publications */
- data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1);
+ data_tvb = tvb_new_subset_remaining(tipc_tvb, offset);
dissect_tipc_name_dist_data(data_tvb, tipc_tree, item_size);
break;
case TIPCv2_MSG_FRAGMENTER:
@@ -1919,7 +1919,7 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
case 1: /* ORIGINAL_MSG */
proto_tree_add_text(tipc_tree, tvb, offset, -1, "TIPC_CHANGEOVER_PROTOCOL %s (%u)",
val_to_str(msg_type, tipc_cng_prot_msg_type_values, "unknown"), msg_type);
- data_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ data_tvb = tvb_new_subset_remaining(tvb, offset);
if (check_col(pinfo->cinfo, COL_INFO))
col_set_fence(pinfo->cinfo, COL_INFO);
dissect_tipc(data_tvb, pinfo, tipc_tree);
@@ -1978,7 +1978,7 @@ dissect_tipc_int_prot_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tipc_tr
if (new_tvb) { /* take it all */
next_tvb = new_tvb;
} else { /* make a new subset */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
}
pinfo->fragmented = save_fragmented;
if (new_tvb) {
@@ -2273,7 +2273,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = offset + 8;
tipc_data_item = proto_tree_add_text(tipc_tree, tvb, offset, -1, "TIPC_NAME_DISTRIBUTOR %u bytes User Data", (msg_size - hdr_size*4));
tipc_data_tree = proto_item_add_subtree(tipc_data_item , ett_tipc_data);
- data_tvb = tvb_new_subset(tipc_tvb, offset, -1, -1);
+ data_tvb = tvb_new_subset_remaining(tipc_tvb, offset);
dissect_tipc_name_dist_data(data_tvb, tipc_data_tree, 0);
return;
} else {
@@ -2295,7 +2295,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_text(tipc_tree, tipc_tvb, offset, -1, "%u bytes Data", (msg_size - hdr_size*4));
break;
case TIPC_NAMED_MSG:
- data_tvb = tvb_new_subset(tipc_tvb, offset+14, -1, -1);
+ data_tvb = tvb_new_subset_remaining(tipc_tvb, offset+14);
proto_tree_add_text(tipc_tree, tipc_tvb, offset, 14, "TIPC_NAMED_MSG Hdr");
proto_tree_add_text(tipc_tree, data_tvb, 0, -1, "%u bytes Data", (msg_size - hdr_size*4));
break;
@@ -2307,7 +2307,7 @@ dissect_tipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
/* tipc data type user doesn't change format, reuse v2 function */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_tipc_v2_data_subdissectors(next_tvb, pinfo, name_type_p, user);
}
} /*if (hdr_size <= 5) */
diff --git a/epan/dissectors/packet-tns.c b/epan/dissectors/packet-tns.c
index 4c75b81027..5e2b7b8eda 100644
--- a/epan/dissectors/packet-tns.c
+++ b/epan/dissectors/packet-tns.c
@@ -310,7 +310,7 @@ static void dissect_tns_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
if ( data_tree )
{
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo, data_tree);
+ tvb_new_subset_remaining(tvb, offset), pinfo, data_tree);
}
return;
@@ -1005,7 +1005,7 @@ dissect_tns_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
call_dissector(data_handle,
- tvb_new_subset(tvb, offset, -1, -1), pinfo,
+ tvb_new_subset_remaining(tvb, offset), pinfo,
tns_tree);
break;
}
diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c
index 335ec6036c..fb75a30c7f 100644
--- a/epan/dissectors/packet-tr.c
+++ b/epan/dissectors/packet-tr.c
@@ -565,7 +565,7 @@ dissect_tr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- next_tvb = tvb_new_subset(tr_tvb, TR_MIN_HEADER_LEN + actual_rif_bytes + fixoffset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tr_tvb, TR_MIN_HEADER_LEN + actual_rif_bytes + fixoffset);
/* The package is either MAC or LLC */
switch (frame_type) {
diff --git a/epan/dissectors/packet-tte.c b/epan/dissectors/packet-tte.c
index 4063cfe2d0..eb5433b19c 100644
--- a/epan/dissectors/packet-tte.c
+++ b/epan/dissectors/packet-tte.c
@@ -126,7 +126,7 @@ dissect_tte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
TTE_MACDEST_CTID_LENGTH, FALSE);
}
- tvb_next = tvb_new_subset(tvb, TTE_HEADER_LENGTH, -1, -1);
+ tvb_next = tvb_new_subset_remaining(tvb, TTE_HEADER_LENGTH);
/* prevent the Columns to be cleared...appending cannot be prevented */
col_set_fence(pinfo->cinfo, COL_PROTOCOL);
diff --git a/epan/dissectors/packet-turbocell.c b/epan/dissectors/packet-turbocell.c
index 430d040e65..9745d4d838 100644
--- a/epan/dissectors/packet-turbocell.c
+++ b/epan/dissectors/packet-turbocell.c
@@ -195,7 +195,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/*Couldn't make sense of the apparently random data in the end*/
- next_tvb = tvb_new_subset(tvb, 0x34 + 8*i, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 0x34 + 8*i);
call_dissector(data_handle, next_tvb, pinfo, tree);
} else {
@@ -240,7 +240,7 @@ static void dissect_turbocell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
} while (remaining_length > 6);
if (remaining_length > 2) {
- next_tvb = tvb_new_subset(next_tvb, msdu_offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(next_tvb, msdu_offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
}
}
diff --git a/epan/dissectors/packet-tzsp.c b/epan/dissectors/packet-tzsp.c
index dd0940a977..eaf3802271 100644
--- a/epan/dissectors/packet-tzsp.c
+++ b/epan/dissectors/packet-tzsp.c
@@ -337,7 +337,7 @@ dissect_tzsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree)
proto_item_set_end(ti, tvb, pos);
- next_tvb = tvb_new_subset(tvb, pos, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, pos);
if (encapsulation != 0
&& (wtap_encap == -1
|| !dissector_try_port(encap_dissector_table, wtap_encap,
diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c
index 12ad165415..039a54bfe8 100644
--- a/epan/dissectors/packet-ucp.c
+++ b/epan/dissectors/packet-ucp.c
@@ -1862,7 +1862,7 @@ dissect_ucp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
if (result == UCP_SHORTENED)
return;
- tmp_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tmp_tvb = tvb_new_subset_remaining(tvb, offset);
sub_ti = proto_tree_add_item(ucp_tree, hf_ucp_oper_section, tvb,
offset, endpkt - offset, FALSE);
sub_tree = proto_item_add_subtree(sub_ti, ett_sub);
diff --git a/epan/dissectors/packet-udld.c b/epan/dissectors/packet-udld.c
index 6fef266b2c..61ecb698e8 100644
--- a/epan/dissectors/packet-udld.c
+++ b/epan/dissectors/packet-udld.c
@@ -239,7 +239,7 @@ dissect_udld(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- call_dissector(data_handle, tvb_new_subset(tvb, offset, -1, -1), pinfo, udld_tree);
+ call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, udld_tree);
}
void
diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c
index 42d771797e..5e253e0c40 100644
--- a/epan/dissectors/packet-usb.c
+++ b/epan/dissectors/packet-usb.c
@@ -1802,7 +1802,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
tvbuff_t *next_tvb;
pinfo->usb_conv_info=usb_conv_info;
- next_tvb=tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb=tvb_new_subset_remaining(tvb, offset);
if(dissector_try_port(usb_bulk_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, parent)){
return;
}
@@ -1894,7 +1894,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
case RQT_SETUP_TYPE_CLASS:
/* Try to find a class specific dissector */
- next_tvb=tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb=tvb_new_subset_remaining(tvb, offset);
if(dissector_try_port(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, tree)){
return;
}
@@ -1953,7 +1953,7 @@ dissect_linux_usb_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent,
if(usb_trans_info){
/* Try to find a class specific dissector */
- next_tvb=tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb=tvb_new_subset_remaining(tvb, offset);
if(dissector_try_port(usb_control_dissector_table, usb_conv_info->interfaceClass, next_tvb, pinfo, tree)){
return;
}
diff --git a/epan/dissectors/packet-v120.c b/epan/dissectors/packet-v120.c
index 5d1908be2c..5c1b4d27e6 100644
--- a/epan/dissectors/packet-v120.c
+++ b/epan/dissectors/packet-v120.c
@@ -166,7 +166,7 @@ dissect_v120(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_bytes_exist(tvb, v120len, 1))
v120len += dissect_v120_header(tvb, v120len, v120_tree);
proto_item_set_len(ti, v120len);
- next_tvb = tvb_new_subset(tvb, v120len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, v120len);
call_dissector(data_handle,next_tvb, pinfo, v120_tree);
}
}
diff --git a/epan/dissectors/packet-v5ua.c b/epan/dissectors/packet-v5ua.c
index 252a97a659..38cf347841 100644
--- a/epan/dissectors/packet-v5ua.c
+++ b/epan/dissectors/packet-v5ua.c
@@ -1389,7 +1389,7 @@ dissect_v5ua_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
common_header_tvb = tvb_new_subset(tvb, COMMON_HEADER_OFFSET, COMMON_HEADER_LENGTH, COMMON_HEADER_LENGTH);
dissect_common_header(common_header_tvb, pinfo, v5ua_tree);
- parameters_tvb = tvb_new_subset(tvb, COMMON_HEADER_LENGTH, -1, -1);
+ parameters_tvb = tvb_new_subset_remaining(tvb, COMMON_HEADER_LENGTH);
dissect_parameters(parameters_tvb, pinfo, tree, v5ua_tree);
if (dlci_efa >= 0 && dlci_efa <= 8175) {
if ((messageclassCopy == 0) || (messageclassCopy == 3) || (messageclassCopy == 4)) {
diff --git a/epan/dissectors/packet-vcdu.c b/epan/dissectors/packet-vcdu.c
index 8931a312e1..0f3db99d51 100644
--- a/epan/dissectors/packet-vcdu.c
+++ b/epan/dissectors/packet-vcdu.c
@@ -438,7 +438,7 @@ dissect_vcdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
apid=apid & 0x07ff;
/* printf ( "new_ptr=%d new_offset=%d apid=%d ccsds_len=%d\n", new_ptr, new_offset, apid, ccsds_len ); fflush(stdout); */
- new_tvb = tvb_new_subset(tvb, new_offset, -1, -1);
+ new_tvb = tvb_new_subset_remaining(tvb, new_offset);
call_dissector(ccsds_handle, new_tvb, pinfo, vcdu_tree);
new_offset=new_offset+ccsds_len+7;
diff --git a/epan/dissectors/packet-vines.c b/epan/dissectors/packet-vines.c
index ef87d7ac1f..a0b2022bee 100644
--- a/epan/dissectors/packet-vines.c
+++ b/epan/dissectors/packet-vines.c
@@ -157,7 +157,7 @@ dissect_vines_frp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Decode the "real" Vines now */
- next_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 2);
call_dissector(vines_ip_handle, next_tvb, pinfo, tree);
}
@@ -226,7 +226,7 @@ dissect_vines_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ptype);
}
- next_tvb = tvb_new_subset(tvb, 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 1);
if (!dissector_try_port(vines_llc_dissector_table, ptype,
next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -386,7 +386,7 @@ dissect_vines_ip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
offset += 18;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (!dissector_try_port(vines_ip_dissector_table, viph.vip_proto,
next_tvb, pinfo, tree))
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -667,7 +667,7 @@ dissect_vines_ipc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* if none of them accept the packet, or if it's not a data packet,
* dissect it as data.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (viph.vipc_pkttype != PKTTYPE_DATA ||
!dissector_try_heuristic(vines_ipc_heur_subdissector_list,
next_tvb, pinfo, tree))
@@ -794,7 +794,7 @@ dissect_vines_spp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* if none of them accept the packet, or if it's not a data packet,
* dissect it as data.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
if (viph.vspp_pkttype != PKTTYPE_DATA ||
!dissector_try_heuristic(vines_spp_heur_subdissector_list,
next_tvb, pinfo, tree))
@@ -1609,7 +1609,7 @@ dissect_vines_icp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
pinfo->in_error_pkt = TRUE;
/* Decode the first 40 bytes of the original VIP datagram. */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(vines_ip_handle, next_tvb, pinfo, vines_icp_tree);
/* Restore the "we're inside an error packet" flag. */
diff --git a/epan/dissectors/packet-wcp.c b/epan/dissectors/packet-wcp.c
index fc61c28df1..a20c86eccd 100644
--- a/epan/dissectors/packet-wcp.c
+++ b/epan/dissectors/packet-wcp.c
@@ -370,7 +370,7 @@ static void dissect_wcp( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
if ( !pinfo->fd->flags.visited){ /* if first pass */
wcp_save_data( tvb, pinfo);
}
- next_tvb = tvb_new_subset(tvb, wcp_header_len, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, wcp_header_len);
}
else { /* cmd == 0 || (cmd == 0xf && ext_cmd == 0) */
diff --git a/epan/dissectors/packet-wfleet-hdlc.c b/epan/dissectors/packet-wfleet-hdlc.c
index 06c3b812f5..76f2f44594 100644
--- a/epan/dissectors/packet-wfleet-hdlc.c
+++ b/epan/dissectors/packet-wfleet-hdlc.c
@@ -78,7 +78,7 @@ dissect_wfleet_hdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* ethernet dissector
*/
- next_tvb = tvb_new_subset(tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, 2);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c
index afa077dbff..7ac858e5b7 100644
--- a/epan/dissectors/packet-wsp.c
+++ b/epan/dissectors/packet-wsp.c
@@ -5148,7 +5148,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
add_uri (wsp_tree, pinfo, tvb, offset, nextOffset, proto_ti);
if (tree) {
offset += value + count; /* VERIFY */
- tmp_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ tmp_tvb = tvb_new_subset_remaining (tvb, offset);
add_headers (wsp_tree, tmp_tvb, hf_wsp_headers_section, pinfo);
}
break;
@@ -5207,9 +5207,8 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_reported_length_remaining(tvb,
headerStart + count + uriLength + headersLength) > 0)
{
- tmp_tvb = tvb_new_subset (tvb,
- headerStart + count + uriLength + headersLength,
- -1, -1);
+ tmp_tvb = tvb_new_subset_remaining (tvb,
+ headerStart + count + uriLength + headersLength);
/*
* Try finding a dissector for the content
* first, then fallback.
@@ -5304,8 +5303,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_reported_length_remaining(tvb, headerStart + headersLength)
> 0)
{
- tmp_tvb = tvb_new_subset (tvb, headerStart + headersLength,
- -1, -1);
+ tmp_tvb = tvb_new_subset_remaining (tvb, headerStart + headersLength);
/*
* Try finding a dissector for the content
* first, then fallback.
@@ -5384,8 +5382,7 @@ dissect_wsp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (tvb_reported_length_remaining(tvb, headerStart + headersLength)
> 0)
{
- tmp_tvb = tvb_new_subset (tvb, headerStart + headersLength,
- -1, -1);
+ tmp_tvb = tvb_new_subset_remaining (tvb, headerStart + headersLength);
/*
* Try finding a dissector for the content
* first, then fallback.
diff --git a/epan/dissectors/packet-wtp.c b/epan/dissectors/packet-wtp.c
index 923a234c97..e96abf7683 100644
--- a/epan/dissectors/packet-wtp.c
+++ b/epan/dissectors/packet-wtp.c
@@ -759,7 +759,7 @@ dissect_wtp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else if ( ((pdut == INVOKE) || (pdut == RESULT)) && (fTTR) )
{
/* Non-fragmented payload */
- wsp_tvb = tvb_new_subset(tvb, dataOffset, -1, -1);
+ wsp_tvb = tvb_new_subset_remaining(tvb, dataOffset);
/* We can safely hand the tvb to the WSP dissector */
call_dissector(wsp_handle, wsp_tvb, pinfo, tree);
}
diff --git a/epan/dissectors/packet-x224.c b/epan/dissectors/packet-x224.c
index 6ce56d7d05..8d6bd59bc5 100644
--- a/epan/dissectors/packet-x224.c
+++ b/epan/dissectors/packet-x224.c
@@ -163,7 +163,7 @@ dissect_x224_dt(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int off
offset+=1;
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(t125_handle, next_tvb, pinfo, parent_tree);
return offset;
diff --git a/epan/dissectors/packet-x25.c b/epan/dissectors/packet-x25.c
index b44e4158ed..9a5782c2e5 100644
--- a/epan/dissectors/packet-x25.c
+++ b/epan/dissectors/packet-x25.c
@@ -2485,7 +2485,7 @@ dissect_x25_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return;
if (!next_tvb)
- next_tvb = tvb_new_subset(tvb, localoffset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, localoffset);
saved_private_data = pinfo->private_data;
pinfo->private_data = &q_bit_set;
diff --git a/epan/dissectors/packet-zbee-aps.c b/epan/dissectors/packet-zbee-aps.c
index e45d768f75..0d9a569f91 100644
--- a/epan/dissectors/packet-zbee-aps.c
+++ b/epan/dissectors/packet-zbee-aps.c
@@ -828,7 +828,7 @@ dissect_zbee_aps_no_endpt:
}
/* If the payload exists, create a tvb subset. */
else if (offset < tvb_length(tvb)) {
- payload_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, offset);
}
/* If the payload exists, and the packet is fragmented, attempt reassembly. */
@@ -1635,7 +1635,7 @@ static void dissect_zbee_apf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
dissect_app_end:
if (offset < tvb_length(tvb)) {
/* There are bytes remaining! */
- app_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ app_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, app_tvb, pinfo, tree);
}
} /* dissect_zbee_apf */
diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c
index d4b2c9a146..2faf932647 100644
--- a/epan/dissectors/packet-zbee-nwk.c
+++ b/epan/dissectors/packet-zbee-nwk.c
@@ -587,7 +587,7 @@ dissect_zbee_nwk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Plaintext payload. */
else {
- payload_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ payload_tvb = tvb_new_subset_remaining(tvb, offset);
}
if (packet.type == ZBEE_NWK_FCF_CMD) {
diff --git a/epan/dissectors/packet-zbee-zdp.c b/epan/dissectors/packet-zbee-zdp.c
index e87a751a84..b95ced81b1 100644
--- a/epan/dissectors/packet-zbee-zdp.c
+++ b/epan/dissectors/packet-zbee-zdp.c
@@ -1125,7 +1125,7 @@ dissect_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Create a new tvb for the zdp message. */
- zdp_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ zdp_tvb = tvb_new_subset_remaining(tvb, offset);
switch (cluster) {
case ZBEE_ZDP_REQ_NWK_ADDR:
diff --git a/epan/libwireshark.def b/epan/libwireshark.def
index b6d48f451e..bf3fecc12c 100644
--- a/epan/libwireshark.def
+++ b/epan/libwireshark.def
@@ -1005,6 +1005,7 @@ tvb_memeql
tvb_new_real_data
tvb_new_child_real_data
tvb_new_subset
+tvb_new_subset_remaining
tvb_offset_exists
tvb_pbrk_guint8
tvb_reported_length
diff --git a/epan/reassemble.c b/epan/reassemble.c
index 6e48d792fa..1fec1398db 100644
--- a/epan/reassemble.c
+++ b/epan/reassemble.c
@@ -1897,7 +1897,7 @@ process_reassembled_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
* No.
* Return a tvbuff with the payload.
*/
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
pinfo->fragmented = FALSE; /* one-fragment packet */
update_col_info = TRUE;
}
diff --git a/plugins/docsis/packet-bpkmreq.c b/plugins/docsis/packet-bpkmreq.c
index 8d0702da71..4fe04d215d 100644
--- a/plugins/docsis/packet-bpkmreq.c
+++ b/plugins/docsis/packet-bpkmreq.c
@@ -104,7 +104,7 @@ dissect_bpkmreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
/* Code to Call subdissector */
- attrs_tvb = tvb_new_subset (tvb, 4, -1, -1);
+ attrs_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (attrs_handle, attrs_tvb, pinfo, tree);
diff --git a/plugins/docsis/packet-bpkmrsp.c b/plugins/docsis/packet-bpkmrsp.c
index 6daab3df2f..ca3808fda0 100644
--- a/plugins/docsis/packet-bpkmrsp.c
+++ b/plugins/docsis/packet-bpkmrsp.c
@@ -105,7 +105,7 @@ dissect_bpkmrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
}
/* Code to Call subdissector */
- attrs_tvb = tvb_new_subset (tvb, 4, -1, -1);
+ attrs_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (attrs_handle, attrs_tvb, pinfo, tree);
diff --git a/plugins/docsis/packet-dsaack.c b/plugins/docsis/packet-dsaack.c
index d9b6b4d868..43808054e3 100644
--- a/plugins/docsis/packet-dsaack.c
+++ b/plugins/docsis/packet-dsaack.c
@@ -84,7 +84,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree);
}
}
diff --git a/plugins/docsis/packet-dsareq.c b/plugins/docsis/packet-dsareq.c
index f7670b7ed5..23f1bb66d1 100644
--- a/plugins/docsis/packet-dsareq.c
+++ b/plugins/docsis/packet-dsareq.c
@@ -76,7 +76,7 @@ dissect_dsareq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsareq_tree);
}
diff --git a/plugins/docsis/packet-dsarsp.c b/plugins/docsis/packet-dsarsp.c
index 6d4a177ddc..04240a7c91 100644
--- a/plugins/docsis/packet-dsarsp.c
+++ b/plugins/docsis/packet-dsarsp.c
@@ -84,7 +84,7 @@ dissect_dsarsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsarsp_tree);
}
diff --git a/plugins/docsis/packet-dscack.c b/plugins/docsis/packet-dscack.c
index a7b27e7762..bc17155911 100644
--- a/plugins/docsis/packet-dscack.c
+++ b/plugins/docsis/packet-dscack.c
@@ -83,7 +83,7 @@ dissect_dscack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item (dscack_tree, hf_docsis_dscack_response, tvb, 2, 1,
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscack_tree);
}
diff --git a/plugins/docsis/packet-dscreq.c b/plugins/docsis/packet-dscreq.c
index 18ada3e02c..b1c3ba6879 100644
--- a/plugins/docsis/packet-dscreq.c
+++ b/plugins/docsis/packet-dscreq.c
@@ -77,7 +77,7 @@ dissect_dscreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscreq_tree);
}
diff --git a/plugins/docsis/packet-dscrsp.c b/plugins/docsis/packet-dscrsp.c
index 68d7f52a72..09c3b07610 100644
--- a/plugins/docsis/packet-dscrsp.c
+++ b/plugins/docsis/packet-dscrsp.c
@@ -85,7 +85,7 @@ dissect_dscrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dscrsp_tree);
}
}
diff --git a/plugins/docsis/packet-dsdreq.c b/plugins/docsis/packet-dsdreq.c
index 0be18a9f73..ea3a8dd59f 100644
--- a/plugins/docsis/packet-dsdreq.c
+++ b/plugins/docsis/packet-dsdreq.c
@@ -82,7 +82,7 @@ dissect_dsdreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 8, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 8);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsdreq_tree);
}
}
diff --git a/plugins/docsis/packet-regack.c b/plugins/docsis/packet-regack.c
index a4fca36253..0f93cf9967 100644
--- a/plugins/docsis/packet-regack.c
+++ b/plugins/docsis/packet-regack.c
@@ -83,7 +83,7 @@ dissect_regack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regack_tree);
}
diff --git a/plugins/docsis/packet-regreq.c b/plugins/docsis/packet-regreq.c
index a5a13541e1..5b96cd017a 100644
--- a/plugins/docsis/packet-regreq.c
+++ b/plugins/docsis/packet-regreq.c
@@ -76,7 +76,7 @@ dissect_regreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item (regreq_tree, hf_docsis_regreq_sid, tvb, 0, 2,
FALSE);
/* Call Dissector for Appendix C TlV's */
- next_tvb = tvb_new_subset (tvb, 2, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 2);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreq_tree);
}
diff --git a/plugins/docsis/packet-regreqmp.c b/plugins/docsis/packet-regreqmp.c
index 663b1fc8a6..2aa8c96526 100644
--- a/plugins/docsis/packet-regreqmp.c
+++ b/plugins/docsis/packet-regreqmp.c
@@ -76,7 +76,7 @@ dissect_regreqmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item (regreqmp_tree, hf_docsis_regreqmp_fragment_sequence_number, tvb, 3, 1, FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 4, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 4);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regreqmp_tree);
}
}
diff --git a/plugins/docsis/packet-regrsp.c b/plugins/docsis/packet-regrsp.c
index aa51d1767e..1c366752a7 100644
--- a/plugins/docsis/packet-regrsp.c
+++ b/plugins/docsis/packet-regrsp.c
@@ -84,7 +84,7 @@ dissect_regrsp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item (regrsp_tree, hf_docsis_regrsp_response, tvb, 2, 1,
FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 3, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 3);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrsp_tree);
}
diff --git a/plugins/docsis/packet-regrspmp.c b/plugins/docsis/packet-regrspmp.c
index e3403895b5..3861e79b4f 100644
--- a/plugins/docsis/packet-regrspmp.c
+++ b/plugins/docsis/packet-regrspmp.c
@@ -82,7 +82,7 @@ dissect_regrspmp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree_add_item (regrspmp_tree, hf_docsis_regrspmp_fragment_sequence_number, tvb, 4, 1, FALSE);
/* Call Dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 5, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 5);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, regrspmp_tree);
}
}
diff --git a/plugins/docsis/packet-uccreq.c b/plugins/docsis/packet-uccreq.c
index 781496813f..5490db5a9d 100644
--- a/plugins/docsis/packet-uccreq.c
+++ b/plugins/docsis/packet-uccreq.c
@@ -77,7 +77,7 @@ dissect_uccreq (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
FALSE);
/* call dissector for Appendix C TLV's */
- next_tvb = tvb_new_subset (tvb, 1, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, 1);
call_dissector (docsis_tlv_handle, next_tvb, pinfo, uccreq_tree);
}
diff --git a/plugins/ethercat/packet-esl.c b/plugins/ethercat/packet-esl.c
index fd2ca16d83..4cd25c6bae 100644
--- a/plugins/ethercat/packet-esl.c
+++ b/plugins/ethercat/packet-esl.c
@@ -197,7 +197,7 @@ dissect_esl_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_esl_header(tvb, pinfo, tree);
if ( eth_withoutfcs_handle != NULL )
{
- next_tvb = tvb_new_subset(tvb, SIZEOF_ESLHEADER, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, SIZEOF_ESLHEADER);
call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
}
modify_times(tvb, 0, pinfo);
diff --git a/plugins/ethercat/packet-ethercat-frame.c b/plugins/ethercat/packet-ethercat-frame.c
index b3ce57f186..b340b6154a 100644
--- a/plugins/ethercat/packet-ethercat-frame.c
+++ b/plugins/ethercat/packet-ethercat-frame.c
@@ -100,7 +100,7 @@ static void dissect_ethercat_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* The EtherCAT frame header has now been processed, allow sub dissectors to
handle the rest of the PDU. */
- next_tvb = tvb_new_subset (tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining (tvb, offset);
if (!dissector_try_port(ethercat_frame_dissector_table, hdr.v.protocol,
next_tvb, pinfo, tree))
diff --git a/plugins/irda/packet-ircomm.c b/plugins/irda/packet-ircomm.c
index a2340f42ba..77c81d766a 100644
--- a/plugins/irda/packet-ircomm.c
+++ b/plugins/irda/packet-ircomm.c
@@ -213,7 +213,7 @@ static void dissect_cooked_ircomm(tvbuff_t* tvb, packet_info* pinfo, proto_tree*
offset += clen;
}
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, tvb, pinfo, tree);
}
}
diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c
index 6361383426..b0f0aec5a9 100644
--- a/plugins/irda/packet-irda.c
+++ b/plugins/irda/packet-irda.c
@@ -662,7 +662,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r
}
/* If any bytes remain, send it to the generic data dissector */
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, tvb, pinfo, root);
}
@@ -919,7 +919,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
}
/* If any bytes remain, send it to the generic data dissector */
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, tvb, pinfo, root);
}
@@ -1030,7 +1030,7 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro
{
offset += dissect_ttp(tvb, pinfo, root, (pdu_type == DATA_PDU));
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
}
pinfo->private_data = (void *)pdu_type;
@@ -1150,7 +1150,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
}
}
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
proto_item_set_len(tree, offset);
}
else
@@ -1179,7 +1179,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
}
}
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
}
if (cbit == 0)
@@ -1792,7 +1792,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
if ((c & XDLC_I_MASK) == XDLC_I) {
/* I frame */
proto_item_set_len(tree, offset);
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
dissect_irlmp(tvb, pinfo, root);
return;
}
@@ -1845,7 +1845,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
break;
case IRDA_XID_CMD:
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
dissect_xid(tvb, pinfo, root, tree, TRUE);
return;
@@ -1879,7 +1879,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
break;
case XDLC_XID:
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
dissect_xid(tvb, pinfo, root, tree, FALSE);
return;
}
@@ -1888,7 +1888,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root)
/* If any bytes remain, send it to the generic data dissector */
if (tvb_reported_length_remaining(tvb, offset) > 0)
{
- tvb = tvb_new_subset(tvb, offset, -1, -1);
+ tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, tvb, pinfo, root);
}
}
diff --git a/plugins/profinet/packet-dcom-cba-acco.c b/plugins/profinet/packet-dcom-cba-acco.c
index 83bf8e6cbf..adf1c8953b 100644
--- a/plugins/profinet/packet-dcom-cba-acco.c
+++ b/plugins/profinet/packet-dcom-cba-acco.c
@@ -3266,7 +3266,7 @@ dissect_ICBAAccoCallback_OnDataChanged_rqst(tvbuff_t *tvb, int offset,
/*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
/* dissect PROFINET component data (without header) */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, cons_ldev, NULL /* frame */);
@@ -3424,7 +3424,7 @@ dissect_ICBAAccoServer2_GetConnectionData_resp(tvbuff_t *tvb, int offset,
/*** the data below is NOT ndr encoded (especially NOT aligned)!!! ***/
/* dissect PROFINET component data (without header) */
- next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+ next_tvb = tvb_new_subset_remaining(tvb, offset);
offset += dissect_CBA_Connection_Data(next_tvb, pinfo, tree, (call != NULL) ? *call : NULL, NULL /* frame */);
diff --git a/plugins/profinet/packet-pn-mrp.c b/plugins/profinet/packet-pn-mrp.c
index 2f03ef73d6..2aff5279c4 100644
--- a/plugins/profinet/packet-pn-mrp.c
+++ b/plugins/profinet/packet-pn-mrp.c
@@ -326,7 +326,7 @@ dissect_PNMRP_PDU(tvbuff_t *tvb, int offset,
/* the rest of the packet has 4byte alignment regarding to the beginning of the next TLV block! */
/* XXX - do we have to free this new tvb below? */
- tvb_new = tvb_new_subset(tvb, offset, -1, -1);
+ tvb_new = tvb_new_subset_remaining(tvb, offset);
offset = 0;
for(i=0; tvb_length_remaining(tvb, offset) > 0; i++) {
diff --git a/plugins/sercosiii/packet-sercosiii_1v1_at.c b/plugins/sercosiii/packet-sercosiii_1v1_at.c
index 28f5bd3ddc..327b68b43c 100644
--- a/plugins/sercosiii/packet-sercosiii_1v1_at.c
+++ b/plugins/sercosiii/packet-sercosiii_1v1_at.c
@@ -177,7 +177,7 @@ void dissect_siii_at(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case COMMUNICATION_PHASE_3: /* CP3 */
case COMMUNICATION_PHASE_4: /* CP4 */
- tvb_n = tvb_new_subset(tvb, 6, -1, -1);
+ tvb_n = tvb_new_subset_remaining(tvb, 6);
dissect_siii_at_cp3_4(tvb_n, pinfo, subtree, telno);
break;
diff --git a/plugins/sercosiii/packet-sercosiii_1v1_mdt.c b/plugins/sercosiii/packet-sercosiii_1v1_mdt.c
index 88e20062dc..eb9824be7a 100644
--- a/plugins/sercosiii/packet-sercosiii_1v1_mdt.c
+++ b/plugins/sercosiii/packet-sercosiii_1v1_mdt.c
@@ -176,7 +176,7 @@ void dissect_siii_mdt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case COMMUNICATION_PHASE_3: /* CP3 */
case COMMUNICATION_PHASE_4: /* CP4 */
- tvb_n = tvb_new_subset(tvb, 6, -1, -1);
+ tvb_n = tvb_new_subset_remaining(tvb, 6);
dissect_siii_mdt_cp3_4(tvb_n, pinfo, subtree, telno);
break;