Switch a bunch of dissectors over to using tvb_new_subset_remaining()
authorkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Aug 2009 12:36:22 +0000 (12:36 +0000)
committerkrj <krj@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 16 Aug 2009 12:36:22 +0000 (12:36 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@29446 f5534014-38df-0310-8fa8-9805f1628bb7

236 files changed:
asn1/ldap/packet-ldap-template.c
asn1/mpeg-pes/packet-mpeg-pes-template.c
asn1/pres/packet-pres-template.c
asn1/snmp/packet-snmp-template.c
asn1/spnego/packet-spnego-template.c
asn1/t38/packet-t38-template.c
epan/dissectors/packet-3com-xns.c
epan/dissectors/packet-afp.c
epan/dissectors/packet-aim-icq.c
epan/dissectors/packet-aim-messaging.c
epan/dissectors/packet-aim.c
epan/dissectors/packet-airopeek.c
epan/dissectors/packet-ap1394.c
epan/dissectors/packet-arcnet.c
epan/dissectors/packet-artnet.c
epan/dissectors/packet-asap.c
epan/dissectors/packet-atalk.c
epan/dissectors/packet-atm.c
epan/dissectors/packet-ayiya.c
epan/dissectors/packet-bacnet.c
epan/dissectors/packet-bat.c
epan/dissectors/packet-bctp.c
epan/dissectors/packet-ber.c
epan/dissectors/packet-bssgp.c
epan/dissectors/packet-capwap.c
epan/dissectors/packet-cdp.c
epan/dissectors/packet-chdlc.c
epan/dissectors/packet-cisco-erspan.c
epan/dissectors/packet-clnp.c
epan/dissectors/packet-cosine.c
epan/dissectors/packet-dccp.c
epan/dissectors/packet-dcerpc.c
epan/dissectors/packet-dcp-etsi.c
epan/dissectors/packet-dsi.c
epan/dissectors/packet-dtpt.c
epan/dissectors/packet-dua.c
epan/dissectors/packet-eapol.c
epan/dissectors/packet-egd.c
epan/dissectors/packet-ehs.c
epan/dissectors/packet-eigrp.c
epan/dissectors/packet-enc.c
epan/dissectors/packet-enrp.c
epan/dissectors/packet-erf.c
epan/dissectors/packet-ethertype.c
epan/dissectors/packet-fc.c
epan/dissectors/packet-fcct.c
epan/dissectors/packet-fcip.c
epan/dissectors/packet-fcsb3.c
epan/dissectors/packet-fcswils.c
epan/dissectors/packet-fddi.c
epan/dissectors/packet-fefd.c
epan/dissectors/packet-fr.c
epan/dissectors/packet-giop.c
epan/dissectors/packet-gmrp.c
epan/dissectors/packet-gprs-ns.c
epan/dissectors/packet-gre.c
epan/dissectors/packet-gsm_map.c
epan/dissectors/packet-gsm_sms.c
epan/dissectors/packet-gsm_sms_ud.c
epan/dissectors/packet-gssapi.c
epan/dissectors/packet-gtp.c
epan/dissectors/packet-gvrp.c
epan/dissectors/packet-hci_h1.c
epan/dissectors/packet-hci_h4.c
epan/dissectors/packet-hip.c
epan/dissectors/packet-hpext.c
epan/dissectors/packet-hsrp.c
epan/dissectors/packet-iax2.c
epan/dissectors/packet-icap.c
epan/dissectors/packet-icmp.c
epan/dissectors/packet-icmpv6.c
epan/dissectors/packet-idp.c
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-ieee8021ah.c
epan/dissectors/packet-ieee8023.c
epan/dissectors/packet-ieee802a.c
epan/dissectors/packet-imf.c
epan/dissectors/packet-ip.c
epan/dissectors/packet-ipars.c
epan/dissectors/packet-ipfc.c
epan/dissectors/packet-ipp.c
epan/dissectors/packet-ipsec.c
epan/dissectors/packet-ipv6.c
epan/dissectors/packet-ipx.c
epan/dissectors/packet-isl.c
epan/dissectors/packet-isup.c
epan/dissectors/packet-itdm.c
epan/dissectors/packet-iua.c
epan/dissectors/packet-iuup.c
epan/dissectors/packet-iwarp-ddp-rdmap.c
epan/dissectors/packet-jabber.c
epan/dissectors/packet-juniper.c
epan/dissectors/packet-jxta.c
epan/dissectors/packet-kpasswd.c
epan/dissectors/packet-l2tp.c
epan/dissectors/packet-lanforge.c
epan/dissectors/packet-lapb.c
epan/dissectors/packet-lapd.c
epan/dissectors/packet-ldap.c
epan/dissectors/packet-lge_monitor.c
epan/dissectors/packet-llc.c
epan/dissectors/packet-loop.c
epan/dissectors/packet-lwapp.c
epan/dissectors/packet-m2pa.c
epan/dissectors/packet-m2ua.c
epan/dissectors/packet-m3ua.c
epan/dissectors/packet-mdshdr.c
epan/dissectors/packet-mgcp.c
epan/dissectors/packet-mikey.c
epan/dissectors/packet-miop.c
epan/dissectors/packet-mip.c
epan/dissectors/packet-mip6.c
epan/dissectors/packet-mmse.c
epan/dissectors/packet-mpeg-pes.c
epan/dissectors/packet-mpls.c
epan/dissectors/packet-mq.c
epan/dissectors/packet-msdp.c
epan/dissectors/packet-msrp.c
epan/dissectors/packet-mtp2.c
epan/dissectors/packet-mtp3.c
epan/dissectors/packet-mtp3mg.c
epan/dissectors/packet-nbipx.c
epan/dissectors/packet-nbns.c
epan/dissectors/packet-ncp.c
epan/dissectors/packet-ndmp.c
epan/dissectors/packet-ndps.c
epan/dissectors/packet-netbios.c
epan/dissectors/packet-nhrp.c
epan/dissectors/packet-nsip.c
epan/dissectors/packet-null.c
epan/dissectors/packet-osi.c
epan/dissectors/packet-ositp.c
epan/dissectors/packet-ospf.c
epan/dissectors/packet-pcli.c
epan/dissectors/packet-pdcp-lte.c
epan/dissectors/packet-pflog.c
epan/dissectors/packet-pgm.c
epan/dissectors/packet-pim.c
epan/dissectors/packet-pktc.c
epan/dissectors/packet-pktgen.c
epan/dissectors/packet-ppi.c
epan/dissectors/packet-ppp.c
epan/dissectors/packet-pptp.c
epan/dissectors/packet-pres.c
epan/dissectors/packet-pw-atm.c
epan/dissectors/packet-pw-eth.c
epan/dissectors/packet-pw-hdlc.c
epan/dissectors/packet-q931.c
epan/dissectors/packet-radiotap.c
epan/dissectors/packet-raw.c
epan/dissectors/packet-redback.c
epan/dissectors/packet-redbackli.c
epan/dissectors/packet-rmcp.c
epan/dissectors/packet-rmi.c
epan/dissectors/packet-rmp.c
epan/dissectors/packet-rmt-alc.c
epan/dissectors/packet-roofnet.c
epan/dissectors/packet-rpc.c
epan/dissectors/packet-rpl.c
epan/dissectors/packet-rtnet.c
epan/dissectors/packet-rtp.c
epan/dissectors/packet-rudp.c
epan/dissectors/packet-rx.c
epan/dissectors/packet-sap.c
epan/dissectors/packet-sctp.c
epan/dissectors/packet-sdlc.c
epan/dissectors/packet-sdp.c
epan/dissectors/packet-ses.c
epan/dissectors/packet-simulcrypt.c
epan/dissectors/packet-sll.c
epan/dissectors/packet-smb.c
epan/dissectors/packet-smb2.c
epan/dissectors/packet-sna.c
epan/dissectors/packet-snaeth.c
epan/dissectors/packet-sndcp.c
epan/dissectors/packet-snmp.c
epan/dissectors/packet-spnego.c
epan/dissectors/packet-spp.c
epan/dissectors/packet-srp.c
epan/dissectors/packet-ssl.c
epan/dissectors/packet-sua.c
epan/dissectors/packet-symantec.c
epan/dissectors/packet-t38.c
epan/dissectors/packet-tali.c
epan/dissectors/packet-tcp.c
epan/dissectors/packet-tds.c
epan/dissectors/packet-teamspeak2.c
epan/dissectors/packet-telkonet.c
epan/dissectors/packet-teredo.c
epan/dissectors/packet-tipc.c
epan/dissectors/packet-tns.c
epan/dissectors/packet-tr.c
epan/dissectors/packet-tte.c
epan/dissectors/packet-turbocell.c
epan/dissectors/packet-tzsp.c
epan/dissectors/packet-ucp.c
epan/dissectors/packet-udld.c
epan/dissectors/packet-usb.c
epan/dissectors/packet-v120.c
epan/dissectors/packet-v5ua.c
epan/dissectors/packet-vcdu.c
epan/dissectors/packet-vines.c
epan/dissectors/packet-wcp.c
epan/dissectors/packet-wfleet-hdlc.c
epan/dissectors/packet-wsp.c
epan/dissectors/packet-wtp.c
epan/dissectors/packet-x224.c
epan/dissectors/packet-x25.c
epan/dissectors/packet-zbee-aps.c
epan/dissectors/packet-zbee-nwk.c
epan/dissectors/packet-zbee-zdp.c
epan/libwireshark.def
epan/reassemble.c
plugins/docsis/packet-bpkmreq.c
plugins/docsis/packet-bpkmrsp.c
plugins/docsis/packet-dsaack.c
plugins/docsis/packet-dsareq.c
plugins/docsis/packet-dsarsp.c
plugins/docsis/packet-dscack.c
plugins/docsis/packet-dscreq.c
plugins/docsis/packet-dscrsp.c
plugins/docsis/packet-dsdreq.c
plugins/docsis/packet-regack.c
plugins/docsis/packet-regreq.c
plugins/docsis/packet-regreqmp.c
plugins/docsis/packet-regrsp.c
plugins/docsis/packet-regrspmp.c
plugins/docsis/packet-uccreq.c
plugins/ethercat/packet-esl.c
plugins/ethercat/packet-ethercat-frame.c
plugins/irda/packet-ircomm.c
plugins/irda/packet-irda.c
plugins/profinet/packet-dcom-cba-acco.c
plugins/profinet/packet-pn-mrp.c
plugins/sercosiii/packet-sercosiii_1v1_at.c
plugins/sercosiii/packet-sercosiii_1v1_mdt.c

index 5fdc5009245a13f04db3dfc51573449e935119db..11039e0443e1df9b9ec62dfc8ac52ac3c7254fed 100644 (file)
@@ -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);
            }
          }
 
index 714adadf11be5d707f99760f0e15d1a16c70452f..f75883783a3ac9f744d95ad7ff7a812e445989d5 100644 (file)
@@ -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) {
index 01a6035df98f065a528d2374db9db5b65a6e00f6..01236857f5481bc486e2bdddd70c02377a6a67a5 100644 (file)
@@ -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;
                }
index 74ca2d8b304895aa5656c27052214dc7299e37da..35b868b45a7a3069c289a6a4fb1360d894154e44 100644 (file)
@@ -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{
index 0b7f453a6d9f64e9e02a08eef098eca79633173d..d88e58a41ecae179d7b76037205327768a3e118e 100644 (file)
@@ -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){
index d3cca47b223fe4fcc1d9979fc22bf690e4d5e66b..709e5471b26d957363dafce48190496309775caa 100644 (file)
@@ -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++;
 
index a105b1924482113b2f075e43df8bedabda83ebcd..d758476648ab36501fed0123c754a958d1c1a435 100644 (file)
@@ -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);
index 6f44c249b43a04b2c4921b862d86dbd098f48f90..90f5201b9d2b3bd7fec0c0646cb4d65e82c51388 100644 (file)
@@ -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);
        }
 }
index 8ac5809773eb5fbe1889108c8fc84f2812d07d00..ce06a3a97e89b1cf345b123b6d5fd513a5db6805 100644 (file)
@@ -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;
index 5a7a419f2d9ab275ec902c68667cd430d68e0b3a..df6238c75b321e8be16d4be0c603d487846330dd 100644 (file)
@@ -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;
index 9a1516580b79a719c0611eb3f73c46d6dfc50faa..a6483160908209a086d4edf98e1bd0fb8b24d7a7 100644 (file)
@@ -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;
index aa14e2066b9f7481bcd8cd1e03d41d253f879fb5..e852050fddd5809de0b3feea750bd64bff3a0ead 100644 (file)
@@ -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);
 }
index 753d67af51371eb1c4cb828b5d5bc26a183e9c0d..d08cde5bb1c26afd05170a8afc3495778cfac6c8 100644 (file)
@@ -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);
index 2b84feb8b345f18b2f06261695d400feb1cd8012..3f7747173f95a5a145e5203fb161de5346fecae8 100644 (file)
@@ -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))
index 2265db4c7a380fa8c2d7bdfe22b58c0b78d2345f..4ebafc64257cd2533e91e83bdd4229e815363401 100644 (file)
@@ -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);
 
index aca054d5465d2771d8c1110737b7ff1bd14eb91b..5b6fd070df35247d99c86b3c4fede90d4d0a197c 100644 (file)
@@ -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);
     }
index 7e51052cfe03dc515cbee58da6f4161423bf8711..3c6205050eab5da7a3bdbfdb5ecd78208708b618 100644 (file)
@@ -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) {
 
index 26885ba7b85dfeb72fb054bf312d47811fa58c65..1c13d03e569cb3b06e746dfcab6beef624b78fb7 100644 (file)
@@ -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;
   }
index 7a000c9a5fd43c8a34347f2e077cc31d6c5943e1..2e669f0a9fe4cf475937b186a68dc7ed06516bd4 100644 (file)
@@ -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;
        }
index c0f6c1a56ac2649bc9f6b3f687205325de48f06c..13d7caefb8c6167f0d696992783aedd310419928 100644 (file)
@@ -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);
index e9f3a468f47d2c97587745d071cc5fd7a225102f..5339c4f01e9999f8c6e7c68d41707e007e7f8552 100644 (file)
@@ -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);
index 6a66bc86acc63c38f8cef9f94fa04bf581cf5020..b93d55bed8918e71720a49fcc8b8a55b18826465 100644 (file)
@@ -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);
index 9202068fd26c872b0f1c7961e9befbd2841d95f7..18d6b6595fca506836ca0533cb15f497154d16a6 100644 (file)
@@ -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);
                        }
                }
        }
index 1f3d439946f61e618ccf659d90db86d1cf515df1..e3b17a135f74dc72dfd6d41e55cc5a329adfb184 100644 (file)
@@ -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);
index 3dcbb4d9c2b29f6798c7c69e6ccfd7950319a780..a0fb1b77ff5e02c25599b976ba60096c649b6f3d 100644 (file)
@@ -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 */
index 65538df130ce41173ccb694e1899406862eca98d..07d08b3433db405572dfcecaffa5b3c6a524375c 100644 (file)
@@ -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);
 }
 
index 6991f02cc04dfaf40b0f63f4d79a5df2afb42672..1f3e31e1d95838180d367b1d24bdf0760ad5c932 100644 (file)
@@ -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;
index 8e9878acce8db7403dd6dd7685a9341ee87836d5..ce940770e130f186eac6070dfbd33319b79661b2 100644 (file)
@@ -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);
        }
 }
index a57de95464bc8c2708ddc358e6d1f25b58fe8fb3..e4db23f3d0ffe8e6567028692c3c4c04d4093e7b 100644 (file)
@@ -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;
index 40772fee774b4c385afd789f2247822294a7856c..da3ee3ce6672eb2a2a3489ac5cb30737b75743f1 100644 (file)
@@ -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:
index ca878d92692f591cea7e3d7027a12bad1da2b79d..b551832e067c03641f66db3a0a94d54a40f1fd68 100644 (file)
@@ -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 */
index 66f0fd6b4380c6ad7cf08c33194f5be625e2bb5e..c5fb88d2e3a33540f46ce7ecad16ce0c83e9b77c 100644 (file)
@@ -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);
        }
     }
 
index 7cfec3a7e5c59c549f9bee9c3df4654f1d8b74b5..28d46c141193c46f96167ac9ea8da02308fa16fc 100644 (file)
@@ -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);
index f9d48d3040dd2e577998372fb06a7a24733c6b23..a006bc3c850e486ba35773f4dccf8d4f9cf3e1fa 100644 (file)
@@ -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;
index 96526b17c2475d206ceafcda5024516ea5937712..963727572b0869a6d447d92c9720ea93e9286b00 100644 (file)
@@ -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);
index 79c74f1b430cc57fd288a48b66ac0b3796e56617..6ec480327242c8d2176af51f82a8021984250944 100644 (file)
@@ -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);
 }
index e104c5f3900a6584c2e78c1d7e4ad011d72651a5..4648aa05d089c8aaae5061df49442afcc12c938d 100644 (file)
@@ -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;
   }
index 7c7054309f132bf6055cd2993a11d2bef0bec251..77457a740c393a0365f98fa7b83a9ce60eb9fc8c 100644 (file)
@@ -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);
     }
   }
index 6ec6a07171b7bca7c42cb23da32835fb76314f6b..e15fb90d2334ce07950b7d239df48f04ed7b3fda 100644 (file)
@@ -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 */
index f62f78a5044f4a5f242e92db2e116e573d3e83ed..c5cf8f19fa2905e40ff9eda671f5a953e6799929 100644 (file)
@@ -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;
        }
 
index 4b547632385c5e39dc42b46faf89406d7d2aaab6..0e81f32a123bfe307305485aa5b5ff050c8eebc8 100644 (file)
@@ -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) {
 
index b9f980e7f0fcd64bb5c41b0c4a1ae7b78ad42574..f568796750ad21219c59c7faeb1976358154fa95 100644 (file)
@@ -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);
 }
 
index c335481a8eabaecf67722b2cf4291402b1e3108d..f1403e30ead91ad69ec173d5543c8cc5c7c40418 100644 (file)
@@ -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;
 
index 1f1ac9d273a118631db206ae7be9eb10e6d4e9a0..de0ccee3ea0c5f75d24e18b701d51767ef8f5882 100644 (file)
@@ -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.
index 981f77f4e4dd534eda54409f042a473bb06a1d54..88ed326998fe768a7b41e64b9e2c34a789e02b2a 100644 (file)
@@ -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)) {
index 0b99688b21140471e20c7a16ad8475ff22e53c32..195151006a8457fa7b819b8d89faa4a8399935c5 100644 (file)
@@ -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);
index 8a223889135fb1001552d186b184bbd72fdc6307..63eb8130bff6c46b7445afa3c63e692479f14038 100644 (file)
@@ -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);
             }
index 4457ea4e99c4c3aecf9f22da426a13b559038530..8ebf393a1101160dfcf1cbb0109ff027252a7e9d 100644 (file)
@@ -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;
index daa2f025c9d554a335c43f9df696f93724e359f5..89d1846671c8306ec0989b509170eb28a6503a4c 100644 (file)
@@ -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);
     }
 
index 9cf32e49bdb280a9e48d39df9c403d9242e09e52..e3ec43b0388723da6b01b606d9113ce1c1e3ef19 100644 (file)
@@ -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);
index a96b809fbce9b2b2aa8b636eadfaa32a1dd04628..dc3e8f49e8764fc9b720dd9f28afb509790b207e 100644 (file)
@@ -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
index 95f1437d0ab24500d239c76665cf575747502962..a42d5b2690daee8c46abab5c3e37e571005b5e24 100644 (file)
@@ -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 */
index 96936260b248c4603a2dafff4b4100c3a21c4dec..0f1514cf46cd2b0484ec60ad1e2f56b36870c6f4 100644 (file)
@@ -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
index 45d09bf4b4a09183f2b4af32a1116b5ce0ff126b..7b58d445f2f5e8d170c2a85f0edfea3640960f0a 100644 (file)
@@ -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;
                                        }
index 2e960f20f129b254621acdcd543eb4050461c8a8..f068a8ae3fff4a04c6c58d24f4c9e3c665fad5c2 100644 (file)
@@ -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;
 
index 17db26a6f191ec08e1aa24eebe035b04c08844a2..9c6d3eff5be8f7a378642d78ebb9d1897177dc20 100644 (file)
@@ -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);
 }
index 8a0a373788d535f9462c1fba43b9337367170581..6ff0574c023a634c3ce30f2ef40cf1b82ccb069a 100644 (file)
@@ -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;
index d03f31881364f8ae35d0115d2ded551edcf30cdf..5c3974f6b13ae1bf4161c15e26bc65db0d259868 100644 (file)
@@ -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)
     {
index 41fe1feaa84cbeed6138a4676aaefbbb01f7724d..f0d1bca320bfff37efdb47c02ebca3585e0c97f7 100644 (file)
@@ -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)
index cd9a6ff3e78fbe391a756e808dc9f4a1e3a27278..0d837201ef34507accedaa92107dc01c726955cb 100644 (file)
@@ -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);
 }
index f3952bf1884fe62199c9eb899c6cc9d34c650db4..4146539adc60cf184b1ab869467b4e505b8f6083 100644 (file)
@@ -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);
        }
 
index cc744a79606c05c40eb397c6580b0077ee4db2ed..d04fc9a3a61156eb3064325a42f6ecafee5b7956 100644 (file)
@@ -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;
                    }
                }
index 73b92d1f2e8488a1d82e87e42ca445282434d658..6fa98c6b09fa63de376e02f2c8284fd074f5f763 100644 (file)
@@ -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);
        }
index 3a409a6a946ca7155bdd659cfa96c56350defca8..96cad74b4a919518499f248d5020ebbf5e4ca1ec 100644 (file)
@@ -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",
index 2f06c173d6959a84013f145830348d700a538a93..0d2b27b794933c28ce8bccf18da3630d614943ef 100644 (file)
@@ -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);
        }
 }
index c5bf4760c514572a95e6eb862f186d24c2aae1c5..259fae689fbcab4fe2cb21671cc46bea27303ea1 100644 (file)
@@ -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);
index 7d6110b58eb19bd04327bda97a0dc2d7d8795211..56f4e65c2f251fac640b43b7df2fce32ff1deedc 100644 (file)
@@ -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;
index bceb3136fa800aefb03db4cbd99eaf75f9ac75e3..46f71140c58f0ed0f44e88ad93fb61ae005dfd5b 100644 (file)
@@ -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. */
 
index d777ce94ac3864d69c65d18e823e6a587a037329..1a7b61eea3af766ad8d3550cbee09b090309aa16 100644 (file)
@@ -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);
        }
 }
 
index 2dd7733e734bf0030c39bb44d3478ba5be88b60d..5763f588993a5ccbd2962ab2630a19e783f6a349 100644 (file)
@@ -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;
 
index 39e49322bdf33a6e979daa85e3b88baec85acdd0..94d26b0c85593981144dcedbd90717f1a31fd4c1 100644 (file)
@@ -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;
index a004e3464611641b831e6809aa9d72240f5f7e99..ea60b66065b1d3ddb138c3f605f136e5eaa445f9 100644 (file)
@@ -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.
index 89758a5f8fc41e32e31a2d92cb1053ff3836836d..f5ee6d63194c9e488a8529ef829818f829d2d18f 100644 (file)
@@ -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);
 }
 
index 9574667a54396bfa39977463820872ec0070026f..8a64c266383f5c72a871352f594df23efcb0533c 100644 (file)
@@ -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 */
index aec6252520291ccd40138da4bc78a07f0efa641a..142dcf18f22cc1c9101a54af5183f02ba887ba04 100644 (file)
@@ -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
index 11d8a9b5767370220ce65b21a51362ef5eb961ef..440f2588c4930d44223d30a77b39a6191566388c 100644 (file)
@@ -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,
index 915f0031a623e22f27f3a1dd02570a4b5ec2fcf8..113bba29a3ee2dd5f62e6e6290f230e4d9791015 100644 (file)
@@ -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);
 
index 3a130351a629b29fc9e8564826dbf748efc23618..0961df6cdc026bd8c1b9cca264a78644e36359bf 100644 (file)
@@ -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;
index 75d2cba26d204ea5fc9392a7f62269fd1bdf27f3..3f9ad2907f8533eda55e649128ef2960703f6d9e 100644 (file)
@@ -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,
index 8e133599f0a1dc0ceffdc45bb022b06a8001962e..06b425cd210925b8f306832bae55cade69335f05 100644 (file)
@@ -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);
 }
 
index 35a39b63f9eab60458fdda742e751e2a8f0b4c86..1634b833042fa1a85746b90be76ee61705d09870 100644 (file)
@@ -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);
                }
        }
index 081a05830e3c0aa59d33eeab498d9356a99ab034..ce40819026a60ca961b8ef799501ac0d24156f2e 100644 (file)
@@ -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);
index 80d4ad8bdb78a8832266c856a892fb44e5e0bc57..0db45678ce820a04503687c0861695182383a6be 100644 (file)
@@ -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,
index 53ad6d6b618449b2eacf020cddf42ced7815716f..142cad82cb6c670b5f36bb3a2005048163569214 100644 (file)
@@ -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))
                {
index d403c588934672bf25eeb38ca3d5a5c0e7d4e33a..745a6b746d52e72f356828e063377b8f3e1e57cd 100644 (file)
@@ -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;
   }
index 0b1c19ee31da582e99719b23d71b79e988678ae4..7f8e063e574ad346064cd7cfba6eb1f0fffe735d 100644 (file)
@@ -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
index 6b404b93161dee06886ac1c7f998ee98056723a2..d0e113770eb45e1d749147bd675a5b73b618c67b 100644 (file)
@@ -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);
 }
 
index f5ab0673610ea5281760beda5e01ee5d63cbfa28..7bef0aac80e5b047a400ca20c7d4b918e683b267 100644 (file)
@@ -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);
 }
index b082083087f2f101164282eafa75367277370dc6..3948df53d9612b5c6cbe69c581c3e1262ec756e5 100644 (file)
@@ -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++;
index b48097627464b0c1f4b443be06ac6b39a20adb87..bb1f596e70c3808d10a93f6cbf532e05d90ef3aa 100644 (file)
@@ -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);
                        }
                }
index 58bed87e1a1d1d73fa63402a3aeec6f88041f30f..da71c1e4bc0f707280cc236b947129728bd584b4 100644 (file)
@@ -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);
        }
 }
index 92e2a59f2753ef91be685eb8c87d504f2c1f83f3..bf827dc7790aee21c6abc37956bc536c66e2243b 100644 (file)
@@ -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);
index 9e377c996962ea98de379e3219538768fb4e43c9..fa2a0c9be6492dc0d006dedee02f35a9695e9b80 100644 (file)
@@ -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);
         }
index e897eee104c8f53b3826d49d5c056f6ce5f21d7f..c819712da7c02cc9d9432269c04b8dfa9d12c8f7 100644 (file)
@@ -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);
index f3de64de616cc770aee6d3099a8a438abd4fe68d..48014513f115b8768d8b66e288fdc2953b86d395 100644 (file)
@@ -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);
index e7aa9f551b7aa75afd41997f4ac78d19e1c9dc11..18673a179a0ce3eeafa5c97bc5565a7f05bcdf3b 100644 (file)
@@ -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
     }
index 1d677951f1e210b0afd6a7a9da819b221815e5a2..7d55d2da2df36cd4600ba351fa5bf93f4c2c3b64 100644 (file)
@@ -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:
index ce5a864deb86e66802d4852e4c82f4237c9a53ad..d8b01fe5f064ffad0d9802a734c93cdd2fe20fac 100644 (file)
@@ -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 */
index 2d93694b55723b7edcc127a7364e3bbb6d7eb096..e512ce391b31221a5560c30c8529294a5c6d993b 100644 (file)
@@ -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);
            }
          }
 
index dbd7c71edd7ba2a69cdc97c2cf7fb98d78f3adf4..eaf313179344799fafa98ea22b76e98cbb93e287 100644 (file)
@@ -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 */
index 06e6d41ec3f4d5f0a90f84613de818a72b7827eb..4a035c2f059b7caaa5505c5590b8494fa7676683 100644 (file)
@@ -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 */
index 569acd5b80496393201661596433650917d6b98d..b9ada3eeee5383d66b9e34d0ce44898ee64971bf 100644 (file)
@@ -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);
   }
 }
index 0318b286bae1aca1d85ac202d239234cab892a49..0e8593611507e7c1ed108f17b5c645e776381e66 100644 (file)
@@ -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;
 
index d84ea7eaedafcf3d960105448c612d99b085f831..b69528d7e2d72cc7e44550d602df0aa0e322e65f 100644 (file)
@@ -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);
   }
 }
index 2611c22189f4ec9baaad6b3f27e0ef7db0534069..fd946193333d943724c6fa20861c696515fed37f 100644 (file)
@@ -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);
 }
index 8121bb91a9982e5dc61ee2f9a02caa207e088ae6..1a732d91c14364f27a6bfba533eaed448b6f7c76 100644 (file)
@@ -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
index 80c2a22fd607cd67943a622877caf265f28c2385..0e8b974c4dca5e7b275a757112af772a53fe4ea6 100644 (file)
@@ -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 */
index ed7c71e93cf0d60bbb187cd28f84f9481102d426..6c680ad4a922bc521ff5a79ba33fdb69a2131131 100644 (file)
@@ -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);
                }
        }
index c3a703b52d3147510bcb61b17a3953f18cc958f0..aea260c99ccefd949f4dff7dfb972b910b5d0e99 100644 (file)
@@ -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)
index cf4c0a567aeec5874cddebcf95761217c4325f0d..d81044e8fffeca22401e806c94458836fb6d3bf8 100644 (file)
@@ -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);
       }
     }
index f3e629728757d73128316f573021643650004b5e..ca1d61487b4bb224d2b755b33287ab3f33c2dba8 100644 (file)
@@ -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 */
index 3b59b284b265c4ad6fada293b3ac58c19cad4199..b043b075bb0453feb99bec96dad0303276169f19 100644 (file)
@@ -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);
index 307edcdd611f32ed9658c46df7b334d2606c091c..1c978d5cfeae95e248c294d09f9a9c798e919097 100644 (file)
@@ -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"));
index 13ac0ea68ec504830e5e99fc2c6510b5d3914f7d..0ef4ead71d9af8b4731a70f2e486bdcc992e78a6 100644 (file)
@@ -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) {
index 308472b656cddbf41689d8dc3f4433dddbdfd2da..eb8bf0ad48c384ee574fb29108cf1db891dd6471 100644 (file)
@@ -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))
     {
index c43ca4b2c98b4595d245d3c060ece90116d4d3e8..1419c489c41ea34d75d63e2e87f09f96b77d1ba3 100644 (file)
@@ -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);
                }
        }
 }
index d6a11d7677e49e075aec221a1f6ab26cb9433632..f4333c37f1b51493736741a8d95361ee3a7e6b8d 100644 (file)
@@ -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:
index 1621fa3945a52739b944964ba9c43030671db231..cd42de51ee0a8f803bc1b37e209224d8efeef668 100644 (file)
@@ -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);
index 25891a551f3dac86777955bb97b9af0fbccce6d4..16386910708a01d264f6120f79ada596402c9ff3 100644 (file)
@@ -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
index 7056de0fddbe8bca95b87af76f98f2e21a539e21..d0a274536b3743b05f136ec04806799c9b8cfed1 100644 (file)
@@ -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();
index 5f63e48b83db2e7335391014eb52f062c1d7fc48..73b537be56c416e85d71948e349341354b1c9c14 100644 (file)
@@ -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)
        {
index 36dce82c82281d02ab73d646f3992d5cd2866643..bb219d4d0f5b2061e12fd0195ffb8ce70f641352 100644 (file)
@@ -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);
        }
 }
index 93493b3651e5b252d5b34e42faf5a896fa3287b3..9184206932a4a0456d0264f54004edf905ef7ab3 100644 (file)
@@ -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;
 
index df6d493d0d70ae65a7641394dffa7e636db1b1ca..03cc39169489bfdcecc4d89a71dabd4ba2dca408 100644 (file)
@@ -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;
index 89a5057f57a3b02a44bcc8b9e0060407a9d48627..3918ce3ba2918f76c30a1b70a9cc7782ab0fa83b 100644 (file)
@@ -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);
        }
 
 
index 22058d3e607c47d48b653636b660c502b05df472..cd1ae324b9e2c6f959bf95f5400eaa2ff0a2a5a1 100644 (file)
@@ -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
index 7891dba34f050003fdc54d486a184dce3960561d..be11cefb5b7c2dbc4900f93982952cb2ddd76b9c 100644 (file)
@@ -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);
                        }
index 8c1abbffa7a8e52acc6eb88f80212ee7e4e6912f..21debb514a0d771a0bb95f8e511b525b840bd776 100644 (file)
@@ -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);
                }
index ccdf0b7e96ff7a1795b8fb4cd7c441696eee7c39..e4ecc9357bdb6e86c2fd799f7ff85a952fe6a6a8 100644 (file)
@@ -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);
   } 
index 6d6c683f0fd5ce8723c7acb791bc98b024e23e95..ed4914e361f92ef9dcf6c6e4f1a53890336e1947 100644 (file)
@@ -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" */
index 872d3dce6ef75076e0cb855cdc3699cb621cf1ef..808e0764be2e15a9058802249d64700c3f78cd9c 100644 (file)
@@ -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;
 
index b01dad854d9a4d92581cd9bc31e6295e54fc8b33..15c9b424e26a88719577d374a20f0946741f4417 100644 (file)
@@ -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;
     }
index 59dc3425cee355fa9cea217628dd8b6e43b66dad..d1537bb694da286f4996242ef1b6a49ab88f0400 100644 (file)
@@ -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;
        }
 
index a957ac5669b7b62ed51b486ed9f90eb47a8dcc2a..c728df2064f9709399cf9508c0ee1f931d1b216f 100644 (file)
@@ -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);
 }
 
index e0707f543f4eb451941e650af83746f79b5f93e4..24bcdf36b8b9d052557d90bcf3f7be6bc64a3f81 100644 (file)
@@ -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 {
index 5be796c2aacca9baabc0f35ec4f65260232ff56b..7b63780cd0c5da180438d3acc11dc78f2e0b7553 100644 (file)
@@ -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) {
 
index 7a97e5aa8e0a02c74c97c58bab7670acd7accb31..c09dc511c279d5c10c8e885dd5207a623bdf04ae 100644 (file)
@@ -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,
index 2991b04024a529af6c4d7acb3f221384a55b7671..754f31a0f8dedf01198090be2f7a128590f85b05 100644 (file)
@@ -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.
index 3991fb208b1dfd7602d25c01cadd5d30b7fb6d5b..020f7b7f3f358e283f307c126cefa715b4aa66eb 100644 (file)
@@ -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);
index 0632937561236c21582647d3b432e8a2900a4b07..0b78cf4d19f46e05f5f914a3e4fdef8380317c46 100644 (file)
@@ -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
     }
index 21ee423aec3cde417f988c34ac25b3e097deae20..1c7bfc0b695342db99cced1425a80f2ce92f03e3 100644 (file)
@@ -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 {
index 78b44e1ac8bc44f32c7e9ca3edc24cc432df59ab..948372466b51fc7dc048a272ae63ba8dac68ebe1 100644 (file)
@@ -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);
   }
 }
index 09b74612f6167e41b080b5042616385fa42c2e68..960c7d5477b86709581290e6d7e0f1370eb5a283 100644 (file)
@@ -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
index 949e0052a0da65b95f21225b911076e032b10305..0162ca85a10ae4bfbdb4d09cb5f153c34cca6d43 100644 (file)
@@ -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)) {
index 63c920b21da381c2ade882a0fecd89d796689b07..f6d0d6a8dc699cf4a509c0b63e020aadcac67d37 100644 (file)
@@ -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);
        }
 
index 5e809c12c53a2ce6f15d966b1d76bbcea12546dc..7956bcefbf295cb5200faa360c52d2fcb0a39ce9 100644 (file)
@@ -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);
index afe4b3ba6fb18c7da4c94d141acf77c808e20020..117a711bb59fc6370b99a92b02395f14c80b3808 100644 (file)
@@ -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)
index e6b2968091126fdb55900f7b837b065a8f7b3fc8..b100f446cceef0bcce699bef699e3200c8d999fe 100644 (file)
@@ -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]",
index 06986b780d836304b85365b95c2bfdbdddc49c9f..94a708c341775c014503cb3100b0f99bb71f5d2a 100644 (file)
@@ -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
index 6280977c5e800b2c6f27bb715cafc1a410d21d30..0697bc97d208609a8d030b49ac3191fd2efe6a01 100644 (file)
@@ -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 {
index 64141df585ab9d794884bce73dde330acc7922ea..c08d9888a1ae25c1b25c70f54cf6cb9abffe0abe 100644 (file)
@@ -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:
index 88070b02b627533d1eacfd15aacec5de080e4460..7bd0853e3d314978967358002288baf02ffccb1e 100644 (file)
@@ -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);
 }
 
index 283dd76c5e2fdfe1ade637e2cfc549d1d63e3ad1..aefe7a91d0aa3bfc6660cf1de5283aff5411bd2c 100644 (file)
@@ -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);
index c7f675c488bc2debe7d89219a6bba2a815992cd7..ab8925225b08146b5cb0e7f51b5828d42dacdd57 100644 (file)
@@ -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) {
index bfeab73a6d9b69e1fe32a806e5035917a29affc1..e1fea09ef123f26e48945ca055c86f056ccd29df 100644 (file)
@@ -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);
                }
        }
 }
index 2538dd829230e14f2ae8aec428738b4a013daf14..957e4401b5762ad5440a32f551f699ad8c97149e 100644 (file)
@@ -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);
index 9e461e140075070644b69ae97437eed7c5cdbda6..08283d5ceef079554b690859f150dd2c20f8cad8 100644 (file)
@@ -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);
 
 }
 
index d1d407ea6147451a20295c1e08ea47c3e16e81d6..421394fb28483d5d3ea0e395d2a6fa5599f4bf38 100644 (file)
@@ -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 */
index a2746d83491ea553df95134b52f07ff65f54ee10..fd04576c6ae201f537ca4c52a0733629f5faffa9 100644 (file)
@@ -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);
        }
 }
index f759520cb963f578cd76d7bdff74703cb5912677..93ff5f638866e7fd3cebd2d4831a5d7bc1d5f74c 100644 (file)
@@ -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) {
index e849f45f1ade14884e1d020fd326af134bec0374..f4a545c92bba12207e9b3ec01d9211e5816686e4 100644 (file)
@@ -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;
                }
index 5f31db4933b8198a96910c4adeb7a0c10e18b356..8cbde451727c880ef3bd564518b937633a46d0fd 100644 (file)
@@ -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);
 }
index 9816453b7a1c97d418d38f385f79d699bff451b3..e70cb180515d9a727abf6524d3f982f300fba3e4 100644 (file)
@@ -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;
                };
index 3d6d93c5d8dad7f290cba8099d3f5183fa374129..6ad82ccfc19215f505d04dd881154e161bb5a8f4 100644 (file)
@@ -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;
index c38e0256a30232dc4b160bb87c2d8adfab5d7f16..b1ba98ea8e03c3e7b0ced69394af86aa4c49a8ce 100644 (file)
@@ -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
index 1aa9b3bd4c8e8803424830381f3c227479881193..886dec36ab52f4a05edf81ad4fffff65d48bd544 100644 (file)
@@ -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);
index f59e33b8768b85b48401f32608568a8cc1b5f803..091073ecade0254f21a1f4d55d029fd8d1a6c9a4 100644 (file)
@@ -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);