aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/file-elf.c12
-rw-r--r--epan/dissectors/file-file.c2
-rw-r--r--epan/dissectors/file-png.c6
-rw-r--r--epan/dissectors/packet-3com-njack.c2
-rw-r--r--epan/dissectors/packet-3g-a11.c4
-rw-r--r--epan/dissectors/packet-6lowpan.c12
-rw-r--r--epan/dissectors/packet-aastra-aasp.c14
-rw-r--r--epan/dissectors/packet-acn.c4
-rw-r--r--epan/dissectors/packet-acr122.c24
-rw-r--r--epan/dissectors/packet-acse.c2
-rw-r--r--epan/dissectors/packet-actrace.c2
-rw-r--r--epan/dissectors/packet-adb_cs.c94
-rw-r--r--epan/dissectors/packet-adwin-config.c4
-rw-r--r--epan/dissectors/packet-adwin.c2
-rw-r--r--epan/dissectors/packet-afp.c8
-rw-r--r--epan/dissectors/packet-afs.c12
-rw-r--r--epan/dissectors/packet-agentx.c4
-rw-r--r--epan/dissectors/packet-aim-buddylist.c2
-rw-r--r--epan/dissectors/packet-aim-chat.c10
-rw-r--r--epan/dissectors/packet-aim-directory.c2
-rw-r--r--epan/dissectors/packet-aim-generic.c22
-rw-r--r--epan/dissectors/packet-aim-location.c2
-rw-r--r--epan/dissectors/packet-aim-messaging.c6
-rw-r--r--epan/dissectors/packet-aim-signon.c4
-rw-r--r--epan/dissectors/packet-aim-ssi.c2
-rw-r--r--epan/dissectors/packet-aim-userlookup.c4
-rw-r--r--epan/dissectors/packet-aim.c18
-rw-r--r--epan/dissectors/packet-ajp13.c4
-rw-r--r--epan/dissectors/packet-alcap.c2
-rw-r--r--epan/dissectors/packet-amqp.c6
-rw-r--r--epan/dissectors/packet-amr.c2
-rw-r--r--epan/dissectors/packet-ancp.c4
-rw-r--r--epan/dissectors/packet-ansi_637.c4
-rw-r--r--epan/dissectors/packet-ansi_683.c4
-rw-r--r--epan/dissectors/packet-ansi_801.c12
-rw-r--r--epan/dissectors/packet-ansi_a.c14
-rw-r--r--epan/dissectors/packet-ansi_map.c28
-rw-r--r--epan/dissectors/packet-ansi_tcap.c8
-rw-r--r--epan/dissectors/packet-aodv.c2
-rw-r--r--epan/dissectors/packet-aol.c16
-rw-r--r--epan/dissectors/packet-applemidi.c4
-rw-r--r--epan/dissectors/packet-aprs.c6
-rw-r--r--epan/dissectors/packet-ar_drone.c2
-rw-r--r--epan/dissectors/packet-armagetronad.c6
-rw-r--r--epan/dissectors/packet-artnet.c2
-rw-r--r--epan/dissectors/packet-asap.c12
-rw-r--r--epan/dissectors/packet-assa_r3.c26
-rw-r--r--epan/dissectors/packet-at.c2
-rw-r--r--epan/dissectors/packet-atalk.c6
-rw-r--r--epan/dissectors/packet-atm.c12
-rw-r--r--epan/dissectors/packet-atmtcp.c2
-rw-r--r--epan/dissectors/packet-ax25-nol3.c2
-rw-r--r--epan/dissectors/packet-babel.c2
-rw-r--r--epan/dissectors/packet-bacapp.c16
-rw-r--r--epan/dissectors/packet-bacnet.c2
-rw-r--r--epan/dissectors/packet-banana.c8
-rw-r--r--epan/dissectors/packet-batadv.c52
-rw-r--r--epan/dissectors/packet-beep.c46
-rw-r--r--epan/dissectors/packet-bencode.c2
-rw-r--r--epan/dissectors/packet-ber.c138
-rw-r--r--epan/dissectors/packet-bfcp.c2
-rw-r--r--epan/dissectors/packet-bitcoin.c6
-rw-r--r--epan/dissectors/packet-bittorrent.c10
-rw-r--r--epan/dissectors/packet-bmc.c10
-rw-r--r--epan/dissectors/packet-bofl.c2
-rw-r--r--epan/dissectors/packet-bootp.c24
-rw-r--r--epan/dissectors/packet-brdwlk.c2
-rw-r--r--epan/dissectors/packet-bssap.c114
-rw-r--r--epan/dissectors/packet-bssgp.c2
-rw-r--r--epan/dissectors/packet-bt-dht.c2
-rw-r--r--epan/dissectors/packet-bt-utp.c4
-rw-r--r--epan/dissectors/packet-bt3ds.c4
-rw-r--r--epan/dissectors/packet-btatt.c26
-rw-r--r--epan/dissectors/packet-btavdtp.c26
-rw-r--r--epan/dissectors/packet-btavrcp.c2
-rw-r--r--epan/dissectors/packet-bthci_cmd.c24
-rw-r--r--epan/dissectors/packet-bthci_evt.c10
-rw-r--r--epan/dissectors/packet-bthci_sco.c2
-rw-r--r--epan/dissectors/packet-bthcrp.c20
-rw-r--r--epan/dissectors/packet-bthfp.c24
-rw-r--r--epan/dissectors/packet-bthid.c14
-rw-r--r--epan/dissectors/packet-bthsp.c24
-rw-r--r--epan/dissectors/packet-btl2cap.c18
-rw-r--r--epan/dissectors/packet-btle.c38
-rw-r--r--epan/dissectors/packet-btmcap.c10
-rw-r--r--epan/dissectors/packet-btobex.c22
-rw-r--r--epan/dissectors/packet-btrfcomm.c14
-rw-r--r--epan/dissectors/packet-btsap.c2
-rw-r--r--epan/dissectors/packet-btsdp.c14
-rw-r--r--epan/dissectors/packet-btsmp.c2
-rw-r--r--epan/dissectors/packet-c1222.c8
-rw-r--r--epan/dissectors/packet-camel.c22
-rw-r--r--epan/dissectors/packet-canopen.c2
-rw-r--r--epan/dissectors/packet-carp.c4
-rw-r--r--epan/dissectors/packet-cast.c6
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c20
-rw-r--r--epan/dissectors/packet-cdt.c2
-rw-r--r--epan/dissectors/packet-cell_broadcast.c16
-rw-r--r--epan/dissectors/packet-charging_ase.c6
-rw-r--r--epan/dissectors/packet-cigi.c12
-rw-r--r--epan/dissectors/packet-cimd.c2
-rw-r--r--epan/dissectors/packet-cip.c32
-rw-r--r--epan/dissectors/packet-cipsafety.c10
-rw-r--r--epan/dissectors/packet-cisco-metadata.c2
-rw-r--r--epan/dissectors/packet-cisco-wids.c2
-rw-r--r--epan/dissectors/packet-classicstun.c4
-rw-r--r--epan/dissectors/packet-clique-rm.c4
-rw-r--r--epan/dissectors/packet-clnp.c4
-rw-r--r--epan/dissectors/packet-cmip.c6
-rw-r--r--epan/dissectors/packet-cmp.c14
-rw-r--r--epan/dissectors/packet-cmpp.c8
-rw-r--r--epan/dissectors/packet-cms.c10
-rw-r--r--epan/dissectors/packet-componentstatus.c6
-rw-r--r--epan/dissectors/packet-cops.c12
-rw-r--r--epan/dissectors/packet-cpfi.c6
-rw-r--r--epan/dissectors/packet-cpha.c4
-rw-r--r--epan/dissectors/packet-credssp.c2
-rw-r--r--epan/dissectors/packet-ctdb.c2
-rw-r--r--epan/dissectors/packet-dap.c2
-rw-r--r--epan/dissectors/packet-data.c2
-rw-r--r--epan/dissectors/packet-db-lsp.c8
-rw-r--r--epan/dissectors/packet-dbus.c2
-rw-r--r--epan/dissectors/packet-dcc.c8
-rw-r--r--epan/dissectors/packet-dccp.c24
-rw-r--r--epan/dissectors/packet-dcerpc-dnsserver.c2
-rw-r--r--epan/dissectors/packet-dcerpc-eventlog.c4
-rw-r--r--epan/dissectors/packet-dcerpc-frsrpc.c4
-rw-r--r--epan/dissectors/packet-dcerpc-krb5rpc.c4
-rw-r--r--epan/dissectors/packet-dcerpc-lsa.c4
-rw-r--r--epan/dissectors/packet-dcerpc-netlogon.c4
-rw-r--r--epan/dissectors/packet-dcerpc-nt.c2
-rw-r--r--epan/dissectors/packet-dcerpc-rs_pgo.c6
-rw-r--r--epan/dissectors/packet-dcerpc-spoolss.c6
-rw-r--r--epan/dissectors/packet-dcerpc.c36
-rw-r--r--epan/dissectors/packet-dcm.c10
-rw-r--r--epan/dissectors/packet-dcp-etsi.c14
-rw-r--r--epan/dissectors/packet-ddtp.c4
-rw-r--r--epan/dissectors/packet-dec-dnart.c8
-rw-r--r--epan/dissectors/packet-dect.c4
-rw-r--r--epan/dissectors/packet-devicenet.c2
-rw-r--r--epan/dissectors/packet-dhcp-failover.c6
-rw-r--r--epan/dissectors/packet-dhcpv6.c4
-rw-r--r--epan/dissectors/packet-diameter.c48
-rw-r--r--epan/dissectors/packet-diameter_3gpp.c20
-rw-r--r--epan/dissectors/packet-disp.c4
-rw-r--r--epan/dissectors/packet-distcc.c10
-rw-r--r--epan/dissectors/packet-dlm3.c4
-rw-r--r--epan/dissectors/packet-dlsw.c4
-rw-r--r--epan/dissectors/packet-dmp.c10
-rw-r--r--epan/dissectors/packet-dmx-sip.c2
-rw-r--r--epan/dissectors/packet-dmx.c2
-rw-r--r--epan/dissectors/packet-dnp.c14
-rw-r--r--epan/dissectors/packet-dop.c6
-rw-r--r--epan/dissectors/packet-dplay.c2
-rw-r--r--epan/dissectors/packet-dpnss-link.c2
-rw-r--r--epan/dissectors/packet-dpnss.c38
-rw-r--r--epan/dissectors/packet-drda.c14
-rw-r--r--epan/dissectors/packet-dsi.c6
-rw-r--r--epan/dissectors/packet-dsp.c4
-rw-r--r--epan/dissectors/packet-dtls.c12
-rw-r--r--epan/dissectors/packet-dtn.c10
-rw-r--r--epan/dissectors/packet-dtpt.c2
-rw-r--r--epan/dissectors/packet-dua.c6
-rw-r--r--epan/dissectors/packet-dvb-s2-bb.c4
-rw-r--r--epan/dissectors/packet-dvbci.c2
-rw-r--r--epan/dissectors/packet-dvmrp.c4
-rw-r--r--epan/dissectors/packet-e100.c6
-rw-r--r--epan/dissectors/packet-eap.c4
-rw-r--r--epan/dissectors/packet-edonkey.c8
-rw-r--r--epan/dissectors/packet-egd.c2
-rw-r--r--epan/dissectors/packet-ehdlc.c2
-rw-r--r--epan/dissectors/packet-eigrp.c14
-rw-r--r--epan/dissectors/packet-elcom.c54
-rw-r--r--epan/dissectors/packet-enip.c16
-rw-r--r--epan/dissectors/packet-enrp.c14
-rw-r--r--epan/dissectors/packet-epl_v1.c2
-rw-r--r--epan/dissectors/packet-epmd.c12
-rw-r--r--epan/dissectors/packet-erf.c4
-rw-r--r--epan/dissectors/packet-erldp.c14
-rw-r--r--epan/dissectors/packet-esio.c4
-rw-r--r--epan/dissectors/packet-ess.c4
-rw-r--r--epan/dissectors/packet-etch.c6
-rw-r--r--epan/dissectors/packet-ethertype.c4
-rw-r--r--epan/dissectors/packet-etsi_card_app_toolkit.c2
-rw-r--r--epan/dissectors/packet-exec.c12
-rw-r--r--epan/dissectors/packet-extreme.c2
-rw-r--r--epan/dissectors/packet-fc.c8
-rw-r--r--epan/dissectors/packet-fcct.c2
-rw-r--r--epan/dissectors/packet-fcdns.c2
-rw-r--r--epan/dissectors/packet-fcfcs.c6
-rw-r--r--epan/dissectors/packet-fcfzs.c10
-rw-r--r--epan/dissectors/packet-fcgi.c4
-rw-r--r--epan/dissectors/packet-fcip.c4
-rw-r--r--epan/dissectors/packet-fcoe.c4
-rw-r--r--epan/dissectors/packet-fcoib.c4
-rw-r--r--epan/dissectors/packet-fcp.c12
-rw-r--r--epan/dissectors/packet-fcsp.c4
-rw-r--r--epan/dissectors/packet-fcswils.c8
-rw-r--r--epan/dissectors/packet-ff.c4
-rw-r--r--epan/dissectors/packet-finger.c2
-rw-r--r--epan/dissectors/packet-fix.c18
-rw-r--r--epan/dissectors/packet-flip.c6
-rw-r--r--epan/dissectors/packet-fmtp.c2
-rw-r--r--epan/dissectors/packet-frame.c2
-rw-r--r--epan/dissectors/packet-ftam.c4
-rw-r--r--epan/dissectors/packet-ftp.c2
-rw-r--r--epan/dissectors/packet-gadu-gadu.c6
-rw-r--r--epan/dissectors/packet-gdsdb.c134
-rw-r--r--epan/dissectors/packet-gearman.c4
-rw-r--r--epan/dissectors/packet-ged125.c6
-rw-r--r--epan/dissectors/packet-giop.c12
-rw-r--r--epan/dissectors/packet-git.c4
-rw-r--r--epan/dissectors/packet-glbp.c4
-rw-r--r--epan/dissectors/packet-gmhdr.c6
-rw-r--r--epan/dissectors/packet-gmr1_bcch.c2
-rw-r--r--epan/dissectors/packet-gmr1_dtap.c2
-rw-r--r--epan/dissectors/packet-gmr1_rach.c2
-rw-r--r--epan/dissectors/packet-gmr1_rr.c2
-rw-r--r--epan/dissectors/packet-gnutella.c6
-rw-r--r--epan/dissectors/packet-goose.c2
-rw-r--r--epan/dissectors/packet-gopher.c4
-rw-r--r--epan/dissectors/packet-gprs-llc.c4
-rw-r--r--epan/dissectors/packet-gre.c2
-rw-r--r--epan/dissectors/packet-gsm_a_bssmap.c6
-rw-r--r--epan/dissectors/packet-gsm_a_dtap.c2
-rw-r--r--epan/dissectors/packet-gsm_a_rp.c2
-rw-r--r--epan/dissectors/packet-gsm_a_rr.c40
-rw-r--r--epan/dissectors/packet-gsm_bsslap.c18
-rw-r--r--epan/dissectors/packet-gsm_bssmap_le.c2
-rw-r--r--epan/dissectors/packet-gsm_cbch.c4
-rw-r--r--epan/dissectors/packet-gsm_map.c26
-rw-r--r--epan/dissectors/packet-gsm_rlcmac.c20
-rw-r--r--epan/dissectors/packet-gsm_sms.c24
-rw-r--r--epan/dissectors/packet-gsm_um.c4
-rw-r--r--epan/dissectors/packet-gsmtap.c2
-rw-r--r--epan/dissectors/packet-gssapi.c36
-rw-r--r--epan/dissectors/packet-gtp.c12
-rw-r--r--epan/dissectors/packet-gtpv2.c2
-rw-r--r--epan/dissectors/packet-h1.c2
-rw-r--r--epan/dissectors/packet-h221_nonstd.c4
-rw-r--r--epan/dissectors/packet-h223.c6
-rw-r--r--epan/dissectors/packet-h225.c12
-rw-r--r--epan/dissectors/packet-h245.c8
-rw-r--r--epan/dissectors/packet-h248.c16
-rw-r--r--epan/dissectors/packet-h248_3gpp.c6
-rw-r--r--epan/dissectors/packet-h248_annex_c.c10
-rw-r--r--epan/dissectors/packet-h264.c12
-rw-r--r--epan/dissectors/packet-h283.c4
-rw-r--r--epan/dissectors/packet-h450.c18
-rw-r--r--epan/dissectors/packet-h460.c4
-rw-r--r--epan/dissectors/packet-h501.c4
-rw-r--r--epan/dissectors/packet-hazelcast.c6
-rw-r--r--epan/dissectors/packet-hci_h1.c2
-rw-r--r--epan/dissectors/packet-hci_h4.c2
-rw-r--r--epan/dissectors/packet-hci_mon.c12
-rw-r--r--epan/dissectors/packet-hci_usb.c4
-rw-r--r--epan/dissectors/packet-hdfs.c4
-rw-r--r--epan/dissectors/packet-hdfsdata.c4
-rw-r--r--epan/dissectors/packet-hip.c2
-rw-r--r--epan/dissectors/packet-hnbap.c16
-rw-r--r--epan/dissectors/packet-homeplug-av.c4
-rw-r--r--epan/dissectors/packet-homeplug.c8
-rw-r--r--epan/dissectors/packet-hpext.c2
-rw-r--r--epan/dissectors/packet-hpfeeds.c4
-rw-r--r--epan/dissectors/packet-hpsw.c2
-rw-r--r--epan/dissectors/packet-hsrp.c2
-rw-r--r--epan/dissectors/packet-http-urlencoded.c2
-rw-r--r--epan/dissectors/packet-http.c16
-rw-r--r--epan/dissectors/packet-i2c.c2
-rw-r--r--epan/dissectors/packet-iapp.c2
-rw-r--r--epan/dissectors/packet-iax2.c8
-rw-r--r--epan/dissectors/packet-icap.c2
-rw-r--r--epan/dissectors/packet-icep.c10
-rw-r--r--epan/dissectors/packet-icmp.c8
-rw-r--r--epan/dissectors/packet-icmpv6.c2
-rw-r--r--epan/dissectors/packet-icq.c4
-rw-r--r--epan/dissectors/packet-idmp.c4
-rw-r--r--epan/dissectors/packet-iec104.c8
-rw-r--r--epan/dissectors/packet-ieee17221.c2
-rw-r--r--epan/dissectors/packet-ieee80211-radiotap.c4
-rw-r--r--epan/dissectors/packet-ieee80211.c8
-rw-r--r--epan/dissectors/packet-ieee802154.c24
-rw-r--r--epan/dissectors/packet-ieee8023.c2
-rw-r--r--epan/dissectors/packet-ifcp.c8
-rw-r--r--epan/dissectors/packet-igap.c2
-rw-r--r--epan/dissectors/packet-igmp.c4
-rw-r--r--epan/dissectors/packet-ilp.c2
-rw-r--r--epan/dissectors/packet-imap.c2
-rw-r--r--epan/dissectors/packet-imf.c2
-rw-r--r--epan/dissectors/packet-inap.c6
-rw-r--r--epan/dissectors/packet-infiniband.c14
-rw-r--r--epan/dissectors/packet-infiniband_sdp.c4
-rw-r--r--epan/dissectors/packet-ip.c2
-rw-r--r--epan/dissectors/packet-ipars.c16
-rw-r--r--epan/dissectors/packet-ipdc.c4
-rw-r--r--epan/dissectors/packet-ipnet.c2
-rw-r--r--epan/dissectors/packet-ipsec-tcp.c4
-rw-r--r--epan/dissectors/packet-ipsec-udp.c2
-rw-r--r--epan/dissectors/packet-ipsec.c8
-rw-r--r--epan/dissectors/packet-ipx.c2
-rw-r--r--epan/dissectors/packet-isakmp.c6
-rw-r--r--epan/dissectors/packet-iscsi.c20
-rw-r--r--epan/dissectors/packet-isdn-sup.c18
-rw-r--r--epan/dissectors/packet-isis-hello.c8
-rw-r--r--epan/dissectors/packet-isis-lsp.c6
-rw-r--r--epan/dissectors/packet-isis-snp.c10
-rw-r--r--epan/dissectors/packet-isl.c2
-rw-r--r--epan/dissectors/packet-ismp.c2
-rw-r--r--epan/dissectors/packet-isns.c12
-rw-r--r--epan/dissectors/packet-isup.c178
-rw-r--r--epan/dissectors/packet-itdm.c2
-rw-r--r--epan/dissectors/packet-iua.c6
-rw-r--r--epan/dissectors/packet-iuup.c10
-rw-r--r--epan/dissectors/packet-iwarp-mpa.c6
-rw-r--r--epan/dissectors/packet-ixiatrailer.c2
-rw-r--r--epan/dissectors/packet-ixveriwave.c4
-rw-r--r--epan/dissectors/packet-j1939.c2
-rw-r--r--epan/dissectors/packet-json.c6
-rw-r--r--epan/dissectors/packet-jxta.c10
-rw-r--r--epan/dissectors/packet-kafka.c12
-rw-r--r--epan/dissectors/packet-kdsp.c4
-rw-r--r--epan/dissectors/packet-kerberos.c44
-rw-r--r--epan/dissectors/packet-kingfisher.c2
-rw-r--r--epan/dissectors/packet-kink.c10
-rw-r--r--epan/dissectors/packet-knet.c6
-rw-r--r--epan/dissectors/packet-kpasswd.c4
-rw-r--r--epan/dissectors/packet-l1-events.c2
-rw-r--r--epan/dissectors/packet-l2tp.c8
-rw-r--r--epan/dissectors/packet-lanforge.c4
-rw-r--r--epan/dissectors/packet-lapd.c8
-rw-r--r--epan/dissectors/packet-lapdm.c4
-rw-r--r--epan/dissectors/packet-laplink.c6
-rw-r--r--epan/dissectors/packet-lapsat.c8
-rw-r--r--epan/dissectors/packet-lbmc.c2
-rw-r--r--epan/dissectors/packet-lcsap.c12
-rw-r--r--epan/dissectors/packet-ldap.c68
-rw-r--r--epan/dissectors/packet-ldp.c8
-rw-r--r--epan/dissectors/packet-ldss.c22
-rw-r--r--epan/dissectors/packet-lg8979.c18
-rw-r--r--epan/dissectors/packet-llc.c2
-rw-r--r--epan/dissectors/packet-llrp.c4
-rw-r--r--epan/dissectors/packet-lmp.c8
-rw-r--r--epan/dissectors/packet-logcat.c2
-rw-r--r--epan/dissectors/packet-loop.c2
-rw-r--r--epan/dissectors/packet-lppa.c8
-rw-r--r--epan/dissectors/packet-lsc.c10
-rw-r--r--epan/dissectors/packet-ltp.c48
-rw-r--r--epan/dissectors/packet-m2pa.c12
-rw-r--r--epan/dissectors/packet-m2ua.c4
-rw-r--r--epan/dissectors/packet-m3ap.c20
-rw-r--r--epan/dissectors/packet-m3ua.c18
-rw-r--r--epan/dissectors/packet-mac-lte-framed.c2
-rw-r--r--epan/dissectors/packet-macsec.c6
-rw-r--r--epan/dissectors/packet-mactelnet.c2
-rw-r--r--epan/dissectors/packet-mbtcp.c22
-rw-r--r--epan/dissectors/packet-mdshdr.c6
-rw-r--r--epan/dissectors/packet-media.c6
-rw-r--r--epan/dissectors/packet-megaco.c8
-rw-r--r--epan/dissectors/packet-memcache.c14
-rw-r--r--epan/dissectors/packet-mgcp.c22
-rw-r--r--epan/dissectors/packet-mih.c2
-rw-r--r--epan/dissectors/packet-mikey.c2
-rw-r--r--epan/dissectors/packet-mim.c2
-rw-r--r--epan/dissectors/packet-mint.c10
-rw-r--r--epan/dissectors/packet-miop.c2
-rw-r--r--epan/dissectors/packet-mms.c4
-rw-r--r--epan/dissectors/packet-mndp.c4
-rw-r--r--epan/dissectors/packet-mojito.c6
-rw-r--r--epan/dissectors/packet-moldudp.c2
-rw-r--r--epan/dissectors/packet-moldudp64.c4
-rw-r--r--epan/dissectors/packet-mongo.c4
-rw-r--r--epan/dissectors/packet-mp2t.c4
-rw-r--r--epan/dissectors/packet-mp4ves.c8
-rw-r--r--epan/dissectors/packet-mpls-echo.c4
-rw-r--r--epan/dissectors/packet-mq-pcf.c6
-rw-r--r--epan/dissectors/packet-mq.c180
-rw-r--r--epan/dissectors/packet-mrcpv2.c6
-rw-r--r--epan/dissectors/packet-mrdisc.c2
-rw-r--r--epan/dissectors/packet-ms-mms.c2
-rw-r--r--epan/dissectors/packet-msdp.c4
-rw-r--r--epan/dissectors/packet-msnip.c2
-rw-r--r--epan/dissectors/packet-msrp.c6
-rw-r--r--epan/dissectors/packet-mstp.c2
-rw-r--r--epan/dissectors/packet-mtp2.c8
-rw-r--r--epan/dissectors/packet-mtp3.c2
-rw-r--r--epan/dissectors/packet-mtp3mg.c2
-rw-r--r--epan/dissectors/packet-multipart.c22
-rw-r--r--epan/dissectors/packet-nas_eps.c10
-rw-r--r--epan/dissectors/packet-nb_rtpmux.c6
-rw-r--r--epan/dissectors/packet-nbap.c14
-rw-r--r--epan/dissectors/packet-nbd.c16
-rw-r--r--epan/dissectors/packet-nbipx.c2
-rw-r--r--epan/dissectors/packet-nbns.c14
-rw-r--r--epan/dissectors/packet-ncp-nmas.c2
-rw-r--r--epan/dissectors/packet-ncp-sss.c36
-rw-r--r--epan/dissectors/packet-ncp.c12
-rw-r--r--epan/dissectors/packet-ncp2222.inc68
-rw-r--r--epan/dissectors/packet-ndmp.c30
-rw-r--r--epan/dissectors/packet-ndps.c36
-rw-r--r--epan/dissectors/packet-negoex.c6
-rw-r--r--epan/dissectors/packet-netanalyzer.c12
-rw-r--r--epan/dissectors/packet-netlink.c2
-rw-r--r--epan/dissectors/packet-netsync.c6
-rw-r--r--epan/dissectors/packet-nfs.c6
-rw-r--r--epan/dissectors/packet-nsip.c4
-rw-r--r--epan/dissectors/packet-ntlmssp.c10
-rw-r--r--epan/dissectors/packet-ntp.c4
-rw-r--r--epan/dissectors/packet-nwmtp.c2
-rw-r--r--epan/dissectors/packet-oicq.c2
-rw-r--r--epan/dissectors/packet-olsr.c8
-rw-r--r--epan/dissectors/packet-omron-fins.c18
-rw-r--r--epan/dissectors/packet-opensafety.c6
-rw-r--r--epan/dissectors/packet-openvpn.c22
-rw-r--r--epan/dissectors/packet-openwire.c110
-rw-r--r--epan/dissectors/packet-opsi.c4
-rw-r--r--epan/dissectors/packet-osi.c4
-rw-r--r--epan/dissectors/packet-ositp.c12
-rw-r--r--epan/dissectors/packet-ospf.c2
-rw-r--r--epan/dissectors/packet-p1.c36
-rw-r--r--epan/dissectors/packet-p22.c2
-rw-r--r--epan/dissectors/packet-p_mul.c8
-rw-r--r--epan/dissectors/packet-packetlogger.c2
-rw-r--r--epan/dissectors/packet-paltalk.c2
-rw-r--r--epan/dissectors/packet-pana.c2
-rw-r--r--epan/dissectors/packet-pathport.c2
-rw-r--r--epan/dissectors/packet-pcap.c12
-rw-r--r--epan/dissectors/packet-pcep.c4
-rw-r--r--epan/dissectors/packet-pcp.c4
-rw-r--r--epan/dissectors/packet-peekremote.c2
-rw-r--r--epan/dissectors/packet-per.c4
-rw-r--r--epan/dissectors/packet-pgm.c2
-rw-r--r--epan/dissectors/packet-pgsql.c4
-rw-r--r--epan/dissectors/packet-pim.c10
-rw-r--r--epan/dissectors/packet-pkcs12.c4
-rw-r--r--epan/dissectors/packet-pkix1explicit.c2
-rw-r--r--epan/dissectors/packet-pktc.c2
-rw-r--r--epan/dissectors/packet-pktgen.c8
-rw-r--r--epan/dissectors/packet-pnrp.c2
-rw-r--r--epan/dissectors/packet-pop.c6
-rw-r--r--epan/dissectors/packet-ppi.c2
-rw-r--r--epan/dissectors/packet-ppp.c14
-rw-r--r--epan/dissectors/packet-pppoe.c2
-rw-r--r--epan/dissectors/packet-pres.c6
-rw-r--r--epan/dissectors/packet-ptp.c2
-rw-r--r--epan/dissectors/packet-ptpip.c2
-rw-r--r--epan/dissectors/packet-pulse.c2
-rw-r--r--epan/dissectors/packet-pvfs2.c8
-rw-r--r--epan/dissectors/packet-pw-atm.c4
-rw-r--r--epan/dissectors/packet-q931.c4
-rw-r--r--epan/dissectors/packet-q932-ros.c12
-rw-r--r--epan/dissectors/packet-q932.c2
-rw-r--r--epan/dissectors/packet-qllc.c4
-rw-r--r--epan/dissectors/packet-qsig.c26
-rw-r--r--epan/dissectors/packet-quake2.c2
-rw-r--r--epan/dissectors/packet-quake3.c2
-rw-r--r--epan/dissectors/packet-quic.c2
-rw-r--r--epan/dissectors/packet-radius.c18
-rw-r--r--epan/dissectors/packet-radius_packetcable.c4
-rw-r--r--epan/dissectors/packet-ranap.c32
-rw-r--r--epan/dissectors/packet-rdm.c2
-rw-r--r--epan/dissectors/packet-rdp.c6
-rw-r--r--epan/dissectors/packet-rdt.c52
-rw-r--r--epan/dissectors/packet-redbackli.c4
-rw-r--r--epan/dissectors/packet-reload-framing.c6
-rw-r--r--epan/dissectors/packet-reload.c4
-rw-r--r--epan/dissectors/packet-rfid-pn532-hci.c14
-rw-r--r--epan/dissectors/packet-rfid-pn532.c112
-rw-r--r--epan/dissectors/packet-rgmp.c2
-rw-r--r--epan/dissectors/packet-rlc.c42
-rw-r--r--epan/dissectors/packet-rlm.c2
-rw-r--r--epan/dissectors/packet-rlogin.c12
-rw-r--r--epan/dissectors/packet-rmcp.c8
-rw-r--r--epan/dissectors/packet-rnsap.c12
-rw-r--r--epan/dissectors/packet-rohc.c32
-rw-r--r--epan/dissectors/packet-ros.c6
-rw-r--r--epan/dissectors/packet-rpc.c20
-rw-r--r--epan/dissectors/packet-rpcap.c20
-rw-r--r--epan/dissectors/packet-rpki-rtr.c4
-rw-r--r--epan/dissectors/packet-rpl.c2
-rw-r--r--epan/dissectors/packet-rrc.c10
-rw-r--r--epan/dissectors/packet-rsh.c12
-rw-r--r--epan/dissectors/packet-rsl.c112
-rw-r--r--epan/dissectors/packet-rsvp.c6
-rw-r--r--epan/dissectors/packet-rsync.c6
-rw-r--r--epan/dissectors/packet-rtacser.c4
-rw-r--r--epan/dissectors/packet-rtcdc.c8
-rw-r--r--epan/dissectors/packet-rtcp.c4
-rw-r--r--epan/dissectors/packet-rtmpt.c28
-rw-r--r--epan/dissectors/packet-rtpproxy.c2
-rw-r--r--epan/dissectors/packet-rtse.c18
-rw-r--r--epan/dissectors/packet-rtsp.c2
-rw-r--r--epan/dissectors/packet-rua.c12
-rw-r--r--epan/dissectors/packet-rudp.c2
-rw-r--r--epan/dissectors/packet-rx.c6
-rw-r--r--epan/dissectors/packet-s1ap.c30
-rw-r--r--epan/dissectors/packet-s5066dts.c6
-rw-r--r--epan/dissectors/packet-s5066sis.c8
-rw-r--r--epan/dissectors/packet-sabp.c16
-rw-r--r--epan/dissectors/packet-sametime.c6
-rw-r--r--epan/dissectors/packet-sap.c2
-rw-r--r--epan/dissectors/packet-sasp.c6
-rw-r--r--epan/dissectors/packet-sbc-ap.c16
-rw-r--r--epan/dissectors/packet-sbc.c2
-rw-r--r--epan/dissectors/packet-sbus.c2
-rw-r--r--epan/dissectors/packet-sccp.c6
-rw-r--r--epan/dissectors/packet-sccpmg.c2
-rw-r--r--epan/dissectors/packet-scop.c8
-rw-r--r--epan/dissectors/packet-scsi-osd.c6
-rw-r--r--epan/dissectors/packet-scsi.c50
-rw-r--r--epan/dissectors/packet-sctp.c60
-rw-r--r--epan/dissectors/packet-sdp.c20
-rw-r--r--epan/dissectors/packet-sebek.c4
-rw-r--r--epan/dissectors/packet-selfm.c28
-rw-r--r--epan/dissectors/packet-ses.c10
-rw-r--r--epan/dissectors/packet-sflow.c2
-rw-r--r--epan/dissectors/packet-sgsap.c2
-rw-r--r--epan/dissectors/packet-sigcomp.c12
-rw-r--r--epan/dissectors/packet-simulcrypt.c4
-rw-r--r--epan/dissectors/packet-skinny.c6
-rw-r--r--epan/dissectors/packet-skype.c6
-rw-r--r--epan/dissectors/packet-slsk.c40
-rw-r--r--epan/dissectors/packet-smb-logon.c2
-rw-r--r--epan/dissectors/packet-smb-pipe.c8
-rw-r--r--epan/dissectors/packet-smb.c68
-rw-r--r--epan/dissectors/packet-smb2.c138
-rw-r--r--epan/dissectors/packet-smpp.c12
-rw-r--r--epan/dissectors/packet-smtp.c10
-rw-r--r--epan/dissectors/packet-sna.c2
-rw-r--r--epan/dissectors/packet-sndcp.c2
-rw-r--r--epan/dissectors/packet-snmp.c26
-rw-r--r--epan/dissectors/packet-socks.c2
-rw-r--r--epan/dissectors/packet-soupbintcp.c4
-rw-r--r--epan/dissectors/packet-spice.c14
-rw-r--r--epan/dissectors/packet-spnego.c30
-rw-r--r--epan/dissectors/packet-sprt.c8
-rw-r--r--epan/dissectors/packet-srvloc.c6
-rw-r--r--epan/dissectors/packet-ssl.c12
-rw-r--r--epan/dissectors/packet-stanag4607.c2
-rw-r--r--epan/dissectors/packet-starteam.c28
-rw-r--r--epan/dissectors/packet-sua.c12
-rw-r--r--epan/dissectors/packet-sv.c4
-rw-r--r--epan/dissectors/packet-sync.c8
-rw-r--r--epan/dissectors/packet-synergy.c8
-rw-r--r--epan/dissectors/packet-synphasor.c10
-rw-r--r--epan/dissectors/packet-sysex.c10
-rw-r--r--epan/dissectors/packet-t124.c8
-rw-r--r--epan/dissectors/packet-t125.c4
-rw-r--r--epan/dissectors/packet-t30.c2
-rw-r--r--epan/dissectors/packet-t38.c8
-rw-r--r--epan/dissectors/packet-tacacs.c4
-rw-r--r--epan/dissectors/packet-tali.c4
-rw-r--r--epan/dissectors/packet-tapa.c4
-rw-r--r--epan/dissectors/packet-tcap.c4
-rw-r--r--epan/dissectors/packet-tdmoe.c2
-rw-r--r--epan/dissectors/packet-tds.c8
-rw-r--r--epan/dissectors/packet-teamspeak2.c12
-rw-r--r--epan/dissectors/packet-telnet.c6
-rw-r--r--epan/dissectors/packet-teredo.c8
-rw-r--r--epan/dissectors/packet-tetra.c2
-rw-r--r--epan/dissectors/packet-text-media.c6
-rw-r--r--epan/dissectors/packet-tipc.c16
-rw-r--r--epan/dissectors/packet-tivoconnect.c4
-rw-r--r--epan/dissectors/packet-tns.c4
-rw-r--r--epan/dissectors/packet-tpkt.c6
-rw-r--r--epan/dissectors/packet-tpncp.c8
-rw-r--r--epan/dissectors/packet-tr.c2
-rw-r--r--epan/dissectors/packet-trill.c2
-rw-r--r--epan/dissectors/packet-tte-pcf.c2
-rw-r--r--epan/dissectors/packet-tte.c4
-rw-r--r--epan/dissectors/packet-turbocell.c6
-rw-r--r--epan/dissectors/packet-turnchannel.c10
-rw-r--r--epan/dissectors/packet-tuxedo.c4
-rw-r--r--epan/dissectors/packet-ua3g.c2
-rw-r--r--epan/dissectors/packet-uasip.c2
-rw-r--r--epan/dissectors/packet-ubertooth.c26
-rw-r--r--epan/dissectors/packet-ucp.c14
-rw-r--r--epan/dissectors/packet-ulp.c2
-rw-r--r--epan/dissectors/packet-uma.c10
-rw-r--r--epan/dissectors/packet-umts_fp.c20
-rw-r--r--epan/dissectors/packet-umts_mac.c2
-rw-r--r--epan/dissectors/packet-usb-audio.c6
-rw-r--r--epan/dissectors/packet-usb-ccid.c2
-rw-r--r--epan/dissectors/packet-usb-dfu.c18
-rw-r--r--epan/dissectors/packet-usb-hid.c4
-rw-r--r--epan/dissectors/packet-usb-hub.c4
-rw-r--r--epan/dissectors/packet-usb-masstorage.c26
-rw-r--r--epan/dissectors/packet-usb-video.c6
-rw-r--r--epan/dissectors/packet-user_encap.c2
-rw-r--r--epan/dissectors/packet-uts.c8
-rw-r--r--epan/dissectors/packet-v150fw.c6
-rw-r--r--epan/dissectors/packet-v52.c28
-rw-r--r--epan/dissectors/packet-v5dl.c10
-rw-r--r--epan/dissectors/packet-v5ua.c18
-rw-r--r--epan/dissectors/packet-vines.c2
-rw-r--r--epan/dissectors/packet-vlan.c2
-rw-r--r--epan/dissectors/packet-vnc.c8
-rw-r--r--epan/dissectors/packet-vntag.c2
-rw-r--r--epan/dissectors/packet-vrrp.c2
-rw-r--r--epan/dissectors/packet-wassp.c2
-rw-r--r--epan/dissectors/packet-waveagent.c4
-rw-r--r--epan/dissectors/packet-wccp.c8
-rw-r--r--epan/dissectors/packet-websocket.c4
-rw-r--r--epan/dissectors/packet-whois.c2
-rw-r--r--epan/dissectors/packet-wifi-p2p.c6
-rw-r--r--epan/dissectors/packet-winsrepl.c4
-rw-r--r--epan/dissectors/packet-wlccp.c8
-rw-r--r--epan/dissectors/packet-wol.c2
-rw-r--r--epan/dissectors/packet-wow.c2
-rw-r--r--epan/dissectors/packet-wsp.c4
-rw-r--r--epan/dissectors/packet-wtls.c4
-rw-r--r--epan/dissectors/packet-wtp.c4
-rw-r--r--epan/dissectors/packet-x224.c2
-rw-r--r--epan/dissectors/packet-x25.c4
-rw-r--r--epan/dissectors/packet-x29.c2
-rw-r--r--epan/dissectors/packet-x2ap.c14
-rw-r--r--epan/dissectors/packet-x509if.c2
-rw-r--r--epan/dissectors/packet-x509sat.c2
-rw-r--r--epan/dissectors/packet-xcsl.c2
-rw-r--r--epan/dissectors/packet-xmcp.c8
-rw-r--r--epan/dissectors/packet-xml.c4
-rw-r--r--epan/dissectors/packet-xot.c20
-rw-r--r--epan/dissectors/packet-xtp.c20
-rw-r--r--epan/dissectors/packet-yami.c4
-rw-r--r--epan/dissectors/packet-yhoo.c2
-rw-r--r--epan/dissectors/packet-ymsg.c6
-rw-r--r--epan/dissectors/packet-zbee-aps.c36
-rw-r--r--epan/dissectors/packet-zbee-nwk-gp.c8
-rw-r--r--epan/dissectors/packet-zbee-nwk.c26
-rw-r--r--epan/dissectors/packet-zbee-security.c6
-rw-r--r--epan/dissectors/packet-zbee-zcl-general.c14
-rw-r--r--epan/dissectors/packet-zbee-zcl-ha.c4
-rw-r--r--epan/dissectors/packet-zbee-zcl-se.c2
-rw-r--r--epan/dissectors/packet-zbee-zcl.c28
-rw-r--r--epan/dissectors/packet-zbee-zdp-binding.c6
-rw-r--r--epan/dissectors/packet-zbee-zdp-management.c6
-rw-r--r--epan/dissectors/packet-zbee-zdp.c10
-rw-r--r--epan/dissectors/packet-zep.c2
-rw-r--r--epan/dissectors/packet-ziop.c10
638 files changed, 3408 insertions, 3408 deletions
diff --git a/epan/dissectors/file-elf.c b/epan/dissectors/file-elf.c
index 9f8384116f..df457e9211 100644
--- a/epan/dissectors/file-elf.c
+++ b/epan/dissectors/file-elf.c
@@ -1155,7 +1155,7 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
guint64 strtab_offset = 0;
guint64 dynstr_offset = 0;
- if (tvb_length(tvb) < 52)
+ if (tvb_captured_length(tvb) < 52)
return 0;
if (tvb_memeql(tvb, 0, magic, sizeof(magic)) != 0)
@@ -1703,8 +1703,8 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
}
- if (segment_info[area_counter - 1].offset + segment_info[area_counter - 1].size < tvb_length(tvb)) {
- len = tvb_length(tvb) - (guint) (segment_info[area_counter - 1].offset - segment_info[area_counter - 1].size);
+ if (segment_info[area_counter - 1].offset + segment_info[area_counter - 1].size < tvb_captured_length(tvb)) {
+ len = tvb_captured_length(tvb) - (guint) (segment_info[area_counter - 1].offset - segment_info[area_counter - 1].size);
proto_tree_add_text(blackhole_tree, tvb,
value_guard(segment_info[area_counter - 1].offset +
@@ -1713,15 +1713,15 @@ dissect_elf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
segment_info[area_counter - 1].name, len);
}
- proto_tree_add_text(generated_tree, tvb, 0, 0, "File size: %i", tvb_length(tvb));
+ proto_tree_add_text(generated_tree, tvb, 0, 0, "File size: %i", tvb_captured_length(tvb));
proto_tree_add_text(generated_tree, tvb, 0, 0, "Header size + all segment size: %i", (int) file_size);
- proto_tree_add_text(generated_tree, tvb, 0, 0, "Total blackholes size: %i", tvb_length(tvb) - (int) file_size);
+ proto_tree_add_text(generated_tree, tvb, 0, 0, "Total blackholes size: %i", tvb_captured_length(tvb) - (int) file_size);
col_clear(pinfo->cinfo, COL_INFO);
col_add_str(pinfo->cinfo, COL_INFO, "(ELF)");
/* We jumping around offsets, so treat as bytes as read */
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
return offset;
}
diff --git a/epan/dissectors/file-file.c b/epan/dissectors/file-file.c
index 35767a6370..88b6ed1304 100644
--- a/epan/dissectors/file-file.c
+++ b/epan/dissectors/file-file.c
@@ -110,7 +110,7 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
gboolean old_visible;
/* Put in frame header information. */
- cap_len = tvb_length(tvb);
+ cap_len = tvb_captured_length(tvb);
frame_len = tvb_reported_length(tvb);
cap_plurality = plurality(cap_len, "", "s");
diff --git a/epan/dissectors/file-png.c b/epan/dissectors/file-png.c
index 4d19f19da8..0ba4fa22cc 100644
--- a/epan/dissectors/file-png.c
+++ b/epan/dissectors/file-png.c
@@ -326,7 +326,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
gint offset=0, nul_offset;
- nul_offset = tvb_find_guint8(tvb, offset, tvb_length_remaining(tvb, offset), 0);
+ nul_offset = tvb_find_guint8(tvb, offset, tvb_captured_length_remaining(tvb, offset), 0);
/* nul_offset == 0 means empty keyword, this is not allowed by the png standard */
if (nul_offset<=0) {
/* XXX exception */
@@ -336,7 +336,7 @@ dissect_png_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, &hfi_png_text_keyword, tvb, offset, nul_offset, ENC_ISO_8859_1|ENC_NA);
offset = nul_offset+1; /* length of the key word + 0 character */
- proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA);
+ proto_tree_add_item(tree, &hfi_png_text_string, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ISO_8859_1|ENC_NA);
}
@@ -442,7 +442,7 @@ dissect_png(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *da
/* http://libpng.org/pub/png/spec/1.2/PNG-Structure.html#PNG-file-signature */
static const guint8 magic[8] = { 137, 80, 78, 71, 13, 10, 26, 10 };
- if (tvb_length(tvb) < 20)
+ if (tvb_captured_length(tvb) < 20)
return 0;
if (tvb_memeql(tvb, 0, magic, sizeof(magic)) != 0)
return 0;
diff --git a/epan/dissectors/packet-3com-njack.c b/epan/dissectors/packet-3com-njack.c
index 1b45fd2b31..24957b5e04 100644
--- a/epan/dissectors/packet-3com-njack.c
+++ b/epan/dissectors/packet-3com-njack.c
@@ -644,7 +644,7 @@ static gboolean
test_njack(tvbuff_t *tvb)
{
/* We need at least 'NJ200' + 1 Byte packet type */
- if ( (tvb_length(tvb) < 6) ||
+ if ( (tvb_captured_length(tvb) < 6) ||
(tvb_strncaseeql(tvb, 0, "NJ200", 5) != 0) ) {
return FALSE;
}
diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c
index bf3ea6c4df..81a4c1b847 100644
--- a/epan/dissectors/packet-3g-a11.c
+++ b/epan/dissectors/packet-3g-a11.c
@@ -746,7 +746,7 @@ dissect_3gpp2_service_option_profile(proto_tree *tree, tvbuff_t *tvb, packet_i
proto_tree_add_item(tree, hf_a11_serv_opt_prof_max_serv, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
- while (tvb_length_remaining(tvb,offset) > 0) {
+ while (tvb_captured_length_remaining(tvb,offset) > 0) {
sub_type_length = tvb_get_guint8(tvb,offset+1);
sub_type = tvb_get_guint8(tvb,offset);
@@ -790,7 +790,7 @@ dissect_3gpp2_radius_aut_flow_profile_ids(proto_tree *tree, tvbuff_t *tvb, pac
guint8 sub_type, sub_type_length;
guint32 value;
- while (tvb_length_remaining(tvb,offset) > 0) {
+ while (tvb_captured_length_remaining(tvb,offset) > 0) {
sub_type = tvb_get_guint8(tvb,offset);
sub_type_length = tvb_get_guint8(tvb,offset+1);
/* value is 2 octets */
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index ba132664f5..faf9f18335 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -1804,10 +1804,10 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
if (!iphc_tvb) return NULL;
/* Create the next header structure for the tunneled IPv6 header. */
- nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_length(iphc_tvb));
+ nhdr = (struct lowpan_nhdr *)wmem_alloc0(wmem_packet_scope(), sizeof(struct lowpan_nhdr) + tvb_captured_length(iphc_tvb));
nhdr->next = NULL;
nhdr->proto = IP_PROTO_IPV6;
- nhdr->length = tvb_length(iphc_tvb);
+ nhdr->length = tvb_captured_length(iphc_tvb);
nhdr->reported = tvb_reported_length(iphc_tvb);
tvb_memcpy(iphc_tvb, LOWPAN_NHDR_DATA(nhdr), 0, nhdr->length);
return nhdr;
@@ -1887,8 +1887,8 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, nhc_tree);
/* Copy the remainder, and truncate the real buffer length. */
- nhdr->length = tvb_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext);
- tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_length_remaining(tvb, offset));
+ nhdr->length = tvb_captured_length_remaining(tvb, offset) + (int)sizeof(struct ip6_ext);
+ tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct ip6_ext), offset, tvb_captured_length_remaining(tvb, offset));
/* There is nothing more we can do. */
return nhdr;
@@ -2072,7 +2072,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
/* Copy the UDP header and payload into the buffer. */
memcpy(LOWPAN_NHDR_DATA(nhdr), &udp, sizeof(struct udp_hdr));
- tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_length_remaining(tvb, offset));
+ tvb_memcpy(tvb, LOWPAN_NHDR_DATA(nhdr) + sizeof(struct udp_hdr), offset, tvb_captured_length_remaining(tvb, offset));
return nhdr;
}
/*=====================================================
@@ -2320,7 +2320,7 @@ dissect_6lowpan_frag_first(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* Add this datagram to the fragment table. */
- frag_size = tvb_length(frag_tvb);
+ frag_size = tvb_captured_length(frag_tvb);
tvb_set_reported_length(frag_tvb, frag_size);
save_fragmented = pinfo->fragmented;
pinfo->fragmented = TRUE;
diff --git a/epan/dissectors/packet-aastra-aasp.c b/epan/dissectors/packet-aastra-aasp.c
index 564f500d16..b4528781fb 100644
--- a/epan/dissectors/packet-aastra-aasp.c
+++ b/epan/dissectors/packet-aastra-aasp.c
@@ -157,17 +157,17 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
{
default:
{
- if(tvb_length(tvb) > 1)
+ if(tvb_captured_length(tvb) > 1)
proto_tree_add_item(subtree, hf_a_data, tvb, 1, -1, ENC_NA);
break;
}
case CONTEXT_INFO:
{
- for(i = 1; i<tvb_length(tvb); )
+ for(i = 1; i<tvb_captured_length(tvb); )
{
switch(tvb_get_guint8(tvb, i))
{
- default: i = tvb_length(tvb); continue;
+ default: i = tvb_captured_length(tvb); continue;
case 1:
case 3:
@@ -209,7 +209,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
}
case SET_TEXT:
{
- if(tvb_length(tvb) > 3)
+ if(tvb_captured_length(tvb) > 3)
{
proto_tree_add_item(subtree, hf_a_data, tvb, 1, 3, ENC_NA);
proto_tree_add_item(subtree, hf_a_length, tvb, 4, 1, ENC_NA);
@@ -231,7 +231,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
{
proto_tree *infotree;
- for(i=1; i<tvb_length(tvb); )
+ for(i=1; i<tvb_captured_length(tvb); )
{
switch(tvb_get_guint8(tvb, i))
{
@@ -347,7 +347,7 @@ dissect_a_binary_command(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree
}
case DO_COMMAND:
{
- if(tvb_length(tvb) > 1)
+ if(tvb_captured_length(tvb) > 1)
{
proto_tree_add_item(subtree, hf_a_line, tvb, 1, 1, ENC_NA);
proto_tree_add_item(subtree, hf_a_length, tvb, 2, 1, ENC_NA);
@@ -387,7 +387,7 @@ dissect_aasp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
proto_item *ti; proto_tree *aasp_tree; guint n;
/* Check that there's enough data */
- n = tvb_length(tvb);
+ n = tvb_captured_length(tvb);
if(n < 3) return 0;
col_clear(pinfo->cinfo, COL_INFO);
diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c
index dae082ce49..7b087e2142 100644
--- a/epan/dissectors/packet-acn.c
+++ b/epan/dissectors/packet-acn.c
@@ -456,7 +456,7 @@ is_acn(tvbuff_t *tvb)
{
static const char acn_packet_id[] = "ASC-E1.17\0\0\0"; /* must be 12 bytes */
- if (tvb_length(tvb) < (4+sizeof(acn_packet_id)))
+ if (tvb_captured_length(tvb) < (4+sizeof(acn_packet_id)))
return FALSE;
/* Check the bytes in octets 4 - 16 */
@@ -2760,7 +2760,7 @@ dissect_acn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (data_offset == old_offset) break;
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/******************************************************************************/
diff --git a/epan/dissectors/packet-acr122.c b/epan/dissectors/packet-acr122.c
index 47bdb72eb7..16c649c6e7 100644
--- a/epan/dissectors/packet-acr122.c
+++ b/epan/dissectors/packet-acr122.c
@@ -503,37 +503,37 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
- sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_length_remaining(tvb, offset), command);
+ sub_item = proto_tree_add_uint(main_tree, hf_response, tvb, offset, tvb_captured_length_remaining(tvb, offset), command);
PROTO_ITEM_SET_GENERATED(sub_item);
col_add_fstr(pinfo->cinfo, COL_INFO, "Response: %s", val_to_str_ext_const(command, &command_vals_ext, "Unknown"));
if (command != CMD_UNKNOWN) {
- sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_length_remaining(tvb, offset), command_frame_number);
+ sub_item = proto_tree_add_uint(main_tree, hf_response_for, tvb, offset, tvb_captured_length_remaining(tvb, offset), command_frame_number);
PROTO_ITEM_SET_GENERATED(sub_item);
}
switch (command) {
case CMD_GET_FIRMWARE_VERSION:
proto_tree_add_item(main_tree, hf_firmware_version, tvb, offset, -1, ENC_NA | ENC_ASCII);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case CMD_DIRECT_TRANSMIT:
use_status_word = TRUE;
- if (tvb_length_remaining(tvb, offset) > 2) {
- next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 2);
+ if (tvb_captured_length_remaining(tvb, offset) > 2) {
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2);
call_dissector_with_data(pn532_handle, next_tvb, pinfo, tree, usb_conv_info);
- offset += tvb_length_remaining(tvb, offset) - 2;
+ offset += tvb_captured_length_remaining(tvb, offset) - 2;
}
break;
case CMD_READ_BINARY_BLOCKS:
use_status_word = TRUE;
- proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
- offset += tvb_length_remaining(tvb, offset) - 2;
+ proto_tree_add_item(main_tree, hf_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_READ_VALUE_BLOCK:
@@ -543,14 +543,14 @@ dissect_acr122(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case CMD_GET_DATA_UID:
use_status_word = TRUE;
- proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
- offset += tvb_length_remaining(tvb, offset) - 2;
+ proto_tree_add_item(main_tree, hf_uid, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_GET_DATA_ATS:
use_status_word = TRUE;
- proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_length_remaining(tvb, offset) - 2, ENC_NA);
- offset += tvb_length_remaining(tvb, offset) - 2;
+ proto_tree_add_item(main_tree, hf_ats, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, ENC_NA);
+ offset += tvb_captured_length_remaining(tvb, offset) - 2;
break;
case CMD_BI_COLOR_AND_BUZZER_LED_CONTROL:
diff --git a/epan/dissectors/packet-acse.c b/epan/dissectors/packet-acse.c
index d2c0f9f059..b7a7643542 100644
--- a/epan/dissectors/packet-acse.c
+++ b/epan/dissectors/packet-acse.c
@@ -1785,7 +1785,7 @@ dissect_acse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
top_tree = NULL;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_acse ----------------------------------------------*/
diff --git a/epan/dissectors/packet-actrace.c b/epan/dissectors/packet-actrace.c
index ecfb860bda..4740b3bd89 100644
--- a/epan/dissectors/packet-actrace.c
+++ b/epan/dissectors/packet-actrace.c
@@ -486,7 +486,7 @@ static int dissect_actrace(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_actrace_isdn(tvb, pinfo, tree, actrace_tree);
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
return 0;
diff --git a/epan/dissectors/packet-adb_cs.c b/epan/dissectors/packet-adb_cs.c
index 2ab768da35..ac05e7788d 100644
--- a/epan/dissectors/packet-adb_cs.c
+++ b/epan/dissectors/packet-adb_cs.c
@@ -216,7 +216,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* heuristic to recognize type of (partial) packet */
- if (tvb_length_remaining(tvb, offset) >= 4) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 4) {
guint8 hex_ascii_length[5];
hex_ascii_length[4] = 0;
@@ -237,10 +237,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (g_str_has_prefix(service, "shell:")) {
proto_tree_add_item(main_tree, hf_stdin, tvb, offset, -1, ENC_NA | ENC_ASCII);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
return offset;
@@ -274,7 +274,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
wmem_tree_insert32_array(client_requests, key, client_request);
}
- if (!pinfo->fd->flags.visited && (length == -1 || (client_request && client_request->service_in == -1 && tvb_length_remaining(tvb, offset) > 0))) { /* save Service to client_requests */
+ if (!pinfo->fd->flags.visited && (length == -1 || (client_request && client_request->service_in == -1 && tvb_captured_length_remaining(tvb, offset) > 0))) { /* save Service to client_requests */
if (!client_request) {
if (pinfo->phdr->presence_flags & WTAP_HAS_INTERFACE_ID)
wireshark_interface_id = pinfo->phdr->interface_id;
@@ -300,19 +300,19 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
}
- if (!client_request_service && tvb_length_remaining(tvb, offset) > 0) {
+ if (!client_request_service && tvb_captured_length_remaining(tvb, offset) > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, " Unknown service");
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
- } else if (tvb_length_remaining(tvb, offset) > 0) {
+ offset = tvb_captured_length(tvb);
+ } else if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(main_tree, hf_service, tvb, offset, -1, ENC_NA | ENC_ASCII);
- service = (guint8 *) wmem_alloc(wmem_packet_scope(), tvb_length_remaining(tvb, offset) + 1);
- tvb_memcpy(tvb, service, offset, tvb_length_remaining(tvb, offset));
- service[tvb_length_remaining(tvb, offset)] = '\0';
+ service = (guint8 *) wmem_alloc(wmem_packet_scope(), tvb_captured_length_remaining(tvb, offset) + 1);
+ tvb_memcpy(tvb, service, offset, tvb_captured_length_remaining(tvb, offset));
+ service[tvb_captured_length_remaining(tvb, offset)] = '\0';
col_append_fstr(pinfo->cinfo, COL_INFO, " Service=<%s>", service);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
} else if (pinfo->srcport == server_port) { /* Server sent to Client */
@@ -358,7 +358,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (!service) {
col_append_fstr(pinfo->cinfo, COL_INFO, " Unknown service");
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
return offset;
}
@@ -387,7 +387,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_append_fstr(pinfo->cinfo, COL_INFO, " Service=<%s>", service);
- if (tvb_length_remaining(tvb, offset) <= 0) return offset;
+ if (tvb_captured_length_remaining(tvb, offset) <= 0) return offset;
if (!pinfo->fd->flags.visited && client_request && client_request->data_in == -1) {
client_request->data_in = pinfo->fd->num;
@@ -396,12 +396,12 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
if (status == STATUS_FAIL) {
sub_item = proto_tree_add_item(main_tree, hf_fail_reason, tvb, offset, -1, ENC_NA | ENC_ASCII);
- if (length < tvb_length_remaining(tvb, offset)) {
+ if (length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
- col_append_fstr(pinfo->cinfo, COL_INFO, " Fail=<%s>", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII));
- offset = tvb_length(tvb);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " Fail=<%s>", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII));
+ offset = tvb_captured_length(tvb);
return offset;
}
@@ -430,7 +430,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
sub_item = proto_tree_add_item(main_tree, hf_devices, tvb, offset, -1, ENC_NA | ENC_ASCII);
- if (data_length < tvb_length_remaining(tvb, offset)) {
+ if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
} else if (g_strcmp0(service, "host:get-state") == 0 ||
@@ -443,7 +443,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
sub_item = proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII);
- if (data_length < tvb_length_remaining(tvb, offset)) {
+ if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
} else if (g_str_has_prefix(service, "framebuffer:")) {
@@ -509,7 +509,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset += 4;
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item *pixel_item;
proto_tree *pixel_tree;
@@ -524,8 +524,8 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
client_request->data.framebuffer_data->red_offset == 11 &&
client_request->data.framebuffer_data->green_offset == 5 &&
client_request->data.framebuffer_data->blue_offset == 0) {
- while (tvb_length_remaining(tvb, offset) > 0) {
- if (tvb_length_remaining(tvb, offset) < 2) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) < 2) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset, -1, ENC_NA);
offset += 1;
}
@@ -544,10 +544,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
client_request->data.framebuffer_data->blue_length == 8 &&
(client_request->data.framebuffer_data->alpha_length == 0 ||
client_request->data.framebuffer_data->alpha_length == 8)) {
- while (tvb_length_remaining(tvb, offset) > 0) {
- if (tvb_length_remaining(tvb, offset) < 3 || (tvb_length_remaining(tvb, offset) < 4 && client_request->data.framebuffer_data->alpha_offset > 0)) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) < 3 || (tvb_captured_length_remaining(tvb, offset) < 4 && client_request->data.framebuffer_data->alpha_offset > 0)) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
break;
}
@@ -569,10 +569,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset += 3;
}
} else {
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
} else {
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
}
} else if (g_strcmp0(service, "track-jdwp") == 0) {
@@ -580,13 +580,13 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_ascii_data_length(main_tree, tvb, offset, &data_length);
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
sub_item = proto_tree_add_item(main_tree, hf_pids, tvb, offset, -1, ENC_NA | ENC_ASCII);
- if (data_length < tvb_length_remaining(tvb, offset)) {
+ if (data_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, sub_item, &ei_incomplete_message);
}
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else if ((g_strcmp0(service, "shell:export ANDROID_LOG_TAGS=\"\" ; exec logcat -B") == 0) ||
(g_strcmp0(service, "shell:logcat -B") == 0)) {
tvbuff_t *next_tvb;
@@ -627,7 +627,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
}
- size += tvb_length_remaining(tvb, i_offset);
+ size += tvb_captured_length_remaining(tvb, i_offset);
if (size > 0) {
buffer = (guint8 *) wmem_alloc(pinfo->pool, size);
if (fragment && i_char > 0)
@@ -642,12 +642,12 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
i_offset += 1;
old_offset = i_offset;
- while (tvb_length_remaining(tvb, i_offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, i_offset) > 0) {
c2 = tvb_get_guint8(tvb, i_offset);
if (c1 == '\r' && c2 == '\n') {
buffer[i_char] = c2;
- if (tvb_length_remaining(tvb, i_offset) > 1) {
+ if (tvb_captured_length_remaining(tvb, i_offset) > 1) {
c1 = tvb_get_guint8(tvb, i_offset + 1);
i_offset += 2;
i_char += 1;
@@ -664,10 +664,10 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
i_offset += 1;
}
- if (tvb_length_remaining(tvb, old_offset) == 0) {
+ if (tvb_captured_length_remaining(tvb, old_offset) == 0) {
buffer[i_char] = c1;
i_char += 1;
- } else if (tvb_length_remaining(tvb, old_offset) > 0) {
+ } else if (tvb_captured_length_remaining(tvb, old_offset) > 0) {
buffer[i_char] = c2;
i_char += 1;
}
@@ -676,8 +676,8 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
add_new_data_source(pinfo, next_tvb, "Logcat");
i_offset = 0;
- while (tvb_length_remaining(next_tvb, i_offset) > 0) {
- if (tvb_length_remaining(next_tvb, i_offset) >= 4) {
+ while (tvb_captured_length_remaining(next_tvb, i_offset) > 0) {
+ if (tvb_captured_length_remaining(next_tvb, i_offset) >= 4) {
payload_length = tvb_get_letohs(next_tvb, i_offset);
try_header_size = tvb_get_letohs(next_tvb, i_offset + 2);
@@ -687,7 +687,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
logcat_length = payload_length + 24;
}
- if (tvb_length_remaining(next_tvb, i_offset) >= 4 && tvb_length_remaining(next_tvb, i_offset) >= logcat_length) {
+ if (tvb_captured_length_remaining(next_tvb, i_offset) >= 4 && tvb_captured_length_remaining(next_tvb, i_offset) >= logcat_length) {
new_tvb = tvb_new_subset_length(next_tvb, i_offset, logcat_length);
call_dissector(logcat_handle, new_tvb, pinfo, main_tree);
@@ -711,7 +711,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
fragment = wmem_new(wmem_file_scope(), fragment_t);
- fragment->length = tvb_length_remaining(next_tvb, i_offset);
+ fragment->length = tvb_captured_length_remaining(next_tvb, i_offset);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
tvb_memcpy(next_tvb, fragment->data, i_offset, fragment->length);
fragment->reassembled_in_frame = -1;
@@ -720,33 +720,33 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
proto_tree_add_item(main_tree, hf_fragment, next_tvb, i_offset, -1, ENC_NA);
- i_offset = tvb_length(next_tvb);
+ i_offset = tvb_captured_length(next_tvb);
}
}
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "shell:")) {
proto_tree_add_item(main_tree, hf_stdout, tvb, offset, -1, ENC_NA | ENC_ASCII);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "jdwp:")) {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else if (g_str_has_prefix(service, "sync:")) {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
} else if (g_strcmp0(service, "host:list-forward") == 0 ||
g_str_has_prefix(service, "root:") ||
g_str_has_prefix(service, "remount:") ||
g_str_has_prefix(service, "tcpip:") ||
g_str_has_prefix(service, "usb:")) {
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(main_tree, hf_result, tvb, offset, -1, ENC_NA | ENC_ASCII);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
} else {
proto_tree_add_item(main_tree, hf_data, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
} else {
@@ -759,7 +759,7 @@ dissect_adb_cs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, main_tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c
index ebe46b3174..1a2e141291 100644
--- a/epan/dissectors/packet-adwin-config.c
+++ b/epan/dissectors/packet-adwin-config.c
@@ -363,10 +363,10 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
offset += 4;
proto_tree_add_item(adwin_tree, hf_adwin_config_unused, tvb, offset, 128, ENC_NA);
offset += 128;
- length = tvb_length(tvb) - offset;
+ length = tvb_captured_length(tvb) - offset;
proto_tree_add_item(adwin_tree, hf_adwin_config_data, tvb, offset, length, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* 00:50:c2:0a:2*:** */
diff --git a/epan/dissectors/packet-adwin.c b/epan/dissectors/packet-adwin.c
index 194d8eb44b..7bb06b3429 100644
--- a/epan/dissectors/packet-adwin.c
+++ b/epan/dissectors/packet-adwin.c
@@ -439,7 +439,7 @@ static const value_string packet_type_mapping[] = {
static value_string_ext packet_type_mapping_ext = VALUE_STRING_EXT_INIT(packet_type_mapping);
#define SET_PACKET_TYPE(tree, type) \
- proto_tree_add_int(tree, hf_adwin_packet_type, tvb, 0, tvb_length(tvb), type);
+ proto_tree_add_int(tree, hf_adwin_packet_type, tvb, 0, tvb_captured_length(tvb), type);
/* Initialize the protocol and registered fields */
diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c
index 3bb4202062..e1b876e149 100644
--- a/epan/dissectors/packet-afp.c
+++ b/epan/dissectors/packet-afp.c
@@ -5247,7 +5247,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!request_val) { /* missing request */
col_set_str(pinfo->cinfo, COL_INFO, "[Reply without query?]");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
afp_command = request_val->command;
@@ -5278,7 +5278,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_set_str(pinfo->cinfo, COL_INFO,
"[Error!IP port reused, you need to split the capture file]");
expert_add_info(pinfo, ti, &ei_afp_ip_port_reused);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -5520,7 +5520,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (!len) {
/* for some calls if the reply is an error there's no data
*/
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
switch (afp_command) {
@@ -5621,7 +5621,7 @@ dissect_afp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
pinfo, afp_tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void afp_reinit( void)
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c
index 0d332db4d7..b9aba67e96 100644
--- a/epan/dissectors/packet-afs.c
+++ b/epan/dissectors/packet-afs.c
@@ -916,7 +916,7 @@ static const fragment_items afs_frag_items = {
} else { \
if ( ! seen_null ) { \
proto_tree_add_text(tree, tvb, offset, \
- tvb_length_remaining(tvb, offset), \
+ tvb_captured_length_remaining(tvb, offset), \
"Null Interface Addresses"); \
seen_null = 1; \
} \
@@ -971,7 +971,7 @@ static const fragment_items afs_frag_items = {
offset += bytes;
/* Raw data - to end of frame */
-#define OUT_BYTES_ALL(field) OUT_BYTES(field, tvb_length_remaining(tvb,offset))
+#define OUT_BYTES_ALL(field) OUT_BYTES(field, tvb_captured_length_remaining(tvb,offset))
/* Raw data */
#define OUT_BYTES(field, bytes) \
@@ -1025,7 +1025,7 @@ static const fragment_items afs_frag_items = {
OUT_RXString(hf_afs_kauth_realm); \
}
-#define GETSTR (tvb_format_text(tvb,offset,tvb_length_remaining(tvb,offset)))
+#define GETSTR (tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb,offset)))
#define VALID_OPCODE(opcode) ((opcode >= OPCODE_LOW && opcode <= OPCODE_HIGH) || \
(opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \
@@ -1828,7 +1828,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
frag_msg = fragment_add_seq_check(&afs_reassembly_table,
tvb, offset, pinfo, afs_seqid, NULL,
- rxinfo->seq-1, tvb_length_remaining(tvb, offset),
+ rxinfo->seq-1, tvb_captured_length_remaining(tvb, offset),
! ( rxinfo->flags & RX_LAST_PACKET ) );
new_tvb = process_reassembled_data( tvb, offset, pinfo, "Reassembled RX", frag_msg,
@@ -1840,7 +1840,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_append_str(pinfo->cinfo, COL_INFO, " [AFS reassembled]");
} else {
col_set_str(pinfo->cinfo, COL_INFO, "[AFS segment of a reassembled PDU]");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -1917,7 +1917,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c
index 79cfcddf39..9d0b763885 100644
--- a/epan/dissectors/packet-agentx.c
+++ b/epan/dissectors/packet-agentx.c
@@ -954,7 +954,7 @@ dissect_agentx_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -962,7 +962,7 @@ dissect_agentx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 20, get_agentx_pdu_len,
dissect_agentx_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static const true_false_string tfs_agentx_include = { "Yes", "No" };
diff --git a/epan/dissectors/packet-aim-buddylist.c b/epan/dissectors/packet-aim-buddylist.c
index 27de2a2b48..7a0f366fa5 100644
--- a/epan/dissectors/packet-aim-buddylist.c
+++ b/epan/dissectors/packet-aim-buddylist.c
@@ -58,7 +58,7 @@ static gint ett_aim_buddylist = -1;
static int dissect_aim_buddylist_buddylist(tvbuff_t *tvb, packet_info *pinfo, proto_tree *buddy_tree)
{
int offset = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_buddyname( tvb, pinfo, offset, buddy_tree);
}
return offset;
diff --git a/epan/dissectors/packet-aim-chat.c b/epan/dissectors/packet-aim-chat.c
index a0ff6e592f..0c648bfa50 100644
--- a/epan/dissectors/packet-aim-chat.c
+++ b/epan/dissectors/packet-aim-chat.c
@@ -73,7 +73,7 @@ static gint ett_aim_chat = -1;
static int dissect_aim_chat_userinfo_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *chat_tree)
{
int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_userinfo(tvb, pinfo, offset, chat_tree);
}
return offset;
@@ -89,12 +89,12 @@ static int dissect_aim_chat_outgoing_msg(tvbuff_t *tvb, packet_info *pinfo, prot
buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 );
/* channel message from client */
- aim_get_message( msg, tvb, 40 + buddyname_length, tvb_length(tvb)
+ aim_get_message( msg, tvb, 40 + buddyname_length, tvb_captured_length(tvb)
- 40 - buddyname_length );
col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -108,7 +108,7 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot
msg=(guchar *)wmem_alloc(wmem_packet_scope(), 1000);
buddyname_length = aim_get_buddyname( &buddyname, tvb, 30 );
- aim_get_message( msg, tvb, 36 + buddyname_length, tvb_length(tvb)
+ aim_get_message( msg, tvb, 36 + buddyname_length, tvb_captured_length(tvb)
- 36 - buddyname_length );
col_append_fstr(pinfo->cinfo, COL_INFO, "from: %s", buddyname);
@@ -119,7 +119,7 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot
"Screen Name: %s",
format_text(buddyname, buddyname_length));
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static const aim_subtype aim_fnac_family_chat[] = {
diff --git a/epan/dissectors/packet-aim-directory.c b/epan/dissectors/packet-aim-directory.c
index 84433c61f0..bdc991ae43 100644
--- a/epan/dissectors/packet-aim-directory.c
+++ b/epan/dissectors/packet-aim-directory.c
@@ -41,7 +41,7 @@ static int ett_aim_directory = -1;
static int dissect_aim_directory_user_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;
diff --git a/epan/dissectors/packet-aim-generic.c b/epan/dissectors/packet-aim-generic.c
index 95c9f8e903..69eeb673ce 100644
--- a/epan/dissectors/packet-aim-generic.c
+++ b/epan/dissectors/packet-aim-generic.c
@@ -217,10 +217,10 @@ static int dissect_generic_rateinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto
static int dissect_aim_generic_clientready(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- proto_item *ti = proto_tree_add_text(gen_tree, tvb, 0, tvb_length(tvb), "Supported services");
+ proto_item *ti = proto_tree_add_text(gen_tree, tvb, 0, tvb_captured_length(tvb), "Supported services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
@@ -240,10 +240,10 @@ static int dissect_aim_generic_clientready(tvbuff_t *tvb, packet_info *pinfo _U_
static int dissect_aim_generic_serverready(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Supported services");
+ proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Supported services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 2, "%s (0x%x)", family?family->name:"Unknown Family", famnum);
@@ -271,10 +271,10 @@ static int dissect_aim_generic_redirect(tvbuff_t *tvb, packet_info *pinfo, proto
static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Requested services");
+ proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Requested services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2));
@@ -286,10 +286,10 @@ static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U
static int dissect_aim_generic_capack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_length(tvb), "Accepted requested services");
+ proto_item *ti = proto_tree_add_text(gen_tree, tvb, offset, tvb_captured_length(tvb), "Accepted requested services");
proto_tree *entry = proto_item_add_subtree(ti, ett_generic_clientready);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2));
@@ -310,7 +310,7 @@ static int dissect_aim_generic_motd(tvbuff_t *tvb, packet_info *pinfo, proto_tre
static int dissect_aim_generic_rateinfoack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_uint(gen_tree, hf_generic_rateinfoack_group, tvb, offset, 2, tvb_get_ntohs(tvb, offset));
offset+=2;
}
@@ -330,7 +330,7 @@ static int dissect_aim_generic_ratechange(tvbuff_t *tvb, packet_info *pinfo, pro
static int dissect_aim_generic_clientpauseack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *gen_tree)
{
int offset = 0;
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
guint16 famnum = tvb_get_ntohs(tvb, offset);
const aim_family *family = aim_get_family(famnum);
proto_tree_add_text(gen_tree, tvb, offset, 4, "Family: %s (0x%x)", family?family->name:"Unknown Family", famnum);
@@ -384,7 +384,7 @@ static int dissect_aim_generic_evil(tvbuff_t *tvb, packet_info *pinfo, proto_tre
{
int offset = 0;
proto_tree_add_item(gen_tree, hf_generic_evil_new_warn_level, tvb, offset, 2, ENC_BIG_ENDIAN);
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_userinfo(tvb, pinfo, offset, gen_tree);
}
return offset;
diff --git a/epan/dissectors/packet-aim-location.c b/epan/dissectors/packet-aim-location.c
index 41d925f0ed..fe38f519c2 100644
--- a/epan/dissectors/packet-aim-location.c
+++ b/epan/dissectors/packet-aim-location.c
@@ -104,7 +104,7 @@ static int dissect_aim_location_setuserinfo(tvbuff_t *tvb, packet_info *pinfo, p
static int dissect_aim_location_watcher_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *loc_tree)
{
int offset = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_buddyname(tvb, pinfo, offset, loc_tree);
}
return offset;
diff --git a/epan/dissectors/packet-aim-messaging.c b/epan/dissectors/packet-aim-messaging.c
index ed7d917086..68ebfab9e1 100644
--- a/epan/dissectors/packet-aim-messaging.c
+++ b/epan/dissectors/packet-aim-messaging.c
@@ -507,7 +507,7 @@ dissect_aim_rendezvous_extended_message(tvbuff_t *tvb, proto_tree *msg_tree)
text = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, text_length, ENC_ASCII|ENC_NA);
proto_tree_add_text(msg_tree, tvb, offset, text_length, "Text: %s", text); /* offset+=text_length; */
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
return offset;
}
@@ -571,7 +571,7 @@ dissect_aim_tlv_value_extended_data(proto_item *ti, guint16 valueid _U_, tvbuff_
/* plugin-specific data follows */
proto_tree_add_text(entry, tvb, offset, -1, "Plugin-specific data");
}
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
return offset;
}
@@ -604,7 +604,7 @@ dissect_aim_msg_client_err(tvbuff_t *tvb, packet_info *pinfo, proto_tree *msg_tr
reason = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(msg_tree, hf_aim_icbm_client_err_reason, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2;
- if (reason == CLIENT_ERR__REASON_CHANNEL_SPECIFIC && tvb_length_remaining(tvb, offset) > 0)
+ if (reason == CLIENT_ERR__REASON_CHANNEL_SPECIFIC && tvb_captured_length_remaining(tvb, offset) > 0)
{
switch (channel)
{
diff --git a/epan/dissectors/packet-aim-signon.c b/epan/dissectors/packet-aim-signon.c
index 8144d1130d..60dc9f903a 100644
--- a/epan/dissectors/packet-aim-signon.c
+++ b/epan/dissectors/packet-aim-signon.c
@@ -51,7 +51,7 @@ static int dissect_aim_snac_signon_logon(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree)
{
int offset = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;
@@ -62,7 +62,7 @@ static int dissect_aim_snac_signon_logon_reply(tvbuff_t *tvb,
proto_tree *tree)
{
int offset = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_aim_tlv(tvb, pinfo, offset, tree, aim_client_tlvs);
}
return offset;
diff --git a/epan/dissectors/packet-aim-ssi.c b/epan/dissectors/packet-aim-ssi.c
index d340569ce1..4e457b4977 100644
--- a/epan/dissectors/packet-aim-ssi.c
+++ b/epan/dissectors/packet-aim-ssi.c
@@ -157,7 +157,7 @@ static int dissect_ssi_ssi_items(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
gint ssi_entry_size;
proto_item *ti;
proto_tree *ssi_entry = NULL;
- int size = tvb_length(tvb);
+ int size = tvb_captured_length(tvb);
while (size > offset)
{
ssi_entry_size = calc_ssi_entry_size(tvb, offset);
diff --git a/epan/dissectors/packet-aim-userlookup.c b/epan/dissectors/packet-aim-userlookup.c
index 3b72c2d2c8..6ad505b64a 100644
--- a/epan/dissectors/packet-aim-userlookup.c
+++ b/epan/dissectors/packet-aim-userlookup.c
@@ -44,8 +44,8 @@ static gint ett_aim_userlookup = -1;
static int dissect_aim_userlookup_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *lookup_tree)
{
- proto_tree_add_item(lookup_tree, hf_aim_userlookup_email, tvb, 0, tvb_length(tvb), ENC_UTF_8|ENC_NA);
- return tvb_length(tvb);
+ proto_tree_add_item(lookup_tree, hf_aim_userlookup_email, tvb, 0, tvb_captured_length(tvb), ENC_UTF_8|ENC_NA);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c
index f3616b2f5c..120599b67e 100644
--- a/epan/dissectors/packet-aim.c
+++ b/epan/dissectors/packet-aim.c
@@ -1048,7 +1048,7 @@ dissect_aim_tlv_value_client_capabilities(proto_item *ti _U_, guint16 valueid _U
offset = dissect_aim_capability(entry, tvb, offset);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1065,14 +1065,14 @@ dissect_aim_tlv_value_client_short_capabilities(proto_item *ti _U_, guint16 valu
offset = dissect_aim_short_capability(entry, tvb, offset);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
int
dissect_aim_tlv_value_time(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_)
{
/* FIXME */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
int
@@ -1117,7 +1117,7 @@ static int
dissect_aim_tlv_value_userstatus(proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_)
{
/* FIXME */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1148,7 +1148,7 @@ dissect_aim_tlv_value_string (proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb
guint8 *buf;
gint string_len;
- string_len = tvb_length(tvb);
+ string_len = tvb_captured_length(tvb);
buf = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, string_len, ENC_UTF_8|ENC_NA);
proto_item_set_text(ti, "Value: %s", format_text(buf, string_len));
@@ -1178,7 +1178,7 @@ dissect_aim_tlv_value_string08_array (proto_item *ti, guint16 valueid _U_, tvbuf
int
dissect_aim_tlv_value_bytes (proto_item *ti _U_, guint16 valueid _U_, tvbuff_t *tvb _U_, packet_info *pinfo _U_)
{
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
int
@@ -1461,7 +1461,7 @@ dissect_aim_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the packets */
@@ -1471,7 +1471,7 @@ dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* check, if this is really an AIM packet, they start with 0x2a */
/* XXX - I've seen some stuff starting with 0x5a followed by 0x2a */
- if(tvb_length(tvb) >= 1 && tvb_get_guint8(tvb, 0) != 0x2a)
+ if(tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb, 0) != 0x2a)
{
/* Not an instant messenger packet, just happened to use the
* same port
@@ -1484,7 +1484,7 @@ dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
tcp_dissect_pdus(tvb, pinfo, tree, aim_desegment, 6, get_aim_pdu_len,
dissect_aim_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-ajp13.c b/epan/dissectors/packet-ajp13.c
index f9bcb1adc5..37a08d3e43 100644
--- a/epan/dissectors/packet-ajp13.c
+++ b/epan/dissectors/packet-ajp13.c
@@ -828,7 +828,7 @@ dissect_ajp13_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -862,7 +862,7 @@ dissect_ajp13(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
get_ajp13_pdu_len, /* use first 4, calc data len */
dissect_ajp13_tcp_pdu, data); /* the naive dissector */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-alcap.c b/epan/dissectors/packet-alcap.c
index 3fc44d7fe6..461c3963bc 100644
--- a/epan/dissectors/packet-alcap.c
+++ b/epan/dissectors/packet-alcap.c
@@ -1349,7 +1349,7 @@ extern void alcap_tree_from_bearer_key(proto_tree* tree, tvbuff_t* tvb, packet_i
static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
proto_tree *alcap_tree = NULL;
alcap_message_info_t* msg_info = wmem_new0(wmem_packet_scope(), alcap_message_info_t);
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
int offset;
proto_item* pi;
proto_tree* compat_tree;
diff --git a/epan/dissectors/packet-amqp.c b/epan/dissectors/packet-amqp.c
index 6e4c0acb96..f2f31b10d1 100644
--- a/epan/dissectors/packet-amqp.c
+++ b/epan/dissectors/packet-amqp.c
@@ -7178,7 +7178,7 @@ dissect_amqp_1_0_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
col_append_str(pinfo->cinfo, COL_INFO, method_name);
col_append_str(pinfo->cinfo, COL_INFO, " ");
col_set_fence(pinfo->cinfo, COL_INFO);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -7325,7 +7325,7 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %d", frame_type);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Dissection routine for AMQP 0-9 frames */
@@ -7969,7 +7969,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
expert_add_info_format(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %u", frame_type);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Dissection routine for method Connection.Start */
diff --git a/epan/dissectors/packet-amr.c b/epan/dissectors/packet-amr.c
index b1fd09140a..d998165e84 100644
--- a/epan/dissectors/packet-amr.c
+++ b/epan/dissectors/packet-amr.c
@@ -615,7 +615,7 @@ dissect_amr_name(tvbuff_t *tvb _U_, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ancp.c b/epan/dissectors/packet-ancp.c
index 7036c31ff1..fbd98fe965 100644
--- a/epan/dissectors/packet-ancp.c
+++ b/epan/dissectors/packet-ancp.c
@@ -634,7 +634,7 @@ dissect_ancp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
tap_queue_packet(ancp_tap, pinfo, ancp_info);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -649,7 +649,7 @@ dissect_ancp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, ANCP_MIN_HDR,
get_ancp_msg_len, dissect_ancp_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ansi_637.c b/epan/dissectors/packet-ansi_637.c
index d627527e72..f869c83430 100644
--- a/epan/dissectors/packet-ansi_637.c
+++ b/epan/dissectors/packet-ansi_637.c
@@ -2274,7 +2274,7 @@ dissect_ansi_637_tele_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ans
guint32 curr_offset;
curr_offset = 0;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
while ((len - curr_offset) > 0)
{
@@ -2530,7 +2530,7 @@ dissect_ansi_637_trans(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
curr_offset = 1;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
while ((len - curr_offset) > 0)
{
diff --git a/epan/dissectors/packet-ansi_683.c b/epan/dissectors/packet-ansi_683.c
index 2a71b3e1e6..d9b26a45a9 100644
--- a/epan/dissectors/packet-ansi_683.c
+++ b/epan/dissectors/packet-ansi_683.c
@@ -4691,7 +4691,7 @@ dissect_ansi_683_for_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
if (ansi_683_for_msg_fcn[idx] != NULL)
{
- (*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
+ (*ansi_683_for_msg_fcn[idx])(tvb, ansi_683_tree, tvb_captured_length(tvb) - 1, 1);
}
}
@@ -4719,7 +4719,7 @@ dissect_ansi_683_rev_message(tvbuff_t *tvb, proto_tree *ansi_683_tree)
proto_tree_add_uint(ansi_683_tree, hf_ansi_683_rev_msg_type,
tvb, 0, 1, msg_type);
- (*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_length(tvb) - 1, 1);
+ (*ansi_683_rev_msg_fcn[idx])(tvb, ansi_683_tree, tvb_captured_length(tvb) - 1, 1);
}
static void
diff --git a/epan/dissectors/packet-ansi_801.c b/epan/dissectors/packet-ansi_801.c
index 0ae262af57..d7352d6149 100644
--- a/epan/dissectors/packet-ansi_801.c
+++ b/epan/dissectors/packet-ansi_801.c
@@ -1405,14 +1405,14 @@ dissect_ansi_801_for_message(tvbuff_t *tvb, proto_tree *tree)
}
offset++;
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
while ((num_req > 0) &&
(rem_len >= 2))
{
for_request(tvb, tree, &offset, pd_msg_type);
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
num_req--;
}
@@ -1428,7 +1428,7 @@ dissect_ansi_801_for_message(tvbuff_t *tvb, proto_tree *tree)
{
for_response(tvb, tree, &offset);
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
num_rsp--;
}
@@ -1529,14 +1529,14 @@ dissect_ansi_801_rev_message(tvbuff_t *tvb, proto_tree *tree)
offset++;
}
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
while ((num_req > 0) &&
(rem_len >= 2))
{
rev_request(tvb, tree, &offset, pd_msg_type);
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
num_req--;
}
@@ -1552,7 +1552,7 @@ dissect_ansi_801_rev_message(tvbuff_t *tvb, proto_tree *tree)
{
rev_response(tvb, tree, &offset);
- rem_len = tvb_length_remaining(tvb, offset);
+ rem_len = tvb_captured_length_remaining(tvb, offset);
num_rsp--;
}
diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c
index 634ec666d8..d0763ff532 100644
--- a/epan/dissectors/packet-ansi_a.c
+++ b/epan/dissectors/packet-ansi_a.c
@@ -7486,7 +7486,7 @@ elem_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gu
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@@ -7552,7 +7552,7 @@ elem_tv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gui
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@@ -7614,7 +7614,7 @@ elem_t(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, elem_idx_t idx,
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
oct = tvb_get_guint8(tvb, curr_offset);
@@ -7651,7 +7651,7 @@ elem_lv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, gui
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
dec_idx = ansi_a_elem_1_strings[idx].dec_index;
@@ -7705,7 +7705,7 @@ elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guin
if ((int) idx < 0 || idx >= ansi_a_elem_1_max-1)
{
/* Unknown index, skip the element */
- return tvb_length_remaining(tvb, offset) ;
+ return tvb_captured_length_remaining(tvb, offset) ;
}
dec_idx = ansi_a_elem_1_strings[idx].dec_index;
@@ -10499,7 +10499,7 @@ dissect_bsmap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboole
}
tap_p = &tap_rec[tap_current];
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
offset = 0;
/*
@@ -10586,7 +10586,7 @@ dissect_dtap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolea
const gchar *str;
ansi_a_shared_data_t shared_data;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if ((len < 3) && !from_sip)
{
diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c
index 819db7ee78..e67c5b3f01 100644
--- a/epan/dissectors/packet-ansi_map.c
+++ b/epan/dissectors/packet-ansi_map.c
@@ -1431,7 +1431,7 @@ dissect_ansi_map_min_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
subtree = proto_item_add_subtree(actx->created_item, ett_mintype);
- digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), NULL, FALSE);
+ digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), NULL, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
}
@@ -1476,7 +1476,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
if(octet_len == 0)
return;
offset++;
- digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
+ digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
@@ -1488,7 +1488,7 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
return;
offset++;
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_captured_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
break;
case 3:
/* Octet string */
@@ -1514,14 +1514,14 @@ dissect_ansi_map_digits_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
switch ((octet&0xf)){
case 1:
/* BCD Coding */
- digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
+ digit_str = tvb_bcd_dig_to_wmem_packet_str(tvb, offset, tvb_captured_length_remaining(tvb,offset), &Dgt_tbcd, FALSE);
proto_tree_add_string(subtree, hf_ansi_map_bcd_digits, tvb, offset, -1, digit_str);
proto_item_append_text(actx->created_item, " - %s", digit_str);
break;
case 2:
/* IA5 Coding */
proto_tree_add_item(subtree, hf_ansi_map_ia5_digits, tvb, offset, -1, ENC_ASCII|ENC_NA);
- proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
+ proto_item_append_text(actx->created_item, " - %s", tvb_get_string_enc(wmem_packet_scope(),tvb,offset,tvb_captured_length_remaining(tvb,offset),ENC_ASCII|ENC_NA));
break;
case 3:
/* Octet string */
@@ -1951,7 +1951,7 @@ dissect_ansi_map_callingfeaturesindicator(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *subtree;
- length = tvb_length_remaining(tvb,offset);
+ length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_mscid);
@@ -2108,7 +2108,7 @@ dissect_ansi_map_cdmacallmode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
proto_tree *subtree;
- length = tvb_length_remaining(tvb,offset);
+ length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_mscid);
@@ -2162,7 +2162,7 @@ dissect_ansi_map_cdmachanneldata(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
proto_tree *subtree;
- length = tvb_length_remaining(tvb,offset);
+ length = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_cdmachanneldata);
@@ -6019,7 +6019,7 @@ dissect_ansi_map_CDMA2000HandoffInvokeIOSData(gboolean implicit_tag _U_, tvbuff_
if (parameter_tvb){
subtree = proto_item_add_subtree(actx->created_item, ett_CDMA2000HandoffInvokeIOSData);
dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree,
- 0, tvb_length_remaining(parameter_tvb,0));
+ 0, tvb_captured_length_remaining(parameter_tvb,0));
}
@@ -6628,7 +6628,7 @@ dissect_ansi_map_CDMA2000HandoffResponseIOSData(gboolean implicit_tag _U_, tvbuf
if (parameter_tvb){
subtree = proto_item_add_subtree(actx->created_item, ett_CDMA2000HandoffResponseIOSData);
dissect_cdma2000_a1_elements(parameter_tvb, actx->pinfo, subtree,
- 0, tvb_length_remaining(parameter_tvb,0));
+ 0, tvb_captured_length_remaining(parameter_tvb,0));
}
@@ -10633,7 +10633,7 @@ dissect_ansi_map_SMS_BearerData(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in
if (SMS_BearerData_tvb){
/* A zero length OCTET STRING will return a zero length tvb */
- length = tvb_length_remaining(SMS_BearerData_tvb,0);
+ length = tvb_captured_length_remaining(SMS_BearerData_tvb,0);
if (length <=0){
proto_item_append_text(actx->created_item," length %u",length);
SMS_BearerData_tvb = NULL;
@@ -10679,7 +10679,7 @@ dissect_ansi_map_SMS_TeleserviceIdentifier(gboolean implicit_tag _U_, tvbuff_t *
if (parameter_tvb){
/* A zero length OCTET STRING will return a zero length tvb */
- length = tvb_length_remaining(parameter_tvb,0);
+ length = tvb_captured_length_remaining(parameter_tvb,0);
if (length <=0){
proto_item_append_text(actx->created_item, " length %u",length);
return offset;
@@ -15480,7 +15480,7 @@ dissect_ansi_map_win_trigger_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_tree *subtree;
guint8 octet;
- end_offset = tvb_length_remaining(tvb,offset);
+ end_offset = tvb_captured_length_remaining(tvb,offset);
subtree = proto_item_add_subtree(actx->created_item, ett_win_trigger_list);
while(offset< end_offset) {
@@ -16267,7 +16267,7 @@ dissect_ansi_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void range_delete_callback(guint32 ssn)
diff --git a/epan/dissectors/packet-ansi_tcap.c b/epan/dissectors/packet-ansi_tcap.c
index 42f74903d0..d50fdbe8c3 100644
--- a/epan/dissectors/packet-ansi_tcap.c
+++ b/epan/dissectors/packet-ansi_tcap.c
@@ -614,7 +614,7 @@ guint8 len;
if(next_tvb) {
- len = tvb_length_remaining(next_tvb, 0);
+ len = tvb_captured_length_remaining(next_tvb, 0);
if(len !=0){
/* 0 octets for the Unidirectional,
* 4 octets for Query, Response & Abort
@@ -875,7 +875,7 @@ dissect_ansi_tcap_T_parameter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
#line 87 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
@@ -920,7 +920,7 @@ static int
dissect_ansi_tcap_T_parameter_01(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 100 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
@@ -964,7 +964,7 @@ static int
dissect_ansi_tcap_T_parameter_02(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 110 "../../asn1/ansi_tcap/ansi_tcap.cnf"
if(find_tcap_subdissector(tvb, actx, tree))
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
diff --git a/epan/dissectors/packet-aodv.c b/epan/dissectors/packet-aodv.c
index ad306dbf1c..b99f2fc852 100644
--- a/epan/dissectors/packet-aodv.c
+++ b/epan/dissectors/packet-aodv.c
@@ -816,7 +816,7 @@ dissect_aodv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Unknown AODV Packet Type (%u)", type);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-aol.c b/epan/dissectors/packet-aol.c
index cb8870e838..6fb9fbaf36 100644
--- a/epan/dissectors/packet-aol.c
+++ b/epan/dissectors/packet-aol.c
@@ -144,7 +144,7 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse
guint16 win_ver = 0;
/* Add the Data subtree */
- data_item = proto_tree_add_item(tree,hf_aol_init,tvb,offset,tvb_length_remaining(tvb,offset)-1,ENC_NA);
+ data_item = proto_tree_add_item(tree,hf_aol_init,tvb,offset,tvb_captured_length_remaining(tvb,offset)-1,ENC_NA);
data_tree = proto_item_add_subtree(data_item,ett_aol_data);
/* Now, parse the structure */
@@ -180,8 +180,8 @@ static guint dissect_aol_init(tvbuff_t *tvb, packet_info *pinfo _U_, guint offse
proto_tree_add_item(data_tree,hf_aol_num_colors, tvb,offset,2,ENC_LITTLE_ENDIAN); offset += 2; /* 37b */
/* WAOL 1.5 (48b), >= 2.5 (49b) */
- if (tvb_length_remaining(tvb,offset) <= 13) { /* WAOL 1.5 - 3.0 */
- if (tvb_length_remaining(tvb,offset) == 13) { /* WAOL > 1.5 */
+ if (tvb_captured_length_remaining(tvb,offset) <= 13) { /* WAOL 1.5 - 3.0 */
+ if (tvb_captured_length_remaining(tvb,offset) == 13) { /* WAOL > 1.5 */
proto_tree_add_item(data_tree,hf_aol_filler,tvb,offset,1,ENC_BIG_ENDIAN); offset += 1;
}
@@ -252,7 +252,7 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (pdu_len > 0) {
old_offset = offset;
- if (tvb_length_remaining(tvb,offset) > pdu_len) {
+ if (tvb_captured_length_remaining(tvb,offset) > pdu_len) {
/* Init packets are a special case */
if (pdu_type == AOL_P3_TYPE_INIT) {
offset = dissect_aol_init(tvb,pinfo,offset,aol_tree);
@@ -287,14 +287,14 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/* End-of-Frame Marker */
- if (tvb_length_remaining(tvb,offset) >= 1) {
+ if (tvb_captured_length_remaining(tvb,offset) >= 1) {
proto_tree_add_item(aol_tree,hf_aol_end,tvb,offset,1,ENC_NA);/* offset += 1;*/
} else {
/* Malformed Packet */
expert_add_info(pinfo,ti,&ei_aol_end_missing);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/**
@@ -302,11 +302,11 @@ static int dissect_aol_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
static int dissect_aol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) {
/* Ensure this really is an AOL packet */
- if (tvb_length(tvb) >= 1 && tvb_get_guint8(tvb,0) != AOL_P3_FRAME_START) return 0;
+ if (tvb_captured_length(tvb) >= 1 && tvb_get_guint8(tvb,0) != AOL_P3_FRAME_START) return 0;
/* Dissect PDUs */
tcp_dissect_pdus(tvb,pinfo,tree,aol_desegment,9,get_aol_pdu_len,dissect_aol_pdu,data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/**
diff --git a/epan/dissectors/packet-applemidi.c b/epan/dissectors/packet-applemidi.c
index 21443e4767..f8110c77bf 100644
--- a/epan/dissectors/packet-applemidi.c
+++ b/epan/dissectors/packet-applemidi.c
@@ -225,7 +225,7 @@ dissect_applemidi_common( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
}
/* If there is any remaining data (possibly because an unknown command was encountered),
* we just dump it here */
- len = tvb_length_remaining( tvb, offset );
+ len = tvb_captured_length_remaining( tvb, offset );
if ( len > 0 ) {
proto_tree_add_item( applemidi_tree, hf_applemidi_unknown_data, tvb, offset, len, ENC_NA );
}
@@ -287,7 +287,7 @@ dissect_applemidi_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
/*struct _rtp_conversation_info *p_conv_data = NULL;*/
rtp_dyn_payload_t *rtp_dyn_payload = NULL;
- if ( tvb_length( tvb ) < 4)
+ if ( tvb_captured_length( tvb ) < 4)
return FALSE; /* not enough bytes to check */
if ( !test_applemidi( tvb, &command, FALSE ) ) {
diff --git a/epan/dissectors/packet-aprs.c b/epan/dissectors/packet-aprs.c
index 3a98576675..beb71ad233 100644
--- a/epan/dissectors/packet-aprs.c
+++ b/epan/dissectors/packet-aprs.c
@@ -706,7 +706,7 @@ dissect_mic_e( tvbuff_t *tvb,
const guint8 *addr;
const mic_e_dst_code_table_s *dst_code_entry;
- data_len = tvb_length_remaining( tvb, offset );
+ data_len = tvb_captured_length_remaining( tvb, offset );
new_offset = offset + data_len;
info_buffer = (char *)wmem_alloc( wmem_packet_scope(), STRLEN );
@@ -898,7 +898,7 @@ dissect_aprs_weather( tvbuff_t *tvb,
guint8 ch;
- data_len = tvb_length_remaining( tvb, offset );
+ data_len = tvb_captured_length_remaining( tvb, offset );
new_offset = offset + data_len;
tc = proto_tree_add_item( parent_tree, hf_aprs_weather_idx, tvb, offset, data_len, ENC_ASCII|ENC_NA );
@@ -1100,7 +1100,7 @@ aprs_status( proto_tree *aprs_tree, tvbuff_t *tvb, int offset )
{
int data_len;
- data_len = tvb_length_remaining( tvb, offset );
+ data_len = tvb_captured_length_remaining( tvb, offset );
if ( ( data_len > 7 ) && ( tvb_get_guint8( tvb, offset+6 ) == 'z' ) )
{
diff --git a/epan/dissectors/packet-ar_drone.c b/epan/dissectors/packet-ar_drone.c
index c7e2d975fd..e6d859025a 100644
--- a/epan/dissectors/packet-ar_drone.c
+++ b/epan/dissectors/packet-ar_drone.c
@@ -124,7 +124,7 @@ dissect_ar_drone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
char *command;
guint32 dword;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return 0;
/* Make sure the packet we're dissecting is a ar_drone packet
diff --git a/epan/dissectors/packet-armagetronad.c b/epan/dissectors/packet-armagetronad.c
index 3c93bec2b4..97c412f29f 100644
--- a/epan/dissectors/packet-armagetronad.c
+++ b/epan/dissectors/packet-armagetronad.c
@@ -115,7 +115,7 @@ is_armagetronad_packet(tvbuff_t * tvb)
gint offset = 0;
/* For each message in the frame */
- while (tvb_length_remaining(tvb, offset) > 2) {
+ while (tvb_captured_length_remaining(tvb, offset) > 2) {
gint data_len = tvb_get_ntohs(tvb, offset + 4) * 2;
#if 0
@@ -138,7 +138,7 @@ is_armagetronad_packet(tvbuff_t * tvb)
}
/* The packed should end with a 2 bytes ID */
- return tvb_length_remaining(tvb, offset) == 2;
+ return tvb_captured_length_remaining(tvb, offset) == 2;
}
static void
@@ -250,7 +250,7 @@ dissect_armagetronad(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, voi
armagetronad_tree = proto_item_add_subtree(ti, ett_armagetronad);
/* For each message in the frame */
- while (tvb_length_remaining(tvb, offset) > 2)
+ while (tvb_captured_length_remaining(tvb, offset) > 2)
offset += add_message(tvb, offset, armagetronad_tree, info);
/* After the messages, comes the SenderID */
diff --git a/epan/dissectors/packet-artnet.c b/epan/dissectors/packet-artnet.c
index bf233212f1..9fb51c69b2 100644
--- a/epan/dissectors/packet-artnet.c
+++ b/epan/dissectors/packet-artnet.c
@@ -3134,7 +3134,7 @@ dissect_artnet_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
guint64 qword;
/* check if we atleast have the 8 byte header */
- if (tvb_length(tvb) < 8)
+ if (tvb_captured_length(tvb) < 8)
return FALSE;
/* Check the 8 byte header "Art-Net\0" = 0x4172742d4e7400*/
diff --git a/epan/dissectors/packet-asap.c b/epan/dissectors/packet-asap.c
index 4c1e6de52c..a5a6462af6 100644
--- a/epan/dissectors/packet-asap.c
+++ b/epan/dissectors/packet-asap.c
@@ -170,9 +170,9 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
code = tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET);
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
- padding_length = tvb_length(cause_tvb) - length;
+ padding_length = tvb_captured_length(cause_tvb) - length;
- cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb),
+ cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_captured_length(cause_tvb),
"%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
cause_tree = proto_item_add_subtree(cause_item, ett_asap_cause);
@@ -470,7 +470,7 @@ dissect_pool_member_selection_policy_parameter(tvbuff_t *parameter_tvb, proto_tr
proto_tree_add_item(parameter_tree, hf_policy_distance, parameter_tvb, POLICY_WRANDDPF_DISTANCE_OFFSET, POLICY_WRANDDPF_DISTANCE_LENGTH, ENC_BIG_ENDIAN);
break;
default:
- length = tvb_length(parameter_tvb) - POLICY_VALUE_OFFSET;
+ length = tvb_captured_length(parameter_tvb) - POLICY_VALUE_OFFSET;
if (length > 0) {
proto_tree_add_item(parameter_tree, hf_policy_value, parameter_tvb, POLICY_VALUE_OFFSET, length, ENC_NA);
}
@@ -647,10 +647,10 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *asap_tree)
/* extract tag and length from the parameter */
type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET);
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
- padding_length = tvb_length(parameter_tvb) - length;
+ padding_length = tvb_captured_length(parameter_tvb) - length;
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
+ parameter_item = proto_tree_add_text(asap_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_asap_parameter);
/* add tag and length to the asap tree */
@@ -722,7 +722,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
tvbuff_t *parameter_tvb;
offset = 0;
- while((remaining_length = tvb_length_remaining(parameters_tvb, offset)) > 0) {
+ while((remaining_length = tvb_captured_length_remaining(parameters_tvb, offset)) > 0) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
if (remaining_length >= length)
diff --git a/epan/dissectors/packet-assa_r3.c b/epan/dissectors/packet-assa_r3.c
index 3dcbf82725..1ebd66b8ef 100644
--- a/epan/dissectors/packet-assa_r3.c
+++ b/epan/dissectors/packet-assa_r3.c
@@ -4172,7 +4172,7 @@ dissect_r3_upstreammfgfield_iopins (tvbuff_t *tvb, guint32 start_offset, guint32
DISSECTOR_ASSERT(start_offset == 0);
- len = MAX(0, tvb_length_remaining(tvb, start_offset));
+ len = MAX(0, tvb_captured_length_remaining(tvb, start_offset));
if (len % 3 != 0)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "IOPINS data length not modulo 3 == 0");
@@ -4251,7 +4251,7 @@ dissect_r3_upstreammfgfield_checkpointlog (tvbuff_t *tvb, guint32 start_offset,
DISSECTOR_ASSERT(start_offset == 0);
- len = tvb_length_remaining (tvb, 1);
+ len = tvb_captured_length_remaining (tvb, 1);
proto_tree_add_item (tree, hf_r3_checkpointlog_entryptr, tvb, 0, 1, ENC_LITTLE_ENDIAN);
cpl_item = proto_tree_add_text (tree, tvb, 1, -1, "Checkpoint Log");
@@ -4501,7 +4501,7 @@ dissect_r3_upstreammfgfield_taskflags (tvbuff_t *tvb, guint32 start_offset, guin
DISSECTOR_ASSERT(start_offset == 0);
- len = MAX(0, tvb_length_remaining (tvb, 0));
+ len = MAX(0, tvb_captured_length_remaining (tvb, 0));
tfg_item = proto_tree_add_text (tree, tvb, 0, -1, "Task Flags (%u tasks)", len / 5);
tfg_tree = proto_item_add_subtree (tfg_item, ett_r3taskflags);
@@ -4529,7 +4529,7 @@ dissect_r3_upstreammfgfield_timerchain (tvbuff_t *tvb, guint32 start_offset, gui
DISSECTOR_ASSERT(start_offset == 0);
- len = tvb_length_remaining (tvb, 3);
+ len = tvb_captured_length_remaining (tvb, 3);
proto_tree_add_item (tree, hf_r3_timerchain_newtick, tvb, 0, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_timerchain_currentboundary, tvb, 2, 1, ENC_LITTLE_ENDIAN);
@@ -4556,7 +4556,7 @@ dissect_r3_upstreammfgfield_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint
DISSECTOR_ASSERT(start_offset == 0);
- len = tvb_length_remaining (tvb, 0);
+ len = tvb_captured_length_remaining (tvb, 0);
for (i = 0; i < len; i += 3)
{
@@ -4696,7 +4696,7 @@ dissect_r3_upstreammfgfield_capabilities (tvbuff_t *tvb, guint32 start_offset, g
DISSECTOR_ASSERT(start_offset == 0);
- len = MAX(0, tvb_length_remaining (tvb, 0));
+ len = MAX(0, tvb_captured_length_remaining (tvb, 0));
items = 0;
i = 0;
@@ -4742,7 +4742,7 @@ dissect_r3_upstreammfgfield_dumpm41t81 (tvbuff_t *tvb, guint32 start_offset, gui
{
DISSECTOR_ASSERT(start_offset == 0);
- if (tvb_length_remaining (tvb, 0) != 20)
+ if (tvb_captured_length_remaining (tvb, 0) != 20)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Length of M41T81 RTC register dump not 20 octets");
}
@@ -4860,7 +4860,7 @@ dissect_r3_upstreammfgfield_checksumresults (tvbuff_t *tvb, guint32 start_offset
DISSECTOR_ASSERT(start_offset == 0);
- len = MAX(0, tvb_length_remaining(tvb, 0));
+ len = MAX(0, tvb_captured_length_remaining(tvb, 0));
if (len % 3 != 0)
{
expert_add_info_format(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Checksum results data length not modulo 3 == 0");
@@ -4921,7 +4921,7 @@ dissect_r3_upstreammfgfield_mortisestatelog (tvbuff_t *tvb, guint32 start_offset
DISSECTOR_ASSERT(start_offset == 0);
- len = tvb_length_remaining (tvb, 3);
+ len = tvb_captured_length_remaining (tvb, 3);
proto_tree_add_item (tree, hf_r3_mortisestatelog_pointer, tvb, 0, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item (tree, hf_r3_mortisestatelog_mortisetype, tvb, 1, 1, ENC_LITTLE_ENDIAN);
@@ -6266,7 +6266,7 @@ dissect_r3_cmdmfg_forceoptions (tvbuff_t *tvb, guint32 start_offset, guint32 len
proto_tree_add_item (tree, hf_r3_commandmfg, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
start_offset += 2;
- len = tvb_length_remaining (tvb, start_offset);
+ len = tvb_captured_length_remaining (tvb, start_offset);
i = 0;
while (i<len && (step=tvb_get_guint8(tvb, start_offset + i))>0)
@@ -6373,7 +6373,7 @@ dissect_r3_cmdmfg_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint32 length
proto_tree_add_item (tree, hf_r3_commandmfg, tvb, start_offset + 1, 1, ENC_LITTLE_ENDIAN);
start_offset += 2;
- len = tvb_length_remaining (tvb, start_offset);
+ len = tvb_captured_length_remaining (tvb, start_offset);
for (i = 0; i < len; i += 3)
{
@@ -6759,7 +6759,7 @@ dissect_r3_message (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
dissect_r3_packet (tvb, pinfo, r3_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -6772,7 +6772,7 @@ static int
dissect_r3 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus (tvb, pinfo, tree, TRUE, 4, get_r3_message_len, dissect_r3_message, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
diff --git a/epan/dissectors/packet-at.c b/epan/dissectors/packet-at.c
index d1516ceecc..7c03176957 100644
--- a/epan/dissectors/packet-at.c
+++ b/epan/dissectors/packet-at.c
@@ -46,7 +46,7 @@ static gboolean allowed_chars(tvbuff_t *tvb)
gint offset, len;
guint8 val;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
for (offset = 0; offset < len; offset++) {
val = tvb_get_guint8(tvb, offset);
if (!(g_ascii_isprint(val) || (val == 0x0a) || (val == 0x0d)))
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c
index ddaeeb1a2a..4d0a0a6c34 100644
--- a/epan/dissectors/packet-atalk.c
+++ b/epan/dissectors/packet-atalk.c
@@ -1213,7 +1213,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
aspinfo = get_transaction(tvb, pinfo, (struct aspinfo *)data);
if (!aspinfo)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
fn = (guint8) aspinfo->command;
@@ -1224,7 +1224,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
val_to_str(fn, zip_atp_function_vals, "Unknown (0x%01x)"), aspinfo->seq);
if (!tree)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
ti = proto_tree_add_item(tree, proto_zip, tvb, offset, -1, ENC_NA);
zip_tree = proto_item_add_subtree(ti, ett_zip);
@@ -1268,7 +1268,7 @@ dissect_atp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index f3232b8435..0444334079 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -1033,7 +1033,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* succeeded.
* Decode the trailer, if present, and then chop it off.
*/
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
if ((reported_length % 48) == 0) {
/*
@@ -1151,7 +1151,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
default:
- if (tvb_length(next_tvb) > 7) /* sizeof(octet) */
+ if (tvb_captured_length(next_tvb) > 7) /* sizeof(octet) */
{
guint8 octet[8];
tvb_memcpy(next_tvb, octet, 0, sizeof(octet));
@@ -1744,7 +1744,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(aal_tree, hf_atm_aal3_4_seq_num, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(aal_tree, hf_atm_aal3_4_multiplex_id, tvb, offset, 2, ENC_BIG_ENDIAN);
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
crc10 = update_crc10_by_bytes(0, tvb_get_ptr(tvb, offset, length),
length);
offset += 2;
@@ -1791,7 +1791,7 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(aal_tree, hf_atm_aal_oamcell_type_ft, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
}
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
crc10 = update_crc10_by_bytes(0, tvb_get_ptr(tvb, offset, length),
length);
offset += 1;
@@ -1891,7 +1891,7 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated, pwpd != NULL);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1926,7 +1926,7 @@ dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL, FALSE, FALSE, pwpd);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-atmtcp.c b/epan/dissectors/packet-atmtcp.c
index 407c762a5c..12c3e9613e 100644
--- a/epan/dissectors/packet-atmtcp.c
+++ b/epan/dissectors/packet-atmtcp.c
@@ -101,7 +101,7 @@ dissect_atmtcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* Data (for the moment...) */
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-ax25-nol3.c b/epan/dissectors/packet-ax25-nol3.c
index e39656ca6b..dd3a7f156c 100644
--- a/epan/dissectors/packet-ax25-nol3.c
+++ b/epan/dissectors/packet-ax25-nol3.c
@@ -91,7 +91,7 @@ dissect_dx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
int offset;
offset = 0;
- data_len = tvb_length_remaining( tvb, offset );
+ data_len = tvb_captured_length_remaining( tvb, offset );
col_set_str( pinfo->cinfo, COL_PROTOCOL, "DX" );
diff --git a/epan/dissectors/packet-babel.c b/epan/dissectors/packet-babel.c
index f3c143618b..88b0254746 100644
--- a/epan/dissectors/packet-babel.c
+++ b/epan/dissectors/packet-babel.c
@@ -194,7 +194,7 @@ dissect_babel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
guint8 version;
guint16 bodylen;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return 0;
if (tvb_get_guint8(tvb, 0) != 42)
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index 451c4dc130..82a9c2bb34 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -42,8 +42,8 @@ static int bacapp_tap = -1;
/* formerly bacapp.h contains definitions and forward declarations */
#ifndef FAULT
-#define FAULT proto_tree_add_text(subtree, tvb, offset, tvb_length(tvb) - offset, "something is going wrong here !!"); \
- offset = tvb_length(tvb);
+#define FAULT proto_tree_add_text(subtree, tvb, offset, tvb_captured_length(tvb) - offset, "something is going wrong here !!"); \
+ offset = tvb_captured_length(tvb);
#endif
/* BACnet PDU Types */
@@ -5292,10 +5292,10 @@ fTagHeaderTree(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvb, lvt_offset, lvt_len, *lvt);
} /* if (tree) */
- if (*lvt > tvb_length(tvb)) {
+ if (*lvt > tvb_captured_length(tvb)) {
expert_add_info_format(pinfo, ti, &ei_bacapp_bad_length,
"LVT length too long: %d > %d", *lvt,
- tvb_length(tvb));
+ tvb_captured_length(tvb));
*lvt = 1;
}
@@ -6975,14 +6975,14 @@ fPropertyValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset
offset += fTagHeaderTree(tvb, pinfo, tree, offset,
&tag_no, &tag_info, &lvt);
offset = fAbstractSyntaxNType(tvb, pinfo, tree, offset);
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
offset += fTagHeaderTree(tvb, pinfo, tree, offset,
&tag_no, &tag_info, &lvt);
}
} else {
- proto_tree_add_text(tree, tvb, offset, tvb_length(tvb) - offset,
+ proto_tree_add_text(tree, tvb, offset, tvb_captured_length(tvb) - offset,
"expected Opening Tag!");
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
return offset;
@@ -7344,7 +7344,7 @@ fConfirmedPrivateTransferRequest(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
if (dissector_try_uint(bacapp_dissector_table,
vendor_identifier, next_tvb, pinfo, tree)) {
/* we parsed it so skip over length and we are done */
- offset += tvb_length(next_tvb);
+ offset += tvb_captured_length(next_tvb);
return offset;
}
diff --git a/epan/dissectors/packet-bacnet.c b/epan/dissectors/packet-bacnet.c
index 2910beb955..124dc3a978 100644
--- a/epan/dissectors/packet-bacnet.c
+++ b/epan/dissectors/packet-bacnet.c
@@ -357,7 +357,7 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
vendor_id, next_tvb, pinfo, bacnet_tree)) {
/* we parsed it so skip over length and we are done */
/* Note: offset has now been bumped for message type and vendor id so we take that out of our next_tvb size */
- offset += tvb_length(next_tvb) -3;
+ offset += tvb_captured_length(next_tvb) -3;
}
}
/* Performance Index (in I-Could-Be-Router-To-Network) */
diff --git a/epan/dissectors/packet-banana.c b/epan/dissectors/packet-banana.c
index 76dd785e69..166f4daf05 100644
--- a/epan/dissectors/packet-banana.c
+++ b/epan/dissectors/packet-banana.c
@@ -139,7 +139,7 @@ dissect_banana_element(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int
int i;
/* Accumulate our value/length 'til we hit a valid type */
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
byte = tvb_get_guint8(tvb, offset);
offset++;
@@ -228,13 +228,13 @@ dissect_banana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree *banana_tree;
/* Check that there's enough data */
- if (tvb_length(tvb) < 2)
+ if (tvb_captured_length(tvb) < 2)
return 0;
/* Fill in our protocol and info columns */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "Banana");
- while (tvb_length_remaining(tvb, offset) > 0 && offset < MAX_ELEMENT_VAL_LEN) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0 && offset < MAX_ELEMENT_VAL_LEN) {
byte = tvb_get_guint8(tvb, offset);
if (is_element(byte))
break;
@@ -255,7 +255,7 @@ dissect_banana(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-batadv.c b/epan/dissectors/packet-batadv.c
index 3a6b5ae13f..d829b6410c 100644
--- a/epan/dissectors/packet-batadv.c
+++ b/epan/dissectors/packet-batadv.c
@@ -628,7 +628,7 @@ static void dissect_batman_plugin(tvbuff_t *tvb, packet_info *pinfo, proto_tree
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BATADV_???");
- length_remaining = tvb_length_remaining(tvb, 0);
+ length_remaining = tvb_captured_length_remaining(tvb, 0);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, 0);
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -650,35 +650,35 @@ static void dissect_batadv_batman(tvbuff_t *tvb, packet_info *pinfo, proto_tree
switch (version) {
case 5:
case 6:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V5_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V5_SIZE) {
offset = dissect_batadv_batman_v5(tvb, offset, pinfo, tree);
}
break;
case 7:
case 8:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V7_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V7_SIZE) {
offset = dissect_batadv_batman_v7(tvb, offset, pinfo, tree);
}
break;
case 9:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V9_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V9_SIZE) {
offset = dissect_batadv_batman_v9(tvb, offset, pinfo, tree);
}
break;
case 11:
case 13:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V11_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V11_SIZE) {
offset = dissect_batadv_batman_v11(tvb, offset, pinfo, tree);
}
break;
case 10:
case 12:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V10_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V10_SIZE) {
offset = dissect_batadv_batman_v10(tvb, offset, pinfo, tree);
}
break;
case 14:
- while (offset != -1 && tvb_length_remaining(tvb, offset) >= BATMAN_PACKET_V14_SIZE) {
+ while (offset != -1 && tvb_captured_length_remaining(tvb, offset) >= BATMAN_PACKET_V14_SIZE) {
offset = dissect_batadv_batman_v14(tvb, offset, pinfo, tree);
}
break;
@@ -1358,7 +1358,7 @@ static int dissect_batadv_batman_v14(tvbuff_t *tvb, int offset, packet_info *pin
offset += TT_ENTRY_V14_SIZE;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -1475,7 +1475,7 @@ static void dissect_batadv_bcast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tre
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
if (have_tap_listener(batadv_follow_tap)) {
@@ -1543,7 +1543,7 @@ static void dissect_batadv_bcast_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tr
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1616,7 +1616,7 @@ static void dissect_batadv_bcast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tr
tap_queue_packet(batadv_tap, pinfo, bcast_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1733,7 +1733,7 @@ static void dissect_batadv_icmp_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -1834,7 +1834,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += 1;
/* rr data available? */
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining >= 1 + BAT_RR_LEN * 6) {
dissect_batadv_icmp_rr(batadv_icmp_tree, tvb, offset);
offset += 1 + BAT_RR_LEN * 6;
@@ -1848,7 +1848,7 @@ static void dissect_batadv_icmp_v7(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -1926,7 +1926,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre
offset += 1;
/* rr data available? */
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining >= 1 + BAT_RR_LEN * 6) {
dissect_batadv_icmp_rr(batadv_icmp_tree, tvb, offset);
offset += 1 + BAT_RR_LEN * 6;
@@ -1940,7 +1940,7 @@ static void dissect_batadv_icmp_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tre
tap_queue_packet(batadv_tap, pinfo, icmp_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset(tvb, offset, length_remaining, -1);
call_dissector(data_handle, next_tvb, pinfo, tree);
@@ -2029,7 +2029,7 @@ static void dissect_batadv_unicast_v6(tvbuff_t *tvb, packet_info *pinfo, proto_t
tap_queue_packet(batadv_tap, pinfo, unicast_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -2098,7 +2098,7 @@ static void dissect_batadv_unicast_v14(tvbuff_t *tvb, packet_info *pinfo, proto_
tap_queue_packet(batadv_tap, pinfo, unicast_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -2198,7 +2198,7 @@ static void dissect_batadv_unicast_4addr_v14(tvbuff_t *tvb, packet_info *pinfo,
tap_queue_packet(batadv_tap, pinfo, unicast_4addr_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -2315,7 +2315,7 @@ static void dissect_batadv_unicast_frag_v12(tvbuff_t *tvb, packet_info *pinfo, p
tap_queue_packet(batadv_tap, pinfo, unicast_frag_packeth);
head = (unicast_frag_packeth->flags & 0x1);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining < 0)
length_remaining = 0;
frag_msg = fragment_add_seq_check(&msg_reassembly_table,
@@ -2429,7 +2429,7 @@ static void dissect_batadv_unicast_frag_v14(tvbuff_t *tvb, packet_info *pinfo, p
tap_queue_packet(batadv_tap, pinfo, unicast_frag_packeth);
head = (unicast_frag_packeth->flags & 0x1);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining < 0)
length_remaining = 0;
frag_msg = fragment_add_seq_check(&msg_reassembly_table,
@@ -2601,7 +2601,7 @@ static void dissect_batadv_vis_v6(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += entry_size;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -2705,7 +2705,7 @@ static void dissect_batadv_vis_v10(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += VIS_ENTRY_V8_SIZE;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -2813,7 +2813,7 @@ static void dissect_batadv_vis_v14(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += VIS_ENTRY_V8_SIZE;
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -3009,7 +3009,7 @@ static void dissect_batadv_tt_query_v14(tvbuff_t *tvb, packet_info *pinfo _U_, p
}
}
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -3141,7 +3141,7 @@ static void dissect_batadv_roam_adv_v14(tvbuff_t *tvb, packet_info *pinfo, proto
tap_queue_packet(batadv_tap, pinfo, roam_adv_packeth);
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (length_remaining > 0) {
next_tvb = tvb_new_subset_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-beep.c b/epan/dissectors/packet-beep.c
index 304f722bda..2556ef2b39 100644
--- a/epan/dissectors/packet-beep.c
+++ b/epan/dissectors/packet-beep.c
@@ -529,9 +529,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
set_mime_hdr_flags(more, request_val, beep_frame_data, pinfo);
}
else { /* Protocol violation, so dissect rest as undisectable */
- if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
+ if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
}
@@ -561,9 +561,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
- if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
+ if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@@ -579,9 +579,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Now for the payload, if any */
- if (tvb_length_remaining(tvb, offset) > 0) { /* Dissect what is left as payload */
+ if (tvb_captured_length_remaining(tvb, offset) > 0) { /* Dissect what is left as payload */
- int pl_size = MIN(size, tvb_length_remaining(tvb, offset));
+ int pl_size = MIN(size, tvb_captured_length_remaining(tvb, offset));
/* Except, check the payload length, and only dissect that much */
@@ -608,7 +608,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* If anything else left, dissect it ... */
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
offset += dissect_beep_tree(tvb, offset, pinfo, tree, request_val, beep_frame_data);
} else if (tvb_strneql(tvb, offset, "SEQ ", 4) == 0) {
@@ -643,9 +643,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
- if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
+ if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@@ -659,7 +659,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tr = NULL;
if (tree) {
- ti = proto_tree_add_text(tree, tvb, offset, MIN(5, MAX(0, tvb_length_remaining(tvb, offset))), "Trailer");
+ ti = proto_tree_add_text(tree, tvb, offset, MIN(5, MAX(0, tvb_captured_length_remaining(tvb, offset))), "Trailer");
tr = proto_item_add_subtree(ti, ett_trailer);
@@ -672,9 +672,9 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* We dissect the rest as data and bail ... */
- if (tree && (tvb_length_remaining(tvb, offset) > 0)) {
+ if (tree && (tvb_captured_length_remaining(tvb, offset) > 0)) {
proto_tree_add_item(tree, hf_beep_payload_undissected, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA|ENC_ASCII);
}
return -1;
@@ -685,24 +685,24 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
- if (tvb_length_remaining(tvb, offset) > 0) { /* Dissect anything left over */
+ if (tvb_captured_length_remaining(tvb, offset) > 0) { /* Dissect anything left over */
int pl_size = 0;
if (request_val) {
- pl_size = MIN(request_val->size, tvb_length_remaining(tvb, offset));
+ pl_size = MIN(request_val->size, tvb_captured_length_remaining(tvb, offset));
if (pl_size == 0) { /* The whole of the rest must be payload */
- pl_size = tvb_length_remaining(tvb, offset); /* Right place ? */
+ pl_size = tvb_captured_length_remaining(tvb, offset); /* Right place ? */
}
} else if (beep_frame_data) {
- pl_size = MIN(beep_frame_data->pl_size, tvb_length_remaining(tvb, offset));
+ pl_size = MIN(beep_frame_data->pl_size, tvb_captured_length_remaining(tvb, offset));
} else { /* Just in case */
- pl_size = tvb_length_remaining(tvb, offset);
+ pl_size = tvb_captured_length_remaining(tvb, offset);
}
/* Take care here to handle the payload correctly, and if there is
@@ -715,7 +715,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
if (pl_size == 0 && offset == st_offset)
- pl_size = tvb_length_remaining(tvb, offset);
+ pl_size = tvb_captured_length_remaining(tvb, offset);
if (pl_size > 0) {
@@ -735,7 +735,7 @@ dissect_beep_tree(tvbuff_t *tvb, int offset, packet_info *pinfo,
}
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
offset += dissect_beep_tree(tvb, offset, pinfo, tree, request_val, beep_frame_data);
}
}
@@ -811,8 +811,8 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* "tvb_format_text()" is passed a value that won't go past the end
* of the packet, so it won't throw an exception.
*/
- if (tvb_length_remaining(tvb, offset) > 0)
- col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, offset, tvb_length_remaining(tvb, offset)));
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
+ col_add_str(pinfo->cinfo, COL_INFO, tvb_format_text(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
/* Here, we parse the message so we can retrieve the info we need, which
* is that there is some payload left from a previous segment on the
@@ -848,7 +848,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int pl_left = beep_frame_data->pl_left;
- pl_left = MIN(pl_left, MAX(0, tvb_length_remaining(tvb, offset)));
+ pl_left = MIN(pl_left, MAX(0, tvb_captured_length_remaining(tvb, offset)));
/* Add the payload bit, only if we have a tree */
if (tree && (pl_left > 0)) {
@@ -892,7 +892,7 @@ dissect_beep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
/*offset += */dissect_beep_tree(tvb, offset, pinfo, beep_tree, request_val, beep_frame_data);
diff --git a/epan/dissectors/packet-bencode.c b/epan/dissectors/packet-bencode.c
index 7ce5855951..e20d8dd04d 100644
--- a/epan/dissectors/packet-bencode.c
+++ b/epan/dissectors/packet-bencode.c
@@ -282,7 +282,7 @@ static int dissect_bencoding_rec(tvbuff_t *tvb, packet_info *pinfo _U_,
static void dissect_bencoding(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
- dissect_bencoding_rec(tvb, pinfo, 0, tvb_length(tvb), tree, 0, NULL, 0);
+ dissect_bencoding_rec(tvb, pinfo, 0, tvb_captured_length(tvb), tree, 0, NULL, 0);
}
void
diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c
index 6fdc4d6d1b..344f4d732f 100644
--- a/epan/dissectors/packet-ber.c
+++ b/epan/dissectors/packet-ber.c
@@ -633,8 +633,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("dissect_ber_tagged_type(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("dissect_ber_tagged_type(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("dissect_ber_tagged_type(%s) entered\n", name);
}
@@ -666,7 +666,7 @@ printf("dissect_ber_tagged_type(%s) entered\n", name);
if (tag_impl) {
gint length_remaining;
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (tmp_len > (guint32)length_remaining)
tmp_len = length_remaining;
next_tvb = tvb_new_subset_length(tvb, offset, tmp_len);
@@ -827,7 +827,7 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
offset = get_ber_length(tvb, offset, &len, &ind);
- if (len > (guint32)tvb_length_remaining(tvb, offset)) {
+ if (len > (guint32)tvb_captured_length_remaining(tvb, offset)) {
/* hmm maybe something bad happened or the frame is short;
since these are not vital outputs just return instead of
throwing an exception.
@@ -839,11 +839,11 @@ try_dissect_unknown_ber(packet_info *pinfo, tvbuff_t *tvb, volatile int offset,
}
cause = proto_tree_add_string_format_value(
tree, hf_ber_error, tvb, offset, len, "illegal_length",
- "length:%u longer than tvb_length_remaining:%d",
+ "length:%u longer than tvb_captured_length_remaining:%d",
len,
- tvb_length_remaining(tvb, offset));
+ tvb_captured_length_remaining(tvb, offset));
expert_add_info(pinfo, cause, &ei_ber_error_length);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* we don't care about the class only on the constructor flag */
switch (pc) {
@@ -1080,7 +1080,7 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
proto_tree *next_tree = NULL;
gint length_remaining;
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
if (oid == NULL) {
item = proto_tree_add_expert(tree, pinfo, &ei_ber_no_oid, next_tvb, 0, length_remaining);
@@ -1124,7 +1124,7 @@ call_ber_oid_callback(const char *oid, tvbuff_t *tvb, int offset, packet_info *p
* into new_dissector_t we have to do this kludge with
* manually step past the content in the ANY type.
*/
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -1142,11 +1142,11 @@ call_ber_syntax_callback(const char *syntax, tvbuff_t *tvb, int offset, packet_i
if (syntax == NULL) {
item = proto_tree_add_expert_format(
- tree, pinfo, &ei_ber_no_oid, next_tvb, 0, tvb_length_remaining(tvb, offset),
+ tree, pinfo, &ei_ber_no_oid, next_tvb, 0, tvb_captured_length_remaining(tvb, offset),
"BER: No syntax supplied to call_ber_syntax_callback");
} else {
item = proto_tree_add_expert_format(
- tree, pinfo, &ei_ber_syntax_not_implemented, next_tvb, 0, tvb_length_remaining(tvb, offset),
+ tree, pinfo, &ei_ber_syntax_not_implemented, next_tvb, 0, tvb_captured_length_remaining(tvb, offset),
"BER: Dissector for syntax:%s not implemented."
" Contact Wireshark developers if you want this supported",
syntax);
@@ -1161,7 +1161,7 @@ call_ber_syntax_callback(const char *syntax, tvbuff_t *tvb, int offset, packet_i
* into new_dissector_t we have to do this kludge with
* manually step past the content in the ANY type.
*/
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -1189,7 +1189,7 @@ printf ("BER ID=%02x", id);
/* 8.1.2.4 */
if (tmp_tag == 0x1F) {
tmp_tag = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
t = tvb_get_guint8(tvb, offset);
#ifdef DEBUG_BER
printf (" %02x", t);
@@ -1341,7 +1341,7 @@ try_get_ber_length(tvbuff_t *tvb, int offset, guint32 *length, gboolean *ind, gi
*ind = tmp_ind;
#ifdef DEBUG_BER
-printf("get BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
+printf("get BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_captured_length_remaining(tvb, offset));
#endif
return offset;
@@ -1387,7 +1387,7 @@ dissect_ber_length(packet_info *pinfo _U_, proto_tree *tree, tvbuff_t *tvb, int
*ind = tmp_ind;
#ifdef DEBUG_BER
-printf("dissect BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_length_remaining(tvb, offset));
+printf("dissect BER length %d, offset %d (remaining %d)\n", tmp_length, offset, tvb_captured_length_remaining(tvb, offset));
#endif
last_length = tmp_length;
@@ -1462,13 +1462,13 @@ reassemble_octet_string(asn1_ctx_t *actx, proto_tree *tree, gint hf_id, tvbuff_t
}
- if (tvb_length(next_tvb) < 1) {
+ if (tvb_captured_length(next_tvb) < 1) {
/* Don't cause an assertion in the reassembly code. */
THROW(ReportedBoundsError);
}
fd_head = fragment_add_seq_next(&octet_segment_reassembly_table,
next_tvb, 0, actx->pinfo, dst_ref, NULL,
- tvb_length(next_tvb),
+ tvb_captured_length(next_tvb),
fragment);
firstFragment = FALSE;
@@ -1524,8 +1524,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("OCTET STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("OCTET STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
}
@@ -1571,7 +1571,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
end_offset = offset+len;
/* caller may have created new buffer for indefinite length data Verify via length */
- len_remain = (guint32)tvb_length_remaining(tvb, offset);
+ len_remain = (guint32)tvb_captured_length_remaining(tvb, offset);
if (ind && (len_remain == (len - 2))) {
/* new buffer received so adjust length and indefinite flag */
len -= 2;
@@ -1584,7 +1584,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
*/
cause = proto_tree_add_string_format_value(
tree, hf_ber_error, tvb, offset, len, "illegal_length",
- "length:%u longer than tvb_length_remaining:%d",
+ "length:%u longer than tvb_captured_length_remaining:%d",
len,
len_remain);
expert_add_info(actx->pinfo, cause, &ei_ber_error_length);
@@ -1602,7 +1602,7 @@ printf("OCTET STRING dissect_ber_octet_string(%s) entered\n", name);
/* primitive */
gint length_remaining;
- length_remaining = tvb_length_remaining(tvb, offset);
+ length_remaining = tvb_captured_length_remaining(tvb, offset);
#if 0
if (length_remaining < 1) {
return end_offset;
@@ -1727,7 +1727,7 @@ dissect_ber_octet_string_wcb(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
tvbuff_t *out_tvb = NULL;
offset = dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_id, (func) ? &out_tvb : NULL);
- if (func && out_tvb && (tvb_length(out_tvb) > 0)) {
+ if (func && out_tvb && (tvb_captured_length(out_tvb) > 0)) {
if (hf_id >= 0)
tree = proto_item_add_subtree(actx->created_item, ett_ber_octet_string);
/* TODO Should hf_id2 be pased as last parameter???*/
@@ -1801,8 +1801,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, implicit_tag);
}
@@ -1818,7 +1818,7 @@ printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, im
offset = dissect_ber_identifier(actx->pinfo, tree, tvb, offset, &ber_class, &pc, &tag);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &len, NULL);
} else {
- gint32 remaining = tvb_length_remaining(tvb, offset);
+ gint32 remaining = tvb_captured_length_remaining(tvb, offset);
len = remaining>0 ? remaining : 0;
}
@@ -2066,8 +2066,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("SEQUENCE dissect_ber_sequence(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("SEQUENCE dissect_ber_sequence(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
}
@@ -2079,7 +2079,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
offset = get_ber_length(tvb, offset, &lenx, NULL);
} else {
/* was implicit tag so just use the length of the tvb */
- lenx = tvb_length_remaining(tvb, offset);
+ lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+lenx;
}
/* create subtree */
@@ -2097,7 +2097,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) entered\n", name);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &lenx, &ind);
if (ind) {
/* Fixed the length is correctly returned from dissect ber_length
- end_offset = tvb_length(tvb);*/
+ end_offset = tvb_captured_length(tvb);*/
end_offset = offset + lenx -2;
} else {
end_offset = offset + lenx;
@@ -2297,13 +2297,13 @@ ber_sequence_try_again:
} else {
hoffset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
hoffset = dissect_ber_length(actx->pinfo, tree, tvb, hoffset, NULL, NULL);
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset - (2 * ind_field)))
length_remaining = eoffset - hoffset - (2 * ind_field);
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
}
} else {
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset))
length_remaining = eoffset - hoffset;
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
@@ -2332,8 +2332,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(next_tvb, 0) > 3) {
-printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
+if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
+printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
printf("SEQUENCE dissect_ber_sequence(%s) calling subdissector\n", name);
}
@@ -2398,7 +2398,7 @@ printf("SEQUENCE dissect_ber_sequence(%s) subdissector ate %d bytes\n", name, co
}
if (ind) {
/* need to eat this EOC
- end_offset = tvb_length(tvb);*/
+ end_offset = tvb_captured_length(tvb);*/
end_offset += 2;
if (show_internal_ber_fields) {
proto_tree_add_text(tree, tvb, end_offset-2, 2 , "SEQ EOC");
@@ -2441,8 +2441,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("SET dissect_ber_set(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("SET dissect_ber_set(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SET dissect_ber_set(%s) entered\n", name);
}
@@ -2456,7 +2456,7 @@ printf("SET dissect_ber_set(%s) entered\n", name);
offset = dissect_ber_length(actx->pinfo, tree, tvb, offset, &lenx, &ind);
if (ind) {
/* Fixed the length is correctly returned from dissect ber_length
- end_offset = tvb_length(tvb);*/
+ end_offset = tvb_captured_length(tvb);*/
end_offset = offset + lenx -2;
} else {
end_offset = offset + lenx;
@@ -2485,7 +2485,7 @@ printf("SET dissect_ber_set(%s) entered\n", name);
}
} else {
/* was implicit tag so just use the length of the tvb */
- lenx = tvb_length_remaining(tvb, offset);
+ lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+lenx;
}
@@ -2554,12 +2554,12 @@ printf("SET dissect_ber_set(%s) entered\n", name);
/* dissect header and len for field */
hoffset = dissect_ber_identifier(actx->pinfo, tree, tvb, hoffset, NULL, NULL, NULL);
hoffset = dissect_ber_length(actx->pinfo, tree, tvb, hoffset, NULL, NULL);
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset - (2 * ind_field)))
length_remaining = eoffset - hoffset - (2 * ind_field);
next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, eoffset - hoffset - (2 * ind_field));
} else {
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining > (eoffset - hoffset))
length_remaining = eoffset - hoffset;
next_tvb = tvb_new_subset(tvb, hoffset, length_remaining, eoffset - hoffset);
@@ -2589,8 +2589,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(next_tvb, 0) > 3) {
-printf("SET dissect_ber_set(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
+if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
+printf("SET dissect_ber_set(%s) calling subdissector offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
printf("SET dissect_ber_set(%s) calling subdissector\n", name);
}
@@ -2678,7 +2678,7 @@ printf("SET dissect_ber_set(%s) calling subdissector\n", name);
if (ind) {
/* need to eat this EOC
- end_offset = tvb_length(tvb);*/
+ end_offset = tvb_captured_length(tvb);*/
end_offset += 2;
if (show_internal_ber_fields) {
proto_tree_add_text(tree, tvb, end_offset-2, 2 , "SET EOC");
@@ -2719,10 +2719,10 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("CHOICE dissect_ber_choice(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("CHOICE dissect_ber_choice(%s) entered offset:%d len:%d %02x:%02x:%02x\n", name, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
-printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_length_remaining(tvb, offset));
+printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_captured_length_remaining(tvb, offset));
}
}
#endif
@@ -2733,7 +2733,7 @@ printf("CHOICE dissect_ber_choice(%s) entered len:%d\n", name, tvb_length_remain
*branch_taken = -1;
}
- if (tvb_length_remaining(tvb, offset) == 0) {
+ if (tvb_captured_length_remaining(tvb, offset) == 0) {
item = proto_tree_add_string_format_value(
parent_tree, hf_ber_error, tvb, offset, 0, "empty_choice",
"Empty choice was found");
@@ -2815,7 +2815,7 @@ printf("CHOICE testing potential subdissector class[%p]:%d:(expected)%d tag:%d:
}
}
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining>length)
length_remaining = length;
@@ -2845,10 +2845,10 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(next_tvb, 0) > 3) {
-printf("CHOICE dissect_ber_choice(%s) calling subdissector start_offset:%d offset:%d len:%d %02x:%02x:%02x\n", name, start_offset, offset, tvb_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
+if (tvb_captured_length_remaining(next_tvb, 0) > 3) {
+printf("CHOICE dissect_ber_choice(%s) calling subdissector start_offset:%d offset:%d len:%d %02x:%02x:%02x\n", name, start_offset, offset, tvb_captured_length_remaining(next_tvb, 0), tvb_get_guint8(next_tvb, 0), tvb_get_guint8(next_tvb, 1), tvb_get_guint8(next_tvb, 2));
} else {
-printf("CHOICE dissect_ber_choice(%s) calling subdissector len:%d\n", name, tvb_length(next_tvb));
+printf("CHOICE dissect_ber_choice(%s) calling subdissector len:%d\n", name, tvb_captured_length(next_tvb));
}
}
#endif
@@ -3009,8 +3009,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("RESTRICTED STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("RESTRICTED STRING dissect_ber_octet string(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("RESTRICTED STRING dissect_ber_octet_string(%s) entered\n", name);
}
@@ -3066,7 +3066,7 @@ dissect_ber_GeneralString(asn1_ctx_t *actx, proto_tree *tree, tvbuff_t *tvb, int
* do we want to throw an exception?
*/
if (out_tvb) {
- tvb_len = tvb_length(out_tvb);
+ tvb_len = tvb_captured_length(out_tvb);
if ((guint)tvb_len >= name_len) {
tvb_memcpy(out_tvb, (guint8*)name_string, 0, name_len-1);
name_string[name_len-1] = '\0';
@@ -3105,8 +3105,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb, offset) > 3) {
-printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb, offset) > 3) {
+printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered\n", name);
}
@@ -3138,7 +3138,7 @@ printf("OBJECT IDENTIFIER dissect_ber_any_oid(%s) entered\n", name);
return eoffset;
}
} else {
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
eoffset = offset+len;
}
@@ -3175,7 +3175,7 @@ dissect_ber_any_oid_str(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tre
offset = dissect_ber_any_oid(implicit_tag, actx, tree, tvb, offset, hf_id, (value_stringx) ? &value_tvb : NULL, is_absolute);
if (value_stringx) {
- if (value_tvb && (length = tvb_length(value_tvb))) {
+ if (value_tvb && (length = tvb_captured_length(value_tvb))) {
*value_stringx = oid_encoded2string(tvb_get_ptr(value_tvb, 0, length), length);
} else {
*value_stringx = "";
@@ -3242,8 +3242,8 @@ name = hfinfo->name;
} else {
name = "unnamed";
}
-if (tvb_length_remaining(tvb,offset) > 3) {
-printf("SQ OF dissect_ber_sq_of(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
+if (tvb_captured_length_remaining(tvb,offset) > 3) {
+printf("SQ OF dissect_ber_sq_of(%s) entered implicit_tag:%d offset:%d len:%d %02x:%02x:%02x\n", name, implicit_tag, offset, tvb_captured_length_remaining(tvb, offset), tvb_get_guint8(tvb, offset), tvb_get_guint8(tvb, offset+1), tvb_get_guint8(tvb, offset+2));
} else {
printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
}
@@ -3297,7 +3297,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
} else {
/* the tvb length should be correct now nope we could be coming from an implicit choice or sequence, thus we
read the items we match and return the length*/
- lenx = tvb_length_remaining(tvb, offset);
+ lenx = tvb_captured_length_remaining(tvb, offset);
end_offset = offset + lenx;
}
@@ -3309,7 +3309,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
* dissecting a single item.
*/
/* XXX Do we really need to count them at all ? ronnie */
- if (tvb_length_remaining(tvb, offset) == tvb_reported_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset) == tvb_reported_length_remaining(tvb, offset)) {
while (offset < end_offset) {
guint32 len;
gint s_offset;
@@ -3425,7 +3425,7 @@ printf("SQ OF dissect_ber_sq_of(%s) entered\n", name);
/* Function has IMPLICIT TAG */
}
- length_remaining = tvb_length_remaining(tvb, hoffset);
+ length_remaining = tvb_captured_length_remaining(tvb, hoffset);
if (length_remaining>eoffset-hoffset)
length_remaining = eoffset-hoffset;
next_tvb = tvb_new_subset_length(tvb, hoffset, length_remaining);
@@ -3523,7 +3523,7 @@ dissect_ber_GeneralizedTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree
return end_offset;
}
} else {
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+len;
}
@@ -3645,7 +3645,7 @@ dissect_ber_UTCTime(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *tree, t
return offset+len;
}
} else {
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
}
if ((len < 10) || (len > 19)) {
@@ -3806,7 +3806,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
}
} else {
pc=0;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
end_offset = offset+len;
}
@@ -3840,7 +3840,7 @@ dissect_ber_constrained_bitstring(gboolean implicit_tag, asn1_ctx_t *actx, proto
}
}
if (out_tvb) {
- if (len <= (guint32)tvb_length_remaining(tvb, offset)) {
+ if (len <= (guint32)tvb_captured_length_remaining(tvb, offset)) {
*out_tvb = tvb_new_subset_length(tvb, offset, len);
} else {
*out_tvb = tvb_new_subset_remaining(tvb, offset);
@@ -3937,7 +3937,7 @@ dissect_ber_bitstring32(gboolean implicit_tag, asn1_ctx_t *actx, proto_tree *par
* so we have to read it byte by byte.
*/
val = 0;
- tvb_len = tvb_length(tmp_tvb);
+ tvb_len = tvb_captured_length(tmp_tvb);
for (i=0; i<4; i++) {
val <<= 8;
if (i < tvb_len) {
diff --git a/epan/dissectors/packet-bfcp.c b/epan/dissectors/packet-bfcp.c
index 129909ad5c..806f36f16d 100644
--- a/epan/dissectors/packet-bfcp.c
+++ b/epan/dissectors/packet-bfcp.c
@@ -458,7 +458,7 @@ dissect_bfcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* Size of smallest BFCP packet: 12 octets */
- if (tvb_length(tvb) < 12)
+ if (tvb_captured_length(tvb) < 12)
return FALSE;
/* Check version and reserved bits in first byte */
diff --git a/epan/dissectors/packet-bitcoin.c b/epan/dissectors/packet-bitcoin.c
index 8544fe764f..660bedf340 100644
--- a/epan/dissectors/packet-bitcoin.c
+++ b/epan/dissectors/packet-bitcoin.c
@@ -1073,7 +1073,7 @@ static int dissect_bitcoin_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
tvb_sub = tvb_new_subset_remaining(tvb, offset);
msg_dissectors[i].function(tvb_sub, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
@@ -1081,7 +1081,7 @@ static int dissect_bitcoin_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", "[unknown command]");
expert_add_info(pinfo, ti, &ei_bitcoin_command_unknown);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1100,7 +1100,7 @@ dissect_bitcoin_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
guint32 magic_number;
conversation_t *conversation;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return FALSE;
magic_number = tvb_get_letohl(tvb, 0);
diff --git a/epan/dissectors/packet-bittorrent.c b/epan/dissectors/packet-bittorrent.c
index ccbdb1b8e4..3d58ce9c1e 100644
--- a/epan/dissectors/packet-bittorrent.c
+++ b/epan/dissectors/packet-bittorrent.c
@@ -290,7 +290,7 @@ get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
data from the middle of a message, and just return the
remaining length in the tvbuff so the rest of the tvbuff
is displayed as continuation data. */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
} else {
/* We don't have the type field, so we can't determine
@@ -299,7 +299,7 @@ get_bittorrent_pdu_length(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
and just return the remaining length in the tvbuff so
the rest of the tvbuff is displayed as continuation
data. */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
}
}
@@ -547,7 +547,7 @@ int dissect_bittorrent_tcp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
col_append_str(pinfo->cinfo, COL_INFO, " ");
col_set_fence(pinfo->cinfo, COL_INFO);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static
@@ -555,7 +555,7 @@ int dissect_bittorrent (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
{
tcp_dissect_pdus(tvb, pinfo, tree, bittorrent_desegment, BITTORRENT_HEADER_LENGTH,
get_bittorrent_pdu_length, dissect_bittorrent_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static
@@ -564,7 +564,7 @@ gboolean test_bittorrent_packet (tvbuff_t *tvb, packet_info *pinfo,
{
conversation_t *conversation;
- if (tvb_length(tvb) >= 20 &&
+ if (tvb_captured_length(tvb) >= 20 &&
tvb_get_guint8(tvb, 0) == 19 &&
tvb_memeql(tvb, 1, "BitTorrent protocol", 19) == 0) {
conversation = find_or_create_conversation(pinfo);
diff --git a/epan/dissectors/packet-bmc.c b/epan/dissectors/packet-bmc.c
index cde5f729dd..04100043c2 100644
--- a/epan/dissectors/packet-bmc.c
+++ b/epan/dissectors/packet-bmc.c
@@ -100,7 +100,7 @@ dissect_bmc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
bmc_tree = proto_item_add_subtree(ti, ett_bmc);
/* Needs bit-reversing. Create a new buffer, copy the message to it and bit-reverse */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
reversing_buffer = (guint8 *)tvb_memdup(NULL, tvb, offset, len);
bitswap_buf_inplace(reversing_buffer, len);
@@ -151,7 +151,7 @@ dissect_bmc_cbs_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
cell_broadcast_tvb = tvb_new_subset_remaining(tvb, offset);
dissect_umts_cell_broadcast_message(cell_broadcast_tvb, pinfo, tree);
- offset = tvb_length(cell_broadcast_tvb);
+ offset = tvb_captured_length(cell_broadcast_tvb);
return offset;
}
@@ -213,7 +213,7 @@ dissect_bmc_schedule_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
}
proto_item_set_len(ti, offset-saved_offset);
- if (tvb_length_remaining(tvb,offset)) {
+ if (tvb_captured_length_remaining(tvb,offset)) {
future_extension_bitmap = tvb_get_guint8(tvb,offset);
proto_tree_add_item(tree, hf_bmc_future_extension_bitmap, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -243,8 +243,8 @@ dissect_bmc_cbs41_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
proto_tree_add_item(tree, hf_bmc_broadcast_address, tvb, offset, 5, ENC_NA);
offset += 5;
- proto_tree_add_item(tree, hf_bmc_cb_data41, tvb, offset, tvb_length_remaining(tvb,offset), ENC_NA);
- offset = tvb_length(tvb);
+ proto_tree_add_item(tree, hf_bmc_cb_data41, tvb, offset, tvb_captured_length_remaining(tvb,offset), ENC_NA);
+ offset = tvb_captured_length(tvb);
return offset;
}
diff --git a/epan/dissectors/packet-bofl.c b/epan/dissectors/packet-bofl.c
index 9eb9308e6d..b905d64de1 100644
--- a/epan/dissectors/packet-bofl.c
+++ b/epan/dissectors/packet-bofl.c
@@ -89,7 +89,7 @@ dissect_bofl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
proto_tree_add_uint(bofl_tree, hf_bofl_sequence, tvb, 4, 4, sequence);
- len = tvb_length_remaining(tvb, 8);
+ len = tvb_captured_length_remaining(tvb, 8);
if (len > 0)
proto_tree_add_text(bofl_tree, tvb, 8, len,
"Padding (%d byte)", len);
diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c
index ca3cf52c83..362b2556ef 100644
--- a/epan/dissectors/packet-bootp.c
+++ b/epan/dissectors/packet-bootp.c
@@ -2301,9 +2301,9 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
unsigned int offset = 0;
tvb_composite_finalize(rfc3396_dns_domain_search_list.tvb_composite);
- while (offset < tvb_length(rfc3396_dns_domain_search_list.tvb_composite)) {
+ while (offset < tvb_captured_length(rfc3396_dns_domain_search_list.tvb_composite)) {
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
- consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, offset, tvb_length(rfc3396_dns_domain_search_list.tvb_composite), 0, &dns_name);
+ consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, offset, tvb_captured_length(rfc3396_dns_domain_search_list.tvb_composite), 0, &dns_name);
if (rfc3396_dns_domain_search_list.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
proto_tree_add_string(v_tree, hf_bootp_option_dhcp_dns_domain_search_list_fqdn, tvb, optoff + offset, consumedx, dns_name);
@@ -2360,14 +2360,14 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
switch (enc) {
case RFC_3361_ENC_FQDN: {
unsigned int consumedx = 0;
- if (tvb_length(rfc3396_sip_server.tvb_composite) < 3) {
- expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 3 (len = %u)", tvb_length(rfc3396_sip_server.tvb_composite));
+ if (tvb_captured_length(rfc3396_sip_server.tvb_composite) < 3) {
+ expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 3 (len = %u)", tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
- while (offset < tvb_length(rfc3396_sip_server.tvb_composite)) {
+ while (offset < tvb_captured_length(rfc3396_sip_server.tvb_composite)) {
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
- consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, offset, tvb_length(rfc3396_sip_server.tvb_composite), 1 /* ignore enc */, &dns_name);
+ consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, offset, tvb_captured_length(rfc3396_sip_server.tvb_composite), 1 /* ignore enc */, &dns_name);
if (rfc3396_sip_server.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
@@ -2382,21 +2382,21 @@ bootp_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree, proto_item
break;
}
case RFC_3361_ENC_IPADDR:
- if (tvb_length(rfc3396_sip_server.tvb_composite) < 5) {
- expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 5 (len = %u)", tvb_length(rfc3396_sip_server.tvb_composite));
+ if (tvb_captured_length(rfc3396_sip_server.tvb_composite) < 5) {
+ expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't >= 5 (len = %u)", tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
/* x % 2^n == x & (2^n - 1) note : (assuming x is a positive integer) */
- if ((tvb_length(rfc3396_sip_server.tvb_composite) - 1) & 3) {
+ if ((tvb_captured_length(rfc3396_sip_server.tvb_composite) - 1) & 3) {
if (rfc3396_sip_server.total_number_of_block == 1)
- expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", tvb_length(rfc3396_sip_server.tvb_composite));
+ expert_add_info_format(pinfo, vti, &ei_bootp_bad_length, "length isn't a multiple of 4 plus 1 (len = %u).", tvb_captured_length(rfc3396_sip_server.tvb_composite));
else
expert_add_info_format(pinfo, vti, &ei_bootp_bad_length,
"length isn't a multiple of 4 plus 1 (len = %u). For your information with RFC 3396, the length is the length sum of all options 120 into this BOOTP packet.",
- tvb_length(rfc3396_sip_server.tvb_composite));
+ tvb_captured_length(rfc3396_sip_server.tvb_composite));
break;
}
- while (offset < tvb_length(rfc3396_sip_server.tvb_composite)) {
+ while (offset < tvb_captured_length(rfc3396_sip_server.tvb_composite)) {
if (rfc3396_sip_server.total_number_of_block == 1) {
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
proto_tree_add_item(v_tree, hf_bootp_option_sip_server_address, rfc3396_sip_server.tvb_composite, offset, 4, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-brdwlk.c b/epan/dissectors/packet-brdwlk.c
index e0c67da969..a4d39b287c 100644
--- a/epan/dissectors/packet-brdwlk.c
+++ b/epan/dissectors/packet-brdwlk.c
@@ -248,7 +248,7 @@ dissect_brdwlk(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Locate EOF which is the last 4 bytes of the frame */
- len = tvb_length_remaining(tvb, hdrlen);
+ len = tvb_captured_length_remaining(tvb, hdrlen);
reported_len = tvb_reported_length_remaining(tvb, hdrlen);
if (reported_len < 4) {
/*
diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c
index e309bf7ff3..870c72b190 100644
--- a/epan/dissectors/packet-bssap.c
+++ b/epan/dissectors/packet-bssap.c
@@ -371,7 +371,7 @@ dissect_bssap_unknown_message(tvbuff_t *message_tvb, proto_tree *bssap_tree)
{
guint32 message_length;
- message_length = tvb_length(message_tvb);
+ message_length = tvb_captured_length(message_tvb);
proto_tree_add_text(bssap_tree, message_tvb, 0, message_length,
"Unknown message (%u byte%s)",
@@ -639,7 +639,7 @@ unpack_digits(tvbuff_t *tvb, int offset, dgt_set_t *dgt, gboolean skip_first)
int i = 0;
char *digit_str;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length < offset)
return "";
digit_str = (char *)wmem_alloc(wmem_packet_scope(), (length - offset)*2+1);
@@ -1663,37 +1663,37 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
/* End of mandatory elements */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI TMSI 18.4.23 O TLV 6 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI))
offset = dissect_bssap_tmsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location area identifier Location area identifier 18.4.14 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Channel needed Channel needed 18.4.2 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_CHANNEL_NEEDED))
offset = dissect_bssap_channel_needed(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* eMLPP Priority eMLPP Priority 18.4.4 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_EMLPP_PRIORITY))
offset = dissect_bssap_emlpp_priority(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Global CN-Id Global CN-Id 18.4.27 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_GLOBAL_CN_ID))
offset = dissect_bssap_global_cn_id(tvb, pinfo, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
@@ -1706,7 +1706,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1723,7 +1723,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_DLINK_TNL_PLD_CTR_AND_INF))
offset = dissect_bssap_dlink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1736,7 +1736,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_ULINK_TNL_PLD_CTR_AND_INF))
offset = dissect_bssap_ulink_tunnel_payload_control_and_info(tvb, pinfo, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1760,31 +1760,31 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Mobile station classmark Mobile station classmark 1 18.4.18 M TLV 3 */
if (check_ie(tvb, tree, &offset, BSSAP_MOBILE_STN_CLS_MRK1))
offset = dissect_bssap_mobile_stn_cls_mrk1(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Old location area identifier Location area identifier 18.4.14 O TLV 7 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI status TMSI status 18.4.24 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI_STATUS))
offset = dissect_bssap_tmsi_status(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* New service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEISV IMEISV 18.4.9 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_IMEISV))
offset = dissect_bssap_imesiv(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1797,13 +1797,13 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_LOC_AREA_ID))
offset = dissect_bssap_loc_area_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* New TMSI, or IMSI Mobile identity 18.4.17 O TLV 6-10 */
if (check_optional_ie(tvb, offset, BSSAP_MOBILE_ID))
offset = dissect_bssap_mobile_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1814,7 +1814,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Reject cause Reject cause 18.4.21 M TLV 3 */
if (check_ie(tvb, tree, &offset, BSSAP_REJECT_CAUSE))
offset = dissect_bssap_reject_cause(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1823,20 +1823,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1845,7 +1845,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1854,7 +1854,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1867,7 +1867,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1876,20 +1876,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1906,20 +1906,20 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_GPRS_SERV_TYPE))
offset = dissect_bssap_imsi_det_from_gprs_serv_type(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1928,7 +1928,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1945,27 +1945,27 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI_DET_FROM_NON_GPRS_SERV_TYPE))
offset = dissect_bssap_imsi_det_from_non_gprs_serv_type(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location information age Location information age 18.4.14 O TLV 4 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_INF_AGE))
offset = dissect_bssap_location_information_age(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1974,7 +1974,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -1983,14 +1983,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* SGSN number SGSN number 18.4.22 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_SGSN_NUMBER)) {
offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}else{
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)) {
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}
@@ -2002,14 +2002,14 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* SGSN number SGSN number 18.4.22 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_SGSN_NUMBER)) {
offset = dissect_bssap_sgsn_number(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}else{
/* VLR number VLR number 18.4.26 C TLV 5-11 */
if (check_optional_ie(tvb, offset, BSSAP_VLR_NUMBER)) {
offset = dissect_bssap_vlr_number(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
}
@@ -2025,7 +2025,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_INFO_REQ))
offset = dissect_bssap_info_req(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
@@ -2034,56 +2034,56 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* IMSI IMSI 18.4.10 M TLV 6-10 */
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* TMSI TMSI 18.4.23 O TLV 6 */
if (check_optional_ie(tvb, offset, BSSAP_TMSI))
offset = dissect_bssap_tmsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* PTMSI PTMSI 18.4.20 O TLV 6 BSSAP_PTMSI*/
if (check_optional_ie(tvb, offset, BSSAP_PTMSI))
offset = dissect_bssap_ptmsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEI IMEI 18.4.8 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_IMEI))
offset = dissect_bssap_imei(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* IMEISV IMEISV 18.4.9 O TLV 10 BSSAP_IMEISV*/
if (check_optional_ie(tvb, offset, BSSAP_IMEISV))
offset = dissect_bssap_imesiv(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Cell global identity Cell global identity 18.4.1 O TLV 10 */
if (check_optional_ie(tvb, offset, BSSAP_CELL_GBL_ID))
offset = dissect_bssap_cell_global_id(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Location information age Location information age 18.4.15 O TLV 4 */
if (check_optional_ie(tvb, offset, BSSAP_LOC_INF_AGE))
offset = dissect_bssap_location_information_age(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Mobile station state Mobile station state 18.4.19 O TLV 3 */
if (check_optional_ie(tvb, offset, BSSAP_MOBILE_STN_STATE))
offset = dissect_bssap_mobile_station_state(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Service area identification Service area identification 18.4.21b O TLV 9 */
if (check_optional_ie(tvb, offset, BSSAP_SERVICE_AREA_ID))
offset = dissect_bssap_service_area_id(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -2092,12 +2092,12 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_IMSI))
offset = dissect_bssap_imsi(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* MM information MM information 18.4.16 O TLV 3-n */
if (check_optional_ie(tvb, offset, BSSAP_MM_INFORMATION))
offset = dissect_bssap_MM_information(tvb, bssap_tree, pinfo, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -2113,7 +2113,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_ERRONEOUS_MSG))
offset = dissect_bssap_gprs_erroneous_msg(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -2126,7 +2126,7 @@ static void dissect_bssap_plus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_ie(tvb, tree, &offset, BSSAP_GS_CAUSE))
offset = dissect_bssap_Gs_cause(tvb, bssap_tree, offset);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
proto_tree_add_text(tree, tvb, offset, -1, "Extraneous data");
break;
@@ -2149,7 +2149,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
switch (tvb_get_guint8(tvb, 0))
{
case 0x00:
- if (tvb_get_guint8(tvb, 1) != (tvb_length(tvb) - 2)) {
+ if (tvb_get_guint8(tvb, 1) != (tvb_captured_length(tvb) - 2)) {
return(FALSE);
}
if (tvb_get_guint8(tvb, 2) == 0x40 && tvb_get_guint8(tvb, 3) != 0x01) {
@@ -2158,7 +2158,7 @@ dissect_bssap_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
break;
case 0x01:
- if (tvb_get_guint8(tvb, 2) != (tvb_length(tvb) - 3)) {
+ if (tvb_get_guint8(tvb, 2) != (tvb_captured_length(tvb) - 3)) {
return(FALSE);
}
break;
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
index 9483e2d684..ea19da39fa 100644
--- a/epan/dissectors/packet-bssgp.c
+++ b/epan/dissectors/packet-bssgp.c
@@ -6399,7 +6399,7 @@ dissect_bssgp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Save pinfo */
g_rim_application_identity = 0;
gparent_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BSSGP");
diff --git a/epan/dissectors/packet-bt-dht.c b/epan/dissectors/packet-bt-dht.c
index e8599d916e..0269d36ebf 100644
--- a/epan/dissectors/packet-bt-dht.c
+++ b/epan/dissectors/packet-bt-dht.c
@@ -478,7 +478,7 @@ gboolean dissect_bt_dht_heur (tvbuff_t *tvb, packet_info *pinfo,
/* try dissecting */
/* Assume dictionary (d) is followed by a one char long (1:) key string. */
- if(tvb_length(tvb) < 4)
+ if(tvb_captured_length(tvb) < 4)
return FALSE;
if(tvb_memeql(tvb, 0, "d1:", 3) != 0)
diff --git a/epan/dissectors/packet-bt-utp.c b/epan/dissectors/packet-bt-utp.c
index ffda931e5a..644140db66 100644
--- a/epan/dissectors/packet-bt-utp.c
+++ b/epan/dissectors/packet-bt-utp.c
@@ -161,7 +161,7 @@ get_utp_version(tvbuff_t *tvb) {
/* Simple heuristics inspired by code from utp.cpp */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* Version 1? */
if (len < V1_FIXED_HDR_SIZE) {
@@ -357,7 +357,7 @@ dissect_bt_utp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
offset = dissect_utp_extension(tvb, pinfo, sub_tree, offset, &extension_type);
- len_tvb = tvb_length_remaining(tvb, offset);
+ len_tvb = tvb_captured_length_remaining(tvb, offset);
if(len_tvb > 0)
proto_tree_add_item(sub_tree, hf_bt_utp_data, tvb, offset, len_tvb, ENC_NA);
diff --git a/epan/dissectors/packet-bt3ds.c b/epan/dissectors/packet-bt3ds.c
index b82108bf95..21b90585a9 100644
--- a/epan/dissectors/packet-bt3ds.c
+++ b/epan/dissectors/packet-bt3ds.c
@@ -108,9 +108,9 @@ dissect_bt3ds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset += 1;
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(main_tree, pinfo, &ei_unexpected_data, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
return offset;
diff --git a/epan/dissectors/packet-btatt.c b/epan/dissectors/packet-btatt.c
index b2f3101d8b..11b6ef0418 100644
--- a/epan/dissectors/packet-btatt.c
+++ b/epan/dissectors/packet-btatt.c
@@ -151,7 +151,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree *st, *ltree;
guint8 opcode;
- if (tvb_length_remaining(tvb, 0) < 1)
+ if (tvb_captured_length_remaining(tvb, 0) < 1)
return 0;
ti = proto_tree_add_item(tree, proto_btatt, tvb, 0, -1, ENC_NA);
@@ -220,7 +220,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset++;
if( format == 1 ) {
- while( tvb_length_remaining(tvb, offset) > 0) {
+ while( tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(st, hf_btatt_uuid16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
@@ -228,7 +228,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
}
}
else if( format == 2 ) {
- while( tvb_length_remaining(tvb, offset) > 0) {
+ while( tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(st, hf_btatt_uuid128, tvb, offset, 16, ENC_NA);
@@ -257,7 +257,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case 0x07: /* Find By Type Value Response */
- while( tvb_length_remaining(tvb, offset) > 0 ) {
+ while( tvb_captured_length_remaining(tvb, offset) > 0 ) {
item = proto_tree_add_none_format(st, hf_btatt_handles_info, tvb, offset, 4,
"Handles Info, Handle: 0x%04x, Group End Handle: 0x%04x",
tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2));
@@ -282,11 +282,11 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_tree_add_item(st, hf_btatt_ending_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) == 2) {
+ if (tvb_captured_length_remaining(tvb, offset) == 2) {
proto_tree_add_item(st, hf_btatt_uuid16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
}
- else if (tvb_length_remaining(tvb, offset) == 16) {
+ else if (tvb_captured_length_remaining(tvb, offset) == 16) {
item = proto_tree_add_item(st, hf_btatt_uuid128, tvb, offset, 16, ENC_NA);
proto_item_append_text(item, " (%s)", val_to_str_ext_const(tvb_get_letohs(tvb, offset),
&bt_sig_uuid_vals_ext, "<unknown>"));
@@ -303,9 +303,9 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
if(length > 0) {
col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u",
- tvb_length_remaining(tvb, offset)/length);
+ tvb_captured_length_remaining(tvb, offset)/length);
- while (tvb_length_remaining(tvb, offset) >= length)
+ while (tvb_captured_length_remaining(tvb, offset) >= length)
{
item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb,
offset, length, "Attribute Data, Handle: 0x%04x",
@@ -345,13 +345,13 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
case 0x0e: /* Multiple Read Request */
- if(tvb_length_remaining(tvb, offset) < 4) {
+ if(tvb_captured_length_remaining(tvb, offset) < 4) {
expert_add_info(pinfo, item, &ei_btatt_handle_too_few);
break;
}
col_append_str(pinfo->cinfo, COL_INFO, ", Handles: ");
- while (tvb_length_remaining(tvb, offset) >= 2) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 2) {
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO, "0x%04x ", tvb_get_letohs(tvb, offset));
offset += 2;
@@ -366,9 +366,9 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
offset++;
if(length > 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u", tvb_length_remaining(tvb, offset)/length);
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Attribute List Length: %u", tvb_captured_length_remaining(tvb, offset)/length);
- while (tvb_length_remaining(tvb, offset) >= length) {
+ while (tvb_captured_length_remaining(tvb, offset) >= length) {
item = proto_tree_add_none_format(st, hf_btatt_attribute_data, tvb, offset, length,
"Attribute Data, Handle: 0x%04x, Group End Handle: 0x%04x",
tvb_get_letohs(tvb, offset), tvb_get_letohs(tvb, offset+2));
@@ -423,7 +423,7 @@ dissect_btatt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_append_fstr(pinfo->cinfo, COL_INFO, ", Handle: 0x%04x", tvb_get_letohs(tvb, offset));
proto_tree_add_item(st, hf_btatt_handle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length > 12) {
proto_tree_add_item(st, hf_btatt_value, tvb, offset, length-12, ENC_NA);
offset+=length-12;
diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c
index 13097c8a28..9d801bbf27 100644
--- a/epan/dissectors/packet-btavdtp.c
+++ b/epan/dissectors/packet-btavdtp.c
@@ -637,8 +637,8 @@ dissect_sep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset,
when SEP is provided in ACP role, otherwise INT frequently asking for it
*/
direction = (pinfo->p2p_dir == P2P_DIR_SENT) ? P2P_DIR_RECV : P2P_DIR_SENT;
- items = tvb_length_remaining(tvb, offset) / 2;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ items = tvb_captured_length_remaining(tvb, offset) / 2;
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
seid = tvb_get_guint8(tvb, offset);
in_use = seid & 0x02;
seid = seid >> 2;
@@ -995,7 +995,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
gint media_type = 0;
gint media_codec_type = 0;
- capabilities_item = proto_tree_add_item(tree, hf_btavdtp_capabilities, tvb, offset, tvb_length(tvb) - offset, ENC_NA);
+ capabilities_item = proto_tree_add_item(tree, hf_btavdtp_capabilities, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
capabilities_tree = proto_item_add_subtree(capabilities_item, ett_btavdtp_capabilities);
if (codec)
@@ -1007,7 +1007,7 @@ dissect_capabilities(tvbuff_t *tvb, packet_info *pinfo,
if (vendor_codec)
*vendor_codec = 0;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
service_category = tvb_get_guint8(tvb, offset);
losc = tvb_get_guint8(tvb, offset + 1);
service_item = proto_tree_add_none_format(capabilities_tree, hf_btavdtp_service, tvb, offset, 2 + losc, "Service: %s", val_to_str_const(service_category, service_category_vals, "RFD"));
@@ -1457,7 +1457,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} else if (!(l2cap_data->local_cid == channels_info->control_local_cid &&
l2cap_data->remote_cid == channels_info->control_remote_cid)) {
/* Unknown Stream Channel */
@@ -1466,7 +1466,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown channel stream on cid=0x%04x", l2cap_data->cid);
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Signaling Channel */
@@ -1701,7 +1701,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case SIGNAL_ID_START:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset,
SEID_ACP, i_sep, NULL,
interface_id, adapter_id, chandle, frame_number);
@@ -1774,7 +1774,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case SIGNAL_ID_SUSPEND:
if (message_type == MESSAGE_TYPE_COMMAND) {
i_sep = 1;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
offset = dissect_seid(tvb, pinfo, btavdtp_tree, offset,
SEID_ACP, i_sep, NULL,
interface_id, adapter_id, chandle, frame_number);
@@ -1814,7 +1814,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
SEID_ACP, 0, NULL, interface_id,
adapter_id, chandle, frame_number);
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
if (message_type == MESSAGE_TYPE_REJECT) {
@@ -1824,7 +1824,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case SIGNAL_ID_DELAY_REPORT:
if (message_type == MESSAGE_TYPE_COMMAND) {
@@ -1849,7 +1849,7 @@ dissect_btavdtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
LABEL_data:
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(btavdtp_tree, hf_btavdtp_data, tvb, offset, -1, ENC_NA);
}
@@ -2840,7 +2840,7 @@ dissect_bta2dp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
bluetooth_add_address(pinfo, &pinfo->net_dst, sep_data.stream_number, "BT A2DP", pinfo->fd->num, FALSE, &bta2dp_codec_info);
call_dissector(rtp_handle, tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -3021,7 +3021,7 @@ dissect_btvdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
bluetooth_add_address(pinfo, &pinfo->net_dst, 0, "BT VDP", pinfo->fd->num, TRUE, &btvdp_codec_info);
call_dissector(rtp_handle, tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c
index ea31ff4887..eac12dca63 100644
--- a/epan/dissectors/packet-btavrcp.c
+++ b/epan/dissectors/packet-btavrcp.c
@@ -1036,7 +1036,7 @@ dissect_vendor_dependant(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(tree, hf_btavrcp_bt_pdu_id, tvb, offset, 1, ENC_BIG_ENDIAN);
} else {
- if (tvb_length_remaining(tvb, offset) == 0) {
+ if (tvb_captured_length_remaining(tvb, offset) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, " - No PDU ID");
return offset;
}
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index d5de57d57d..5f9148694e 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -2185,7 +2185,7 @@ dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset++;
proto_tree_add_item(tree, hf_bthci_cmd_dedicated_amp_key, tvb, offset, -1, ENC_NA);
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
break;
case 0x0037: /* Disconnect Physical Link */
@@ -2237,7 +2237,7 @@ dissect_link_control_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
case 0x0044: /* Receive Synchronization Train */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@@ -2975,7 +2975,7 @@ dissect_host_controller_baseband_cmd(tvbuff_t *tvb, int offset, packet_info *pin
case 0x078: /* Write Synchronization Train Parameters */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@@ -3051,7 +3051,7 @@ dissect_status_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
proto_tree_add_item(tree, hf_bthci_cmd_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset+=2;
proto_tree_add_item(tree, hf_bthci_cmd_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
- offset+=tvb_length_remaining(tvb, offset);
+ offset+=tvb_captured_length_remaining(tvb, offset);
break;
case 0x00D: /* Set Triggered Clock Capture */
@@ -3061,7 +3061,7 @@ dissect_status_parameters_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
case 0x00C: /* Get MWS Transport Layer Configuration */
/* TODO: Implement above cases */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@@ -3099,7 +3099,7 @@ dissect_testing_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre
case 0x009: /* AMP Test */
/* TODO: Implement above case */
proto_tree_add_expert(tree, pinfo, &ei_command_undecoded, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@@ -3435,14 +3435,14 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
default:
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_unknown, tvb, 3, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_parameter_unexpected, tvb, offset, -1);
- /*offset += tvb_length_remaining(tvb, offset);*/
+ /*offset += tvb_captured_length_remaining(tvb, offset);*/
}
return offset;
@@ -4952,7 +4952,7 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint end_offset;
guint i_uuid;
- data_size = tvb_length(tvb);
+ data_size = tvb_captured_length(tvb);
while (offset < data_size) {
length = tvb_get_guint8(tvb, offset);
@@ -5245,9 +5245,9 @@ dissect_eir_ad_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_tree_add_item(tree, hf_btcommon_eir_ad_unused, tvb, offset, -1, ENC_NA);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
return offset + data_size;
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c
index 8faee73fa8..00389c3626 100644
--- a/epan/dissectors/packet-bthci_evt.c
+++ b/epan/dissectors/packet-bthci_evt.c
@@ -1398,7 +1398,7 @@ dissect_bthci_evt_loopback_command(tvbuff_t *tvb, int offset,
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_with_data(bthci_cmd_handle, next_tvb, pinfo, tree, hci_data);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -2821,7 +2821,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
proto_tree_add_item(tree, hf_bthci_evt_amp_remaining_assoc_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_bthci_evt_amp_assoc_fragment, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case 0x140b: /* Write Remote AMP Assoc */
@@ -2976,7 +2976,7 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset,
default:
proto_tree_add_item(tree, hf_bthci_evt_ret_params, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
@@ -3640,12 +3640,12 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
case 0xff: /* Vendor-Specific */
/* TODO: Implement above cases */
proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_undecoded, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
default:
proto_tree_add_expert(bthci_evt_tree, pinfo, &ei_event_unknown, tvb, offset, -1);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
}
diff --git a/epan/dissectors/packet-bthci_sco.c b/epan/dissectors/packet-bthci_sco.c
index 8e9d57e96d..347f3345c1 100644
--- a/epan/dissectors/packet-bthci_sco.c
+++ b/epan/dissectors/packet-bthci_sco.c
@@ -227,7 +227,7 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void
proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_data, tvb, offset, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-bthcrp.c b/epan/dissectors/packet-bthcrp.c
index 682a683f98..5d6fc757c0 100644
--- a/epan/dissectors/packet-bthcrp.c
+++ b/epan/dissectors/packet-bthcrp.c
@@ -163,10 +163,10 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
"Parameter length is shorter than 2 in response");
}
- if (parameter_length < tvb_length_remaining(tvb, offset)) {
+ if (parameter_length < tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_bthcrp_control_parameter_length,
"Parameter length is shorter than payload length");
- } else if (parameter_length > tvb_length_remaining(tvb, offset)) {
+ } else if (parameter_length > tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_bthcrp_control_parameter_length,
"Parameter length is larger than payload length");
}
@@ -177,9 +177,9 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
if (control_pdu_id >= 0x8000) {
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
} else switch(control_pdu_id) {
case 0x0001: /* CR_DataChannelCreditGrant */
@@ -249,9 +249,9 @@ dissect_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 *id;
proto_tree_add_item(tree, hf_bthcrp_control_1284_id, tvb, offset, -1, ENC_ASCII | ENC_NA);
- id = tvb_get_string_enc(NULL, tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
+ id = tvb_get_string_enc(NULL, tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
col_append_fstr(pinfo->cinfo, COL_INFO, " - 1284 ID: %s", id);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
case 0x0007: /* CR_SoftReset */
@@ -310,7 +310,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint offset)
next_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector(data_handle, next_tvb, pinfo, tree);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
return offset;
}
@@ -338,9 +338,9 @@ dissect_notification(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (notification_pdu_id >= 0x8000) {
proto_item_append_text(pitem, " (Vendor Specific)");
col_append_str(pinfo->cinfo, COL_INFO, " (Vendor Specific)");
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
} else if (notification_pdu_id != 0x001) {
proto_item_append_text(pitem, " (Reserved)");
@@ -494,7 +494,7 @@ dissect_bthcrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
col_append_fstr(pinfo->cinfo, COL_INFO, "HCRP stream (CID: 0x%04X)", l2cap_data->cid);
}
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_item *pitem;
pitem = proto_tree_add_item(main_tree, hf_bthcrp_data, tvb, offset, -1, ENC_NA);
diff --git a/epan/dissectors/packet-bthfp.c b/epan/dissectors/packet-bthfp.c
index b66f4d10d8..7375ef6057 100644
--- a/epan/dissectors/packet-bthfp.c
+++ b/epan/dissectors/packet-bthfp.c
@@ -885,9 +885,9 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean quotation;
gboolean next;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length <= 0)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
if (!command_number) {
proto_tree_add_item(tree, hf_data, tvb, offset, length, ENC_NA | ENC_ASCII);
@@ -1120,7 +1120,7 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
i_char += i_char_fix;
proto_item_set_len(command_item, i_char);
} else {
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 0)
length = 0;
proto_item_set_len(command_item, length);
@@ -1268,9 +1268,9 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (role == ROLE_UNKNOWN) {
col_append_fstr(pinfo->cinfo, COL_INFO, "Data: %s",
- tvb_format_text(tvb, 0, tvb_length(tvb)));
+ tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
proto_tree_add_item(main_tree, hf_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* save fragments */
@@ -1337,7 +1337,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
fragment->role = role;
fragment->index = previous_fragment ? previous_fragment->index + previous_fragment->length : 0;
fragment->reassemble_state = REASSEMBLE_FRAGMENT;
- fragment->length = tvb_length(tvb);
+ fragment->length = tvb_captured_length(tvb);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
fragment->previous_fragment = previous_fragment;
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
@@ -1345,7 +1345,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
wmem_tree_insert32_array(fragments, key, fragment);
/* Detect reassemble end character: \r for HS or \n for AG */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
at_stream = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, length, ENC_ASCII);
reassemble_start_offset = 0;
@@ -1494,7 +1494,7 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (fragment->index > 0 && fragment->length > 0) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
reassembled_tvb = tvb_new_child_real_data(tvb, at_data,
fragment->index + fragment->length, fragment->index + fragment->length);
add_new_data_source(pinfo, reassembled_tvb, "Reassembled HFP");
@@ -1504,24 +1504,24 @@ dissect_bthfp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (reassembled_tvb) {
guint reassembled_offset = 0;
- while (tvb_length(reassembled_tvb) > reassembled_offset) {
+ while (tvb_captured_length(reassembled_tvb) > reassembled_offset) {
reassembled_offset = dissect_at_command(reassembled_tvb,
pinfo, main_tree, reassembled_offset, role, command_number);
command_number += 1;
}
} else {
- while (tvb_length(tvb) > (guint) offset) {
+ while (tvb_captured_length(tvb) > (guint) offset) {
offset = dissect_at_command(tvb, pinfo, main_tree, offset, role, command_number);
command_number += 1;
}
}
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s",
- tvb_format_text_wsp(tvb, offset, tvb_length_remaining(tvb, offset)));
+ tvb_format_text_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
pitem = proto_tree_add_item(main_tree, hf_fragmented, tvb, 0, 0, ENC_NA);
PROTO_ITEM_SET_GENERATED(pitem);
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
}
return offset;
diff --git a/epan/dissectors/packet-bthid.c b/epan/dissectors/packet-bthid.c
index c888237726..5b3b59e3df 100644
--- a/epan/dissectors/packet-bthid.c
+++ b/epan/dissectors/packet-bthid.c
@@ -663,20 +663,20 @@ dissect_hid_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += 1;
/* not really in HID Specification */
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data_mouse_horizontal_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
/* not really in HID Specification */
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data_mouse_vertical_scroll_wheel, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
proto_tree_add_item(tree, hf_bthid_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
break;
}
@@ -751,8 +751,8 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
Global Items are declared in the report descriptor, and in
Boot Protocol Mode. Otherwise the field does not exist."
*/
- if (((parameter >> 3) && tvb_length_remaining(tvb, offset) >= 3) ||
- (!(parameter >> 3) && tvb_length_remaining(tvb, offset) >= 1)) {
+ if (((parameter >> 3) && tvb_captured_length_remaining(tvb, offset) >= 3) ||
+ (!(parameter >> 3) && tvb_captured_length_remaining(tvb, offset) >= 1)) {
proto_tree_add_item(bthid_tree, hf_bthid_report_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
}
@@ -772,7 +772,7 @@ dissect_bthid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
/* playload */
proto_tree_add_item(bthid_tree, hf_bthid_data, tvb, offset, -1, ENC_NA);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case 0x06: /* GET_PROTOCOL */
proto_tree_add_item(bthid_tree, hf_bthid_parameter_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
diff --git a/epan/dissectors/packet-bthsp.c b/epan/dissectors/packet-bthsp.c
index 8c3dd201df..2bf7e063df 100644
--- a/epan/dissectors/packet-bthsp.c
+++ b/epan/dissectors/packet-bthsp.c
@@ -300,9 +300,9 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean next;
void *data;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length <= 0)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
if (!command_number) {
proto_tree_add_item(tree, hf_data, tvb, offset, length, ENC_NA | ENC_ASCII);
@@ -601,7 +601,7 @@ dissect_at_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
i_char += i_char_fix;
proto_item_set_len(command_item, i_char);
} else {
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 0)
length = 0;
proto_item_set_len(command_item, length);
@@ -767,9 +767,9 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (role == ROLE_UNKNOWN) {
col_append_fstr(pinfo->cinfo, COL_INFO, "Data: %s",
- tvb_format_text(tvb, 0, tvb_length(tvb)));
+ tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
proto_tree_add_item(main_tree, hf_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* save fragments */
@@ -836,7 +836,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
fragment->role = role;
fragment->index = previous_fragment ? previous_fragment->index + previous_fragment->length : 0;
fragment->reassemble_state = REASSEMBLE_FRAGMENT;
- fragment->length = tvb_length(tvb);
+ fragment->length = tvb_captured_length(tvb);
fragment->data = (guint8 *) wmem_alloc(wmem_file_scope(), fragment->length);
fragment->previous_fragment = previous_fragment;
tvb_memcpy(tvb, fragment->data, offset, fragment->length);
@@ -844,7 +844,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
wmem_tree_insert32_array(fragments, key, fragment);
/* Detect reassemble end character: \r for HS or \n for AG */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
at_stream = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, length, ENC_ASCII);
reassemble_start_offset = 0;
@@ -993,7 +993,7 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (fragment->index > 0 && fragment->length > 0) {
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
reassembled_tvb = tvb_new_child_real_data(tvb, at_data,
fragment->index + fragment->length, fragment->index + fragment->length);
add_new_data_source(pinfo, reassembled_tvb, "Reassembled HSP");
@@ -1003,24 +1003,24 @@ dissect_bthsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
if (reassembled_tvb) {
guint reassembled_offset = 0;
- while (tvb_length(reassembled_tvb) > reassembled_offset) {
+ while (tvb_captured_length(reassembled_tvb) > reassembled_offset) {
reassembled_offset = dissect_at_command(reassembled_tvb,
pinfo, main_tree, reassembled_offset, role, command_number);
command_number += 1;
}
} else {
- while (tvb_length(tvb) > (guint) offset) {
+ while (tvb_captured_length(tvb) > (guint) offset) {
offset = dissect_at_command(tvb, pinfo, main_tree, offset, role, command_number);
command_number += 1;
}
}
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "Fragment: %s",
- tvb_format_text_wsp(tvb, offset, tvb_length_remaining(tvb, offset)));
+ tvb_format_text_wsp(tvb, offset, tvb_captured_length_remaining(tvb, offset)));
pitem = proto_tree_add_item(main_tree, hf_fragmented, tvb, 0, 0, ENC_NA);
PROTO_ITEM_SET_GENERATED(pitem);
proto_tree_add_item(main_tree, hf_fragment, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_ASCII | ENC_NA);
}
return offset;
diff --git a/epan/dissectors/packet-btl2cap.c b/epan/dissectors/packet-btl2cap.c
index f3895c35eb..54549f2b7f 100644
--- a/epan/dissectors/packet-btl2cap.c
+++ b/epan/dissectors/packet-btl2cap.c
@@ -1453,7 +1453,7 @@ dissect_b_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
tvbuff_t *next_tvb;
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
col_append_str(pinfo->cinfo, COL_INFO, "Connection oriented channel");
@@ -1629,7 +1629,7 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
/*pass up to higher layer if we have a complete packet*/
if (segment == 0x00) {
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset) - 2, length);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 2, length);
}
if (next_tvb) {
if (psm) {
@@ -1671,15 +1671,15 @@ dissect_i_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* not a known fixed PSM, try to find a registered service to a dynamic PSM */
if (!dissector_try_uint_new(l2cap_service_dissector_table, uuid, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
/* unknown protocol. declare as data */
- proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_length(next_tvb), ENC_NA);
+ proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_captured_length(next_tvb), ENC_NA);
}
}
}
else {
- proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_length(next_tvb), ENC_NA);
+ proto_tree_add_item(btl2cap_tree, hf_btl2cap_payload, next_tvb, 0, tvb_captured_length(next_tvb), ENC_NA);
}
}
- offset += (tvb_length_remaining(tvb, offset) - 2);
+ offset += (tvb_captured_length_remaining(tvb, offset) - 2);
proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
return offset;
@@ -1984,7 +1984,7 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(btl2cap_tree, hf_btl2cap_psm, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
/* call next dissector */
if (!dissector_try_uint_new(l2cap_psm_dissector_table, (guint32) psm, next_tvb, pinfo, tree, TRUE, l2cap_data)) {
@@ -2031,13 +2031,13 @@ dissect_btl2cap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
proto_tree_add_item(ti_control_subtree, hf_btl2cap_control_txseq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(ti_control_subtree, hf_btl2cap_control_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
- proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, tvb_length(tvb)-2, 2, ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(btl2cap_tree, hf_btl2cap_fcs, tvb, tvb_captured_length(tvb)-2, 2, ENC_LITTLE_ENDIAN);
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset)-2, length);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset)-2, length);
}
}
else {
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), length);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), length);
}
/* call next dissector */
if (next_tvb && !dissector_try_uint_new(l2cap_cid_dissector_table, (guint32) cid,
diff --git a/epan/dissectors/packet-btle.c b/epan/dissectors/packet-btle.c
index 0fc82e1b1d..5dee70cfdb 100644
--- a/epan/dissectors/packet-btle.c
+++ b/epan/dissectors/packet-btle.c
@@ -407,12 +407,12 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x06: /* ADV_SCAN_IND */
offset = dissect_bd_addr(hf_advertising_address, btle_tree, tvb, offset);
- if (tvb_length_remaining(tvb, offset) > 3) {
- next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, btle_tree);
}
- offset += tvb_length_remaining(tvb, offset) - 3;
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
break;
case 0x01: /* ADV_DIRECT_IND */
@@ -428,15 +428,15 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x04: /* SCAN_RSP */
offset = dissect_bd_addr(hf_advertising_address, btle_tree, tvb, offset);
- sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3, ENC_NA);
+ sub_item = proto_tree_add_item(btle_tree, hf_scan_response_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3, ENC_NA);
sub_tree = proto_item_add_subtree(sub_item, ett_scan_response_data);
- if (tvb_length_remaining(tvb, offset) > 3) {
- next_tvb = tvb_new_subset_length(tvb, offset, tvb_length_remaining(tvb, offset) - 3);
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ next_tvb = tvb_new_subset_length(tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
call_dissector(btcommon_ad_handle, next_tvb, pinfo, sub_tree);
}
- offset += tvb_length_remaining(tvb, offset) - 3;
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
break;
case 0x05: /* CONNECT_REQ */
@@ -479,9 +479,9 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- if (tvb_length_remaining(tvb, offset) > 3) {
- proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
- offset += tvb_length_remaining(tvb, offset) - 3;
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}
} else { /* data PDU */
@@ -558,9 +558,9 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
case 0x0B: /* LL_PAUSE_ENC_RSP */
case 0x12: /* LL_PING_REQ */
case 0x13: /* LL_PING_RSP */
- if (tvb_length_remaining(tvb, offset) > 3) {
- proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
- offset += tvb_length_remaining(tvb, offset) - 3;
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
break;
@@ -705,17 +705,17 @@ dissect_btle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- if (tvb_length_remaining(tvb, offset) > 3) {
- proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
- offset += tvb_length_remaining(tvb, offset) - 3;
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}
break;
default:
- if (tvb_length_remaining(tvb, offset) > 3) {
- proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_length_remaining(tvb, offset) - 3);
- offset += tvb_length_remaining(tvb, offset) - 3;
+ if (tvb_captured_length_remaining(tvb, offset) > 3) {
+ proto_tree_add_expert(btle_tree, pinfo, &ei_unknown_data, tvb, offset, tvb_captured_length_remaining(tvb, offset) - 3);
+ offset += tvb_captured_length_remaining(tvb, offset) - 3;
}
}
diff --git a/epan/dissectors/packet-btmcap.c b/epan/dissectors/packet-btmcap.c
index 1ca6fecaef..05ad711acf 100644
--- a/epan/dissectors/packet-btmcap.c
+++ b/epan/dissectors/packet-btmcap.c
@@ -293,24 +293,24 @@ dissect_btmcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_append_str(pinfo->cinfo, COL_INFO, " (Reserved)");
}
- if ((op_code == 0x03 || op_code == 0x05 || op_code == 0x07) && tvb_length_remaining(tvb, offset)) {
+ if ((op_code == 0x03 || op_code == 0x05 || op_code == 0x07) && tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, pitem, &ei_btmcap_response_parameters_bad,
"The Response Parameters for MD_RECONNECT_MDL_RSP shall have length zero.");
- } else if (tvb_length_remaining(tvb, offset)) {
+ } else if (tvb_captured_length_remaining(tvb, offset)) {
pitem = proto_tree_add_item(main_tree, hf_btmcap_response_parameters, tvb, offset, -1, ENC_NA);
if (response_code != 0x00) {
expert_add_info_format(pinfo, pitem, &ei_btmcap_response_parameters_bad,
"When the Response Code is not Success, the Response Parameters shall have length zero.");
}
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
}
}
}
- if (tvb_length_remaining(tvb, offset)) {
+ if (tvb_captured_length_remaining(tvb, offset)) {
pitem = proto_tree_add_item(main_tree, hf_btmcap_data, tvb, offset, -1, ENC_NA);
expert_add_info(pinfo, pitem, &ei_btmcap_unexpected_data);
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
}
return offset;
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c
index c4c175981b..6f5803be5e 100644
--- a/epan/dissectors/packet-btobex.c
+++ b/epan/dissectors/packet-btobex.c
@@ -1089,7 +1089,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
gint parameters_length;
guint8 hdr_id, i;
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item *hdrs;
hdrs = proto_tree_add_item(tree, hf_headers, tvb, offset, item_length, ENC_NA);
hdrs_tree = proto_item_add_subtree(hdrs, ett_btobex_hdrs);
@@ -1098,7 +1098,7 @@ dissect_headers(proto_tree *tree, tvbuff_t *tvb, int offset, packet_info *pinfo,
return offset;
}
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
hdr_id = tvb_get_guint8(tvb, offset);
switch(0xC0 & hdr_id)
@@ -1475,22 +1475,22 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
/* not the first fragment */
frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
tvb, 0, pinfo, pinfo->p2p_dir, NULL,
- tvb_length(tvb), TRUE);
+ tvb_captured_length(tvb), TRUE);
new_tvb = process_reassembled_data(tvb, 0, pinfo,
"Reassembled Obex packet", frag_msg, &btobex_frag_items, NULL, tree);
pinfo->fragmented = TRUE;
} else {
- if (tvb_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
+ if (tvb_captured_length(tvb) < tvb_get_ntohs(tvb, offset+1)) {
/* first fragment in a sequence */
- no_of_segments = tvb_get_ntohs(tvb, offset+1)/tvb_length(tvb);
- if (tvb_get_ntohs(tvb, offset+1) > (no_of_segments * tvb_length(tvb)))
+ no_of_segments = tvb_get_ntohs(tvb, offset+1)/tvb_captured_length(tvb);
+ if (tvb_get_ntohs(tvb, offset+1) > (no_of_segments * tvb_captured_length(tvb)))
no_of_segments++;
frag_msg = fragment_add_seq_next(&btobex_reassembly_table,
tvb, 0, pinfo, pinfo->p2p_dir, NULL,
- tvb_length(tvb), TRUE);
+ tvb_captured_length(tvb), TRUE);
fragment_set_tot_len(&btobex_reassembly_table,
pinfo, pinfo->p2p_dir, NULL,
@@ -1501,7 +1501,7 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
pinfo->fragmented = TRUE;
}
- else if (tvb_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
+ else if (tvb_captured_length(tvb) == tvb_get_ntohs(tvb, offset+1)) {
/* non-fragmented */
complete = TRUE;
pinfo->fragmented = FALSE;
@@ -1652,9 +1652,9 @@ dissect_btobex(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
break;
default:
- if (length == 0 && tvb_length_remaining(tvb, offset) > 0) {
- proto_tree_add_expert(st, pinfo, &ei_unexpected_data, tvb, offset, tvb_length_remaining(tvb, offset));
- offset += tvb_length_remaining(tvb, offset);
+ if (length == 0 && tvb_captured_length_remaining(tvb, offset) > 0) {
+ proto_tree_add_expert(st, pinfo, &ei_unexpected_data, tvb, offset, tvb_captured_length_remaining(tvb, offset));
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
} else if (length == 0) break;
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index d8fc59ffab..2109da7f8d 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -805,7 +805,7 @@ dissect_btrfcomm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
/* len */
offset = get_le_multi_byte_value(tvb, offset, ctrl_tree, &length, hf_mcc_len);
- if (length > (guint32) tvb_length_remaining(tvb, offset)) {
+ if (length > (guint32) tvb_captured_length_remaining(tvb, offset)) {
expert_add_info_format(pinfo, ctrl_tree, &ei_btrfcomm_mcc_length_bad, "Huge MCC length: %u", length);
return offset;
}
@@ -1215,7 +1215,7 @@ dissect_btdun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
gboolean is_at_cmd;
guint i, length;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DUN");
@@ -1292,7 +1292,7 @@ dissect_btspp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_item *ti;
proto_tree *st;
gboolean ascii_only;
- guint i, length = tvb_length(tvb);
+ guint i, length = tvb_captured_length(tvb);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SPP");
@@ -1309,12 +1309,12 @@ dissect_btspp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_add_fstr(pinfo->cinfo, COL_INFO, "%s \"%s%s\"",
(pinfo->p2p_dir == P2P_DIR_SENT) ? "Sent" : "Rcvd",
tvb_format_text(tvb, 0, length),
- (tvb_length(tvb) > length) ? "..." : "");
+ (tvb_captured_length(tvb) > length) ? "..." : "");
}
proto_tree_add_item(st, hf_spp_data, tvb, 0, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
@@ -1363,12 +1363,12 @@ dissect_btgnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
(pinfo->p2p_dir == P2P_DIR_SENT) ? "Sent" : "Rcvd",
- tvb_format_text(tvb, 0, tvb_length(tvb)));
+ tvb_format_text(tvb, 0, tvb_captured_length(tvb)));
/* GNSS using NMEA-0183 protocol, but it is not available */
proto_tree_add_item(main_tree, hf_gnss_data, tvb, 0, -1, ENC_NA | ENC_ASCII);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-btsap.c b/epan/dissectors/packet-btsap.c
index 8d3f901466..a7b5d5d704 100644
--- a/epan/dissectors/packet-btsap.c
+++ b/epan/dissectors/packet-btsap.c
@@ -578,7 +578,7 @@ dissect_btsap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
tvb, offset, 0, "Too many parameters");
}
- if (tvb_length(tvb) > offset)
+ if (tvb_captured_length(tvb) > offset)
proto_tree_add_expert(tree, pinfo, &ei_unexpected_data, tvb, offset, -1);
return offset;
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index 81f2a79be5..0b99541731 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -1187,7 +1187,7 @@ dissect_continuation_state(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
proto_item *cont_item;
guint length;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length == 0) {
proto_tree_add_expert(tree, pinfo, &ei_btsdp_continuation_state_none, tvb, offset, -1);
} else if (length > 17) {
@@ -1285,7 +1285,7 @@ reassemble_continuation_state(tvbuff_t *tvb, packet_info *pinfo,
if (is_first) *is_first = TRUE;
if (is_continued) *is_continued = TRUE;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length == 0) {
return offset;
} else if (length > 17) {
@@ -1709,7 +1709,7 @@ dissect_data_element(proto_tree *tree, proto_tree **next_tree,
}
pitem = proto_tree_add_item(ptree, hf_data_element_value, tvb, offset, 0, ENC_NA);
- if (length > tvb_length_remaining(tvb, offset)) {
+ if (length > tvb_captured_length_remaining(tvb, offset)) {
expert_add_info(pinfo, pitem, &ei_data_element_value_large);
length = 0;
}
@@ -3928,7 +3928,7 @@ dissect_sdp_service_search_response(proto_tree *tree, tvbuff_t *tvb,
gint new_offset = 0;
gint new_length;
- new_length = tvb_length(new_tvb);
+ new_length = tvb_captured_length(new_tvb);
reassembled_item = proto_tree_add_item(tree, (is_continued) ? hf_partial_record_handle_list : hf_reassembled_record_handle_list,new_tvb, 0, new_length, ENC_NA);
proto_item_append_text(reassembled_item, " [count = %u]", new_length / 4);
@@ -4027,7 +4027,7 @@ dissect_sdp_service_attribute_response(proto_tree *tree, tvbuff_t *tvb,
reassembled_item = proto_tree_add_item(tree,
(is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
- new_tvb, 0, tvb_length(new_tvb), ENC_NA);
+ new_tvb, 0, tvb_captured_length(new_tvb), ENC_NA);
reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
PROTO_ITEM_SET_GENERATED(reassembled_item);
@@ -4152,13 +4152,13 @@ dissect_sdp_service_search_attribute_response(proto_tree *tree, tvbuff_t *tvb,
reassembled_item = proto_tree_add_item(tree,
(is_continued) ? hf_partial_attribute_list : hf_reassembled_attribute_list,
- new_tvb, 0, tvb_length(new_tvb), ENC_NA);
+ new_tvb, 0, tvb_captured_length(new_tvb), ENC_NA);
reassembled_tree = proto_item_add_subtree(reassembled_item, ett_btsdp_reassembled);
PROTO_ITEM_SET_GENERATED(reassembled_item);
if (!is_continued)
dissect_sdp_service_attribute_list_array(reassembled_tree, new_tvb, 0,
- pinfo, tvb_length(new_tvb), &uuid, l2cap_data);
+ pinfo, tvb_captured_length(new_tvb), &uuid, l2cap_data);
}
return offset;
diff --git a/epan/dissectors/packet-btsmp.c b/epan/dissectors/packet-btsmp.c
index 5ac91ac54f..e11d44d7e4 100644
--- a/epan/dissectors/packet-btsmp.c
+++ b/epan/dissectors/packet-btsmp.c
@@ -202,7 +202,7 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
break;
}
- if (tvb_length_remaining(tvb, 0) < 1)
+ if (tvb_captured_length_remaining(tvb, 0) < 1)
return FALSE;
proto_tree_add_item(st, hf_btsmp_opcode, tvb, 0, 1, ENC_LITTLE_ENDIAN);
diff --git a/epan/dissectors/packet-c1222.c b/epan/dissectors/packet-c1222.c
index 717d6bb5cd..2625385f7b 100644
--- a/epan/dissectors/packet-c1222.c
+++ b/epan/dissectors/packet-c1222.c
@@ -998,7 +998,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
case EAX_MODE_CIPHERTEXT_AUTH:
/* mode is ciphertext with authentication */
hasmac = TRUE;
- len2 = tvb_length_remaining(tvb, offset);
+ len2 = tvb_captured_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
encrypted = TRUE;
@@ -1018,7 +1018,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
case EAX_MODE_CLEARTEXT_AUTH:
/* mode is cleartext with authentication */
hasmac = TRUE;
- len2 = tvb_length_remaining(tvb, offset);
+ len2 = tvb_captured_length_remaining(tvb, offset);
if (len2 <= 0)
return offset;
buffer = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, len2);
@@ -1592,7 +1592,7 @@ dissect_c1222_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
dissect_MESSAGE_PDU(tvb, pinfo, c1222_tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/**
@@ -1628,7 +1628,7 @@ dissect_c1222(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, c1222_desegment, 5,
get_c1222_message_len, dissect_c1222_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_c1222 -------------------------------------------*/
diff --git a/epan/dissectors/packet-camel.c b/epan/dissectors/packet-camel.c
index 0bd108faf2..7425f0a472 100644
--- a/epan/dissectors/packet-camel.c
+++ b/epan/dissectors/packet-camel.c
@@ -1358,7 +1358,7 @@ dissect_camel_AccessPointName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_AccessPointName);
- de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_sm_apn(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
return offset;
}
@@ -2009,7 +2009,7 @@ proto_tree *subtree;
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_cause);
- dissect_q931_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
+ dissect_q931_cause_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), subtree, hf_camel_cause_indicator, &Cause_value, isup_parameter_type_value);
return offset;
}
@@ -2042,7 +2042,7 @@ dissect_camel_T_bearerCap(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
if (!parameter_tvb)
return offset;
- dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), tree);
+ dissect_q931_bearer_capability_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), tree);
return offset;
}
@@ -2096,7 +2096,7 @@ dissect_camel_CalledPartyBCDNumber(gboolean implicit_tag _U_, tvbuff_t *tvb _U_,
if (!parameter_tvb)
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_calledpartybcdnumber);
- de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_length(parameter_tvb), NULL, 0);
+ de_cld_party_bcd_num(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length(parameter_tvb), NULL, 0);
return offset;
@@ -2215,7 +2215,7 @@ dissect_camel_INTEGER_1_864000(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
static int
dissect_camel_T_audibleIndicator(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- if (tvb_length_remaining(tvb,offset) < 2)
+ if (tvb_captured_length_remaining(tvb,offset) < 2)
offset = dissect_camel_BOOLEAN(TRUE, tvb, offset, actx , tree, hf_camel_audibleIndicatorTone);
else
offset = dissect_camel_AudibleIndicator(implicit_tag, tvb, offset, actx, tree, hf_index);
@@ -3417,10 +3417,10 @@ dissect_camel_T_pDPAddress(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off
case 1: /* IETF */
switch(PDPTypeNumber){
case 0x21: /* IPv4 */
- proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_BIG_ENDIAN);
+ proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv4, parameter_tvb, 0, tvb_captured_length(parameter_tvb), ENC_BIG_ENDIAN);
break;
case 0x57: /* IPv6 */
- proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_length(parameter_tvb), ENC_NA);
+ proto_tree_add_item(subtree, hf_camel_PDPAddress_IPv6, parameter_tvb, 0, tvb_captured_length(parameter_tvb), ENC_NA);
break;
default:
break;
@@ -4899,7 +4899,7 @@ proto_tree *subtree;
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_camel_RPcause);
- dissect_RP_cause_ie(parameter_tvb, 0, tvb_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
+ dissect_RP_cause_ie(parameter_tvb, 0, tvb_captured_length_remaining(parameter_tvb,0), subtree, hf_camel_RP_Cause, &Cause_value);
return offset;
}
@@ -7981,7 +7981,7 @@ dissect_camel_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -8019,7 +8019,7 @@ dissect_camel_v2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, voi
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -8056,7 +8056,7 @@ dissect_camel(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
tap_queue_packet(camel_tap, pinfo, gp_camelsrt_info);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_reg_handoff_camel ---------------------------------------*/
diff --git a/epan/dissectors/packet-canopen.c b/epan/dissectors/packet-canopen.c
index e560efb359..66e881a366 100644
--- a/epan/dissectors/packet-canopen.c
+++ b/epan/dissectors/packet-canopen.c
@@ -335,7 +335,7 @@ dissect_canopen(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-carp.c b/epan/dissectors/packet-carp.c
index b9d5e347bd..e0e1969df0 100644
--- a/epan/dissectors/packet-carp.c
+++ b/epan/dissectors/packet-carp.c
@@ -63,7 +63,7 @@ test_carp_packet(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, vo
/* First some simple check if the data is
really CARP */
- if (tvb_length(tvb) < 36)
+ if (tvb_captured_length(tvb) < 36)
return FALSE;
/* Version must be 1 or 2, type must be in carp_type_vals */
@@ -135,7 +135,7 @@ dissect_carp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
cksum = tvb_get_ntohs(tvb, offset);
carp_len = (gint)tvb_reported_length(tvb);
- if (!pinfo->fragmented && (gint)tvb_length(tvb) >= carp_len) {
+ if (!pinfo->fragmented && (gint)tvb_captured_length(tvb) >= carp_len) {
/* The packet isn't part of a fragmented datagram
and isn't truncated, so we can checksum it. */
cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, carp_len);
diff --git a/epan/dissectors/packet-cast.c b/epan/dissectors/packet-cast.c
index e6a2943ca3..39cc7832e8 100644
--- a/epan/dissectors/packet-cast.c
+++ b/epan/dissectors/packet-cast.c
@@ -1027,7 +1027,7 @@ dissect_cast_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Get the length of a single CAST PDU */
@@ -1065,7 +1065,7 @@ dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
hdr_data_length = tvb_get_letohl(tvb, 0);
hdr_marker = tvb_get_letohl(tvb, 4);
- /* data_size = MIN(8+hdr_data_length, tvb_length(tvb)) - 0xC; */
+ /* data_size = MIN(8+hdr_data_length, tvb_captured_length(tvb)) - 0xC; */
if (hdr_data_length < 4 || hdr_marker != 0) {
return 0;
@@ -1076,7 +1076,7 @@ dissect_cast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
col_set_str(pinfo->cinfo, COL_INFO, "Cast Client Control Protocol");
tcp_dissect_pdus(tvb, pinfo, tree, cast_desegment, 4, get_cast_pdu_len, dissect_cast_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index 1ddfcfdcfa..fb5705b140 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -356,7 +356,7 @@ static gboolean find_ipprim_data_offset(tvbuff_t *tvb, int *data_offset, guint8
}
/* Skip any other TLC fields before reach payload */
- while (tvb_length_remaining(tvb, offset) > 2) {
+ while (tvb_captured_length_remaining(tvb, offset) > 2) {
/* Look at next tag */
tag = tvb_get_guint8(tvb, offset++);
@@ -463,7 +463,7 @@ static gboolean find_sctpprim_variant1_data_offset(tvbuff_t *tvb, int *data_offs
offset += skipASNLength(first_length_byte);
/* Skip any other fields before reach payload */
- while (tvb_length_remaining(tvb, offset) > 2) {
+ while (tvb_captured_length_remaining(tvb, offset) > 2) {
/* Look at next tag */
tag = tvb_get_guint8(tvb, offset++);
@@ -618,7 +618,7 @@ static gboolean find_sctpprim_variant3_data_offset(tvbuff_t *tvb, int *data_offs
offset += 2;
/* Some optional params */
- while ((tag != 0x0c00) && (tvb_length_remaining(tvb, offset) > 4)) {
+ while ((tag != 0x0c00) && (tvb_captured_length_remaining(tvb, offset) > 4)) {
switch (tag) {
case 0x0900: /* Dest address */
/* Length field */
@@ -727,7 +727,7 @@ static void dissect_rlc_umts(tvbuff_t *tvb, gint offset,
}
/* Keep going until reach data tag or end of frame */
- while ((tag != 0x41) && tvb_length_remaining(tvb, offset)) { /* i.e. Data */
+ while ((tag != 0x41) && tvb_captured_length_remaining(tvb, offset)) { /* i.e. Data */
tag = tvb_get_guint8(tvb, offset++);
switch (tag) {
case 0x72: /* UE Id */
@@ -1027,7 +1027,7 @@ static void dissect_rrc_lte(tvbuff_t *tvb, gint offset,
}
/* Send to RRC dissector, if got here, have sub-dissector and some data left */
- if ((protocol_handle != NULL) && (tvb_length_remaining(tvb, offset) > 0)) {
+ if ((protocol_handle != NULL) && (tvb_captured_length_remaining(tvb, offset) > 0)) {
rrc_tvb = tvb_new_subset_remaining(tvb, offset);
call_dissector_only(protocol_handle, rrc_tvb, pinfo, tree, NULL);
}
@@ -1089,7 +1089,7 @@ static void dissect_ccpri_lte(tvbuff_t *tvb, gint offset,
/* Send remainder to lapb dissector (lapb needs patch with preference
set to call cpri C&M dissector instead of X.25) */
protocol_handle = find_dissector("lapb");
- if ((protocol_handle != NULL) && (tvb_length_remaining(tvb, offset) > 0)) {
+ if ((protocol_handle != NULL) && (tvb_captured_length_remaining(tvb, offset) > 0)) {
ccpri_tvb = tvb_new_subset_length(tvb, offset, length);
call_dissector_only(protocol_handle, ccpri_tvb, pinfo, tree, NULL);
}
@@ -1253,7 +1253,7 @@ static void dissect_pdcp_lte(tvbuff_t *tvb, gint offset,
/* Other optional fields may follow */
tag = tvb_get_guint8(tvb, offset++);
- while ((tag != 0x41) && (tvb_length_remaining(tvb, offset) > 2)) {
+ while ((tag != 0x41) && (tvb_captured_length_remaining(tvb, offset) > 2)) {
if (tag == 0x35) {
/* This is MUI */
@@ -1932,7 +1932,7 @@ static void dissect_tty_lines(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
/* Otherwise show as $hex */
int n, idx;
char *hex_string;
- int tty_string_length = tvb_length_remaining(tvb, offset);
+ int tty_string_length = tvb_captured_length_remaining(tvb, offset);
int hex_string_length = 1+(2*tty_string_length)+1;
hex_string = (char *)wmem_alloc(wmem_packet_scope(), hex_string_length);
@@ -2465,7 +2465,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (strcmp(protocol_name, "comment") == 0) {
/* Extract & add the string. */
proto_item *string_ti;
- char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
+ char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
/* Show comment string */
string_ti = proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_comment, tvb,
@@ -2492,7 +2492,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
else
if (strcmp(protocol_name, "sprint") == 0) {
/* Extract & add the string. */
- char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_length_remaining(tvb, offset), ENC_ASCII);
+ char *string = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tvb_captured_length_remaining(tvb, offset), ENC_ASCII);
/* Show sprint string */
proto_tree_add_item(dct2000_tree, hf_catapult_dct2000_sprint, tvb,
diff --git a/epan/dissectors/packet-cdt.c b/epan/dissectors/packet-cdt.c
index e05a792900..9dd019df7b 100644
--- a/epan/dissectors/packet-cdt.c
+++ b/epan/dissectors/packet-cdt.c
@@ -258,7 +258,7 @@ dissect_cdt_CompressedContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
return offset;
}
- next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_length (compr_tvb));
+ next_tvb = tvb_child_uncompress (tvb, compr_tvb, 0, tvb_captured_length (compr_tvb));
if (next_tvb == NULL) {
proto_tree_add_expert(top_tree, actx->pinfo, &ei_cdt_unable_uncompress_content,
diff --git a/epan/dissectors/packet-cell_broadcast.c b/epan/dissectors/packet-cell_broadcast.c
index fb67f32f15..d0825f622c 100644
--- a/epan/dissectors/packet-cell_broadcast.c
+++ b/epan/dissectors/packet-cell_broadcast.c
@@ -254,7 +254,7 @@ guint dissect_cbs_message_identifier(tvbuff_t *tvb, proto_tree *tree, guint offs
tvbuff_t * dissect_cbs_data(guint8 sms_encoding, tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint offset )
{
tvbuff_t * tvb_out = NULL;
- int length = tvb_length(tvb) - offset;
+ int length = tvb_captured_length(tvb) - offset;
gchar *utf8_text = NULL, *utf8_out;
switch(sms_encoding){
@@ -308,7 +308,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvbuff_t *cbs_msg_tvb = NULL;
fragment_head * frag_data = NULL;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast");
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Page)");
@@ -330,7 +330,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (cbs_page_tvb != NULL)
{
- text_len = tvb_length(cbs_page_tvb);
+ text_len = tvb_captured_length(cbs_page_tvb);
while (text_len && (tvb_get_guint8(cbs_page_tvb, text_len-1) == '\r')) {
text_len--;
}
@@ -338,7 +338,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *item = proto_tree_add_text(cbs_page_tree, tvb, offset, -1, "Cell Broadcast Page Contents");
proto_tree *cbs_page_subtree = proto_item_add_subtree(item, ett_gsm_cbs_page_content);
- len = tvb_length(cbs_page_tvb);
+ len = tvb_captured_length(cbs_page_tvb);
proto_tree_add_string(cbs_page_subtree, hf_gsm_cbs_page_content, cbs_page_tvb, 0,
text_len, tvb_get_string_enc(wmem_packet_scope(), cbs_page_tvb, 0, text_len, ENC_ASCII));
len -= text_len;
@@ -375,7 +375,7 @@ dissect_gsm_cell_broadcast(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *cbs_msg_item = NULL;
proto_tree *cbs_msg_tree = NULL;
- len = tvb_length(cbs_msg_tvb);
+ len = tvb_captured_length(cbs_msg_tvb);
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)");
cbs_msg_item = proto_tree_add_protocol_format(proto_tree_get_root(tree), proto_cell_broadcast, cbs_msg_tvb, 0, len, "GSM Cell Broadcast Message");
@@ -395,7 +395,7 @@ void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, prot
guint msg_len;
tvbuff_t * cbs_msg_tvb = NULL;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_PROTOCOL, " Cell Broadcast");
col_append_str(pinfo->cinfo, COL_INFO, " (CBS Message)");
@@ -407,10 +407,10 @@ void dissect_umts_cell_broadcast_message(tvbuff_t *tvb, packet_info *pinfo, prot
offset++;
cbs_msg_tvb = dissect_cbs_data(sms_encoding, tvb, cbs_tree, pinfo, offset );
- msg_len = tvb_length(cbs_msg_tvb);
+ msg_len = tvb_captured_length(cbs_msg_tvb);
cbs_item2 = proto_tree_add_text(cbs_tree, tvb, offset, -1, "Cell Broadcast Message Contents (length: %d)", msg_len);
cbs_subtree = proto_item_add_subtree(cbs_item2, ett_cbs_msg);
- proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_length(cbs_msg_tvb), "%s", tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII));
+ proto_tree_add_text(cbs_subtree, cbs_msg_tvb , 0, tvb_captured_length(cbs_msg_tvb), "%s", tvb_get_string_enc(wmem_packet_scope(), cbs_msg_tvb, 0, msg_len, ENC_ASCII));
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-charging_ase.c b/epan/dissectors/packet-charging_ase.c
index a8b6200dfb..3a8d462b04 100644
--- a/epan/dissectors/packet-charging_ase.c
+++ b/epan/dissectors/packet-charging_ase.c
@@ -535,7 +535,7 @@ dissect_charging_ase_T_value(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
#line 13 "../../asn1/charging_ase/charging_ase.cnf"
proto_tree_add_text(tree, tvb, offset, -1, "Extensions not dissected");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
return offset;
@@ -847,10 +847,10 @@ dissect_charging_ase(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *it;
proto_tree *tr;
- it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, tvb_length(tvb), "Charging ASE");
+ it=proto_tree_add_protocol_format(tree, proto_charging_ase, tvb, 0, tvb_captured_length(tvb), "Charging ASE");
tr=proto_item_add_subtree(it, ett_charging_ase);
- if(tvb_length(tvb)>0)
+ if(tvb_captured_length(tvb)>0)
{
dissect_charging_ase_ChargingMessageType_PDU(tvb , pinfo, tr, NULL);
}
diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c
index 30f3c65223..4122b9a2d5 100644
--- a/epan/dissectors/packet-cigi.c
+++ b/epan/dissectors/packet-cigi.c
@@ -2455,7 +2455,7 @@ packet_is_cigi(tvbuff_t *tvb)
/* CIGI 3 */
guint16 byte_swap;
- if (tvb_length(tvb) < 3) {
+ if (tvb_captured_length(tvb) < 3) {
/* Not enough data available to check */
return FALSE;
}
@@ -2609,7 +2609,7 @@ dissect_cigi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
dissect_cigi_pdu(tvb, pinfo, tree);
/* We probably ate the entire packet. */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the CIGI packets */
@@ -2658,7 +2658,7 @@ dissect_cigi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
- ti = proto_tree_add_protocol_format(tree, proto_cigi, tvb, 0, tvb_length(tvb), "Common Image Generator Interface (%i), %s => %s (%u bytes)",
+ ti = proto_tree_add_protocol_format(tree, proto_cigi, tvb, 0, tvb_captured_length(tvb), "Common Image Generator Interface (%i), %s => %s (%u bytes)",
cigi_version, src_str, dest_str, tvb_reported_length(tvb));
cigi_tree = proto_item_add_subtree(ti, ett_cigi);
@@ -2707,7 +2707,7 @@ cigi_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_tree* cigi_packet_tree = NULL;
proto_item* tipacket;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given
@@ -2798,7 +2798,7 @@ cigi2_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_item* tipacket;
int hf_cigi2_packet = -1;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given
@@ -2995,7 +2995,7 @@ cigi3_add_tree(tvbuff_t *tvb, proto_tree *cigi_tree)
proto_item* tipacket;
int hf_cigi3_packet = -1;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
/* Each iteration through this loop is meant to be a separate cigi packet
* therefore it is okay to assume that at the top of this look we are given
diff --git a/epan/dissectors/packet-cimd.c b/epan/dissectors/packet-cimd.c
index ea5dbd760c..084b282274 100644
--- a/epan/dissectors/packet-cimd.c
+++ b/epan/dissectors/packet-cimd.c
@@ -858,7 +858,7 @@ dissect_cimd_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
int etxp;
guint8 opcode = 0; /* Operation code */
- if (tvb_length(tvb) < CIMD_MIN_LENGTH)
+ if (tvb_captured_length(tvb) < CIMD_MIN_LENGTH)
return FALSE;
if (tvb_get_guint8(tvb, 0) != CIMD_STX)
diff --git a/epan/dissectors/packet-cip.c b/epan/dissectors/packet-cip.c
index 303ef7dce1..b2a045862d 100644
--- a/epan/dissectors/packet-cip.c
+++ b/epan/dissectors/packet-cip.c
@@ -4149,9 +4149,9 @@ dissect_cip_class_generic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
ti = proto_tree_add_item(tree, proto_cip_class_generic, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_generic );
- dissect_cip_generic_data( class_tree, tvb, 0, tvb_length(tvb), pinfo, ti );
+ dissect_cip_generic_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo, ti );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -4384,7 +4384,7 @@ dissect_cip_generic_service_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
add_cip_service_to_info_column(pinfo, service, cip_sc_vals);
/* Create service tree */
- cmd_data_item = proto_tree_add_text(tree, tvb, 0, tvb_length(tvb), "%s",
+ cmd_data_item = proto_tree_add_text(tree, tvb, 0, tvb_captured_length(tvb), "%s",
val_to_str(service, cip_sc_vals , "Unknown Service (0x%02x)"));
proto_item_append_text(cmd_data_item, " (Request)");
cmd_data_tree = proto_item_add_subtree( cmd_data_item, ett_cmd_data );
@@ -4465,7 +4465,7 @@ dissect_cip_generic_service_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -4725,7 +4725,7 @@ dissect_cip_generic_service_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
cip_req_info_t* preq_info;
cip_simple_request_info_t req_data;
int offset = 0,
- item_length = tvb_length(tvb);
+ item_length = tvb_captured_length(tvb);
guint8 service = tvb_get_guint8( tvb, offset ) & CIP_SC_MASK,
add_stat_size = tvb_get_guint8( tvb, offset+3 ) * 2;
@@ -4740,7 +4740,7 @@ dissect_cip_generic_service_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
else
{
/* PROTO_ITEM_SET_HIDDEN( ti ); */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
preq_info = (cip_req_info_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_cip, 0);
@@ -4829,7 +4829,7 @@ dissect_cip_generic_service_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/************************************************
@@ -5505,9 +5505,9 @@ dissect_cip_class_cm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
ti = proto_tree_add_item(tree, proto_cip_class_cm, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_cm );
- dissect_cip_cm_data( class_tree, tvb, 0, tvb_length(tvb), pinfo );
+ dissect_cip_cm_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/************************************************
@@ -5589,7 +5589,7 @@ dissect_cip_mb_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
case SC_MB_PASSTHROUGH:
/* Passthrough response (Success) */
- if( tvb_length_remaining(tvb, offset) > 0 )
+ if( tvb_captured_length_remaining(tvb, offset) > 0 )
{
/* dissect the Modbus PDU */
next_tvb = tvb_new_subset_length( tvb, offset+4+add_stat_size, item_length-4-add_stat_size);
@@ -5679,7 +5679,7 @@ dissect_cip_mb_data( proto_tree *item_tree, tvbuff_t *tvb, int offset, int item_
case SC_MB_PASSTHROUGH:
/* Passthrough Request */
- if( tvb_length_remaining(tvb, offset) > 0 )
+ if( tvb_captured_length_remaining(tvb, offset) > 0 )
{
/* dissect the Modbus PDU */
next_tvb = tvb_new_subset_length( tvb, offset+2+req_path_size, item_length-req_path_size-2);
@@ -5716,9 +5716,9 @@ dissect_cip_class_mb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
ti = proto_tree_add_item(tree, proto_cip_class_mb, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_mb );
- dissect_cip_mb_data( class_tree, tvb, 0, tvb_length(tvb), pinfo );
+ dissect_cip_mb_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/************************************************
@@ -6067,9 +6067,9 @@ dissect_cip_class_cco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void
ti = proto_tree_add_item(tree, proto_cip_class_cco, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_cco );
- dissect_cip_cco_data( class_tree, tvb, 0, tvb_length(tvb), pinfo );
+ dissect_cip_cco_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -6379,7 +6379,7 @@ dissect_cip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
dissect_cip_data( tree, tvb, 0, pinfo, NULL );
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
diff --git a/epan/dissectors/packet-cipsafety.c b/epan/dissectors/packet-cipsafety.c
index b94beebf84..c24ba44e80 100644
--- a/epan/dissectors/packet-cipsafety.c
+++ b/epan/dissectors/packet-cipsafety.c
@@ -740,9 +740,9 @@ dissect_cip_class_s_supervisor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
ti = proto_tree_add_item(tree, proto_cip_class_s_supervisor, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_s_supervisor );
- dissect_cip_s_supervisor_data( class_tree, tvb, 0, tvb_length(tvb), pinfo );
+ dissect_cip_s_supervisor_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_s_supervisor_exception_detail(proto_tree *tree, proto_item *item, tvbuff_t *tvb, int offset, int hf_size, int hf_data)
@@ -1299,9 +1299,9 @@ dissect_cip_class_s_validator(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
ti = proto_tree_add_item(tree, proto_cip_class_s_validator, tvb, 0, -1, ENC_NA);
class_tree = proto_item_add_subtree( ti, ett_cip_class_s_validator );
- dissect_cip_s_validator_data( class_tree, tvb, 0, tvb_length(tvb), pinfo );
+ dissect_cip_s_validator_data( class_tree, tvb, 0, tvb_captured_length(tvb), pinfo );
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -1625,7 +1625,7 @@ dissect_cipsafety(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_item(tree, proto_cipsafety, tvb, 0, -1, ENC_NA);
safety_tree = proto_item_add_subtree( ti, ett_cip_safety);
- dissect_cip_safety_data(safety_tree, ti, tvb, tvb_length(tvb), pinfo );
+ dissect_cip_safety_data(safety_tree, ti, tvb, tvb_captured_length(tvb), pinfo );
}
static int dissect_sercosiii_link_error_count_p1p2(packet_info *pinfo, proto_tree *tree, proto_item *item, tvbuff_t *tvb,
diff --git a/epan/dissectors/packet-cisco-metadata.c b/epan/dissectors/packet-cisco-metadata.c
index eaf0dfd351..299f3361d9 100644
--- a/epan/dissectors/packet-cisco-metadata.c
+++ b/epan/dissectors/packet-cisco-metadata.c
@@ -83,7 +83,7 @@ dissect_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean is_802_2 = TRUE;
/* Don't throw an exception for this check (even a BoundsError) */
- if (tvb_length_remaining(tvb, 4) >= 2) {
+ if (tvb_captured_length_remaining(tvb, 4) >= 2) {
if (tvb_get_ntohs(tvb, 4) == 0xffff)
is_802_2 = FALSE;
}
diff --git a/epan/dissectors/packet-cisco-wids.c b/epan/dissectors/packet-cisco-wids.c
index 1c4268c675..1f819da6bb 100644
--- a/epan/dissectors/packet-cisco-wids.c
+++ b/epan/dissectors/packet-cisco-wids.c
@@ -83,7 +83,7 @@ dissect_cwids(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
cwids_tree = NULL;
- while(tvb_length_remaining(tvb, offset) > 0) {
+ while(tvb_captured_length_remaining(tvb, offset) > 0) {
ti = proto_tree_add_item(tree, proto_cwids, tvb, offset, 28, ENC_NA);
cwids_tree = proto_item_add_subtree(ti, ett_cwids);
diff --git a/epan/dissectors/packet-classicstun.c b/epan/dissectors/packet-classicstun.c
index 4ed9e6ecb8..0a7a87e1c9 100644
--- a/epan/dissectors/packet-classicstun.c
+++ b/epan/dissectors/packet-classicstun.c
@@ -235,7 +235,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
/*
* First check if the frame is really meant for us.
*/
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/* First, make sure we have enough data to do the check. */
if (len < CLASSICSTUN_HDR_LEN)
return 0;
@@ -543,7 +543,7 @@ dissect_classicstun(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-clique-rm.c b/epan/dissectors/packet-clique-rm.c
index a30c5566d8..9894bb1a7a 100644
--- a/epan/dissectors/packet-clique-rm.c
+++ b/epan/dissectors/packet-clique-rm.c
@@ -153,7 +153,7 @@ dissect_data_packet(proto_tree *clique_rm_tree, tvbuff_t *tvb, int offset)
proto_tree_add_item(tree, hf_clique_rm_data_data, tvb, offset,
- tvb_length_remaining(tvb, offset), ENC_NA);
+ tvb_captured_length_remaining(tvb, offset), ENC_NA);
}
static int
@@ -276,7 +276,7 @@ dissect_clique_rm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
int offset = 0;
guint64 qword;
- if (tvb_length(tvb) < 12)
+ if (tvb_captured_length(tvb) < 12)
return FALSE;
qword = tvb_get_ntoh48(tvb,0);
diff --git a/epan/dissectors/packet-clnp.c b/epan/dissectors/packet-clnp.c
index d03ed621f0..bef9165659 100644
--- a/epan/dissectors/packet-clnp.c
+++ b/epan/dissectors/packet-clnp.c
@@ -311,7 +311,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
or not - set the Info column now; we'll get an exception before
we set it otherwise. */
- if (tvb_length(tvb) < cnf_hdr_len) {
+ if (tvb_captured_length(tvb) < cnf_hdr_len) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s NPDU %s", pdu_type_string, flag_string);
}
@@ -577,7 +577,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect it as a CLNP PDU. */
col_add_fstr(pinfo->cinfo, COL_INFO, "%s NPDU %s", pdu_type_string, flag_string);
- next_length = tvb_length_remaining(tvb, offset);
+ next_length = tvb_captured_length_remaining(tvb, offset);
if (next_length != 0) {
/* We have payload; dissect it. */
ti = proto_tree_add_text(clnp_tree, tvb, offset, next_length,
diff --git a/epan/dissectors/packet-cmip.c b/epan/dissectors/packet-cmip.c
index 6699f459c2..615b137e84 100644
--- a/epan/dissectors/packet-cmip.c
+++ b/epan/dissectors/packet-cmip.c
@@ -956,7 +956,7 @@ dissect_cmip_AttributeValue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
if(attributeform==ATTRIBUTE_GLOBAL_FORM){
offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, actx->private_data);
} else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) {
- offset=tvb_length (tvb);
+ offset=tvb_captured_length (tvb);
} else {
offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree);
}
@@ -2092,7 +2092,7 @@ dissect_cmip_T_attributevalue(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int
if(attributeform==ATTRIBUTE_GLOBAL_FORM){
offset=call_ber_oid_callback(attribute_identifier_id, tvb, offset, actx->pinfo, tree, NULL);
} else if (dissector_try_uint(attribute_id_dissector_table, attribute_local_id, tvb, actx->pinfo, tree)) {
- offset=tvb_length (tvb);
+ offset=tvb_captured_length (tvb);
} else {
offset=dissect_unknown_ber(actx->pinfo, tvb, offset, tree);
}
@@ -4417,7 +4417,7 @@ dissect_cmip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_cmip ----------------------------------------------*/
diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c
index b7546a6a23..19783e6b3e 100644
--- a/epan/dissectors/packet-cmp.c
+++ b/epan/dissectors/packet-cmp.c
@@ -1529,9 +1529,9 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
switch(pdu_type){
case CMP_TYPE_PKIMSG:
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), pdu_len);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case CMP_TYPE_POLLREP:
proto_tree_add_item(tcptrans_tree, hf_cmp_tcptrans_poll_ref, tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -1557,14 +1557,14 @@ static int dissect_cmp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pa
proto_tree_add_time(tcptrans_tree, hf_cmp_tcptrans_ttcb, tvb, offset, 4, &ts);
offset += 4;
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), pdu_len);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case CMP_TYPE_FINALMSGREP:
- next_tvb = tvb_new_subset(tvb, offset, tvb_length_remaining(tvb, offset), pdu_len);
+ next_tvb = tvb_new_subset(tvb, offset, tvb_captured_length_remaining(tvb, offset), pdu_len);
dissect_cmp_pdu(next_tvb, tree, &asn1_ctx);
- offset += tvb_length_remaining(tvb, offset);
+ offset += tvb_captured_length_remaining(tvb, offset);
break;
case CMP_TYPE_ERRORMSGREP:
/*XXX to be added*/
@@ -1641,7 +1641,7 @@ dissect_cmp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void
tcp_dissect_pdus(tvb, pinfo, parent_tree, cmp_desegment, offset, get_cmp_pdu_len,
dissect_cmp_tcp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-cmpp.c b/epan/dissectors/packet-cmpp.c
index 26e8f8fe0b..6c2a6596ab 100644
--- a/epan/dissectors/packet-cmpp.c
+++ b/epan/dissectors/packet-cmpp.c
@@ -547,7 +547,7 @@ dissect_cmpp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
const gchar *command_str; /* Header command string */
/* Get the length of the PDU */
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
/* if the length of the tvb is shorder then the cmpp header length exit */
if (tvb_len < CMPP_FIX_HEADER_LENGTH)
return 0;
@@ -617,7 +617,7 @@ dissect_cmpp_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -634,7 +634,7 @@ dissect_cmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
guint total_length, command_id, tvb_len;
/* Check that there's enough data */
- tvb_len = tvb_length(tvb);
+ tvb_len = tvb_captured_length(tvb);
if (tvb_len < CMPP_FIX_HEADER_LENGTH)
return 0;
@@ -658,7 +658,7 @@ dissect_cmpp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
get_cmpp_pdu_len, dissect_cmpp_tcp_pdu, data);
/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c
index 904499b75b..bffc9e26bf 100644
--- a/epan/dissectors/packet-cms.c
+++ b/epan/dissectors/packet-cms.c
@@ -291,8 +291,8 @@ cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff
sha1_starts(&sha1_ctx);
- sha1_update(&sha1_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
- tvb_length(content));
+ sha1_update(&sha1_ctx, tvb_get_ptr(content, 0, tvb_captured_length(content)),
+ tvb_captured_length(content));
sha1_finish(&sha1_ctx, digest_buf);
@@ -302,8 +302,8 @@ cms_verify_msg_digest(proto_item *pi, tvbuff_t *content, const char *alg, tvbuff
md5_init(&md5_ctx);
- md5_append(&md5_ctx, tvb_get_ptr(content, 0, tvb_length(content)),
- tvb_length(content));
+ md5_append(&md5_ctx, tvb_get_ptr(content, 0, tvb_captured_length(content)),
+ tvb_captured_length(content));
md5_finish(&md5_ctx, digest_buf);
@@ -436,7 +436,7 @@ dissect_cms_T_eContent(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
#line 102 "../../asn1/cms/cms.cnf"
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
- proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_length (content_tvb));
+ proto_item_set_text(actx->created_item, "eContent (%u bytes)", tvb_captured_length (content_tvb));
call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
diff --git a/epan/dissectors/packet-componentstatus.c b/epan/dissectors/packet-componentstatus.c
index da18b24fba..c85f5bd257 100644
--- a/epan/dissectors/packet-componentstatus.c
+++ b/epan/dissectors/packet-componentstatus.c
@@ -177,7 +177,7 @@ dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_
"Association #%d", i++);
association_tree = proto_item_add_subtree(association_item, ett_association);
association_tvb = tvb_new_subset(message_tvb, offset,
- MIN(COMPONENTASSOCIATION_LENGTH, tvb_length_remaining(message_tvb, offset)),
+ MIN(COMPONENTASSOCIATION_LENGTH, tvb_captured_length_remaining(message_tvb, offset)),
COMPONENTASSOCIATION_LENGTH);
dissect_componentstatusprotocol_componentassociation_message(association_tvb, association_tree);
@@ -219,7 +219,7 @@ dissect_componentstatusprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto
gint8 type;
gint32 version;
- if (tvb_length(message_tvb) < (MESSAGE_VERSION_OFFSET + MESSAGE_VERSION_LENGTH))
+ if (tvb_captured_length(message_tvb) < (MESSAGE_VERSION_OFFSET + MESSAGE_VERSION_LENGTH))
return(0);
/* Check, if this packet really contains a ComponentStatusProtocol message */
@@ -245,7 +245,7 @@ dissect_componentstatusprotocol(tvbuff_t *message_tvb, packet_info *pinfo, proto
};
/* dissect the message */
dissect_componentstatusprotocol_message(message_tvb, pinfo, componentstatusprotocol_tree);
- return(tvb_length(message_tvb));
+ return(tvb_captured_length(message_tvb));
}
diff --git a/epan/dissectors/packet-cops.c b/epan/dissectors/packet-cops.c
index 75f02ab57b..98be1ca305 100644
--- a/epan/dissectors/packet-cops.c
+++ b/epan/dissectors/packet-cops.c
@@ -986,7 +986,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
offset += object_len;
}
- garbage = tvb_length_remaining(tvb, offset);
+ garbage = tvb_captured_length_remaining(tvb, offset);
if (garbage > 0) {
proto_tree_add_expert_format(tree, pinfo, &ei_cops_trailing_garbage, tvb, offset, garbage, "Trailing garbage: %d byte%s", garbage, plurality(garbage, "", "s"));
}
@@ -1121,7 +1121,7 @@ dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the packets */
@@ -1130,7 +1130,7 @@ dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
get_cops_pdu_len, dissect_cops_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static const char *cops_c_type_to_str(guint8 c_num, guint8 c_type)
@@ -1594,7 +1594,7 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, packet_info *pinfo, guint3
gint encoid_len;
guint8* encoid;
- encoid_len = tvb_length_remaining(oid_tvb,0);
+ encoid_len = tvb_captured_length_remaining(oid_tvb,0);
if (encoid_len > 0) {
encoid = (guint8*)tvb_memdup(wmem_packet_scope(),oid_tvb,0,encoid_len);
(*pprid_subids_len) = oid_encoded2subid(encoid, encoid_len, pprid_subids);
@@ -5963,7 +5963,7 @@ cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
/* Do the remaining client specific objects */
- remdata = tvb_length_remaining(tvb, offset);
+ remdata = tvb_captured_length_remaining(tvb, offset);
while (remdata > 4) {
/* In case we have remaining data, then lets try to get this analyzed */
@@ -6021,7 +6021,7 @@ cops_analyze_packetcable_dqos_obj(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += object_len;
/* See what we can still get from the buffer */
- remdata = tvb_length_remaining(tvb, offset);
+ remdata = tvb_captured_length_remaining(tvb, offset);
}
}
diff --git a/epan/dissectors/packet-cpfi.c b/epan/dissectors/packet-cpfi.c
index 9099beb9ae..f88731f997 100644
--- a/epan/dissectors/packet-cpfi.c
+++ b/epan/dissectors/packet-cpfi.c
@@ -328,7 +328,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
if (pinfo->dst.type != AT_ETHER || pinfo->src.type != AT_ETHER)
return 0;
- length = tvb_length_remaining(message_tvb, 8);
+ length = tvb_captured_length_remaining(message_tvb, 8);
reported_length = tvb_reported_length_remaining(message_tvb, 8);
if (reported_length < 8)
{
@@ -343,7 +343,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
if (body_length > reported_body_length)
body_length = reported_body_length;
- length = tvb_length_remaining(message_tvb, 8+body_length);
+ length = tvb_captured_length_remaining(message_tvb, 8+body_length);
if (length < 0)
{
/* The footer wasn't captured at all.
@@ -383,7 +383,7 @@ dissect_cpfi(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree, void *
footer_tvb = tvb_new_subset(message_tvb, 8+body_length, length, 8);
dissect_cpfi_footer(footer_tvb, cpfi_tree);
- return(tvb_length(message_tvb));
+ return(tvb_captured_length(message_tvb));
}
diff --git a/epan/dissectors/packet-cpha.c b/epan/dissectors/packet-cpha.c
index ce551b802e..67494895fb 100644
--- a/epan/dissectors/packet-cpha.c
+++ b/epan/dissectors/packet-cpha.c
@@ -164,7 +164,7 @@ dissect_cpha(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* If the magic number or protocol version is unknown, don't treat this
* frame as a CPHA frame.
*/
- if (tvb_length(tvb) < 4) {
+ if (tvb_captured_length(tvb) < 4) {
/* Not enough data for the magic number or protocol version */
return 0;
}
@@ -240,7 +240,7 @@ dissect_cpha(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_my_state(tvbuff_t * tvb, int offset, proto_tree * tree) {
diff --git a/epan/dissectors/packet-credssp.c b/epan/dissectors/packet-credssp.c
index cf95f40d63..8531c59b43 100644
--- a/epan/dissectors/packet-credssp.c
+++ b/epan/dissectors/packet-credssp.c
@@ -366,7 +366,7 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
/* Look for SEQUENCE, CONTEXT 0, and INTEGER 2 */
- if(tvb_length(tvb) > 7) {
+ if(tvb_captured_length(tvb) > 7) {
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_SEQUENCE) && (pc == TRUE)) {
offset = get_ber_length(tvb, offset, NULL, NULL);
diff --git a/epan/dissectors/packet-ctdb.c b/epan/dissectors/packet-ctdb.c
index 077938d5f7..09c45bac6e 100644
--- a/epan/dissectors/packet-ctdb.c
+++ b/epan/dissectors/packet-ctdb.c
@@ -982,7 +982,7 @@ dissect_ctdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
int endianess;
/* does this look like CTDB? */
- if(tvb_length_remaining(tvb, offset)<8){
+ if(tvb_captured_length_remaining(tvb, offset)<8){
return FALSE;
}
switch(tvb_get_letohl(tvb, offset+4)){
diff --git a/epan/dissectors/packet-dap.c b/epan/dissectors/packet-dap.c
index 12da234f02..a929e5c3a9 100644
--- a/epan/dissectors/packet-dap.c
+++ b/epan/dissectors/packet-dap.c
@@ -1571,7 +1571,7 @@ dissect_dap_T_pagedResultsQueryReference(gboolean implicit_tag _U_, tvbuff_t *tv
if(out_tvb) {
- len = tvb_length(out_tvb);
+ len = tvb_captured_length(out_tvb);
/* now see if we can add a string representation */
for(i=0; i<len; i++)
if(!g_ascii_isprint(tvb_get_guint8(out_tvb, i)))
diff --git a/epan/dissectors/packet-data.c b/epan/dissectors/packet-data.c
index 7a10bd5b82..f42d83ff34 100644
--- a/epan/dissectors/packet-data.c
+++ b/epan/dissectors/packet-data.c
@@ -67,7 +67,7 @@ dissect_data(tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree)
gint bytes;
if (tree) {
- bytes = tvb_length_remaining(tvb, 0);
+ bytes = tvb_captured_length_remaining(tvb, 0);
if (bytes > 0) {
tvbuff_t *data_tvb;
proto_item *ti;
diff --git a/epan/dissectors/packet-db-lsp.c b/epan/dissectors/packet-db-lsp.c
index 79b3f339ab..1e0a9fdd24 100644
--- a/epan/dissectors/packet-db-lsp.c
+++ b/epan/dissectors/packet-db-lsp.c
@@ -111,7 +111,7 @@ dissect_db_lsp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
proto_tree_add_item (db_lsp_tree, hf_length, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- if (magic != 0x0301 || length > tvb_length_remaining (tvb, offset)) {
+ if (magic != 0x0301 || length > tvb_captured_length_remaining (tvb, offset)) {
/* Probably an unknown packet */
/* expert_add_info_format (pinfo, db_lsp_item, PI_UNDECODED, PI_WARN, "Unknown packet"); */
return 0;
@@ -137,7 +137,7 @@ dissect_db_lsp_pdu (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
proto_item_append_text (db_lsp_item, ", Type: %d, Length: %d", type, length);
proto_item_set_len (db_lsp_item, length + 5);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -145,7 +145,7 @@ get_db_lsp_pdu_len (packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
if (tvb_get_ntohs (tvb, offset + 1) != 0x0301) {
/* Unknown data, eat remaining data for this frame */
- return tvb_length_remaining (tvb, offset);
+ return tvb_captured_length_remaining (tvb, offset);
}
return tvb_get_ntohs (tvb, offset + 3) + 5;
@@ -156,7 +156,7 @@ dissect_db_lsp_tcp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
{
tcp_dissect_pdus (tvb, pinfo, tree, db_lsp_desegment, 5,
get_db_lsp_pdu_len, dissect_db_lsp_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-dbus.c b/epan/dissectors/packet-dbus.c
index 36edd41769..b455baea54 100644
--- a/epan/dissectors/packet-dbus.c
+++ b/epan/dissectors/packet-dbus.c
@@ -621,7 +621,7 @@ static int
dissect_dbus_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
tcp_dissect_pdus(tvb, pinfo, tree, dbus_desegment, DBUS_HEADER_LEN, get_dbus_message_len, dissect_dbus_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-dcc.c b/epan/dissectors/packet-dcc.c
index 7208a9d10c..b5babf0b3e 100644
--- a/epan/dissectors/packet-dcc.c
+++ b/epan/dissectors/packet-dcc.c
@@ -89,7 +89,7 @@ static gint ett_dcc_trace = -1;
#define D_TEXT(label, endpad) { \
int next_offset,left; \
while (tvb_offset_exists(tvb, offset+endpad)) { \
- left = tvb_length_remaining(tvb,offset) - endpad; \
+ left = tvb_captured_length_remaining(tvb,offset) - endpad; \
tvb_find_line_end(tvb, offset, left, &next_offset, \
FALSE); \
proto_tree_add_text(dcc_optree, tvb, offset, \
@@ -215,7 +215,7 @@ dissect_dcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
}
/* get at least a full packet structure */
- if ( tvb_length(tvb) < sizeof(DCC_HDR) ) {
+ if ( tvb_captured_length(tvb) < sizeof(DCC_HDR) ) {
/* Doesn't have enough bytes to contain packet header. */
return FALSE;
}
@@ -240,7 +240,7 @@ dissect_dcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
proto_tree_add_item(dcc_tree, hf_dcc_len, tvb,
offset, 2, ENC_BIG_ENDIAN);
- if ( tvb_length(tvb) < tvb_get_ntohs(tvb, offset)) {
+ if ( tvb_captured_length(tvb) < tvb_get_ntohs(tvb, offset)) {
/* Doesn't have number of bytes that header claims. */
proto_tree_add_text(dcc_tree, tvb, offset, 2, "Error - packet is shorter than header claims!");
}
@@ -320,7 +320,7 @@ dissect_dcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
case DCC_OP_ADMN:
if ( is_response )
{
- int left_local = tvb_length_remaining(tvb, offset) -
+ int left_local = tvb_captured_length_remaining(tvb, offset) -
(int)sizeof(DCC_SIGNATURE);
if ( left_local == sizeof(DCC_ADMN_RESP_CLIENTS) )
{
diff --git a/epan/dissectors/packet-dccp.c b/epan/dissectors/packet-dccp.c
index b8b2af88e5..ebd75fa338 100644
--- a/epan/dissectors/packet-dccp.c
+++ b/epan/dissectors/packet-dccp.c
@@ -715,7 +715,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* checksums in DCCP)
*/
reported_len = tvb_reported_length(tvb);
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (!pinfo->fragmented && len >= reported_len) {
/* The packet isn't part of a fragmented datagram and isn't
@@ -809,7 +809,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
expert_add_info_format(pinfo, offset_item, &ei_dccp_advertised_header_length_bad,
"Advertised header length (%u) is smaller than the minimum (%u)",
advertised_dccp_header_len, DCCP_GEN_HDR_LEN_X);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->reserved2 = tvb_get_guint8(tvb, offset);
hidden_item =
@@ -827,7 +827,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
expert_add_info_format(pinfo, offset_item, &ei_dccp_advertised_header_length_bad,
"Advertised header length (%u) is smaller than the minimum (%u)",
advertised_dccp_header_len, DCCP_GEN_HDR_LEN_NO_X);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->seq = tvb_get_ntoh24(tvb, offset);
proto_tree_add_uint64(dccp_tree, hf_dccp_seq, tvb, offset, 3,
@@ -851,7 +851,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Advertised header length (%u) is smaller than the minimum (%u) for %s",
advertised_dccp_header_len, offset + 4,
val_to_str(dccph->type, dccp_packet_type_vals, "Unknown (%u)"));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->service_code = tvb_get_ntohl(tvb, offset);
if (tree)
@@ -866,7 +866,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
expert_add_info_format(pinfo, offset_item, &ei_dccp_advertised_header_length_bad,
"Advertised header length (%u) is smaller than the minimum (%u) for Response",
advertised_dccp_header_len, offset + 12);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->ack_reserved = tvb_get_ntohs(tvb, offset);
if (tree) {
@@ -907,7 +907,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Advertised header length (%u) is smaller than the minimum (%u) for %s",
advertised_dccp_header_len, offset + 8,
val_to_str(dccph->type, dccp_packet_type_vals, "Unknown (%u)"));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->ack_reserved = tvb_get_ntohs(tvb, offset);
if (tree) {
@@ -932,7 +932,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Advertised header length (%u) is smaller than the minimum (%u) for %s",
advertised_dccp_header_len, offset + 4,
val_to_str(dccph->type, dccp_packet_type_vals, "Unknown (%u)"));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->ack_reserved = tvb_get_guint8(tvb, offset);
if (tree) {
@@ -957,7 +957,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
expert_add_info_format(pinfo, offset_item, &ei_dccp_advertised_header_length_bad,
"Advertised header length (%u) is smaller than the minimum (%u) for Reset",
advertised_dccp_header_len, offset + 4);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->ack_reserved = tvb_get_ntohs(tvb, offset);
@@ -1009,7 +1009,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
"Advertised header length (%u) is smaller than the minimum (%u) for %s",
advertised_dccp_header_len, offset + 8,
val_to_str(dccph->type, dccp_packet_type_vals, "Unknown (%u)"));
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
dccph->ack_reserved = tvb_get_ntohs(tvb, offset);
if (tree) {
@@ -1030,7 +1030,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
break;
default:
expert_add_info(pinfo, dccp_item, &ei_dccp_packet_type_reserved);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1041,7 +1041,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
expert_add_info_format(pinfo, offset_item, &ei_dccp_advertised_header_length_bad,
"Advertised header length (%u) is larger than the maximum (%u)",
advertised_dccp_header_len, DCCP_HDR_LEN_MAX);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -1077,7 +1077,7 @@ dissect_dccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
if (!pinfo->flags.in_error_pkt || tvb_reported_length_remaining(tvb, offset) > 0)
decode_dccp_ports(tvb, offset, pinfo, tree, dccph->sport, dccph->dport);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-dcerpc-dnsserver.c b/epan/dissectors/packet-dcerpc-dnsserver.c
index d171b2cf88..fdf60570f5 100644
--- a/epan/dissectors/packet-dcerpc-dnsserver.c
+++ b/epan/dissectors/packet-dcerpc-dnsserver.c
@@ -602,7 +602,7 @@ dnsserver_dissect_struct_DNS_RPC_NAME(tvbuff_t *tvb _U_, int offset _U_, packet_
tree = proto_item_add_subtree(item, ett_dnsserver_DNS_RPC_NAME);
}
offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, di, drep, hf_dnsserver_DNS_RPC_NAME_NameLength, &len);
- bc = tvb_length_remaining(tvb, offset);
+ bc = tvb_captured_length_remaining(tvb, offset);
dn = get_unicode_or_ascii_string(tvb, &offset,
TRUE, &dn_len, TRUE, TRUE, &bc);
if (dn) {
diff --git a/epan/dissectors/packet-dcerpc-eventlog.c b/epan/dissectors/packet-dcerpc-eventlog.c
index 3676f68c07..ba9e457c04 100644
--- a/epan/dissectors/packet-dcerpc-eventlog.c
+++ b/epan/dissectors/packet-dcerpc-eventlog.c
@@ -311,7 +311,7 @@ eventlog_dissect_element_ReadEventLogW_data_(tvbuff_t *tvb, int offset, packet_i
* NDR encoded at all and there are byte offsets into this buffer
* encoded therein.
*/
- record_tvb=tvb_new_subset(tvb, offset, MIN((gint)len, tvb_length_remaining(tvb, offset)), len);
+ record_tvb=tvb_new_subset(tvb, offset, MIN((gint)len, tvb_captured_length_remaining(tvb, offset)), len);
eventlog_dissect_struct_Record(record_tvb, 0, pinfo, tree, di, drep, hf_eventlog_Record, 0);
offset+=len;
return offset;
@@ -336,7 +336,7 @@ eventlog_dissect_element_Record_sid_offset(tvbuff_t *tvb, int offset, packet_inf
/* this blob contains an NT SID.
* tvb starts at the beginning of the record.
*/
- sid_tvb=tvb_new_subset(tvb, sid_offset, MIN((gint)sid_length, tvb_length_remaining(tvb, offset)), sid_length);
+ sid_tvb=tvb_new_subset(tvb, sid_offset, MIN((gint)sid_length, tvb_captured_length_remaining(tvb, offset)), sid_length);
dissect_nt_sid(sid_tvb, 0, tree, "SID", NULL, -1);
}
return offset;
diff --git a/epan/dissectors/packet-dcerpc-frsrpc.c b/epan/dissectors/packet-dcerpc-frsrpc.c
index d0a08d00b4..8a392ecf5e 100644
--- a/epan/dissectors/packet-dcerpc-frsrpc.c
+++ b/epan/dissectors/packet-dcerpc-frsrpc.c
@@ -712,7 +712,7 @@ static int
frsrpc_dissect_struct_frsrpc_CommPktChunkCtr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info* di _U_, guint8 *drep _U_, int hf_index, guint32 param _U_)
{
guint32 nb_chunk = 0;
- guint32 remaining = tvb_length_remaining(tvb, offset);
+ guint32 remaining = tvb_captured_length_remaining(tvb, offset);
int align_status = di->no_align;
if (remaining > 0) {
proto_item *item = proto_tree_add_item(tree, hf_index, tvb, offset, -1, TRUE);
@@ -720,7 +720,7 @@ frsrpc_dissect_struct_frsrpc_CommPktChunkCtr(tvbuff_t *tvb, int offset, packet_i
di->no_align = 1;
for(nb_chunk = 0; remaining > 0; nb_chunk++) {
offset = frsrpc_dissect_struct_CommPktChunk(tvb, offset, pinfo, subtree, di, drep, hf_CommPktChunk, param);
- remaining = tvb_length_remaining(tvb, offset);
+ remaining = tvb_captured_length_remaining(tvb, offset);
}
di->no_align = align_status;
}
diff --git a/epan/dissectors/packet-dcerpc-krb5rpc.c b/epan/dissectors/packet-dcerpc-krb5rpc.c
index 06592c1e0f..f0ff8e2498 100644
--- a/epan/dissectors/packet-dcerpc-krb5rpc.c
+++ b/epan/dissectors/packet-dcerpc-krb5rpc.c
@@ -86,7 +86,7 @@ krb5rpc_dissect_sendto_kdc_rqst (tvbuff_t * tvb, int offset,
item = proto_tree_add_item (tree, hf_krb5rpc_krb5, tvb, offset, -1, ENC_NA);
subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
- remain = tvb_length_remaining(tvb, offset);
+ remain = tvb_captured_length_remaining(tvb, offset);
krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE, NULL);
@@ -131,7 +131,7 @@ krb5rpc_dissect_sendto_kdc_resp (tvbuff_t * tvb, int offset,
item = proto_tree_add_item (tree, hf_krb5rpc_krb5, tvb, offset, -1, ENC_NA);
subtree = proto_item_add_subtree (item, ett_krb5rpc_krb5);
- remain = tvb_length_remaining(tvb, offset);
+ remain = tvb_captured_length_remaining(tvb, offset);
krb5_tvb = tvb_new_subset (tvb, offset, remain, remain);
offset = dissect_kerberos_main (krb5_tvb, pinfo, subtree, TRUE, NULL);
diff --git a/epan/dissectors/packet-dcerpc-lsa.c b/epan/dissectors/packet-dcerpc-lsa.c
index 1afd1f0a20..a3de728115 100644
--- a/epan/dissectors/packet-dcerpc-lsa.c
+++ b/epan/dissectors/packet-dcerpc-lsa.c
@@ -1575,8 +1575,8 @@ lsarpc_dissect_element_lsa_DomainInfoEfs_efs_blob_(tvbuff_t *tvb _U_, int offset
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, di, drep,
hf_lsarpc_efs_blob_len, &reported_len);
len = reported_len;
- if (len > tvb_length_remaining(tvb, offset)) {
- len = tvb_length_remaining(tvb, offset);
+ if (len > tvb_captured_length_remaining(tvb, offset)) {
+ len = tvb_captured_length_remaining(tvb, offset);
}
next_tvb = tvb_new_subset(tvb, offset, len, reported_len);
efsblob_handle = find_dissector("efsblob");
diff --git a/epan/dissectors/packet-dcerpc-netlogon.c b/epan/dissectors/packet-dcerpc-netlogon.c
index c2ad75935e..20a92f55e8 100644
--- a/epan/dissectors/packet-dcerpc-netlogon.c
+++ b/epan/dissectors/packet-dcerpc-netlogon.c
@@ -7881,7 +7881,7 @@ dissect_packet_data(tvbuff_t *tvb ,tvbuff_t *auth_tvb _U_,
guint8* decrypted;
netlogon_auth_vars *vars;
netlogon_auth_key key;
- /*debugprintf("Dissection of request data offset %d len=%d on packet %d\n",offset,tvb_length_remaining(tvb,offset),pinfo->fd->num);*/
+ /*debugprintf("Dissection of request data offset %d len=%d on packet %d\n",offset,tvb_captured_length_remaining(tvb,offset),pinfo->fd->num);*/
generate_hash_key(pinfo,is_server,&key,NULL);
vars = (netlogon_auth_vars *)g_hash_table_lookup(netlogon_auths, &key);
@@ -7900,7 +7900,7 @@ dissect_packet_data(tvbuff_t *tvb ,tvbuff_t *auth_tvb _U_,
int data_len;
guint64 copyconfounder = vars->confounder;
- data_len = tvb_length_remaining(tvb,offset);
+ data_len = tvb_captured_length_remaining(tvb,offset);
if (data_len < 0) {
return NULL;
}
diff --git a/epan/dissectors/packet-dcerpc-nt.c b/epan/dissectors/packet-dcerpc-nt.c
index b80fcd589f..3ee19cc94d 100644
--- a/epan/dissectors/packet-dcerpc-nt.c
+++ b/epan/dissectors/packet-dcerpc-nt.c
@@ -90,7 +90,7 @@ dissect_ndr_datablob(tvbuff_t *tvb, int offset, packet_info *pinfo,
subtree = proto_item_add_subtree(item, ett_nt_data_blob);
if (use_remaining_space) {
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
} else {
offset = dissect_ndr_uint3264(tvb, offset, pinfo, subtree, di, drep,
hf_nt_data_blob_len, &len);
diff --git a/epan/dissectors/packet-dcerpc-rs_pgo.c b/epan/dissectors/packet-dcerpc-rs_pgo.c
index d072527587..c2919dd21f 100644
--- a/epan/dissectors/packet-dcerpc-rs_pgo.c
+++ b/epan/dissectors/packet-dcerpc-rs_pgo.c
@@ -982,7 +982,7 @@ rs_pgo_dissect_add_resp (tvbuff_t * tvb, int offset,
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
if (buff_remain > 8) {
@@ -1034,7 +1034,7 @@ rs_pgo_dissect_delete_resp (tvbuff_t * tvb, int offset,
[out] rs_cache_data_t *cache_info,
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add_member responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
@@ -1200,7 +1200,7 @@ rs_pgo_dissect_add_member_resp (tvbuff_t * tvb, int offset,
[out] error_status_t *status
*/
- buff_remain = tvb_length_remaining(tvb, offset);
+ buff_remain = tvb_captured_length_remaining(tvb, offset);
/* found several add responses that had 8 bytes of data. first was 4 0's and last was 3 zeros and a 1 */
if (buff_remain > 8) {
diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c
index 8cd5419057..585d5d26e7 100644
--- a/epan/dissectors/packet-dcerpc-spoolss.c
+++ b/epan/dissectors/packet-dcerpc-spoolss.c
@@ -1077,7 +1077,7 @@ dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
/* Get remaining data in buffer as a string */
- remaining = tvb_length_remaining(tvb, offset);
+ remaining = tvb_captured_length_remaining(tvb, offset);
if (remaining <= 0) {
if (data)
*data = g_strdup("");
@@ -4142,7 +4142,7 @@ dissect_FORM_1(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Eek - we need to know whether this pointer was NULL or not.
Currently there is not any way to do this. */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
goto done;
offset = dissect_ndr_uint32(
@@ -4485,7 +4485,7 @@ static int
SpoolssGeneric_r(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, dcerpc_info *di, guint8 *drep _U_)
{
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
proto_tree_add_text(tree, tvb, offset, 0,
"[Unimplemented dissector: SPOOLSS]");
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 1d7758fba4..42aa04f3a7 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -2758,7 +2758,7 @@ show_stub_data(tvbuff_t *tvb, gint offset, proto_tree *dcerpc_tree,
* bytes, the reported number of bytes, not the number of bytes
* that happen to be in the tvbuff.
*/
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
auth_pad_len = auth_info?auth_info->auth_pad_len:0;
length = tvb_reported_length_remaining(tvb, offset);
@@ -2923,7 +2923,7 @@ dcerpc_try_handoff(packet_info *pinfo, proto_tree *tree,
init_ndr_pointer_list(info);
- length = tvb_length(decrypted_tvb);
+ length = tvb_captured_length(decrypted_tvb);
reported_length = tvb_reported_length(decrypted_tvb);
/*
@@ -3164,7 +3164,7 @@ dissect_dcerpc_cn_auth(tvbuff_t *tvb, int stub_offset, packet_info *pinfo,
dcerpc_auth_subdissector_fns *auth_fns;
auth_tvb = tvb_new_subset(tvb, offset,
- MIN(hdr->auth_len,tvb_length_remaining(tvb, offset)),
+ MIN(hdr->auth_len,tvb_captured_length_remaining(tvb, offset)),
hdr->auth_len);
if ((auth_fns = get_auth_subdissector_fns(auth_info->auth_level,
@@ -3590,7 +3590,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
save_fragmented = pinfo->fragmented;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
reported_length = tvb_reported_length_remaining(tvb, offset);
if (reported_length < 0 ||
(guint32)reported_length < auth_info->auth_size) {
@@ -3608,8 +3608,8 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
/*XXX we should really make sure we calculate auth_info->auth_data
and use that one instead of this auth_tvb hack
*/
- if (tvb_length(tvb) == tvb_reported_length(tvb)) {
- if (tvb_length_remaining(tvb, offset+length) > 8) {
+ if (tvb_captured_length(tvb) == tvb_reported_length(tvb)) {
+ if (tvb_captured_length_remaining(tvb, offset+length) > 8) {
auth_tvb = tvb_new_subset_remaining(tvb, offset+length+8);
}
}
@@ -3649,7 +3649,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
"Encrypted stub data (%d byte%s)",
tvb_reported_length(payload_tvb),
- plurality(tvb_length(payload_tvb), "", "s"));
+ plurality(tvb_captured_length(payload_tvb), "", "s"));
add_new_data_source(
pinfo, result, "Decrypted stub data");
@@ -3679,7 +3679,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* debug output of essential fragment data. */
/* leave it here for future debugging sessions */
/*printf("DCE num:%u offset:%u frag_len:%u tvb_len:%u\n",
- pinfo->fd->num, offset, hdr->frag_len, tvb_length(decrypted_tvb));*/
+ pinfo->fd->num, offset, hdr->frag_len, tvb_captured_length(decrypted_tvb));*/
/* if we are not doing reassembly and this is the first fragment
then just dissect it and exit
@@ -3711,7 +3711,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
nor the first fragment then there is nothing more we can do
so we just have to exit
*/
- if ( !dcerpc_reassemble || (tvb_length(tvb) != tvb_reported_length(tvb)) )
+ if ( !dcerpc_reassemble || (tvb_captured_length(tvb) != tvb_reported_length(tvb)) )
goto end_cn_stub;
/* if we didn't get 'frame' we don't know where the PDU started and thus
@@ -3742,7 +3742,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
*/
fd_head = fragment_add_seq_next(&dcerpc_co_reassembly_table,
decrypted_tvb, 0, pinfo, frame, NULL,
- tvb_length(decrypted_tvb),
+ tvb_captured_length(decrypted_tvb),
hdr->flags&PFC_LAST_FRAG ? FALSE : TRUE /* more_frags */);
end_cn_stub:
@@ -4232,7 +4232,7 @@ dissect_dcerpc_cn_fault(tvbuff_t *tvb, gint offset, packet_info *pinfo,
proto_tree_add_expert(dcerpc_tree, pinfo, &ei_dcerpc_no_request_found, tvb, 0, 0);
}
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
/* as we now create a tvb in dissect_dcerpc_cn() containing only the
* stub_data, the following calculation is no longer valid:
* stub_length = hdr->frag_len - offset - auth_info.auth_size;
@@ -4393,7 +4393,7 @@ dissect_dcerpc_cn_rts(tvbuff_t *tvb, gint offset, packet_info *pinfo,
hf_dcerpc_cn_rts_commands_nb, &commands_nb);
/* Create the RTS PDU tree - we do not yet know its name */
- tf = proto_tree_add_text(dcerpc_tree, tvb, offset, tvb_length_remaining(tvb, offset), "RTS PDU: %u commands", commands_nb);
+ tf = proto_tree_add_text(dcerpc_tree, tvb, offset, tvb_captured_length_remaining(tvb, offset), "RTS PDU: %u commands", commands_nb);
cn_rts_pdu_tree = proto_item_add_subtree(tf, ett_dcerpc_cn_rts_pdu);
cmd = (guint32 *)wmem_alloc(wmem_packet_scope(), sizeof (guint32) * (commands_nb + 1));
@@ -4753,7 +4753,7 @@ dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (can_desegment && pinfo->can_desegment
&& !tvb_bytes_exist(tvb, start_offset, hdr.frag_len)) {
pinfo->desegment_offset = start_offset;
- pinfo->desegment_len = hdr.frag_len - tvb_length_remaining(tvb, start_offset);
+ pinfo->desegment_len = hdr.frag_len - tvb_captured_length_remaining(tvb, start_offset);
*pkt_len = 0; /* desegmentation required */
return TRUE;
}
@@ -4864,7 +4864,7 @@ dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,
* (and other functions might fail as well) computing the right start
* offset otherwise.
*/
- subtvb_len = MIN(hdr.frag_len, tvb_length(tvb));
+ subtvb_len = MIN(hdr.frag_len, tvb_captured_length(tvb));
fragment_tvb = tvb_new_subset(tvb, start_offset,
subtvb_len /* length */,
hdr.frag_len /* reported_length */);
@@ -5029,7 +5029,7 @@ dissect_dcerpc_cn_bs_body(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* it was just too short to tell and ask the TCP layer for more
* data. */
pinfo->desegment_offset = offset;
- pinfo->desegment_len = (guint32)(sizeof(e_dce_cn_common_hdr_t) - tvb_length_remaining(tvb, offset));
+ pinfo->desegment_len = (guint32)(sizeof(e_dce_cn_common_hdr_t) - tvb_captured_length_remaining(tvb, offset));
} else {
/* Really not DCE-RPC */
break;
@@ -5120,7 +5120,7 @@ dissect_dcerpc_dg_auth(tvbuff_t *tvb, int offset, proto_tree *dcerpc_tree,
* packet body, then dissect the auth info.
*/
offset += hdr->frag_len;
- if (tvb_length_remaining(tvb, offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset) > 0) {
switch (hdr->auth_proto) {
case DCE_C_RPC_AUTHN_PROTOCOL_KRB5:
@@ -5280,7 +5280,7 @@ dissect_dcerpc_dg_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
col_append_fstr(pinfo->cinfo, COL_INFO, " opnum: %u len: %u",
di->call_data->opnum, hdr->frag_len );
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
reported_length = tvb_reported_length_remaining(tvb, offset);
stub_length = hdr->frag_len;
if (length > stub_length)
@@ -5580,7 +5580,7 @@ dissect_dcerpc_dg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
* have an 80 byte header on them. Which starts with
* version (4), pkt_type.
*/
- if (tvb_length(tvb) < sizeof (hdr)) {
+ if (tvb_captured_length(tvb) < sizeof (hdr)) {
return FALSE;
}
diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c
index 363c5ab4e3..5d88f26d29 100644
--- a/epan/dissectors/packet-dcm.c
+++ b/epan/dissectors/packet-dcm.c
@@ -6713,7 +6713,7 @@ dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
offset += pdv_body_len;
}
else {
- guint next_tvb_length = tvb_length(next_tvb);
+ guint next_tvb_captured_length = tvb_captured_length(next_tvb);
/* Decode reassembled data */
if (tree || have_tap_listener(dicom_eo_tap)) {
@@ -6723,15 +6723,15 @@ dissect_dcm_pdv_fragmented(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
i.e Class & Instance UID, so the export dialog has all information and
that the dicom header is complete
*/
- offset += dissect_dcm_pdv_body(next_tvb, pinfo, tree, pdv, 0, next_tvb_length, pdv_description);
+ offset += dissect_dcm_pdv_body(next_tvb, pinfo, tree, pdv, 0, next_tvb_captured_length, pdv_description);
}
if (have_tap_listener(dicom_eo_tap)) {
/* Copy pure DICOM data to buffer, no PDV flags */
- pdv->data = g_malloc(next_tvb_length); /* will be freed in dcm_export_create_object() */
- tvb_memcpy(next_tvb, pdv->data, 0, next_tvb_length);
- pdv->data_len = next_tvb_length;
+ pdv->data = g_malloc(next_tvb_captured_length); /* will be freed in dcm_export_create_object() */
+ tvb_memcpy(next_tvb, pdv->data, 0, next_tvb_captured_length);
+ pdv->data_len = next_tvb_captured_length;
/* Copy to export buffer */
dcm_export_create_object(pinfo, assoc, pdv);
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c
index 2b30b1c8f4..71b5077801 100644
--- a/epan/dissectors/packet-dcp-etsi.c
+++ b/epan/dissectors/packet-dcp-etsi.c
@@ -175,7 +175,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void *
* Don't accept this packet unless at least a full AF header present(10 bytes).
* It should be possible to strengthen the heuristic further if need be.
*/
- if(tvb_length(tvb) < 11)
+ if(tvb_captured_length(tvb) < 11)
return FALSE;
word = tvb_get_ntohs(tvb,0);
@@ -188,7 +188,7 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void *
/* Clear out stuff in the info column */
col_clear(pinfo->cinfo, COL_INFO);
col_set_str (pinfo->cinfo, COL_PROTOCOL, "DCP (ETSI)");
- /*col_append_fstr (pinfo->cinfo, COL_INFO, " tvb %d", tvb_length(tvb));*/
+ /*col_append_fstr (pinfo->cinfo, COL_INFO, " tvb %d", tvb_captured_length(tvb));*/
if(tree) {
proto_item *ti = NULL;
@@ -338,11 +338,11 @@ dissect_pft_fec_detailed(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
NULL, tree);
}
}
- if(new_tvb && tvb_length(new_tvb) > 0) {
+ if(new_tvb && tvb_captured_length(new_tvb) > 0) {
gboolean decoded;
tvbuff_t *dtvb = NULL;
const guint8 *input = tvb_get_ptr(new_tvb, 0, -1);
- guint32 reassembled_size = tvb_length(new_tvb);
+ guint32 reassembled_size = tvb_captured_length(new_tvb);
guint8 *deinterleaved = (guint8*) g_malloc (reassembled_size);
guint8 *output = (guint8*) g_malloc (decoded_size);
rs_deinterleave(input, deinterleaved, plen, fcount);
@@ -503,7 +503,7 @@ dissect_pft(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
offset += 2;
if (fcount > 1) { /* fragmented*/
gboolean save_fragmented = pinfo->fragmented;
- guint16 real_len = tvb_length(tvb)-offset;
+ guint16 real_len = tvb_captured_length(tvb)-offset;
proto_tree_add_item (pft_tree, hf_edcp_pft_payload, tvb, offset, real_len, ENC_NA);
if(real_len != payload_len || real_len == 0) {
proto_item_append_text(li, " (length error (%d))", real_len);
@@ -551,7 +551,7 @@ dissect_af (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
offset += 2;
payload_len = tvb_get_ntohl(tvb, offset);
if (tree) {
- guint32 real_payload_len = tvb_length(tvb)-12;
+ guint32 real_payload_len = tvb_captured_length(tvb)-12;
li = proto_tree_add_item (af_tree, hf_edcp_len, tvb, offset, 4, ENC_BIG_ENDIAN);
if(real_payload_len < payload_len) {
proto_item_append_text (li, " (wrong len claims %d is %d)",
@@ -615,7 +615,7 @@ dissect_tpl(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
ti = proto_tree_add_item (tree, proto_tpl, tvb, 0, -1, ENC_NA);
tpl_tree = proto_item_add_subtree (ti, ett_tpl);
- while(offset<tvb_length(tvb)) {
+ while(offset<tvb_captured_length(tvb)) {
guint32 bits;
guint32 bytes;
char *tag = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 4, ENC_ASCII); offset += 4;
diff --git a/epan/dissectors/packet-ddtp.c b/epan/dissectors/packet-ddtp.c
index 5ac9ed54ba..19fa2d013a 100644
--- a/epan/dissectors/packet-ddtp.c
+++ b/epan/dissectors/packet-ddtp.c
@@ -96,7 +96,7 @@ dissect_ddtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
/*
* If we don't recognize the version number, don't dissect this.
*/
- if (tvb_length(tvb) >= 4) {
+ if (tvb_captured_length(tvb) >= 4) {
if (try_val_to_str(tvb_get_ntohl(tvb, 0), vals_ddtp_version) == NULL)
return 0;
}
@@ -161,7 +161,7 @@ dissect_ddtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
} else {
col_set_str(pinfo->cinfo, COL_INFO, "Encrypted payload");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-dec-dnart.c b/epan/dissectors/packet-dec-dnart.c
index bd8761ed51..1b7d1be171 100644
--- a/epan/dissectors/packet-dec-dnart.c
+++ b/epan/dissectors/packet-dec-dnart.c
@@ -624,7 +624,7 @@ do_hello_test_msg(
proto_tree_add_item(tree, hf_dec_rt_src_node, tvb,
my_offset, 2, ENC_LITTLE_ENDIAN);
my_offset += 2;
- remainder_count = tvb_length_remaining(tvb, my_offset);
+ remainder_count = tvb_captured_length_remaining(tvb, my_offset);
if (remainder_count != 0) {
proto_tree_add_item(tree, hf_dec_rt_test_data, tvb,
my_offset, remainder_count, ENC_NA);
@@ -651,7 +651,7 @@ do_routing_msg(
my_offset, 2, ENC_LITTLE_ENDIAN);
/* Skip the 1-byte reserved field */
my_offset += 3;
- remainder_count = tvb_length_remaining(tvb, my_offset);
+ remainder_count = tvb_captured_length_remaining(tvb, my_offset);
do {
/* if the remainder_count == 1, only the checksum remains */
count = tvb_get_letohs(tvb, my_offset);
@@ -1034,7 +1034,7 @@ handle_nsp_msg(
(ack_num & 0x1000) ? "NAK" : "ACK",
ack_num & 0xfff);
- if (tvb_length_remaining(tvb, my_offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, my_offset) > 0) {
ack_oth = tvb_get_letohs(tvb, my_offset);
if (ack_oth & 0x8000) {
/* There is an ack_oth field */
@@ -1058,7 +1058,7 @@ handle_nsp_msg(
ack_num & 0xfff);
my_offset += 2;
/* There may be an optional ack_dat field */
- if (tvb_length_remaining(tvb, my_offset) > 0) {
+ if (tvb_captured_length_remaining(tvb, my_offset) > 0) {
ack_dat = tvb_get_letohs(tvb, my_offset);
if (ack_dat & 0x8000) {
/* There is an ack_dat field */
diff --git a/epan/dissectors/packet-dect.c b/epan/dissectors/packet-dect.c
index 578d24c8e3..da6ce8bbe1 100644
--- a/epan/dissectors/packet-dect.c
+++ b/epan/dissectors/packet-dect.c
@@ -1273,7 +1273,7 @@ dissect_bfield(gboolean dect_packet_type _U_, guint8 ba,
proto_tree *BFDescrData = NULL;
guint8 bfield_data[DECT_BFIELD_DATA_SIZE];
- guint bfield_length = tvb_length_remaining(tvb, offset);
+ guint bfield_length = tvb_captured_length_remaining(tvb, offset);
if (bfield_length > DECT_BFIELD_DATA_SIZE)
bfield_length = DECT_BFIELD_DATA_SIZE;
@@ -1953,7 +1953,7 @@ dissect_dect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "DECT");
- pkt_len=tvb_length(tvb);
+ pkt_len=tvb_captured_length(tvb);
if(pkt_len<=DECT_PACKET_INFO_LEN)
{
diff --git a/epan/dissectors/packet-devicenet.c b/epan/dissectors/packet-devicenet.c
index b5c669754e..de70607833 100644
--- a/epan/dissectors/packet-devicenet.c
+++ b/epan/dissectors/packet-devicenet.c
@@ -784,7 +784,7 @@ static int dissect_devicenet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
"Invalid CAN Message 0x%04X", can_id.id);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_devicenet(void)
diff --git a/epan/dissectors/packet-dhcp-failover.c b/epan/dissectors/packet-dhcp-failover.c
index 54305653f9..736b22af4d 100644
--- a/epan/dissectors/packet-dhcp-failover.c
+++ b/epan/dissectors/packet-dhcp-failover.c
@@ -470,7 +470,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
return offset; /* payload offset was bogus */
if (!tree)
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/* if there are any additional header bytes */
if (poffset != offset) {
@@ -872,7 +872,7 @@ dissect_dhcpfo_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
offset += option_length;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -880,7 +880,7 @@ dissect_dhcpfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, dhcpfo_desegment, 2,
get_dhcpfo_pdu_len, dissect_dhcpfo_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index 66d493ce9c..af6ad80e8a 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -2016,7 +2016,7 @@ dissect_dhcpv6_bulk_leasequery_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset += dhcpv6_option(tvb, pinfo, option_tree, FALSE, offset,
end, &at_end, proto_dhcpv6_bulk_leasequery);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -2024,7 +2024,7 @@ dissect_dhcpv6_bulk_leasequery(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
{
tcp_dissect_pdus(tvb, pinfo, tree, dhcpv6_bulk_leasequery_desegment, 2,
get_dhcpv6_bulk_leasequery_pdu_len, dissect_dhcpv6_bulk_leasequery_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index b73856950f..fdc0ba1e9e 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -387,7 +387,7 @@ dissect_diameter_eap_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
call_dissector(eap_handle, tvb, pinfo, tree);
col_set_writable(pinfo->cinfo, save_writable);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* http://www.3gpp2.org/public_html/X/VSA-VSE.cfm */
@@ -677,10 +677,10 @@ address_rfc_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *dia
{
char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
address_avp_t *t = (address_avp_t *)a->type_data;
- proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_BIG_ENDIAN);
+ proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length(tvb),ENC_BIG_ENDIAN);
proto_tree *pt = proto_item_add_subtree(pi,t->ett);
guint32 addr_type = tvb_get_ntohs(tvb,0);
- gint len = tvb_length_remaining(tvb,2);
+ gint len = tvb_captured_length_remaining(tvb,2);
proto_tree_add_item(pt,t->hf_address_type,tvb,0,2,ENC_NA);
switch (addr_type ) {
@@ -734,7 +734,7 @@ proto_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_
static const char *
time_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_)
{
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item *pi;
@@ -755,9 +755,9 @@ address_v16_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *dia
{
char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
address_avp_t *t = (address_avp_t *)a->type_data;
- proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_BIG_ENDIAN);
+ proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length(tvb),ENC_BIG_ENDIAN);
proto_tree *pt = proto_item_add_subtree(pi,t->ett);
- guint32 len = tvb_length(tvb);
+ guint32 len = tvb_captured_length(tvb);
switch (len) {
case 4:
@@ -783,7 +783,7 @@ static const char *
simple_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_)
{
char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
- proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_BIG_ENDIAN);
+ proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length(tvb),ENC_BIG_ENDIAN);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
return label;
@@ -793,7 +793,7 @@ static const char *
utf8_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf _U_)
{
char *label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
- proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length(tvb),ENC_UTF_8|ENC_BIG_ENDIAN);
+ proto_item *pi = proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length(tvb),ENC_UTF_8|ENC_BIG_ENDIAN);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
return label;
@@ -806,9 +806,9 @@ integer32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 4) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -832,9 +832,9 @@ integer64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 8) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -858,9 +858,9 @@ unsigned32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 4) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -884,9 +884,9 @@ unsigned64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 8) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -910,9 +910,9 @@ float32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_su
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 4) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -936,9 +936,9 @@ float64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_su
proto_item *pi;
/* Verify length before adding */
- gint length = tvb_length_remaining(tvb,0);
+ gint length = tvb_captured_length_remaining(tvb,0);
if (length == 8) {
- pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_length_remaining(tvb,0),ENC_BIG_ENDIAN);
+ pi= proto_tree_add_item(c->tree,a->hf_value,tvb,0,tvb_captured_length_remaining(tvb,0),ENC_BIG_ENDIAN);
label = (char *)wmem_alloc(wmem_packet_scope(), ITEM_LABEL_LENGTH+1);
proto_item_fill_label(PITEM_FINFO(pi), label);
label = strstr(label,": ")+2;
@@ -959,7 +959,7 @@ static const char *
grouped_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb, diam_sub_dis_t *diam_sub_dis_inf)
{
int offset = 0;
- int len = tvb_length(tvb);
+ int len = tvb_captured_length(tvb);
proto_item *pi = proto_tree_add_item(c->tree, a->hf_value, tvb , 0 , -1, ENC_BIG_ENDIAN);
proto_tree *pt = c->tree;
@@ -1229,7 +1229,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
export_diameter_pdu(pinfo,tvb);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -1246,7 +1246,7 @@ check_diameter(tvbuff_t *tvb)
guint8 flags;
/* Ensure we don't throw an exception trying to do these heuristics */
- if (tvb_length(tvb) < 5)
+ if (tvb_captured_length(tvb) < 5)
return FALSE;
/* Check if the Diameter version is 1 */
@@ -1299,7 +1299,7 @@ dissect_diameter_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
get_diameter_pdu_len, dissect_diameter_common, data);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-diameter_3gpp.c b/epan/dissectors/packet-diameter_3gpp.c
index 74370a53ab..b00898af37 100644
--- a/epan/dissectors/packet-diameter_3gpp.c
+++ b/epan/dissectors/packet-diameter_3gpp.c
@@ -275,7 +275,7 @@ dissect_diameter_3gpp_visited_nw_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto
proto_item* item;
int offset = 0, i;
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
for(i = 0; i < length; i++)
if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
@@ -489,7 +489,7 @@ dissect_diameter_3gpp_path(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
proto_item* item;
proto_tree *sub_tree;
int offset = 0, comma_offset;
- int end_offset = tvb_length(tvb) - 1;
+ int end_offset = tvb_captured_length(tvb) - 1;
item = proto_tree_add_text(tree, tvb, offset, -1,"Paths");
sub_tree = proto_item_add_subtree(item,diameter_3gpp_path_ett);
@@ -505,7 +505,7 @@ dissect_diameter_3gpp_path(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* AVP Code: 641 Contact
@@ -524,7 +524,7 @@ dissect_diameter_3gpp_contact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
item = proto_tree_add_item(tree, hf_diameter_3gpp_contact, tvb, offset, -1, ENC_ASCII|ENC_NA);
PROTO_ITEM_SET_GENERATED(item);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* AVP Code: 701 MSISDN */
@@ -535,7 +535,7 @@ dissect_diameter_3gpp_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
proto_tree *sub_tree;
int offset = 0;
const char *digit_str;
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
item = proto_tree_add_item(tree, hf_diameter_3gpp_msisdn, tvb, offset, length, ENC_NA);
sub_tree = proto_item_add_subtree(item,diameter_3gpp_msisdn_ett);
@@ -545,7 +545,7 @@ dissect_diameter_3gpp_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
digit_str = unpack_digits(tvb, 1);
proto_tree_add_string(sub_tree, hf_diameter_address_digits, tvb, 1, -1, digit_str);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -560,7 +560,7 @@ dissect_diameter_3gpp_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
static int
dissect_diameter_3gpp_user_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
/* If there is less than 38 characters this is not XML
* <?xml version="1.0" encoding="UTF-8"?>
@@ -584,7 +584,7 @@ dissect_diameter_3gpp_service_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_t
proto_item* item;
int offset = 0, i;
- int length = tvb_length(tvb);
+ int length = tvb_captured_length(tvb);
for(i = 0; i < length; i++)
if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
@@ -660,7 +660,7 @@ dissect_diameter_3gpp_rai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tre
int offset = 0;
guint length;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if(length==12){
diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MNC %s, MCC %s, LAC 0x%s, RAC 0x%s",
@@ -700,7 +700,7 @@ dissect_diameter_3gpp_mbms_required_qos(tvbuff_t *tvb, packet_info *pinfo, proto
*/
proto_tree_add_item(tree, hf_diameter_3gpp_mbms_required_qos_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- length = tvb_length(tvb) - 1;
+ length = tvb_captured_length(tvb) - 1;
de_sm_qos(tvb, tree, pinfo, offset,length, NULL, 0);
return offset+length;
diff --git a/epan/dissectors/packet-disp.c b/epan/dissectors/packet-disp.c
index 884d5f729d..1e8e829faf 100644
--- a/epan/dissectors/packet-disp.c
+++ b/epan/dissectors/packet-disp.c
@@ -1570,7 +1570,7 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DISP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(disp_dissector) {
@@ -1586,7 +1586,7 @@ dissect_disp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-distcc.c b/epan/dissectors/packet-distcc.c
index 196ca7a92d..537c262c2a 100644
--- a/epan/dissectors/packet-distcc.c
+++ b/epan/dissectors/packet-distcc.c
@@ -63,8 +63,8 @@ void proto_register_distcc(void);
extern void proto_reg_handoff_distcc(void);
#define CHECK_PDU_LEN(x) \
- if(parameter>tvb_length_remaining(tvb, offset) || parameter < 1){\
- len=tvb_length_remaining(tvb, offset);\
+ if(parameter>tvb_captured_length_remaining(tvb, offset) || parameter < 1){\
+ len=tvb_captured_length_remaining(tvb, offset);\
col_append_str(pinfo->cinfo, COL_INFO, "[Short" x " PDU]");\
} \
tvb_ensure_bytes_exist(tvb, offset, len);
@@ -73,11 +73,11 @@ extern void proto_reg_handoff_distcc(void);
#define DESEGMENT_TCP(x) \
if(distcc_desegment && pinfo->can_desegment){\
/* only attempt reassembly if whe have the full segment */\
- if(tvb_length_remaining(tvb, offset)==tvb_reported_length_remaining(tvb, offset)){\
- if(parameter>tvb_length_remaining(tvb, offset)){\
+ if(tvb_captured_length_remaining(tvb, offset)==tvb_reported_length_remaining(tvb, offset)){\
+ if(parameter>tvb_captured_length_remaining(tvb, offset)){\
proto_tree_add_text(tree, tvb, offset-12, -1, "[Short " x " PDU]");\
pinfo->desegment_offset=offset-12;\
- pinfo->desegment_len=parameter-tvb_length_remaining(tvb, offset);\
+ pinfo->desegment_len=parameter-tvb_captured_length_remaining(tvb, offset);\
return offset+len;\
}\
}\
diff --git a/epan/dissectors/packet-dlm3.c b/epan/dissectors/packet-dlm3.c
index c64d521543..3f1bd488f8 100644
--- a/epan/dissectors/packet-dlm3.c
+++ b/epan/dissectors/packet-dlm3.c
@@ -760,7 +760,7 @@ dissect_dlm3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
/* Check that there's enough data */
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length < 4 + 4 + 4 + 2 + 1 + 1)
return 0;
@@ -839,7 +839,7 @@ dissect_dlm3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d
dissect_dlm3_rcom(tvb, pinfo, sub_tree, length, offset);
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-dlsw.c b/epan/dissectors/packet-dlsw.c
index 2aec7bb2c8..595b9b47bc 100644
--- a/epan/dissectors/packet-dlsw.c
+++ b/epan/dissectors/packet-dlsw.c
@@ -406,7 +406,7 @@ dissect_dlsw_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -540,7 +540,7 @@ dissect_dlsw_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
}
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 4, get_dlsw_pdu_len, dissect_dlsw_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c
index 03f8ba1933..c258b47254 100644
--- a/epan/dissectors/packet-dmp.c
+++ b/epan/dissectors/packet-dmp.c
@@ -2630,7 +2630,7 @@ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo,
if (dmp.ack_rec_present) {
/* Recipient List */
- rec_len = tvb_length (tvb);
+ rec_len = tvb_captured_length (tvb);
if (dmp.checksum) {
rec_len -= 2;
}
@@ -3118,7 +3118,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
offset += 1;
}
- len = tvb_length_remaining (tvb, offset);
+ len = tvb_captured_length_remaining (tvb, offset);
if (dmp.checksum) {
len -= 2;
}
@@ -3141,7 +3141,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo,
dmp.body_format == FREE_TEXT_SUBJECT)) {
if (compr_alg == ALGORITHM_ZLIB) {
if ((body_tvb = tvb_child_uncompress (tvb, tvb, offset, len)) != NULL) {
- body_len = tvb_length (body_tvb);
+ body_len = tvb_captured_length (body_tvb);
add_new_data_source (pinfo, body_tvb, "Uncompressed User data");
tf = proto_tree_add_item (message_tree, hf_message_body_data,
body_tvb, 0, body_len, ENC_NA);
@@ -3839,7 +3839,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo,
offset = dissect_dmp_message (tvb, pinfo, dmp_tree, offset);
} else if (dmp.msg_type == REPORT) {
/* One or more Delivery Report or Non-Delivery Report Data */
- rep_len = tvb_length (tvb);
+ rep_len = tvb_captured_length (tvb);
if (dmp.checksum) {
rep_len -= 2;
}
@@ -3934,7 +3934,7 @@ static int dissect_dmp (tvbuff_t *tvb, packet_info *pinfo,
}
if (dmp.checksum) {
- length = tvb_length (tvb);
+ length = tvb_captured_length (tvb);
checksum1 = crc16_x25_ccitt_tvb (tvb, length - 2);
checksum2 = tvb_get_ntohs (tvb, offset);
diff --git a/epan/dissectors/packet-dmx-sip.c b/epan/dissectors/packet-dmx-sip.c
index 220dc9938e..5801682a2f 100644
--- a/epan/dissectors/packet-dmx-sip.c
+++ b/epan/dissectors/packet-dmx-sip.c
@@ -187,7 +187,7 @@ dissect_dmx_sip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 1;
- if (offset < tvb_length(tvb))
+ if (offset < tvb_captured_length(tvb))
proto_tree_add_item(dmx_sip_tree, hf_dmx_sip_trailer, tvb,
offset, -1, ENC_NA);
}
diff --git a/epan/dissectors/packet-dmx.c b/epan/dissectors/packet-dmx.c
index bf1a4c6773..f5e2c05658 100644
--- a/epan/dissectors/packet-dmx.c
+++ b/epan/dissectors/packet-dmx.c
@@ -103,7 +103,7 @@ dissect_dmx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
call_dissector(dmx_sip_handle, next_tvb, pinfo, tree);
break;
default:
- if (offset < tvb_length(tvb))
+ if (offset < tvb_captured_length(tvb))
call_dissector(data_handle, next_tvb, pinfo, tree);
break;
}
diff --git a/epan/dissectors/packet-dnp.c b/epan/dissectors/packet-dnp.c
index d915f08af6..94b640f438 100644
--- a/epan/dissectors/packet-dnp.c
+++ b/epan/dissectors/packet-dnp.c
@@ -1813,7 +1813,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
if (num_items < 0) {
proto_item_append_text(range_item, " (bogus)");
expert_add_info(pinfo, range_item, &ei_dnp_num_items_neg);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -2788,7 +2788,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
proto_tree_add_text(object_tree, tvb, offset, -1,
"Unknown Data Chunk, %u Bytes", tvb_reported_length_remaining(tvb, offset));
- offset = tvb_length(tvb); /* Finish decoding if unknown object is encountered... */
+ offset = tvb_captured_length(tvb); /* Finish decoding if unknown object is encountered... */
break;
}
/* Increment the bit index for next time */
@@ -2799,7 +2799,7 @@ dnp3_al_process_object(tvbuff_t *tvb, packet_info *pinfo, int offset,
}
if (start_offset > offset) {
expert_add_info(pinfo, point_item, &ei_dnp_invalid_length);
- offset = tvb_length(tvb); /* Finish decoding if unknown object is encountered... */
+ offset = tvb_captured_length(tvb); /* Finish decoding if unknown object is encountered... */
}
}
}
@@ -2824,7 +2824,7 @@ dissect_dnp3_al(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
nstime_set_zero (&al_cto);
- data_len = tvb_length(tvb);
+ data_len = tvb_captured_length(tvb);
/* Handle the control byte and function code */
al_ctl = tvb_get_guint8(tvb, offset);
@@ -3398,7 +3398,7 @@ dissect_dnp3_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -3423,7 +3423,7 @@ get_dnp3_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static gboolean
dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a dnp packet. It should begin with 0x0564 */
if ((length < 2) || (tvb_get_ntohs(tvb, 0) != 0x0564)) {
@@ -3440,7 +3440,7 @@ dissect_dnp3_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
static gboolean
dissect_dnp3_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- gint length = tvb_length(tvb);
+ gint length = tvb_captured_length(tvb);
/* Check for a dnp packet. It should begin with 0x0564 */
if ((length < 2) || (tvb_get_ntohs(tvb, 0) != 0x0564)) {
diff --git a/epan/dissectors/packet-dop.c b/epan/dissectors/packet-dop.c
index 3b43aedc0a..ed0ce5a7ab 100644
--- a/epan/dissectors/packet-dop.c
+++ b/epan/dissectors/packet-dop.c
@@ -2032,7 +2032,7 @@ call_dop_oid_callback(const char *base_string, tvbuff_t *tvb, int offset, packet
proto_item *item=NULL;
proto_tree *next_tree=NULL;
- item = proto_tree_add_text(tree, tvb, 0, tvb_length_remaining(tvb, offset), "Dissector for parameter %s OID:%s not implemented. Contact Wireshark developers if you want this supported", base_string, binding_type ? binding_type : "<empty>");
+ item = proto_tree_add_text(tree, tvb, 0, tvb_captured_length_remaining(tvb, offset), "Dissector for parameter %s OID:%s not implemented. Contact Wireshark developers if you want this supported", base_string, binding_type ? binding_type : "<empty>");
if (item) {
next_tree = proto_item_add_subtree(item, ett_dop_unknown);
}
@@ -2141,7 +2141,7 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DOP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(dop_dissector) {
@@ -2157,7 +2157,7 @@ dissect_dop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-dplay.c b/epan/dissectors/packet-dplay.c
index ff29751754..5ab25f296b 100644
--- a/epan/dissectors/packet-dplay.c
+++ b/epan/dissectors/packet-dplay.c
@@ -1153,7 +1153,7 @@ static gboolean heur_dissect_dplay(tvbuff_t *tvb, packet_info *pinfo, proto_tree
{
guint32 dplay_id, token;
- if(tvb_length(tvb) < 25)
+ if(tvb_captured_length(tvb) < 25)
return FALSE;
/* The string play = 0x706c6179 */
diff --git a/epan/dissectors/packet-dpnss-link.c b/epan/dissectors/packet-dpnss-link.c
index a73293f11c..1b9224c905 100644
--- a/epan/dissectors/packet-dpnss-link.c
+++ b/epan/dissectors/packet-dpnss-link.c
@@ -141,7 +141,7 @@ dissect_dpnss_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (octet){
case FRAME_TYPE_UI_EVEN:
case FRAME_TYPE_UI_ODD:
- protocol_data_length=tvb_length(tvb)-LINK_HEADER_SIZE;
+ protocol_data_length=tvb_captured_length(tvb)-LINK_HEADER_SIZE;
protocol_data_tvb=tvb_new_subset_length(tvb, LINK_HEADER_SIZE,
protocol_data_length);
if (dpnss_handle && protocol_data_length>0) {
diff --git a/epan/dissectors/packet-dpnss.c b/epan/dissectors/packet-dpnss.c
index e608b01860..2c92526fff 100644
--- a/epan/dissectors/packet-dpnss.c
+++ b/epan/dissectors/packet-dpnss.c
@@ -1077,7 +1077,7 @@ dissect_dpnss_sup_info_str(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
gboolean last_string = FALSE;
gboolean has_par;
- tvb_end_offset = tvb_length(tvb);
+ tvb_end_offset = tvb_captured_length(tvb);
str_no = 1;
while ((offset<tvb_end_offset)&&(last_string == FALSE)) {
@@ -1166,7 +1166,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int tvb_end_offset;
guint8 octet;
- tvb_end_offset = tvb_length(tvb);
+ tvb_end_offset = tvb_captured_length(tvb);
proto_tree_add_item(tree, hf_dpnss_LbL_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
octet = tvb_get_guint8(tvb,offset)&0x0f;
@@ -1182,7 +1182,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1194,7 +1194,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_end_offset>offset) {
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
}
@@ -1211,7 +1211,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1228,7 +1228,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1239,7 +1239,7 @@ dissect_dpnss_LbL_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1261,7 +1261,7 @@ dissect_dpnss_e2e_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int tvb_end_offset;
guint8 octet;
- tvb_end_offset = tvb_length(tvb);
+ tvb_end_offset = tvb_captured_length(tvb);
proto_tree_add_item(tree, hf_dpnss_e2e_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
octet = tvb_get_guint8(tvb,offset)&0x0f;
@@ -1277,7 +1277,7 @@ dissect_dpnss_e2e_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1292,7 +1292,7 @@ dissect_dpnss_e2e_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_end_offset>offset) {
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
}
@@ -1316,7 +1316,7 @@ dissect_dpnss_e2e_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
sel_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Selection Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset);
break;
@@ -1358,7 +1358,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int tvb_end_offset;
guint8 octet;
- tvb_end_offset = tvb_length(tvb);
+ tvb_end_offset = tvb_captured_length(tvb);
proto_tree_add_item(tree, hf_dpnss_cc_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
octet = tvb_get_guint8(tvb,offset)&0x0f;
offset++;
@@ -1393,7 +1393,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
*/
sel_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Selection Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset);
break;
@@ -1403,7 +1403,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field (Optional) */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
}
@@ -1416,7 +1416,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Indication Field */
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
break;
@@ -1430,7 +1430,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_end_offset>offset) {
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
}
@@ -1443,7 +1443,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_end_offset>offset) {
ind_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Indication Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
ind_field_tree = proto_item_add_subtree(ind_field_item, ett_dpnss_ind_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, ind_field_tree, offset);
}
@@ -1453,7 +1453,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Selection Field */
sel_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Selection Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset);
break;
@@ -1463,7 +1463,7 @@ dissect_dpnss_cc_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tvb_end_offset>offset) {
sel_field_item = proto_tree_add_text(tree, tvb, offset, -1,
"Selection Field: %s",
- tvb_format_text(tvb,offset,tvb_length_remaining(tvb, offset)));
+ tvb_format_text(tvb,offset,tvb_captured_length_remaining(tvb, offset)));
sel_field_tree = proto_item_add_subtree(sel_field_item, ett_dpnss_sel_field);
offset = dissect_dpnss_sup_info_str(tvb, pinfo, sel_field_tree, offset);
}
diff --git a/epan/dissectors/packet-drda.c b/epan/dissectors/packet-drda.c
index c82565c771..93eb7ccb4f 100644
--- a/epan/dissectors/packet-drda.c
+++ b/epan/dissectors/packet-drda.c
@@ -694,7 +694,7 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
iPreviousFrameNumber = pinfo->fd->num;
/* There may be multiple DRDA commands in one frame */
- while ((guint) (offset + 10) <= tvb_length(tvb))
+ while ((guint) (offset + 10) <= tvb_captured_length(tvb))
{
iCommand = tvb_get_ntohs(tvb, offset + 8);
iLength = tvb_get_ntohs(tvb, offset + 0);
@@ -747,11 +747,11 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
/* The number of attributes is variable */
for (offset += 10; offset < iCommandEnd; )
{
- if (tvb_length_remaining(tvb, offset) >= 2)
+ if (tvb_captured_length_remaining(tvb, offset) >= 2)
{
iLengthParam = tvb_get_ntohs(tvb, offset + 0);
if (iLengthParam == 0 || iLengthParam == 1) iLengthParam = iLength - 10;
- if (tvb_length_remaining(tvb, offset) >= iLengthParam)
+ if (tvb_captured_length_remaining(tvb, offset) >= iLengthParam)
{
iParameterCP = tvb_get_ntohs(tvb, offset + 2);
ti = proto_tree_add_text(drdaroot_tree, tvb, offset, iLengthParam,
@@ -787,13 +787,13 @@ dissect_drda(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
get_drda_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
{
- if (tvb_length_remaining(tvb, offset) >= 10)
+ if (tvb_captured_length_remaining(tvb, offset) >= 10)
{
return (tvb_get_ntohs(tvb, offset));
}
@@ -804,7 +804,7 @@ static int
dissect_drda_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, drda_desegment, 10, get_drda_pdu_len, dissect_drda, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -812,7 +812,7 @@ static gboolean
dissect_drda_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
conversation_t * conversation;
- if (tvb_length(tvb) >= 10)
+ if (tvb_captured_length(tvb) >= 10)
{
/* The first header is 6 bytes long, so the length in the second header should 6 bytes less */
guint16 cOuterLength, cInnerLength;
diff --git a/epan/dissectors/packet-dsi.c b/epan/dissectors/packet-dsi.c
index 3271105fec..e022cda4ee 100644
--- a/epan/dissectors/packet-dsi.c
+++ b/epan/dissectors/packet-dsi.c
@@ -326,7 +326,7 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -340,7 +340,7 @@ get_dsi_pdu_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
if ( dsi_flags > DSIFL_MAX || !dsi_command || dsi_command > DSIFUNC_MAX)
{
/* it's not a known dsi pdu start sequence */
- return tvb_length_remaining(tvb, offset);
+ return tvb_captured_length_remaining(tvb, offset);
}
/*
@@ -361,7 +361,7 @@ dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tcp_dissect_pdus(tvb, pinfo, tree, dsi_desegment, 12,
get_dsi_pdu_len, dissect_dsi_packet, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-dsp.c b/epan/dissectors/packet-dsp.c
index 5ffdade71e..89ceeee9e2 100644
--- a/epan/dissectors/packet-dsp.c
+++ b/epan/dissectors/packet-dsp.c
@@ -1859,7 +1859,7 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
break;
default:
proto_tree_add_text(tree, tvb, offset, -1,"Unsupported DSP PDU");
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
if(dsp_dissector) {
@@ -1875,7 +1875,7 @@ dissect_dsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* da
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-dtls.c b/epan/dissectors/packet-dtls.c
index 854c35866d..5316e73d0e 100644
--- a/epan/dissectors/packet-dtls.c
+++ b/epan/dissectors/packet-dtls.c
@@ -593,7 +593,7 @@ dissect_dtls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* looks like something unknown, so lump into
* continuation data
*/
- offset = tvb_length(tvb);
+ offset = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_INFO,
"Continuation Data");
@@ -616,7 +616,7 @@ dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
{
/* Stronger confirmation of DTLS packet is provided by verifying the
* captured payload length against the remainder of the UDP packet size. */
- guint length = tvb_length(tvb);
+ guint length = tvb_captured_length(tvb);
guint offset = 0;
if (tvb_reported_length(tvb) == length) {
@@ -639,12 +639,12 @@ dissect_dtls_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* This packet was truncated by the capture process due to a snapshot
* length - do our best with what we've got. */
- while (tvb_length_remaining(tvb, offset) >= 3) {
+ while (tvb_captured_length_remaining(tvb, offset) >= 3) {
if (!looks_like_dtls(tvb, offset))
return FALSE;
offset += 3;
- if (tvb_length_remaining(tvb, offset) >= 10 ) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 10 ) {
offset += tvb_get_ntohs(tvb, offset + 8) + 10;
} else {
/* Dissect what we've got, which might be as little as 3 bytes. */
@@ -988,7 +988,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
decrypted = ssl_get_record_info(tvb, proto_dtls, pinfo, offset);
if (decrypted) {
dissect_dtls_handshake(decrypted, pinfo, dtls_record_tree, 0,
- tvb_length(decrypted), session, is_from_server,
+ tvb_captured_length(decrypted), session, is_from_server,
ssl, content_type);
add_new_data_source(pinfo, decrypted, "Decrypted SSL record");
} else {
@@ -1082,7 +1082,7 @@ dissect_dtls_record(tvbuff_t *tvb, packet_info *pinfo,
decrypted = ssl_get_record_info(tvb, proto_dtls, pinfo, offset);
if (decrypted) {
dissect_dtls_heartbeat(decrypted, pinfo, dtls_record_tree, 0,
- session, tvb_length (decrypted), TRUE);
+ session, tvb_captured_length (decrypted), TRUE);
add_new_data_source(pinfo, decrypted, "Decrypted SSL record");
} else {
dissect_dtls_heartbeat(tvb, pinfo, dtls_record_tree, offset,
diff --git a/epan/dissectors/packet-dtn.c b/epan/dissectors/packet-dtn.c
index a42839ba82..98720a5624 100644
--- a/epan/dissectors/packet-dtn.c
+++ b/epan/dissectors/packet-dtn.c
@@ -1771,7 +1771,7 @@ dissect_dtn_contact_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
proto_tree_add_item(conv_tree, hf_contact_hdr_local_eid, tvb, sdnv_length + offset, eid_length, ENC_NA|ENC_ASCII);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -1901,7 +1901,7 @@ dissect_tcpcl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
if (bundle_size == 0) {
/*Couldn't parse bundle, treat as raw data */
call_dissector(data_handle, new_tvb, pinfo, sub_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
else {
@@ -1958,7 +1958,7 @@ dissect_tcpcl_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -2015,7 +2015,7 @@ dissect_tcpcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
}
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 8, get_dtn_contact_header_len, dissect_dtn_contact_header, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Not for us */
@@ -2023,7 +2023,7 @@ dissect_tcpcl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
};
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 1, get_tcpcl_pdu_len, dissect_tcpcl_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
diff --git a/epan/dissectors/packet-dtpt.c b/epan/dissectors/packet-dtpt.c
index ec15f36b7c..7a5a094e10 100644
--- a/epan/dissectors/packet-dtpt.c
+++ b/epan/dissectors/packet-dtpt.c
@@ -824,7 +824,7 @@ dissect_dtpt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_reg_handoff_dtpt(void);
diff --git a/epan/dissectors/packet-dua.c b/epan/dissectors/packet-dua.c
index b42b49470e..ba419193e1 100644
--- a/epan/dissectors/packet-dua.c
+++ b/epan/dissectors/packet-dua.c
@@ -466,11 +466,11 @@ dissect_parameter(tvbuff_t *parameter_tvb, packet_info *pinfo, proto_tree *tree,
/* extract tag and length from the parameter */
tag = tvb_get_ntohs(parameter_tvb, PARAMETER_TAG_OFFSET);
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
- padding_length = tvb_length(parameter_tvb) - length;
+ padding_length = tvb_captured_length(parameter_tvb) - length;
/* create proto_tree stuff */
parameter_item = proto_tree_add_text(dua_tree, parameter_tvb, PARAMETER_HEADER_OFFSET,
- tvb_length(parameter_tvb), "%s",
+ tvb_captured_length(parameter_tvb), "%s",
val_to_str_const(tag, parameter_tag_values, "Unknown parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_dua_parameter);
@@ -543,7 +543,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, packet_info *pinfo, proto_tree *tre
tvbuff_t *parameter_tvb;
offset = 0;
- while((remaining_length = tvb_length_remaining(parameters_tvb, offset))) {
+ while((remaining_length = tvb_captured_length_remaining(parameters_tvb, offset))) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
if (remaining_length >= length)
diff --git a/epan/dissectors/packet-dvb-s2-bb.c b/epan/dissectors/packet-dvb-s2-bb.c
index 5319b0d1b2..e69643af49 100644
--- a/epan/dissectors/packet-dvb-s2-bb.c
+++ b/epan/dissectors/packet-dvb-s2-bb.c
@@ -701,7 +701,7 @@ static gboolean test_dvb_s2_crc(tvbuff_t *tvb, guint offset) {
guint8 input8;
/* only check BB Header and return */
- if (tvb_length(tvb) < (offset + DVB_S2_BB_HEADER_LEN))
+ if (tvb_captured_length(tvb) < (offset + DVB_S2_BB_HEADER_LEN))
return FALSE;
input8 = tvb_get_guint8(tvb, offset + DVB_S2_BB_OFFS_CRC);
@@ -821,7 +821,7 @@ static int dissect_dvb_s2_modeadapt(tvbuff_t *tvb, packet_info *pinfo, proto_tre
guint8 byte;
/* Check that there's enough data */
- if (tvb_length(tvb) < 1)
+ if (tvb_captured_length(tvb) < 1)
return 0;
/* Check if first byte is valid for this dissector */
diff --git a/epan/dissectors/packet-dvbci.c b/epan/dissectors/packet-dvbci.c
index b4fcee3ecf..fb708023c0 100644
--- a/epan/dissectors/packet-dvbci.c
+++ b/epan/dissectors/packet-dvbci.c
@@ -4993,7 +4993,7 @@ dissect_dvbci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
proto_item *pi;
guint8 hw_event;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return 0;
offset_ver = offset;
diff --git a/epan/dissectors/packet-dvmrp.c b/epan/dissectors/packet-dvmrp.c
index 6870cc42c4..3b6126375b 100644
--- a/epan/dissectors/packet-dvmrp.c
+++ b/epan/dissectors/packet-dvmrp.c
@@ -687,7 +687,7 @@ dissect_dvmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int of
/* we are not enabled, skip entire packet to be nice
to the igmp layer. (so clicking on IGMP will display the data)
*/
- return offset+tvb_length_remaining(tvb, offset);
+ return offset+tvb_captured_length_remaining(tvb, offset);
}
item = proto_tree_add_item(parent_tree, proto_dvmrp, tvb, offset, -1, ENC_NA);
@@ -698,7 +698,7 @@ dissect_dvmrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int of
col_clear(pinfo->cinfo, COL_INFO);
- if ((tvb_length_remaining(tvb, offset)>=8)
+ if ((tvb_captured_length_remaining(tvb, offset)>=8)
&& (((tvb_get_guint8(tvb, 6)==0xff)
&& (tvb_get_guint8(tvb, 7)==0x03))
|| !strict_v3)) {
diff --git a/epan/dissectors/packet-e100.c b/epan/dissectors/packet-e100.c
index a83ebb217e..ebc53d0fc9 100644
--- a/epan/dissectors/packet-e100.c
+++ b/epan/dissectors/packet-e100.c
@@ -74,9 +74,9 @@ dissect_e100(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
* (2) e100 header is 1
* (3) e100 capture size matches tvb packet size
*/
- if (tvb_length(tvb) >= e100_encap_len &&
+ if (tvb_captured_length(tvb) >= e100_encap_len &&
tvb_get_guint8(tvb, e100_header_ver.offset) == 1 &&
- tvb_get_ntohl(tvb, e100_bytes_cap.offset) == tvb_length(tvb)-e100_encap_len)
+ tvb_get_ntohl(tvb, e100_bytes_cap.offset) == tvb_captured_length(tvb)-e100_encap_len)
{
guint32 bytes_captured=0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "e100");
@@ -117,7 +117,7 @@ dissect_e100(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
next_tvb = tvb_new_subset(tvb, e100_encap_len, -1, bytes_captured);
call_dissector(eth_handle, next_tvb, pinfo, tree);
- ret_val = tvb_length(tvb);
+ ret_val = tvb_captured_length(tvb);
} /* heuristic testing */
return ret_val;
diff --git a/epan/dissectors/packet-eap.c b/epan/dissectors/packet-eap.c
index 25a031a23c..7c2df095f4 100644
--- a/epan/dissectors/packet-eap.c
+++ b/epan/dissectors/packet-eap.c
@@ -861,7 +861,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
gint tvb_len;
gboolean save_fragmented;
- tvb_len = tvb_length_remaining(tvb, offset);
+ tvb_len = tvb_captured_length_remaining(tvb, offset);
if (size < tvb_len)
tvb_len = size;
@@ -1202,7 +1202,7 @@ dissect_eap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
} /* switch (eap_code) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-edonkey.c b/epan/dissectors/packet-edonkey.c
index 0eb1326e98..a42705dada 100644
--- a/epan/dissectors/packet-edonkey.c
+++ b/epan/dissectors/packet-edonkey.c
@@ -2905,7 +2905,7 @@ static int dissect_kademlia_udp_compressed_message(guint8 msg_type,
if (tvbraw) {
guint32 raw_length;
- raw_length = tvb_length( tvbraw );
+ raw_length = tvb_captured_length( tvbraw );
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
dissect_kademlia_udp_message( msg_type, tvbraw, pinfo, 0, raw_length, tree );
@@ -3019,12 +3019,12 @@ static int dissect_edonkey_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree
offset+1, msg_len-1, ENC_NA);
emule_zlib_tree = proto_item_add_subtree(ti, ett_emule_zlib);
add_new_data_source(pinfo, tvbraw, "Decompressed Data");
- (*dissector)(msg_type, tvbraw, pinfo, 0, tvb_length(tvbraw), emule_zlib_tree);
+ (*dissector)(msg_type, tvbraw, pinfo, 0, tvb_captured_length(tvbraw), emule_zlib_tree);
}
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int dissect_edonkey_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
@@ -3095,7 +3095,7 @@ static int dissect_edonkey_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
"%s (0x%02x)", message_name, msg_type);
offset += EDONKEY_UDP_HEADER_LENGTH;
- remainingLength = tvb_length_remaining( tvb, offset );
+ remainingLength = tvb_captured_length_remaining( tvb, offset );
if (remainingLength > 0) {
switch (protocol) {
diff --git a/epan/dissectors/packet-egd.c b/epan/dissectors/packet-egd.c
index ebea2b35ab..6b3047248b 100644
--- a/epan/dissectors/packet-egd.c
+++ b/epan/dissectors/packet-egd.c
@@ -147,7 +147,7 @@ static void dissect_egd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(egd_tree, hf_egd_resv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
- data_length = tvb_length_remaining(tvb, offset);
+ data_length = tvb_captured_length_remaining(tvb, offset);
if (data_length > 0)
{
next_tvb = tvb_new_subset_remaining(tvb, offset);
diff --git a/epan/dissectors/packet-ehdlc.c b/epan/dissectors/packet-ehdlc.c
index d4b711bcb8..ad42a00d75 100644
--- a/epan/dissectors/packet-ehdlc.c
+++ b/epan/dissectors/packet-ehdlc.c
@@ -138,7 +138,7 @@ dissect_ehdlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Use MIN(...,...) in the following to prevent a premature */
/* exception before we try to dissect whatever is available. */
ti = proto_tree_add_protocol_format(tree, proto_ehdlc,
- tvb, offset, MIN(len, tvb_length_remaining(tvb,offset)),
+ tvb, offset, MIN(len, tvb_captured_length_remaining(tvb,offset)),
"Ericsson HDLC protocol, type: %s",
val_to_str(msg_type, ehdlc_protocol_vals,
"unknown 0x%02x"));
diff --git a/epan/dissectors/packet-eigrp.c b/epan/dissectors/packet-eigrp.c
index 01c8737ca8..9fc734b2d4 100644
--- a/epan/dissectors/packet-eigrp.c
+++ b/epan/dissectors/packet-eigrp.c
@@ -1072,7 +1072,7 @@ dissect_eigrp_ipv4_addr (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
proto_item *ti_prefixlen, *ti_dst;
int first = TRUE;
- for (; tvb_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
+ for (; tvb_captured_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
length = tvb_get_guint8(tvb, offset);
addr_len = ipv4_addr_and_mask(tvb, offset + 1, ip_addr, length);
@@ -1126,7 +1126,7 @@ dissect_eigrp_ipv6_addr (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
proto_item *ti_prefixlen, *ti_dst;
int first = TRUE;
- for (; tvb_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
+ for (; tvb_captured_length_remaining(tvb, offset) > 0; offset += (1 + addr_len)) {
length = tvb_get_guint8(tvb, offset);
addr_len = ipv6_addr_and_mask(tvb, offset + 1, &addr, length);
@@ -1253,13 +1253,13 @@ dissect_eigrp_service (proto_item *ti, proto_tree *tree, tvbuff_t *tvb,
tvbuff_t *sub_tvb, *reach_tvb;
guint16 service, sub_service;
- remaining = tvb_length_remaining(tvb, offset);
+ remaining = tvb_captured_length_remaining(tvb, offset);
sub_ti = proto_tree_add_text(tree, tvb, offset, remaining, "SAF Service ");
sub_tree = proto_item_add_subtree(sub_ti, ett_eigrp_tlv_metric);
sub_tvb = tvb_new_subset(tvb, offset, remaining, -1);
sub_offset = 0;
- for (; tvb_length_remaining(sub_tvb, sub_offset) > 0; ) {
+ for (; tvb_captured_length_remaining(sub_tvb, sub_offset) > 0; ) {
service = tvb_get_ntohs(sub_tvb, sub_offset);
proto_item_append_text(sub_ti, "%c %s", (sub_offset == 0 ? '=':','),
val_to_str_const(service, eigrp_saf_srv2string, ""));
@@ -2471,7 +2471,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree_add_item(eigrp_tree, hf_eigrp_opcode, tvb, 1, 1,
ENC_BIG_ENDIAN);
- size = tvb_length(tvb);
+ size = tvb_captured_length(tvb);
checksum = tvb_get_ntohs(tvb, 2);
cacl_checksum = ip_checksum(tvb_get_ptr(tvb, 0, size), size);
@@ -2523,7 +2523,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
size = tvb_get_ntohs(tvb, offset + 2);
if (size == 0) {
proto_tree_add_expert(eigrp_tree, pinfo, &ei_eigrp_tlv_len, tvb, offset, -1);
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
ti = proto_tree_add_text(eigrp_tree, tvb, offset, size, "%s",
@@ -2576,7 +2576,7 @@ dissect_eigrp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* Return the amount of data this dissector was able to dissect */
- return(tvb_length(tvb));
+ return(tvb_captured_length(tvb));
}
/**
diff --git a/epan/dissectors/packet-elcom.c b/epan/dissectors/packet-elcom.c
index d9194a97fd..1d1b6e1e67 100644
--- a/epan/dissectors/packet-elcom.c
+++ b/epan/dissectors/packet-elcom.c
@@ -182,10 +182,10 @@ dissect_lower_address(proto_item *ti_arg, gint ett_arg,
* ELCOM-90 TRA3825.02 User Element conventions, p. 5-2 and Appendix G
*/
len1 = tvb_get_guint8(tvb, offset);
- if (tvb_length_remaining(tvb, offset+len1+1) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset+len1+1) <= 0)
return offset;
len2 = tvb_get_guint8(tvb, offset+len1+1);
- if (tvb_length_remaining(tvb, offset+len1+len2+2) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset+len1+len2+2) <= 0)
return offset;
if ((len1 != LOWADR_LEN) || (len2 != SUFFIX_LEN)) {
proto_item_append_text(tree, " Invalid structure");
@@ -259,20 +259,20 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
proto_item_append_text(ti, " (2 bytes, should be 1 byte)");
}
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_pduid, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_version, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_userdata_result, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -281,13 +281,13 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
/* show the rest */
/* tree2 = proto_tree_add_text(tree, tvb, offset, -1, "User Data"); */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
ti = proto_tree_add_item(tree, hf_elcom_userdata_restmark, tvb, offset, 1, ENC_BIG_ENDIAN);
proto_item_append_text(ti, " <-- '0' = no restart etc.");
offset +=1;
- if (tvb_length_remaining(tvb, offset+8) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset+8) <= 0)
return offset;
year = tvb_get_guint8(tvb, offset);
month = tvb_get_guint8(tvb, offset+1);
@@ -302,11 +302,11 @@ dissect_userdata(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_offse
year+1900, month, day, hour, min, sec, msec);
offset += 12;
- if (tvb_length_remaining(tvb, offset+12) > 0) {
+ if (tvb_captured_length_remaining(tvb, offset+12) > 0) {
proto_item_append_text(ti, " Security info: ");
}
/* security info field, if present */
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item_append_text(ti, elcom_show_hex ? " %02x" : " %03o",
tvb_get_guint8(tvb, offset));
offset++;
@@ -324,7 +324,7 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
proto_item *ti;
tree = proto_item_add_subtree(ti_arg, ett_arg);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
gtype = tvb_get_guint8(tvb, offset);
@@ -350,50 +350,50 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
proto_item_append_text(ti, " <<--- meaning WHAT?");
return offset;
}
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupnumber, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_grouppriority, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupsize, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupindex1, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_groupindex2, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
while (1) {
oidlen = tvb_get_guint8(tvb, offset);
if (oidlen == 0) /* normal termination */
break;
- if (tvb_length_remaining(tvb, offset+oidlen+1) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset+oidlen+1) <= 0)
return offset;
proto_tree_add_item(tree, hf_elcom_datarequest_oid, tvb, offset, 1, ENC_ASCII|ENC_NA);
offset += oidlen+1;
}
offset += 1; /* the loop exited at the 0 length byte */
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return offset;
/* show the rest */
tree2 = proto_tree_add_text(tree, tvb, offset, -1, "leftover =");
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item_append_text(tree2, elcom_show_hex ? " %02x" : " %03o",
tvb_get_guint8(tvb, offset));
offset++;
@@ -402,7 +402,7 @@ dissect_datarequest(proto_item *ti_arg, gint ett_arg, tvbuff_t *tvb, gint arg_of
return offset;
}
-/* XXX: Are all the tests against tvb_length() really the right way to handle invalid fields ?
+/* XXX: Are all the tests against tvb_captured_length() really the right way to handle invalid fields ?
* It seems to me that invalid fields should just add an expert item
* or cause a "Malformed" exception.
*/
@@ -418,7 +418,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 *suffix;
/* Check that there's enough data */
- if (tvb_length(tvb) < 3)
+ if (tvb_captured_length(tvb) < 3)
return;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ELCOM");
@@ -440,7 +440,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* starting after elcom_len and elcom_msg_type,
initiator + responder + userdata fields must be there */
- if (tvb_length_remaining(tvb, 3+TOTAL_LEN+TOTAL_LEN+3) < 0) return;
+ if (tvb_captured_length_remaining(tvb, 3+TOTAL_LEN+TOTAL_LEN+3) < 0) return;
/* check also that those field lengths are valid */
if (tvb_get_guint8(tvb, 3) != LOWADR_LEN) return;
if (tvb_get_guint8(tvb, 3+1+LOWADR_LEN) != SUFFIX_LEN) return;
@@ -498,7 +498,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item_append_text(elcom_tree, " ( %s)", val_to_str(elcom_msg_type, type_vals, "Unknown %d"));
offset++;
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
switch (elcom_msg_type) {
@@ -516,7 +516,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_elcom_initiator_ip,
hf_elcom_initiator_port,
hf_elcom_initiator_suff);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
ti = proto_tree_add_item(elcom_tree, hf_elcom_responder, tvb, offset, TOTAL_LEN, ENC_NA);
@@ -525,7 +525,7 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
hf_elcom_responder_ip,
hf_elcom_responder_port,
hf_elcom_responder_suff);
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* Rest of the payload is USER-DATA, 0..82 bytes */
@@ -559,12 +559,12 @@ dissect_elcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
- if (tvb_length_remaining(tvb, offset) <= 0)
+ if (tvb_captured_length_remaining(tvb, offset) <= 0)
return;
/* We should not get here, but if we do, show what is left over: */
ti = proto_tree_add_item(elcom_tree, hf_elcom_strangeleftover, tvb, offset, -1, ENC_NA);
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
proto_item_append_text(ti, elcom_show_hex ? " %02x" : " %03o",
tvb_get_guint8(tvb, offset));
offset++;
diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c
index 5519d765ec..f5285eb180 100644
--- a/epan/dissectors/packet-enip.c
+++ b/epan/dissectors/packet-enip.c
@@ -1829,10 +1829,10 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Call dissector for interface */
next_tvb = tvb_new_subset_length( tvb, offset+6, item_length);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
- if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_srrd_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
+ if ( tvb_captured_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_srrd_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
/* Show the undissected payload */
- if ( tvb_length_remaining(tvb, offset) > 0 )
+ if ( tvb_captured_length_remaining(tvb, offset) > 0 )
call_dissector( data_handle, next_tvb, pinfo, dissector_tree);
}
@@ -1888,10 +1888,10 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
/* Call dissector for interface */
next_tvb = tvb_new_subset_length (tvb, offset+8, item_length-2);
p_add_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO, request_info);
- if ( tvb_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_sud_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
+ if ( tvb_captured_length_remaining(next_tvb, 0) <= 0 || !dissector_try_uint(subdissector_sud_table, ifacehndl, next_tvb, pinfo, dissector_tree) )
{
/* Show the undissected payload */
- if ( tvb_length_remaining(tvb, offset) > 0 )
+ if ( tvb_captured_length_remaining(tvb, offset) > 0 )
call_dissector( data_handle, next_tvb, pinfo, dissector_tree );
}
p_remove_proto_data(wmem_file_scope(), pinfo, proto_enip, ENIP_REQUEST_INFO);
@@ -1899,7 +1899,7 @@ dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
else
{
/* Display data */
- if (tvb_length_remaining(tvb, offset+6) > 0)
+ if (tvb_captured_length_remaining(tvb, offset+6) > 0)
{
next_tvb = tvb_new_subset_length(tvb, offset+6, item_length);
if (conn_info != NULL)
@@ -2353,7 +2353,7 @@ dissect_enip_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
} /* end of if ( encapsulated data ) */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* end of dissect_enip_pdu() */
static int
@@ -2388,7 +2388,7 @@ dissect_enip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data
return 0; /* not a known command */
tcp_dissect_pdus(tvb, pinfo, tree, enip_desegment, 4, get_enip_pdu_len, dissect_enip_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Code to actually dissect the io packets*/
@@ -2555,7 +2555,7 @@ dissect_dlr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
/* Unknown Frame type */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
} /* end of dissect_dlr() */
diff --git a/epan/dissectors/packet-enrp.c b/epan/dissectors/packet-enrp.c
index 3d101dc71a..f6e107dff7 100644
--- a/epan/dissectors/packet-enrp.c
+++ b/epan/dissectors/packet-enrp.c
@@ -176,9 +176,9 @@ dissect_error_cause(tvbuff_t *cause_tvb, proto_tree *parameter_tree)
code = tvb_get_ntohs(cause_tvb, CAUSE_CODE_OFFSET);
length = tvb_get_ntohs(cause_tvb, CAUSE_LENGTH_OFFSET);
- padding_length = tvb_length(cause_tvb) - length;
+ padding_length = tvb_captured_length(cause_tvb) - length;
- cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_length(cause_tvb), "%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
+ cause_item = proto_tree_add_text(parameter_tree, cause_tvb, CAUSE_HEADER_OFFSET, tvb_captured_length(cause_tvb), "%s", val_to_str_const(code, cause_code_values, "Unknown error cause"));
cause_tree = proto_item_add_subtree(cause_item, ett_enrp_cause);
proto_tree_add_item(cause_tree, hf_cause_code, cause_tvb, CAUSE_CODE_OFFSET, CAUSE_CODE_LENGTH, ENC_BIG_ENDIAN);
@@ -475,7 +475,7 @@ dissect_pool_member_selection_policy_parameter(tvbuff_t *parameter_tvb, proto_tr
proto_tree_add_item(parameter_tree, hf_policy_distance, parameter_tvb, POLICY_WRANDDPF_DISTANCE_OFFSET, POLICY_WRANDDPF_DISTANCE_LENGTH, ENC_BIG_ENDIAN);
break;
default:
- length = tvb_length(parameter_tvb) - POLICY_VALUE_OFFSET;
+ length = tvb_captured_length(parameter_tvb) - POLICY_VALUE_OFFSET;
if (length > 0) {
proto_tree_add_item(parameter_tree, hf_policy_value, parameter_tvb, POLICY_VALUE_OFFSET, length, ENC_NA);
}
@@ -642,10 +642,10 @@ dissect_parameter(tvbuff_t *parameter_tvb, proto_tree *enrp_tree)
/* extract tag and length from the parameter */
type = tvb_get_ntohs(parameter_tvb, PARAMETER_TYPE_OFFSET);
length = tvb_get_ntohs(parameter_tvb, PARAMETER_LENGTH_OFFSET);
- padding_length = tvb_length(parameter_tvb) - length;
+ padding_length = tvb_captured_length(parameter_tvb) - length;
/* create proto_tree stuff */
- parameter_item = proto_tree_add_text(enrp_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
+ parameter_item = proto_tree_add_text(enrp_tree, parameter_tvb, PARAMETER_HEADER_OFFSET, tvb_captured_length(parameter_tvb), "%s", val_to_str_const(type, parameter_type_values, "Unknown Parameter"));
parameter_tree = proto_item_add_subtree(parameter_item, ett_enrp_parameter);
/* add tag and length to the enrp tree */
@@ -714,7 +714,7 @@ dissect_parameters(tvbuff_t *parameters_tvb, proto_tree *tree)
tvbuff_t *parameter_tvb;
offset = 0;
- while((remaining_length = tvb_length_remaining(parameters_tvb, offset)) > 0) {
+ while((remaining_length = tvb_captured_length_remaining(parameters_tvb, offset)) > 0) {
length = tvb_get_ntohs(parameters_tvb, offset + PARAMETER_LENGTH_OFFSET);
total_length = ADD_PADDING(length);
if (remaining_length >= length)
@@ -905,7 +905,7 @@ dissect_enrp_error_message(tvbuff_t *message_tvb, proto_tree *message_tree, prot
static void
dissect_unknown_message(tvbuff_t *message_tvb, proto_tree *message_tree, proto_tree *flags_tree _U_)
{
- proto_tree_add_item(message_tree, hf_message_value, message_tvb, MESSAGE_VALUE_OFFSET, tvb_length(message_tvb) - MESSAGE_HEADER_LENGTH, ENC_NA);
+ proto_tree_add_item(message_tree, hf_message_value, message_tvb, MESSAGE_VALUE_OFFSET, tvb_captured_length(message_tvb) - MESSAGE_HEADER_LENGTH, ENC_NA);
}
#define ENRP_PRESENCE_MESSAGE_TYPE 0x01
diff --git a/epan/dissectors/packet-epl_v1.c b/epan/dissectors/packet-epl_v1.c
index f60bbfe065..5e943243c8 100644
--- a/epan/dissectors/packet-epl_v1.c
+++ b/epan/dissectors/packet-epl_v1.c
@@ -346,7 +346,7 @@ dissect_epl_v1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
proto_tree *epl_v1_tree=NULL;
- if(tvb_length(tvb) < 3){
+ if(tvb_captured_length(tvb) < 3){
/* Not enough data for an EPL_V1 header; don't try to interpret it */
return FALSE;
}
diff --git a/epan/dissectors/packet-epmd.c b/epan/dissectors/packet-epmd.c
index 000b8322f1..7ab9fe8c86 100644
--- a/epan/dissectors/packet-epmd.c
+++ b/epan/dissectors/packet-epmd.c
@@ -147,7 +147,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, name_length, ENC_ASCII);
offset += 2 + name_length;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
elen = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_elen, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -159,7 +159,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
case EPMD_PORT_REQ:
case EPMD_PORT2_REQ:
- name_length = tvb_length_remaining(tvb, offset);
+ name_length = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_length, ENC_ASCII);
break;
@@ -167,7 +167,7 @@ dissect_epmd_request(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
case EPMD_ALIVE_REQ:
proto_tree_add_item(tree, hf_epmd_port_no, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- name_length = tvb_length_remaining(tvb, offset);
+ name_length = tvb_captured_length_remaining(tvb, offset);
proto_tree_add_item(tree, hf_epmd_name, tvb, offset, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, name_length, ENC_ASCII);
break;
@@ -250,7 +250,7 @@ dissect_epmd_response(packet_info *pinfo, tvbuff_t *tvb, gint offset, proto_tree
proto_tree_add_item(tree, hf_epmd_name, tvb, offset + 2, name_length, ENC_ASCII|ENC_NA);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, name_length, ENC_ASCII);
offset += 2 + name_length;
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 2) {
guint16 elen=0;
elen = tvb_get_ntohs(tvb, offset);
proto_tree_add_item(tree, hf_epmd_elen, tvb, offset, 2, ENC_BIG_ENDIAN);
@@ -280,7 +280,7 @@ check_epmd(tvbuff_t *tvb) {
* It's possible to start checking lengths but imho that
* doesn't bring very much.
*/
- if (tvb_length(tvb) < 3)
+ if (tvb_captured_length(tvb) < 3)
return (FALSE);
type = tvb_get_guint8(tvb, 0);
@@ -327,7 +327,7 @@ dissect_epmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
dissect_epmd_response(pinfo, tvb, 0, epmd_tree);
}
- return (tvb_length(tvb));
+ return (tvb_captured_length(tvb));
}
void
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c
index 1d38ee92c1..ebe95f4279 100644
--- a/epan/dissectors/packet-erf.c
+++ b/epan/dissectors/packet-erf.c
@@ -1323,7 +1323,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;
/* Try to guess the type according to the first bytes */
- atm_pdu_caplen = tvb_length(new_tvb);
+ atm_pdu_caplen = tvb_captured_length(new_tvb);
atm_pdu = tvb_get_ptr(new_tvb, 0, atm_pdu_caplen);
erf_atm_guess_traffic_type(atm_pdu, atm_pdu_caplen, pinfo->pseudo_header);
break;
@@ -1371,7 +1371,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;
/* Try to guess the type according to the first bytes */
- atm_pdu_caplen = tvb_length(new_tvb);
+ atm_pdu_caplen = tvb_captured_length(new_tvb);
atm_pdu = tvb_get_ptr(new_tvb, 0, atm_pdu_caplen);
erf_atm_guess_traffic_type(atm_pdu, atm_pdu_caplen, pinfo->pseudo_header);
break;
diff --git a/epan/dissectors/packet-erldp.c b/epan/dissectors/packet-erldp.c
index a2f445981c..ce7f3f2fd3 100644
--- a/epan/dissectors/packet-erldp.c
+++ b/epan/dissectors/packet-erldp.c
@@ -407,7 +407,7 @@ static gint dissect_etf_type(const gchar *label, packet_info *pinfo, tvbuff_t *t
static gboolean is_handshake(tvbuff_t *tvb, int offset) {
guint32 len = tvb_get_ntohs(tvb, offset);
guint8 tag = tvb_get_guint8(tvb, offset + 2);
- return ((len > 0) && strchr("nras", tag) && (len == (guint32)tvb_length_remaining(tvb, offset + 2)));
+ return ((len > 0) && strchr("nras", tag) && (len == (guint32)tvb_captured_length_remaining(tvb, offset + 2)));
}
/*--- dissect_erldp_handshake -------------------------------------------------*/
@@ -442,7 +442,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
proto_tree_add_item(tree, hf_erldp_challenge, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
}
- str_len = tvb_length_remaining(tvb, offset);
+ str_len = tvb_captured_length_remaining(tvb, offset);
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, str_len, ENC_ASCII);
proto_tree_add_item(tree, hf_erldp_name, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s", (is_challenge) ? "SEND_CHALLENGE" : "SEND_NAME", str);
@@ -463,7 +463,7 @@ static void dissect_erldp_handshake(tvbuff_t *tvb, packet_info *pinfo, proto_tre
break;
case 's' :
- str_len = tvb_length_remaining(tvb, offset);
+ str_len = tvb_captured_length_remaining(tvb, offset);
str = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, str_len, ENC_ASCII);
proto_tree_add_item(tree, hf_erldp_status, tvb, offset, str_len, ENC_ASCII|ENC_NA);
col_add_fstr(pinfo->cinfo, COL_INFO, "SEND_STATUS %s", str);
@@ -487,7 +487,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
if (is_handshake(tvb, 0)) {
dissect_erldp_handshake(tvb, pinfo, erldp_tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset = 0;
@@ -516,7 +516,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(ctl_op, VALS(erldp_ctlmsg_vals), "unknown ControlMessage operation (%d)"));
}
offset = dissect_etf_type("ControlMessage", pinfo, tvb, offset, erldp_tree);
- if (tvb_length_remaining(tvb, offset) > 0)
+ if (tvb_captured_length_remaining(tvb, offset) > 0)
dissect_etf_type("Message", pinfo, tvb, offset, erldp_tree);
break;
@@ -526,7 +526,7 @@ static int dissect_erldp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
col_set_str(pinfo->cinfo, COL_INFO, "unknown header format");
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- get_erldp_pdu_len -------------------------------------------------*/
@@ -545,7 +545,7 @@ dissect_erldp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) {
4, /* fixed-length part of the PDU */
get_erldp_pdu_len, /* routine to get the length of the PDU */
dissect_erldp_pdu, data); /* routine to dissect a PDU */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*--- proto_register_erldp ----------------------------------------------*/
diff --git a/epan/dissectors/packet-esio.c b/epan/dissectors/packet-esio.c
index 17cdd337db..819ab2703b 100644
--- a/epan/dissectors/packet-esio.c
+++ b/epan/dissectors/packet-esio.c
@@ -87,7 +87,7 @@ is_esio_pdu(tvbuff_t *tvb)
/* we need at least 8 bytes to determine whether this is
Ether-S-I/O or not*/
/* minimal length is 20 bytes*/
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return FALSE;
}
/* First four bytes must be "ESIO"*/
@@ -271,7 +271,7 @@ dissect_esio(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
break;
} /* switch() */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
/*End of dissect_sbus*/
}
diff --git a/epan/dissectors/packet-ess.c b/epan/dissectors/packet-ess.c
index db51222599..95ab745498 100644
--- a/epan/dissectors/packet-ess.c
+++ b/epan/dissectors/packet-ess.c
@@ -263,13 +263,13 @@ ess_dissect_attribute_flags (tvbuff_t *tvb, asn1_ctx_t *actx)
guint i;
tree = proto_item_add_subtree (actx->created_item, ett_Category_attributes);
- value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, tvb_length (tvb));
+ value = (guint8 *)tvb_memdup (wmem_packet_scope(), tvb, 0, tvb_captured_length (tvb));
for (i = 0; i < num_ess_category_attributes; i++) {
ess_category_attributes_t *u = &(ess_category_attributes[i]);
if ((strcmp (u->oid, object_identifier_id) == 0) &&
- ((u->lacv / 8) < tvb_length (tvb)) &&
+ ((u->lacv / 8) < tvb_captured_length (tvb)) &&
(value[u->lacv / 8] & (1 << (7 - (u->lacv % 8)))))
{
proto_tree_add_string_format (tree, hf_ess_Category_attribute, tvb,
diff --git a/epan/dissectors/packet-etch.c b/epan/dissectors/packet-etch.c
index aa0d6b8b95..a4a141c665 100644
--- a/epan/dissectors/packet-etch.c
+++ b/epan/dissectors/packet-etch.c
@@ -621,7 +621,7 @@ read_struct(unsigned int *offset, tvbuff_t *tvb, proto_tree *etch_tree,
int i;
ti = proto_tree_add_item(etch_tree, hf_etch_struct, tvb, *offset,
- tvb_length(tvb) - *offset, ENC_NA);
+ tvb_captured_length(tvb) - *offset, ENC_NA);
new_tree = proto_item_add_subtree(ti, ett_etch_struct);
if (add_type_field) {
@@ -758,7 +758,7 @@ dissect_etch_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
read_struct(&offset, tvb, etch_tree, 0);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/*
@@ -778,7 +778,7 @@ get_etch_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset)
static int
dissect_etch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- if (tvb_length(tvb) < 4) {
+ if (tvb_captured_length(tvb) < 4) {
/* Too small for an etch packet. */
return 0;
}
diff --git a/epan/dissectors/packet-ethertype.c b/epan/dissectors/packet-ethertype.c
index 839a9dd5a5..5328f84fed 100644
--- a/epan/dissectors/packet-ethertype.c
+++ b/epan/dissectors/packet-ethertype.c
@@ -267,7 +267,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
/* Get the captured length and reported length of the data
after the Ethernet type. */
- captured_length = tvb_length_remaining(tvb, ethertype_data->offset_after_ethertype);
+ captured_length = tvb_captured_length_remaining(tvb, ethertype_data->offset_after_ethertype);
reported_length = tvb_reported_length_remaining(tvb,
ethertype_data->offset_after_ethertype);
@@ -343,7 +343,7 @@ dissect_ethertype(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
add_dix_trailer(pinfo, tree, ethertype_data->fh_tree, ethertype_data->trailer_id, tvb, next_tvb, ethertype_data->offset_after_ethertype,
length_before, ethertype_data->fcs_len);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-etsi_card_app_toolkit.c b/epan/dissectors/packet-etsi_card_app_toolkit.c
index 8877de5e3c..23ac83cfca 100644
--- a/epan/dissectors/packet-etsi_card_app_toolkit.c
+++ b/epan/dissectors/packet-etsi_card_app_toolkit.c
@@ -928,7 +928,7 @@ dissect_cat(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
unsigned int pos = 0;
tvbuff_t *new_tvb;
gboolean ims_event = FALSE;
- guint length = tvb_length(tvb);
+ guint length = tvb_captured_length(tvb);
gsm_sms_data_t sms_data;
cat_ti = proto_tree_add_item(tree, proto_cat, tvb, 0, -1, ENC_NA);
diff --git a/epan/dissectors/packet-exec.c b/epan/dissectors/packet-exec.c
index 27f829619f..a806c605a2 100644
--- a/epan/dissectors/packet-exec.c
+++ b/epan/dissectors/packet-exec.c
@@ -218,12 +218,12 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
* then it must be session data only and we can skip looking
* for the other fields.
*/
- if(tvb_find_guint8(tvb, tvb_length(tvb)-1, 1, '\0') == -1){
+ if(tvb_find_guint8(tvb, tvb_captured_length(tvb)-1, 1, '\0') == -1){
hash_info->state = WAIT_FOR_DATA;
}
if(hash_info->state == WAIT_FOR_STDERR_PORT
- && tvb_length_remaining(tvb, offset)){
+ && tvb_captured_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the stderr_port field.
@@ -246,7 +246,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_USERNAME
- && tvb_length_remaining(tvb, offset)){
+ && tvb_captured_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the username field */
@@ -274,7 +274,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_PASSWORD
- && tvb_length_remaining(tvb, offset)){
+ && tvb_captured_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the password field */
@@ -297,7 +297,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_COMMAND
- && tvb_length_remaining(tvb, offset)){
+ && tvb_captured_length_remaining(tvb, offset)){
field_stringz = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &length, ENC_ASCII);
/* Check if this looks like the command field */
@@ -320,7 +320,7 @@ dissect_exec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if(hash_info->state == WAIT_FOR_DATA
- && tvb_length_remaining(tvb, offset)){
+ && tvb_captured_length_remaining(tvb, offset)){
if(pinfo->destport == EXEC_PORT){
/* Packet going to the server */
/* offset = 0 since the whole packet is data */
diff --git a/epan/dissectors/packet-extreme.c b/epan/dissectors/packet-extreme.c
index 69f23049d2..d1af9960ab 100644
--- a/epan/dissectors/packet-extreme.c
+++ b/epan/dissectors/packet-extreme.c
@@ -1005,7 +1005,7 @@ dissect_edp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/*
* If we have the entire ESP packet available, check the checksum.
*/
- if (tvb_length(tvb) >= data_length) {
+ if (tvb_captured_length(tvb) >= data_length) {
/* Checksum from version to null tlv */
cksum_vec[0].ptr = tvb_get_ptr(tvb, 0, data_length);
cksum_vec[0].len = data_length;
diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c
index 4bd49d173f..e0f1a0a03c 100644
--- a/epan/dissectors/packet-fc.c
+++ b/epan/dissectors/packet-fc.c
@@ -360,7 +360,7 @@ dissect_fc_ba_acc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "BA_ACC");
if (tree) {
- ti = proto_tree_add_text (tree, tvb, 0, tvb_length (tvb), "Basic Link Svc");
+ ti = proto_tree_add_text (tree, tvb, 0, tvb_captured_length (tvb), "Basic Link Svc");
acc_tree = proto_item_add_subtree (ti, ett_fcbls);
proto_tree_add_item (acc_tree, hf_fc_bls_seqid_vld, tvb, offset++, 1, ENC_BIG_ENDIAN);
@@ -390,7 +390,7 @@ dissect_fc_ba_rjt (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_INFO, "BA_RJT");
if (tree) {
- ti = proto_tree_add_text (tree, tvb, 0, tvb_length (tvb), "Basic Link Svc");
+ ti = proto_tree_add_text (tree, tvb, 0, tvb_captured_length (tvb), "Basic Link Svc");
rjt_tree = proto_item_add_subtree (ti, ett_fcbls);
proto_tree_add_item (rjt_tree, hf_fc_bls_rjtcode, tvb, offset+1, 1, ENC_BIG_ENDIAN);
@@ -1243,7 +1243,7 @@ dissect_fc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
return 0;
dissect_fc_helper (tvb, pinfo, tree, FALSE, fc_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1255,7 +1255,7 @@ dissect_fc_ifcp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
return 0;
dissect_fc_helper (tvb, pinfo, tree, TRUE, fc_data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
diff --git a/epan/dissectors/packet-fcct.c b/epan/dissectors/packet-fcct.c
index 41dd023134..ae80d1bac0 100644
--- a/epan/dissectors/packet-fcct.c
+++ b/epan/dissectors/packet-fcct.c
@@ -216,7 +216,7 @@ dissect_fcct (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
call_dissector (data_handle, next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcdns.c b/epan/dissectors/packet-fcdns.c
index 5a61c731a6..753b8fec54 100644
--- a/epan/dissectors/packet-fcdns.c
+++ b/epan/dissectors/packet-fcdns.c
@@ -1857,7 +1857,7 @@ dissect_fcdns (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcfcs.c b/epan/dissectors/packet-fcfcs.c
index 5cf14ebc1e..f05baaeeb0 100644
--- a/epan/dissectors/packet-fcfcs.c
+++ b/epan/dissectors/packet-fcfcs.c
@@ -847,7 +847,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
val_to_str (opcode, fc_fcs_opcode_abbrev_val,
"0x%x"));
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text (fcfcs_tree, tvb, 0, tvb_length (tvb),
+ proto_tree_add_text (fcfcs_tree, tvb, 0, tvb_captured_length (tvb),
"No record of Exchg. Unable to decode MSG_ACC/RJT");
return 0;
}
@@ -880,7 +880,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (tree) {
if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text (fcfcs_tree, tvb, 0, tvb_length (tvb),
+ proto_tree_add_text (fcfcs_tree, tvb, 0, tvb_captured_length (tvb),
"No record of Exchg. Unable to decode MSG_ACC/RJT");
return 0;
}
@@ -985,7 +985,7 @@ dissect_fcfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcfzs.c b/epan/dissectors/packet-fcfzs.c
index 421270a394..ac9733559b 100644
--- a/epan/dissectors/packet-fcfzs.c
+++ b/epan/dissectors/packet-fcfzs.c
@@ -504,7 +504,7 @@ dissect_fcfzs_arzm(tvbuff_t *tvb, proto_tree *tree, gboolean isreq)
len, ENC_ASCII|ENC_NA);
len += (len % 4);
- plen = tvb_length(tvb) - offset - len;
+ plen = tvb_captured_length(tvb) - offset - len;
numrec = plen/12; /* each mbr rec is 12 bytes long */
@@ -613,7 +613,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_fcfzs, tvb, 0,
- tvb_length(tvb),
+ tvb_captured_length(tvb),
"Zone Server");
fcfzs_tree = proto_item_add_subtree(ti, ett_fcfzs);
proto_tree_add_item(fcfzs_tree, hf_fcfzs_opcode, tvb, offset+8, 2, ENC_BIG_ENDIAN);
@@ -667,7 +667,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
val_to_str(opcode, fc_fzs_opcode_val,
"0x%x"));
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text(fcfzs_tree, tvb, 0, tvb_length(tvb),
+ proto_tree_add_text(fcfzs_tree, tvb, 0, tvb_captured_length(tvb),
"No record of Exchg. Unable to decode MSG_ACC");
return 0;
}
@@ -697,7 +697,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if ((cdata == NULL) && (opcode != FCCT_MSG_RJT)) {
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text(fcfzs_tree, tvb, 0, tvb_length(tvb),
+ proto_tree_add_text(fcfzs_tree, tvb, 0, tvb_captured_length(tvb),
"No record of Exchg. Unable to decode MSG_ACC/RJT");
return 0;
}
@@ -761,7 +761,7 @@ dissect_fcfzs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcgi.c b/epan/dissectors/packet-fcgi.c
index 7b6f7855aa..89eb56b36c 100644
--- a/epan/dissectors/packet-fcgi.c
+++ b/epan/dissectors/packet-fcgi.c
@@ -321,7 +321,7 @@ dissect_fcgi_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -334,7 +334,7 @@ static int
dissect_fcgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 8, get_fcgi_record_len, dissect_fcgi_record, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-fcip.c b/epan/dissectors/packet-fcip.c
index 642155ac2d..7ae83849b5 100644
--- a/epan/dissectors/packet-fcip.c
+++ b/epan/dissectors/packet-fcip.c
@@ -144,7 +144,7 @@ static dissector_handle_t fc_handle;
static guint
get_next_fcip_header_offset (tvbuff_t *tvb, packet_info *pinfo, gint offset)
{
- gint bytes_remaining = tvb_length_remaining (tvb, offset);
+ gint bytes_remaining = tvb_captured_length_remaining (tvb, offset);
gint frame_len;
guint16 flen, flen1;
fcip_eof_t eof, eofc;
@@ -373,7 +373,7 @@ dissect_fcip (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gint offset = 0,
start = 0,
frame_len = 0;
- gint bytes_remaining = tvb_length (tvb);
+ gint bytes_remaining = tvb_captured_length (tvb);
guint8 pflags, sof = 0, eof = 0;
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *ti;
diff --git a/epan/dissectors/packet-fcoe.c b/epan/dissectors/packet-fcoe.c
index d8d9573285..2732f94a91 100644
--- a/epan/dissectors/packet-fcoe.c
+++ b/epan/dissectors/packet-fcoe.c
@@ -167,7 +167,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCoE");
crc_offset = header_len + frame_len;
eof_offset = crc_offset + 4;
- bytes_remaining = tvb_length_remaining(tvb, header_len);
+ bytes_remaining = tvb_captured_length_remaining(tvb, header_len);
if (bytes_remaining > frame_len)
bytes_remaining = frame_len; /* backing length */
next_tvb = tvb_new_subset(tvb, header_len, bytes_remaining, frame_len);
@@ -231,7 +231,7 @@ dissect_fcoe(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
crc, crc_computed);
}
proto_tree_set_appendix(fcoe_tree, tvb, crc_offset,
- tvb_length_remaining (tvb, crc_offset));
+ tvb_captured_length_remaining (tvb, crc_offset));
} else {
item = proto_tree_add_text(fcoe_tree, tvb, crc_offset, 0,
"CRC: [missing]");
diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c
index 53c088f9d6..a4416bd6db 100644
--- a/epan/dissectors/packet-fcoib.c
+++ b/epan/dissectors/packet-fcoib.c
@@ -211,7 +211,7 @@ dissect_fcoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FCoIB");
- bytes_remaining = tvb_length_remaining(tvb, FCOIB_HEADER_LEN);
+ bytes_remaining = tvb_captured_length_remaining(tvb, FCOIB_HEADER_LEN);
if (bytes_remaining > frame_len)
bytes_remaining = frame_len; /* backing length */
next_tvb = tvb_new_subset(tvb, FCOIB_HEADER_LEN, bytes_remaining, frame_len);
@@ -284,7 +284,7 @@ dissect_fcoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
crc, crc_computed);
}
proto_tree_set_appendix(fcoib_tree, tvb, crc_offset,
- tvb_length_remaining (tvb, crc_offset));
+ tvb_captured_length_remaining (tvb, crc_offset));
} else {
item = proto_tree_add_text(fcoib_tree, tvb, crc_offset, 0,
"CRC: [missing]");
diff --git a/epan/dissectors/packet-fcp.c b/epan/dissectors/packet-fcp.c
index 2245ba07a2..1396f1e929 100644
--- a/epan/dissectors/packet-fcp.c
+++ b/epan/dissectors/packet-fcp.c
@@ -480,7 +480,7 @@ dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, pro
proto_tree_add_item(tree, hf_fcp_rddata, tvb, offset+11, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_fcp_wrdata, tvb, offset+11, 1, ENC_BIG_ENDIAN);
- tvb_len = tvb_length_remaining(tvb, offset+12);
+ tvb_len = tvb_captured_length_remaining(tvb, offset+12);
if (tvb_len > (16 + add_len))
tvb_len = 16 + add_len;
@@ -497,7 +497,7 @@ dissect_fcp_cmnd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, pro
}
if ( ((rwflags & 0x03) == 0x03)
- && tvb_length_remaining(tvb, offset+12+16+add_len+4) >= 4) {
+ && tvb_captured_length_remaining(tvb, offset+12+16+add_len+4) >= 4) {
proto_tree_add_item(tree, hf_fcp_bidir_dl, tvb, offset+12+16+add_len+4,
4, ENC_BIG_ENDIAN);
if (request_data->itlq) {
@@ -629,7 +629,7 @@ dissect_fcp_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, prot
if (rsplen) {
tvbuff_t *rspinfo_tvb;
- rspinfo_tvb = tvb_new_subset(tvb, offset, MIN(rsplen, tvb_length_remaining(tvb, offset)), rsplen);
+ rspinfo_tvb = tvb_new_subset(tvb, offset, MIN(rsplen, tvb_captured_length_remaining(tvb, offset)), rsplen);
dissect_fcp_rspinfo(rspinfo_tvb, tree, 0);
offset += rsplen;
@@ -639,7 +639,7 @@ dissect_fcp_rsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, prot
if (snslen) {
tvbuff_t *sns_tvb;
- sns_tvb = tvb_new_subset(tvb, offset, MIN(snslen, tvb_length_remaining(tvb, offset)), snslen);
+ sns_tvb = tvb_new_subset(tvb, offset, MIN(snslen, tvb_captured_length_remaining(tvb, offset)), snslen);
dissect_scsi_snsinfo(sns_tvb, pinfo, parent_tree, 0,
snslen,
(request_data != NULL) ? request_data->itlq : &empty_itlq, &itl);
@@ -802,7 +802,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (els) {
dissect_fcp_els(tvb, pinfo, fcp_tree, fchdr);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
switch (r_ctl) {
@@ -826,7 +826,7 @@ dissect_fcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
break;
}
/*xxx once the subdissectors return bytes consumed: proto_item_set_end(ti, tvb, offset);*/
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-fcsp.c b/epan/dissectors/packet-fcsp.c
index ff1a836562..436ca19e10 100644
--- a/epan/dissectors/packet-fcsp.c
+++ b/epan/dissectors/packet-fcsp.c
@@ -391,7 +391,7 @@ static void dissect_fcsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_fcsp, tvb, 0,
- tvb_length(tvb), "FC-SP");
+ tvb_captured_length(tvb), "FC-SP");
fcsp_tree = proto_item_add_subtree(ti, ett_fcsp);
proto_tree_add_item(fcsp_tree, hf_auth_flags, tvb, offset+1, 1, ENC_BIG_ENDIAN);
@@ -426,7 +426,7 @@ static void dissect_fcsp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case FC_AUTH_FCPAP_INIT:
case FC_AUTH_FCPAP_ACCEPT:
case FC_AUTH_FCPAP_COMPLETE:
- proto_tree_add_text(fcsp_tree, tvb, offset+12, tvb_length(tvb),
+ proto_tree_add_text(fcsp_tree, tvb, offset+12, tvb_captured_length(tvb),
"FCAP Decoding Not Supported");
break;
default:
diff --git a/epan/dissectors/packet-fcswils.c b/epan/dissectors/packet-fcswils.c
index de839afbab..6a553459e2 100644
--- a/epan/dissectors/packet-fcswils.c
+++ b/epan/dissectors/packet-fcswils.c
@@ -1786,7 +1786,7 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (tree) {
ti = proto_tree_add_protocol_format(tree, proto_fcswils, tvb, 0,
- tvb_length(tvb), "SW_ILS");
+ tvb_captured_length(tvb), "SW_ILS");
swils_tree = proto_item_add_subtree(ti, ett_fcswils);
}
@@ -1831,7 +1831,7 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (!conversation) {
if (tree && (opcode == FC_SWILS_SWACC)) {
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text(swils_tree, tvb, 0, tvb_length(tvb),
+ proto_tree_add_text(swils_tree, tvb, 0, tvb_captured_length(tvb),
"No record of Exchg. Unable to decode SW_ACC");
return 0;
}
@@ -1851,7 +1851,7 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (tree) {
if ((cdata == NULL) && (opcode != FC_SWILS_SWRJT)) {
/* No record of what this accept is for. Can't decode */
- proto_tree_add_text(swils_tree, tvb, 0, tvb_length(tvb),
+ proto_tree_add_text(swils_tree, tvb, 0, tvb_captured_length(tvb),
"No record of SW_ILS Req. Unable to decode SW_ACC");
return 0;
}
@@ -1888,7 +1888,7 @@ dissect_fcswils(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
call_dissector(data_handle, next_tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Register the protocol with Wireshark */
diff --git a/epan/dissectors/packet-ff.c b/epan/dissectors/packet-ff.c
index d8d5675a03..bc14607da1 100644
--- a/epan/dissectors/packet-ff.c
+++ b/epan/dissectors/packet-ff.c
@@ -11983,7 +11983,7 @@ dissect_ff(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
/*offset += trailer_len;*/
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -12028,7 +12028,7 @@ dissect_ff_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
guint32 length;
/* Make sure at least the header is there */
- if (tvb_length(tvb) < 12)
+ if (tvb_captured_length(tvb) < 12)
return 0;
length = tvb_get_ntohl(tvb, 8);
diff --git a/epan/dissectors/packet-finger.c b/epan/dissectors/packet-finger.c
index 6036a5e6bc..dd24e51b20 100644
--- a/epan/dissectors/packet-finger.c
+++ b/epan/dissectors/packet-finger.c
@@ -78,7 +78,7 @@ dissect_finger(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_add_proto_data(conversation, proto_finger, finger_trans);
}
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (!PINFO_FD_VISITED(pinfo)) {
if (pinfo->can_desegment) {
if (is_query) {
diff --git a/epan/dissectors/packet-fix.c b/epan/dissectors/packet-fix.c
index 8529d83a94..559cd67a92 100644
--- a/epan/dissectors/packet-fix.c
+++ b/epan/dissectors/packet-fix.c
@@ -118,7 +118,7 @@ tag_search(int key)
static int fix_next_header(tvbuff_t *tvb, int offset)
{
/* try to resync to the next start */
- guint min_len = tvb_length_remaining(tvb, offset);
+ guint min_len = tvb_captured_length_remaining(tvb, offset);
const guint8 *data = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, min_len, ENC_ASCII);
const guint8 *start = data;
@@ -127,7 +127,7 @@ static int fix_next_header(tvbuff_t *tvb, int offset)
/* if remaining length < 6 return and let the next desegment round
test for 8=FIX
*/
- if (tvb_length_remaining(tvb, min_len + offset) < MARKER_LEN)
+ if (tvb_captured_length_remaining(tvb, min_len + offset) < MARKER_LEN)
break;
if (!fix_marker(tvb, min_len +offset) )
break;
@@ -198,7 +198,7 @@ static int fix_header_len(tvbuff_t *tvb, int offset)
* If the packet is big enough find the checksum
*/
size = atoi(value) +tag->ctrla_offset - base_offset +1;
- if (tvb_length_remaining(tvb, base_offset) > size +4) {
+ if (tvb_captured_length_remaining(tvb, base_offset) > size +4) {
/* 10= should be there */
offset = base_offset +size;
if (tvb_strneql(tvb, offset, "10=", 3) != 0) {
@@ -245,7 +245,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
ti = proto_tree_add_item(tree, proto_fix, tvb, 0, -1, ENC_NA);
fix_tree = proto_item_add_subtree(ti, ett_fix);
proto_tree_add_item(fix_tree, hf_fix_data, tvb, 0, -1, ENC_NA);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
pdu_len = tvb_reported_length(tvb);
@@ -255,20 +255,20 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
/* begin string */
ctrla_offset = tvb_find_guint8(tvb, offset, -1, 0x01);
if (ctrla_offset == -1) {
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset = ctrla_offset + 1;
/* msg length */
ctrla_offset = tvb_find_guint8(tvb, offset, -1, 0x01);
if (ctrla_offset == -1) {
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
offset = ctrla_offset + 1;
/* msg type */
if (!(tag = fix_param(tvb, offset)) || tag->value_len < 1) {
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
value = tvb_get_string_enc(wmem_packet_scope(), tvb, tag->value_offset, tag->value_len, ENC_ASCII);
@@ -386,7 +386,7 @@ dissect_fix_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da
tag_str = NULL;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -416,7 +416,7 @@ dissect_fix_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
tcp_dissect_pdus(tvb, pinfo, tree, fix_desegment, FIX_MIN_LEN,
get_fix_pdu_len, dissect_fix_packet, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c
index 074233addb..dfbb3666de 100644
--- a/epan/dissectors/packet-flip.c
+++ b/epan/dissectors/packet-flip.c
@@ -251,7 +251,7 @@ is_payload_rtp(tvbuff_t *tvb)
offset = 0;
- len_remaining = tvb_length_remaining(tvb, offset);
+ len_remaining = tvb_captured_length_remaining(tvb, offset);
if (len_remaining < RTP_V2_HEADER_MIN_LEN) {
return FALSE;
}
@@ -301,7 +301,7 @@ is_payload_rtcp(tvbuff_t *tvb)
offset = 0;
- len_remaining = tvb_length_remaining(tvb, offset);
+ len_remaining = tvb_captured_length_remaining(tvb, offset);
if (len_remaining < RTCP_V2_HEADER_MIN_LEN) {
return FALSE;
}
@@ -392,7 +392,7 @@ dissect_flip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_
*/
/* Check that there's enough data at least for the basic header. */
- frame_len = tvb_length(tvb);
+ frame_len = tvb_captured_length(tvb);
if (frame_len < FLIP_BASIC_HDR_LEN) {
/* Not enough. This must be a malformed packet. */
goto DISSECT_FLIP_EXIT;
diff --git a/epan/dissectors/packet-fmtp.c b/epan/dissectors/packet-fmtp.c
index 6652011408..edafcc1866 100644
--- a/epan/dissectors/packet-fmtp.c
+++ b/epan/dissectors/packet-fmtp.c
@@ -125,7 +125,7 @@ dissect_fmtp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
call_dissector(data_handle, next_tvb, pinfo, fmtp_tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c
index 58cc59d7ad..c050c06638 100644
--- a/epan/dissectors/packet-frame.c
+++ b/epan/dissectors/packet-frame.c
@@ -277,7 +277,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
gboolean old_visible;
/* Put in frame header information. */
- cap_len = tvb_length(tvb);
+ cap_len = tvb_captured_length(tvb);
frame_len = tvb_reported_length(tvb);
cap_plurality = plurality(cap_len, "", "s");
diff --git a/epan/dissectors/packet-ftam.c b/epan/dissectors/packet-ftam.c
index a84d0e1667..cb26851239 100644
--- a/epan/dissectors/packet-ftam.c
+++ b/epan/dissectors/packet-ftam.c
@@ -4744,7 +4744,7 @@ dissect_ftam_PDU(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, a
static void
dissect_ftam_unstructured_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree)
{
- proto_tree_add_item (parent_tree, hf_ftam_unstructured_text, tvb, 0, tvb_length_remaining(tvb, 0), ENC_ASCII|ENC_NA);
+ proto_tree_add_item (parent_tree, hf_ftam_unstructured_text, tvb, 0, tvb_captured_length_remaining(tvb, 0), ENC_ASCII|ENC_NA);
}
/*
@@ -4753,7 +4753,7 @@ dissect_ftam_unstructured_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
static void
dissect_ftam_unstructured_binary(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *parent_tree)
{
- proto_tree_add_item (parent_tree, hf_ftam_unstructured_binary, tvb, 0, tvb_length_remaining(tvb, 0), ENC_NA);
+ proto_tree_add_item (parent_tree, hf_ftam_unstructured_binary, tvb, 0, tvb_captured_length_remaining(tvb, 0), ENC_NA);
}
/*
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 0143d84637..d93898ea91 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -902,7 +902,7 @@ dissect_ftpdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_add_fstr(pinfo->cinfo, COL_INFO, "FTP Data: %u bytes",
tvb_reported_length(tvb));
- data_length = tvb_length(tvb);
+ data_length = tvb_captured_length(tvb);
ti = proto_tree_add_item(tree, proto_ftp_data, tvb, 0, -1, ENC_NA);
diff --git a/epan/dissectors/packet-gadu-gadu.c b/epan/dissectors/packet-gadu-gadu.c
index 4c9c4ae265..103651d308 100644
--- a/epan/dissectors/packet-gadu-gadu.c
+++ b/epan/dissectors/packet-gadu-gadu.c
@@ -590,7 +590,7 @@ gadu_gadu_strsize(tvbuff_t *tvb, const gint abs_offset)
nul_offset = tvb_find_guint8(tvb, abs_offset, -1, 0);
if (nul_offset == -1)
- nul_offset = tvb_length(tvb) - 1;
+ nul_offset = tvb_captured_length(tvb) - 1;
return (nul_offset - abs_offset) + 1;
}
@@ -1973,7 +1973,7 @@ dissect_gadu_gadu_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
proto_tree_add_item(gadu_gadu_tree, &hfi_gadu_gadu_data, tvb, offset, -1, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -1998,7 +1998,7 @@ dissect_gadu_gadu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
col_clear(pinfo->cinfo, COL_INFO);
tcp_dissect_pdus(tvb, pinfo, tree, gadu_gadu_desegment, 8, get_gadu_gadu_pdu_len, dissect_gadu_gadu_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-gdsdb.c b/epan/dissectors/packet-gdsdb.c
index 4ad2f4468f..7f982f15b6 100644
--- a/epan/dissectors/packet-gdsdb.c
+++ b/epan/dissectors/packet-gdsdb.c
@@ -423,7 +423,7 @@ gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_item *ti;
proto_tree *pref_tree;
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
col_append_str(pinfo->cinfo, COL_INFO, ": ");
@@ -481,7 +481,7 @@ gdsdb_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -489,7 +489,7 @@ gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -502,7 +502,7 @@ gdsdb_accept(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/*offset += 4;*/
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -510,7 +510,7 @@ gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
if (tree) {
@@ -525,7 +525,7 @@ gdsdb_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 8, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -534,7 +534,7 @@ gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
int offset;
int length;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
@@ -557,7 +557,7 @@ gdsdb_attach(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
length, "%i data bytes", length);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -565,7 +565,7 @@ gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
if (tree) {
@@ -577,7 +577,7 @@ gdsdb_compile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 4, ENC_ASCII|ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -585,7 +585,7 @@ gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
if (tree) {
@@ -615,7 +615,7 @@ gdsdb_receive(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -623,7 +623,7 @@ gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
if (tree) {
@@ -644,7 +644,7 @@ gdsdb_send(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 4, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -653,7 +653,7 @@ gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
int offset;
int length;
- if (tvb_length(tvb) < 32) {
+ if (tvb_captured_length(tvb) < 32) {
return 0;
}
if (tree) {
@@ -669,10 +669,10 @@ gdsdb_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
length = tvb_get_ntohl(tvb, offset);
offset += length + 4;
proto_tree_add_item(tree, hf_gdsdb_response_status, tvb,
- offset, tvb_length(tvb) - offset, ENC_NA);
+ offset, tvb_captured_length(tvb) - offset, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -681,7 +681,7 @@ gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
if (tree) {
@@ -693,7 +693,7 @@ gdsdb_transact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 4, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -701,7 +701,7 @@ gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 8) {
+ if (tvb_captured_length(tvb) < 8) {
return 0;
}
if (tree) {
@@ -710,7 +710,7 @@ gdsdb_transact_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
tvb, offset, 4, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -735,7 +735,7 @@ gdsdb_open_blob2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
8, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -743,7 +743,7 @@ gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
int offset;
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -755,7 +755,7 @@ gdsdb_open_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
8, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -763,7 +763,7 @@ gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -772,7 +772,7 @@ gdsdb_segment(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_segment_segment */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -780,7 +780,7 @@ gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -788,7 +788,7 @@ gdsdb_seek_blob(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_seekblob_mode */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -796,14 +796,14 @@ gdsdb_reconnect(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
/* hf_gdsdb_reconnect_database */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -813,7 +813,7 @@ gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
int length;
guint opcode;
- if (tvb_length(tvb) < 20) {
+ if (tvb_captured_length(tvb) < 20) {
return 0;
}
@@ -837,7 +837,7 @@ gdsdb_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 4, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -845,7 +845,7 @@ gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -855,7 +855,7 @@ gdsdb_service_start(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_info_buffer_length */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -863,14 +863,14 @@ gdsdb_release(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 8) {
+ if (tvb_captured_length(tvb) < 8) {
return 0;
}
if (tree) {
/* hf_gdsdb_release_object */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
#if 0
@@ -879,14 +879,14 @@ gdsdb_prepare2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
/* hf_gdsdb_prepare2_transaction */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
#endif
@@ -895,7 +895,7 @@ gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 24) {
+ if (tvb_captured_length(tvb) < 24) {
return 0;
}
if (tree) {
@@ -905,7 +905,7 @@ gdsdb_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_event_arg */
/* hf_gdsdb_event_rid */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -913,14 +913,14 @@ gdsdb_cancel_events(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
/* hf_gdsdb_event_database */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -928,7 +928,7 @@ gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -937,7 +937,7 @@ gdsdb_ddl(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_ddl_blr */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -945,7 +945,7 @@ gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 24) {
+ if (tvb_captured_length(tvb) < 24) {
return 0;
}
if (tree) {
@@ -955,7 +955,7 @@ gdsdb_slice(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_slice_parameters */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -963,14 +963,14 @@ gdsdb_slice_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 8) {
+ if (tvb_captured_length(tvb) < 8) {
return 0;
}
if (tree) {
/* hf_gdsdb_sliceresponse_length */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -978,7 +978,7 @@ gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
@@ -988,7 +988,7 @@ gdsdb_execute(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_execute_messages */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -996,7 +996,7 @@ gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 44) {
+ if (tvb_captured_length(tvb) < 44) {
return 0;
}
if (tree) {
@@ -1007,7 +1007,7 @@ gdsdb_exec_immediate2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_prepare2_outmsgnr */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1016,7 +1016,7 @@ gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
int offset;
int length;
- if (tvb_length(tvb) < 32) {
+ if (tvb_captured_length(tvb) < 32) {
return 0;
}
col_append_str(pinfo->cinfo, COL_INFO, ": ");
@@ -1047,7 +1047,7 @@ gdsdb_prepare(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
offset, 2, ENC_BIG_ENDIAN);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1055,7 +1055,7 @@ gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -1064,7 +1064,7 @@ gdsdb_fetch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_fetch_messages */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1072,7 +1072,7 @@ gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
@@ -1080,7 +1080,7 @@ gdsdb_fetch_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_fetchresponse_messages */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1088,7 +1088,7 @@ gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 12) {
+ if (tvb_captured_length(tvb) < 12) {
return 0;
}
if (tree) {
@@ -1096,7 +1096,7 @@ gdsdb_free_statement(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_free_option */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1104,7 +1104,7 @@ gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -1113,7 +1113,7 @@ gdsdb_insert(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_insert_messages */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1121,7 +1121,7 @@ gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 16) {
+ if (tvb_captured_length(tvb) < 16) {
return 0;
}
if (tree) {
@@ -1129,7 +1129,7 @@ gdsdb_cursor(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
/* hf_gdsdb_cursor_type */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1137,14 +1137,14 @@ gdsdb_sql_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
{
/* int offset; */
- if (tvb_length(tvb) < 8) {
+ if (tvb_captured_length(tvb) < 8) {
return 0;
}
if (tree) {
/* hf_gdsdb_sqlresponse_messages */
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int (*gdsdb_handle_opcode[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) = {
@@ -1248,7 +1248,7 @@ dissect_gdsdb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
gdsdb_tree = NULL; /* So the opcode functions can check on if(tree) */
nopi.cinfo = NULL;
- if (tvb_length(tvb) < 4)
+ if (tvb_captured_length(tvb) < 4)
return 0;
opcode = tvb_get_ntohl(tvb, 0);
diff --git a/epan/dissectors/packet-gearman.c b/epan/dissectors/packet-gearman.c
index cb7004e470..bf6c3cdee8 100644
--- a/epan/dissectors/packet-gearman.c
+++ b/epan/dissectors/packet-gearman.c
@@ -415,7 +415,7 @@ dissect_binary_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
}
col_set_fence(pinfo->cinfo, COL_INFO);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static void
@@ -480,7 +480,7 @@ dissect_gearman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
dissect_management_packet(tvb, pinfo, tree);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-ged125.c b/epan/dissectors/packet-ged125.c
index aeb8de407a..2ebb40babd 100644
--- a/epan/dissectors/packet-ged125.c
+++ b/epan/dissectors/packet-ged125.c
@@ -1234,7 +1234,7 @@ dissect_ged125_base_messages(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree
proto_tree_add_item(ged125_message_tree, hf_ged125_CallID, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
floating_fields(tvb, pinfo, ged125_tree, offset, size);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
case GED125_ROUTE_SELECT_VALUE:
proto_tree_add_item(ged125_message_tree, hf_ged125_CrossRefID, tvb, offset, 4, ENC_BIG_ENDIAN);
@@ -1280,7 +1280,7 @@ dissect_ged125_base_messages(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree
}
proto_item_set_len(message_item, offset-8);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -1289,7 +1289,7 @@ dissect_ged125(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
gint size;
guint32 message_type;
- size = tvb_length(tvb);
+ size = tvb_captured_length(tvb);
if (size < 12)
return 0;
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index dc24268af1..d8324852c9 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -4747,7 +4747,7 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
payload_tvb = tvb_new_subset_remaining (tvb, GIOP_HEADER_SIZE);
call_dissector(data_handle, payload_tvb, pinfo, tree);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
switch (header.GIOP_version.minor)
@@ -4797,7 +4797,7 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
{
gint rem_len;
- rem_len = tvb_length_remaining(tvb, GIOP_HEADER_SIZE);
+ rem_len = tvb_captured_length_remaining(tvb, GIOP_HEADER_SIZE);
if (rem_len <= 0)
return 8;
@@ -4863,7 +4863,7 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree
break;
} /* switch message_type */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static guint
@@ -4910,12 +4910,12 @@ dissect_giop_tcp (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void*
if (!dissect_ziop_heur(tvb, pinfo, tree, NULL))
return 0;
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
tcp_dissect_pdus(tvb, pinfo, tree, giop_desegment, GIOP_HEADER_SIZE,
get_giop_pdu_len, dissect_giop_common, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static gboolean
@@ -4928,7 +4928,7 @@ dissect_giop_heur (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void
/*define END_OF_GIOP_MESSAGE (offset - first_offset - GIOP_HEADER_SIZE) */
- tot_len = tvb_length(tvb);
+ tot_len = tvb_captured_length(tvb);
if (tot_len < GIOP_HEADER_SIZE) /* tot_len < 12 */
{
diff --git a/epan/dissectors/packet-git.c b/epan/dissectors/packet-git.c
index 9158900676..9f22960151 100644
--- a/epan/dissectors/packet-git.c
+++ b/epan/dissectors/packet-git.c
@@ -111,7 +111,7 @@ dissect_git_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
plen-4, ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
static int
@@ -119,7 +119,7 @@ dissect_git(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
tcp_dissect_pdus(tvb, pinfo, tree, git_desegment, 4, get_git_pdu_len,
dissect_git_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-glbp.c b/epan/dissectors/packet-glbp.c
index c3db1019e6..a3338ebfd9 100644
--- a/epan/dissectors/packet-glbp.c
+++ b/epan/dissectors/packet-glbp.c
@@ -329,7 +329,7 @@ dissect_glbp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset += 2;
proto_tree_add_item(glbp_tree, hf_glbp_ownerid, tvb, offset, 6, ENC_NA);
offset += 6;
- while (tvb_length_remaining(tvb, offset) > 0) {
+ while (tvb_captured_length_remaining(tvb, offset) > 0) {
type = tvb_get_guint8(tvb, offset);
length = tvb_get_guint8(tvb, offset+1);
@@ -382,7 +382,7 @@ static gboolean
test_glbp(tvbuff_t *tvb, packet_info *pinfo)
{
guint32 unknown1;
- if ( tvb_length(tvb) < 2)
+ if ( tvb_captured_length(tvb) < 2)
return FALSE;
unknown1 = tvb_get_guint8(tvb, 1);
if (tvb_get_guint8(tvb, 0) != 1 /* version? */
diff --git a/epan/dissectors/packet-gmhdr.c b/epan/dissectors/packet-gmhdr.c
index 018defa87e..bf07ffd282 100644
--- a/epan/dissectors/packet-gmhdr.c
+++ b/epan/dissectors/packet-gmhdr.c
@@ -254,7 +254,7 @@ dissect_gmhdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
is_802_2 = TRUE;
/* Don't throw an exception for this check (even a BoundsError) */
- if (tvb_length_remaining(tvb, offset) >= 2) {
+ if (tvb_captured_length_remaining(tvb, offset) >= 2) {
if (tvb_get_ntohs(tvb, offset) == 0xffff) {
is_802_2 = FALSE;
}
@@ -294,7 +294,7 @@ dissect_gmtimestamp_trailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t
/* See if this packet has a Gigamon trailer, if yes, then decode it */
/* (Don't throw any exceptions while checking for the trailer). */
- tvblen = tvb_length(tvb); /* end+1 */
+ tvblen = tvb_captured_length(tvb); /* end+1 */
if (tvblen < trailer_len)
return 0;
@@ -343,7 +343,7 @@ dissect_gmtrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void
/* See if this packet has a Gigamon trailer, if yes, then decode it */
/* (Don't throw any exceptions while checking for the trailer). */
- tvblen = tvb_length(tvb); /* end+1 */
+ tvblen = tvb_captured_length(tvb); /* end+1 */
if (tvblen < 5)
return 0;
extra_trailer = 0;
diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c
index d613e80b46..65aeb48b3c 100644
--- a/epan/dissectors/packet-gmr1_bcch.c
+++ b/epan/dissectors/packet-gmr1_bcch.c
@@ -1042,7 +1042,7 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
);
bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch);
- csnStreamInit(&ar, 0, tvb_length(tvb)*8);
+ csnStreamInit(&ar, 0, tvb_captured_length(tvb)*8);
/* SI1 or SI2 */
if (is_si1) {
diff --git a/epan/dissectors/packet-gmr1_dtap.c b/epan/dissectors/packet-gmr1_dtap.c
index f80395743c..cdc2ddc9bb 100644
--- a/epan/dissectors/packet-gmr1_dtap.c
+++ b/epan/dissectors/packet-gmr1_dtap.c
@@ -62,7 +62,7 @@ dissect_gmr1_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
guint8 pd;
/* Scan init */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
offset = 0;
/* Protocol descriptor */
diff --git a/epan/dissectors/packet-gmr1_rach.c b/epan/dissectors/packet-gmr1_rach.c
index 390d5013d0..6afaae680e 100644
--- a/epan/dissectors/packet-gmr1_rach.c
+++ b/epan/dissectors/packet-gmr1_rach.c
@@ -512,7 +512,7 @@ dissect_gmr1_rach(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *rach_tree = NULL, *kls1_tree = NULL, *kls2_tree = NULL;
int len, is_moc;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
rach_item = proto_tree_add_protocol_format(
tree, proto_gmr1_rach, tvb, 0, len,
diff --git a/epan/dissectors/packet-gmr1_rr.c b/epan/dissectors/packet-gmr1_rr.c
index 53376af02a..a9885c0119 100644
--- a/epan/dissectors/packet-gmr1_rr.c
+++ b/epan/dissectors/packet-gmr1_rr.c
@@ -1802,7 +1802,7 @@ dissect_gmr1_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint ti = -1;
/* Scan init */
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
offset = 0;
/* Safety */
diff --git a/epan/dissectors/packet-gnutella.c b/epan/dissectors/packet-gnutella.c
index 490e58e077..8d48599481 100644
--- a/epan/dissectors/packet-gnutella.c
+++ b/epan/dissectors/packet-gnutella.c
@@ -508,7 +508,7 @@ static int dissect_gnutella_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
}
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -555,13 +555,13 @@ static int dissect_gnutella(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
-1,
ENC_NA);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
}
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, GNUTELLA_HEADER_SIZE_OFFSET+4,
get_gnutella_pdu_len, dissect_gnutella_pdu, data);
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void proto_register_gnutella(void) {
diff --git a/epan/dissectors/packet-goose.c b/epan/dissectors/packet-goose.c
index 8f922f8f79..a1d4eb20d1 100644
--- a/epan/dissectors/packet-goose.c
+++ b/epan/dissectors/packet-goose.c
@@ -483,7 +483,7 @@ dissect_goose_UtcTime(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
nstime_t ts;
gchar * ptime;
- len = tvb_length_remaining(tvb, offset);
+ len = tvb_captured_length_remaining(tvb, offset);
if(len != 8)
{
diff --git a/epan/dissectors/packet-gopher.c b/epan/dissectors/packet-gopher.c
index d6001bbe9c..69e00c5672 100644
--- a/epan/dissectors/packet-gopher.c
+++ b/epan/dissectors/packet-gopher.c
@@ -98,7 +98,7 @@ static gboolean
find_dir_tokens(tvbuff_t *tvb, gint name_start, gint *sel_start, gint *host_start, gint *port_start, gint *line_len, gint *next_offset) {
gint remain;
- if (tvb_length_remaining(tvb, name_start) < MIN_DIR_LINE_LEN)
+ if (tvb_captured_length_remaining(tvb, name_start) < MIN_DIR_LINE_LEN)
return FALSE;
if (! (sel_start && host_start && port_start && line_len && next_offset) )
@@ -199,7 +199,7 @@ dissect_gopher(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
}
/* Return the amount of data this dissector was able to dissect */
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
/* Preference callbacks */
diff --git a/epan/dissectors/packet-gprs-llc.c b/epan/dissectors/packet-gprs-llc.c
index a6ce57bc31..cef0e19f12 100644
--- a/epan/dissectors/packet-gprs-llc.c
+++ b/epan/dissectors/packet-gprs-llc.c
@@ -513,12 +513,12 @@ dissect_llcgprs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
frame_format = (ctrl_fld_fb < 0xe0 )? UI_FORMAT : U_FORMAT;
}
length = tvb_reported_length(tvb);
- llc_data_length = tvb_length(tvb);
+ llc_data_length = tvb_captured_length(tvb);
if(llc_data_length==length){
llc_data_length = length - CRC_LENGTH;
}
llc_data_reported_length = length - CRC_LENGTH; /* llc_data_reported_length includes the header and the payload */
- if (tvb_length(tvb) >= length && length >= CRC_LENGTH)
+ if (tvb_captured_length(tvb) >= length && length >= CRC_LENGTH)
{
/*
* We have all the packet data, including the full FCS,
diff --git a/epan/dissectors/packet-gre.c b/epan/dissectors/packet-gre.c
index 44fbcab4f0..e591e2496b 100644
--- a/epan/dissectors/packet-gre.c
+++ b/epan/dissectors/packet-gre.c
@@ -409,7 +409,7 @@ dissect_gre(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
it_checksum = proto_tree_add_item(gre_tree, hf_gre_checksum, tvb, offset, 2, ENC_BIG_ENDIAN);
/* Checksum check !... */
cksum = tvb_get_ntohs(tvb, offset);
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
reported_length = tvb_reported_length(tvb);
/* The Checksum Present bit is set, and the packet isn't part of a
fragmented datagram and isn't truncated, so we can checksum it. */
diff --git a/epan/dissectors/packet-gsm_a_bssmap.c b/epan/dissectors/packet-gsm_a_bssmap.c
index 284d7a2e9d..8e15776e84 100644
--- a/epan/dissectors/packet-gsm_a_bssmap.c
+++ b/epan/dissectors/packet-gsm_a_bssmap.c
@@ -2964,7 +2964,7 @@ bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pin
g_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
be_field_element_dissect(tvb, tree, pinfo, 0, len, NULL, 0);
g_tree = NULL;
@@ -3387,7 +3387,7 @@ bssmap_new_bss_to_old_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pin
g_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
be_field_element_dissect(tvb, tree, pinfo, 0, len, NULL, 0);
g_tree = NULL;
@@ -7279,7 +7279,7 @@ dissect_bssmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
g_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/*
* add BSSMAP message name
diff --git a/epan/dissectors/packet-gsm_a_dtap.c b/epan/dissectors/packet-gsm_a_dtap.c
index ac9e91e4e5..8373c9e673 100644
--- a/epan/dissectors/packet-gsm_a_dtap.c
+++ b/epan/dissectors/packet-gsm_a_dtap.c
@@ -5908,7 +5908,7 @@ dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gboolean nsd;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len < 2)
{
diff --git a/epan/dissectors/packet-gsm_a_rp.c b/epan/dissectors/packet-gsm_a_rp.c
index 2dcf3ae2c6..b783cb06aa 100644
--- a/epan/dissectors/packet-gsm_a_rp.c
+++ b/epan/dissectors/packet-gsm_a_rp.c
@@ -455,7 +455,7 @@ dissect_rp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
g_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/*
* add RP message name
diff --git a/epan/dissectors/packet-gsm_a_rr.c b/epan/dissectors/packet-gsm_a_rr.c
index 16434a4d39..3089568a51 100644
--- a/epan/dissectors/packet-gsm_a_rr.c
+++ b/epan/dissectors/packet-gsm_a_rr.c
@@ -3404,7 +3404,7 @@ de_rr_ia_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, gu
gint bit_offset;
gint length;
guint64 ma_length;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -3495,7 +3495,7 @@ de_rr_iar_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, g
{
guint32 curr_bit_offset;
guint8 i;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
curr_bit_offset = offset<<3;
@@ -3523,7 +3523,7 @@ static guint16
de_rr_iax_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
{
guint32 curr_bit_offset;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
curr_bit_offset = offset<<3;
@@ -3980,7 +3980,7 @@ de_rr_p1_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, gu
proto_item *item2;
guint32 curr_offset, value;
gint bit_offset, bit_offset_sav;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -4046,7 +4046,7 @@ de_rr_p2_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, gu
proto_item *item2;
guint32 curr_offset;
gint bit_offset;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -4107,7 +4107,7 @@ de_rr_p3_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, gu
proto_item *item2;
guint32 curr_offset;
gint bit_offset;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -4596,7 +4596,7 @@ de_rr_si1_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, g
{
guint32 curr_offset;
gint bit_offset;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
curr_offset = offset;
bit_offset = curr_offset << 3;
@@ -4710,7 +4710,7 @@ de_rr_si2ter_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_
proto_item *item2;
guint32 curr_offset;
gint bit_offset, bit_offset_sav;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -6441,7 +6441,7 @@ de_rr_si2quater_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo
guint32 curr_offset;
gint bit_offset, bit_offset_sav, idx;
guint8 value;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -6914,7 +6914,7 @@ de_rr_si3_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, g
guint32 curr_offset;
gint bit_offset;
gboolean gprs_indicator;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
curr_offset = offset;
bit_offset = curr_offset << 3;
@@ -6989,7 +6989,7 @@ de_rr_si4_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, g
proto_item *item2, *item3;
guint32 curr_offset;
gint bit_offset, bit_offset_sav;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -7131,7 +7131,7 @@ de_rr_si6_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_, g
guint32 curr_offset;
gint bit_offset, bit_offset_sav;
guint8 value;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
curr_offset = offset;
bit_offset = curr_offset << 3;
@@ -7606,7 +7606,7 @@ de_rr_si13_rest_oct(tvbuff_t *tvb, proto_tree *subtree, packet_info *pinfo _U_,
proto_tree *subtree2;
proto_item *item2;
guint bit_offset, bit_offset_sav;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
bit_offset = offset << 3;
@@ -9195,7 +9195,7 @@ dtap_rr_imm_ass(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guint32
/* 7C Starting Time 10.5.2.38 O TV 3 */
ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
/* IA Rest Octets 10.5.2.16 M V 0-11 */
- if(tvb_length_remaining(tvb,curr_offset) > 0)
+ if(tvb_captured_length_remaining(tvb,curr_offset) > 0)
ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IA_REST_OCT, NULL);
}
@@ -9234,7 +9234,7 @@ dtap_rr_imm_ass_ext(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, gui
/* 7C Starting Time 10.5.2.38 O TV 3 */
ELEM_OPT_TV(0x7C,GSM_A_PDU_TYPE_RR, DE_RR_STARTING_TIME, NULL);
/* IAX Rest Octets 10.5.2.18 M V 0-4 */
- if(tvb_length_remaining(tvb,curr_offset) > 0)
+ if(tvb_captured_length_remaining(tvb,curr_offset) > 0)
ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAX_REST_OCT, NULL);
}
@@ -9273,7 +9273,7 @@ dtap_rr_imm_ass_rej(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, gui
/* Wait Indication 4 Wait Indication 10.5.2.43 M V 1 */
ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_WAIT_IND, " - Wait Indication 4");
/* IAR Rest Octets 10.5.2.19 M V 3 */
- if(tvb_length_remaining(tvb,curr_offset) > 0)
+ if(tvb_captured_length_remaining(tvb,curr_offset) > 0)
ELEM_MAND_V(GSM_A_PDU_TYPE_RR, DE_RR_IAR_REST_OCT, NULL);
}
@@ -9892,7 +9892,7 @@ sacch_rr_meas_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, guin
guint32 curr_offset;
gint bit_offset, bit_offset_sav, bit_offset_sav2;
guint8 value, idx;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
curr_offset = offset;
@@ -10243,7 +10243,7 @@ sacch_rr_enh_meas_report(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_
proto_item *item;
guint32 curr_offset;
guint bit_offset, bit_offset_sav;
- guint8 tvb_len = tvb_length(tvb);
+ guint8 tvb_len = tvb_captured_length(tvb);
guint16 bit_len = tvb_len << 3;
guint8 idx;
@@ -10489,7 +10489,7 @@ dissect_ccch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
int hf_idx;
gboolean nsd;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
if (len < 3){
/*
@@ -10718,7 +10718,7 @@ dissect_sacch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint ett_tree;
int hf_idx;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_INFO, "(SACCH) ");
diff --git a/epan/dissectors/packet-gsm_bsslap.c b/epan/dissectors/packet-gsm_bsslap.c
index 4f4a0ec60c..bfa5b389dd 100644
--- a/epan/dissectors/packet-gsm_bsslap.c
+++ b/epan/dissectors/packet-gsm_bsslap.c
@@ -563,7 +563,7 @@ dissect_gsm_bsslap_ta_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, i
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Cell Identity IE / 5.4 M TV 3 */
ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY, GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, "Serving Cell Identity");
@@ -592,7 +592,7 @@ dissect_gsm_bsslap_reject(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, i
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Cause IE / 5.14 M TV 2 */
ELEM_MAND_TV(BSSLAP_PARAM_CAUSE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CAUSE,NULL);
@@ -609,7 +609,7 @@ dissect_gsm_bsslap_reset(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, in
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Cell Identity IE / 5.4 M TV 3 */
ELEM_MAND_TV(BSSLAP_PARAM_CELL_IDENTITY, GSM_A_PDU_TYPE_COMMON, DE_CELL_ID, NULL);
@@ -657,7 +657,7 @@ dissect_gsm_bsslap_abort(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, in
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Cause IE / 5.14 M TV 2 */
ELEM_MAND_TV(BSSLAP_PARAM_CAUSE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_CAUSE,NULL);
@@ -673,7 +673,7 @@ dissect_gsm_bsslap_ta_layer3(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Timing Advance IE / 5.2 M TV 2 */
ELEM_MAND_TV(BSSLAP_PARAM_TIMING_ADVANCE, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_TA, NULL);
@@ -694,7 +694,7 @@ dissect_gsm_bsslap_ms_pos_cmd(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* RRLP flag IE / 5.15 M TV 2 */
ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_FLG,"flag");
@@ -711,7 +711,7 @@ dissect_gsm_bsslap_ms_pos_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* flag RRLP flag IE / 5.15 M TV 2 */
ELEM_MAND_TV(BSSLAP_PARAM_RRLP_FLAG, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_RRLP_FLG,"flag");
@@ -736,7 +736,7 @@ dissect_gsm_bsslap_u_tdoa_req(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Delta Timer IE 5.22 O (note 1) TV 2 */
ELEM_OPT_TV(BSSLAP_PARAM_DELTA_TIMER, GSM_A_PDU_TYPE_BSSLAP, DE_BLAP_DELTA_TIME, NULL);
@@ -754,7 +754,7 @@ dissect_gsm_bsslap_u_tdoa_res(tvbuff_t *tvb, proto_tree *tree, packet_info *pinf
guint curr_len;
curr_offset = offset;
- curr_len = tvb_length_remaining(tvb,offset);
+ curr_len = tvb_captured_length_remaining(tvb,offset);
/* Channel Description IE 5.8 M TV 4 */
ELEM_MAND_TV(BSSLAP_PARAM_CHANNEL_DESCRIPTION,GSM_A_PDU_TYPE_RR, DE_RR_CH_DSC, NULL);
diff --git a/epan/dissectors/packet-gsm_bssmap_le.c b/epan/dissectors/packet-gsm_bssmap_le.c
index 9aa587bd21..7da537d860 100644
--- a/epan/dissectors/packet-gsm_bssmap_le.c
+++ b/epan/dissectors/packet-gsm_bssmap_le.c
@@ -938,7 +938,7 @@ dissect_bssmap_le(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
g_tree = tree;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
/*
* add BSSMAP message name
diff --git a/epan/dissectors/packet-gsm_cbch.c b/epan/dissectors/packet-gsm_cbch.c
index f610ac7a0f..88b56f764a 100644
--- a/epan/dissectors/packet-gsm_cbch.c
+++ b/epan/dissectors/packet-gsm_cbch.c
@@ -135,7 +135,7 @@ dissect_schedule_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *top_tree
proto_item *item = NULL, *schedule_item = NULL;
proto_tree *sched_tree = NULL, *sched_subtree = NULL;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
col_append_str(pinfo->cinfo, COL_INFO, " CBCH Schedule Message ");
@@ -365,7 +365,7 @@ dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *cbch_tree = NULL;
tvbuff_t *reass_tvb = NULL, *msg_tvb = NULL;
- len = tvb_length(tvb);
+ len = tvb_captured_length(tvb);
offset = 0;
octet = tvb_get_guint8(tvb, offset);
diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c
index 84580d8191..4a9cf93a10 100644
--- a/epan/dissectors/packet-gsm_map.c
+++ b/epan/dissectors/packet-gsm_map.c
@@ -2744,7 +2744,7 @@ unpack_digits(tvbuff_t *tvb, int offset) {
int i=0;
char *digit_str;
- length = tvb_length(tvb);
+ length = tvb_captured_length(tvb);
if (length < offset)
return "";
digit_str = (char *)wmem_alloc(wmem_packet_scope(), (length - offset)*2+1);
@@ -3248,7 +3248,7 @@ dissect_gsm_map_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(tree, hf_gsm_map_nature_of_number, tvb, 0,1,ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_gsm_map_number_plan, tvb, 0,1,ENC_BIG_ENDIAN);
- if(tvb_length(tvb)==1)
+ if(tvb_captured_length(tvb)==1)
return;
digit_str = unpack_digits(tvb, 1);
@@ -3349,7 +3349,7 @@ dissect_gsm_map_T_extType(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offs
offset=call_ber_oid_callback(obj_id, tvb, offset, actx->pinfo, tree, NULL);
}else{
call_dissector(data_handle, tvb, actx->pinfo, tree);
- offset = tvb_length_remaining(tvb,offset);
+ offset = tvb_captured_length_remaining(tvb,offset);
}
@@ -3468,7 +3468,7 @@ dissect_gsm_map_TBCD_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
if (!parameter_tvb)
return offset;
- if(tvb_length(parameter_tvb)==0)
+ if(tvb_captured_length(parameter_tvb)==0)
return offset;
digit_str = unpack_digits(parameter_tvb, 0);
@@ -3820,10 +3820,10 @@ dissect_gsm_map_GSN_Address(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of
octet = tvb_get_guint8(parameter_tvb,0);
switch(octet){
case 0x04: /* IPv4 */
- proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN);
+ proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_captured_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN);
break;
case 0x50: /* IPv4 */
- proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN);
+ proto_tree_add_item(subtree, hf_gsm_map_GSNAddress_IPv4, parameter_tvb, 1, tvb_captured_length_remaining(parameter_tvb, 1), ENC_BIG_ENDIAN);
break;
default:
break;
@@ -3966,7 +3966,7 @@ dissect_gsm_map_GlobalCellId(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int o
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_GlobalCellId);
- be_cell_id_aux(parameter_tvb, subtree, actx->pinfo, 0, tvb_length_remaining(tvb,0), NULL, 0, 0);
+ be_cell_id_aux(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length_remaining(tvb,0), NULL, 0, 0);
@@ -8823,7 +8823,7 @@ dissect_gsm_map_ms_APN(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
if (!parameter_tvb)
return offset;
- length = tvb_length(parameter_tvb);
+ length = tvb_captured_length(parameter_tvb);
name_len = tvb_get_guint8(parameter_tvb, 0);
apn_str = tvb_get_string_enc(wmem_packet_scope(), parameter_tvb, 1, length - 1, ENC_ASCII|ENC_NA);
if (name_len < length-1) {
@@ -9182,7 +9182,7 @@ dissect_gsm_map_ms_RadioResourceInformation(gboolean implicit_tag _U_, tvbuff_t
return offset;
subtree = proto_item_add_subtree(actx->created_item, ett_gsm_map_RadioResourceInformation);
- be_chan_type(parameter_tvb, subtree, actx->pinfo, 0, tvb_length_remaining(tvb,0), NULL, 0);
+ be_chan_type(parameter_tvb, subtree, actx->pinfo, 0, tvb_captured_length_remaining(tvb,0), NULL, 0);
@@ -21189,7 +21189,7 @@ static int dissect_invokeData(proto_tree *tree, tvbuff_t *tvb, int offset, asn1_
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown invokeData %d", opcode);
}
- offset+= tvb_length_remaining(tvb,offset);
+ offset+= tvb_captured_length_remaining(tvb,offset);
break;
}
return offset;
@@ -21499,7 +21499,7 @@ static int dissect_returnResultData(proto_tree *tree, tvbuff_t *tvb, int offset,
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown returnResultData %d", opcode);
}
- offset+= tvb_length_remaining(tvb,offset);
+ offset+= tvb_captured_length_remaining(tvb,offset);
break;
}
return offset;
@@ -21662,7 +21662,7 @@ static int dissect_returnErrorData(proto_tree *tree, tvbuff_t *tvb, int offset,
proto_tree_add_expert_format(tree, actx->pinfo, &ei_gsm_map_unknown_invokeData,
tvb, offset, -1, "Unknown returnErrorData %d", opcode);
}
- offset+= tvb_length_remaining(tvb,offset);
+ offset+= tvb_captured_length_remaining(tvb,offset);
break;
}
return offset;
@@ -22055,7 +22055,7 @@ dissect_gsm_map(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void
tap_queue_packet(gsm_map_tap, pinfo, &tap_rec);
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
const value_string ssCode_vals[] = {
diff --git a/epan/dissectors/packet-gsm_rlcmac.c b/epan/dissectors/packet-gsm_rlcmac.c
index 33be85e148..158e846a84 100644
--- a/epan/dissectors/packet-gsm_rlcmac.c
+++ b/epan/dissectors/packet-gsm_rlcmac.c
@@ -7405,7 +7405,7 @@ dissect_dl_gprs_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, RlcMa
proto_tree *rlcmac_tree = NULL;
csnStream_t ar;
gint bit_offset = 0;
- guint16 bit_length = tvb_length(tvb) * 8;
+ guint16 bit_length = tvb_captured_length(tvb) * 8;
guint8 payload_type = tvb_get_bits8(tvb, 0, 2);
guint8 rbsn = tvb_get_bits8(tvb, 8, 1);
@@ -7546,7 +7546,7 @@ dissect_egprs_dl_header_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree *rlcmac_tree;
csnStream_t ar;
- guint16 bit_length = tvb_length(tvb) * 8;
+ guint16 bit_length = tvb_captured_length(tvb) * 8;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC");
col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "EGPRS DL:HEADER");
@@ -7591,7 +7591,7 @@ dissect_ul_pacch_access_burst(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_item *ti;
proto_tree *rlcmac_tree;
csnStream_t ar;
- guint16 bit_length = tvb_length(tvb) * 8;
+ guint16 bit_length = tvb_captured_length(tvb) * 8;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC");
col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "PACCH ACCESS BURST");
@@ -7632,7 +7632,7 @@ dissect_ul_gprs_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, RlcMa
{
csnStream_t ar;
guint8 payload_type = tvb_get_bits8(tvb, 0, 2);
- guint16 bit_length = tvb_length(tvb) * 8;
+ guint16 bit_length = tvb_captured_length(tvb) * 8;
guint16 bit_offset = 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC");
@@ -7720,7 +7720,7 @@ dissect_egprs_ul_header_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre
proto_tree *rlcmac_tree;
csnStream_t ar;
guint16 bit_offset = 0;
- guint16 bit_length = tvb_length(tvb) * 8;
+ guint16 bit_length = tvb_captured_length(tvb) * 8;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "GSM RLC/MAC");
col_append_sep_str(pinfo->cinfo, COL_INFO, ":", "EGPRS UL:HEADER");
@@ -7809,7 +7809,7 @@ dissect_egprs_ul_data_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
/* dissect the data segments */
dissect_egprs_data_segments(tvb, pinfo, data_tree, offset,
- tvb_length(tvb), li_count, li_array);
+ tvb_captured_length(tvb), li_count, li_array);
}
else
{
@@ -7856,7 +7856,7 @@ dissect_egprs_dl_data_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
/* dissect the data segments */
dissect_egprs_data_segments(tvb, pinfo, data_tree, offset,
- tvb_length(tvb), li_count, li_array);
+ tvb_captured_length(tvb), li_count, li_array);
}
else
{
@@ -7912,7 +7912,7 @@ dissect_gsm_rlcmac_downlink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
@@ -7932,7 +7932,7 @@ dissect_gsm_rlcmac_uplink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
rlc_ul->block_format = rlc_mac->block_format;
rlc_ul->flags = rlc_mac->flags;
}
- else if (tvb_length(tvb) < 3)
+ else if (tvb_captured_length(tvb) < 3)
{
/* assume that little packets are PACCH */
rlc_ul->block_format = RLCMAC_PRACH;
@@ -7975,7 +7975,7 @@ dissect_gsm_rlcmac_uplink(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, v
break;
}
- return tvb_length(tvb);
+ return tvb_captured_length(tvb);
}
void
diff --git a/epan/dissectors/packet-gsm_sms.c b/epan/dissectors/packet-gsm_sms.c
index 82da3f05f7..1770960117 100644
--- a/epan/dissectors/packet-gsm_sms.c
+++ b/epan/dissectors/packet-gsm_sms.c
@@ -343,7 +343,7 @@ dis_field_addr(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p, const gchar *
addrlength = tvb_get_guint8(tvb, offset);
numdigocts = (addrlength + 1) / 2;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length <= numdigocts)
{
@@ -911,7 +911,7 @@ dis_field_scts(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p)
offset = *offset_p;
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 7)
{
@@ -960,7 +960,7 @@ dis_field_vp(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p, guint8 vp_form)
switch (vp_form)
{
case 1:
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 7)
{
@@ -1150,7 +1150,7 @@ dis_field_vp(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p, guint8 vp_form)
break;
case 3:
- length = tvb_length_remaining(tvb, offset);
+ length = tvb_captured_length_remaining(tvb, offset);
if (length < 7)
{
@@ -1199,7 +1199,7 @@ dis_field_dt(tvbuff_t *tvb, proto_tree *tree, guint32 *offset_p)